whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> /home/qbizpnmr/arif.umairtax.com/public/bundle.OlIVtvc7.js
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["Invoices-CS_QAVlV.js","Actions-qiDN9dzt.js","invoice-status-We6cAxTk.js","useInvoiceColumns-DQBbqJBN.js","InvoiceStatus-BkeECTVy.js","DataTableColumnsPicker-BAbL5ze4.js","ImportButton-CbAh905F.js","Import-Dp8FQZJ0.js","DeleteInvoicesConfirmationModal-DyAAUSpE.js","useDownloadPdfs-Dg_h5aER.js","payments-BhlrdSKU.js","atoms-BIyl7r8z.js","useSumTableColumn-CcUHRmLL.js","InvoiceSlider-C-0dW-62.js","PaymentStatus-z209A_tu.js","payment-status-DaLbqgbM.js","EmailRecord-DsIG6Q4V.js","CloudPlay-C_FtsbNl.js","History-C-yFGmPI.js","DataTableFooterColumnsPicker-Dt0X8Afq.js","Invoice-fo9g6ZUP.js","CommonActions-Cz0ckZtZ.js","hooks-DfuZBC_R.js","CreditStatus-Bi9XtGcq.js","useInvoiceUtilities-DqFLik2o.js","AddUninvoicedItemsButton-tU0BNzSr.js","Banner-D9Q__Gmd.js","PreviousNextNavigation-zAd8_mLU.js","Create-BswCht_1.js","blank-invitation-DyrJ7EfP.js","Edit-BbQ5p2pM.js","ClientSelector-Ba4kw69L.js","ClientActionButtons-DC8u7uNL.js","InvoiceFooter-BVOCef5h.js","useProductColumns-CRexQ0gt.js","InvoiceViewer-Dp83-peG.js","TasksTabLabel-Ba8gqxlc.js","Pdf-BcBfzZPt.js","Email-DgwYuWBO.js","Mailer-CZBmNGmG.js","EInvoice-BK9mHB8V.js","Payments-CTFwwaQt.js","PaymentSchedule-Bp7JKjaV.js","Settings-CxIjFxbV.js","DesignSelector-CCHne1Q2.js","designs-5HfLWi9D.js","Activities-02eZOrQ9.js","History-BaYBFn6z.js","arrow-right-8GGkoR_y.js","EmailHistory-CFfMbD8S.js","CreatePage-C54Itos9.js","Clients-0aUKK3zh.js","Client-Cf8uVe16.js","InfoCard-BvC2FhUQ.js","Client-CXR1jw51.js","Quotes-BSCxuM10.js","useFooterColumns-CmLgRl0v.js","Payments-D3eouJXN.js","usePaymentColumns-nJ_NJo1i.js","useActions-5wRXt2Qd.js","RecurringInvoices-n_C2kTCO.js","useFooterColumns-C38SmncW.js","Credits-DjUg5VJW.js","useCustomBulkActions-CpMgieVX.js","Projects-DOC3pXm1.js","hooks-CA_GHzwm.js","atoms-BexY8cYu.js","Tasks-B8IcUJ8H.js","useShowEditOption-Cod7cZDV.js","RecurringExpenses-DXFqT4ma.js","hooks-BCXySYSi.js","Invoices-Dm_Rk1Xs.js","HistoryAndActivities-CzNRIGqN.js","Documents-abT6JgfA.js","Product-BoK2fxfM.js","Products-CLEqnFtY.js","RecurringInvoices-BeDCrr3H.js","RecurringInvoiceSlider-CHmNRL8L.js","RecurringInvoice-igg8pX54.js","Create-CsyxMk-D.js","CreatePage-BbK_ECsx.js","InvoiceFooter-m_Ij8B2h.js","Settings-C8ZFeEQc.js","Activities-VYLXITv7.js","History-gPTKz-sT.js","Edit-Bvcn5Zrl.js","Pdf-Bd25Mael.js","Activities-KnS3vSlY.js","useGenerateActivityElement-6K_jcbzu.js","Payment-D_bOZN71.js","Payments-Go3Iq7p8.js","Create-DUbET5n7.js","usePaymentTypes-BHeQ2Qab.js","Edit-Cx1RH3iU.js","Documents-Jf-3UFZz.js","Apply-SWcSdrbd.js","Refund-omPLkxUg.js","InvoiceDesign-Co2ip6ft.js","atoms-a9Jv7fG_.js","GeneralSettings-BYdlonyH.js","hooks-Bs_0mVnU.js","Create-CV9qh_Sx.js","ClientDetails-GW1y93bc.js","SortableVariableList-BCj_4ydS.js","CompanyDetails-CmJclcbm.js","CompanyAddress-s1CM1mZr.js","InvoiceDetails-Bo2ITW3D.js","QuoteDetails-2N8o-obg.js","CreditDetails-Br-cOJhr.js","VendorDetails-CPbVKkGI.js","PurchaseOrderDetails-D4y37R3k.js","ProductColumns-CibzypHy.js","ProductQuoteColumns-B6NOeImC.js","TaskColumns-Dv9wbx98.js","TotalFields-ux6Q4zY5.js","CustomDesign-CMRjO40Q.js","react-resizable-panels.browser.esm-DGjypp5c.js","react-responsive-DfXP7Il0.js","Settings-5d6Om5mh.js","hooks-C7TEhFVH.js","Body-BVOOYmAn.js","Headers-Bkv7zEGp.js","Footer-ogxSWwfe.js","Includes-CSmiLJ7k.js","Quotes-DQ_Gl7fq.js","QuoteSlider-CSPN6fM1.js","queries-CezpVITq.js","Quote-DxxAxeIu.js","Edit-D5ioH2mG.js","QuoteFooter-CcFuEu5K.js","Create-D0uIYbj-.js","CreatePage-1PDJaG-E.js","Settings-1Ay9aNbP.js","Pdf-Cy0XAetx.js","Email-DPDlkcuH.js","Activities-jydPDPFe.js","History-B2Dyc6R5.js","EmailHistory-DdhcEylc.js","Credits-C5JMn-cJ.js","Create-09EHeIs2.js","queries-9gq31GPB.js","CreatePage-s96wMJ-f.js","CreditFooter-Zo_UCGyx.js","Credit-BdymPEOW.js","Edit-CAlVheER.js","Pdf-DW7FFV44.js","Email-D6QHSuWJ.js","Settings-OlnotiSt.js","History-Bzr58LOL.js","Projects-BIRKYSm_.js","Create-D0AqRvEB.js","Project-D3ynNitG.js","Edit-Dmi-Z8QS.js","Show-0pn6Bxo1.js","Tasks-BsV6YmvZ.js","hooks-XTagFAuk.js","TaskClock-SGIUUrSZ.js","Kanban-Bcat7y23.js","TaskDetails-DEMDYSXK.js","Create-D67Si1nl.js","Task-7PYsblHO.js","Edit-D_rqClT3.js","Vendors-C-AtIx4i.js","useActions-71aU1kti.js","Vendor-R3X2jQm6.js","PurchaseOrders-DOAskBTi.js","useCustomBulkActions-pxDoT7Fd.js","RecurringExpenses-D2N8qefm.js","Edit-Cm1CNDgF.js","Expenses-B_vOVEX8.js","Create-BWVPzaC4.js","Taxes-BQNCLIHb.js","PaymentTypeSelector-zG-cKKM-.js","useResolveCurrencySeparator-CdVnMd1X.js","Expense-CXyEITL2.js","Edit-C7p-wAJx.js","PurchaseOrders-DPz8OA_x.js","Edit-D5FK2Qrk.js","useHandleProductChange-DQ23MQg-.js","Email-O27V-Vmh.js","Pdf-C7c6ktvc.js","Create-Dftjwb5U.js","useCalculateInvoiceSum-CwW6HCi-.js","PurchaseOrder-B0x-V3rH.js","CreatePage-D3okxjPm.js","Settings-D-nOCXBv.js","History-D3RadbwT.js","EmailHistory-BeZt3ONR.js","Transactions-CBVXBvEO.js","transactions-D1VRhh84.js","useActions-DDfQicbY.js","Create-GSA3gFDe.js","useHandleChange-DTWQTWFW.js","Edit-_bQ8f5ua.js","RecurringExpense-CdnlwSSk.js","RecurringExpenses-C8hTH3pR.js","Create-DqQG7iLz.js","Taxes-CVFCWS61.js","Edit-CQ-G-xZd.js","Activity-n2nzd57b.js","en_US-Bu1-ttwh.js","interopRequireDefault-CdiRfGvq.js","common-DJie0JoD.js","it_IT-DvS6rGCq.js","de_DE-DdFweBhS.js","fr_FR-Dy6owzIT.js","pt_BR-C9TsgmKN.js","nl_NL-CX7d-5fc.js","es_ES-Bfjv5Ok-.js","nb_NO-DmxNxCwP.js","da_DK-zCv4o9u0.js","ja_JP-D00qwTWa.js","sv_SE-ChEtEsJQ.js","fr_CA-DEb8R9oZ.js","lt_LT-C3xS2hVI.js","pl_PL-CGPHAKi7.js","cs_CZ-Dwz6unpB.js","hr_HR-DSFX2ChI.js","el_GR-C--GkuXQ.js","en_GB-CcU4vPfu.js","pt_PT-Cx4IQlhJ.js","sl_SI-BPWKe95Z.js","fi_FI-BbG369FV.js","ro_RO-C-h-gwMb.js","tr_TR-DYnMuPT2.js","th_TH-fvI7rdhZ.js","mk_MK-DA4YMq95.js","zh_TW-C8OgIE63.js","ru_RU-5-Lg8K-z.js","ar_EG-Bq1mY9oU.js","fa_IR-DQWXhdUm.js","lv_LV-Dcs5Sm8e.js","sr_RS-C7t8eZRa.js","sk_SK-DxGGcu0I.js","et_EE-DbjN1_jc.js","bg_BG-CliAXSn5.js","he_IL-9QRboGVg.js","km_KH-B-zrXF72.js","hu_HU-h6cX-ZPG.js","javascript-D9_7haWm.js","typescript-BP6bbBm4.js"])))=>i.map(i=>d[i]); var n_t=Object.defineProperty;var i_t=(n,e,t)=>e in n?n_t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Xr=(n,e,t)=>i_t(n,typeof e!="symbol"?e+"":e,t);function fVe(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 s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(n,r,s.get?s:{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 s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();var hb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function $1e(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 hie={exports:{}},_5={},fie={exports:{}},mo={};/** * @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 dLe;function r_t(){if(dLe)return mo;dLe=1;var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator;function f(z){return z===null||typeof z!="object"?null:(z=d&&z[d]||z["@@iterator"],typeof z=="function"?z:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function _(z,Z,X){this.props=z,this.context=Z,this.refs=m,this.updater=X||p}_.prototype.isReactComponent={},_.prototype.setState=function(z,Z){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,Z,"setState")},_.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function v(){}v.prototype=_.prototype;function b(z,Z,X){this.props=z,this.context=Z,this.refs=m,this.updater=X||p}var y=b.prototype=new v;y.constructor=b,g(y,_.prototype),y.isPureReactComponent=!0;var C=Array.isArray,S=Object.prototype.hasOwnProperty,k={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function L(z,Z,X){var oe,fe={},Se=null,Me=null;if(Z!=null)for(oe in Z.ref!==void 0&&(Me=Z.ref),Z.key!==void 0&&(Se=""+Z.key),Z)S.call(Z,oe)&&!I.hasOwnProperty(oe)&&(fe[oe]=Z[oe]);var Ie=arguments.length-2;if(Ie===1)fe.children=X;else if(1<Ie){for(var ge=Array(Ie),ye=0;ye<Ie;ye++)ge[ye]=arguments[ye+2];fe.children=ge}if(z&&z.defaultProps)for(oe in Ie=z.defaultProps,Ie)fe[oe]===void 0&&(fe[oe]=Ie[oe]);return{$$typeof:n,type:z,key:Se,ref:Me,props:fe,_owner:k.current}}function N(z,Z){return{$$typeof:n,type:z.type,key:Z,ref:z.ref,props:z.props,_owner:z._owner}}function P(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function O(z){var Z={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(X){return Z[X]})}var F=/\/+/g;function V(z,Z){return typeof z=="object"&&z!==null&&z.key!=null?O(""+z.key):Z.toString(36)}function M(z,Z,X,oe,fe){var Se=typeof z;(Se==="undefined"||Se==="boolean")&&(z=null);var Me=!1;if(z===null)Me=!0;else switch(Se){case"string":case"number":Me=!0;break;case"object":switch(z.$$typeof){case n:case e:Me=!0}}if(Me)return Me=z,fe=fe(Me),z=oe===""?"."+V(Me,0):oe,C(fe)?(X="",z!=null&&(X=z.replace(F,"$&/")+"/"),M(fe,Z,X,"",function(ye){return ye})):fe!=null&&(P(fe)&&(fe=N(fe,X+(!fe.key||Me&&Me.key===fe.key?"":(""+fe.key).replace(F,"$&/")+"/")+z)),Z.push(fe)),1;if(Me=0,oe=oe===""?".":oe+":",C(z))for(var Ie=0;Ie<z.length;Ie++){Se=z[Ie];var ge=oe+V(Se,Ie);Me+=M(Se,Z,X,ge,fe)}else if(ge=f(z),typeof ge=="function")for(z=ge.call(z),Ie=0;!(Se=z.next()).done;)Se=Se.value,ge=oe+V(Se,Ie++),Me+=M(Se,Z,X,ge,fe);else if(Se==="object")throw Z=String(z),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return Me}function B(z,Z,X){if(z==null)return z;var oe=[],fe=0;return M(z,oe,"","",function(Se){return Z.call(X,Se,fe++)}),oe}function W(z){if(z._status===-1){var Z=z._result;Z=Z(),Z.then(function(X){(z._status===0||z._status===-1)&&(z._status=1,z._result=X)},function(X){(z._status===0||z._status===-1)&&(z._status=2,z._result=X)}),z._status===-1&&(z._status=0,z._result=Z)}if(z._status===1)return z._result.default;throw z._result}var q={current:null},U={transition:null},G={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:U,ReactCurrentOwner:k};function H(){throw Error("act(...) is not supported in production builds of React.")}return mo.Children={map:B,forEach:function(z,Z,X){B(z,function(){Z.apply(this,arguments)},X)},count:function(z){var Z=0;return B(z,function(){Z++}),Z},toArray:function(z){return B(z,function(Z){return Z})||[]},only:function(z){if(!P(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},mo.Component=_,mo.Fragment=t,mo.Profiler=r,mo.PureComponent=b,mo.StrictMode=i,mo.Suspense=l,mo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=G,mo.act=H,mo.cloneElement=function(z,Z,X){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var oe=g({},z.props),fe=z.key,Se=z.ref,Me=z._owner;if(Z!=null){if(Z.ref!==void 0&&(Se=Z.ref,Me=k.current),Z.key!==void 0&&(fe=""+Z.key),z.type&&z.type.defaultProps)var Ie=z.type.defaultProps;for(ge in Z)S.call(Z,ge)&&!I.hasOwnProperty(ge)&&(oe[ge]=Z[ge]===void 0&&Ie!==void 0?Ie[ge]:Z[ge])}var ge=arguments.length-2;if(ge===1)oe.children=X;else if(1<ge){Ie=Array(ge);for(var ye=0;ye<ge;ye++)Ie[ye]=arguments[ye+2];oe.children=Ie}return{$$typeof:n,type:z.type,key:fe,ref:Se,props:oe,_owner:Me}},mo.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:s,_context:z},z.Consumer=z},mo.createElement=L,mo.createFactory=function(z){var Z=L.bind(null,z);return Z.type=z,Z},mo.createRef=function(){return{current:null}},mo.forwardRef=function(z){return{$$typeof:a,render:z}},mo.isValidElement=P,mo.lazy=function(z){return{$$typeof:u,_payload:{_status:-1,_result:z},_init:W}},mo.memo=function(z,Z){return{$$typeof:c,type:z,compare:Z===void 0?null:Z}},mo.startTransition=function(z){var Z=U.transition;U.transition={};try{z()}finally{U.transition=Z}},mo.unstable_act=H,mo.useCallback=function(z,Z){return q.current.useCallback(z,Z)},mo.useContext=function(z){return q.current.useContext(z)},mo.useDebugValue=function(){},mo.useDeferredValue=function(z){return q.current.useDeferredValue(z)},mo.useEffect=function(z,Z){return q.current.useEffect(z,Z)},mo.useId=function(){return q.current.useId()},mo.useImperativeHandle=function(z,Z,X){return q.current.useImperativeHandle(z,Z,X)},mo.useInsertionEffect=function(z,Z){return q.current.useInsertionEffect(z,Z)},mo.useLayoutEffect=function(z,Z){return q.current.useLayoutEffect(z,Z)},mo.useMemo=function(z,Z){return q.current.useMemo(z,Z)},mo.useReducer=function(z,Z,X){return q.current.useReducer(z,Z,X)},mo.useRef=function(z){return q.current.useRef(z)},mo.useState=function(z){return q.current.useState(z)},mo.useSyncExternalStore=function(z,Z,X){return q.current.useSyncExternalStore(z,Z,X)},mo.useTransition=function(){return q.current.useTransition()},mo.version="18.3.1",mo}var hLe;function dv(){return hLe||(hLe=1,fie.exports=r_t()),fie.exports}/** * @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 fLe;function s_t(){if(fLe)return _5;fLe=1;var n=dv(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var u,d={},f=null,p=null;c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)i.call(l,u)&&!s.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:e,type:a,key:f,ref:p,props:d,_owner:r.current}}return _5.Fragment=t,_5.jsx=o,_5.jsxs=o,_5}var pLe;function o_t(){return pLe||(pLe=1,hie.exports=s_t()),hie.exports}var h=o_t(),x=dv();const we=Cl(x),q_=fVe({__proto__:null,default:we},[x]),a_t="/af_ZA-olz80oNH.json",l_t="/ar-DoZqROmV.json",c_t="/bg-Bo0ZhxWc.json",u_t="/ca-DES9ROXJ.json",d_t="/cs-cUdco89B.json",h_t="/da-DkJMMH7L.json",f_t="/de-BTtXbiAT.json",p_t="/el-CNa2XNbd.json",g_t="/en-DE1vkgfr.json",m_t="/en_GB-DKJWvNKo.json",__t="/es-Dh48WjLK.json",v_t="/es_ES-jZFKIguI.json",b_t="/et-BVcU5u-H.json",y_t="/fa-CqiSJNKK.json",C_t="/fi-D5-x6Xn6.json",w_t="/fr-CC86GUis.json",x_t="/fr_CA-DZCUGdTd.json",S_t="/fr_CH-GLAtQX6H.json",E_t="/he-CDq375Iv.json",k_t="/hr-DldaS-MX.json",T_t="/hu-B9MFaku7.json",I_t="/id_ID-CHvvzcGv.json",L_t="/it-sPJnNk6X.json",A_t="/ja-CeoI2b28.json",N_t="/km_KH-DF5az2T2.json",D_t="/lo_LA--yio73Ln.json",R_t="/lt-DzyicPsR.json",P_t="/lv_LV-DqdAi1oj.json",O_t="/mk_MK-Daaqddh4.json",M_t="/nb_NO-C3CwpG9S.json",j_t="/nl-DD8ZhPnq.json",F_t="/pl-C_ufVMfb.json",B_t="/pt_BR-CSRHHkNY.json",$_t="/pt_PT-_Rbg9fy-.json",H_t="/ro-DulZNN5s.json",V_t="/ru_RU-D6z2m1KX.json",W_t="/sk-C0lQFpeW.json",z_t="/sl-CQQRZymw.json",U_t="/sq-CHoxAUZr.json",q_t="/sr-DfWz1Yb_.json",K_t="/sv-DxV7ItDN.json",G_t="/th-8BJMKQwb.json",Y_t="/tr_TR-GGzvl-al.json",Q_t="/vi-DzicVnK3.json",X_t="/zh_TW-aEhr5Hgc.json";var pie={exports:{}},gie={};/** * @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 gLe;function Z_t(){if(gLe)return gie;gLe=1;var n=dv();function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var t=typeof Object.is=="function"?Object.is:e,i=n.useState,r=n.useEffect,s=n.useLayoutEffect,o=n.useDebugValue;function a(d,f){var p=f(),g=i({inst:{value:p,getSnapshot:f}}),m=g[0].inst,_=g[1];return s(function(){m.value=p,m.getSnapshot=f,l(m)&&_({inst:m})},[d,p,f]),r(function(){return l(m)&&_({inst:m}),d(function(){l(m)&&_({inst:m})})},[d]),o(p),p}function l(d){var f=d.getSnapshot;d=d.value;try{var p=f();return!t(d,p)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return gie.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:u,gie}var mLe;function pVe(){return mLe||(mLe=1,pie.exports=Z_t()),pie.exports}var J_t=pVe(),mie={exports:{}},_ie={};/** * @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 _Le;function evt(){if(_Le)return _ie;_Le=1;var n=dv(),e=pVe();function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var i=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=n.useRef,o=n.useEffect,a=n.useMemo,l=n.useDebugValue;return _ie.useSyncExternalStoreWithSelector=function(c,u,d,f,p){var g=s(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=a(function(){function v(k){if(!b){if(b=!0,y=k,k=f(k),p!==void 0&&m.hasValue){var I=m.value;if(p(I,k))return C=I}return C=k}if(I=C,i(y,k))return I;var L=f(k);return p!==void 0&&p(I,L)?I:(y=k,C=L)}var b=!1,y,C,S=d===void 0?null:d;return[function(){return v(u())},S===null?void 0:function(){return v(S())}]},[u,d,f,p]);var _=r(c,g[0],g[1]);return o(function(){m.hasValue=!0,m.value=_},[_]),l(_),_},_ie}var vLe;function tvt(){return vLe||(vLe=1,mie.exports=evt()),mie.exports}var nvt=tvt(),vie={exports:{}},Ap={},bie={exports:{}},yie={};/** * @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. */var bLe;function ivt(){return bLe||(bLe=1,function(n){function e(U,G){var H=U.length;U.push(G);e:for(;0<H;){var z=H-1>>>1,Z=U[z];if(0<r(Z,G))U[z]=G,U[H]=Z,H=z;else break e}}function t(U){return U.length===0?null:U[0]}function i(U){if(U.length===0)return null;var G=U[0],H=U.pop();if(H!==G){U[0]=H;e:for(var z=0,Z=U.length,X=Z>>>1;z<X;){var oe=2*(z+1)-1,fe=U[oe],Se=oe+1,Me=U[Se];if(0>r(fe,H))Se<Z&&0>r(Me,fe)?(U[z]=Me,U[Se]=H,z=Se):(U[z]=fe,U[oe]=H,z=oe);else if(Se<Z&&0>r(Me,H))U[z]=Me,U[Se]=H,z=Se;else break e}}return G}function r(U,G){var H=U.sortIndex-G.sortIndex;return H!==0?H:U.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,g=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(U){for(var G=t(c);G!==null;){if(G.callback===null)i(c);else if(G.startTime<=U)i(c),G.sortIndex=G.expirationTime,e(l,G);else break;G=t(c)}}function C(U){if(m=!1,y(U),!g)if(t(l)!==null)g=!0,W(S);else{var G=t(c);G!==null&&q(C,G.startTime-U)}}function S(U,G){g=!1,m&&(m=!1,v(L),L=-1),p=!0;var H=f;try{for(y(G),d=t(l);d!==null&&(!(d.expirationTime>G)||U&&!O());){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var Z=z(d.expirationTime<=G);G=n.unstable_now(),typeof Z=="function"?d.callback=Z:d===t(l)&&i(l),y(G)}else i(l);d=t(l)}if(d!==null)var X=!0;else{var oe=t(c);oe!==null&&q(C,oe.startTime-G),X=!1}return X}finally{d=null,f=H,p=!1}}var k=!1,I=null,L=-1,N=5,P=-1;function O(){return!(n.unstable_now()-P<N)}function F(){if(I!==null){var U=n.unstable_now();P=U;var G=!0;try{G=I(!0,U)}finally{G?V():(k=!1,I=null)}}else k=!1}var V;if(typeof b=="function")V=function(){b(F)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,B=M.port2;M.port1.onmessage=F,V=function(){B.postMessage(null)}}else V=function(){_(F,0)};function W(U){I=U,k||(k=!0,V())}function q(U,G){L=_(function(){U(n.unstable_now())},G)}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(U){U.callback=null},n.unstable_continueExecution=function(){g||p||(g=!0,W(S))},n.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<U?Math.floor(1e3/U):5},n.unstable_getCurrentPriorityLevel=function(){return f},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(U){switch(f){case 1:case 2:case 3:var G=3;break;default:G=f}var H=f;f=G;try{return U()}finally{f=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(U,G){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var H=f;f=U;try{return G()}finally{f=H}},n.unstable_scheduleCallback=function(U,G,H){var z=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?z+H:z):H=z,U){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=H+Z,U={id:u++,callback:G,priorityLevel:U,startTime:H,expirationTime:Z,sortIndex:-1},H>z?(U.sortIndex=H,e(c,U),t(l)===null&&U===t(c)&&(m?(v(L),L=-1):m=!0,q(C,H-z))):(U.sortIndex=Z,e(l,U),g||p||(g=!0,W(S))),U},n.unstable_shouldYield=O,n.unstable_wrapCallback=function(U){var G=f;return function(){var H=f;f=G;try{return U.apply(this,arguments)}finally{f=H}}}}(yie)),yie}var yLe;function rvt(){return yLe||(yLe=1,bie.exports=ivt()),bie.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 CLe;function svt(){if(CLe)return Ap;CLe=1;var n=dv(),e=rvt();function t(w){for(var E="https://reactjs.org/docs/error-decoder.html?invariant="+w,R=1;R<arguments.length;R++)E+="&args[]="+encodeURIComponent(arguments[R]);return"Minified React error #"+w+"; visit "+E+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,r={};function s(w,E){o(w,E),o(w+"Capture",E)}function o(w,E){for(r[w]=E,w=0;w<E.length;w++)i.add(E[w])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,c=/^[: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]*$/,u={},d={};function f(w){return l.call(d,w)?!0:l.call(u,w)?!1:c.test(w)?d[w]=!0:(u[w]=!0,!1)}function p(w,E,R,j){if(R!==null&&R.type===0)return!1;switch(typeof E){case"function":case"symbol":return!0;case"boolean":return j?!1:R!==null?!R.acceptsBooleans:(w=w.toLowerCase().slice(0,5),w!=="data-"&&w!=="aria-");default:return!1}}function g(w,E,R,j){if(E===null||typeof E>"u"||p(w,E,R,j))return!0;if(j)return!1;if(R!==null)switch(R.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 m(w,E,R,j,Y,ee,be){this.acceptsBooleans=E===2||E===3||E===4,this.attributeName=j,this.attributeNamespace=Y,this.mustUseProperty=R,this.propertyName=w,this.type=E,this.sanitizeURL=ee,this.removeEmptyString=be}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(w){_[w]=new m(w,0,!1,w,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(w){var E=w[0];_[E]=new m(E,1,!1,w[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(w){_[w]=new m(w,2,!1,w.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(w){_[w]=new m(w,2,!1,w,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(w){_[w]=new m(w,3,!1,w.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(w){_[w]=new m(w,3,!0,w,null,!1,!1)}),["capture","download"].forEach(function(w){_[w]=new m(w,4,!1,w,null,!1,!1)}),["cols","rows","size","span"].forEach(function(w){_[w]=new m(w,6,!1,w,null,!1,!1)}),["rowSpan","start"].forEach(function(w){_[w]=new m(w,5,!1,w.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function b(w){return w[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(w){var E=w.replace(v,b);_[E]=new m(E,1,!1,w,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(w){var E=w.replace(v,b);_[E]=new m(E,1,!1,w,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(w){var E=w.replace(v,b);_[E]=new m(E,1,!1,w,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(w){_[w]=new m(w,1,!1,w.toLowerCase(),null,!1,!1)}),_.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(w){_[w]=new m(w,1,!1,w.toLowerCase(),null,!0,!0)});function y(w,E,R,j){var Y=_.hasOwnProperty(E)?_[E]:null;(Y!==null?Y.type!==0:j||!(2<E.length)||E[0]!=="o"&&E[0]!=="O"||E[1]!=="n"&&E[1]!=="N")&&(g(E,R,Y,j)&&(R=null),j||Y===null?f(E)&&(R===null?w.removeAttribute(E):w.setAttribute(E,""+R)):Y.mustUseProperty?w[Y.propertyName]=R===null?Y.type===3?!1:"":R:(E=Y.attributeName,j=Y.attributeNamespace,R===null?w.removeAttribute(E):(Y=Y.type,R=Y===3||Y===4&&R===!0?"":""+R,j?w.setAttributeNS(j,E,R):w.setAttribute(E,R))))}var C=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for("react.element"),k=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),O=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),q=Symbol.for("react.offscreen"),U=Symbol.iterator;function G(w){return w===null||typeof w!="object"?null:(w=U&&w[U]||w["@@iterator"],typeof w=="function"?w:null)}var H=Object.assign,z;function Z(w){if(z===void 0)try{throw Error()}catch(R){var E=R.stack.trim().match(/\n( *(at )?)/);z=E&&E[1]||""}return` `+z+w}var X=!1;function oe(w,E){if(!w||X)return"";X=!0;var R=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(on){var j=on}Reflect.construct(w,[],E)}else{try{E.call()}catch(on){j=on}w.call(E.prototype)}else{try{throw Error()}catch(on){j=on}w()}}catch(on){if(on&&j&&typeof on.stack=="string"){for(var Y=on.stack.split(` `),ee=j.stack.split(` `),be=Y.length-1,Ze=ee.length-1;1<=be&&0<=Ze&&Y[be]!==ee[Ze];)Ze--;for(;1<=be&&0<=Ze;be--,Ze--)if(Y[be]!==ee[Ze]){if(be!==1||Ze!==1)do if(be--,Ze--,0>Ze||Y[be]!==ee[Ze]){var bt=` `+Y[be].replace(" at new "," at ");return w.displayName&&bt.includes("<anonymous>")&&(bt=bt.replace("<anonymous>",w.displayName)),bt}while(1<=be&&0<=Ze);break}}}finally{X=!1,Error.prepareStackTrace=R}return(w=w?w.displayName||w.name:"")?Z(w):""}function fe(w){switch(w.tag){case 5:return Z(w.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return w=oe(w.type,!1),w;case 11:return w=oe(w.type.render,!1),w;case 1:return w=oe(w.type,!0),w;default:return""}}function Se(w){if(w==null)return null;if(typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w;switch(w){case I:return"Fragment";case k:return"Portal";case N:return"Profiler";case L:return"StrictMode";case V:return"Suspense";case M:return"SuspenseList"}if(typeof w=="object")switch(w.$$typeof){case O:return(w.displayName||"Context")+".Consumer";case P:return(w._context.displayName||"Context")+".Provider";case F:var E=w.render;return w=w.displayName,w||(w=E.displayName||E.name||"",w=w!==""?"ForwardRef("+w+")":"ForwardRef"),w;case B:return E=w.displayName||null,E!==null?E:Se(w.type)||"Memo";case W:E=w._payload,w=w._init;try{return Se(w(E))}catch{}}return null}function Me(w){var E=w.type;switch(w.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 w=E.render,w=w.displayName||w.name||"",E.displayName||(w!==""?"ForwardRef("+w+")":"ForwardRef");case 7:return"Fragment";case 5:return E;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Se(E);case 8:return E===L?"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 Ie(w){switch(typeof w){case"boolean":case"number":case"string":case"undefined":return w;case"object":return w;default:return""}}function ge(w){var E=w.type;return(w=w.nodeName)&&w.toLowerCase()==="input"&&(E==="checkbox"||E==="radio")}function ye(w){var E=ge(w)?"checked":"value",R=Object.getOwnPropertyDescriptor(w.constructor.prototype,E),j=""+w[E];if(!w.hasOwnProperty(E)&&typeof R<"u"&&typeof R.get=="function"&&typeof R.set=="function"){var Y=R.get,ee=R.set;return Object.defineProperty(w,E,{configurable:!0,get:function(){return Y.call(this)},set:function(be){j=""+be,ee.call(this,be)}}),Object.defineProperty(w,E,{enumerable:R.enumerable}),{getValue:function(){return j},setValue:function(be){j=""+be},stopTracking:function(){w._valueTracker=null,delete w[E]}}}}function Pe(w){w._valueTracker||(w._valueTracker=ye(w))}function Be(w){if(!w)return!1;var E=w._valueTracker;if(!E)return!0;var R=E.getValue(),j="";return w&&(j=ge(w)?w.checked?"true":"false":w.value),w=j,w!==R?(E.setValue(w),!0):!1}function $e(w){if(w=w||(typeof document<"u"?document:void 0),typeof w>"u")return null;try{return w.activeElement||w.body}catch{return w.body}}function qe(w,E){var R=E.checked;return H({},E,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:R??w._wrapperState.initialChecked})}function mt(w,E){var R=E.defaultValue==null?"":E.defaultValue,j=E.checked!=null?E.checked:E.defaultChecked;R=Ie(E.value!=null?E.value:R),w._wrapperState={initialChecked:j,initialValue:R,controlled:E.type==="checkbox"||E.type==="radio"?E.checked!=null:E.value!=null}}function vt(w,E){E=E.checked,E!=null&&y(w,"checked",E,!1)}function ft(w,E){vt(w,E);var R=Ie(E.value),j=E.type;if(R!=null)j==="number"?(R===0&&w.value===""||w.value!=R)&&(w.value=""+R):w.value!==""+R&&(w.value=""+R);else if(j==="submit"||j==="reset"){w.removeAttribute("value");return}E.hasOwnProperty("value")?St(w,E.type,R):E.hasOwnProperty("defaultValue")&&St(w,E.type,Ie(E.defaultValue)),E.checked==null&&E.defaultChecked!=null&&(w.defaultChecked=!!E.defaultChecked)}function tt(w,E,R){if(E.hasOwnProperty("value")||E.hasOwnProperty("defaultValue")){var j=E.type;if(!(j!=="submit"&&j!=="reset"||E.value!==void 0&&E.value!==null))return;E=""+w._wrapperState.initialValue,R||E===w.value||(w.value=E),w.defaultValue=E}R=w.name,R!==""&&(w.name=""),w.defaultChecked=!!w._wrapperState.initialChecked,R!==""&&(w.name=R)}function St(w,E,R){(E!=="number"||$e(w.ownerDocument)!==w)&&(R==null?w.defaultValue=""+w._wrapperState.initialValue:w.defaultValue!==""+R&&(w.defaultValue=""+R))}var Ft=Array.isArray;function en(w,E,R,j){if(w=w.options,E){E={};for(var Y=0;Y<R.length;Y++)E["$"+R[Y]]=!0;for(R=0;R<w.length;R++)Y=E.hasOwnProperty("$"+w[R].value),w[R].selected!==Y&&(w[R].selected=Y),Y&&j&&(w[R].defaultSelected=!0)}else{for(R=""+Ie(R),E=null,Y=0;Y<w.length;Y++){if(w[Y].value===R){w[Y].selected=!0,j&&(w[Y].defaultSelected=!0);return}E!==null||w[Y].disabled||(E=w[Y])}E!==null&&(E.selected=!0)}}function Ke(w,E){if(E.dangerouslySetInnerHTML!=null)throw Error(t(91));return H({},E,{value:void 0,defaultValue:void 0,children:""+w._wrapperState.initialValue})}function dt(w,E){var R=E.value;if(R==null){if(R=E.children,E=E.defaultValue,R!=null){if(E!=null)throw Error(t(92));if(Ft(R)){if(1<R.length)throw Error(t(93));R=R[0]}E=R}E==null&&(E=""),R=E}w._wrapperState={initialValue:Ie(R)}}function nt(w,E){var R=Ie(E.value),j=Ie(E.defaultValue);R!=null&&(R=""+R,R!==w.value&&(w.value=R),E.defaultValue==null&&w.defaultValue!==R&&(w.defaultValue=R)),j!=null&&(w.defaultValue=""+j)}function at(w){var E=w.textContent;E===w._wrapperState.initialValue&&E!==""&&E!==null&&(w.value=E)}function Oe(w){switch(w){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 ce(w,E){return w==null||w==="http://www.w3.org/1999/xhtml"?Oe(E):w==="http://www.w3.org/2000/svg"&&E==="foreignObject"?"http://www.w3.org/1999/xhtml":w}var Ne,Xe=function(w){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(E,R,j,Y){MSApp.execUnsafeLocalFunction(function(){return w(E,R,j,Y)})}:w}(function(w,E){if(w.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in w)w.innerHTML=E;else{for(Ne=Ne||document.createElement("div"),Ne.innerHTML="<svg>"+E.valueOf().toString()+"</svg>",E=Ne.firstChild;w.firstChild;)w.removeChild(w.firstChild);for(;E.firstChild;)w.appendChild(E.firstChild)}});function it(w,E){if(E){var R=w.firstChild;if(R&&R===w.lastChild&&R.nodeType===3){R.nodeValue=E;return}}w.textContent=E}var Tt={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},Ct=["Webkit","ms","Moz","O"];Object.keys(Tt).forEach(function(w){Ct.forEach(function(E){E=E+w.charAt(0).toUpperCase()+w.substring(1),Tt[E]=Tt[w]})});function Rt(w,E,R){return E==null||typeof E=="boolean"||E===""?"":R||typeof E!="number"||E===0||Tt.hasOwnProperty(w)&&Tt[w]?(""+E).trim():E+"px"}function se(w,E){w=w.style;for(var R in E)if(E.hasOwnProperty(R)){var j=R.indexOf("--")===0,Y=Rt(R,E[R],j);R==="float"&&(R="cssFloat"),j?w.setProperty(R,Y):w[R]=Y}}var ke=H({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 Ae(w,E){if(E){if(ke[w]&&(E.children!=null||E.dangerouslySetInnerHTML!=null))throw Error(t(137,w));if(E.dangerouslySetInnerHTML!=null){if(E.children!=null)throw Error(t(60));if(typeof E.dangerouslySetInnerHTML!="object"||!("__html"in E.dangerouslySetInnerHTML))throw Error(t(61))}if(E.style!=null&&typeof E.style!="object")throw Error(t(62))}}function je(w,E){if(w.indexOf("-")===-1)return typeof E.is=="string";switch(w){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 Ve=null;function Qt(w){return w=w.target||w.srcElement||window,w.correspondingUseElement&&(w=w.correspondingUseElement),w.nodeType===3?w.parentNode:w}var rt=null,Cn=null,Rn=null;function li(w){if(w=Cd(w)){if(typeof rt!="function")throw Error(t(280));var E=w.stateNode;E&&(E=_N(E),rt(w.stateNode,w.type,E))}}function Mi(w){Cn?Rn?Rn.push(w):Rn=[w]:Cn=w}function si(){if(Cn){var w=Cn,E=Rn;if(Rn=Cn=null,li(w),E)for(w=0;w<E.length;w++)li(E[w])}}function oi(w,E){return w(E)}function _n(){}var de=!1;function _e(w,E,R){if(de)return w(E,R);de=!0;try{return oi(w,E,R)}finally{de=!1,(Cn!==null||Rn!==null)&&(_n(),si())}}function Le(w,E){var R=w.stateNode;if(R===null)return null;var j=_N(R);if(j===null)return null;R=j[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":(j=!j.disabled)||(w=w.type,j=!(w==="button"||w==="input"||w==="select"||w==="textarea")),w=!j;break e;default:w=!1}if(w)return null;if(R&&typeof R!="function")throw Error(t(231,E,typeof R));return R}var Ge=!1;if(a)try{var gt={};Object.defineProperty(gt,"passive",{get:function(){Ge=!0}}),window.addEventListener("test",gt,gt),window.removeEventListener("test",gt,gt)}catch{Ge=!1}function pt(w,E,R,j,Y,ee,be,Ze,bt){var on=Array.prototype.slice.call(arguments,3);try{E.apply(R,on)}catch(Xn){this.onError(Xn)}}var Vt=!1,Pn=null,Ln=!1,bi=null,et={onError:function(w){Vt=!0,Pn=w}};function Lt(w,E,R,j,Y,ee,be,Ze,bt){Vt=!1,Pn=null,pt.apply(et,arguments)}function qt(w,E,R,j,Y,ee,be,Ze,bt){if(Lt.apply(this,arguments),Vt){if(Vt){var on=Pn;Vt=!1,Pn=null}else throw Error(t(198));Ln||(Ln=!0,bi=on)}}function sn(w){var E=w,R=w;if(w.alternate)for(;E.return;)E=E.return;else{w=E;do E=w,(E.flags&4098)!==0&&(R=E.return),w=E.return;while(w)}return E.tag===3?R:null}function ln(w){if(w.tag===13){var E=w.memoizedState;if(E===null&&(w=w.alternate,w!==null&&(E=w.memoizedState)),E!==null)return E.dehydrated}return null}function ti(w){if(sn(w)!==w)throw Error(t(188))}function di(w){var E=w.alternate;if(!E){if(E=sn(w),E===null)throw Error(t(188));return E!==w?null:w}for(var R=w,j=E;;){var Y=R.return;if(Y===null)break;var ee=Y.alternate;if(ee===null){if(j=Y.return,j!==null){R=j;continue}break}if(Y.child===ee.child){for(ee=Y.child;ee;){if(ee===R)return ti(Y),w;if(ee===j)return ti(Y),E;ee=ee.sibling}throw Error(t(188))}if(R.return!==j.return)R=Y,j=ee;else{for(var be=!1,Ze=Y.child;Ze;){if(Ze===R){be=!0,R=Y,j=ee;break}if(Ze===j){be=!0,j=Y,R=ee;break}Ze=Ze.sibling}if(!be){for(Ze=ee.child;Ze;){if(Ze===R){be=!0,R=ee,j=Y;break}if(Ze===j){be=!0,j=ee,R=Y;break}Ze=Ze.sibling}if(!be)throw Error(t(189))}}if(R.alternate!==j)throw Error(t(190))}if(R.tag!==3)throw Error(t(188));return R.stateNode.current===R?w:E}function Dt(w){return w=di(w),w!==null?le(w):null}function le(w){if(w.tag===5||w.tag===6)return w;for(w=w.child;w!==null;){var E=le(w);if(E!==null)return E;w=w.sibling}return null}var Qe=e.unstable_scheduleCallback,ht=e.unstable_cancelCallback,Bt=e.unstable_shouldYield,An=e.unstable_requestPaint,mn=e.unstable_now,hi=e.unstable_getCurrentPriorityLevel,Di=e.unstable_ImmediatePriority,cr=e.unstable_UserBlockingPriority,Li=e.unstable_NormalPriority,Sr=e.unstable_LowPriority,rr=e.unstable_IdlePriority,ws=null,Er=null;function xa(w){if(Er&&typeof Er.onCommitFiberRoot=="function")try{Er.onCommitFiberRoot(ws,w,void 0,(w.current.flags&128)===128)}catch{}}var No=Math.clz32?Math.clz32:ua,Do=Math.log,Zs=Math.LN2;function ua(w){return w>>>=0,w===0?32:31-(Do(w)/Zs|0)|0}var Os=64,Co=4194304;function ul(w){switch(w&-w){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 w&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return w&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return w}}function Qi(w,E){var R=w.pendingLanes;if(R===0)return 0;var j=0,Y=w.suspendedLanes,ee=w.pingedLanes,be=R&268435455;if(be!==0){var Ze=be&~Y;Ze!==0?j=ul(Ze):(ee&=be,ee!==0&&(j=ul(ee)))}else be=R&~Y,be!==0?j=ul(be):ee!==0&&(j=ul(ee));if(j===0)return 0;if(E!==0&&E!==j&&(E&Y)===0&&(Y=j&-j,ee=E&-E,Y>=ee||Y===16&&(ee&4194240)!==0))return E;if((j&4)!==0&&(j|=R&16),E=w.entangledLanes,E!==0)for(w=w.entanglements,E&=j;0<E;)R=31-No(E),Y=1<<R,j|=w[R],E&=~Y;return j}function Ms(w,E){switch(w){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 js(w,E){for(var R=w.suspendedLanes,j=w.pingedLanes,Y=w.expirationTimes,ee=w.pendingLanes;0<ee;){var be=31-No(ee),Ze=1<<be,bt=Y[be];bt===-1?((Ze&R)===0||(Ze&j)!==0)&&(Y[be]=Ms(Ze,E)):bt<=E&&(w.expiredLanes|=Ze),ee&=~Ze}}function Ro(w){return w=w.pendingLanes&-1073741825,w!==0?w:w&1073741824?1073741824:0}function Bi(){var w=Os;return Os<<=1,(Os&4194240)===0&&(Os=64),w}function Vi(w){for(var E=[],R=0;31>R;R++)E.push(w);return E}function Br(w,E,R){w.pendingLanes|=E,E!==536870912&&(w.suspendedLanes=0,w.pingedLanes=0),w=w.eventTimes,E=31-No(E),w[E]=R}function Gr(w,E){var R=w.pendingLanes&~E;w.pendingLanes=E,w.suspendedLanes=0,w.pingedLanes=0,w.expiredLanes&=E,w.mutableReadLanes&=E,w.entangledLanes&=E,E=w.entanglements;var j=w.eventTimes;for(w=w.expirationTimes;0<R;){var Y=31-No(R),ee=1<<Y;E[Y]=0,j[Y]=-1,w[Y]=-1,R&=~ee}}function xs(w,E){var R=w.entangledLanes|=E;for(w=w.entanglements;R;){var j=31-No(R),Y=1<<j;Y&E|w[j]&E&&(w[j]|=E),R&=~Y}}var sr=0;function Ns(w){return w&=-w,1<w?4<w?(w&268435455)!==0?16:536870912:4:1}var uo,yi,vn,Un,Mn,fi=!1,Wi=[],or=null,qn=null,Wn=null,Ei=new Map,Kn=new Map,Hn=[],ki="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 Sn(w,E){switch(w){case"focusin":case"focusout":or=null;break;case"dragenter":case"dragleave":qn=null;break;case"mouseover":case"mouseout":Wn=null;break;case"pointerover":case"pointerout":Ei.delete(E.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kn.delete(E.pointerId)}}function On(w,E,R,j,Y,ee){return w===null||w.nativeEvent!==ee?(w={blockedOn:E,domEventName:R,eventSystemFlags:j,nativeEvent:ee,targetContainers:[Y]},E!==null&&(E=Cd(E),E!==null&&yi(E)),w):(w.eventSystemFlags|=j,E=w.targetContainers,Y!==null&&E.indexOf(Y)===-1&&E.push(Y),w)}function wi(w,E,R,j,Y){switch(E){case"focusin":return or=On(or,w,E,R,j,Y),!0;case"dragenter":return qn=On(qn,w,E,R,j,Y),!0;case"mouseover":return Wn=On(Wn,w,E,R,j,Y),!0;case"pointerover":var ee=Y.pointerId;return Ei.set(ee,On(Ei.get(ee)||null,w,E,R,j,Y)),!0;case"gotpointercapture":return ee=Y.pointerId,Kn.set(ee,On(Kn.get(ee)||null,w,E,R,j,Y)),!0}return!1}function Cr(w){var E=n_(w.target);if(E!==null){var R=sn(E);if(R!==null){if(E=R.tag,E===13){if(E=ln(R),E!==null){w.blockedOn=E,Mn(w.priority,function(){vn(R)});return}}else if(E===3&&R.stateNode.current.memoizedState.isDehydrated){w.blockedOn=R.tag===3?R.stateNode.containerInfo:null;return}}}w.blockedOn=null}function br(w){if(w.blockedOn!==null)return!1;for(var E=w.targetContainers;0<E.length;){var R=pp(w.domEventName,w.eventSystemFlags,E[0],w.nativeEvent);if(R===null){R=w.nativeEvent;var j=new R.constructor(R.type,R);Ve=j,R.target.dispatchEvent(j),Ve=null}else return E=Cd(R),E!==null&&yi(E),w.blockedOn=R,!1;E.shift()}return!0}function zs(w,E,R){br(w)&&R.delete(E)}function Oa(){fi=!1,or!==null&&br(or)&&(or=null),qn!==null&&br(qn)&&(qn=null),Wn!==null&&br(Wn)&&(Wn=null),Ei.forEach(zs),Kn.forEach(zs)}function $r(w,E){w.blockedOn===E&&(w.blockedOn=null,fi||(fi=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Oa)))}function Qn(w){function E(Y){return $r(Y,w)}if(0<Wi.length){$r(Wi[0],w);for(var R=1;R<Wi.length;R++){var j=Wi[R];j.blockedOn===w&&(j.blockedOn=null)}}for(or!==null&&$r(or,w),qn!==null&&$r(qn,w),Wn!==null&&$r(Wn,w),Ei.forEach(E),Kn.forEach(E),R=0;R<Hn.length;R++)j=Hn[R],j.blockedOn===w&&(j.blockedOn=null);for(;0<Hn.length&&(R=Hn[0],R.blockedOn===null);)Cr(R),R.blockedOn===null&&Hn.shift()}var Po=C.ReactCurrentBatchConfig,jl=!0;function Ku(w,E,R,j){var Y=sr,ee=Po.transition;Po.transition=null;try{sr=1,_c(w,E,R,j)}finally{sr=Y,Po.transition=ee}}function Jo(w,E,R,j){var Y=sr,ee=Po.transition;Po.transition=null;try{sr=4,_c(w,E,R,j)}finally{sr=Y,Po.transition=ee}}function _c(w,E,R,j){if(jl){var Y=pp(w,E,R,j);if(Y===null)y3(w,E,j,sc,R),Sn(w,j);else if(wi(Y,w,E,R,j))j.stopPropagation();else if(Sn(w,j),E&4&&-1<ki.indexOf(w)){for(;Y!==null;){var ee=Cd(Y);if(ee!==null&&uo(ee),ee=pp(w,E,R,j),ee===null&&y3(w,E,j,sc,R),ee===Y)break;Y=ee}Y!==null&&j.stopPropagation()}else y3(w,E,j,null,R)}}var sc=null;function pp(w,E,R,j){if(sc=null,w=Qt(j),w=n_(w),w!==null)if(E=sn(w),E===null)w=null;else if(R=E.tag,R===13){if(w=ln(E),w!==null)return w;w=null}else if(R===3){if(E.stateNode.current.memoizedState.isDehydrated)return E.tag===3?E.stateNode.containerInfo:null;w=null}else E!==w&&(w=null);return sc=w,null}function E1(w){switch(w){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(hi()){case Di:return 1;case cr:return 4;case Li:case Sr:return 16;case rr:return 536870912;default:return 16}default:return 16}}var Sa=null,Xm=null,Jd=null;function Zm(){if(Jd)return Jd;var w,E=Xm,R=E.length,j,Y="value"in Sa?Sa.value:Sa.textContent,ee=Y.length;for(w=0;w<R&&E[w]===Y[w];w++);var be=R-w;for(j=1;j<=be&&E[R-j]===Y[ee-j];j++);return Jd=Y.slice(w,1<j?1-j:void 0)}function Jc(w){var E=w.keyCode;return"charCode"in w?(w=w.charCode,w===0&&E===13&&(w=13)):w=E,w===10&&(w=13),32<=w||w===13?w:0}function eu(){return!0}function n0(){return!1}function vc(w){function E(R,j,Y,ee,be){this._reactName=R,this._targetInst=Y,this.type=j,this.nativeEvent=ee,this.target=be,this.currentTarget=null;for(var Ze in w)w.hasOwnProperty(Ze)&&(R=w[Ze],this[Ze]=R?R(ee):ee[Ze]);return this.isDefaultPrevented=(ee.defaultPrevented!=null?ee.defaultPrevented:ee.returnValue===!1)?eu:n0,this.isPropagationStopped=n0,this}return H(E.prototype,{preventDefault:function(){this.defaultPrevented=!0;var R=this.nativeEvent;R&&(R.preventDefault?R.preventDefault():typeof R.returnValue!="unknown"&&(R.returnValue=!1),this.isDefaultPrevented=eu)},stopPropagation:function(){var R=this.nativeEvent;R&&(R.stopPropagation?R.stopPropagation():typeof R.cancelBubble!="unknown"&&(R.cancelBubble=!0),this.isPropagationStopped=eu)},persist:function(){},isPersistent:eu}),E}var Ef={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(w){return w.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kf=vc(Ef),i0=H({},Ef,{view:0,detail:0}),nN=vc(i0),Gu,Hk,Su,ix=H({},i0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gr,button:0,buttons:0,relatedTarget:function(w){return w.relatedTarget===void 0?w.fromElement===w.srcElement?w.toElement:w.fromElement:w.relatedTarget},movementX:function(w){return"movementX"in w?w.movementX:(w!==Su&&(Su&&w.type==="mousemove"?(Gu=w.screenX-Su.screenX,Hk=w.screenY-Su.screenY):Hk=Gu=0,Su=w),Gu)},movementY:function(w){return"movementY"in w?w.movementY:Hk}}),Vk=vc(ix),Jm=H({},ix,{dataTransfer:0}),rx=vc(Jm),Wk=H({},i0,{relatedTarget:0}),Ma=vc(Wk),dl=H({},Ef,{animationName:0,elapsedTime:0,pseudoElement:0}),k1=vc(dl),h3=H({},Ef,{clipboardData:function(w){return"clipboardData"in w?w.clipboardData:window.clipboardData}}),ae=vc(h3),Q=H({},Ef,{data:0}),re=vc(Q),Fe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},st={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"},xn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ci(w){var E=this.nativeEvent;return E.getModifierState?E.getModifierState(w):(w=xn[w])?!!E[w]:!1}function gr(){return Ci}var Ts=H({},i0,{key:function(w){if(w.key){var E=Fe[w.key]||w.key;if(E!=="Unidentified")return E}return w.type==="keypress"?(w=Jc(w),w===13?"Enter":String.fromCharCode(w)):w.type==="keydown"||w.type==="keyup"?st[w.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gr,charCode:function(w){return w.type==="keypress"?Jc(w):0},keyCode:function(w){return w.type==="keydown"||w.type==="keyup"?w.keyCode:0},which:function(w){return w.type==="keypress"?Jc(w):w.type==="keydown"||w.type==="keyup"?w.keyCode:0}}),wo=vc(Ts),Bo=H({},ix,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sl=vc(Bo),T1=H({},i0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gr}),f3=vc(T1),sx=H({},Ef,{propertyName:0,elapsedTime:0,pseudoElement:0}),zk=vc(sx),iN=H({},ix,{deltaX:function(w){return"deltaX"in w?w.deltaX:"wheelDeltaX"in w?-w.wheelDeltaX:0},deltaY:function(w){return"deltaY"in w?w.deltaY:"wheelDeltaY"in w?-w.wheelDeltaY:"wheelDelta"in w?-w.wheelDelta:0},deltaZ:0,deltaMode:0}),rN=vc(iN),bd=[9,13,27,32],I1=a&&"CompositionEvent"in window,Ag=null;a&&"documentMode"in document&&(Ag=document.documentMode);var Uk=a&&"TextEvent"in window&&!Ag,ox=a&&(!I1||Ag&&8<Ag&&11>=Ag),qk=" ",ax=!1;function lx(w,E){switch(w){case"keyup":return bd.indexOf(E.keyCode)!==-1;case"keydown":return E.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kk(w){return w=w.detail,typeof w=="object"&&"data"in w?w.data:null}var r0=!1;function s0(w,E){switch(w){case"compositionend":return Kk(E);case"keypress":return E.which!==32?null:(ax=!0,qk);case"textInput":return w=E.data,w===qk&&ax?null:w;default:return null}}function p3(w,E){if(r0)return w==="compositionend"||!I1&&lx(w,E)?(w=Zm(),Jd=Xm=Sa=null,r0=!1,w):null;switch(w){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 ox&&E.locale!=="ko"?null:E.data;default:return null}}var g3={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 L1(w){var E=w&&w.nodeName&&w.nodeName.toLowerCase();return E==="input"?!!g3[w.type]:E==="textarea"}function m3(w,E,R,j){Mi(j),E=fN(E,"onChange"),0<E.length&&(R=new kf("onChange","change",null,R,j),w.push({event:R,listeners:E}))}var gp=null,o0=null;function Ine(w){P$(w,0)}function sN(w){var E=Us(w);if(Be(E))return w}function Lne(w,E){if(w==="change")return E}var A1=!1;if(a){var Tf;if(a){var oN="oninput"in document;if(!oN){var I$=document.createElement("div");I$.setAttribute("oninput","return;"),oN=typeof I$.oninput=="function"}Tf=oN}else Tf=!1;A1=Tf&&(!document.documentMode||9<document.documentMode)}function L$(){gp&&(gp.detachEvent("onpropertychange",A$),o0=gp=null)}function A$(w){if(w.propertyName==="value"&&sN(o0)){var E=[];m3(E,o0,w,Qt(w)),_e(Ine,E)}}function Ane(w,E,R){w==="focusin"?(L$(),gp=E,o0=R,gp.attachEvent("onpropertychange",A$)):w==="focusout"&&L$()}function Nne(w){if(w==="selectionchange"||w==="keyup"||w==="keydown")return sN(o0)}function cx(w,E){if(w==="click")return sN(E)}function Nt(w,E){if(w==="input"||w==="change")return sN(E)}function En(w,E){return w===E&&(w!==0||1/w===1/E)||w!==w&&E!==E}var Zt=typeof Object.is=="function"?Object.is:En;function Xi(w,E){if(Zt(w,E))return!0;if(typeof w!="object"||w===null||typeof E!="object"||E===null)return!1;var R=Object.keys(w),j=Object.keys(E);if(R.length!==j.length)return!1;for(j=0;j<R.length;j++){var Y=R[j];if(!l.call(E,Y)||!Zt(w[Y],E[Y]))return!1}return!0}function Ds(w){for(;w&&w.firstChild;)w=w.firstChild;return w}function ea(w,E){var R=Ds(w);w=0;for(var j;R;){if(R.nodeType===3){if(j=w+R.textContent.length,w<=E&&j>=E)return{node:R,offset:E-w};w=j}e:{for(;R;){if(R.nextSibling){R=R.nextSibling;break e}R=R.parentNode}R=void 0}R=Ds(R)}}function Pc(w,E){return w&&E?w===E?!0:w&&w.nodeType===3?!1:E&&E.nodeType===3?Pc(w,E.parentNode):"contains"in w?w.contains(E):w.compareDocumentPosition?!!(w.compareDocumentPosition(E)&16):!1:!1}function ja(){for(var w=window,E=$e();E instanceof w.HTMLIFrameElement;){try{var R=typeof E.contentWindow.location.href=="string"}catch{R=!1}if(R)w=E.contentWindow;else break;E=$e(w.document)}return E}function Gk(w){var E=w&&w.nodeName&&w.nodeName.toLowerCase();return E&&(E==="input"&&(w.type==="text"||w.type==="search"||w.type==="tel"||w.type==="url"||w.type==="password")||E==="textarea"||w.contentEditable==="true")}function Dne(w){var E=ja(),R=w.focusedElem,j=w.selectionRange;if(E!==R&&R&&R.ownerDocument&&Pc(R.ownerDocument.documentElement,R)){if(j!==null&&Gk(R)){if(E=j.start,w=j.end,w===void 0&&(w=E),"selectionStart"in R)R.selectionStart=E,R.selectionEnd=Math.min(w,R.value.length);else if(w=(E=R.ownerDocument||document)&&E.defaultView||window,w.getSelection){w=w.getSelection();var Y=R.textContent.length,ee=Math.min(j.start,Y);j=j.end===void 0?ee:Math.min(j.end,Y),!w.extend&&ee>j&&(Y=j,j=ee,ee=Y),Y=ea(R,ee);var be=ea(R,j);Y&&be&&(w.rangeCount!==1||w.anchorNode!==Y.node||w.anchorOffset!==Y.offset||w.focusNode!==be.node||w.focusOffset!==be.offset)&&(E=E.createRange(),E.setStart(Y.node,Y.offset),w.removeAllRanges(),ee>j?(w.addRange(E),w.extend(be.node,be.offset)):(E.setEnd(be.node,be.offset),w.addRange(E)))}}for(E=[],w=R;w=w.parentNode;)w.nodeType===1&&E.push({element:w,left:w.scrollLeft,top:w.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<E.length;R++)w=E[R],w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}var mp=a&&"documentMode"in document&&11>=document.documentMode,Cv=null,_3=null,e_=null,ux=!1;function Yk(w,E,R){var j=R.window===R?R.document:R.nodeType===9?R:R.ownerDocument;ux||Cv==null||Cv!==$e(j)||(j=Cv,"selectionStart"in j&&Gk(j)?j={start:j.selectionStart,end:j.selectionEnd}:(j=(j.ownerDocument&&j.ownerDocument.defaultView||window).getSelection(),j={anchorNode:j.anchorNode,anchorOffset:j.anchorOffset,focusNode:j.focusNode,focusOffset:j.focusOffset}),e_&&Xi(e_,j)||(e_=j,j=fN(_3,"onSelect"),0<j.length&&(E=new kf("onSelect","select",null,E,R),w.push({event:E,listeners:j}),E.target=Cv)))}function ta(w,E){var R={};return R[w.toLowerCase()]=E.toLowerCase(),R["Webkit"+w]="webkit"+E,R["Moz"+w]="moz"+E,R}var dx={animationend:ta("Animation","AnimationEnd"),animationiteration:ta("Animation","AnimationIteration"),animationstart:ta("Animation","AnimationStart"),transitionend:ta("Transition","TransitionEnd")},aN={},Qk={};a&&(Qk=document.createElement("div").style,"AnimationEvent"in window||(delete dx.animationend.animation,delete dx.animationiteration.animation,delete dx.animationstart.animation),"TransitionEvent"in window||delete dx.transitionend.transition);function lN(w){if(aN[w])return aN[w];if(!dx[w])return w;var E=dx[w],R;for(R in E)if(E.hasOwnProperty(R)&&R in Qk)return aN[w]=E[R];return w}var N$=lN("animationend"),D$=lN("animationiteration"),Xk=lN("animationstart"),wv=lN("transitionend"),Zk=new Map,v3="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 Ng(w,E){Zk.set(w,E),s(E,[w])}for(var cN=0;cN<v3.length;cN++){var uN=v3[cN],dN=uN.toLowerCase(),R$=uN[0].toUpperCase()+uN.slice(1);Ng(dN,"on"+R$)}Ng(N$,"onAnimationEnd"),Ng(D$,"onAnimationIteration"),Ng(Xk,"onAnimationStart"),Ng("dblclick","onDoubleClick"),Ng("focusin","onFocus"),Ng("focusout","onBlur"),Ng(wv,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xv="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(" "),N1=new Set("cancel close invalid load scroll toggle".split(" ").concat(xv));function Jk(w,E,R){var j=w.type||"unknown-event";w.currentTarget=R,qt(j,E,void 0,w),w.currentTarget=null}function P$(w,E){E=(E&4)!==0;for(var R=0;R<w.length;R++){var j=w[R],Y=j.event;j=j.listeners;e:{var ee=void 0;if(E)for(var be=j.length-1;0<=be;be--){var Ze=j[be],bt=Ze.instance,on=Ze.currentTarget;if(Ze=Ze.listener,bt!==ee&&Y.isPropagationStopped())break e;Jk(Y,Ze,on),ee=bt}else for(be=0;be<j.length;be++){if(Ze=j[be],bt=Ze.instance,on=Ze.currentTarget,Ze=Ze.listener,bt!==ee&&Y.isPropagationStopped())break e;Jk(Y,Ze,on),ee=bt}}}if(Ln)throw w=bi,Ln=!1,bi=null,w}function El(w,E){var R=E[mN];R===void 0&&(R=E[mN]=new Set);var j=w+"__bubble";R.has(j)||(hN(E,w,2,!1),R.add(j))}function b3(w,E,R){var j=0;E&&(j|=4),hN(R,w,j,E)}var D1="_reactListening"+Math.random().toString(36).slice(2);function a0(w){if(!w[D1]){w[D1]=!0,i.forEach(function(R){R!=="selectionchange"&&(N1.has(R)||b3(R,!1,w),b3(R,!0,w))});var E=w.nodeType===9?w:w.ownerDocument;E===null||E[D1]||(E[D1]=!0,b3("selectionchange",!1,E))}}function hN(w,E,R,j){switch(E1(E)){case 1:var Y=Ku;break;case 4:Y=Jo;break;default:Y=_c}R=Y.bind(null,E,R,w),Y=void 0,!Ge||E!=="touchstart"&&E!=="touchmove"&&E!=="wheel"||(Y=!0),j?Y!==void 0?w.addEventListener(E,R,{capture:!0,passive:Y}):w.addEventListener(E,R,!0):Y!==void 0?w.addEventListener(E,R,{passive:Y}):w.addEventListener(E,R,!1)}function y3(w,E,R,j,Y){var ee=j;if((E&1)===0&&(E&2)===0&&j!==null)e:for(;;){if(j===null)return;var be=j.tag;if(be===3||be===4){var Ze=j.stateNode.containerInfo;if(Ze===Y||Ze.nodeType===8&&Ze.parentNode===Y)break;if(be===4)for(be=j.return;be!==null;){var bt=be.tag;if((bt===3||bt===4)&&(bt=be.stateNode.containerInfo,bt===Y||bt.nodeType===8&&bt.parentNode===Y))return;be=be.return}for(;Ze!==null;){if(be=n_(Ze),be===null)return;if(bt=be.tag,bt===5||bt===6){j=ee=be;continue e}Ze=Ze.parentNode}}j=j.return}_e(function(){var on=ee,Xn=Qt(R),ri=[];e:{var Gn=Zk.get(w);if(Gn!==void 0){var Zi=kf,hr=w;switch(w){case"keypress":if(Jc(R)===0)break e;case"keydown":case"keyup":Zi=wo;break;case"focusin":hr="focus",Zi=Ma;break;case"focusout":hr="blur",Zi=Ma;break;case"beforeblur":case"afterblur":Zi=Ma;break;case"click":if(R.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Zi=Vk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Zi=rx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Zi=f3;break;case N$:case D$:case Xk:Zi=k1;break;case wv:Zi=zk;break;case"scroll":Zi=nN;break;case"wheel":Zi=rN;break;case"copy":case"cut":case"paste":Zi=ae;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Zi=Sl}var yr=(E&4)!==0,yc=!yr&&w==="scroll",Ht=yr?Gn!==null?Gn+"Capture":null:Gn;yr=[];for(var kt=on,Kt;kt!==null;){Kt=kt;var _i=Kt.stateNode;if(Kt.tag===5&&_i!==null&&(Kt=_i,Ht!==null&&(_i=Le(kt,Ht),_i!=null&&yr.push(hx(kt,_i,Kt)))),yc)break;kt=kt.return}0<yr.length&&(Gn=new Zi(Gn,hr,null,R,Xn),ri.push({event:Gn,listeners:yr}))}}if((E&7)===0){e:{if(Gn=w==="mouseover"||w==="pointerover",Zi=w==="mouseout"||w==="pointerout",Gn&&R!==Ve&&(hr=R.relatedTarget||R.fromElement)&&(n_(hr)||hr[If]))break e;if((Zi||Gn)&&(Gn=Xn.window===Xn?Xn:(Gn=Xn.ownerDocument)?Gn.defaultView||Gn.parentWindow:window,Zi?(hr=R.relatedTarget||R.toElement,Zi=on,hr=hr?n_(hr):null,hr!==null&&(yc=sn(hr),hr!==yc||hr.tag!==5&&hr.tag!==6)&&(hr=null)):(Zi=null,hr=on),Zi!==hr)){if(yr=Vk,_i="onMouseLeave",Ht="onMouseEnter",kt="mouse",(w==="pointerout"||w==="pointerover")&&(yr=Sl,_i="onPointerLeave",Ht="onPointerEnter",kt="pointer"),yc=Zi==null?Gn:Us(Zi),Kt=hr==null?Gn:Us(hr),Gn=new yr(_i,kt+"leave",Zi,R,Xn),Gn.target=yc,Gn.relatedTarget=Kt,_i=null,n_(Xn)===on&&(yr=new yr(Ht,kt+"enter",hr,R,Xn),yr.target=Kt,yr.relatedTarget=yc,_i=yr),yc=_i,Zi&&hr)t:{for(yr=Zi,Ht=hr,kt=0,Kt=yr;Kt;Kt=fx(Kt))kt++;for(Kt=0,_i=Ht;_i;_i=fx(_i))Kt++;for(;0<kt-Kt;)yr=fx(yr),kt--;for(;0<Kt-kt;)Ht=fx(Ht),Kt--;for(;kt--;){if(yr===Ht||Ht!==null&&yr===Ht.alternate)break t;yr=fx(yr),Ht=fx(Ht)}yr=null}else yr=null;Zi!==null&&Oc(ri,Gn,Zi,yr,!1),hr!==null&&yc!==null&&Oc(ri,yc,hr,yr,!0)}}e:{if(Gn=on?Us(on):window,Zi=Gn.nodeName&&Gn.nodeName.toLowerCase(),Zi==="select"||Zi==="input"&&Gn.type==="file")var kr=Lne;else if(L1(Gn))if(A1)kr=Nt;else{kr=Nne;var Qr=Ane}else(Zi=Gn.nodeName)&&Zi.toLowerCase()==="input"&&(Gn.type==="checkbox"||Gn.type==="radio")&&(kr=cx);if(kr&&(kr=kr(w,on))){m3(ri,kr,R,Xn);break e}Qr&&Qr(w,Gn,on),w==="focusout"&&(Qr=Gn._wrapperState)&&Qr.controlled&&Gn.type==="number"&&St(Gn,"number",Gn.value)}switch(Qr=on?Us(on):window,w){case"focusin":(L1(Qr)||Qr.contentEditable==="true")&&(Cv=Qr,_3=on,e_=null);break;case"focusout":e_=_3=Cv=null;break;case"mousedown":ux=!0;break;case"contextmenu":case"mouseup":case"dragend":ux=!1,Yk(ri,R,Xn);break;case"selectionchange":if(mp)break;case"keydown":case"keyup":Yk(ri,R,Xn)}var qr;if(I1)e:{switch(w){case"compositionstart":var ps="onCompositionStart";break e;case"compositionend":ps="onCompositionEnd";break e;case"compositionupdate":ps="onCompositionUpdate";break e}ps=void 0}else r0?lx(w,R)&&(ps="onCompositionEnd"):w==="keydown"&&R.keyCode===229&&(ps="onCompositionStart");ps&&(ox&&R.locale!=="ko"&&(r0||ps!=="onCompositionStart"?ps==="onCompositionEnd"&&r0&&(qr=Zm()):(Sa=Xn,Xm="value"in Sa?Sa.value:Sa.textContent,r0=!0)),Qr=fN(on,ps),0<Qr.length&&(ps=new re(ps,w,null,R,Xn),ri.push({event:ps,listeners:Qr}),qr?ps.data=qr:(qr=Kk(R),qr!==null&&(ps.data=qr)))),(qr=Uk?s0(w,R):p3(w,R))&&(on=fN(on,"onBeforeInput"),0<on.length&&(Xn=new re("onBeforeInput","beforeinput",null,R,Xn),ri.push({event:Xn,listeners:on}),Xn.data=qr))}P$(ri,E)})}function hx(w,E,R){return{instance:w,listener:E,currentTarget:R}}function fN(w,E){for(var R=E+"Capture",j=[];w!==null;){var Y=w,ee=Y.stateNode;Y.tag===5&&ee!==null&&(Y=ee,ee=Le(w,R),ee!=null&&j.unshift(hx(w,ee,Y)),ee=Le(w,E),ee!=null&&j.push(hx(w,ee,Y))),w=w.return}return j}function fx(w){if(w===null)return null;do w=w.return;while(w&&w.tag!==5);return w||null}function Oc(w,E,R,j,Y){for(var ee=E._reactName,be=[];R!==null&&R!==j;){var Ze=R,bt=Ze.alternate,on=Ze.stateNode;if(bt!==null&&bt===j)break;Ze.tag===5&&on!==null&&(Ze=on,Y?(bt=Le(R,ee),bt!=null&&be.unshift(hx(R,bt,Ze))):Y||(bt=Le(R,ee),bt!=null&&be.push(hx(R,bt,Ze)))),R=R.return}be.length!==0&&w.push({event:E,listeners:be})}var yd=/\r\n?/g,Rne=/\u0000|\uFFFD/g;function O$(w){return(typeof w=="string"?w:""+w).replace(yd,` `).replace(Rne,"")}function eT(w,E,R){if(E=O$(E),O$(w)!==E&&R)throw Error(t(425))}function pN(){}var tT=null,R1=null;function nT(w,E){return w==="textarea"||w==="noscript"||typeof E.children=="string"||typeof E.children=="number"||typeof E.dangerouslySetInnerHTML=="object"&&E.dangerouslySetInnerHTML!==null&&E.dangerouslySetInnerHTML.__html!=null}var l0=typeof setTimeout=="function"?setTimeout:void 0,iT=typeof clearTimeout=="function"?clearTimeout:void 0,px=typeof Promise=="function"?Promise:void 0,gN=typeof queueMicrotask=="function"?queueMicrotask:typeof px<"u"?function(w){return px.resolve(null).then(w).catch(gx)}:l0;function gx(w){setTimeout(function(){throw w})}function C3(w,E){var R=E,j=0;do{var Y=R.nextSibling;if(w.removeChild(R),Y&&Y.nodeType===8)if(R=Y.data,R==="/$"){if(j===0){w.removeChild(Y),Qn(E);return}j--}else R!=="$"&&R!=="$?"&&R!=="$!"||j++;R=Y}while(R);Qn(E)}function c0(w){for(;w!=null;w=w.nextSibling){var E=w.nodeType;if(E===1||E===3)break;if(E===8){if(E=w.data,E==="$"||E==="$!"||E==="$?")break;if(E==="/$")return null}}return w}function M$(w){w=w.previousSibling;for(var E=0;w;){if(w.nodeType===8){var R=w.data;if(R==="$"||R==="$!"||R==="$?"){if(E===0)return w;E--}else R==="/$"&&E++}w=w.previousSibling}return null}var mx=Math.random().toString(36).slice(2),t_="__reactFiber$"+mx,u0="__reactProps$"+mx,If="__reactContainer$"+mx,mN="__reactEvents$"+mx,Te="__reactListeners$"+mx,_x="__reactHandles$"+mx;function n_(w){var E=w[t_];if(E)return E;for(var R=w.parentNode;R;){if(E=R[If]||R[t_]){if(R=E.alternate,E.child!==null||R!==null&&R.child!==null)for(w=M$(w);w!==null;){if(R=w[t_])return R;w=M$(w)}return E}w=R,R=w.parentNode}return null}function Cd(w){return w=w[t_]||w[If],!w||w.tag!==5&&w.tag!==6&&w.tag!==13&&w.tag!==3?null:w}function Us(w){if(w.tag===5||w.tag===6)return w.stateNode;throw Error(t(33))}function _N(w){return w[u0]||null}var w3=[],vx=-1;function $h(w){return{current:w}}function kl(w){0>vx||(w.current=w3[vx],w3[vx]=null,vx--)}function hl(w,E){vx++,w3[vx]=w.current,w.current=E}var d0={},wd=$h(d0),Hh=$h(!1),eh=d0;function bx(w,E){var R=w.type.contextTypes;if(!R)return d0;var j=w.stateNode;if(j&&j.__reactInternalMemoizedUnmaskedChildContext===E)return j.__reactInternalMemoizedMaskedChildContext;var Y={},ee;for(ee in R)Y[ee]=E[ee];return j&&(w=w.stateNode,w.__reactInternalMemoizedUnmaskedChildContext=E,w.__reactInternalMemoizedMaskedChildContext=Y),Y}function Vh(w){return w=w.childContextTypes,w!=null}function vN(){kl(Hh),kl(wd)}function j$(w,E,R){if(wd.current!==d0)throw Error(t(168));hl(wd,E),hl(Hh,R)}function F$(w,E,R){var j=w.stateNode;if(E=E.childContextTypes,typeof j.getChildContext!="function")return R;j=j.getChildContext();for(var Y in j)if(!(Y in E))throw Error(t(108,Me(w)||"Unknown",Y));return H({},R,j)}function _p(w){return w=(w=w.stateNode)&&w.__reactInternalMemoizedMergedChildContext||d0,eh=wd.current,hl(wd,w),hl(Hh,Hh.current),!0}function B$(w,E,R){var j=w.stateNode;if(!j)throw Error(t(169));R?(w=F$(w,E,eh),j.__reactInternalMemoizedMergedChildContext=w,kl(Hh),kl(wd),hl(wd,w)):kl(Hh),hl(Hh,R)}var Sv=null,bN=!1,x3=!1;function $$(w){Sv===null?Sv=[w]:Sv.push(w)}function P1(w){bN=!0,$$(w)}function h0(){if(!x3&&Sv!==null){x3=!0;var w=0,E=sr;try{var R=Sv;for(sr=1;w<R.length;w++){var j=R[w];do j=j(!0);while(j!==null)}Sv=null,bN=!1}catch(Y){throw Sv!==null&&(Sv=Sv.slice(w+1)),Qe(Di,h0),Y}finally{sr=E,x3=!1}}return null}var yx=[],xd=0,yN=null,CN=0,vp=[],bp=0,O1=null,i_=1,r_="";function M1(w,E){yx[xd++]=CN,yx[xd++]=yN,yN=w,CN=E}function H$(w,E,R){vp[bp++]=i_,vp[bp++]=r_,vp[bp++]=O1,O1=w;var j=i_;w=r_;var Y=32-No(j)-1;j&=~(1<<Y),R+=1;var ee=32-No(E)+Y;if(30<ee){var be=Y-Y%5;ee=(j&(1<<be)-1).toString(32),j>>=be,Y-=be,i_=1<<32-No(E)+Y|R<<Y|j,r_=ee+w}else i_=1<<ee|R<<Y|j,r_=w}function rT(w){w.return!==null&&(M1(w,1),H$(w,1,0))}function j1(w){for(;w===yN;)yN=yx[--xd],yx[xd]=null,CN=yx[--xd],yx[xd]=null;for(;w===O1;)O1=vp[--bp],vp[bp]=null,r_=vp[--bp],vp[bp]=null,i_=vp[--bp],vp[bp]=null}var Sd=null,Lf=null,Tl=!1,Dg=null;function s_(w,E){var R=kp(5,null,null,0);R.elementType="DELETED",R.stateNode=E,R.return=w,E=w.deletions,E===null?(w.deletions=[R],w.flags|=16):E.push(R)}function wN(w,E){switch(w.tag){case 5:var R=w.type;return E=E.nodeType!==1||R.toLowerCase()!==E.nodeName.toLowerCase()?null:E,E!==null?(w.stateNode=E,Sd=w,Lf=c0(E.firstChild),!0):!1;case 6:return E=w.pendingProps===""||E.nodeType!==3?null:E,E!==null?(w.stateNode=E,Sd=w,Lf=null,!0):!1;case 13:return E=E.nodeType!==8?null:E,E!==null?(R=O1!==null?{id:i_,overflow:r_}:null,w.memoizedState={dehydrated:E,treeContext:R,retryLane:1073741824},R=kp(18,null,null,0),R.stateNode=E,R.return=w,w.child=R,Sd=w,Lf=null,!0):!1;default:return!1}}function Ev(w){return(w.mode&1)!==0&&(w.flags&128)===0}function Wh(w){if(Tl){var E=Lf;if(E){var R=E;if(!wN(w,E)){if(Ev(w))throw Error(t(418));E=c0(R.nextSibling);var j=Sd;E&&wN(w,E)?s_(j,R):(w.flags=w.flags&-4097|2,Tl=!1,Sd=w)}}else{if(Ev(w))throw Error(t(418));w.flags=w.flags&-4097|2,Tl=!1,Sd=w}}}function V$(w){for(w=w.return;w!==null&&w.tag!==5&&w.tag!==3&&w.tag!==13;)w=w.return;Sd=w}function sT(w){if(w!==Sd)return!1;if(!Tl)return V$(w),Tl=!0,!1;var E;if((E=w.tag!==3)&&!(E=w.tag!==5)&&(E=w.type,E=E!=="head"&&E!=="body"&&!nT(w.type,w.memoizedProps)),E&&(E=Lf)){if(Ev(w))throw S3(),Error(t(418));for(;E;)s_(w,E),E=c0(E.nextSibling)}if(V$(w),w.tag===13){if(w=w.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(t(317));e:{for(w=w.nextSibling,E=0;w;){if(w.nodeType===8){var R=w.data;if(R==="/$"){if(E===0){Lf=c0(w.nextSibling);break e}E--}else R!=="$"&&R!=="$!"&&R!=="$?"||E++}w=w.nextSibling}Lf=null}}else Lf=Sd?c0(w.stateNode.nextSibling):null;return!0}function S3(){for(var w=Lf;w;)w=c0(w.nextSibling)}function o_(){Lf=Sd=null,Tl=!1}function a_(w){Dg===null?Dg=[w]:Dg.push(w)}var W$=C.ReactCurrentBatchConfig;function oT(w,E,R){if(w=R.ref,w!==null&&typeof w!="function"&&typeof w!="object"){if(R._owner){if(R=R._owner,R){if(R.tag!==1)throw Error(t(309));var j=R.stateNode}if(!j)throw Error(t(147,w));var Y=j,ee=""+w;return E!==null&&E.ref!==null&&typeof E.ref=="function"&&E.ref._stringRef===ee?E.ref:(E=function(be){var Ze=Y.refs;be===null?delete Ze[ee]:Ze[ee]=be},E._stringRef=ee,E)}if(typeof w!="string")throw Error(t(284));if(!R._owner)throw Error(t(290,w))}return w}function F1(w,E){throw w=Object.prototype.toString.call(E),Error(t(31,w==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":w))}function z$(w){var E=w._init;return E(w._payload)}function E3(w){function E(Ht,kt){if(w){var Kt=Ht.deletions;Kt===null?(Ht.deletions=[kt],Ht.flags|=16):Kt.push(kt)}}function R(Ht,kt){if(!w)return null;for(;kt!==null;)E(Ht,kt),kt=kt.sibling;return null}function j(Ht,kt){for(Ht=new Map;kt!==null;)kt.key!==null?Ht.set(kt.key,kt):Ht.set(kt.index,kt),kt=kt.sibling;return Ht}function Y(Ht,kt){return Ht=Bg(Ht,kt),Ht.index=0,Ht.sibling=null,Ht}function ee(Ht,kt,Kt){return Ht.index=Kt,w?(Kt=Ht.alternate,Kt!==null?(Kt=Kt.index,Kt<kt?(Ht.flags|=2,kt):Kt):(Ht.flags|=2,kt)):(Ht.flags|=1048576,kt)}function be(Ht){return w&&Ht.alternate===null&&(Ht.flags|=2),Ht}function Ze(Ht,kt,Kt,_i){return kt===null||kt.tag!==6?(kt=d5(Kt,Ht.mode,_i),kt.return=Ht,kt):(kt=Y(kt,Kt),kt.return=Ht,kt)}function bt(Ht,kt,Kt,_i){var kr=Kt.type;return kr===I?Xn(Ht,kt,Kt.props.children,_i,Kt.key):kt!==null&&(kt.elementType===kr||typeof kr=="object"&&kr!==null&&kr.$$typeof===W&&z$(kr)===kt.type)?(_i=Y(kt,Kt.props),_i.ref=oT(Ht,kt,Kt),_i.return=Ht,_i):(_i=iD(Kt.type,Kt.key,Kt.props,null,Ht.mode,_i),_i.ref=oT(Ht,kt,Kt),_i.return=Ht,_i)}function on(Ht,kt,Kt,_i){return kt===null||kt.tag!==4||kt.stateNode.containerInfo!==Kt.containerInfo||kt.stateNode.implementation!==Kt.implementation?(kt=h5(Kt,Ht.mode,_i),kt.return=Ht,kt):(kt=Y(kt,Kt.children||[]),kt.return=Ht,kt)}function Xn(Ht,kt,Kt,_i,kr){return kt===null||kt.tag!==7?(kt=Y1(Kt,Ht.mode,_i,kr),kt.return=Ht,kt):(kt=Y(kt,Kt),kt.return=Ht,kt)}function ri(Ht,kt,Kt){if(typeof kt=="string"&&kt!==""||typeof kt=="number")return kt=d5(""+kt,Ht.mode,Kt),kt.return=Ht,kt;if(typeof kt=="object"&&kt!==null){switch(kt.$$typeof){case S:return Kt=iD(kt.type,kt.key,kt.props,null,Ht.mode,Kt),Kt.ref=oT(Ht,null,kt),Kt.return=Ht,Kt;case k:return kt=h5(kt,Ht.mode,Kt),kt.return=Ht,kt;case W:var _i=kt._init;return ri(Ht,_i(kt._payload),Kt)}if(Ft(kt)||G(kt))return kt=Y1(kt,Ht.mode,Kt,null),kt.return=Ht,kt;F1(Ht,kt)}return null}function Gn(Ht,kt,Kt,_i){var kr=kt!==null?kt.key:null;if(typeof Kt=="string"&&Kt!==""||typeof Kt=="number")return kr!==null?null:Ze(Ht,kt,""+Kt,_i);if(typeof Kt=="object"&&Kt!==null){switch(Kt.$$typeof){case S:return Kt.key===kr?bt(Ht,kt,Kt,_i):null;case k:return Kt.key===kr?on(Ht,kt,Kt,_i):null;case W:return kr=Kt._init,Gn(Ht,kt,kr(Kt._payload),_i)}if(Ft(Kt)||G(Kt))return kr!==null?null:Xn(Ht,kt,Kt,_i,null);F1(Ht,Kt)}return null}function Zi(Ht,kt,Kt,_i,kr){if(typeof _i=="string"&&_i!==""||typeof _i=="number")return Ht=Ht.get(Kt)||null,Ze(kt,Ht,""+_i,kr);if(typeof _i=="object"&&_i!==null){switch(_i.$$typeof){case S:return Ht=Ht.get(_i.key===null?Kt:_i.key)||null,bt(kt,Ht,_i,kr);case k:return Ht=Ht.get(_i.key===null?Kt:_i.key)||null,on(kt,Ht,_i,kr);case W:var Qr=_i._init;return Zi(Ht,kt,Kt,Qr(_i._payload),kr)}if(Ft(_i)||G(_i))return Ht=Ht.get(Kt)||null,Xn(kt,Ht,_i,kr,null);F1(kt,_i)}return null}function hr(Ht,kt,Kt,_i){for(var kr=null,Qr=null,qr=kt,ps=kt=0,Tu=null;qr!==null&&ps<Kt.length;ps++){qr.index>ps?(Tu=qr,qr=null):Tu=qr.sibling;var na=Gn(Ht,qr,Kt[ps],_i);if(na===null){qr===null&&(qr=Tu);break}w&&qr&&na.alternate===null&&E(Ht,qr),kt=ee(na,kt,ps),Qr===null?kr=na:Qr.sibling=na,Qr=na,qr=Tu}if(ps===Kt.length)return R(Ht,qr),Tl&&M1(Ht,ps),kr;if(qr===null){for(;ps<Kt.length;ps++)qr=ri(Ht,Kt[ps],_i),qr!==null&&(kt=ee(qr,kt,ps),Qr===null?kr=qr:Qr.sibling=qr,Qr=qr);return Tl&&M1(Ht,ps),kr}for(qr=j(Ht,qr);ps<Kt.length;ps++)Tu=Zi(qr,Ht,ps,Kt[ps],_i),Tu!==null&&(w&&Tu.alternate!==null&&qr.delete(Tu.key===null?ps:Tu.key),kt=ee(Tu,kt,ps),Qr===null?kr=Tu:Qr.sibling=Tu,Qr=Tu);return w&&qr.forEach(function(S0){return E(Ht,S0)}),Tl&&M1(Ht,ps),kr}function yr(Ht,kt,Kt,_i){var kr=G(Kt);if(typeof kr!="function")throw Error(t(150));if(Kt=kr.call(Kt),Kt==null)throw Error(t(151));for(var Qr=kr=null,qr=kt,ps=kt=0,Tu=null,na=Kt.next();qr!==null&&!na.done;ps++,na=Kt.next()){qr.index>ps?(Tu=qr,qr=null):Tu=qr.sibling;var S0=Gn(Ht,qr,na.value,_i);if(S0===null){qr===null&&(qr=Tu);break}w&&qr&&S0.alternate===null&&E(Ht,qr),kt=ee(S0,kt,ps),Qr===null?kr=S0:Qr.sibling=S0,Qr=S0,qr=Tu}if(na.done)return R(Ht,qr),Tl&&M1(Ht,ps),kr;if(qr===null){for(;!na.done;ps++,na=Kt.next())na=ri(Ht,na.value,_i),na!==null&&(kt=ee(na,kt,ps),Qr===null?kr=na:Qr.sibling=na,Qr=na);return Tl&&M1(Ht,ps),kr}for(qr=j(Ht,qr);!na.done;ps++,na=Kt.next())na=Zi(qr,Ht,ps,na.value,_i),na!==null&&(w&&na.alternate!==null&&qr.delete(na.key===null?ps:na.key),kt=ee(na,kt,ps),Qr===null?kr=na:Qr.sibling=na,Qr=na);return w&&qr.forEach(function(eie){return E(Ht,eie)}),Tl&&M1(Ht,ps),kr}function yc(Ht,kt,Kt,_i){if(typeof Kt=="object"&&Kt!==null&&Kt.type===I&&Kt.key===null&&(Kt=Kt.props.children),typeof Kt=="object"&&Kt!==null){switch(Kt.$$typeof){case S:e:{for(var kr=Kt.key,Qr=kt;Qr!==null;){if(Qr.key===kr){if(kr=Kt.type,kr===I){if(Qr.tag===7){R(Ht,Qr.sibling),kt=Y(Qr,Kt.props.children),kt.return=Ht,Ht=kt;break e}}else if(Qr.elementType===kr||typeof kr=="object"&&kr!==null&&kr.$$typeof===W&&z$(kr)===Qr.type){R(Ht,Qr.sibling),kt=Y(Qr,Kt.props),kt.ref=oT(Ht,Qr,Kt),kt.return=Ht,Ht=kt;break e}R(Ht,Qr);break}else E(Ht,Qr);Qr=Qr.sibling}Kt.type===I?(kt=Y1(Kt.props.children,Ht.mode,_i,Kt.key),kt.return=Ht,Ht=kt):(_i=iD(Kt.type,Kt.key,Kt.props,null,Ht.mode,_i),_i.ref=oT(Ht,kt,Kt),_i.return=Ht,Ht=_i)}return be(Ht);case k:e:{for(Qr=Kt.key;kt!==null;){if(kt.key===Qr)if(kt.tag===4&&kt.stateNode.containerInfo===Kt.containerInfo&&kt.stateNode.implementation===Kt.implementation){R(Ht,kt.sibling),kt=Y(kt,Kt.children||[]),kt.return=Ht,Ht=kt;break e}else{R(Ht,kt);break}else E(Ht,kt);kt=kt.sibling}kt=h5(Kt,Ht.mode,_i),kt.return=Ht,Ht=kt}return be(Ht);case W:return Qr=Kt._init,yc(Ht,kt,Qr(Kt._payload),_i)}if(Ft(Kt))return hr(Ht,kt,Kt,_i);if(G(Kt))return yr(Ht,kt,Kt,_i);F1(Ht,Kt)}return typeof Kt=="string"&&Kt!==""||typeof Kt=="number"?(Kt=""+Kt,kt!==null&&kt.tag===6?(R(Ht,kt.sibling),kt=Y(kt,Kt),kt.return=Ht,Ht=kt):(R(Ht,kt),kt=d5(Kt,Ht.mode,_i),kt.return=Ht,Ht=kt),be(Ht)):R(Ht,kt)}return yc}var oc=E3(!0),xN=E3(!1),aT=$h(null),Af=null,f0=null,Cx=null;function kv(){Cx=f0=Af=null}function SN(w){var E=aT.current;kl(aT),w._currentValue=E}function Yu(w,E,R){for(;w!==null;){var j=w.alternate;if((w.childLanes&E)!==E?(w.childLanes|=E,j!==null&&(j.childLanes|=E)):j!==null&&(j.childLanes&E)!==E&&(j.childLanes|=E),w===R)break;w=w.return}}function p0(w,E){Af=w,Cx=f0=null,w=w.dependencies,w!==null&&w.firstContext!==null&&((w.lanes&E)!==0&&(nh=!0),w.firstContext=null)}function yp(w){var E=w._currentValue;if(Cx!==w)if(w={context:w,memoizedValue:E,next:null},f0===null){if(Af===null)throw Error(t(308));f0=w,Af.dependencies={lanes:0,firstContext:w}}else f0=f0.next=w;return E}var B1=null;function k3(w){B1===null?B1=[w]:B1.push(w)}function EN(w,E,R,j){var Y=E.interleaved;return Y===null?(R.next=R,k3(E)):(R.next=Y.next,Y.next=R),E.interleaved=R,Tv(w,j)}function Tv(w,E){w.lanes|=E;var R=w.alternate;for(R!==null&&(R.lanes|=E),R=w,w=w.return;w!==null;)w.childLanes|=E,R=w.alternate,R!==null&&(R.childLanes|=E),R=w,w=w.return;return R.tag===3?R.stateNode:null}var Cp=!1;function kN(w){w.updateQueue={baseState:w.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function U$(w,E){w=w.updateQueue,E.updateQueue===w&&(E.updateQueue={baseState:w.baseState,firstBaseUpdate:w.firstBaseUpdate,lastBaseUpdate:w.lastBaseUpdate,shared:w.shared,effects:w.effects})}function Iv(w,E){return{eventTime:w,lane:E,tag:0,payload:null,callback:null,next:null}}function wp(w,E,R){var j=w.updateQueue;if(j===null)return null;if(j=j.shared,($o&2)!==0){var Y=j.pending;return Y===null?E.next=E:(E.next=Y.next,Y.next=E),j.pending=E,Tv(w,R)}return Y=j.interleaved,Y===null?(E.next=E,k3(j)):(E.next=Y.next,Y.next=E),j.interleaved=E,Tv(w,R)}function TN(w,E,R){if(E=E.updateQueue,E!==null&&(E=E.shared,(R&4194240)!==0)){var j=E.lanes;j&=w.pendingLanes,R|=j,E.lanes=R,xs(w,R)}}function q$(w,E){var R=w.updateQueue,j=w.alternate;if(j!==null&&(j=j.updateQueue,R===j)){var Y=null,ee=null;if(R=R.firstBaseUpdate,R!==null){do{var be={eventTime:R.eventTime,lane:R.lane,tag:R.tag,payload:R.payload,callback:R.callback,next:null};ee===null?Y=ee=be:ee=ee.next=be,R=R.next}while(R!==null);ee===null?Y=ee=E:ee=ee.next=E}else Y=ee=E;R={baseState:j.baseState,firstBaseUpdate:Y,lastBaseUpdate:ee,shared:j.shared,effects:j.effects},w.updateQueue=R;return}w=R.lastBaseUpdate,w===null?R.firstBaseUpdate=E:w.next=E,R.lastBaseUpdate=E}function wx(w,E,R,j){var Y=w.updateQueue;Cp=!1;var ee=Y.firstBaseUpdate,be=Y.lastBaseUpdate,Ze=Y.shared.pending;if(Ze!==null){Y.shared.pending=null;var bt=Ze,on=bt.next;bt.next=null,be===null?ee=on:be.next=on,be=bt;var Xn=w.alternate;Xn!==null&&(Xn=Xn.updateQueue,Ze=Xn.lastBaseUpdate,Ze!==be&&(Ze===null?Xn.firstBaseUpdate=on:Ze.next=on,Xn.lastBaseUpdate=bt))}if(ee!==null){var ri=Y.baseState;be=0,Xn=on=bt=null,Ze=ee;do{var Gn=Ze.lane,Zi=Ze.eventTime;if((j&Gn)===Gn){Xn!==null&&(Xn=Xn.next={eventTime:Zi,lane:0,tag:Ze.tag,payload:Ze.payload,callback:Ze.callback,next:null});e:{var hr=w,yr=Ze;switch(Gn=E,Zi=R,yr.tag){case 1:if(hr=yr.payload,typeof hr=="function"){ri=hr.call(Zi,ri,Gn);break e}ri=hr;break e;case 3:hr.flags=hr.flags&-65537|128;case 0:if(hr=yr.payload,Gn=typeof hr=="function"?hr.call(Zi,ri,Gn):hr,Gn==null)break e;ri=H({},ri,Gn);break e;case 2:Cp=!0}}Ze.callback!==null&&Ze.lane!==0&&(w.flags|=64,Gn=Y.effects,Gn===null?Y.effects=[Ze]:Gn.push(Ze))}else Zi={eventTime:Zi,lane:Gn,tag:Ze.tag,payload:Ze.payload,callback:Ze.callback,next:null},Xn===null?(on=Xn=Zi,bt=ri):Xn=Xn.next=Zi,be|=Gn;if(Ze=Ze.next,Ze===null){if(Ze=Y.shared.pending,Ze===null)break;Gn=Ze,Ze=Gn.next,Gn.next=null,Y.lastBaseUpdate=Gn,Y.shared.pending=null}}while(!0);if(Xn===null&&(bt=ri),Y.baseState=bt,Y.firstBaseUpdate=on,Y.lastBaseUpdate=Xn,E=Y.shared.interleaved,E!==null){Y=E;do be|=Y.lane,Y=Y.next;while(Y!==E)}else ee===null&&(Y.shared.lanes=0);b0|=be,w.lanes=be,w.memoizedState=ri}}function T3(w,E,R){if(w=E.effects,E.effects=null,w!==null)for(E=0;E<w.length;E++){var j=w[E],Y=j.callback;if(Y!==null){if(j.callback=null,j=R,typeof Y!="function")throw Error(t(191,Y));Y.call(j)}}}var lT={},l_=$h(lT),cT=$h(lT),xx=$h(lT);function Lv(w){if(w===lT)throw Error(t(174));return w}function I3(w,E){switch(hl(xx,E),hl(cT,w),hl(l_,lT),w=E.nodeType,w){case 9:case 11:E=(E=E.documentElement)?E.namespaceURI:ce(null,"");break;default:w=w===8?E.parentNode:E,E=w.namespaceURI||null,w=w.tagName,E=ce(E,w)}kl(l_),hl(l_,E)}function g0(){kl(l_),kl(cT),kl(xx)}function L3(w){Lv(xx.current);var E=Lv(l_.current),R=ce(E,w.type);E!==R&&(hl(cT,w),hl(l_,R))}function IN(w){cT.current===w&&(kl(l_),kl(cT))}var Fl=$h(0);function $1(w){for(var E=w;E!==null;){if(E.tag===13){var R=E.memoizedState;if(R!==null&&(R=R.dehydrated,R===null||R.data==="$?"||R.data==="$!"))return E}else if(E.tag===19&&E.memoizedProps.revealOrder!==void 0){if((E.flags&128)!==0)return E}else if(E.child!==null){E.child.return=E,E=E.child;continue}if(E===w)break;for(;E.sibling===null;){if(E.return===null||E.return===w)return null;E=E.return}E.sibling.return=E.return,E=E.sibling}return null}var A3=[];function LN(){for(var w=0;w<A3.length;w++)A3[w]._workInProgressVersionPrimary=null;A3.length=0}var uT=C.ReactCurrentDispatcher,N3=C.ReactCurrentBatchConfig,m0=0,Ql=null,bc=null,tu=null,Sx=!1,dT=!1,H1=0,no=0;function Ed(){throw Error(t(321))}function D3(w,E){if(E===null)return!1;for(var R=0;R<E.length&&R<w.length;R++)if(!Zt(w[R],E[R]))return!1;return!0}function V1(w,E,R,j,Y,ee){if(m0=ee,Ql=E,E.memoizedState=null,E.updateQueue=null,E.lanes=0,uT.current=w===null||w.memoizedState===null?One:MN,w=R(j,Y),dT){ee=0;do{if(dT=!1,H1=0,25<=ee)throw Error(t(301));ee+=1,tu=bc=null,E.updateQueue=null,uT.current=Ix,w=R(j,Y)}while(dT)}if(uT.current=ON,E=bc!==null&&bc.next!==null,m0=0,tu=bc=Ql=null,Sx=!1,E)throw Error(t(300));return w}function AN(){var w=H1!==0;return H1=0,w}function c_(){var w={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tu===null?Ql.memoizedState=tu=w:tu=tu.next=w,tu}function xp(){if(bc===null){var w=Ql.alternate;w=w!==null?w.memoizedState:null}else w=bc.next;var E=tu===null?Ql.memoizedState:tu.next;if(E!==null)tu=E,bc=w;else{if(w===null)throw Error(t(310));bc=w,w={memoizedState:bc.memoizedState,baseState:bc.baseState,baseQueue:bc.baseQueue,queue:bc.queue,next:null},tu===null?Ql.memoizedState=tu=w:tu=tu.next=w}return tu}function kd(w,E){return typeof E=="function"?E(w):E}function R3(w){var E=xp(),R=E.queue;if(R===null)throw Error(t(311));R.lastRenderedReducer=w;var j=bc,Y=j.baseQueue,ee=R.pending;if(ee!==null){if(Y!==null){var be=Y.next;Y.next=ee.next,ee.next=be}j.baseQueue=Y=ee,R.pending=null}if(Y!==null){ee=Y.next,j=j.baseState;var Ze=be=null,bt=null,on=ee;do{var Xn=on.lane;if((m0&Xn)===Xn)bt!==null&&(bt=bt.next={lane:0,action:on.action,hasEagerState:on.hasEagerState,eagerState:on.eagerState,next:null}),j=on.hasEagerState?on.eagerState:w(j,on.action);else{var ri={lane:Xn,action:on.action,hasEagerState:on.hasEagerState,eagerState:on.eagerState,next:null};bt===null?(Ze=bt=ri,be=j):bt=bt.next=ri,Ql.lanes|=Xn,b0|=Xn}on=on.next}while(on!==null&&on!==ee);bt===null?be=j:bt.next=Ze,Zt(j,E.memoizedState)||(nh=!0),E.memoizedState=j,E.baseState=be,E.baseQueue=bt,R.lastRenderedState=j}if(w=R.interleaved,w!==null){Y=w;do ee=Y.lane,Ql.lanes|=ee,b0|=ee,Y=Y.next;while(Y!==w)}else Y===null&&(R.lanes=0);return[E.memoizedState,R.dispatch]}function Ex(w){var E=xp(),R=E.queue;if(R===null)throw Error(t(311));R.lastRenderedReducer=w;var j=R.dispatch,Y=R.pending,ee=E.memoizedState;if(Y!==null){R.pending=null;var be=Y=Y.next;do ee=w(ee,be.action),be=be.next;while(be!==Y);Zt(ee,E.memoizedState)||(nh=!0),E.memoizedState=ee,E.baseQueue===null&&(E.baseState=ee),R.lastRenderedState=ee}return[ee,j]}function NN(){}function P3(w,E){var R=Ql,j=xp(),Y=E(),ee=!Zt(j.memoizedState,Y);if(ee&&(j.memoizedState=Y,nh=!0),j=j.queue,u_(Av.bind(null,R,j,w),[w]),j.getSnapshot!==E||ee||tu!==null&&tu.memoizedState.tag&1){if(R.flags|=2048,kx(9,zh.bind(null,R,j,Y,E),void 0,null),ku===null)throw Error(t(349));(m0&30)!==0||O3(R,E,Y)}return Y}function O3(w,E,R){w.flags|=16384,w={getSnapshot:E,value:R},E=Ql.updateQueue,E===null?(E={lastEffect:null,stores:null},Ql.updateQueue=E,E.stores=[w]):(R=E.stores,R===null?E.stores=[w]:R.push(w))}function zh(w,E,R,j){E.value=R,E.getSnapshot=j,DN(E)&&M3(w)}function Av(w,E,R){return R(function(){DN(E)&&M3(w)})}function DN(w){var E=w.getSnapshot;w=w.value;try{var R=E();return!Zt(w,R)}catch{return!0}}function M3(w){var E=Tv(w,1);E!==null&&Fg(E,w,1,-1)}function hT(w){var E=c_();return typeof w=="function"&&(w=w()),E.memoizedState=E.baseState=w,w={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kd,lastRenderedState:w},E.queue=w,w=w.dispatch=Z$.bind(null,Ql,w),[E.memoizedState,w]}function kx(w,E,R,j){return w={tag:w,create:E,destroy:R,deps:j,next:null},E=Ql.updateQueue,E===null?(E={lastEffect:null,stores:null},Ql.updateQueue=E,E.lastEffect=w.next=w):(R=E.lastEffect,R===null?E.lastEffect=w.next=w:(j=R.next,R.next=w,w.next=j,E.lastEffect=w)),w}function RN(){return xp().memoizedState}function fT(w,E,R,j){var Y=c_();Ql.flags|=w,Y.memoizedState=kx(1|E,R,void 0,j===void 0?null:j)}function Tx(w,E,R,j){var Y=xp();j=j===void 0?null:j;var ee=void 0;if(bc!==null){var be=bc.memoizedState;if(ee=be.destroy,j!==null&&D3(j,be.deps)){Y.memoizedState=kx(E,R,ee,j);return}}Ql.flags|=w,Y.memoizedState=kx(1|E,R,ee,j)}function PN(w,E){return fT(8390656,8,w,E)}function u_(w,E){return Tx(2048,8,w,E)}function K$(w,E){return Tx(4,2,w,E)}function Nv(w,E){return Tx(4,4,w,E)}function j3(w,E){if(typeof E=="function")return w=w(),E(w),function(){E(null)};if(E!=null)return w=w(),E.current=w,function(){E.current=null}}function F3(w,E,R){return R=R!=null?R.concat([w]):null,Tx(4,4,j3.bind(null,E,w),R)}function pT(){}function G$(w,E){var R=xp();E=E===void 0?null:E;var j=R.memoizedState;return j!==null&&E!==null&&D3(E,j[1])?j[0]:(R.memoizedState=[w,E],w)}function Y$(w,E){var R=xp();E=E===void 0?null:E;var j=R.memoizedState;return j!==null&&E!==null&&D3(E,j[1])?j[0]:(w=w(),R.memoizedState=[w,E],w)}function Q$(w,E,R){return(m0&21)===0?(w.baseState&&(w.baseState=!1,nh=!0),w.memoizedState=R):(Zt(R,E)||(R=Bi(),Ql.lanes|=R,b0|=R,w.baseState=!0),E)}function X$(w,E){var R=sr;sr=R!==0&&4>R?R:4,w(!0);var j=N3.transition;N3.transition={};try{w(!1),E()}finally{sr=R,N3.transition=j}}function B3(){return xp().memoizedState}function Pne(w,E,R){var j=w0(w);if(R={lane:j,action:R,hasEagerState:!1,eagerState:null,next:null},$3(w))th(E,R);else if(R=EN(w,E,R,j),R!==null){var Y=sh();Fg(R,w,j,Y),Rg(R,E,j)}}function Z$(w,E,R){var j=w0(w),Y={lane:j,action:R,hasEagerState:!1,eagerState:null,next:null};if($3(w))th(E,Y);else{var ee=w.alternate;if(w.lanes===0&&(ee===null||ee.lanes===0)&&(ee=E.lastRenderedReducer,ee!==null))try{var be=E.lastRenderedState,Ze=ee(be,R);if(Y.hasEagerState=!0,Y.eagerState=Ze,Zt(Ze,be)){var bt=E.interleaved;bt===null?(Y.next=Y,k3(E)):(Y.next=bt.next,bt.next=Y),E.interleaved=Y;return}}catch{}finally{}R=EN(w,E,Y,j),R!==null&&(Y=sh(),Fg(R,w,j,Y),Rg(R,E,j))}}function $3(w){var E=w.alternate;return w===Ql||E!==null&&E===Ql}function th(w,E){dT=Sx=!0;var R=w.pending;R===null?E.next=E:(E.next=R.next,R.next=E),w.pending=E}function Rg(w,E,R){if((R&4194240)!==0){var j=E.lanes;j&=w.pendingLanes,R|=j,E.lanes=R,xs(w,R)}}var ON={readContext:yp,useCallback:Ed,useContext:Ed,useEffect:Ed,useImperativeHandle:Ed,useInsertionEffect:Ed,useLayoutEffect:Ed,useMemo:Ed,useReducer:Ed,useRef:Ed,useState:Ed,useDebugValue:Ed,useDeferredValue:Ed,useTransition:Ed,useMutableSource:Ed,useSyncExternalStore:Ed,useId:Ed,unstable_isNewReconciler:!1},One={readContext:yp,useCallback:function(w,E){return c_().memoizedState=[w,E===void 0?null:E],w},useContext:yp,useEffect:PN,useImperativeHandle:function(w,E,R){return R=R!=null?R.concat([w]):null,fT(4194308,4,j3.bind(null,E,w),R)},useLayoutEffect:function(w,E){return fT(4194308,4,w,E)},useInsertionEffect:function(w,E){return fT(4,2,w,E)},useMemo:function(w,E){var R=c_();return E=E===void 0?null:E,w=w(),R.memoizedState=[w,E],w},useReducer:function(w,E,R){var j=c_();return E=R!==void 0?R(E):E,j.memoizedState=j.baseState=E,w={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:w,lastRenderedState:E},j.queue=w,w=w.dispatch=Pne.bind(null,Ql,w),[j.memoizedState,w]},useRef:function(w){var E=c_();return w={current:w},E.memoizedState=w},useState:hT,useDebugValue:pT,useDeferredValue:function(w){return c_().memoizedState=w},useTransition:function(){var w=hT(!1),E=w[0];return w=X$.bind(null,w[1]),c_().memoizedState=w,[E,w]},useMutableSource:function(){},useSyncExternalStore:function(w,E,R){var j=Ql,Y=c_();if(Tl){if(R===void 0)throw Error(t(407));R=R()}else{if(R=E(),ku===null)throw Error(t(349));(m0&30)!==0||O3(j,E,R)}Y.memoizedState=R;var ee={value:R,getSnapshot:E};return Y.queue=ee,PN(Av.bind(null,j,ee,w),[w]),j.flags|=2048,kx(9,zh.bind(null,j,ee,R,E),void 0,null),R},useId:function(){var w=c_(),E=ku.identifierPrefix;if(Tl){var R=r_,j=i_;R=(j&~(1<<32-No(j)-1)).toString(32)+R,E=":"+E+"R"+R,R=H1++,0<R&&(E+="H"+R.toString(32)),E+=":"}else R=no++,E=":"+E+"r"+R.toString(32)+":";return w.memoizedState=E},unstable_isNewReconciler:!1},MN={readContext:yp,useCallback:G$,useContext:yp,useEffect:u_,useImperativeHandle:F3,useInsertionEffect:K$,useLayoutEffect:Nv,useMemo:Y$,useReducer:R3,useRef:RN,useState:function(){return R3(kd)},useDebugValue:pT,useDeferredValue:function(w){var E=xp();return Q$(E,bc.memoizedState,w)},useTransition:function(){var w=R3(kd)[0],E=xp().memoizedState;return[w,E]},useMutableSource:NN,useSyncExternalStore:P3,useId:B3,unstable_isNewReconciler:!1},Ix={readContext:yp,useCallback:G$,useContext:yp,useEffect:u_,useImperativeHandle:F3,useInsertionEffect:K$,useLayoutEffect:Nv,useMemo:Y$,useReducer:Ex,useRef:RN,useState:function(){return Ex(kd)},useDebugValue:pT,useDeferredValue:function(w){var E=xp();return bc===null?E.memoizedState=w:Q$(E,bc.memoizedState,w)},useTransition:function(){var w=Ex(kd)[0],E=xp().memoizedState;return[w,E]},useMutableSource:NN,useSyncExternalStore:P3,useId:B3,unstable_isNewReconciler:!1};function Sp(w,E){if(w&&w.defaultProps){E=H({},E),w=w.defaultProps;for(var R in w)E[R]===void 0&&(E[R]=w[R]);return E}return E}function jN(w,E,R,j){E=w.memoizedState,R=R(j,E),R=R==null?E:H({},E,R),w.memoizedState=R,w.lanes===0&&(w.updateQueue.baseState=R)}var FN={isMounted:function(w){return(w=w._reactInternals)?sn(w)===w:!1},enqueueSetState:function(w,E,R){w=w._reactInternals;var j=sh(),Y=w0(w),ee=Iv(j,Y);ee.payload=E,R!=null&&(ee.callback=R),E=wp(w,ee,Y),E!==null&&(Fg(E,w,Y,j),TN(E,w,Y))},enqueueReplaceState:function(w,E,R){w=w._reactInternals;var j=sh(),Y=w0(w),ee=Iv(j,Y);ee.tag=1,ee.payload=E,R!=null&&(ee.callback=R),E=wp(w,ee,Y),E!==null&&(Fg(E,w,Y,j),TN(E,w,Y))},enqueueForceUpdate:function(w,E){w=w._reactInternals;var R=sh(),j=w0(w),Y=Iv(R,j);Y.tag=2,E!=null&&(Y.callback=E),E=wp(w,Y,j),E!==null&&(Fg(E,w,j,R),TN(E,w,j))}};function H3(w,E,R,j,Y,ee,be){return w=w.stateNode,typeof w.shouldComponentUpdate=="function"?w.shouldComponentUpdate(j,ee,be):E.prototype&&E.prototype.isPureReactComponent?!Xi(R,j)||!Xi(Y,ee):!0}function W1(w,E,R){var j=!1,Y=d0,ee=E.contextType;return typeof ee=="object"&&ee!==null?ee=yp(ee):(Y=Vh(E)?eh:wd.current,j=E.contextTypes,ee=(j=j!=null)?bx(w,Y):d0),E=new E(R,ee),w.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=FN,w.stateNode=E,E._reactInternals=w,j&&(w=w.stateNode,w.__reactInternalMemoizedUnmaskedChildContext=Y,w.__reactInternalMemoizedMaskedChildContext=ee),E}function Lx(w,E,R,j){w=E.state,typeof E.componentWillReceiveProps=="function"&&E.componentWillReceiveProps(R,j),typeof E.UNSAFE_componentWillReceiveProps=="function"&&E.UNSAFE_componentWillReceiveProps(R,j),E.state!==w&&FN.enqueueReplaceState(E,E.state,null)}function V3(w,E,R,j){var Y=w.stateNode;Y.props=R,Y.state=w.memoizedState,Y.refs={},kN(w);var ee=E.contextType;typeof ee=="object"&&ee!==null?Y.context=yp(ee):(ee=Vh(E)?eh:wd.current,Y.context=bx(w,ee)),Y.state=w.memoizedState,ee=E.getDerivedStateFromProps,typeof ee=="function"&&(jN(w,E,ee,R),Y.state=w.memoizedState),typeof E.getDerivedStateFromProps=="function"||typeof Y.getSnapshotBeforeUpdate=="function"||typeof Y.UNSAFE_componentWillMount!="function"&&typeof Y.componentWillMount!="function"||(E=Y.state,typeof Y.componentWillMount=="function"&&Y.componentWillMount(),typeof Y.UNSAFE_componentWillMount=="function"&&Y.UNSAFE_componentWillMount(),E!==Y.state&&FN.enqueueReplaceState(Y,Y.state,null),wx(w,R,Y,j),Y.state=w.memoizedState),typeof Y.componentDidMount=="function"&&(w.flags|=4194308)}function z1(w,E){try{var R="",j=E;do R+=fe(j),j=j.return;while(j);var Y=R}catch(ee){Y=` Error generating stack: `+ee.message+` `+ee.stack}return{value:w,source:E,stack:Y,digest:null}}function BN(w,E,R){return{value:w,source:null,stack:R??null,digest:E??null}}function Ax(w,E){try{console.error(E.value)}catch(R){setTimeout(function(){throw R})}}var J$=typeof WeakMap=="function"?WeakMap:Map;function gT(w,E,R){R=Iv(-1,R),R.tag=3,R.payload={element:null};var j=E.value;return R.callback=function(){QN||(QN=!0,r5=j),Ax(w,E)},R}function $N(w,E,R){R=Iv(-1,R),R.tag=3;var j=w.type.getDerivedStateFromError;if(typeof j=="function"){var Y=E.value;R.payload=function(){return j(Y)},R.callback=function(){Ax(w,E)}}var ee=w.stateNode;return ee!==null&&typeof ee.componentDidCatch=="function"&&(R.callback=function(){Ax(w,E),typeof j!="function"&&(y0===null?y0=new Set([this]):y0.add(this));var be=E.stack;this.componentDidCatch(E.value,{componentStack:be!==null?be:""})}),R}function mT(w,E,R){var j=w.pingCache;if(j===null){j=w.pingCache=new J$;var Y=new Set;j.set(E,Y)}else Y=j.get(E),Y===void 0&&(Y=new Set,j.set(E,Y));Y.has(R)||(Y.add(R),w=Wne.bind(null,w,E,R),E.then(w,w))}function eH(w){do{var E;if((E=w.tag===13)&&(E=w.memoizedState,E=E!==null?E.dehydrated!==null:!0),E)return w;w=w.return}while(w!==null);return null}function W3(w,E,R,j,Y){return(w.mode&1)===0?(w===E?w.flags|=65536:(w.flags|=128,R.flags|=131072,R.flags&=-52805,R.tag===1&&(R.alternate===null?R.tag=17:(E=Iv(-1,1),E.tag=2,wp(R,E,1))),R.lanes|=1),w):(w.flags|=65536,w.lanes=Y,w)}var HN=C.ReactCurrentOwner,nh=!1;function Qu(w,E,R,j){E.child=w===null?xN(E,null,R,j):oc(E,w.child,R,j)}function tH(w,E,R,j,Y){R=R.render;var ee=E.ref;return p0(E,Y),j=V1(w,E,R,j,ee,Y),R=AN(),w!==null&&!nh?(E.updateQueue=w.updateQueue,E.flags&=-2053,w.lanes&=~Y,Pg(w,E,Y)):(Tl&&R&&rT(E),E.flags|=1,Qu(w,E,j,Y),E.child)}function z3(w,E,R,j,Y){if(w===null){var ee=R.type;return typeof ee=="function"&&!nD(ee)&&ee.defaultProps===void 0&&R.compare===null&&R.defaultProps===void 0?(E.tag=15,E.type=ee,d_(w,E,ee,j,Y)):(w=iD(R.type,null,j,E,E.mode,Y),w.ref=E.ref,w.return=E,E.child=w)}if(ee=w.child,(w.lanes&Y)===0){var be=ee.memoizedProps;if(R=R.compare,R=R!==null?R:Xi,R(be,j)&&w.ref===E.ref)return Pg(w,E,Y)}return E.flags|=1,w=Bg(ee,j),w.ref=E.ref,w.return=E,E.child=w}function d_(w,E,R,j,Y){if(w!==null){var ee=w.memoizedProps;if(Xi(ee,j)&&w.ref===E.ref)if(nh=!1,E.pendingProps=j=ee,(w.lanes&Y)!==0)(w.flags&131072)!==0&&(nh=!0);else return E.lanes=w.lanes,Pg(w,E,Y)}return K3(w,E,R,j,Y)}function U3(w,E,R){var j=E.pendingProps,Y=j.children,ee=w!==null?w.memoizedState:null;if(j.mode==="hidden")if((E.mode&1)===0)E.memoizedState={baseLanes:0,cachePool:null,transitions:null},hl(Px,Df),Df|=R;else{if((R&1073741824)===0)return w=ee!==null?ee.baseLanes|R:R,E.lanes=E.childLanes=1073741824,E.memoizedState={baseLanes:w,cachePool:null,transitions:null},E.updateQueue=null,hl(Px,Df),Df|=w,null;E.memoizedState={baseLanes:0,cachePool:null,transitions:null},j=ee!==null?ee.baseLanes:R,hl(Px,Df),Df|=j}else ee!==null?(j=ee.baseLanes|R,E.memoizedState=null):j=R,hl(Px,Df),Df|=j;return Qu(w,E,Y,R),E.child}function q3(w,E){var R=E.ref;(w===null&&R!==null||w!==null&&w.ref!==R)&&(E.flags|=512,E.flags|=2097152)}function K3(w,E,R,j,Y){var ee=Vh(R)?eh:wd.current;return ee=bx(E,ee),p0(E,Y),R=V1(w,E,R,j,ee,Y),j=AN(),w!==null&&!nh?(E.updateQueue=w.updateQueue,E.flags&=-2053,w.lanes&=~Y,Pg(w,E,Y)):(Tl&&j&&rT(E),E.flags|=1,Qu(w,E,R,Y),E.child)}function G3(w,E,R,j,Y){if(Vh(R)){var ee=!0;_p(E)}else ee=!1;if(p0(E,Y),E.stateNode===null)WN(w,E),W1(E,R,j),V3(E,R,j,Y),j=!0;else if(w===null){var be=E.stateNode,Ze=E.memoizedProps;be.props=Ze;var bt=be.context,on=R.contextType;typeof on=="object"&&on!==null?on=yp(on):(on=Vh(R)?eh:wd.current,on=bx(E,on));var Xn=R.getDerivedStateFromProps,ri=typeof Xn=="function"||typeof be.getSnapshotBeforeUpdate=="function";ri||typeof be.UNSAFE_componentWillReceiveProps!="function"&&typeof be.componentWillReceiveProps!="function"||(Ze!==j||bt!==on)&&Lx(E,be,j,on),Cp=!1;var Gn=E.memoizedState;be.state=Gn,wx(E,j,be,Y),bt=E.memoizedState,Ze!==j||Gn!==bt||Hh.current||Cp?(typeof Xn=="function"&&(jN(E,R,Xn,j),bt=E.memoizedState),(Ze=Cp||H3(E,R,Ze,j,Gn,bt,on))?(ri||typeof be.UNSAFE_componentWillMount!="function"&&typeof be.componentWillMount!="function"||(typeof be.componentWillMount=="function"&&be.componentWillMount(),typeof be.UNSAFE_componentWillMount=="function"&&be.UNSAFE_componentWillMount()),typeof be.componentDidMount=="function"&&(E.flags|=4194308)):(typeof be.componentDidMount=="function"&&(E.flags|=4194308),E.memoizedProps=j,E.memoizedState=bt),be.props=j,be.state=bt,be.context=on,j=Ze):(typeof be.componentDidMount=="function"&&(E.flags|=4194308),j=!1)}else{be=E.stateNode,U$(w,E),Ze=E.memoizedProps,on=E.type===E.elementType?Ze:Sp(E.type,Ze),be.props=on,ri=E.pendingProps,Gn=be.context,bt=R.contextType,typeof bt=="object"&&bt!==null?bt=yp(bt):(bt=Vh(R)?eh:wd.current,bt=bx(E,bt));var Zi=R.getDerivedStateFromProps;(Xn=typeof Zi=="function"||typeof be.getSnapshotBeforeUpdate=="function")||typeof be.UNSAFE_componentWillReceiveProps!="function"&&typeof be.componentWillReceiveProps!="function"||(Ze!==ri||Gn!==bt)&&Lx(E,be,j,bt),Cp=!1,Gn=E.memoizedState,be.state=Gn,wx(E,j,be,Y);var hr=E.memoizedState;Ze!==ri||Gn!==hr||Hh.current||Cp?(typeof Zi=="function"&&(jN(E,R,Zi,j),hr=E.memoizedState),(on=Cp||H3(E,R,on,j,Gn,hr,bt)||!1)?(Xn||typeof be.UNSAFE_componentWillUpdate!="function"&&typeof be.componentWillUpdate!="function"||(typeof be.componentWillUpdate=="function"&&be.componentWillUpdate(j,hr,bt),typeof be.UNSAFE_componentWillUpdate=="function"&&be.UNSAFE_componentWillUpdate(j,hr,bt)),typeof be.componentDidUpdate=="function"&&(E.flags|=4),typeof be.getSnapshotBeforeUpdate=="function"&&(E.flags|=1024)):(typeof be.componentDidUpdate!="function"||Ze===w.memoizedProps&&Gn===w.memoizedState||(E.flags|=4),typeof be.getSnapshotBeforeUpdate!="function"||Ze===w.memoizedProps&&Gn===w.memoizedState||(E.flags|=1024),E.memoizedProps=j,E.memoizedState=hr),be.props=j,be.state=hr,be.context=bt,j=on):(typeof be.componentDidUpdate!="function"||Ze===w.memoizedProps&&Gn===w.memoizedState||(E.flags|=4),typeof be.getSnapshotBeforeUpdate!="function"||Ze===w.memoizedProps&&Gn===w.memoizedState||(E.flags|=1024),j=!1)}return Y3(w,E,R,j,ee,Y)}function Y3(w,E,R,j,Y,ee){q3(w,E);var be=(E.flags&128)!==0;if(!j&&!be)return Y&&B$(E,R,!1),Pg(w,E,ee);j=E.stateNode,HN.current=E;var Ze=be&&typeof R.getDerivedStateFromError!="function"?null:j.render();return E.flags|=1,w!==null&&be?(E.child=oc(E,w.child,null,ee),E.child=oc(E,null,Ze,ee)):Qu(w,E,Ze,ee),E.memoizedState=j.state,Y&&B$(E,R,!0),E.child}function nH(w){var E=w.stateNode;E.pendingContext?j$(w,E.pendingContext,E.pendingContext!==E.context):E.context&&j$(w,E.context,!1),I3(w,E.containerInfo)}function h_(w,E,R,j,Y){return o_(),a_(Y),E.flags|=256,Qu(w,E,R,j),E.child}var _T={dehydrated:null,treeContext:null,retryLane:0};function vT(w){return{baseLanes:w,cachePool:null,transitions:null}}function VN(w,E,R){var j=E.pendingProps,Y=Fl.current,ee=!1,be=(E.flags&128)!==0,Ze;if((Ze=be)||(Ze=w!==null&&w.memoizedState===null?!1:(Y&2)!==0),Ze?(ee=!0,E.flags&=-129):(w===null||w.memoizedState!==null)&&(Y|=1),hl(Fl,Y&1),w===null)return Wh(E),w=E.memoizedState,w!==null&&(w=w.dehydrated,w!==null)?((E.mode&1)===0?E.lanes=1:w.data==="$!"?E.lanes=8:E.lanes=1073741824,null):(be=j.children,w=j.fallback,ee?(j=E.mode,ee=E.child,be={mode:"hidden",children:be},(j&1)===0&&ee!==null?(ee.childLanes=0,ee.pendingProps=be):ee=rD(be,j,0,null),w=Y1(w,j,R,null),ee.return=E,w.return=E,ee.sibling=w,E.child=ee,E.child.memoizedState=vT(R),E.memoizedState=_T,w):Nx(E,be));if(Y=w.memoizedState,Y!==null&&(Ze=Y.dehydrated,Ze!==null))return is(w,E,be,j,Ze,Y,R);if(ee){ee=j.fallback,be=E.mode,Y=w.child,Ze=Y.sibling;var bt={mode:"hidden",children:j.children};return(be&1)===0&&E.child!==Y?(j=E.child,j.childLanes=0,j.pendingProps=bt,E.deletions=null):(j=Bg(Y,bt),j.subtreeFlags=Y.subtreeFlags&14680064),Ze!==null?ee=Bg(Ze,ee):(ee=Y1(ee,be,R,null),ee.flags|=2),ee.return=E,j.return=E,j.sibling=ee,E.child=j,j=ee,ee=E.child,be=w.child.memoizedState,be=be===null?vT(R):{baseLanes:be.baseLanes|R,cachePool:null,transitions:be.transitions},ee.memoizedState=be,ee.childLanes=w.childLanes&~R,E.memoizedState=_T,j}return ee=w.child,w=ee.sibling,j=Bg(ee,{mode:"visible",children:j.children}),(E.mode&1)===0&&(j.lanes=R),j.return=E,j.sibling=null,w!==null&&(R=E.deletions,R===null?(E.deletions=[w],E.flags|=16):R.push(w)),E.child=j,E.memoizedState=null,j}function Nx(w,E){return E=rD({mode:"visible",children:E},w.mode,0,null),E.return=w,w.child=E}function Dv(w,E,R,j){return j!==null&&a_(j),oc(E,w.child,null,R),w=Nx(E,E.pendingProps.children),w.flags|=2,E.memoizedState=null,w}function is(w,E,R,j,Y,ee,be){if(R)return E.flags&256?(E.flags&=-257,j=BN(Error(t(422))),Dv(w,E,be,j)):E.memoizedState!==null?(E.child=w.child,E.flags|=128,null):(ee=j.fallback,Y=E.mode,j=rD({mode:"visible",children:j.children},Y,0,null),ee=Y1(ee,Y,be,null),ee.flags|=2,j.return=E,ee.return=E,j.sibling=ee,E.child=j,(E.mode&1)!==0&&oc(E,w.child,null,be),E.child.memoizedState=vT(be),E.memoizedState=_T,ee);if((E.mode&1)===0)return Dv(w,E,be,null);if(Y.data==="$!"){if(j=Y.nextSibling&&Y.nextSibling.dataset,j)var Ze=j.dgst;return j=Ze,ee=Error(t(419)),j=BN(ee,j,void 0),Dv(w,E,be,j)}if(Ze=(be&w.childLanes)!==0,nh||Ze){if(j=ku,j!==null){switch(be&-be){case 4:Y=2;break;case 16:Y=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:Y=32;break;case 536870912:Y=268435456;break;default:Y=0}Y=(Y&(j.suspendedLanes|be))!==0?0:Y,Y!==0&&Y!==ee.retryLane&&(ee.retryLane=Y,Tv(w,Y),Fg(j,w,Y,-1))}return u5(),j=BN(Error(t(421))),Dv(w,E,be,j)}return Y.data==="$?"?(E.flags|=128,E.child=w.child,E=zne.bind(null,w),Y._reactRetry=E,null):(w=ee.treeContext,Lf=c0(Y.nextSibling),Sd=E,Tl=!0,Dg=null,w!==null&&(vp[bp++]=i_,vp[bp++]=r_,vp[bp++]=O1,i_=w.id,r_=w.overflow,O1=E),E=Nx(E,j.children),E.flags|=4096,E)}function bT(w,E,R){w.lanes|=E;var j=w.alternate;j!==null&&(j.lanes|=E),Yu(w.return,E,R)}function yT(w,E,R,j,Y){var ee=w.memoizedState;ee===null?w.memoizedState={isBackwards:E,rendering:null,renderingStartTime:0,last:j,tail:R,tailMode:Y}:(ee.isBackwards=E,ee.rendering=null,ee.renderingStartTime=0,ee.last=j,ee.tail=R,ee.tailMode=Y)}function _0(w,E,R){var j=E.pendingProps,Y=j.revealOrder,ee=j.tail;if(Qu(w,E,j.children,R),j=Fl.current,(j&2)!==0)j=j&1|2,E.flags|=128;else{if(w!==null&&(w.flags&128)!==0)e:for(w=E.child;w!==null;){if(w.tag===13)w.memoizedState!==null&&bT(w,R,E);else if(w.tag===19)bT(w,R,E);else if(w.child!==null){w.child.return=w,w=w.child;continue}if(w===E)break e;for(;w.sibling===null;){if(w.return===null||w.return===E)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}j&=1}if(hl(Fl,j),(E.mode&1)===0)E.memoizedState=null;else switch(Y){case"forwards":for(R=E.child,Y=null;R!==null;)w=R.alternate,w!==null&&$1(w)===null&&(Y=R),R=R.sibling;R=Y,R===null?(Y=E.child,E.child=null):(Y=R.sibling,R.sibling=null),yT(E,!1,Y,R,ee);break;case"backwards":for(R=null,Y=E.child,E.child=null;Y!==null;){if(w=Y.alternate,w!==null&&$1(w)===null){E.child=Y;break}w=Y.sibling,Y.sibling=R,R=Y,Y=w}yT(E,!0,R,null,ee);break;case"together":yT(E,!1,null,null,void 0);break;default:E.memoizedState=null}return E.child}function WN(w,E){(E.mode&1)===0&&w!==null&&(w.alternate=null,E.alternate=null,E.flags|=2)}function Pg(w,E,R){if(w!==null&&(E.dependencies=w.dependencies),b0|=E.lanes,(R&E.childLanes)===0)return null;if(w!==null&&E.child!==w.child)throw Error(t(153));if(E.child!==null){for(w=E.child,R=Bg(w,w.pendingProps),E.child=R,R.return=E;w.sibling!==null;)w=w.sibling,R=R.sibling=Bg(w,w.pendingProps),R.return=E;R.sibling=null}return E.child}function iH(w,E,R){switch(E.tag){case 3:nH(E),o_();break;case 5:L3(E);break;case 1:Vh(E.type)&&_p(E);break;case 4:I3(E,E.stateNode.containerInfo);break;case 10:var j=E.type._context,Y=E.memoizedProps.value;hl(aT,j._currentValue),j._currentValue=Y;break;case 13:if(j=E.memoizedState,j!==null)return j.dehydrated!==null?(hl(Fl,Fl.current&1),E.flags|=128,null):(R&E.child.childLanes)!==0?VN(w,E,R):(hl(Fl,Fl.current&1),w=Pg(w,E,R),w!==null?w.sibling:null);hl(Fl,Fl.current&1);break;case 19:if(j=(R&E.childLanes)!==0,(w.flags&128)!==0){if(j)return _0(w,E,R);E.flags|=128}if(Y=E.memoizedState,Y!==null&&(Y.rendering=null,Y.tail=null,Y.lastEffect=null),hl(Fl,Fl.current),j)break;return null;case 22:case 23:return E.lanes=0,U3(w,E,R)}return Pg(w,E,R)}var Xu,Q3,rH,X3;Xu=function(w,E){for(var R=E.child;R!==null;){if(R.tag===5||R.tag===6)w.appendChild(R.stateNode);else if(R.tag!==4&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===E)break;for(;R.sibling===null;){if(R.return===null||R.return===E)return;R=R.return}R.sibling.return=R.return,R=R.sibling}},Q3=function(){},rH=function(w,E,R,j){var Y=w.memoizedProps;if(Y!==j){w=E.stateNode,Lv(l_.current);var ee=null;switch(R){case"input":Y=qe(w,Y),j=qe(w,j),ee=[];break;case"select":Y=H({},Y,{value:void 0}),j=H({},j,{value:void 0}),ee=[];break;case"textarea":Y=Ke(w,Y),j=Ke(w,j),ee=[];break;default:typeof Y.onClick!="function"&&typeof j.onClick=="function"&&(w.onclick=pN)}Ae(R,j);var be;R=null;for(on in Y)if(!j.hasOwnProperty(on)&&Y.hasOwnProperty(on)&&Y[on]!=null)if(on==="style"){var Ze=Y[on];for(be in Ze)Ze.hasOwnProperty(be)&&(R||(R={}),R[be]="")}else on!=="dangerouslySetInnerHTML"&&on!=="children"&&on!=="suppressContentEditableWarning"&&on!=="suppressHydrationWarning"&&on!=="autoFocus"&&(r.hasOwnProperty(on)?ee||(ee=[]):(ee=ee||[]).push(on,null));for(on in j){var bt=j[on];if(Ze=Y!=null?Y[on]:void 0,j.hasOwnProperty(on)&&bt!==Ze&&(bt!=null||Ze!=null))if(on==="style")if(Ze){for(be in Ze)!Ze.hasOwnProperty(be)||bt&&bt.hasOwnProperty(be)||(R||(R={}),R[be]="");for(be in bt)bt.hasOwnProperty(be)&&Ze[be]!==bt[be]&&(R||(R={}),R[be]=bt[be])}else R||(ee||(ee=[]),ee.push(on,R)),R=bt;else on==="dangerouslySetInnerHTML"?(bt=bt?bt.__html:void 0,Ze=Ze?Ze.__html:void 0,bt!=null&&Ze!==bt&&(ee=ee||[]).push(on,bt)):on==="children"?typeof bt!="string"&&typeof bt!="number"||(ee=ee||[]).push(on,""+bt):on!=="suppressContentEditableWarning"&&on!=="suppressHydrationWarning"&&(r.hasOwnProperty(on)?(bt!=null&&on==="onScroll"&&El("scroll",w),ee||Ze===bt||(ee=[])):(ee=ee||[]).push(on,bt))}R&&(ee=ee||[]).push("style",R);var on=ee;(E.updateQueue=on)&&(E.flags|=4)}},X3=function(w,E,R,j){R!==j&&(E.flags|=4)};function CT(w,E){if(!Tl)switch(w.tailMode){case"hidden":E=w.tail;for(var R=null;E!==null;)E.alternate!==null&&(R=E),E=E.sibling;R===null?w.tail=null:R.sibling=null;break;case"collapsed":R=w.tail;for(var j=null;R!==null;)R.alternate!==null&&(j=R),R=R.sibling;j===null?E||w.tail===null?w.tail=null:w.tail.sibling=null:j.sibling=null}}function Zu(w){var E=w.alternate!==null&&w.alternate.child===w.child,R=0,j=0;if(E)for(var Y=w.child;Y!==null;)R|=Y.lanes|Y.childLanes,j|=Y.subtreeFlags&14680064,j|=Y.flags&14680064,Y.return=w,Y=Y.sibling;else for(Y=w.child;Y!==null;)R|=Y.lanes|Y.childLanes,j|=Y.subtreeFlags,j|=Y.flags,Y.return=w,Y=Y.sibling;return w.subtreeFlags|=j,w.childLanes=R,E}function Mne(w,E,R){var j=E.pendingProps;switch(j1(E),E.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zu(E),null;case 1:return Vh(E.type)&&vN(),Zu(E),null;case 3:return j=E.stateNode,g0(),kl(Hh),kl(wd),LN(),j.pendingContext&&(j.context=j.pendingContext,j.pendingContext=null),(w===null||w.child===null)&&(sT(E)?E.flags|=4:w===null||w.memoizedState.isDehydrated&&(E.flags&256)===0||(E.flags|=1024,Dg!==null&&(a5(Dg),Dg=null))),Q3(w,E),Zu(E),null;case 5:IN(E);var Y=Lv(xx.current);if(R=E.type,w!==null&&E.stateNode!=null)rH(w,E,R,j,Y),w.ref!==E.ref&&(E.flags|=512,E.flags|=2097152);else{if(!j){if(E.stateNode===null)throw Error(t(166));return Zu(E),null}if(w=Lv(l_.current),sT(E)){j=E.stateNode,R=E.type;var ee=E.memoizedProps;switch(j[t_]=E,j[u0]=ee,w=(E.mode&1)!==0,R){case"dialog":El("cancel",j),El("close",j);break;case"iframe":case"object":case"embed":El("load",j);break;case"video":case"audio":for(Y=0;Y<xv.length;Y++)El(xv[Y],j);break;case"source":El("error",j);break;case"img":case"image":case"link":El("error",j),El("load",j);break;case"details":El("toggle",j);break;case"input":mt(j,ee),El("invalid",j);break;case"select":j._wrapperState={wasMultiple:!!ee.multiple},El("invalid",j);break;case"textarea":dt(j,ee),El("invalid",j)}Ae(R,ee),Y=null;for(var be in ee)if(ee.hasOwnProperty(be)){var Ze=ee[be];be==="children"?typeof Ze=="string"?j.textContent!==Ze&&(ee.suppressHydrationWarning!==!0&&eT(j.textContent,Ze,w),Y=["children",Ze]):typeof Ze=="number"&&j.textContent!==""+Ze&&(ee.suppressHydrationWarning!==!0&&eT(j.textContent,Ze,w),Y=["children",""+Ze]):r.hasOwnProperty(be)&&Ze!=null&&be==="onScroll"&&El("scroll",j)}switch(R){case"input":Pe(j),tt(j,ee,!0);break;case"textarea":Pe(j),at(j);break;case"select":case"option":break;default:typeof ee.onClick=="function"&&(j.onclick=pN)}j=Y,E.updateQueue=j,j!==null&&(E.flags|=4)}else{be=Y.nodeType===9?Y:Y.ownerDocument,w==="http://www.w3.org/1999/xhtml"&&(w=Oe(R)),w==="http://www.w3.org/1999/xhtml"?R==="script"?(w=be.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild)):typeof j.is=="string"?w=be.createElement(R,{is:j.is}):(w=be.createElement(R),R==="select"&&(be=w,j.multiple?be.multiple=!0:j.size&&(be.size=j.size))):w=be.createElementNS(w,R),w[t_]=E,w[u0]=j,Xu(w,E,!1,!1),E.stateNode=w;e:{switch(be=je(R,j),R){case"dialog":El("cancel",w),El("close",w),Y=j;break;case"iframe":case"object":case"embed":El("load",w),Y=j;break;case"video":case"audio":for(Y=0;Y<xv.length;Y++)El(xv[Y],w);Y=j;break;case"source":El("error",w),Y=j;break;case"img":case"image":case"link":El("error",w),El("load",w),Y=j;break;case"details":El("toggle",w),Y=j;break;case"input":mt(w,j),Y=qe(w,j),El("invalid",w);break;case"option":Y=j;break;case"select":w._wrapperState={wasMultiple:!!j.multiple},Y=H({},j,{value:void 0}),El("invalid",w);break;case"textarea":dt(w,j),Y=Ke(w,j),El("invalid",w);break;default:Y=j}Ae(R,Y),Ze=Y;for(ee in Ze)if(Ze.hasOwnProperty(ee)){var bt=Ze[ee];ee==="style"?se(w,bt):ee==="dangerouslySetInnerHTML"?(bt=bt?bt.__html:void 0,bt!=null&&Xe(w,bt)):ee==="children"?typeof bt=="string"?(R!=="textarea"||bt!=="")&&it(w,bt):typeof bt=="number"&&it(w,""+bt):ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&ee!=="autoFocus"&&(r.hasOwnProperty(ee)?bt!=null&&ee==="onScroll"&&El("scroll",w):bt!=null&&y(w,ee,bt,be))}switch(R){case"input":Pe(w),tt(w,j,!1);break;case"textarea":Pe(w),at(w);break;case"option":j.value!=null&&w.setAttribute("value",""+Ie(j.value));break;case"select":w.multiple=!!j.multiple,ee=j.value,ee!=null?en(w,!!j.multiple,ee,!1):j.defaultValue!=null&&en(w,!!j.multiple,j.defaultValue,!0);break;default:typeof Y.onClick=="function"&&(w.onclick=pN)}switch(R){case"button":case"input":case"select":case"textarea":j=!!j.autoFocus;break e;case"img":j=!0;break e;default:j=!1}}j&&(E.flags|=4)}E.ref!==null&&(E.flags|=512,E.flags|=2097152)}return Zu(E),null;case 6:if(w&&E.stateNode!=null)X3(w,E,w.memoizedProps,j);else{if(typeof j!="string"&&E.stateNode===null)throw Error(t(166));if(R=Lv(xx.current),Lv(l_.current),sT(E)){if(j=E.stateNode,R=E.memoizedProps,j[t_]=E,(ee=j.nodeValue!==R)&&(w=Sd,w!==null))switch(w.tag){case 3:eT(j.nodeValue,R,(w.mode&1)!==0);break;case 5:w.memoizedProps.suppressHydrationWarning!==!0&&eT(j.nodeValue,R,(w.mode&1)!==0)}ee&&(E.flags|=4)}else j=(R.nodeType===9?R:R.ownerDocument).createTextNode(j),j[t_]=E,E.stateNode=j}return Zu(E),null;case 13:if(kl(Fl),j=E.memoizedState,w===null||w.memoizedState!==null&&w.memoizedState.dehydrated!==null){if(Tl&&Lf!==null&&(E.mode&1)!==0&&(E.flags&128)===0)S3(),o_(),E.flags|=98560,ee=!1;else if(ee=sT(E),j!==null&&j.dehydrated!==null){if(w===null){if(!ee)throw Error(t(318));if(ee=E.memoizedState,ee=ee!==null?ee.dehydrated:null,!ee)throw Error(t(317));ee[t_]=E}else o_(),(E.flags&128)===0&&(E.memoizedState=null),E.flags|=4;Zu(E),ee=!1}else Dg!==null&&(a5(Dg),Dg=null),ee=!0;if(!ee)return E.flags&65536?E:null}return(E.flags&128)!==0?(E.lanes=R,E):(j=j!==null,j!==(w!==null&&w.memoizedState!==null)&&j&&(E.child.flags|=8192,(E.mode&1)!==0&&(w===null||(Fl.current&1)!==0?nu===0&&(nu=3):u5())),E.updateQueue!==null&&(E.flags|=4),Zu(E),null);case 4:return g0(),Q3(w,E),w===null&&a0(E.stateNode.containerInfo),Zu(E),null;case 10:return SN(E.type._context),Zu(E),null;case 17:return Vh(E.type)&&vN(),Zu(E),null;case 19:if(kl(Fl),ee=E.memoizedState,ee===null)return Zu(E),null;if(j=(E.flags&128)!==0,be=ee.rendering,be===null)if(j)CT(ee,!1);else{if(nu!==0||w!==null&&(w.flags&128)!==0)for(w=E.child;w!==null;){if(be=$1(w),be!==null){for(E.flags|=128,CT(ee,!1),j=be.updateQueue,j!==null&&(E.updateQueue=j,E.flags|=4),E.subtreeFlags=0,j=R,R=E.child;R!==null;)ee=R,w=j,ee.flags&=14680066,be=ee.alternate,be===null?(ee.childLanes=0,ee.lanes=w,ee.child=null,ee.subtreeFlags=0,ee.memoizedProps=null,ee.memoizedState=null,ee.updateQueue=null,ee.dependencies=null,ee.stateNode=null):(ee.childLanes=be.childLanes,ee.lanes=be.lanes,ee.child=be.child,ee.subtreeFlags=0,ee.deletions=null,ee.memoizedProps=be.memoizedProps,ee.memoizedState=be.memoizedState,ee.updateQueue=be.updateQueue,ee.type=be.type,w=be.dependencies,ee.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext}),R=R.sibling;return hl(Fl,Fl.current&1|2),E.child}w=w.sibling}ee.tail!==null&&mn()>U1&&(E.flags|=128,j=!0,CT(ee,!1),E.lanes=4194304)}else{if(!j)if(w=$1(be),w!==null){if(E.flags|=128,j=!0,R=w.updateQueue,R!==null&&(E.updateQueue=R,E.flags|=4),CT(ee,!0),ee.tail===null&&ee.tailMode==="hidden"&&!be.alternate&&!Tl)return Zu(E),null}else 2*mn()-ee.renderingStartTime>U1&&R!==1073741824&&(E.flags|=128,j=!0,CT(ee,!1),E.lanes=4194304);ee.isBackwards?(be.sibling=E.child,E.child=be):(R=ee.last,R!==null?R.sibling=be:E.child=be,ee.last=be)}return ee.tail!==null?(E=ee.tail,ee.rendering=E,ee.tail=E.sibling,ee.renderingStartTime=mn(),E.sibling=null,R=Fl.current,hl(Fl,j?R&1|2:R&1),E):(Zu(E),null);case 22:case 23:return c5(),j=E.memoizedState!==null,w!==null&&w.memoizedState!==null!==j&&(E.flags|=8192),j&&(E.mode&1)!==0?(Df&1073741824)!==0&&(Zu(E),E.subtreeFlags&6&&(E.flags|=8192)):Zu(E),null;case 24:return null;case 25:return null}throw Error(t(156,E.tag))}function jne(w,E){switch(j1(E),E.tag){case 1:return Vh(E.type)&&vN(),w=E.flags,w&65536?(E.flags=w&-65537|128,E):null;case 3:return g0(),kl(Hh),kl(wd),LN(),w=E.flags,(w&65536)!==0&&(w&128)===0?(E.flags=w&-65537|128,E):null;case 5:return IN(E),null;case 13:if(kl(Fl),w=E.memoizedState,w!==null&&w.dehydrated!==null){if(E.alternate===null)throw Error(t(340));o_()}return w=E.flags,w&65536?(E.flags=w&-65537|128,E):null;case 19:return kl(Fl),null;case 4:return g0(),null;case 10:return SN(E.type._context),null;case 22:case 23:return c5(),null;case 24:return null;default:return null}}var zN=!1,Bl=!1,ih=typeof WeakSet=="function"?WeakSet:Set,ar=null;function Dx(w,E){var R=w.ref;if(R!==null)if(typeof R=="function")try{R(null)}catch(j){Xl(w,E,j)}else R.current=null}function wT(w,E,R){try{R()}catch(j){Xl(w,E,j)}}var sH=!1;function Fne(w,E){if(tT=jl,w=ja(),Gk(w)){if("selectionStart"in w)var R={start:w.selectionStart,end:w.selectionEnd};else e:{R=(R=w.ownerDocument)&&R.defaultView||window;var j=R.getSelection&&R.getSelection();if(j&&j.rangeCount!==0){R=j.anchorNode;var Y=j.anchorOffset,ee=j.focusNode;j=j.focusOffset;try{R.nodeType,ee.nodeType}catch{R=null;break e}var be=0,Ze=-1,bt=-1,on=0,Xn=0,ri=w,Gn=null;t:for(;;){for(var Zi;ri!==R||Y!==0&&ri.nodeType!==3||(Ze=be+Y),ri!==ee||j!==0&&ri.nodeType!==3||(bt=be+j),ri.nodeType===3&&(be+=ri.nodeValue.length),(Zi=ri.firstChild)!==null;)Gn=ri,ri=Zi;for(;;){if(ri===w)break t;if(Gn===R&&++on===Y&&(Ze=be),Gn===ee&&++Xn===j&&(bt=be),(Zi=ri.nextSibling)!==null)break;ri=Gn,Gn=ri.parentNode}ri=Zi}R=Ze===-1||bt===-1?null:{start:Ze,end:bt}}else R=null}R=R||{start:0,end:0}}else R=null;for(R1={focusedElem:w,selectionRange:R},jl=!1,ar=E;ar!==null;)if(E=ar,w=E.child,(E.subtreeFlags&1028)!==0&&w!==null)w.return=E,ar=w;else for(;ar!==null;){E=ar;try{var hr=E.alternate;if((E.flags&1024)!==0)switch(E.tag){case 0:case 11:case 15:break;case 1:if(hr!==null){var yr=hr.memoizedProps,yc=hr.memoizedState,Ht=E.stateNode,kt=Ht.getSnapshotBeforeUpdate(E.elementType===E.type?yr:Sp(E.type,yr),yc);Ht.__reactInternalSnapshotBeforeUpdate=kt}break;case 3:var Kt=E.stateNode.containerInfo;Kt.nodeType===1?Kt.textContent="":Kt.nodeType===9&&Kt.documentElement&&Kt.removeChild(Kt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(_i){Xl(E,E.return,_i)}if(w=E.sibling,w!==null){w.return=E.return,ar=w;break}ar=E.return}return hr=sH,sH=!1,hr}function Rv(w,E,R){var j=E.updateQueue;if(j=j!==null?j.lastEffect:null,j!==null){var Y=j=j.next;do{if((Y.tag&w)===w){var ee=Y.destroy;Y.destroy=void 0,ee!==void 0&&wT(E,R,ee)}Y=Y.next}while(Y!==j)}}function xT(w,E){if(E=E.updateQueue,E=E!==null?E.lastEffect:null,E!==null){var R=E=E.next;do{if((R.tag&w)===w){var j=R.create;R.destroy=j()}R=R.next}while(R!==E)}}function UN(w){var E=w.ref;if(E!==null){var R=w.stateNode;switch(w.tag){case 5:w=R;break;default:w=R}typeof E=="function"?E(w):E.current=w}}function oH(w){var E=w.alternate;E!==null&&(w.alternate=null,oH(E)),w.child=null,w.deletions=null,w.sibling=null,w.tag===5&&(E=w.stateNode,E!==null&&(delete E[t_],delete E[u0],delete E[mN],delete E[Te],delete E[_x])),w.stateNode=null,w.return=null,w.dependencies=null,w.memoizedProps=null,w.memoizedState=null,w.pendingProps=null,w.stateNode=null,w.updateQueue=null}function aH(w){return w.tag===5||w.tag===3||w.tag===4}function lH(w){e:for(;;){for(;w.sibling===null;){if(w.return===null||aH(w.return))return null;w=w.return}for(w.sibling.return=w.return,w=w.sibling;w.tag!==5&&w.tag!==6&&w.tag!==18;){if(w.flags&2||w.child===null||w.tag===4)continue e;w.child.return=w,w=w.child}if(!(w.flags&2))return w.stateNode}}function Z3(w,E,R){var j=w.tag;if(j===5||j===6)w=w.stateNode,E?R.nodeType===8?R.parentNode.insertBefore(w,E):R.insertBefore(w,E):(R.nodeType===8?(E=R.parentNode,E.insertBefore(w,R)):(E=R,E.appendChild(w)),R=R._reactRootContainer,R!=null||E.onclick!==null||(E.onclick=pN));else if(j!==4&&(w=w.child,w!==null))for(Z3(w,E,R),w=w.sibling;w!==null;)Z3(w,E,R),w=w.sibling}function qN(w,E,R){var j=w.tag;if(j===5||j===6)w=w.stateNode,E?R.insertBefore(w,E):R.appendChild(w);else if(j!==4&&(w=w.child,w!==null))for(qN(w,E,R),w=w.sibling;w!==null;)qN(w,E,R),w=w.sibling}var Eu=null,Og=!1;function f_(w,E,R){for(R=R.child;R!==null;)J3(w,E,R),R=R.sibling}function J3(w,E,R){if(Er&&typeof Er.onCommitFiberUnmount=="function")try{Er.onCommitFiberUnmount(ws,R)}catch{}switch(R.tag){case 5:Bl||Dx(R,E);case 6:var j=Eu,Y=Og;Eu=null,f_(w,E,R),Eu=j,Og=Y,Eu!==null&&(Og?(w=Eu,R=R.stateNode,w.nodeType===8?w.parentNode.removeChild(R):w.removeChild(R)):Eu.removeChild(R.stateNode));break;case 18:Eu!==null&&(Og?(w=Eu,R=R.stateNode,w.nodeType===8?C3(w.parentNode,R):w.nodeType===1&&C3(w,R),Qn(w)):C3(Eu,R.stateNode));break;case 4:j=Eu,Y=Og,Eu=R.stateNode.containerInfo,Og=!0,f_(w,E,R),Eu=j,Og=Y;break;case 0:case 11:case 14:case 15:if(!Bl&&(j=R.updateQueue,j!==null&&(j=j.lastEffect,j!==null))){Y=j=j.next;do{var ee=Y,be=ee.destroy;ee=ee.tag,be!==void 0&&((ee&2)!==0||(ee&4)!==0)&&wT(R,E,be),Y=Y.next}while(Y!==j)}f_(w,E,R);break;case 1:if(!Bl&&(Dx(R,E),j=R.stateNode,typeof j.componentWillUnmount=="function"))try{j.props=R.memoizedProps,j.state=R.memoizedState,j.componentWillUnmount()}catch(Ze){Xl(R,E,Ze)}f_(w,E,R);break;case 21:f_(w,E,R);break;case 22:R.mode&1?(Bl=(j=Bl)||R.memoizedState!==null,f_(w,E,R),Bl=j):f_(w,E,R);break;default:f_(w,E,R)}}function Rx(w){var E=w.updateQueue;if(E!==null){w.updateQueue=null;var R=w.stateNode;R===null&&(R=w.stateNode=new ih),E.forEach(function(j){var Y=Une.bind(null,w,j);R.has(j)||(R.add(j),j.then(Y,Y))})}}function Nf(w,E){var R=E.deletions;if(R!==null)for(var j=0;j<R.length;j++){var Y=R[j];try{var ee=w,be=E,Ze=be;e:for(;Ze!==null;){switch(Ze.tag){case 5:Eu=Ze.stateNode,Og=!1;break e;case 3:Eu=Ze.stateNode.containerInfo,Og=!0;break e;case 4:Eu=Ze.stateNode.containerInfo,Og=!0;break e}Ze=Ze.return}if(Eu===null)throw Error(t(160));J3(ee,be,Y),Eu=null,Og=!1;var bt=Y.alternate;bt!==null&&(bt.return=null),Y.return=null}catch(on){Xl(Y,E,on)}}if(E.subtreeFlags&12854)for(E=E.child;E!==null;)e5(E,w),E=E.sibling}function e5(w,E){var R=w.alternate,j=w.flags;switch(w.tag){case 0:case 11:case 14:case 15:if(Nf(E,w),Mg(w),j&4){try{Rv(3,w,w.return),xT(3,w)}catch(yr){Xl(w,w.return,yr)}try{Rv(5,w,w.return)}catch(yr){Xl(w,w.return,yr)}}break;case 1:Nf(E,w),Mg(w),j&512&&R!==null&&Dx(R,R.return);break;case 5:if(Nf(E,w),Mg(w),j&512&&R!==null&&Dx(R,R.return),w.flags&32){var Y=w.stateNode;try{it(Y,"")}catch(yr){Xl(w,w.return,yr)}}if(j&4&&(Y=w.stateNode,Y!=null)){var ee=w.memoizedProps,be=R!==null?R.memoizedProps:ee,Ze=w.type,bt=w.updateQueue;if(w.updateQueue=null,bt!==null)try{Ze==="input"&&ee.type==="radio"&&ee.name!=null&&vt(Y,ee),je(Ze,be);var on=je(Ze,ee);for(be=0;be<bt.length;be+=2){var Xn=bt[be],ri=bt[be+1];Xn==="style"?se(Y,ri):Xn==="dangerouslySetInnerHTML"?Xe(Y,ri):Xn==="children"?it(Y,ri):y(Y,Xn,ri,on)}switch(Ze){case"input":ft(Y,ee);break;case"textarea":nt(Y,ee);break;case"select":var Gn=Y._wrapperState.wasMultiple;Y._wrapperState.wasMultiple=!!ee.multiple;var Zi=ee.value;Zi!=null?en(Y,!!ee.multiple,Zi,!1):Gn!==!!ee.multiple&&(ee.defaultValue!=null?en(Y,!!ee.multiple,ee.defaultValue,!0):en(Y,!!ee.multiple,ee.multiple?[]:"",!1))}Y[u0]=ee}catch(yr){Xl(w,w.return,yr)}}break;case 6:if(Nf(E,w),Mg(w),j&4){if(w.stateNode===null)throw Error(t(162));Y=w.stateNode,ee=w.memoizedProps;try{Y.nodeValue=ee}catch(yr){Xl(w,w.return,yr)}}break;case 3:if(Nf(E,w),Mg(w),j&4&&R!==null&&R.memoizedState.isDehydrated)try{Qn(E.containerInfo)}catch(yr){Xl(w,w.return,yr)}break;case 4:Nf(E,w),Mg(w);break;case 13:Nf(E,w),Mg(w),Y=w.child,Y.flags&8192&&(ee=Y.memoizedState!==null,Y.stateNode.isHidden=ee,!ee||Y.alternate!==null&&Y.alternate.memoizedState!==null||(i5=mn())),j&4&&Rx(w);break;case 22:if(Xn=R!==null&&R.memoizedState!==null,w.mode&1?(Bl=(on=Bl)||Xn,Nf(E,w),Bl=on):Nf(E,w),Mg(w),j&8192){if(on=w.memoizedState!==null,(w.stateNode.isHidden=on)&&!Xn&&(w.mode&1)!==0)for(ar=w,Xn=w.child;Xn!==null;){for(ri=ar=Xn;ar!==null;){switch(Gn=ar,Zi=Gn.child,Gn.tag){case 0:case 11:case 14:case 15:Rv(4,Gn,Gn.return);break;case 1:Dx(Gn,Gn.return);var hr=Gn.stateNode;if(typeof hr.componentWillUnmount=="function"){j=Gn,R=Gn.return;try{E=j,hr.props=E.memoizedProps,hr.state=E.memoizedState,hr.componentWillUnmount()}catch(yr){Xl(j,R,yr)}}break;case 5:Dx(Gn,Gn.return);break;case 22:if(Gn.memoizedState!==null){v0(ri);continue}}Zi!==null?(Zi.return=Gn,ar=Zi):v0(ri)}Xn=Xn.sibling}e:for(Xn=null,ri=w;;){if(ri.tag===5){if(Xn===null){Xn=ri;try{Y=ri.stateNode,on?(ee=Y.style,typeof ee.setProperty=="function"?ee.setProperty("display","none","important"):ee.display="none"):(Ze=ri.stateNode,bt=ri.memoizedProps.style,be=bt!=null&&bt.hasOwnProperty("display")?bt.display:null,Ze.style.display=Rt("display",be))}catch(yr){Xl(w,w.return,yr)}}}else if(ri.tag===6){if(Xn===null)try{ri.stateNode.nodeValue=on?"":ri.memoizedProps}catch(yr){Xl(w,w.return,yr)}}else if((ri.tag!==22&&ri.tag!==23||ri.memoizedState===null||ri===w)&&ri.child!==null){ri.child.return=ri,ri=ri.child;continue}if(ri===w)break e;for(;ri.sibling===null;){if(ri.return===null||ri.return===w)break e;Xn===ri&&(Xn=null),ri=ri.return}Xn===ri&&(Xn=null),ri.sibling.return=ri.return,ri=ri.sibling}}break;case 19:Nf(E,w),Mg(w),j&4&&Rx(w);break;case 21:break;default:Nf(E,w),Mg(w)}}function Mg(w){var E=w.flags;if(E&2){try{e:{for(var R=w.return;R!==null;){if(aH(R)){var j=R;break e}R=R.return}throw Error(t(160))}switch(j.tag){case 5:var Y=j.stateNode;j.flags&32&&(it(Y,""),j.flags&=-33);var ee=lH(w);qN(w,ee,Y);break;case 3:case 4:var be=j.stateNode.containerInfo,Ze=lH(w);Z3(w,Ze,be);break;default:throw Error(t(161))}}catch(bt){Xl(w,w.return,bt)}w.flags&=-3}E&4096&&(w.flags&=-4097)}function KN(w,E,R){ar=w,t5(w)}function t5(w,E,R){for(var j=(w.mode&1)!==0;ar!==null;){var Y=ar,ee=Y.child;if(Y.tag===22&&j){var be=Y.memoizedState!==null||zN;if(!be){var Ze=Y.alternate,bt=Ze!==null&&Ze.memoizedState!==null||Bl;Ze=zN;var on=Bl;if(zN=be,(Bl=bt)&&!on)for(ar=Y;ar!==null;)be=ar,bt=be.child,be.tag===22&&be.memoizedState!==null?cH(Y):bt!==null?(bt.return=be,ar=bt):cH(Y);for(;ee!==null;)ar=ee,t5(ee),ee=ee.sibling;ar=Y,zN=Ze,Bl=on}jg(w)}else(Y.subtreeFlags&8772)!==0&&ee!==null?(ee.return=Y,ar=ee):jg(w)}}function jg(w){for(;ar!==null;){var E=ar;if((E.flags&8772)!==0){var R=E.alternate;try{if((E.flags&8772)!==0)switch(E.tag){case 0:case 11:case 15:Bl||xT(5,E);break;case 1:var j=E.stateNode;if(E.flags&4&&!Bl)if(R===null)j.componentDidMount();else{var Y=E.elementType===E.type?R.memoizedProps:Sp(E.type,R.memoizedProps);j.componentDidUpdate(Y,R.memoizedState,j.__reactInternalSnapshotBeforeUpdate)}var ee=E.updateQueue;ee!==null&&T3(E,ee,j);break;case 3:var be=E.updateQueue;if(be!==null){if(R=null,E.child!==null)switch(E.child.tag){case 5:R=E.child.stateNode;break;case 1:R=E.child.stateNode}T3(E,be,R)}break;case 5:var Ze=E.stateNode;if(R===null&&E.flags&4){R=Ze;var bt=E.memoizedProps;switch(E.type){case"button":case"input":case"select":case"textarea":bt.autoFocus&&R.focus();break;case"img":bt.src&&(R.src=bt.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(E.memoizedState===null){var on=E.alternate;if(on!==null){var Xn=on.memoizedState;if(Xn!==null){var ri=Xn.dehydrated;ri!==null&&Qn(ri)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Bl||E.flags&512&&UN(E)}catch(Gn){Xl(E,E.return,Gn)}}if(E===w){ar=null;break}if(R=E.sibling,R!==null){R.return=E.return,ar=R;break}ar=E.return}}function v0(w){for(;ar!==null;){var E=ar;if(E===w){ar=null;break}var R=E.sibling;if(R!==null){R.return=E.return,ar=R;break}ar=E.return}}function cH(w){for(;ar!==null;){var E=ar;try{switch(E.tag){case 0:case 11:case 15:var R=E.return;try{xT(4,E)}catch(bt){Xl(E,R,bt)}break;case 1:var j=E.stateNode;if(typeof j.componentDidMount=="function"){var Y=E.return;try{j.componentDidMount()}catch(bt){Xl(E,Y,bt)}}var ee=E.return;try{UN(E)}catch(bt){Xl(E,ee,bt)}break;case 5:var be=E.return;try{UN(E)}catch(bt){Xl(E,be,bt)}}}catch(bt){Xl(E,E.return,bt)}if(E===w){ar=null;break}var Ze=E.sibling;if(Ze!==null){Ze.return=E.return,ar=Ze;break}ar=E.return}}var uH=Math.ceil,GN=C.ReactCurrentDispatcher,n5=C.ReactCurrentOwner,Ep=C.ReactCurrentBatchConfig,$o=0,ku=null,Mc=null,Ju=0,Df=0,Px=$h(0),nu=0,ST=null,b0=0,ET=0,YN=0,kT=null,Uh=null,i5=0,U1=1/0,Pv=null,QN=!1,r5=null,y0=null,XN=!1,C0=null,rh=0,TT=0,s5=null,ZN=-1,IT=0;function sh(){return($o&6)!==0?mn():ZN!==-1?ZN:ZN=mn()}function w0(w){return(w.mode&1)===0?1:($o&2)!==0&&Ju!==0?Ju&-Ju:W$.transition!==null?(IT===0&&(IT=Bi()),IT):(w=sr,w!==0||(w=window.event,w=w===void 0?16:E1(w.type)),w)}function Fg(w,E,R,j){if(50<TT)throw TT=0,s5=null,Error(t(185));Br(w,R,j),(($o&2)===0||w!==ku)&&(w===ku&&(($o&2)===0&&(ET|=R),nu===4&&x0(w,Ju)),qh(w,j),R===1&&$o===0&&(E.mode&1)===0&&(U1=mn()+500,bN&&h0()))}function qh(w,E){var R=w.callbackNode;js(w,E);var j=Qi(w,w===ku?Ju:0);if(j===0)R!==null&&ht(R),w.callbackNode=null,w.callbackPriority=0;else if(E=j&-j,w.callbackPriority!==E){if(R!=null&&ht(R),E===1)w.tag===0?P1(dH.bind(null,w)):$$(dH.bind(null,w)),gN(function(){($o&6)===0&&h0()}),R=null;else{switch(Ns(j)){case 1:R=Di;break;case 4:R=cr;break;case 16:R=Li;break;case 536870912:R=rr;break;default:R=Li}R=vH(R,JN.bind(null,w))}w.callbackPriority=E,w.callbackNode=R}}function JN(w,E){if(ZN=-1,IT=0,($o&6)!==0)throw Error(t(327));var R=w.callbackNode;if(Ox()&&w.callbackNode!==R)return null;var j=Qi(w,w===ku?Ju:0);if(j===0)return null;if((j&30)!==0||(j&w.expiredLanes)!==0||E)E=eD(w,j);else{E=j;var Y=$o;$o|=2;var ee=fH();(ku!==w||Ju!==E)&&(Pv=null,U1=mn()+500,K1(w,E));do try{Hne();break}catch(Ze){hH(w,Ze)}while(!0);kv(),GN.current=ee,$o=Y,Mc!==null?E=0:(ku=null,Ju=0,E=nu)}if(E!==0){if(E===2&&(Y=Ro(w),Y!==0&&(j=Y,E=o5(w,Y))),E===1)throw R=ST,K1(w,0),x0(w,j),qh(w,mn()),R;if(E===6)x0(w,j);else{if(Y=w.current.alternate,(j&30)===0&&!Bne(Y)&&(E=eD(w,j),E===2&&(ee=Ro(w),ee!==0&&(j=ee,E=o5(w,ee))),E===1))throw R=ST,K1(w,0),x0(w,j),qh(w,mn()),R;switch(w.finishedWork=Y,w.finishedLanes=j,E){case 0:case 1:throw Error(t(345));case 2:G1(w,Uh,Pv);break;case 3:if(x0(w,j),(j&130023424)===j&&(E=i5+500-mn(),10<E)){if(Qi(w,0)!==0)break;if(Y=w.suspendedLanes,(Y&j)!==j){sh(),w.pingedLanes|=w.suspendedLanes&Y;break}w.timeoutHandle=l0(G1.bind(null,w,Uh,Pv),E);break}G1(w,Uh,Pv);break;case 4:if(x0(w,j),(j&4194240)===j)break;for(E=w.eventTimes,Y=-1;0<j;){var be=31-No(j);ee=1<<be,be=E[be],be>Y&&(Y=be),j&=~ee}if(j=Y,j=mn()-j,j=(120>j?120:480>j?480:1080>j?1080:1920>j?1920:3e3>j?3e3:4320>j?4320:1960*uH(j/1960))-j,10<j){w.timeoutHandle=l0(G1.bind(null,w,Uh,Pv),j);break}G1(w,Uh,Pv);break;case 5:G1(w,Uh,Pv);break;default:throw Error(t(329))}}}return qh(w,mn()),w.callbackNode===R?JN.bind(null,w):null}function o5(w,E){var R=kT;return w.current.memoizedState.isDehydrated&&(K1(w,E).flags|=256),w=eD(w,E),w!==2&&(E=Uh,Uh=R,E!==null&&a5(E)),w}function a5(w){Uh===null?Uh=w:Uh.push.apply(Uh,w)}function Bne(w){for(var E=w;;){if(E.flags&16384){var R=E.updateQueue;if(R!==null&&(R=R.stores,R!==null))for(var j=0;j<R.length;j++){var Y=R[j],ee=Y.getSnapshot;Y=Y.value;try{if(!Zt(ee(),Y))return!1}catch{return!1}}}if(R=E.child,E.subtreeFlags&16384&&R!==null)R.return=E,E=R;else{if(E===w)break;for(;E.sibling===null;){if(E.return===null||E.return===w)return!0;E=E.return}E.sibling.return=E.return,E=E.sibling}}return!0}function x0(w,E){for(E&=~YN,E&=~ET,w.suspendedLanes|=E,w.pingedLanes&=~E,w=w.expirationTimes;0<E;){var R=31-No(E),j=1<<R;w[R]=-1,E&=~j}}function dH(w){if(($o&6)!==0)throw Error(t(327));Ox();var E=Qi(w,0);if((E&1)===0)return qh(w,mn()),null;var R=eD(w,E);if(w.tag!==0&&R===2){var j=Ro(w);j!==0&&(E=j,R=o5(w,j))}if(R===1)throw R=ST,K1(w,0),x0(w,E),qh(w,mn()),R;if(R===6)throw Error(t(345));return w.finishedWork=w.current.alternate,w.finishedLanes=E,G1(w,Uh,Pv),qh(w,mn()),null}function l5(w,E){var R=$o;$o|=1;try{return w(E)}finally{$o=R,$o===0&&(U1=mn()+500,bN&&h0())}}function q1(w){C0!==null&&C0.tag===0&&($o&6)===0&&Ox();var E=$o;$o|=1;var R=Ep.transition,j=sr;try{if(Ep.transition=null,sr=1,w)return w()}finally{sr=j,Ep.transition=R,$o=E,($o&6)===0&&h0()}}function c5(){Df=Px.current,kl(Px)}function K1(w,E){w.finishedWork=null,w.finishedLanes=0;var R=w.timeoutHandle;if(R!==-1&&(w.timeoutHandle=-1,iT(R)),Mc!==null)for(R=Mc.return;R!==null;){var j=R;switch(j1(j),j.tag){case 1:j=j.type.childContextTypes,j!=null&&vN();break;case 3:g0(),kl(Hh),kl(wd),LN();break;case 5:IN(j);break;case 4:g0();break;case 13:kl(Fl);break;case 19:kl(Fl);break;case 10:SN(j.type._context);break;case 22:case 23:c5()}R=R.return}if(ku=w,Mc=w=Bg(w.current,null),Ju=Df=E,nu=0,ST=null,YN=ET=b0=0,Uh=kT=null,B1!==null){for(E=0;E<B1.length;E++)if(R=B1[E],j=R.interleaved,j!==null){R.interleaved=null;var Y=j.next,ee=R.pending;if(ee!==null){var be=ee.next;ee.next=Y,j.next=be}R.pending=j}B1=null}return w}function hH(w,E){do{var R=Mc;try{if(kv(),uT.current=ON,Sx){for(var j=Ql.memoizedState;j!==null;){var Y=j.queue;Y!==null&&(Y.pending=null),j=j.next}Sx=!1}if(m0=0,tu=bc=Ql=null,dT=!1,H1=0,n5.current=null,R===null||R.return===null){nu=1,ST=E,Mc=null;break}e:{var ee=w,be=R.return,Ze=R,bt=E;if(E=Ju,Ze.flags|=32768,bt!==null&&typeof bt=="object"&&typeof bt.then=="function"){var on=bt,Xn=Ze,ri=Xn.tag;if((Xn.mode&1)===0&&(ri===0||ri===11||ri===15)){var Gn=Xn.alternate;Gn?(Xn.updateQueue=Gn.updateQueue,Xn.memoizedState=Gn.memoizedState,Xn.lanes=Gn.lanes):(Xn.updateQueue=null,Xn.memoizedState=null)}var Zi=eH(be);if(Zi!==null){Zi.flags&=-257,W3(Zi,be,Ze,ee,E),Zi.mode&1&&mT(ee,on,E),E=Zi,bt=on;var hr=E.updateQueue;if(hr===null){var yr=new Set;yr.add(bt),E.updateQueue=yr}else hr.add(bt);break e}else{if((E&1)===0){mT(ee,on,E),u5();break e}bt=Error(t(426))}}else if(Tl&&Ze.mode&1){var yc=eH(be);if(yc!==null){(yc.flags&65536)===0&&(yc.flags|=256),W3(yc,be,Ze,ee,E),a_(z1(bt,Ze));break e}}ee=bt=z1(bt,Ze),nu!==4&&(nu=2),kT===null?kT=[ee]:kT.push(ee),ee=be;do{switch(ee.tag){case 3:ee.flags|=65536,E&=-E,ee.lanes|=E;var Ht=gT(ee,bt,E);q$(ee,Ht);break e;case 1:Ze=bt;var kt=ee.type,Kt=ee.stateNode;if((ee.flags&128)===0&&(typeof kt.getDerivedStateFromError=="function"||Kt!==null&&typeof Kt.componentDidCatch=="function"&&(y0===null||!y0.has(Kt)))){ee.flags|=65536,E&=-E,ee.lanes|=E;var _i=$N(ee,Ze,E);q$(ee,_i);break e}}ee=ee.return}while(ee!==null)}gH(R)}catch(kr){E=kr,Mc===R&&R!==null&&(Mc=R=R.return);continue}break}while(!0)}function fH(){var w=GN.current;return GN.current=ON,w===null?ON:w}function u5(){(nu===0||nu===3||nu===2)&&(nu=4),ku===null||(b0&268435455)===0&&(ET&268435455)===0||x0(ku,Ju)}function eD(w,E){var R=$o;$o|=2;var j=fH();(ku!==w||Ju!==E)&&(Pv=null,K1(w,E));do try{$ne();break}catch(Y){hH(w,Y)}while(!0);if(kv(),$o=R,GN.current=j,Mc!==null)throw Error(t(261));return ku=null,Ju=0,nu}function $ne(){for(;Mc!==null;)pH(Mc)}function Hne(){for(;Mc!==null&&!Bt();)pH(Mc)}function pH(w){var E=_H(w.alternate,w,Df);w.memoizedProps=w.pendingProps,E===null?gH(w):Mc=E,n5.current=null}function gH(w){var E=w;do{var R=E.alternate;if(w=E.return,(E.flags&32768)===0){if(R=Mne(R,E,Df),R!==null){Mc=R;return}}else{if(R=jne(R,E),R!==null){R.flags&=32767,Mc=R;return}if(w!==null)w.flags|=32768,w.subtreeFlags=0,w.deletions=null;else{nu=6,Mc=null;return}}if(E=E.sibling,E!==null){Mc=E;return}Mc=E=w}while(E!==null);nu===0&&(nu=5)}function G1(w,E,R){var j=sr,Y=Ep.transition;try{Ep.transition=null,sr=1,Vne(w,E,R,j)}finally{Ep.transition=Y,sr=j}return null}function Vne(w,E,R,j){do Ox();while(C0!==null);if(($o&6)!==0)throw Error(t(327));R=w.finishedWork;var Y=w.finishedLanes;if(R===null)return null;if(w.finishedWork=null,w.finishedLanes=0,R===w.current)throw Error(t(177));w.callbackNode=null,w.callbackPriority=0;var ee=R.lanes|R.childLanes;if(Gr(w,ee),w===ku&&(Mc=ku=null,Ju=0),(R.subtreeFlags&2064)===0&&(R.flags&2064)===0||XN||(XN=!0,vH(Li,function(){return Ox(),null})),ee=(R.flags&15990)!==0,(R.subtreeFlags&15990)!==0||ee){ee=Ep.transition,Ep.transition=null;var be=sr;sr=1;var Ze=$o;$o|=4,n5.current=null,Fne(w,R),e5(R,w),Dne(R1),jl=!!tT,R1=tT=null,w.current=R,KN(R),An(),$o=Ze,sr=be,Ep.transition=ee}else w.current=R;if(XN&&(XN=!1,C0=w,rh=Y),ee=w.pendingLanes,ee===0&&(y0=null),xa(R.stateNode),qh(w,mn()),E!==null)for(j=w.onRecoverableError,R=0;R<E.length;R++)Y=E[R],j(Y.value,{componentStack:Y.stack,digest:Y.digest});if(QN)throw QN=!1,w=r5,r5=null,w;return(rh&1)!==0&&w.tag!==0&&Ox(),ee=w.pendingLanes,(ee&1)!==0?w===s5?TT++:(TT=0,s5=w):TT=0,h0(),null}function Ox(){if(C0!==null){var w=Ns(rh),E=Ep.transition,R=sr;try{if(Ep.transition=null,sr=16>w?16:w,C0===null)var j=!1;else{if(w=C0,C0=null,rh=0,($o&6)!==0)throw Error(t(331));var Y=$o;for($o|=4,ar=w.current;ar!==null;){var ee=ar,be=ee.child;if((ar.flags&16)!==0){var Ze=ee.deletions;if(Ze!==null){for(var bt=0;bt<Ze.length;bt++){var on=Ze[bt];for(ar=on;ar!==null;){var Xn=ar;switch(Xn.tag){case 0:case 11:case 15:Rv(8,Xn,ee)}var ri=Xn.child;if(ri!==null)ri.return=Xn,ar=ri;else for(;ar!==null;){Xn=ar;var Gn=Xn.sibling,Zi=Xn.return;if(oH(Xn),Xn===on){ar=null;break}if(Gn!==null){Gn.return=Zi,ar=Gn;break}ar=Zi}}}var hr=ee.alternate;if(hr!==null){var yr=hr.child;if(yr!==null){hr.child=null;do{var yc=yr.sibling;yr.sibling=null,yr=yc}while(yr!==null)}}ar=ee}}if((ee.subtreeFlags&2064)!==0&&be!==null)be.return=ee,ar=be;else e:for(;ar!==null;){if(ee=ar,(ee.flags&2048)!==0)switch(ee.tag){case 0:case 11:case 15:Rv(9,ee,ee.return)}var Ht=ee.sibling;if(Ht!==null){Ht.return=ee.return,ar=Ht;break e}ar=ee.return}}var kt=w.current;for(ar=kt;ar!==null;){be=ar;var Kt=be.child;if((be.subtreeFlags&2064)!==0&&Kt!==null)Kt.return=be,ar=Kt;else e:for(be=kt;ar!==null;){if(Ze=ar,(Ze.flags&2048)!==0)try{switch(Ze.tag){case 0:case 11:case 15:xT(9,Ze)}}catch(kr){Xl(Ze,Ze.return,kr)}if(Ze===be){ar=null;break e}var _i=Ze.sibling;if(_i!==null){_i.return=Ze.return,ar=_i;break e}ar=Ze.return}}if($o=Y,h0(),Er&&typeof Er.onPostCommitFiberRoot=="function")try{Er.onPostCommitFiberRoot(ws,w)}catch{}j=!0}return j}finally{sr=R,Ep.transition=E}}return!1}function tD(w,E,R){E=z1(R,E),E=gT(w,E,1),w=wp(w,E,1),E=sh(),w!==null&&(Br(w,1,E),qh(w,E))}function Xl(w,E,R){if(w.tag===3)tD(w,w,R);else for(;E!==null;){if(E.tag===3){tD(E,w,R);break}else if(E.tag===1){var j=E.stateNode;if(typeof E.type.getDerivedStateFromError=="function"||typeof j.componentDidCatch=="function"&&(y0===null||!y0.has(j))){w=z1(R,w),w=$N(E,w,1),E=wp(E,w,1),w=sh(),E!==null&&(Br(E,1,w),qh(E,w));break}}E=E.return}}function Wne(w,E,R){var j=w.pingCache;j!==null&&j.delete(E),E=sh(),w.pingedLanes|=w.suspendedLanes&R,ku===w&&(Ju&R)===R&&(nu===4||nu===3&&(Ju&130023424)===Ju&&500>mn()-i5?K1(w,0):YN|=R),qh(w,E)}function mH(w,E){E===0&&((w.mode&1)===0?E=1:(E=Co,Co<<=1,(Co&130023424)===0&&(Co=4194304)));var R=sh();w=Tv(w,E),w!==null&&(Br(w,E,R),qh(w,R))}function zne(w){var E=w.memoizedState,R=0;E!==null&&(R=E.retryLane),mH(w,R)}function Une(w,E){var R=0;switch(w.tag){case 13:var j=w.stateNode,Y=w.memoizedState;Y!==null&&(R=Y.retryLane);break;case 19:j=w.stateNode;break;default:throw Error(t(314))}j!==null&&j.delete(E),mH(w,R)}var _H;_H=function(w,E,R){if(w!==null)if(w.memoizedProps!==E.pendingProps||Hh.current)nh=!0;else{if((w.lanes&R)===0&&(E.flags&128)===0)return nh=!1,iH(w,E,R);nh=(w.flags&131072)!==0}else nh=!1,Tl&&(E.flags&1048576)!==0&&H$(E,CN,E.index);switch(E.lanes=0,E.tag){case 2:var j=E.type;WN(w,E),w=E.pendingProps;var Y=bx(E,wd.current);p0(E,R),Y=V1(null,E,j,w,Y,R);var ee=AN();return E.flags|=1,typeof Y=="object"&&Y!==null&&typeof Y.render=="function"&&Y.$$typeof===void 0?(E.tag=1,E.memoizedState=null,E.updateQueue=null,Vh(j)?(ee=!0,_p(E)):ee=!1,E.memoizedState=Y.state!==null&&Y.state!==void 0?Y.state:null,kN(E),Y.updater=FN,E.stateNode=Y,Y._reactInternals=E,V3(E,j,w,R),E=Y3(null,E,j,!0,ee,R)):(E.tag=0,Tl&&ee&&rT(E),Qu(null,E,Y,R),E=E.child),E;case 16:j=E.elementType;e:{switch(WN(w,E),w=E.pendingProps,Y=j._init,j=Y(j._payload),E.type=j,Y=E.tag=Kne(j),w=Sp(j,w),Y){case 0:E=K3(null,E,j,w,R);break e;case 1:E=G3(null,E,j,w,R);break e;case 11:E=tH(null,E,j,w,R);break e;case 14:E=z3(null,E,j,Sp(j.type,w),R);break e}throw Error(t(306,j,""))}return E;case 0:return j=E.type,Y=E.pendingProps,Y=E.elementType===j?Y:Sp(j,Y),K3(w,E,j,Y,R);case 1:return j=E.type,Y=E.pendingProps,Y=E.elementType===j?Y:Sp(j,Y),G3(w,E,j,Y,R);case 3:e:{if(nH(E),w===null)throw Error(t(387));j=E.pendingProps,ee=E.memoizedState,Y=ee.element,U$(w,E),wx(E,j,null,R);var be=E.memoizedState;if(j=be.element,ee.isDehydrated)if(ee={element:j,isDehydrated:!1,cache:be.cache,pendingSuspenseBoundaries:be.pendingSuspenseBoundaries,transitions:be.transitions},E.updateQueue.baseState=ee,E.memoizedState=ee,E.flags&256){Y=z1(Error(t(423)),E),E=h_(w,E,j,R,Y);break e}else if(j!==Y){Y=z1(Error(t(424)),E),E=h_(w,E,j,R,Y);break e}else for(Lf=c0(E.stateNode.containerInfo.firstChild),Sd=E,Tl=!0,Dg=null,R=xN(E,null,j,R),E.child=R;R;)R.flags=R.flags&-3|4096,R=R.sibling;else{if(o_(),j===Y){E=Pg(w,E,R);break e}Qu(w,E,j,R)}E=E.child}return E;case 5:return L3(E),w===null&&Wh(E),j=E.type,Y=E.pendingProps,ee=w!==null?w.memoizedProps:null,be=Y.children,nT(j,Y)?be=null:ee!==null&&nT(j,ee)&&(E.flags|=32),q3(w,E),Qu(w,E,be,R),E.child;case 6:return w===null&&Wh(E),null;case 13:return VN(w,E,R);case 4:return I3(E,E.stateNode.containerInfo),j=E.pendingProps,w===null?E.child=oc(E,null,j,R):Qu(w,E,j,R),E.child;case 11:return j=E.type,Y=E.pendingProps,Y=E.elementType===j?Y:Sp(j,Y),tH(w,E,j,Y,R);case 7:return Qu(w,E,E.pendingProps,R),E.child;case 8:return Qu(w,E,E.pendingProps.children,R),E.child;case 12:return Qu(w,E,E.pendingProps.children,R),E.child;case 10:e:{if(j=E.type._context,Y=E.pendingProps,ee=E.memoizedProps,be=Y.value,hl(aT,j._currentValue),j._currentValue=be,ee!==null)if(Zt(ee.value,be)){if(ee.children===Y.children&&!Hh.current){E=Pg(w,E,R);break e}}else for(ee=E.child,ee!==null&&(ee.return=E);ee!==null;){var Ze=ee.dependencies;if(Ze!==null){be=ee.child;for(var bt=Ze.firstContext;bt!==null;){if(bt.context===j){if(ee.tag===1){bt=Iv(-1,R&-R),bt.tag=2;var on=ee.updateQueue;if(on!==null){on=on.shared;var Xn=on.pending;Xn===null?bt.next=bt:(bt.next=Xn.next,Xn.next=bt),on.pending=bt}}ee.lanes|=R,bt=ee.alternate,bt!==null&&(bt.lanes|=R),Yu(ee.return,R,E),Ze.lanes|=R;break}bt=bt.next}}else if(ee.tag===10)be=ee.type===E.type?null:ee.child;else if(ee.tag===18){if(be=ee.return,be===null)throw Error(t(341));be.lanes|=R,Ze=be.alternate,Ze!==null&&(Ze.lanes|=R),Yu(be,R,E),be=ee.sibling}else be=ee.child;if(be!==null)be.return=ee;else for(be=ee;be!==null;){if(be===E){be=null;break}if(ee=be.sibling,ee!==null){ee.return=be.return,be=ee;break}be=be.return}ee=be}Qu(w,E,Y.children,R),E=E.child}return E;case 9:return Y=E.type,j=E.pendingProps.children,p0(E,R),Y=yp(Y),j=j(Y),E.flags|=1,Qu(w,E,j,R),E.child;case 14:return j=E.type,Y=Sp(j,E.pendingProps),Y=Sp(j.type,Y),z3(w,E,j,Y,R);case 15:return d_(w,E,E.type,E.pendingProps,R);case 17:return j=E.type,Y=E.pendingProps,Y=E.elementType===j?Y:Sp(j,Y),WN(w,E),E.tag=1,Vh(j)?(w=!0,_p(E)):w=!1,p0(E,R),W1(E,j,Y),V3(E,j,Y,R),Y3(null,E,j,!0,w,R);case 19:return _0(w,E,R);case 22:return U3(w,E,R)}throw Error(t(156,E.tag))};function vH(w,E){return Qe(w,E)}function qne(w,E,R,j){this.tag=w,this.key=R,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=j,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kp(w,E,R,j){return new qne(w,E,R,j)}function nD(w){return w=w.prototype,!(!w||!w.isReactComponent)}function Kne(w){if(typeof w=="function")return nD(w)?1:0;if(w!=null){if(w=w.$$typeof,w===F)return 11;if(w===B)return 14}return 2}function Bg(w,E){var R=w.alternate;return R===null?(R=kp(w.tag,E,w.key,w.mode),R.elementType=w.elementType,R.type=w.type,R.stateNode=w.stateNode,R.alternate=w,w.alternate=R):(R.pendingProps=E,R.type=w.type,R.flags=0,R.subtreeFlags=0,R.deletions=null),R.flags=w.flags&14680064,R.childLanes=w.childLanes,R.lanes=w.lanes,R.child=w.child,R.memoizedProps=w.memoizedProps,R.memoizedState=w.memoizedState,R.updateQueue=w.updateQueue,E=w.dependencies,R.dependencies=E===null?null:{lanes:E.lanes,firstContext:E.firstContext},R.sibling=w.sibling,R.index=w.index,R.ref=w.ref,R}function iD(w,E,R,j,Y,ee){var be=2;if(j=w,typeof w=="function")nD(w)&&(be=1);else if(typeof w=="string")be=5;else e:switch(w){case I:return Y1(R.children,Y,ee,E);case L:be=8,Y|=8;break;case N:return w=kp(12,R,E,Y|2),w.elementType=N,w.lanes=ee,w;case V:return w=kp(13,R,E,Y),w.elementType=V,w.lanes=ee,w;case M:return w=kp(19,R,E,Y),w.elementType=M,w.lanes=ee,w;case q:return rD(R,Y,ee,E);default:if(typeof w=="object"&&w!==null)switch(w.$$typeof){case P:be=10;break e;case O:be=9;break e;case F:be=11;break e;case B:be=14;break e;case W:be=16,j=null;break e}throw Error(t(130,w==null?w:typeof w,""))}return E=kp(be,R,E,Y),E.elementType=w,E.type=j,E.lanes=ee,E}function Y1(w,E,R,j){return w=kp(7,w,j,E),w.lanes=R,w}function rD(w,E,R,j){return w=kp(22,w,j,E),w.elementType=q,w.lanes=R,w.stateNode={isHidden:!1},w}function d5(w,E,R){return w=kp(6,w,null,E),w.lanes=R,w}function h5(w,E,R){return E=kp(4,w.children!==null?w.children:[],w.key,E),E.lanes=R,E.stateNode={containerInfo:w.containerInfo,pendingChildren:null,implementation:w.implementation},E}function Gne(w,E,R,j,Y){this.tag=E,this.containerInfo=w,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vi(0),this.expirationTimes=Vi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vi(0),this.identifierPrefix=j,this.onRecoverableError=Y,this.mutableSourceEagerHydrationData=null}function f5(w,E,R,j,Y,ee,be,Ze,bt){return w=new Gne(w,E,R,Ze,bt),E===1?(E=1,ee===!0&&(E|=8)):E=0,ee=kp(3,null,null,E),w.current=ee,ee.stateNode=w,ee.memoizedState={element:j,isDehydrated:R,cache:null,transitions:null,pendingSuspenseBoundaries:null},kN(ee),w}function Yne(w,E,R){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:j==null?null:""+j,children:w,containerInfo:E,implementation:R}}function bH(w){if(!w)return d0;w=w._reactInternals;e:{if(sn(w)!==w||w.tag!==1)throw Error(t(170));var E=w;do{switch(E.tag){case 3:E=E.stateNode.context;break e;case 1:if(Vh(E.type)){E=E.stateNode.__reactInternalMemoizedMergedChildContext;break e}}E=E.return}while(E!==null);throw Error(t(171))}if(w.tag===1){var R=w.type;if(Vh(R))return F$(w,R,E)}return E}function yH(w,E,R,j,Y,ee,be,Ze,bt){return w=f5(R,j,!0,w,Y,ee,be,Ze,bt),w.context=bH(null),R=w.current,j=sh(),Y=w0(R),ee=Iv(j,Y),ee.callback=E??null,wp(R,ee,Y),w.current.lanes=Y,Br(w,Y,j),qh(w,j),w}function sD(w,E,R,j){var Y=E.current,ee=sh(),be=w0(Y);return R=bH(R),E.context===null?E.context=R:E.pendingContext=R,E=Iv(ee,be),E.payload={element:w},j=j===void 0?null:j,j!==null&&(E.callback=j),w=wp(Y,E,be),w!==null&&(Fg(w,Y,be,ee),TN(w,Y,be)),be}function oD(w){if(w=w.current,!w.child)return null;switch(w.child.tag){case 5:return w.child.stateNode;default:return w.child.stateNode}}function CH(w,E){if(w=w.memoizedState,w!==null&&w.dehydrated!==null){var R=w.retryLane;w.retryLane=R!==0&&R<E?R:E}}function p5(w,E){CH(w,E),(w=w.alternate)&&CH(w,E)}function Qne(){return null}var wH=typeof reportError=="function"?reportError:function(w){console.error(w)};function aD(w){this._internalRoot=w}LT.prototype.render=aD.prototype.render=function(w){var E=this._internalRoot;if(E===null)throw Error(t(409));sD(w,E,null,null)},LT.prototype.unmount=aD.prototype.unmount=function(){var w=this._internalRoot;if(w!==null){this._internalRoot=null;var E=w.containerInfo;q1(function(){sD(null,w,null,null)}),E[If]=null}};function LT(w){this._internalRoot=w}LT.prototype.unstable_scheduleHydration=function(w){if(w){var E=Un();w={blockedOn:null,target:w,priority:E};for(var R=0;R<Hn.length&&E!==0&&E<Hn[R].priority;R++);Hn.splice(R,0,w),R===0&&Cr(w)}};function g5(w){return!(!w||w.nodeType!==1&&w.nodeType!==9&&w.nodeType!==11)}function lD(w){return!(!w||w.nodeType!==1&&w.nodeType!==9&&w.nodeType!==11&&(w.nodeType!==8||w.nodeValue!==" react-mount-point-unstable "))}function xH(){}function Xne(w,E,R,j,Y){if(Y){if(typeof j=="function"){var ee=j;j=function(){var on=oD(be);ee.call(on)}}var be=yH(E,j,w,0,null,!1,!1,"",xH);return w._reactRootContainer=be,w[If]=be.current,a0(w.nodeType===8?w.parentNode:w),q1(),be}for(;Y=w.lastChild;)w.removeChild(Y);if(typeof j=="function"){var Ze=j;j=function(){var on=oD(bt);Ze.call(on)}}var bt=f5(w,0,!1,null,null,!1,!1,"",xH);return w._reactRootContainer=bt,w[If]=bt.current,a0(w.nodeType===8?w.parentNode:w),q1(function(){sD(E,bt,R,j)}),bt}function Q1(w,E,R,j,Y){var ee=R._reactRootContainer;if(ee){var be=ee;if(typeof Y=="function"){var Ze=Y;Y=function(){var bt=oD(be);Ze.call(bt)}}sD(E,be,w,Y)}else be=Xne(R,E,w,Y,j);return oD(be)}uo=function(w){switch(w.tag){case 3:var E=w.stateNode;if(E.current.memoizedState.isDehydrated){var R=ul(E.pendingLanes);R!==0&&(xs(E,R|1),qh(E,mn()),($o&6)===0&&(U1=mn()+500,h0()))}break;case 13:q1(function(){var j=Tv(w,1);if(j!==null){var Y=sh();Fg(j,w,1,Y)}}),p5(w,1)}},yi=function(w){if(w.tag===13){var E=Tv(w,134217728);if(E!==null){var R=sh();Fg(E,w,134217728,R)}p5(w,134217728)}},vn=function(w){if(w.tag===13){var E=w0(w),R=Tv(w,E);if(R!==null){var j=sh();Fg(R,w,E,j)}p5(w,E)}},Un=function(){return sr},Mn=function(w,E){var R=sr;try{return sr=w,E()}finally{sr=R}},rt=function(w,E,R){switch(E){case"input":if(ft(w,R),E=R.name,R.type==="radio"&&E!=null){for(R=w;R.parentNode;)R=R.parentNode;for(R=R.querySelectorAll("input[name="+JSON.stringify(""+E)+'][type="radio"]'),E=0;E<R.length;E++){var j=R[E];if(j!==w&&j.form===w.form){var Y=_N(j);if(!Y)throw Error(t(90));Be(j),ft(j,Y)}}}break;case"textarea":nt(w,R);break;case"select":E=R.value,E!=null&&en(w,!!R.multiple,E,!1)}},oi=l5,_n=q1;var Zne={usingClientEntryPoint:!1,Events:[Cd,Us,_N,Mi,si,l5]},AT={findFiberByHostInstance:n_,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jne={bundleType:AT.bundleType,version:AT.version,rendererPackageName:AT.rendererPackageName,rendererConfig:AT.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(w){return w=Dt(w),w===null?null:w.stateNode},findFiberByHostInstance:AT.findFiberByHostInstance||Qne,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cD=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cD.isDisabled&&cD.supportsFiber)try{ws=cD.inject(Jne),Er=cD}catch{}}return Ap.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Zne,Ap.createPortal=function(w,E){var R=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g5(E))throw Error(t(200));return Yne(w,E,null,R)},Ap.createRoot=function(w,E){if(!g5(w))throw Error(t(299));var R=!1,j="",Y=wH;return E!=null&&(E.unstable_strictMode===!0&&(R=!0),E.identifierPrefix!==void 0&&(j=E.identifierPrefix),E.onRecoverableError!==void 0&&(Y=E.onRecoverableError)),E=f5(w,1,!1,null,null,R,!1,j,Y),w[If]=E.current,a0(w.nodeType===8?w.parentNode:w),new aD(E)},Ap.findDOMNode=function(w){if(w==null)return null;if(w.nodeType===1)return w;var E=w._reactInternals;if(E===void 0)throw typeof w.render=="function"?Error(t(188)):(w=Object.keys(w).join(","),Error(t(268,w)));return w=Dt(E),w=w===null?null:w.stateNode,w},Ap.flushSync=function(w){return q1(w)},Ap.hydrate=function(w,E,R){if(!lD(E))throw Error(t(200));return Q1(null,w,E,!0,R)},Ap.hydrateRoot=function(w,E,R){if(!g5(w))throw Error(t(405));var j=R!=null&&R.hydratedSources||null,Y=!1,ee="",be=wH;if(R!=null&&(R.unstable_strictMode===!0&&(Y=!0),R.identifierPrefix!==void 0&&(ee=R.identifierPrefix),R.onRecoverableError!==void 0&&(be=R.onRecoverableError)),E=yH(E,null,w,1,R??null,Y,!1,ee,be),w[If]=E.current,a0(w),j)for(w=0;w<j.length;w++)R=j[w],Y=R._getVersion,Y=Y(R._source),E.mutableSourceEagerHydrationData==null?E.mutableSourceEagerHydrationData=[R,Y]:E.mutableSourceEagerHydrationData.push(R,Y);return new LT(E)},Ap.render=function(w,E,R){if(!lD(E))throw Error(t(200));return Q1(null,w,E,!1,R)},Ap.unmountComponentAtNode=function(w){if(!lD(w))throw Error(t(40));return w._reactRootContainer?(q1(function(){Q1(null,null,w,!1,function(){w._reactRootContainer=null,w[If]=null})}),!0):!1},Ap.unstable_batchedUpdates=l5,Ap.unstable_renderSubtreeIntoContainer=function(w,E,R,j){if(!lD(R))throw Error(t(200));if(w==null||w._reactInternals===void 0)throw Error(t(38));return Q1(w,E,R,!1,j)},Ap.version="18.3.1-next-f1338f8080-20240426",Ap}var wLe;function gVe(){if(wLe)return vie.exports;wLe=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),vie.exports=svt(),vie.exports}var Bm=gVe();const J6=Cl(Bm),ovt=fVe({__proto__:null,default:J6},[Bm]);function avt(n){n()}let mVe=avt;const lvt=n=>mVe=n,cvt=()=>mVe,xLe=Symbol.for("react-redux-context"),SLe=typeof globalThis<"u"?globalThis:{};function uvt(){var n;if(!x.createContext)return{};const e=(n=SLe[xLe])!=null?n:SLe[xLe]=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}const mw=uvt();function H1e(n=mw){return function(){return x.useContext(n)}}const _Ve=H1e(),vVe=()=>{throw new Error("uSES not initialized!")};let bVe=vVe;const dvt=n=>{bVe=n},hvt=(n,e)=>n===e;function fvt(n=mw){const e=n===mw?_Ve:H1e(n);return function(i,r={}){const{equalityFn:s=hvt,stabilityCheck:o=void 0,noopCheck:a=void 0}=typeof r=="function"?{equalityFn:r}:r,{store:l,subscription:c,getServerState:u,stabilityCheck:d,noopCheck:f}=e();x.useRef(!0);const p=x.useCallback({[i.name](m){return i(m)}}[i.name],[i,d,o]),g=bVe(c.addNestedSub,l.getState,u||l.getState,p,s);return x.useDebugValue(g),g}}const Cu=fvt();function hn(){return hn=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},hn.apply(null,arguments)}function V1e(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var Cie={exports:{}},Ba={};/** @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 ELe;function pvt(){if(ELe)return Ba;ELe=1;var n=typeof Symbol=="function"&&Symbol.for,e=n?Symbol.for("react.element"):60103,t=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,r=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,o=n?Symbol.for("react.provider"):60109,a=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,u=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,p=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,m=n?Symbol.for("react.block"):60121,_=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function y(S){if(typeof S=="object"&&S!==null){var k=S.$$typeof;switch(k){case e:switch(S=S.type,S){case l:case c:case i:case s:case r:case d:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case g:case p:case o:return S;default:return k}}case t:return k}}}function C(S){return y(S)===c}return Ba.AsyncMode=l,Ba.ConcurrentMode=c,Ba.ContextConsumer=a,Ba.ContextProvider=o,Ba.Element=e,Ba.ForwardRef=u,Ba.Fragment=i,Ba.Lazy=g,Ba.Memo=p,Ba.Portal=t,Ba.Profiler=s,Ba.StrictMode=r,Ba.Suspense=d,Ba.isAsyncMode=function(S){return C(S)||y(S)===l},Ba.isConcurrentMode=C,Ba.isContextConsumer=function(S){return y(S)===a},Ba.isContextProvider=function(S){return y(S)===o},Ba.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},Ba.isForwardRef=function(S){return y(S)===u},Ba.isFragment=function(S){return y(S)===i},Ba.isLazy=function(S){return y(S)===g},Ba.isMemo=function(S){return y(S)===p},Ba.isPortal=function(S){return y(S)===t},Ba.isProfiler=function(S){return y(S)===s},Ba.isStrictMode=function(S){return y(S)===r},Ba.isSuspense=function(S){return y(S)===d},Ba.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===i||S===c||S===s||S===r||S===d||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===g||S.$$typeof===p||S.$$typeof===o||S.$$typeof===a||S.$$typeof===u||S.$$typeof===_||S.$$typeof===v||S.$$typeof===b||S.$$typeof===m)},Ba.typeOf=y,Ba}var kLe;function gvt(){return kLe||(kLe=1,Cie.exports=pvt()),Cie.exports}var wie,TLe;function mvt(){if(TLe)return wie;TLe=1;var n=gvt(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},t={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=i,s[n.Memo]=r;function o(g){return n.isMemo(g)?r:s[g.$$typeof]||e}var a=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,f=Object.prototype;function p(g,m,_){if(typeof m!="string"){if(f){var v=d(m);v&&v!==f&&p(g,v,_)}var b=l(m);c&&(b=b.concat(c(m)));for(var y=o(g),C=o(m),S=0;S<b.length;++S){var k=b[S];if(!t[k]&&!(_&&_[k])&&!(C&&C[k])&&!(y&&y[k])){var I=u(m,k);try{a(g,k,I)}catch{}}}}return g}return wie=p,wie}var _vt=mvt();const ILe=Cl(_vt);var xie={exports:{}},$a={};/** * @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 LLe;function vvt(){if(LLe)return $a;LLe=1;var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g;g=Symbol.for("react.module.reference");function m(_){if(typeof _=="object"&&_!==null){var v=_.$$typeof;switch(v){case n:switch(_=_.type,_){case t:case r:case i:case c:case u:return _;default:switch(_=_&&_.$$typeof,_){case a:case o:case l:case f:case d:case s:return _;default:return v}}case e:return v}}}return $a.ContextConsumer=o,$a.ContextProvider=s,$a.Element=n,$a.ForwardRef=l,$a.Fragment=t,$a.Lazy=f,$a.Memo=d,$a.Portal=e,$a.Profiler=r,$a.StrictMode=i,$a.Suspense=c,$a.SuspenseList=u,$a.isAsyncMode=function(){return!1},$a.isConcurrentMode=function(){return!1},$a.isContextConsumer=function(_){return m(_)===o},$a.isContextProvider=function(_){return m(_)===s},$a.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===n},$a.isForwardRef=function(_){return m(_)===l},$a.isFragment=function(_){return m(_)===t},$a.isLazy=function(_){return m(_)===f},$a.isMemo=function(_){return m(_)===d},$a.isPortal=function(_){return m(_)===e},$a.isProfiler=function(_){return m(_)===r},$a.isStrictMode=function(_){return m(_)===i},$a.isSuspense=function(_){return m(_)===c},$a.isSuspenseList=function(_){return m(_)===u},$a.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===t||_===r||_===i||_===c||_===u||_===p||typeof _=="object"&&_!==null&&(_.$$typeof===f||_.$$typeof===d||_.$$typeof===s||_.$$typeof===o||_.$$typeof===l||_.$$typeof===g||_.getModuleId!==void 0)},$a.typeOf=m,$a}var ALe;function bvt(){return ALe||(ALe=1,xie.exports=vvt()),xie.exports}var yvt=bvt();const Cvt=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function wvt(n,e,t,i,{areStatesEqual:r,areOwnPropsEqual:s,areStatePropsEqual:o}){let a=!1,l,c,u,d,f;function p(b,y){return l=b,c=y,u=n(l,c),d=e(i,c),f=t(u,d,c),a=!0,f}function g(){return u=n(l,c),e.dependsOnOwnProps&&(d=e(i,c)),f=t(u,d,c),f}function m(){return n.dependsOnOwnProps&&(u=n(l,c)),e.dependsOnOwnProps&&(d=e(i,c)),f=t(u,d,c),f}function _(){const b=n(l,c),y=!o(b,u);return u=b,y&&(f=t(u,d,c)),f}function v(b,y){const C=!s(y,c),S=!r(b,l,y,c);return l=b,c=y,C&&S?g():C?m():S?_():f}return function(y,C){return a?v(y,C):p(y,C)}}function xvt(n,e){let{initMapStateToProps:t,initMapDispatchToProps:i,initMergeProps:r}=e,s=V1e(e,Cvt);const o=t(n,s),a=i(n,s),l=r(n,s);return wvt(o,a,l,n,s)}function Svt(n,e){const t={};for(const i in n){const r=n[i];typeof r=="function"&&(t[i]=(...s)=>e(r(...s)))}return t}function fde(n){return function(t){const i=n(t);function r(){return i}return r.dependsOnOwnProps=!1,r}}function NLe(n){return n.dependsOnOwnProps?!!n.dependsOnOwnProps:n.length!==1}function yVe(n,e){return function(i,{displayName:r}){const s=function(a,l){return s.dependsOnOwnProps?s.mapToProps(a,l):s.mapToProps(a,void 0)};return s.dependsOnOwnProps=!0,s.mapToProps=function(a,l){s.mapToProps=n,s.dependsOnOwnProps=NLe(n);let c=s(a,l);return typeof c=="function"&&(s.mapToProps=c,s.dependsOnOwnProps=NLe(c),c=s(a,l)),c},s}}function W1e(n,e){return(t,i)=>{throw new Error(`Invalid value of type ${typeof n} for ${e} argument when connecting component ${i.wrappedComponentName}.`)}}function Evt(n){return n&&typeof n=="object"?fde(e=>Svt(n,e)):n?typeof n=="function"?yVe(n):W1e(n,"mapDispatchToProps"):fde(e=>({dispatch:e}))}function kvt(n){return n?typeof n=="function"?yVe(n):W1e(n,"mapStateToProps"):fde(()=>({}))}function Tvt(n,e,t){return hn({},t,n,e)}function Ivt(n){return function(t,{displayName:i,areMergedPropsEqual:r}){let s=!1,o;return function(l,c,u){const d=n(l,c,u);return s?r(d,o)||(o=d):(s=!0,o=d),o}}}function Lvt(n){return n?typeof n=="function"?Ivt(n):W1e(n,"mergeProps"):()=>Tvt}function Avt(){const n=cvt();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,s=t={callback:i,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!r||e===null||(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}const DLe={notify(){},get:()=>[]};function CVe(n,e){let t,i=DLe,r=0,s=!1;function o(m){u();const _=i.subscribe(m);let v=!1;return()=>{v||(v=!0,_(),d())}}function a(){i.notify()}function l(){g.onStateChange&&g.onStateChange()}function c(){return s}function u(){r++,t||(t=e?e.addNestedSub(l):n.subscribe(l),i=Avt())}function d(){r--,t&&r===0&&(t(),t=void 0,i.clear(),i=DLe)}function f(){s||(s=!0,u())}function p(){s&&(s=!1,d())}const g={addNestedSub:o,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:c,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>i};return g}const Nvt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",FU=Nvt?x.useLayoutEffect:x.useEffect;function RLe(n,e){return n===e?n!==0||e!==0||1/n===1/e:n!==n&&e!==e}function Sie(n,e){if(RLe(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])||!RLe(n[t[r]],e[t[r]]))return!1;return!0}const Dvt=["reactReduxForwardedRef"];let wVe=vVe;const Rvt=n=>{wVe=n},Pvt=[null,null];function Ovt(n,e,t){FU(()=>n(...e),t)}function Mvt(n,e,t,i,r,s){n.current=i,t.current=!1,r.current&&(r.current=null,s())}function jvt(n,e,t,i,r,s,o,a,l,c,u){if(!n)return()=>{};let d=!1,f=null;const p=()=>{if(d||!a.current)return;const m=e.getState();let _,v;try{_=i(m,r.current)}catch(b){v=b,f=b}v||(f=null),_===s.current?o.current||c():(s.current=_,l.current=_,o.current=!0,u())};return t.onStateChange=p,t.trySubscribe(),p(),()=>{if(d=!0,t.tryUnsubscribe(),t.onStateChange=null,f)throw f}}function Fvt(n,e){return n===e}function xVe(n,e,t,{pure:i,areStatesEqual:r=Fvt,areOwnPropsEqual:s=Sie,areStatePropsEqual:o=Sie,areMergedPropsEqual:a=Sie,forwardRef:l=!1,context:c=mw}={}){const u=c,d=kvt(n),f=Evt(e),p=Lvt(t),g=!!n;return _=>{const v=_.displayName||_.name||"Component",b=`Connect(${v})`,y={shouldHandleStateChanges:g,displayName:b,wrappedComponentName:v,WrappedComponent:_,initMapStateToProps:d,initMapDispatchToProps:f,initMergeProps:p,areStatesEqual:r,areStatePropsEqual:o,areOwnPropsEqual:s,areMergedPropsEqual:a};function C(I){const[L,N,P]=x.useMemo(()=>{const{reactReduxForwardedRef:Be}=I,$e=V1e(I,Dvt);return[I.context,Be,$e]},[I]),O=x.useMemo(()=>L&&L.Consumer&&yvt.isContextConsumer(x.createElement(L.Consumer,null))?L:u,[L,u]),F=x.useContext(O),V=!!I.store&&!!I.store.getState&&!!I.store.dispatch,M=!!F&&!!F.store,B=V?I.store:F.store,W=M?F.getServerState:B.getState,q=x.useMemo(()=>xvt(B.dispatch,y),[B]),[U,G]=x.useMemo(()=>{if(!g)return Pvt;const Be=CVe(B,V?void 0:F.subscription),$e=Be.notifyNestedSubs.bind(Be);return[Be,$e]},[B,V,F]),H=x.useMemo(()=>V?F:hn({},F,{subscription:U}),[V,F,U]),z=x.useRef(),Z=x.useRef(P),X=x.useRef(),oe=x.useRef(!1);x.useRef(!1);const fe=x.useRef(!1),Se=x.useRef();FU(()=>(fe.current=!0,()=>{fe.current=!1}),[]);const Me=x.useMemo(()=>()=>X.current&&P===Z.current?X.current:q(B.getState(),P),[B,P]),Ie=x.useMemo(()=>$e=>U?jvt(g,B,U,q,Z,z,oe,fe,X,G,$e):()=>{},[U]);Ovt(Mvt,[Z,z,oe,P,X,G]);let ge;try{ge=wVe(Ie,Me,W?()=>q(W(),P):Me)}catch(Be){throw Se.current&&(Be.message+=` The error may be correlated with this previous error: ${Se.current.stack} `),Be}FU(()=>{Se.current=void 0,X.current=void 0,z.current=ge});const ye=x.useMemo(()=>x.createElement(_,hn({},ge,{ref:N})),[N,_,ge]);return x.useMemo(()=>g?x.createElement(O.Provider,{value:H},ye):ye,[O,ye,H])}const k=x.memo(C);if(k.WrappedComponent=_,k.displayName=C.displayName=b,l){const L=x.forwardRef(function(P,O){return x.createElement(k,hn({},P,{reactReduxForwardedRef:O}))});return L.displayName=b,L.WrappedComponent=_,ILe(L,_)}return ILe(k,_)}}function SVe({store:n,context:e,children:t,serverState:i,stabilityCheck:r="once",noopCheck:s="once"}){const o=x.useMemo(()=>{const c=CVe(n);return{store:n,subscription:c,getServerState:i?()=>i:void 0,stabilityCheck:r,noopCheck:s}},[n,i,r,s]),a=x.useMemo(()=>n.getState(),[n]);FU(()=>{const{subscription:c}=o;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),a!==n.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[o,a]);const l=e||mw;return x.createElement(l.Provider,{value:o},t)}function EVe(n=mw){const e=n===mw?_Ve:H1e(n);return function(){const{store:i}=e();return i}}const kVe=EVe();function Bvt(n=mw){const e=n===mw?kVe:EVe(n);return function(){return e().dispatch}}const Fr=Bvt();dvt(nvt.useSyncExternalStoreWithSelector);Rvt(J_t.useSyncExternalStore);lvt(Bm.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 Nr(){return Cu(n=>n.companyUsers.changes.company)}var Rj={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 */var $vt=Rj.exports,PLe;function Hvt(){return PLe||(PLe=1,function(n,e){(function(){var t,i="4.17.21",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,f=2,p=4,g=1,m=2,_=1,v=2,b=4,y=8,C=16,S=32,k=64,I=128,L=256,N=512,P=30,O="...",F=800,V=16,M=1,B=2,W=3,q=1/0,U=9007199254740991,G=17976931348623157e292,H=NaN,z=4294967295,Z=z-1,X=z>>>1,oe=[["ary",I],["bind",_],["bindKey",v],["curry",y],["curryRight",C],["flip",N],["partial",S],["partialRight",k],["rearg",L]],fe="[object Arguments]",Se="[object Array]",Me="[object AsyncFunction]",Ie="[object Boolean]",ge="[object Date]",ye="[object DOMException]",Pe="[object Error]",Be="[object Function]",$e="[object GeneratorFunction]",qe="[object Map]",mt="[object Number]",vt="[object Null]",ft="[object Object]",tt="[object Promise]",St="[object Proxy]",Ft="[object RegExp]",en="[object Set]",Ke="[object String]",dt="[object Symbol]",nt="[object Undefined]",at="[object WeakMap]",Oe="[object WeakSet]",ce="[object ArrayBuffer]",Ne="[object DataView]",Xe="[object Float32Array]",it="[object Float64Array]",Tt="[object Int8Array]",Ct="[object Int16Array]",Rt="[object Int32Array]",se="[object Uint8Array]",ke="[object Uint8ClampedArray]",Ae="[object Uint16Array]",je="[object Uint32Array]",Ve=/\b__p \+= '';/g,Qt=/\b(__p \+=) '' \+/g,rt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Cn=/&(?:amp|lt|gt|quot|#39);/g,Rn=/[&<>"']/g,li=RegExp(Cn.source),Mi=RegExp(Rn.source),si=/<%-([\s\S]+?)%>/g,oi=/<%([\s\S]+?)%>/g,_n=/<%=([\s\S]+?)%>/g,de=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_e=/^\w*$/,Le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ge=/[\\^$.*+?()[\]{}|]/g,gt=RegExp(Ge.source),pt=/^\s+/,Vt=/\s/,Pn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ln=/\{\n\/\* \[wrapped with (.+)\] \*/,bi=/,? & /,et=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Lt=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,sn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ln=/\w*$/,ti=/^[-+]0x[0-9a-f]+$/i,di=/^0b[01]+$/i,Dt=/^\[object .+?Constructor\]$/,le=/^0o[0-7]+$/i,Qe=/^(?:0|[1-9]\d*)$/,ht=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Bt=/($^)/,An=/['\n\r\u2028\u2029\\]/g,mn="\\ud800-\\udfff",hi="\\u0300-\\u036f",Di="\\ufe20-\\ufe2f",cr="\\u20d0-\\u20ff",Li=hi+Di+cr,Sr="\\u2700-\\u27bf",rr="a-z\\xdf-\\xf6\\xf8-\\xff",ws="\\xac\\xb1\\xd7\\xf7",Er="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",xa="\\u2000-\\u206f",No=" \\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",Do="A-Z\\xc0-\\xd6\\xd8-\\xde",Zs="\\ufe0e\\ufe0f",ua=ws+Er+xa+No,Os="['’]",Co="["+mn+"]",ul="["+ua+"]",Qi="["+Li+"]",Ms="\\d+",js="["+Sr+"]",Ro="["+rr+"]",Bi="[^"+mn+ua+Ms+Sr+rr+Do+"]",Vi="\\ud83c[\\udffb-\\udfff]",Br="(?:"+Qi+"|"+Vi+")",Gr="[^"+mn+"]",xs="(?:\\ud83c[\\udde6-\\uddff]){2}",sr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ns="["+Do+"]",uo="\\u200d",yi="(?:"+Ro+"|"+Bi+")",vn="(?:"+Ns+"|"+Bi+")",Un="(?:"+Os+"(?:d|ll|m|re|s|t|ve))?",Mn="(?:"+Os+"(?:D|LL|M|RE|S|T|VE))?",fi=Br+"?",Wi="["+Zs+"]?",or="(?:"+uo+"(?:"+[Gr,xs,sr].join("|")+")"+Wi+fi+")*",qn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ei=Wi+fi+or,Kn="(?:"+[js,xs,sr].join("|")+")"+Ei,Hn="(?:"+[Gr+Qi+"?",Qi,xs,sr,Co].join("|")+")",ki=RegExp(Os,"g"),Sn=RegExp(Qi,"g"),On=RegExp(Vi+"(?="+Vi+")|"+Hn+Ei,"g"),wi=RegExp([Ns+"?"+Ro+"+"+Un+"(?="+[ul,Ns,"$"].join("|")+")",vn+"+"+Mn+"(?="+[ul,Ns+yi,"$"].join("|")+")",Ns+"?"+yi+"+"+Un,Ns+"+"+Mn,Wn,qn,Ms,Kn].join("|"),"g"),Cr=RegExp("["+uo+mn+Li+Zs+"]"),br=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zs=["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"],Oa=-1,$r={};$r[Xe]=$r[it]=$r[Tt]=$r[Ct]=$r[Rt]=$r[se]=$r[ke]=$r[Ae]=$r[je]=!0,$r[fe]=$r[Se]=$r[ce]=$r[Ie]=$r[Ne]=$r[ge]=$r[Pe]=$r[Be]=$r[qe]=$r[mt]=$r[ft]=$r[Ft]=$r[en]=$r[Ke]=$r[at]=!1;var Qn={};Qn[fe]=Qn[Se]=Qn[ce]=Qn[Ne]=Qn[Ie]=Qn[ge]=Qn[Xe]=Qn[it]=Qn[Tt]=Qn[Ct]=Qn[Rt]=Qn[qe]=Qn[mt]=Qn[ft]=Qn[Ft]=Qn[en]=Qn[Ke]=Qn[dt]=Qn[se]=Qn[ke]=Qn[Ae]=Qn[je]=!0,Qn[Pe]=Qn[Be]=Qn[at]=!1;var Po={À:"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"},jl={"&":"&","<":"<",">":">",'"':""","'":"'"},Ku={"&":"&","<":"<",">":">",""":'"',"'":"'"},Jo={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_c=parseFloat,sc=parseInt,pp=typeof hb=="object"&&hb&&hb.Object===Object&&hb,E1=typeof self=="object"&&self&&self.Object===Object&&self,Sa=pp||E1||Function("return this")(),Xm=e&&!e.nodeType&&e,Jd=Xm&&!0&&n&&!n.nodeType&&n,Zm=Jd&&Jd.exports===Xm,Jc=Zm&&pp.process,eu=function(){try{var Nt=Jd&&Jd.require&&Jd.require("util").types;return Nt||Jc&&Jc.binding&&Jc.binding("util")}catch{}}(),n0=eu&&eu.isArrayBuffer,vc=eu&&eu.isDate,Ef=eu&&eu.isMap,kf=eu&&eu.isRegExp,i0=eu&&eu.isSet,nN=eu&&eu.isTypedArray;function Gu(Nt,En,Zt){switch(Zt.length){case 0:return Nt.call(En);case 1:return Nt.call(En,Zt[0]);case 2:return Nt.call(En,Zt[0],Zt[1]);case 3:return Nt.call(En,Zt[0],Zt[1],Zt[2])}return Nt.apply(En,Zt)}function Hk(Nt,En,Zt,Xi){for(var Ds=-1,ea=Nt==null?0:Nt.length;++Ds<ea;){var Pc=Nt[Ds];En(Xi,Pc,Zt(Pc),Nt)}return Xi}function Su(Nt,En){for(var Zt=-1,Xi=Nt==null?0:Nt.length;++Zt<Xi&&En(Nt[Zt],Zt,Nt)!==!1;);return Nt}function ix(Nt,En){for(var Zt=Nt==null?0:Nt.length;Zt--&&En(Nt[Zt],Zt,Nt)!==!1;);return Nt}function Vk(Nt,En){for(var Zt=-1,Xi=Nt==null?0:Nt.length;++Zt<Xi;)if(!En(Nt[Zt],Zt,Nt))return!1;return!0}function Jm(Nt,En){for(var Zt=-1,Xi=Nt==null?0:Nt.length,Ds=0,ea=[];++Zt<Xi;){var Pc=Nt[Zt];En(Pc,Zt,Nt)&&(ea[Ds++]=Pc)}return ea}function rx(Nt,En){var Zt=Nt==null?0:Nt.length;return!!Zt&&Ci(Nt,En,0)>-1}function Wk(Nt,En,Zt){for(var Xi=-1,Ds=Nt==null?0:Nt.length;++Xi<Ds;)if(Zt(En,Nt[Xi]))return!0;return!1}function Ma(Nt,En){for(var Zt=-1,Xi=Nt==null?0:Nt.length,Ds=Array(Xi);++Zt<Xi;)Ds[Zt]=En(Nt[Zt],Zt,Nt);return Ds}function dl(Nt,En){for(var Zt=-1,Xi=En.length,Ds=Nt.length;++Zt<Xi;)Nt[Ds+Zt]=En[Zt];return Nt}function k1(Nt,En,Zt,Xi){var Ds=-1,ea=Nt==null?0:Nt.length;for(Xi&&ea&&(Zt=Nt[++Ds]);++Ds<ea;)Zt=En(Zt,Nt[Ds],Ds,Nt);return Zt}function h3(Nt,En,Zt,Xi){var Ds=Nt==null?0:Nt.length;for(Xi&&Ds&&(Zt=Nt[--Ds]);Ds--;)Zt=En(Zt,Nt[Ds],Ds,Nt);return Zt}function ae(Nt,En){for(var Zt=-1,Xi=Nt==null?0:Nt.length;++Zt<Xi;)if(En(Nt[Zt],Zt,Nt))return!0;return!1}var Q=Bo("length");function re(Nt){return Nt.split("")}function Fe(Nt){return Nt.match(et)||[]}function st(Nt,En,Zt){var Xi;return Zt(Nt,function(Ds,ea,Pc){if(En(Ds,ea,Pc))return Xi=ea,!1}),Xi}function xn(Nt,En,Zt,Xi){for(var Ds=Nt.length,ea=Zt+(Xi?1:-1);Xi?ea--:++ea<Ds;)if(En(Nt[ea],ea,Nt))return ea;return-1}function Ci(Nt,En,Zt){return En===En?sN(Nt,En,Zt):xn(Nt,Ts,Zt)}function gr(Nt,En,Zt,Xi){for(var Ds=Zt-1,ea=Nt.length;++Ds<ea;)if(Xi(Nt[Ds],En))return Ds;return-1}function Ts(Nt){return Nt!==Nt}function wo(Nt,En){var Zt=Nt==null?0:Nt.length;return Zt?sx(Nt,En)/Zt:H}function Bo(Nt){return function(En){return En==null?t:En[Nt]}}function Sl(Nt){return function(En){return Nt==null?t:Nt[En]}}function T1(Nt,En,Zt,Xi,Ds){return Ds(Nt,function(ea,Pc,ja){Zt=Xi?(Xi=!1,ea):En(Zt,ea,Pc,ja)}),Zt}function f3(Nt,En){var Zt=Nt.length;for(Nt.sort(En);Zt--;)Nt[Zt]=Nt[Zt].value;return Nt}function sx(Nt,En){for(var Zt,Xi=-1,Ds=Nt.length;++Xi<Ds;){var ea=En(Nt[Xi]);ea!==t&&(Zt=Zt===t?ea:Zt+ea)}return Zt}function zk(Nt,En){for(var Zt=-1,Xi=Array(Nt);++Zt<Nt;)Xi[Zt]=En(Zt);return Xi}function iN(Nt,En){return Ma(En,function(Zt){return[Zt,Nt[Zt]]})}function rN(Nt){return Nt&&Nt.slice(0,oN(Nt)+1).replace(pt,"")}function bd(Nt){return function(En){return Nt(En)}}function I1(Nt,En){return Ma(En,function(Zt){return Nt[Zt]})}function Ag(Nt,En){return Nt.has(En)}function Uk(Nt,En){for(var Zt=-1,Xi=Nt.length;++Zt<Xi&&Ci(En,Nt[Zt],0)>-1;);return Zt}function ox(Nt,En){for(var Zt=Nt.length;Zt--&&Ci(En,Nt[Zt],0)>-1;);return Zt}function qk(Nt,En){for(var Zt=Nt.length,Xi=0;Zt--;)Nt[Zt]===En&&++Xi;return Xi}var ax=Sl(Po),lx=Sl(jl);function Kk(Nt){return"\\"+Jo[Nt]}function r0(Nt,En){return Nt==null?t:Nt[En]}function s0(Nt){return Cr.test(Nt)}function p3(Nt){return br.test(Nt)}function g3(Nt){for(var En,Zt=[];!(En=Nt.next()).done;)Zt.push(En.value);return Zt}function L1(Nt){var En=-1,Zt=Array(Nt.size);return Nt.forEach(function(Xi,Ds){Zt[++En]=[Ds,Xi]}),Zt}function m3(Nt,En){return function(Zt){return Nt(En(Zt))}}function gp(Nt,En){for(var Zt=-1,Xi=Nt.length,Ds=0,ea=[];++Zt<Xi;){var Pc=Nt[Zt];(Pc===En||Pc===u)&&(Nt[Zt]=u,ea[Ds++]=Zt)}return ea}function o0(Nt){var En=-1,Zt=Array(Nt.size);return Nt.forEach(function(Xi){Zt[++En]=Xi}),Zt}function Ine(Nt){var En=-1,Zt=Array(Nt.size);return Nt.forEach(function(Xi){Zt[++En]=[Xi,Xi]}),Zt}function sN(Nt,En,Zt){for(var Xi=Zt-1,Ds=Nt.length;++Xi<Ds;)if(Nt[Xi]===En)return Xi;return-1}function Lne(Nt,En,Zt){for(var Xi=Zt+1;Xi--;)if(Nt[Xi]===En)return Xi;return Xi}function A1(Nt){return s0(Nt)?L$(Nt):Q(Nt)}function Tf(Nt){return s0(Nt)?A$(Nt):re(Nt)}function oN(Nt){for(var En=Nt.length;En--&&Vt.test(Nt.charAt(En)););return En}var I$=Sl(Ku);function L$(Nt){for(var En=On.lastIndex=0;On.test(Nt);)++En;return En}function A$(Nt){return Nt.match(On)||[]}function Ane(Nt){return Nt.match(wi)||[]}var Nne=function Nt(En){En=En==null?Sa:cx.defaults(Sa.Object(),En,cx.pick(Sa,zs));var Zt=En.Array,Xi=En.Date,Ds=En.Error,ea=En.Function,Pc=En.Math,ja=En.Object,Gk=En.RegExp,Dne=En.String,mp=En.TypeError,Cv=Zt.prototype,_3=ea.prototype,e_=ja.prototype,ux=En["__core-js_shared__"],Yk=_3.toString,ta=e_.hasOwnProperty,dx=0,aN=function(){var T=/[^.]+$/.exec(ux&&ux.keys&&ux.keys.IE_PROTO||"");return T?"Symbol(src)_1."+T:""}(),Qk=e_.toString,lN=Yk.call(ja),N$=Sa._,D$=Gk("^"+Yk.call(ta).replace(Ge,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xk=Zm?En.Buffer:t,wv=En.Symbol,Zk=En.Uint8Array,v3=Xk?Xk.allocUnsafe:t,Ng=m3(ja.getPrototypeOf,ja),cN=ja.create,uN=e_.propertyIsEnumerable,dN=Cv.splice,R$=wv?wv.isConcatSpreadable:t,xv=wv?wv.iterator:t,N1=wv?wv.toStringTag:t,Jk=function(){try{var T=_0(ja,"defineProperty");return T({},"",{}),T}catch{}}(),P$=En.clearTimeout!==Sa.clearTimeout&&En.clearTimeout,El=Xi&&Xi.now!==Sa.Date.now&&Xi.now,b3=En.setTimeout!==Sa.setTimeout&&En.setTimeout,D1=Pc.ceil,a0=Pc.floor,hN=ja.getOwnPropertySymbols,y3=Xk?Xk.isBuffer:t,hx=En.isFinite,fN=Cv.join,fx=m3(ja.keys,ja),Oc=Pc.max,yd=Pc.min,Rne=Xi.now,O$=En.parseInt,eT=Pc.random,pN=Cv.reverse,tT=_0(En,"DataView"),R1=_0(En,"Map"),nT=_0(En,"Promise"),l0=_0(En,"Set"),iT=_0(En,"WeakMap"),px=_0(ja,"create"),gN=iT&&new iT,gx={},C3=v0(tT),c0=v0(R1),M$=v0(nT),mx=v0(l0),t_=v0(iT),u0=wv?wv.prototype:t,If=u0?u0.valueOf:t,mN=u0?u0.toString:t;function Te(T){if(jc(T)&&!qs(T)&&!(T instanceof Us)){if(T instanceof Cd)return T;if(ta.call(T,"__wrapped__"))return uH(T)}return new Cd(T)}var _x=function(){function T(){}return function(D){if(!Cc(D))return{};if(cN)return cN(D);T.prototype=D;var $=new T;return T.prototype=t,$}}();function n_(){}function Cd(T,D){this.__wrapped__=T,this.__actions__=[],this.__chain__=!!D,this.__index__=0,this.__values__=t}Te.templateSettings={escape:si,evaluate:oi,interpolate:_n,variable:"",imports:{_:Te}},Te.prototype=n_.prototype,Te.prototype.constructor=Te,Cd.prototype=_x(n_.prototype),Cd.prototype.constructor=Cd;function Us(T){this.__wrapped__=T,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=z,this.__views__=[]}function _N(){var T=new Us(this.__wrapped__);return T.__actions__=th(this.__actions__),T.__dir__=this.__dir__,T.__filtered__=this.__filtered__,T.__iteratees__=th(this.__iteratees__),T.__takeCount__=this.__takeCount__,T.__views__=th(this.__views__),T}function w3(){if(this.__filtered__){var T=new Us(this);T.__dir__=-1,T.__filtered__=!0}else T=this.clone(),T.__dir__*=-1;return T}function vx(){var T=this.__wrapped__.value(),D=this.__dir__,$=qs(T),te=D<0,he=$?T.length:0,De=Q3(0,he,this.__views__),ot=De.start,yt=De.end,Pt=yt-ot,jn=te?yt:ot-1,Bn=this.__iteratees__,ei=Bn.length,qi=0,Rr=yd(Pt,this.__takeCount__);if(!$||!te&&he==Pt&&Rr==Pt)return kx(T,this.__actions__);var gs=[];e:for(;Pt--&&qi<Rr;){jn+=D;for(var lo=-1,ms=T[jn];++lo<ei;){var xo=Bn[lo],Ho=xo.iteratee,Hg=xo.type,Rf=Ho(ms);if(Hg==B)ms=Rf;else if(!Rf){if(Hg==M)continue e;break e}}gs[qi++]=ms}return gs}Us.prototype=_x(n_.prototype),Us.prototype.constructor=Us;function $h(T){var D=-1,$=T==null?0:T.length;for(this.clear();++D<$;){var te=T[D];this.set(te[0],te[1])}}function kl(){this.__data__=px?px(null):{},this.size=0}function hl(T){var D=this.has(T)&&delete this.__data__[T];return this.size-=D?1:0,D}function d0(T){var D=this.__data__;if(px){var $=D[T];return $===l?t:$}return ta.call(D,T)?D[T]:t}function wd(T){var D=this.__data__;return px?D[T]!==t:ta.call(D,T)}function Hh(T,D){var $=this.__data__;return this.size+=this.has(T)?0:1,$[T]=px&&D===t?l:D,this}$h.prototype.clear=kl,$h.prototype.delete=hl,$h.prototype.get=d0,$h.prototype.has=wd,$h.prototype.set=Hh;function eh(T){var D=-1,$=T==null?0:T.length;for(this.clear();++D<$;){var te=T[D];this.set(te[0],te[1])}}function bx(){this.__data__=[],this.size=0}function Vh(T){var D=this.__data__,$=Sd(D,T);if($<0)return!1;var te=D.length-1;return $==te?D.pop():dN.call(D,$,1),--this.size,!0}function vN(T){var D=this.__data__,$=Sd(D,T);return $<0?t:D[$][1]}function j$(T){return Sd(this.__data__,T)>-1}function F$(T,D){var $=this.__data__,te=Sd($,T);return te<0?(++this.size,$.push([T,D])):$[te][1]=D,this}eh.prototype.clear=bx,eh.prototype.delete=Vh,eh.prototype.get=vN,eh.prototype.has=j$,eh.prototype.set=F$;function _p(T){var D=-1,$=T==null?0:T.length;for(this.clear();++D<$;){var te=T[D];this.set(te[0],te[1])}}function B$(){this.size=0,this.__data__={hash:new $h,map:new(R1||eh),string:new $h}}function Sv(T){var D=bT(this,T).delete(T);return this.size-=D?1:0,D}function bN(T){return bT(this,T).get(T)}function x3(T){return bT(this,T).has(T)}function $$(T,D){var $=bT(this,T),te=$.size;return $.set(T,D),this.size+=$.size==te?0:1,this}_p.prototype.clear=B$,_p.prototype.delete=Sv,_p.prototype.get=bN,_p.prototype.has=x3,_p.prototype.set=$$;function P1(T){var D=-1,$=T==null?0:T.length;for(this.__data__=new _p;++D<$;)this.add(T[D])}function h0(T){return this.__data__.set(T,l),this}function yx(T){return this.__data__.has(T)}P1.prototype.add=P1.prototype.push=h0,P1.prototype.has=yx;function xd(T){var D=this.__data__=new eh(T);this.size=D.size}function yN(){this.__data__=new eh,this.size=0}function CN(T){var D=this.__data__,$=D.delete(T);return this.size=D.size,$}function vp(T){return this.__data__.get(T)}function bp(T){return this.__data__.has(T)}function O1(T,D){var $=this.__data__;if($ instanceof eh){var te=$.__data__;if(!R1||te.length<r-1)return te.push([T,D]),this.size=++$.size,this;$=this.__data__=new _p(te)}return $.set(T,D),this.size=$.size,this}xd.prototype.clear=yN,xd.prototype.delete=CN,xd.prototype.get=vp,xd.prototype.has=bp,xd.prototype.set=O1;function i_(T,D){var $=qs(T),te=!$&&NT(T),he=!$&&!te&&Mx(T),De=!$&&!te&&!he&&uD(T),ot=$||te||he||De,yt=ot?zk(T.length,Dne):[],Pt=yt.length;for(var jn in T)(D||ta.call(T,jn))&&!(ot&&(jn=="length"||he&&(jn=="offset"||jn=="parent")||De&&(jn=="buffer"||jn=="byteLength"||jn=="byteOffset")||Bl(jn,Pt)))&&yt.push(jn);return yt}function r_(T){var D=T.length;return D?T[Sx(0,D-1)]:t}function M1(T,D){return KN(th(T),Ev(D,0,T.length))}function H$(T){return KN(th(T))}function rT(T,D,$){($!==t&&!Ov(T[D],$)||$===t&&!(D in T))&&s_(T,D,$)}function j1(T,D,$){var te=T[D];(!(ta.call(T,D)&&Ov(te,$))||$===t&&!(D in T))&&s_(T,D,$)}function Sd(T,D){for(var $=T.length;$--;)if(Ov(T[$][0],D))return $;return-1}function Lf(T,D,$,te){return a_(T,function(he,De,ot){D(te,he,$(he),ot)}),te}function Tl(T,D){return T&&Rg(D,Td(D),T)}function Dg(T,D){return T&&Rg(D,Ip(D),T)}function s_(T,D,$){D=="__proto__"&&Jk?Jk(T,D,{configurable:!0,enumerable:!0,value:$,writable:!0}):T[D]=$}function wN(T,D){for(var $=-1,te=D.length,he=Zt(te),De=T==null;++$<te;)he[$]=De?t:iie(T,D[$]);return he}function Ev(T,D,$){return T===T&&($!==t&&(T=T<=$?T:$),D!==t&&(T=T>=D?T:D)),T}function Wh(T,D,$,te,he,De){var ot,yt=D&d,Pt=D&f,jn=D&p;if($&&(ot=he?$(T,te,he,De):$(T)),ot!==t)return ot;if(!Cc(T))return T;var Bn=qs(T);if(Bn){if(ot=CT(T),!yt)return th(T,ot)}else{var ei=Xu(T),qi=ei==Be||ei==$e;if(Mx(T))return F3(T,yt);if(ei==ft||ei==fe||qi&&!he){if(ot=Pt||qi?{}:Zu(T),!yt)return Pt?One(T,Dg(ot,T)):ON(T,Tl(ot,T))}else{if(!Qn[ei])return he?T:{};ot=Mne(T,ei,yt)}}De||(De=new xd);var Rr=De.get(T);if(Rr)return Rr;De.set(T,ot),QIe(T)?T.forEach(function(ms){ot.add(Wh(ms,D,$,ms,T,De))}):GIe(T)&&T.forEach(function(ms,xo){ot.set(xo,Wh(ms,D,$,xo,T,De))});var gs=jn?Pt?vT:_T:Pt?Ip:Td,lo=Bn?t:gs(T);return Su(lo||T,function(ms,xo){lo&&(xo=ms,ms=T[xo]),j1(ot,xo,Wh(ms,D,$,xo,T,De))}),ot}function V$(T){var D=Td(T);return function($){return sT($,T,D)}}function sT(T,D,$){var te=$.length;if(T==null)return!te;for(T=ja(T);te--;){var he=$[te],De=D[he],ot=T[he];if(ot===t&&!(he in T)||!De(ot))return!1}return!0}function S3(T,D,$){if(typeof T!="function")throw new mp(o);return Rx(function(){T.apply(t,$)},D)}function o_(T,D,$,te){var he=-1,De=rx,ot=!0,yt=T.length,Pt=[],jn=D.length;if(!yt)return Pt;$&&(D=Ma(D,bd($))),te?(De=Wk,ot=!1):D.length>=r&&(De=Ag,ot=!1,D=new P1(D));e:for(;++he<yt;){var Bn=T[he],ei=$==null?Bn:$(Bn);if(Bn=te||Bn!==0?Bn:0,ot&&ei===ei){for(var qi=jn;qi--;)if(D[qi]===ei)continue e;Pt.push(Bn)}else De(D,ei,te)||Pt.push(Bn)}return Pt}var a_=Sp(Af),W$=Sp(f0,!0);function oT(T,D){var $=!0;return a_(T,function(te,he,De){return $=!!D(te,he,De),$}),$}function F1(T,D,$){for(var te=-1,he=T.length;++te<he;){var De=T[te],ot=D(De);if(ot!=null&&(yt===t?ot===ot&&!$g(ot):$(ot,yt)))var yt=ot,Pt=De}return Pt}function z$(T,D,$,te){var he=T.length;for($=io($),$<0&&($=-$>he?0:he+$),te=te===t||te>he?he:io(te),te<0&&(te+=he),te=$>te?0:ZIe(te);$<te;)T[$++]=D;return T}function E3(T,D){var $=[];return a_(T,function(te,he,De){D(te,he,De)&&$.push(te)}),$}function oc(T,D,$,te,he){var De=-1,ot=T.length;for($||($=zN),he||(he=[]);++De<ot;){var yt=T[De];D>0&&$(yt)?D>1?oc(yt,D-1,$,te,he):dl(he,yt):te||(he[he.length]=yt)}return he}var xN=jN(),aT=jN(!0);function Af(T,D){return T&&xN(T,D,Td)}function f0(T,D){return T&&aT(T,D,Td)}function Cx(T,D){return Jm(D,function($){return X1(T[$])})}function kv(T,D){D=u_(D,T);for(var $=0,te=D.length;T!=null&&$<te;)T=T[jg(D[$++])];return $&&$==te?T:t}function SN(T,D,$){var te=D(T);return qs(T)?te:dl(te,$(T))}function Yu(T){return T==null?T===t?nt:vt:N1&&N1 in ja(T)?WN(T):Z3(T)}function p0(T,D){return T>D}function yp(T,D){return T!=null&&ta.call(T,D)}function B1(T,D){return T!=null&&D in ja(T)}function k3(T,D,$){return T>=yd(D,$)&&T<Oc(D,$)}function EN(T,D,$){for(var te=$?Wk:rx,he=T[0].length,De=T.length,ot=De,yt=Zt(De),Pt=1/0,jn=[];ot--;){var Bn=T[ot];ot&&D&&(Bn=Ma(Bn,bd(D))),Pt=yd(Bn.length,Pt),yt[ot]=!$&&(D||he>=120&&Bn.length>=120)?new P1(ot&&Bn):t}Bn=T[0];var ei=-1,qi=yt[0];e:for(;++ei<he&&jn.length<Pt;){var Rr=Bn[ei],gs=D?D(Rr):Rr;if(Rr=$||Rr!==0?Rr:0,!(qi?Ag(qi,gs):te(jn,gs,$))){for(ot=De;--ot;){var lo=yt[ot];if(!(lo?Ag(lo,gs):te(T[ot],gs,$)))continue e}qi&&qi.push(gs),jn.push(Rr)}}return jn}function Tv(T,D,$,te){return Af(T,function(he,De,ot){D(te,$(he),De,ot)}),te}function Cp(T,D,$){D=u_(D,T),T=Eu(T,D);var te=T==null?T:T[jg(rh(D))];return te==null?t:Gu(te,T,$)}function kN(T){return jc(T)&&Yu(T)==fe}function U$(T){return jc(T)&&Yu(T)==ce}function Iv(T){return jc(T)&&Yu(T)==ge}function wp(T,D,$,te,he){return T===D?!0:T==null||D==null||!jc(T)&&!jc(D)?T!==T&&D!==D:TN(T,D,$,te,wp,he)}function TN(T,D,$,te,he,De){var ot=qs(T),yt=qs(D),Pt=ot?Se:Xu(T),jn=yt?Se:Xu(D);Pt=Pt==fe?ft:Pt,jn=jn==fe?ft:jn;var Bn=Pt==ft,ei=jn==ft,qi=Pt==jn;if(qi&&Mx(T)){if(!Mx(D))return!1;ot=!0,Bn=!1}if(qi&&!Bn)return De||(De=new xd),ot||uD(T)?G3(T,D,$,te,he,De):Y3(T,D,Pt,$,te,he,De);if(!($&g)){var Rr=Bn&&ta.call(T,"__wrapped__"),gs=ei&&ta.call(D,"__wrapped__");if(Rr||gs){var lo=Rr?T.value():T,ms=gs?D.value():D;return De||(De=new xd),he(lo,ms,$,te,De)}}return qi?(De||(De=new xd),nH(T,D,$,te,he,De)):!1}function q$(T){return jc(T)&&Xu(T)==qe}function wx(T,D,$,te){var he=$.length,De=he,ot=!te;if(T==null)return!De;for(T=ja(T);he--;){var yt=$[he];if(ot&&yt[2]?yt[1]!==T[yt[0]]:!(yt[0]in T))return!1}for(;++he<De;){yt=$[he];var Pt=yt[0],jn=T[Pt],Bn=yt[1];if(ot&&yt[2]){if(jn===t&&!(Pt in T))return!1}else{var ei=new xd;if(te)var qi=te(jn,Bn,Pt,T,D,ei);if(!(qi===t?wp(Bn,jn,g|m,te,ei):qi))return!1}}return!0}function T3(T){if(!Cc(T)||sH(T))return!1;var D=X1(T)?D$:Dt;return D.test(v0(T))}function lT(T){return jc(T)&&Yu(T)==Ft}function l_(T){return jc(T)&&Xu(T)==en}function cT(T){return jc(T)&&SH(T.length)&&!!$r[Yu(T)]}function xx(T){return typeof T=="function"?T:T==null?Lp:typeof T=="object"?qs(T)?Fl(T[0],T[1]):IN(T):cLe(T)}function Lv(T){if(!Rv(T))return fx(T);var D=[];for(var $ in ja(T))ta.call(T,$)&&$!="constructor"&&D.push($);return D}function I3(T){if(!Cc(T))return lH(T);var D=Rv(T),$=[];for(var te in T)te=="constructor"&&(D||!ta.call(T,te))||$.push(te);return $}function g0(T,D){return T<D}function L3(T,D){var $=-1,te=Tp(T)?Zt(T.length):[];return a_(T,function(he,De,ot){te[++$]=D(he,De,ot)}),te}function IN(T){var D=yT(T);return D.length==1&&D[0][2]?UN(D[0][0],D[0][1]):function($){return $===T||wx($,T,D)}}function Fl(T,D){return ar(T)&&xT(D)?UN(jg(T),D):function($){var te=iie($,T);return te===t&&te===D?rie($,T):wp(D,te,g|m)}}function $1(T,D,$,te,he){T!==D&&xN(D,function(De,ot){if(he||(he=new xd),Cc(De))A3(T,D,ot,$,$1,te,he);else{var yt=te?te(f_(T,ot),De,ot+"",T,D,he):t;yt===t&&(yt=De),rT(T,ot,yt)}},Ip)}function A3(T,D,$,te,he,De,ot){var yt=f_(T,$),Pt=f_(D,$),jn=ot.get(Pt);if(jn){rT(T,$,jn);return}var Bn=De?De(yt,Pt,$+"",T,D,ot):t,ei=Bn===t;if(ei){var qi=qs(Pt),Rr=!qi&&Mx(Pt),gs=!qi&&!Rr&&uD(Pt);Bn=Pt,qi||Rr||gs?qs(yt)?Bn=yt:iu(yt)?Bn=th(yt):Rr?(ei=!1,Bn=F3(Pt,!0)):gs?(ei=!1,Bn=X$(Pt,!0)):Bn=[]:m5(Pt)||NT(Pt)?(Bn=yt,NT(yt)?Bn=JIe(yt):(!Cc(yt)||X1(yt))&&(Bn=Zu(Pt))):ei=!1}ei&&(ot.set(Pt,Bn),he(Bn,Pt,te,De,ot),ot.delete(Pt)),rT(T,$,Bn)}function LN(T,D){var $=T.length;if($)return D+=D<0?$:0,Bl(D,$)?T[D]:t}function uT(T,D,$){D.length?D=Ma(D,function(De){return qs(De)?function(ot){return kv(ot,De.length===1?De[0]:De)}:De}):D=[Lp];var te=-1;D=Ma(D,bd(is()));var he=L3(T,function(De,ot,yt){var Pt=Ma(D,function(jn){return jn(De)});return{criteria:Pt,index:++te,value:De}});return f3(he,function(De,ot){return Pne(De,ot,$)})}function N3(T,D){return m0(T,D,function($,te){return rie(T,te)})}function m0(T,D,$){for(var te=-1,he=D.length,De={};++te<he;){var ot=D[te],yt=kv(T,ot);$(yt,ot)&&V1(De,u_(ot,T),yt)}return De}function Ql(T){return function(D){return kv(D,T)}}function bc(T,D,$,te){var he=te?gr:Ci,De=-1,ot=D.length,yt=T;for(T===D&&(D=th(D)),$&&(yt=Ma(T,bd($)));++De<ot;)for(var Pt=0,jn=D[De],Bn=$?$(jn):jn;(Pt=he(yt,Bn,Pt,te))>-1;)yt!==T&&dN.call(yt,Pt,1),dN.call(T,Pt,1);return T}function tu(T,D){for(var $=T?D.length:0,te=$-1;$--;){var he=D[$];if($==te||he!==De){var De=he;Bl(he)?dN.call(T,he,1):DN(T,he)}}return T}function Sx(T,D){return T+a0(eT()*(D-T+1))}function dT(T,D,$,te){for(var he=-1,De=Oc(D1((D-T)/($||1)),0),ot=Zt(De);De--;)ot[te?De:++he]=T,T+=$;return ot}function H1(T,D){var $="";if(!T||D<1||D>U)return $;do D%2&&($+=T),D=a0(D/2),D&&(T+=T);while(D);return $}function no(T,D){return Nf(qN(T,D,Lp),T+"")}function Ed(T){return r_(dD(T))}function D3(T,D){var $=dD(T);return KN($,Ev(D,0,$.length))}function V1(T,D,$,te){if(!Cc(T))return T;D=u_(D,T);for(var he=-1,De=D.length,ot=De-1,yt=T;yt!=null&&++he<De;){var Pt=jg(D[he]),jn=$;if(Pt==="__proto__"||Pt==="constructor"||Pt==="prototype")return T;if(he!=ot){var Bn=yt[Pt];jn=te?te(Bn,Pt,yt):t,jn===t&&(jn=Cc(Bn)?Bn:Bl(D[he+1])?[]:{})}j1(yt,Pt,jn),yt=yt[Pt]}return T}var AN=gN?function(T,D){return gN.set(T,D),T}:Lp,c_=Jk?function(T,D){return Jk(T,"toString",{configurable:!0,enumerable:!1,value:oie(D),writable:!0})}:Lp;function xp(T){return KN(dD(T))}function kd(T,D,$){var te=-1,he=T.length;D<0&&(D=-D>he?0:he+D),$=$>he?he:$,$<0&&($+=he),he=D>$?0:$-D>>>0,D>>>=0;for(var De=Zt(he);++te<he;)De[te]=T[te+D];return De}function R3(T,D){var $;return a_(T,function(te,he,De){return $=D(te,he,De),!$}),!!$}function Ex(T,D,$){var te=0,he=T==null?te:T.length;if(typeof D=="number"&&D===D&&he<=X){for(;te<he;){var De=te+he>>>1,ot=T[De];ot!==null&&!$g(ot)&&($?ot<=D:ot<D)?te=De+1:he=De}return he}return NN(T,D,Lp,$)}function NN(T,D,$,te){var he=0,De=T==null?0:T.length;if(De===0)return 0;D=$(D);for(var ot=D!==D,yt=D===null,Pt=$g(D),jn=D===t;he<De;){var Bn=a0((he+De)/2),ei=$(T[Bn]),qi=ei!==t,Rr=ei===null,gs=ei===ei,lo=$g(ei);if(ot)var ms=te||gs;else jn?ms=gs&&(te||qi):yt?ms=gs&&qi&&(te||!Rr):Pt?ms=gs&&qi&&!Rr&&(te||!lo):Rr||lo?ms=!1:ms=te?ei<=D:ei<D;ms?he=Bn+1:De=Bn}return yd(De,Z)}function P3(T,D){for(var $=-1,te=T.length,he=0,De=[];++$<te;){var ot=T[$],yt=D?D(ot):ot;if(!$||!Ov(yt,Pt)){var Pt=yt;De[he++]=ot===0?0:ot}}return De}function O3(T){return typeof T=="number"?T:$g(T)?H:+T}function zh(T){if(typeof T=="string")return T;if(qs(T))return Ma(T,zh)+"";if($g(T))return mN?mN.call(T):"";var D=T+"";return D=="0"&&1/T==-1/0?"-0":D}function Av(T,D,$){var te=-1,he=rx,De=T.length,ot=!0,yt=[],Pt=yt;if($)ot=!1,he=Wk;else if(De>=r){var jn=D?null:tH(T);if(jn)return o0(jn);ot=!1,he=Ag,Pt=new P1}else Pt=D?[]:yt;e:for(;++te<De;){var Bn=T[te],ei=D?D(Bn):Bn;if(Bn=$||Bn!==0?Bn:0,ot&&ei===ei){for(var qi=Pt.length;qi--;)if(Pt[qi]===ei)continue e;D&&Pt.push(ei),yt.push(Bn)}else he(Pt,ei,$)||(Pt!==yt&&Pt.push(ei),yt.push(Bn))}return yt}function DN(T,D){return D=u_(D,T),T=Eu(T,D),T==null||delete T[jg(rh(D))]}function M3(T,D,$,te){return V1(T,D,$(kv(T,D)),te)}function hT(T,D,$,te){for(var he=T.length,De=te?he:-1;(te?De--:++De<he)&&D(T[De],De,T););return $?kd(T,te?0:De,te?De+1:he):kd(T,te?De+1:0,te?he:De)}function kx(T,D){var $=T;return $ instanceof Us&&($=$.value()),k1(D,function(te,he){return he.func.apply(he.thisArg,dl([te],he.args))},$)}function RN(T,D,$){var te=T.length;if(te<2)return te?Av(T[0]):[];for(var he=-1,De=Zt(te);++he<te;)for(var ot=T[he],yt=-1;++yt<te;)yt!=he&&(De[he]=o_(De[he]||ot,T[yt],D,$));return Av(oc(De,1),D,$)}function fT(T,D,$){for(var te=-1,he=T.length,De=D.length,ot={};++te<he;){var yt=te<De?D[te]:t;$(ot,T[te],yt)}return ot}function Tx(T){return iu(T)?T:[]}function PN(T){return typeof T=="function"?T:Lp}function u_(T,D){return qs(T)?T:ar(T,D)?[T]:t5(Fa(T))}var K$=no;function Nv(T,D,$){var te=T.length;return $=$===t?te:$,!D&&$>=te?T:kd(T,D,$)}var j3=P$||function(T){return Sa.clearTimeout(T)};function F3(T,D){if(D)return T.slice();var $=T.length,te=v3?v3($):new T.constructor($);return T.copy(te),te}function pT(T){var D=new T.constructor(T.byteLength);return new Zk(D).set(new Zk(T)),D}function G$(T,D){var $=D?pT(T.buffer):T.buffer;return new T.constructor($,T.byteOffset,T.byteLength)}function Y$(T){var D=new T.constructor(T.source,ln.exec(T));return D.lastIndex=T.lastIndex,D}function Q$(T){return If?ja(If.call(T)):{}}function X$(T,D){var $=D?pT(T.buffer):T.buffer;return new T.constructor($,T.byteOffset,T.length)}function B3(T,D){if(T!==D){var $=T!==t,te=T===null,he=T===T,De=$g(T),ot=D!==t,yt=D===null,Pt=D===D,jn=$g(D);if(!yt&&!jn&&!De&&T>D||De&&ot&&Pt&&!yt&&!jn||te&&ot&&Pt||!$&&Pt||!he)return 1;if(!te&&!De&&!jn&&T<D||jn&&$&&he&&!te&&!De||yt&&$&&he||!ot&&he||!Pt)return-1}return 0}function Pne(T,D,$){for(var te=-1,he=T.criteria,De=D.criteria,ot=he.length,yt=$.length;++te<ot;){var Pt=B3(he[te],De[te]);if(Pt){if(te>=yt)return Pt;var jn=$[te];return Pt*(jn=="desc"?-1:1)}}return T.index-D.index}function Z$(T,D,$,te){for(var he=-1,De=T.length,ot=$.length,yt=-1,Pt=D.length,jn=Oc(De-ot,0),Bn=Zt(Pt+jn),ei=!te;++yt<Pt;)Bn[yt]=D[yt];for(;++he<ot;)(ei||he<De)&&(Bn[$[he]]=T[he]);for(;jn--;)Bn[yt++]=T[he++];return Bn}function $3(T,D,$,te){for(var he=-1,De=T.length,ot=-1,yt=$.length,Pt=-1,jn=D.length,Bn=Oc(De-yt,0),ei=Zt(Bn+jn),qi=!te;++he<Bn;)ei[he]=T[he];for(var Rr=he;++Pt<jn;)ei[Rr+Pt]=D[Pt];for(;++ot<yt;)(qi||he<De)&&(ei[Rr+$[ot]]=T[he++]);return ei}function th(T,D){var $=-1,te=T.length;for(D||(D=Zt(te));++$<te;)D[$]=T[$];return D}function Rg(T,D,$,te){var he=!$;$||($={});for(var De=-1,ot=D.length;++De<ot;){var yt=D[De],Pt=te?te($[yt],T[yt],yt,$,T):t;Pt===t&&(Pt=T[yt]),he?s_($,yt,Pt):j1($,yt,Pt)}return $}function ON(T,D){return Rg(T,Pg(T),D)}function One(T,D){return Rg(T,iH(T),D)}function MN(T,D){return function($,te){var he=qs($)?Hk:Lf,De=D?D():{};return he($,T,is(te,2),De)}}function Ix(T){return no(function(D,$){var te=-1,he=$.length,De=he>1?$[he-1]:t,ot=he>2?$[2]:t;for(De=T.length>3&&typeof De=="function"?(he--,De):t,ot&&ih($[0],$[1],ot)&&(De=he<3?t:De,he=1),D=ja(D);++te<he;){var yt=$[te];yt&&T(D,yt,te,De)}return D})}function Sp(T,D){return function($,te){if($==null)return $;if(!Tp($))return T($,te);for(var he=$.length,De=D?he:-1,ot=ja($);(D?De--:++De<he)&&te(ot[De],De,ot)!==!1;);return $}}function jN(T){return function(D,$,te){for(var he=-1,De=ja(D),ot=te(D),yt=ot.length;yt--;){var Pt=ot[T?yt:++he];if($(De[Pt],Pt,De)===!1)break}return D}}function FN(T,D,$){var te=D&_,he=Lx(T);function De(){var ot=this&&this!==Sa&&this instanceof De?he:T;return ot.apply(te?$:this,arguments)}return De}function H3(T){return function(D){D=Fa(D);var $=s0(D)?Tf(D):t,te=$?$[0]:D.charAt(0),he=$?Nv($,1).join(""):D.slice(1);return te[T]()+he}}function W1(T){return function(D){return k1(aLe(oLe(D).replace(ki,"")),T,"")}}function Lx(T){return function(){var D=arguments;switch(D.length){case 0:return new T;case 1:return new T(D[0]);case 2:return new T(D[0],D[1]);case 3:return new T(D[0],D[1],D[2]);case 4:return new T(D[0],D[1],D[2],D[3]);case 5:return new T(D[0],D[1],D[2],D[3],D[4]);case 6:return new T(D[0],D[1],D[2],D[3],D[4],D[5]);case 7:return new T(D[0],D[1],D[2],D[3],D[4],D[5],D[6])}var $=_x(T.prototype),te=T.apply($,D);return Cc(te)?te:$}}function V3(T,D,$){var te=Lx(T);function he(){for(var De=arguments.length,ot=Zt(De),yt=De,Pt=Dv(he);yt--;)ot[yt]=arguments[yt];var jn=De<3&&ot[0]!==Pt&&ot[De-1]!==Pt?[]:gp(ot,Pt);if(De-=jn.length,De<$)return nh(T,D,Ax,he.placeholder,t,ot,jn,t,t,$-De);var Bn=this&&this!==Sa&&this instanceof he?te:T;return Gu(Bn,this,ot)}return he}function z1(T){return function(D,$,te){var he=ja(D);if(!Tp(D)){var De=is($,3);D=Td(D),$=function(yt){return De(he[yt],yt,he)}}var ot=T(D,$,te);return ot>-1?he[De?D[ot]:ot]:t}}function BN(T){return h_(function(D){var $=D.length,te=$,he=Cd.prototype.thru;for(T&&D.reverse();te--;){var De=D[te];if(typeof De!="function")throw new mp(o);if(he&&!ot&&Nx(De)=="wrapper")var ot=new Cd([],!0)}for(te=ot?te:$;++te<$;){De=D[te];var yt=Nx(De),Pt=yt=="wrapper"?VN(De):t;Pt&&wT(Pt[0])&&Pt[1]==(I|y|S|L)&&!Pt[4].length&&Pt[9]==1?ot=ot[Nx(Pt[0])].apply(ot,Pt[3]):ot=De.length==1&&wT(De)?ot[yt]():ot.thru(De)}return function(){var jn=arguments,Bn=jn[0];if(ot&&jn.length==1&&qs(Bn))return ot.plant(Bn).value();for(var ei=0,qi=$?D[ei].apply(this,jn):Bn;++ei<$;)qi=D[ei].call(this,qi);return qi}})}function Ax(T,D,$,te,he,De,ot,yt,Pt,jn){var Bn=D&I,ei=D&_,qi=D&v,Rr=D&(y|C),gs=D&N,lo=qi?t:Lx(T);function ms(){for(var xo=arguments.length,Ho=Zt(xo),Hg=xo;Hg--;)Ho[Hg]=arguments[Hg];if(Rr)var Rf=Dv(ms),Vg=qk(Ho,Rf);if(te&&(Ho=Z$(Ho,te,he,Rr)),De&&(Ho=$3(Ho,De,ot,Rr)),xo-=Vg,Rr&&xo<jn){var ru=gp(Ho,Rf);return nh(T,D,Ax,ms.placeholder,$,Ho,ru,yt,Pt,jn-xo)}var Mv=ei?$:this,J1=qi?Mv[T]:T;return xo=Ho.length,yt?Ho=Og(Ho,yt):gs&&xo>1&&Ho.reverse(),Bn&&Pt<xo&&(Ho.length=Pt),this&&this!==Sa&&this instanceof ms&&(J1=lo||Lx(J1)),J1.apply(Mv,Ho)}return ms}function J$(T,D){return function($,te){return Tv($,T,D(te),{})}}function gT(T,D){return function($,te){var he;if($===t&&te===t)return D;if($!==t&&(he=$),te!==t){if(he===t)return te;typeof $=="string"||typeof te=="string"?($=zh($),te=zh(te)):($=O3($),te=O3(te)),he=T($,te)}return he}}function $N(T){return h_(function(D){return D=Ma(D,bd(is())),no(function($){var te=this;return T(D,function(he){return Gu(he,te,$)})})})}function mT(T,D){D=D===t?" ":zh(D);var $=D.length;if($<2)return $?H1(D,T):D;var te=H1(D,D1(T/A1(D)));return s0(D)?Nv(Tf(te),0,T).join(""):te.slice(0,T)}function eH(T,D,$,te){var he=D&_,De=Lx(T);function ot(){for(var yt=-1,Pt=arguments.length,jn=-1,Bn=te.length,ei=Zt(Bn+Pt),qi=this&&this!==Sa&&this instanceof ot?De:T;++jn<Bn;)ei[jn]=te[jn];for(;Pt--;)ei[jn++]=arguments[++yt];return Gu(qi,he?$:this,ei)}return ot}function W3(T){return function(D,$,te){return te&&typeof te!="number"&&ih(D,$,te)&&($=te=t),D=Z1(D),$===t?($=D,D=0):$=Z1($),te=te===t?D<$?1:-1:Z1(te),dT(D,$,te,T)}}function HN(T){return function(D,$){return typeof D=="string"&&typeof $=="string"||(D=p_(D),$=p_($)),T(D,$)}}function nh(T,D,$,te,he,De,ot,yt,Pt,jn){var Bn=D&y,ei=Bn?ot:t,qi=Bn?t:ot,Rr=Bn?De:t,gs=Bn?t:De;D|=Bn?S:k,D&=~(Bn?k:S),D&b||(D&=-4);var lo=[T,D,he,Rr,ei,gs,qi,yt,Pt,jn],ms=$.apply(t,lo);return wT(T)&&J3(ms,lo),ms.placeholder=te,e5(ms,T,D)}function Qu(T){var D=Pc[T];return function($,te){if($=p_($),te=te==null?0:yd(io(te),292),te&&hx($)){var he=(Fa($)+"e").split("e"),De=D(he[0]+"e"+(+he[1]+te));return he=(Fa(De)+"e").split("e"),+(he[0]+"e"+(+he[1]-te))}return D($)}}var tH=l0&&1/o0(new l0([,-0]))[1]==q?function(T){return new l0(T)}:cie;function z3(T){return function(D){var $=Xu(D);return $==qe?L1(D):$==en?Ine(D):iN(D,T(D))}}function d_(T,D,$,te,he,De,ot,yt){var Pt=D&v;if(!Pt&&typeof T!="function")throw new mp(o);var jn=te?te.length:0;if(jn||(D&=-97,te=he=t),ot=ot===t?ot:Oc(io(ot),0),yt=yt===t?yt:io(yt),jn-=he?he.length:0,D&k){var Bn=te,ei=he;te=he=t}var qi=Pt?t:VN(T),Rr=[T,D,$,te,he,Bn,ei,De,ot,yt];if(qi&&aH(Rr,qi),T=Rr[0],D=Rr[1],$=Rr[2],te=Rr[3],he=Rr[4],yt=Rr[9]=Rr[9]===t?Pt?0:T.length:Oc(Rr[9]-jn,0),!yt&&D&(y|C)&&(D&=-25),!D||D==_)var gs=FN(T,D,$);else D==y||D==C?gs=V3(T,D,yt):(D==S||D==(_|S))&&!he.length?gs=eH(T,D,$,te):gs=Ax.apply(t,Rr);var lo=qi?AN:J3;return e5(lo(gs,Rr),T,D)}function U3(T,D,$,te){return T===t||Ov(T,e_[$])&&!ta.call(te,$)?D:T}function q3(T,D,$,te,he,De){return Cc(T)&&Cc(D)&&(De.set(D,T),$1(T,D,t,q3,De),De.delete(D)),T}function K3(T){return m5(T)?t:T}function G3(T,D,$,te,he,De){var ot=$&g,yt=T.length,Pt=D.length;if(yt!=Pt&&!(ot&&Pt>yt))return!1;var jn=De.get(T),Bn=De.get(D);if(jn&&Bn)return jn==D&&Bn==T;var ei=-1,qi=!0,Rr=$&m?new P1:t;for(De.set(T,D),De.set(D,T);++ei<yt;){var gs=T[ei],lo=D[ei];if(te)var ms=ot?te(lo,gs,ei,D,T,De):te(gs,lo,ei,T,D,De);if(ms!==t){if(ms)continue;qi=!1;break}if(Rr){if(!ae(D,function(xo,Ho){if(!Ag(Rr,Ho)&&(gs===xo||he(gs,xo,$,te,De)))return Rr.push(Ho)})){qi=!1;break}}else if(!(gs===lo||he(gs,lo,$,te,De))){qi=!1;break}}return De.delete(T),De.delete(D),qi}function Y3(T,D,$,te,he,De,ot){switch($){case Ne:if(T.byteLength!=D.byteLength||T.byteOffset!=D.byteOffset)return!1;T=T.buffer,D=D.buffer;case ce:return!(T.byteLength!=D.byteLength||!De(new Zk(T),new Zk(D)));case Ie:case ge:case mt:return Ov(+T,+D);case Pe:return T.name==D.name&&T.message==D.message;case Ft:case Ke:return T==D+"";case qe:var yt=L1;case en:var Pt=te&g;if(yt||(yt=o0),T.size!=D.size&&!Pt)return!1;var jn=ot.get(T);if(jn)return jn==D;te|=m,ot.set(T,D);var Bn=G3(yt(T),yt(D),te,he,De,ot);return ot.delete(T),Bn;case dt:if(If)return If.call(T)==If.call(D)}return!1}function nH(T,D,$,te,he,De){var ot=$&g,yt=_T(T),Pt=yt.length,jn=_T(D),Bn=jn.length;if(Pt!=Bn&&!ot)return!1;for(var ei=Pt;ei--;){var qi=yt[ei];if(!(ot?qi in D:ta.call(D,qi)))return!1}var Rr=De.get(T),gs=De.get(D);if(Rr&&gs)return Rr==D&&gs==T;var lo=!0;De.set(T,D),De.set(D,T);for(var ms=ot;++ei<Pt;){qi=yt[ei];var xo=T[qi],Ho=D[qi];if(te)var Hg=ot?te(Ho,xo,qi,D,T,De):te(xo,Ho,qi,T,D,De);if(!(Hg===t?xo===Ho||he(xo,Ho,$,te,De):Hg)){lo=!1;break}ms||(ms=qi=="constructor")}if(lo&&!ms){var Rf=T.constructor,Vg=D.constructor;Rf!=Vg&&"constructor"in T&&"constructor"in D&&!(typeof Rf=="function"&&Rf instanceof Rf&&typeof Vg=="function"&&Vg instanceof Vg)&&(lo=!1)}return De.delete(T),De.delete(D),lo}function h_(T){return Nf(qN(T,t,YN),T+"")}function _T(T){return SN(T,Td,Pg)}function vT(T){return SN(T,Ip,iH)}var VN=gN?function(T){return gN.get(T)}:cie;function Nx(T){for(var D=T.name+"",$=gx[D],te=ta.call(gx,D)?$.length:0;te--;){var he=$[te],De=he.func;if(De==null||De==T)return he.name}return D}function Dv(T){var D=ta.call(Te,"placeholder")?Te:T;return D.placeholder}function is(){var T=Te.iteratee||aie;return T=T===aie?xx:T,arguments.length?T(arguments[0],arguments[1]):T}function bT(T,D){var $=T.__data__;return Dx(D)?$[typeof D=="string"?"string":"hash"]:$.map}function yT(T){for(var D=Td(T),$=D.length;$--;){var te=D[$],he=T[te];D[$]=[te,he,xT(he)]}return D}function _0(T,D){var $=r0(T,D);return T3($)?$:t}function WN(T){var D=ta.call(T,N1),$=T[N1];try{T[N1]=t;var te=!0}catch{}var he=Qk.call(T);return te&&(D?T[N1]=$:delete T[N1]),he}var Pg=hN?function(T){return T==null?[]:(T=ja(T),Jm(hN(T),function(D){return uN.call(T,D)}))}:uie,iH=hN?function(T){for(var D=[];T;)dl(D,Pg(T)),T=Ng(T);return D}:uie,Xu=Yu;(tT&&Xu(new tT(new ArrayBuffer(1)))!=Ne||R1&&Xu(new R1)!=qe||nT&&Xu(nT.resolve())!=tt||l0&&Xu(new l0)!=en||iT&&Xu(new iT)!=at)&&(Xu=function(T){var D=Yu(T),$=D==ft?T.constructor:t,te=$?v0($):"";if(te)switch(te){case C3:return Ne;case c0:return qe;case M$:return tt;case mx:return en;case t_:return at}return D});function Q3(T,D,$){for(var te=-1,he=$.length;++te<he;){var De=$[te],ot=De.size;switch(De.type){case"drop":T+=ot;break;case"dropRight":D-=ot;break;case"take":D=yd(D,T+ot);break;case"takeRight":T=Oc(T,D-ot);break}}return{start:T,end:D}}function rH(T){var D=T.match(Ln);return D?D[1].split(bi):[]}function X3(T,D,$){D=u_(D,T);for(var te=-1,he=D.length,De=!1;++te<he;){var ot=jg(D[te]);if(!(De=T!=null&&$(T,ot)))break;T=T[ot]}return De||++te!=he?De:(he=T==null?0:T.length,!!he&&SH(he)&&Bl(ot,he)&&(qs(T)||NT(T)))}function CT(T){var D=T.length,$=new T.constructor(D);return D&&typeof T[0]=="string"&&ta.call(T,"index")&&($.index=T.index,$.input=T.input),$}function Zu(T){return typeof T.constructor=="function"&&!Rv(T)?_x(Ng(T)):{}}function Mne(T,D,$){var te=T.constructor;switch(D){case ce:return pT(T);case Ie:case ge:return new te(+T);case Ne:return G$(T,$);case Xe:case it:case Tt:case Ct:case Rt:case se:case ke:case Ae:case je:return X$(T,$);case qe:return new te;case mt:case Ke:return new te(T);case Ft:return Y$(T);case en:return new te;case dt:return Q$(T)}}function jne(T,D){var $=D.length;if(!$)return T;var te=$-1;return D[te]=($>1?"& ":"")+D[te],D=D.join($>2?", ":" "),T.replace(Pn,`{ /* [wrapped with `+D+`] */ `)}function zN(T){return qs(T)||NT(T)||!!(R$&&T&&T[R$])}function Bl(T,D){var $=typeof T;return D=D??U,!!D&&($=="number"||$!="symbol"&&Qe.test(T))&&T>-1&&T%1==0&&T<D}function ih(T,D,$){if(!Cc($))return!1;var te=typeof D;return(te=="number"?Tp($)&&Bl(D,$.length):te=="string"&&D in $)?Ov($[D],T):!1}function ar(T,D){if(qs(T))return!1;var $=typeof T;return $=="number"||$=="symbol"||$=="boolean"||T==null||$g(T)?!0:_e.test(T)||!de.test(T)||D!=null&&T in ja(D)}function Dx(T){var D=typeof T;return D=="string"||D=="number"||D=="symbol"||D=="boolean"?T!=="__proto__":T===null}function wT(T){var D=Nx(T),$=Te[D];if(typeof $!="function"||!(D in Us.prototype))return!1;if(T===$)return!0;var te=VN($);return!!te&&T===te[0]}function sH(T){return!!aN&&aN in T}var Fne=ux?X1:die;function Rv(T){var D=T&&T.constructor,$=typeof D=="function"&&D.prototype||e_;return T===$}function xT(T){return T===T&&!Cc(T)}function UN(T,D){return function($){return $==null?!1:$[T]===D&&(D!==t||T in ja($))}}function oH(T){var D=Kt(T,function(te){return $.size===c&&$.clear(),te}),$=D.cache;return D}function aH(T,D){var $=T[1],te=D[1],he=$|te,De=he<(_|v|I),ot=te==I&&$==y||te==I&&$==L&&T[7].length<=D[8]||te==(I|L)&&D[7].length<=D[8]&&$==y;if(!(De||ot))return T;te&_&&(T[2]=D[2],he|=$&_?0:b);var yt=D[3];if(yt){var Pt=T[3];T[3]=Pt?Z$(Pt,yt,D[4]):yt,T[4]=Pt?gp(T[3],u):D[4]}return yt=D[5],yt&&(Pt=T[5],T[5]=Pt?$3(Pt,yt,D[6]):yt,T[6]=Pt?gp(T[5],u):D[6]),yt=D[7],yt&&(T[7]=yt),te&I&&(T[8]=T[8]==null?D[8]:yd(T[8],D[8])),T[9]==null&&(T[9]=D[9]),T[0]=D[0],T[1]=he,T}function lH(T){var D=[];if(T!=null)for(var $ in ja(T))D.push($);return D}function Z3(T){return Qk.call(T)}function qN(T,D,$){return D=Oc(D===t?T.length-1:D,0),function(){for(var te=arguments,he=-1,De=Oc(te.length-D,0),ot=Zt(De);++he<De;)ot[he]=te[D+he];he=-1;for(var yt=Zt(D+1);++he<D;)yt[he]=te[he];return yt[D]=$(ot),Gu(T,this,yt)}}function Eu(T,D){return D.length<2?T:kv(T,kd(D,0,-1))}function Og(T,D){for(var $=T.length,te=yd(D.length,$),he=th(T);te--;){var De=D[te];T[te]=Bl(De,$)?he[De]:t}return T}function f_(T,D){if(!(D==="constructor"&&typeof T[D]=="function")&&D!="__proto__")return T[D]}var J3=Mg(AN),Rx=b3||function(T,D){return Sa.setTimeout(T,D)},Nf=Mg(c_);function e5(T,D,$){var te=D+"";return Nf(T,jne(te,cH(rH(te),$)))}function Mg(T){var D=0,$=0;return function(){var te=Rne(),he=V-(te-$);if($=te,he>0){if(++D>=F)return arguments[0]}else D=0;return T.apply(t,arguments)}}function KN(T,D){var $=-1,te=T.length,he=te-1;for(D=D===t?te:D;++$<D;){var De=Sx($,he),ot=T[De];T[De]=T[$],T[$]=ot}return T.length=D,T}var t5=oH(function(T){var D=[];return T.charCodeAt(0)===46&&D.push(""),T.replace(Le,function($,te,he,De){D.push(he?De.replace(qt,"$1"):te||$)}),D});function jg(T){if(typeof T=="string"||$g(T))return T;var D=T+"";return D=="0"&&1/T==-1/0?"-0":D}function v0(T){if(T!=null){try{return Yk.call(T)}catch{}try{return T+""}catch{}}return""}function cH(T,D){return Su(oe,function($){var te="_."+$[0];D&$[1]&&!rx(T,te)&&T.push(te)}),T.sort()}function uH(T){if(T instanceof Us)return T.clone();var D=new Cd(T.__wrapped__,T.__chain__);return D.__actions__=th(T.__actions__),D.__index__=T.__index__,D.__values__=T.__values__,D}function GN(T,D,$){($?ih(T,D,$):D===t)?D=1:D=Oc(io(D),0);var te=T==null?0:T.length;if(!te||D<1)return[];for(var he=0,De=0,ot=Zt(D1(te/D));he<te;)ot[De++]=kd(T,he,he+=D);return ot}function n5(T){for(var D=-1,$=T==null?0:T.length,te=0,he=[];++D<$;){var De=T[D];De&&(he[te++]=De)}return he}function Ep(){var T=arguments.length;if(!T)return[];for(var D=Zt(T-1),$=arguments[0],te=T;te--;)D[te-1]=arguments[te];return dl(qs($)?th($):[$],oc(D,1))}var $o=no(function(T,D){return iu(T)?o_(T,oc(D,1,iu,!0)):[]}),ku=no(function(T,D){var $=rh(D);return iu($)&&($=t),iu(T)?o_(T,oc(D,1,iu,!0),is($,2)):[]}),Mc=no(function(T,D){var $=rh(D);return iu($)&&($=t),iu(T)?o_(T,oc(D,1,iu,!0),t,$):[]});function Ju(T,D,$){var te=T==null?0:T.length;return te?(D=$||D===t?1:io(D),kd(T,D<0?0:D,te)):[]}function Df(T,D,$){var te=T==null?0:T.length;return te?(D=$||D===t?1:io(D),D=te-D,kd(T,0,D<0?0:D)):[]}function Px(T,D){return T&&T.length?hT(T,is(D,3),!0,!0):[]}function nu(T,D){return T&&T.length?hT(T,is(D,3),!0):[]}function ST(T,D,$,te){var he=T==null?0:T.length;return he?($&&typeof $!="number"&&ih(T,D,$)&&($=0,te=he),z$(T,D,$,te)):[]}function b0(T,D,$){var te=T==null?0:T.length;if(!te)return-1;var he=$==null?0:io($);return he<0&&(he=Oc(te+he,0)),xn(T,is(D,3),he)}function ET(T,D,$){var te=T==null?0:T.length;if(!te)return-1;var he=te-1;return $!==t&&(he=io($),he=$<0?Oc(te+he,0):yd(he,te-1)),xn(T,is(D,3),he,!0)}function YN(T){var D=T==null?0:T.length;return D?oc(T,1):[]}function kT(T){var D=T==null?0:T.length;return D?oc(T,q):[]}function Uh(T,D){var $=T==null?0:T.length;return $?(D=D===t?1:io(D),oc(T,D)):[]}function i5(T){for(var D=-1,$=T==null?0:T.length,te={};++D<$;){var he=T[D];te[he[0]]=he[1]}return te}function U1(T){return T&&T.length?T[0]:t}function Pv(T,D,$){var te=T==null?0:T.length;if(!te)return-1;var he=$==null?0:io($);return he<0&&(he=Oc(te+he,0)),Ci(T,D,he)}function QN(T){var D=T==null?0:T.length;return D?kd(T,0,-1):[]}var r5=no(function(T){var D=Ma(T,Tx);return D.length&&D[0]===T[0]?EN(D):[]}),y0=no(function(T){var D=rh(T),$=Ma(T,Tx);return D===rh($)?D=t:$.pop(),$.length&&$[0]===T[0]?EN($,is(D,2)):[]}),XN=no(function(T){var D=rh(T),$=Ma(T,Tx);return D=typeof D=="function"?D:t,D&&$.pop(),$.length&&$[0]===T[0]?EN($,t,D):[]});function C0(T,D){return T==null?"":fN.call(T,D)}function rh(T){var D=T==null?0:T.length;return D?T[D-1]:t}function TT(T,D,$){var te=T==null?0:T.length;if(!te)return-1;var he=te;return $!==t&&(he=io($),he=he<0?Oc(te+he,0):yd(he,te-1)),D===D?Lne(T,D,he):xn(T,Ts,he,!0)}function s5(T,D){return T&&T.length?LN(T,io(D)):t}var ZN=no(IT);function IT(T,D){return T&&T.length&&D&&D.length?bc(T,D):T}function sh(T,D,$){return T&&T.length&&D&&D.length?bc(T,D,is($,2)):T}function w0(T,D,$){return T&&T.length&&D&&D.length?bc(T,D,t,$):T}var Fg=h_(function(T,D){var $=T==null?0:T.length,te=wN(T,D);return tu(T,Ma(D,function(he){return Bl(he,$)?+he:he}).sort(B3)),te});function qh(T,D){var $=[];if(!(T&&T.length))return $;var te=-1,he=[],De=T.length;for(D=is(D,3);++te<De;){var ot=T[te];D(ot,te,T)&&($.push(ot),he.push(te))}return tu(T,he),$}function JN(T){return T==null?T:pN.call(T)}function o5(T,D,$){var te=T==null?0:T.length;return te?($&&typeof $!="number"&&ih(T,D,$)?(D=0,$=te):(D=D==null?0:io(D),$=$===t?te:io($)),kd(T,D,$)):[]}function a5(T,D){return Ex(T,D)}function Bne(T,D,$){return NN(T,D,is($,2))}function x0(T,D){var $=T==null?0:T.length;if($){var te=Ex(T,D);if(te<$&&Ov(T[te],D))return te}return-1}function dH(T,D){return Ex(T,D,!0)}function l5(T,D,$){return NN(T,D,is($,2),!0)}function q1(T,D){var $=T==null?0:T.length;if($){var te=Ex(T,D,!0)-1;if(Ov(T[te],D))return te}return-1}function c5(T){return T&&T.length?P3(T):[]}function K1(T,D){return T&&T.length?P3(T,is(D,2)):[]}function hH(T){var D=T==null?0:T.length;return D?kd(T,1,D):[]}function fH(T,D,$){return T&&T.length?(D=$||D===t?1:io(D),kd(T,0,D<0?0:D)):[]}function u5(T,D,$){var te=T==null?0:T.length;return te?(D=$||D===t?1:io(D),D=te-D,kd(T,D<0?0:D,te)):[]}function eD(T,D){return T&&T.length?hT(T,is(D,3),!1,!0):[]}function $ne(T,D){return T&&T.length?hT(T,is(D,3)):[]}var Hne=no(function(T){return Av(oc(T,1,iu,!0))}),pH=no(function(T){var D=rh(T);return iu(D)&&(D=t),Av(oc(T,1,iu,!0),is(D,2))}),gH=no(function(T){var D=rh(T);return D=typeof D=="function"?D:t,Av(oc(T,1,iu,!0),t,D)});function G1(T){return T&&T.length?Av(T):[]}function Vne(T,D){return T&&T.length?Av(T,is(D,2)):[]}function Ox(T,D){return D=typeof D=="function"?D:t,T&&T.length?Av(T,t,D):[]}function tD(T){if(!(T&&T.length))return[];var D=0;return T=Jm(T,function($){if(iu($))return D=Oc($.length,D),!0}),zk(D,function($){return Ma(T,Bo($))})}function Xl(T,D){if(!(T&&T.length))return[];var $=tD(T);return D==null?$:Ma($,function(te){return Gu(D,t,te)})}var Wne=no(function(T,D){return iu(T)?o_(T,D):[]}),mH=no(function(T){return RN(Jm(T,iu))}),zne=no(function(T){var D=rh(T);return iu(D)&&(D=t),RN(Jm(T,iu),is(D,2))}),Une=no(function(T){var D=rh(T);return D=typeof D=="function"?D:t,RN(Jm(T,iu),t,D)}),_H=no(tD);function vH(T,D){return fT(T||[],D||[],j1)}function qne(T,D){return fT(T||[],D||[],V1)}var kp=no(function(T){var D=T.length,$=D>1?T[D-1]:t;return $=typeof $=="function"?(T.pop(),$):t,Xl(T,$)});function nD(T){var D=Te(T);return D.__chain__=!0,D}function Kne(T,D){return D(T),T}function Bg(T,D){return D(T)}var iD=h_(function(T){var D=T.length,$=D?T[0]:0,te=this.__wrapped__,he=function(De){return wN(De,T)};return D>1||this.__actions__.length||!(te instanceof Us)||!Bl($)?this.thru(he):(te=te.slice($,+$+(D?1:0)),te.__actions__.push({func:Bg,args:[he],thisArg:t}),new Cd(te,this.__chain__).thru(function(De){return D&&!De.length&&De.push(t),De}))});function Y1(){return nD(this)}function rD(){return new Cd(this.value(),this.__chain__)}function d5(){this.__values__===t&&(this.__values__=XIe(this.value()));var T=this.__index__>=this.__values__.length,D=T?t:this.__values__[this.__index__++];return{done:T,value:D}}function h5(){return this}function Gne(T){for(var D,$=this;$ instanceof n_;){var te=uH($);te.__index__=0,te.__values__=t,D?he.__wrapped__=te:D=te;var he=te;$=$.__wrapped__}return he.__wrapped__=T,D}function f5(){var T=this.__wrapped__;if(T instanceof Us){var D=T;return this.__actions__.length&&(D=new Us(this)),D=D.reverse(),D.__actions__.push({func:Bg,args:[JN],thisArg:t}),new Cd(D,this.__chain__)}return this.thru(JN)}function Yne(){return kx(this.__wrapped__,this.__actions__)}var bH=MN(function(T,D,$){ta.call(T,$)?++T[$]:s_(T,$,1)});function yH(T,D,$){var te=qs(T)?Vk:oT;return $&&ih(T,D,$)&&(D=t),te(T,is(D,3))}function sD(T,D){var $=qs(T)?Jm:E3;return $(T,is(D,3))}var oD=z1(b0),CH=z1(ET);function p5(T,D){return oc(Q1(T,D),1)}function Qne(T,D){return oc(Q1(T,D),q)}function wH(T,D,$){return $=$===t?1:io($),oc(Q1(T,D),$)}function aD(T,D){var $=qs(T)?Su:a_;return $(T,is(D,3))}function LT(T,D){var $=qs(T)?ix:W$;return $(T,is(D,3))}var g5=MN(function(T,D,$){ta.call(T,$)?T[$].push(D):s_(T,$,[D])});function lD(T,D,$,te){T=Tp(T)?T:dD(T),$=$&&!te?io($):0;var he=T.length;return $<0&&($=Oc(he+$,0)),EH(T)?$<=he&&T.indexOf(D,$)>-1:!!he&&Ci(T,D,$)>-1}var xH=no(function(T,D,$){var te=-1,he=typeof D=="function",De=Tp(T)?Zt(T.length):[];return a_(T,function(ot){De[++te]=he?Gu(D,ot,$):Cp(ot,D,$)}),De}),Xne=MN(function(T,D,$){s_(T,$,D)});function Q1(T,D){var $=qs(T)?Ma:L3;return $(T,is(D,3))}function Zne(T,D,$,te){return T==null?[]:(qs(D)||(D=D==null?[]:[D]),$=te?t:$,qs($)||($=$==null?[]:[$]),uT(T,D,$))}var AT=MN(function(T,D,$){T[$?0:1].push(D)},function(){return[[],[]]});function Jne(T,D,$){var te=qs(T)?k1:T1,he=arguments.length<3;return te(T,is(D,4),$,he,a_)}function cD(T,D,$){var te=qs(T)?h3:T1,he=arguments.length<3;return te(T,is(D,4),$,he,W$)}function w(T,D){var $=qs(T)?Jm:E3;return $(T,_i(is(D,3)))}function E(T){var D=qs(T)?r_:Ed;return D(T)}function R(T,D,$){($?ih(T,D,$):D===t)?D=1:D=io(D);var te=qs(T)?M1:D3;return te(T,D)}function j(T){var D=qs(T)?H$:xp;return D(T)}function Y(T){if(T==null)return 0;if(Tp(T))return EH(T)?A1(T):T.length;var D=Xu(T);return D==qe||D==en?T.size:Lv(T).length}function ee(T,D,$){var te=qs(T)?ae:R3;return $&&ih(T,D,$)&&(D=t),te(T,is(D,3))}var be=no(function(T,D){if(T==null)return[];var $=D.length;return $>1&&ih(T,D[0],D[1])?D=[]:$>2&&ih(D[0],D[1],D[2])&&(D=[D[0]]),uT(T,oc(D,1),[])}),Ze=El||function(){return Sa.Date.now()};function bt(T,D){if(typeof D!="function")throw new mp(o);return T=io(T),function(){if(--T<1)return D.apply(this,arguments)}}function on(T,D,$){return D=$?t:D,D=T&&D==null?T.length:D,d_(T,I,t,t,t,t,D)}function Xn(T,D){var $;if(typeof D!="function")throw new mp(o);return T=io(T),function(){return--T>0&&($=D.apply(this,arguments)),T<=1&&(D=t),$}}var ri=no(function(T,D,$){var te=_;if($.length){var he=gp($,Dv(ri));te|=S}return d_(T,te,D,$,he)}),Gn=no(function(T,D,$){var te=_|v;if($.length){var he=gp($,Dv(Gn));te|=S}return d_(D,te,T,$,he)});function Zi(T,D,$){D=$?t:D;var te=d_(T,y,t,t,t,t,t,D);return te.placeholder=Zi.placeholder,te}function hr(T,D,$){D=$?t:D;var te=d_(T,C,t,t,t,t,t,D);return te.placeholder=hr.placeholder,te}function yr(T,D,$){var te,he,De,ot,yt,Pt,jn=0,Bn=!1,ei=!1,qi=!0;if(typeof T!="function")throw new mp(o);D=p_(D)||0,Cc($)&&(Bn=!!$.leading,ei="maxWait"in $,De=ei?Oc(p_($.maxWait)||0,D):De,qi="trailing"in $?!!$.trailing:qi);function Rr(ru){var Mv=te,J1=he;return te=he=t,jn=ru,ot=T.apply(J1,Mv),ot}function gs(ru){return jn=ru,yt=Rx(xo,D),Bn?Rr(ru):ot}function lo(ru){var Mv=ru-Pt,J1=ru-jn,uLe=D-Mv;return ei?yd(uLe,De-J1):uLe}function ms(ru){var Mv=ru-Pt,J1=ru-jn;return Pt===t||Mv>=D||Mv<0||ei&&J1>=De}function xo(){var ru=Ze();if(ms(ru))return Ho(ru);yt=Rx(xo,lo(ru))}function Ho(ru){return yt=t,qi&&te?Rr(ru):(te=he=t,ot)}function Hg(){yt!==t&&j3(yt),jn=0,te=Pt=he=yt=t}function Rf(){return yt===t?ot:Ho(Ze())}function Vg(){var ru=Ze(),Mv=ms(ru);if(te=arguments,he=this,Pt=ru,Mv){if(yt===t)return gs(Pt);if(ei)return j3(yt),yt=Rx(xo,D),Rr(Pt)}return yt===t&&(yt=Rx(xo,D)),ot}return Vg.cancel=Hg,Vg.flush=Rf,Vg}var yc=no(function(T,D){return S3(T,1,D)}),Ht=no(function(T,D,$){return S3(T,p_(D)||0,$)});function kt(T){return d_(T,N)}function Kt(T,D){if(typeof T!="function"||D!=null&&typeof D!="function")throw new mp(o);var $=function(){var te=arguments,he=D?D.apply(this,te):te[0],De=$.cache;if(De.has(he))return De.get(he);var ot=T.apply(this,te);return $.cache=De.set(he,ot)||De,ot};return $.cache=new(Kt.Cache||_p),$}Kt.Cache=_p;function _i(T){if(typeof T!="function")throw new mp(o);return function(){var D=arguments;switch(D.length){case 0:return!T.call(this);case 1:return!T.call(this,D[0]);case 2:return!T.call(this,D[0],D[1]);case 3:return!T.call(this,D[0],D[1],D[2])}return!T.apply(this,D)}}function kr(T){return Xn(2,T)}var Qr=K$(function(T,D){D=D.length==1&&qs(D[0])?Ma(D[0],bd(is())):Ma(oc(D,1),bd(is()));var $=D.length;return no(function(te){for(var he=-1,De=yd(te.length,$);++he<De;)te[he]=D[he].call(this,te[he]);return Gu(T,this,te)})}),qr=no(function(T,D){var $=gp(D,Dv(qr));return d_(T,S,t,D,$)}),ps=no(function(T,D){var $=gp(D,Dv(ps));return d_(T,k,t,D,$)}),Tu=h_(function(T,D){return d_(T,L,t,t,t,D)});function na(T,D){if(typeof T!="function")throw new mp(o);return D=D===t?D:io(D),no(T,D)}function S0(T,D){if(typeof T!="function")throw new mp(o);return D=D==null?0:Oc(io(D),0),no(function($){var te=$[D],he=Nv($,0,D);return te&&dl(he,te),Gu(T,this,he)})}function eie(T,D,$){var te=!0,he=!0;if(typeof T!="function")throw new mp(o);return Cc($)&&(te="leading"in $?!!$.leading:te,he="trailing"in $?!!$.trailing:he),yr(T,D,{leading:te,maxWait:D,trailing:he})}function Rpt(T){return on(T,1)}function Ppt(T,D){return qr(PN(D),T)}function Opt(){if(!arguments.length)return[];var T=arguments[0];return qs(T)?T:[T]}function Mpt(T){return Wh(T,p)}function jpt(T,D){return D=typeof D=="function"?D:t,Wh(T,p,D)}function Fpt(T){return Wh(T,d|p)}function Bpt(T,D){return D=typeof D=="function"?D:t,Wh(T,d|p,D)}function $pt(T,D){return D==null||sT(T,D,Td(D))}function Ov(T,D){return T===D||T!==T&&D!==D}var Hpt=HN(p0),Vpt=HN(function(T,D){return T>=D}),NT=kN(function(){return arguments}())?kN:function(T){return jc(T)&&ta.call(T,"callee")&&!uN.call(T,"callee")},qs=Zt.isArray,Wpt=n0?bd(n0):U$;function Tp(T){return T!=null&&SH(T.length)&&!X1(T)}function iu(T){return jc(T)&&Tp(T)}function zpt(T){return T===!0||T===!1||jc(T)&&Yu(T)==Ie}var Mx=y3||die,Upt=vc?bd(vc):Iv;function qpt(T){return jc(T)&&T.nodeType===1&&!m5(T)}function Kpt(T){if(T==null)return!0;if(Tp(T)&&(qs(T)||typeof T=="string"||typeof T.splice=="function"||Mx(T)||uD(T)||NT(T)))return!T.length;var D=Xu(T);if(D==qe||D==en)return!T.size;if(Rv(T))return!Lv(T).length;for(var $ in T)if(ta.call(T,$))return!1;return!0}function Gpt(T,D){return wp(T,D)}function Ypt(T,D,$){$=typeof $=="function"?$:t;var te=$?$(T,D):t;return te===t?wp(T,D,t,$):!!te}function tie(T){if(!jc(T))return!1;var D=Yu(T);return D==Pe||D==ye||typeof T.message=="string"&&typeof T.name=="string"&&!m5(T)}function Qpt(T){return typeof T=="number"&&hx(T)}function X1(T){if(!Cc(T))return!1;var D=Yu(T);return D==Be||D==$e||D==Me||D==St}function KIe(T){return typeof T=="number"&&T==io(T)}function SH(T){return typeof T=="number"&&T>-1&&T%1==0&&T<=U}function Cc(T){var D=typeof T;return T!=null&&(D=="object"||D=="function")}function jc(T){return T!=null&&typeof T=="object"}var GIe=Ef?bd(Ef):q$;function Xpt(T,D){return T===D||wx(T,D,yT(D))}function Zpt(T,D,$){return $=typeof $=="function"?$:t,wx(T,D,yT(D),$)}function Jpt(T){return YIe(T)&&T!=+T}function egt(T){if(Fne(T))throw new Ds(s);return T3(T)}function tgt(T){return T===null}function ngt(T){return T==null}function YIe(T){return typeof T=="number"||jc(T)&&Yu(T)==mt}function m5(T){if(!jc(T)||Yu(T)!=ft)return!1;var D=Ng(T);if(D===null)return!0;var $=ta.call(D,"constructor")&&D.constructor;return typeof $=="function"&&$ instanceof $&&Yk.call($)==lN}var nie=kf?bd(kf):lT;function igt(T){return KIe(T)&&T>=-9007199254740991&&T<=U}var QIe=i0?bd(i0):l_;function EH(T){return typeof T=="string"||!qs(T)&&jc(T)&&Yu(T)==Ke}function $g(T){return typeof T=="symbol"||jc(T)&&Yu(T)==dt}var uD=nN?bd(nN):cT;function rgt(T){return T===t}function sgt(T){return jc(T)&&Xu(T)==at}function ogt(T){return jc(T)&&Yu(T)==Oe}var agt=HN(g0),lgt=HN(function(T,D){return T<=D});function XIe(T){if(!T)return[];if(Tp(T))return EH(T)?Tf(T):th(T);if(xv&&T[xv])return g3(T[xv]());var D=Xu(T),$=D==qe?L1:D==en?o0:dD;return $(T)}function Z1(T){if(!T)return T===0?T:0;if(T=p_(T),T===q||T===-1/0){var D=T<0?-1:1;return D*G}return T===T?T:0}function io(T){var D=Z1(T),$=D%1;return D===D?$?D-$:D:0}function ZIe(T){return T?Ev(io(T),0,z):0}function p_(T){if(typeof T=="number")return T;if($g(T))return H;if(Cc(T)){var D=typeof T.valueOf=="function"?T.valueOf():T;T=Cc(D)?D+"":D}if(typeof T!="string")return T===0?T:+T;T=rN(T);var $=di.test(T);return $||le.test(T)?sc(T.slice(2),$?2:8):ti.test(T)?H:+T}function JIe(T){return Rg(T,Ip(T))}function cgt(T){return T?Ev(io(T),-9007199254740991,U):T===0?T:0}function Fa(T){return T==null?"":zh(T)}var ugt=Ix(function(T,D){if(Rv(D)||Tp(D)){Rg(D,Td(D),T);return}for(var $ in D)ta.call(D,$)&&j1(T,$,D[$])}),eLe=Ix(function(T,D){Rg(D,Ip(D),T)}),kH=Ix(function(T,D,$,te){Rg(D,Ip(D),T,te)}),dgt=Ix(function(T,D,$,te){Rg(D,Td(D),T,te)}),hgt=h_(wN);function fgt(T,D){var $=_x(T);return D==null?$:Tl($,D)}var pgt=no(function(T,D){T=ja(T);var $=-1,te=D.length,he=te>2?D[2]:t;for(he&&ih(D[0],D[1],he)&&(te=1);++$<te;)for(var De=D[$],ot=Ip(De),yt=-1,Pt=ot.length;++yt<Pt;){var jn=ot[yt],Bn=T[jn];(Bn===t||Ov(Bn,e_[jn])&&!ta.call(T,jn))&&(T[jn]=De[jn])}return T}),ggt=no(function(T){return T.push(t,q3),Gu(tLe,t,T)});function mgt(T,D){return st(T,is(D,3),Af)}function _gt(T,D){return st(T,is(D,3),f0)}function vgt(T,D){return T==null?T:xN(T,is(D,3),Ip)}function bgt(T,D){return T==null?T:aT(T,is(D,3),Ip)}function ygt(T,D){return T&&Af(T,is(D,3))}function Cgt(T,D){return T&&f0(T,is(D,3))}function wgt(T){return T==null?[]:Cx(T,Td(T))}function xgt(T){return T==null?[]:Cx(T,Ip(T))}function iie(T,D,$){var te=T==null?t:kv(T,D);return te===t?$:te}function Sgt(T,D){return T!=null&&X3(T,D,yp)}function rie(T,D){return T!=null&&X3(T,D,B1)}var Egt=J$(function(T,D,$){D!=null&&typeof D.toString!="function"&&(D=Qk.call(D)),T[D]=$},oie(Lp)),kgt=J$(function(T,D,$){D!=null&&typeof D.toString!="function"&&(D=Qk.call(D)),ta.call(T,D)?T[D].push($):T[D]=[$]},is),Tgt=no(Cp);function Td(T){return Tp(T)?i_(T):Lv(T)}function Ip(T){return Tp(T)?i_(T,!0):I3(T)}function Igt(T,D){var $={};return D=is(D,3),Af(T,function(te,he,De){s_($,D(te,he,De),te)}),$}function Lgt(T,D){var $={};return D=is(D,3),Af(T,function(te,he,De){s_($,he,D(te,he,De))}),$}var Agt=Ix(function(T,D,$){$1(T,D,$)}),tLe=Ix(function(T,D,$,te){$1(T,D,$,te)}),Ngt=h_(function(T,D){var $={};if(T==null)return $;var te=!1;D=Ma(D,function(De){return De=u_(De,T),te||(te=De.length>1),De}),Rg(T,vT(T),$),te&&($=Wh($,d|f|p,K3));for(var he=D.length;he--;)DN($,D[he]);return $});function Dgt(T,D){return nLe(T,_i(is(D)))}var Rgt=h_(function(T,D){return T==null?{}:N3(T,D)});function nLe(T,D){if(T==null)return{};var $=Ma(vT(T),function(te){return[te]});return D=is(D),m0(T,$,function(te,he){return D(te,he[0])})}function Pgt(T,D,$){D=u_(D,T);var te=-1,he=D.length;for(he||(he=1,T=t);++te<he;){var De=T==null?t:T[jg(D[te])];De===t&&(te=he,De=$),T=X1(De)?De.call(T):De}return T}function Ogt(T,D,$){return T==null?T:V1(T,D,$)}function Mgt(T,D,$,te){return te=typeof te=="function"?te:t,T==null?T:V1(T,D,$,te)}var iLe=z3(Td),rLe=z3(Ip);function jgt(T,D,$){var te=qs(T),he=te||Mx(T)||uD(T);if(D=is(D,4),$==null){var De=T&&T.constructor;he?$=te?new De:[]:Cc(T)?$=X1(De)?_x(Ng(T)):{}:$={}}return(he?Su:Af)(T,function(ot,yt,Pt){return D($,ot,yt,Pt)}),$}function Fgt(T,D){return T==null?!0:DN(T,D)}function Bgt(T,D,$){return T==null?T:M3(T,D,PN($))}function $gt(T,D,$,te){return te=typeof te=="function"?te:t,T==null?T:M3(T,D,PN($),te)}function dD(T){return T==null?[]:I1(T,Td(T))}function Hgt(T){return T==null?[]:I1(T,Ip(T))}function Vgt(T,D,$){return $===t&&($=D,D=t),$!==t&&($=p_($),$=$===$?$:0),D!==t&&(D=p_(D),D=D===D?D:0),Ev(p_(T),D,$)}function Wgt(T,D,$){return D=Z1(D),$===t?($=D,D=0):$=Z1($),T=p_(T),k3(T,D,$)}function zgt(T,D,$){if($&&typeof $!="boolean"&&ih(T,D,$)&&(D=$=t),$===t&&(typeof D=="boolean"?($=D,D=t):typeof T=="boolean"&&($=T,T=t)),T===t&&D===t?(T=0,D=1):(T=Z1(T),D===t?(D=T,T=0):D=Z1(D)),T>D){var te=T;T=D,D=te}if($||T%1||D%1){var he=eT();return yd(T+he*(D-T+_c("1e-"+((he+"").length-1))),D)}return Sx(T,D)}var Ugt=W1(function(T,D,$){return D=D.toLowerCase(),T+($?sLe(D):D)});function sLe(T){return sie(Fa(T).toLowerCase())}function oLe(T){return T=Fa(T),T&&T.replace(ht,ax).replace(Sn,"")}function qgt(T,D,$){T=Fa(T),D=zh(D);var te=T.length;$=$===t?te:Ev(io($),0,te);var he=$;return $-=D.length,$>=0&&T.slice($,he)==D}function Kgt(T){return T=Fa(T),T&&Mi.test(T)?T.replace(Rn,lx):T}function Ggt(T){return T=Fa(T),T&>.test(T)?T.replace(Ge,"\\$&"):T}var Ygt=W1(function(T,D,$){return T+($?"-":"")+D.toLowerCase()}),Qgt=W1(function(T,D,$){return T+($?" ":"")+D.toLowerCase()}),Xgt=H3("toLowerCase");function Zgt(T,D,$){T=Fa(T),D=io(D);var te=D?A1(T):0;if(!D||te>=D)return T;var he=(D-te)/2;return mT(a0(he),$)+T+mT(D1(he),$)}function Jgt(T,D,$){T=Fa(T),D=io(D);var te=D?A1(T):0;return D&&te<D?T+mT(D-te,$):T}function emt(T,D,$){T=Fa(T),D=io(D);var te=D?A1(T):0;return D&&te<D?mT(D-te,$)+T:T}function tmt(T,D,$){return $||D==null?D=0:D&&(D=+D),O$(Fa(T).replace(pt,""),D||0)}function nmt(T,D,$){return($?ih(T,D,$):D===t)?D=1:D=io(D),H1(Fa(T),D)}function imt(){var T=arguments,D=Fa(T[0]);return T.length<3?D:D.replace(T[1],T[2])}var rmt=W1(function(T,D,$){return T+($?"_":"")+D.toLowerCase()});function smt(T,D,$){return $&&typeof $!="number"&&ih(T,D,$)&&(D=$=t),$=$===t?z:$>>>0,$?(T=Fa(T),T&&(typeof D=="string"||D!=null&&!nie(D))&&(D=zh(D),!D&&s0(T))?Nv(Tf(T),0,$):T.split(D,$)):[]}var omt=W1(function(T,D,$){return T+($?" ":"")+sie(D)});function amt(T,D,$){return T=Fa(T),$=$==null?0:Ev(io($),0,T.length),D=zh(D),T.slice($,$+D.length)==D}function lmt(T,D,$){var te=Te.templateSettings;$&&ih(T,D,$)&&(D=t),T=Fa(T),D=kH({},D,te,U3);var he=kH({},D.imports,te.imports,U3),De=Td(he),ot=I1(he,De),yt,Pt,jn=0,Bn=D.interpolate||Bt,ei="__p += '",qi=Gk((D.escape||Bt).source+"|"+Bn.source+"|"+(Bn===_n?sn:Bt).source+"|"+(D.evaluate||Bt).source+"|$","g"),Rr="//# sourceURL="+(ta.call(D,"sourceURL")?(D.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Oa+"]")+` `;T.replace(qi,function(ms,xo,Ho,Hg,Rf,Vg){return Ho||(Ho=Hg),ei+=T.slice(jn,Vg).replace(An,Kk),xo&&(yt=!0,ei+=`' + __e(`+xo+`) + '`),Rf&&(Pt=!0,ei+=`'; `+Rf+`; __p += '`),Ho&&(ei+=`' + ((__t = (`+Ho+`)) == null ? '' : __t) + '`),jn=Vg+ms.length,ms}),ei+=`'; `;var gs=ta.call(D,"variable")&&D.variable;if(!gs)ei=`with (obj) { `+ei+` } `;else if(Lt.test(gs))throw new Ds(a);ei=(Pt?ei.replace(Ve,""):ei).replace(Qt,"$1").replace(rt,"$1;"),ei="function("+(gs||"obj")+`) { `+(gs?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(yt?", __e = _.escape":"")+(Pt?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+ei+`return __p }`;var lo=lLe(function(){return ea(De,Rr+"return "+ei).apply(t,ot)});if(lo.source=ei,tie(lo))throw lo;return lo}function cmt(T){return Fa(T).toLowerCase()}function umt(T){return Fa(T).toUpperCase()}function dmt(T,D,$){if(T=Fa(T),T&&($||D===t))return rN(T);if(!T||!(D=zh(D)))return T;var te=Tf(T),he=Tf(D),De=Uk(te,he),ot=ox(te,he)+1;return Nv(te,De,ot).join("")}function hmt(T,D,$){if(T=Fa(T),T&&($||D===t))return T.slice(0,oN(T)+1);if(!T||!(D=zh(D)))return T;var te=Tf(T),he=ox(te,Tf(D))+1;return Nv(te,0,he).join("")}function fmt(T,D,$){if(T=Fa(T),T&&($||D===t))return T.replace(pt,"");if(!T||!(D=zh(D)))return T;var te=Tf(T),he=Uk(te,Tf(D));return Nv(te,he).join("")}function pmt(T,D){var $=P,te=O;if(Cc(D)){var he="separator"in D?D.separator:he;$="length"in D?io(D.length):$,te="omission"in D?zh(D.omission):te}T=Fa(T);var De=T.length;if(s0(T)){var ot=Tf(T);De=ot.length}if($>=De)return T;var yt=$-A1(te);if(yt<1)return te;var Pt=ot?Nv(ot,0,yt).join(""):T.slice(0,yt);if(he===t)return Pt+te;if(ot&&(yt+=Pt.length-yt),nie(he)){if(T.slice(yt).search(he)){var jn,Bn=Pt;for(he.global||(he=Gk(he.source,Fa(ln.exec(he))+"g")),he.lastIndex=0;jn=he.exec(Bn);)var ei=jn.index;Pt=Pt.slice(0,ei===t?yt:ei)}}else if(T.indexOf(zh(he),yt)!=yt){var qi=Pt.lastIndexOf(he);qi>-1&&(Pt=Pt.slice(0,qi))}return Pt+te}function gmt(T){return T=Fa(T),T&&li.test(T)?T.replace(Cn,I$):T}var mmt=W1(function(T,D,$){return T+($?" ":"")+D.toUpperCase()}),sie=H3("toUpperCase");function aLe(T,D,$){return T=Fa(T),D=$?t:D,D===t?p3(T)?Ane(T):Fe(T):T.match(D)||[]}var lLe=no(function(T,D){try{return Gu(T,t,D)}catch($){return tie($)?$:new Ds($)}}),_mt=h_(function(T,D){return Su(D,function($){$=jg($),s_(T,$,ri(T[$],T))}),T});function vmt(T){var D=T==null?0:T.length,$=is();return T=D?Ma(T,function(te){if(typeof te[1]!="function")throw new mp(o);return[$(te[0]),te[1]]}):[],no(function(te){for(var he=-1;++he<D;){var De=T[he];if(Gu(De[0],this,te))return Gu(De[1],this,te)}})}function bmt(T){return V$(Wh(T,d))}function oie(T){return function(){return T}}function ymt(T,D){return T==null||T!==T?D:T}var Cmt=BN(),wmt=BN(!0);function Lp(T){return T}function aie(T){return xx(typeof T=="function"?T:Wh(T,d))}function xmt(T){return IN(Wh(T,d))}function Smt(T,D){return Fl(T,Wh(D,d))}var Emt=no(function(T,D){return function($){return Cp($,T,D)}}),kmt=no(function(T,D){return function($){return Cp(T,$,D)}});function lie(T,D,$){var te=Td(D),he=Cx(D,te);$==null&&!(Cc(D)&&(he.length||!te.length))&&($=D,D=T,T=this,he=Cx(D,Td(D)));var De=!(Cc($)&&"chain"in $)||!!$.chain,ot=X1(T);return Su(he,function(yt){var Pt=D[yt];T[yt]=Pt,ot&&(T.prototype[yt]=function(){var jn=this.__chain__;if(De||jn){var Bn=T(this.__wrapped__),ei=Bn.__actions__=th(this.__actions__);return ei.push({func:Pt,args:arguments,thisArg:T}),Bn.__chain__=jn,Bn}return Pt.apply(T,dl([this.value()],arguments))})}),T}function Tmt(){return Sa._===this&&(Sa._=N$),this}function cie(){}function Imt(T){return T=io(T),no(function(D){return LN(D,T)})}var Lmt=$N(Ma),Amt=$N(Vk),Nmt=$N(ae);function cLe(T){return ar(T)?Bo(jg(T)):Ql(T)}function Dmt(T){return function(D){return T==null?t:kv(T,D)}}var Rmt=W3(),Pmt=W3(!0);function uie(){return[]}function die(){return!1}function Omt(){return{}}function Mmt(){return""}function jmt(){return!0}function Fmt(T,D){if(T=io(T),T<1||T>U)return[];var $=z,te=yd(T,z);D=is(D),T-=z;for(var he=zk(te,D);++$<T;)D($);return he}function Bmt(T){return qs(T)?Ma(T,jg):$g(T)?[T]:th(t5(Fa(T)))}function $mt(T){var D=++dx;return Fa(T)+D}var Hmt=gT(function(T,D){return T+D},0),Vmt=Qu("ceil"),Wmt=gT(function(T,D){return T/D},1),zmt=Qu("floor");function Umt(T){return T&&T.length?F1(T,Lp,p0):t}function qmt(T,D){return T&&T.length?F1(T,is(D,2),p0):t}function Kmt(T){return wo(T,Lp)}function Gmt(T,D){return wo(T,is(D,2))}function Ymt(T){return T&&T.length?F1(T,Lp,g0):t}function Qmt(T,D){return T&&T.length?F1(T,is(D,2),g0):t}var Xmt=gT(function(T,D){return T*D},1),Zmt=Qu("round"),Jmt=gT(function(T,D){return T-D},0);function e_t(T){return T&&T.length?sx(T,Lp):0}function t_t(T,D){return T&&T.length?sx(T,is(D,2)):0}return Te.after=bt,Te.ary=on,Te.assign=ugt,Te.assignIn=eLe,Te.assignInWith=kH,Te.assignWith=dgt,Te.at=hgt,Te.before=Xn,Te.bind=ri,Te.bindAll=_mt,Te.bindKey=Gn,Te.castArray=Opt,Te.chain=nD,Te.chunk=GN,Te.compact=n5,Te.concat=Ep,Te.cond=vmt,Te.conforms=bmt,Te.constant=oie,Te.countBy=bH,Te.create=fgt,Te.curry=Zi,Te.curryRight=hr,Te.debounce=yr,Te.defaults=pgt,Te.defaultsDeep=ggt,Te.defer=yc,Te.delay=Ht,Te.difference=$o,Te.differenceBy=ku,Te.differenceWith=Mc,Te.drop=Ju,Te.dropRight=Df,Te.dropRightWhile=Px,Te.dropWhile=nu,Te.fill=ST,Te.filter=sD,Te.flatMap=p5,Te.flatMapDeep=Qne,Te.flatMapDepth=wH,Te.flatten=YN,Te.flattenDeep=kT,Te.flattenDepth=Uh,Te.flip=kt,Te.flow=Cmt,Te.flowRight=wmt,Te.fromPairs=i5,Te.functions=wgt,Te.functionsIn=xgt,Te.groupBy=g5,Te.initial=QN,Te.intersection=r5,Te.intersectionBy=y0,Te.intersectionWith=XN,Te.invert=Egt,Te.invertBy=kgt,Te.invokeMap=xH,Te.iteratee=aie,Te.keyBy=Xne,Te.keys=Td,Te.keysIn=Ip,Te.map=Q1,Te.mapKeys=Igt,Te.mapValues=Lgt,Te.matches=xmt,Te.matchesProperty=Smt,Te.memoize=Kt,Te.merge=Agt,Te.mergeWith=tLe,Te.method=Emt,Te.methodOf=kmt,Te.mixin=lie,Te.negate=_i,Te.nthArg=Imt,Te.omit=Ngt,Te.omitBy=Dgt,Te.once=kr,Te.orderBy=Zne,Te.over=Lmt,Te.overArgs=Qr,Te.overEvery=Amt,Te.overSome=Nmt,Te.partial=qr,Te.partialRight=ps,Te.partition=AT,Te.pick=Rgt,Te.pickBy=nLe,Te.property=cLe,Te.propertyOf=Dmt,Te.pull=ZN,Te.pullAll=IT,Te.pullAllBy=sh,Te.pullAllWith=w0,Te.pullAt=Fg,Te.range=Rmt,Te.rangeRight=Pmt,Te.rearg=Tu,Te.reject=w,Te.remove=qh,Te.rest=na,Te.reverse=JN,Te.sampleSize=R,Te.set=Ogt,Te.setWith=Mgt,Te.shuffle=j,Te.slice=o5,Te.sortBy=be,Te.sortedUniq=c5,Te.sortedUniqBy=K1,Te.split=smt,Te.spread=S0,Te.tail=hH,Te.take=fH,Te.takeRight=u5,Te.takeRightWhile=eD,Te.takeWhile=$ne,Te.tap=Kne,Te.throttle=eie,Te.thru=Bg,Te.toArray=XIe,Te.toPairs=iLe,Te.toPairsIn=rLe,Te.toPath=Bmt,Te.toPlainObject=JIe,Te.transform=jgt,Te.unary=Rpt,Te.union=Hne,Te.unionBy=pH,Te.unionWith=gH,Te.uniq=G1,Te.uniqBy=Vne,Te.uniqWith=Ox,Te.unset=Fgt,Te.unzip=tD,Te.unzipWith=Xl,Te.update=Bgt,Te.updateWith=$gt,Te.values=dD,Te.valuesIn=Hgt,Te.without=Wne,Te.words=aLe,Te.wrap=Ppt,Te.xor=mH,Te.xorBy=zne,Te.xorWith=Une,Te.zip=_H,Te.zipObject=vH,Te.zipObjectDeep=qne,Te.zipWith=kp,Te.entries=iLe,Te.entriesIn=rLe,Te.extend=eLe,Te.extendWith=kH,lie(Te,Te),Te.add=Hmt,Te.attempt=lLe,Te.camelCase=Ugt,Te.capitalize=sLe,Te.ceil=Vmt,Te.clamp=Vgt,Te.clone=Mpt,Te.cloneDeep=Fpt,Te.cloneDeepWith=Bpt,Te.cloneWith=jpt,Te.conformsTo=$pt,Te.deburr=oLe,Te.defaultTo=ymt,Te.divide=Wmt,Te.endsWith=qgt,Te.eq=Ov,Te.escape=Kgt,Te.escapeRegExp=Ggt,Te.every=yH,Te.find=oD,Te.findIndex=b0,Te.findKey=mgt,Te.findLast=CH,Te.findLastIndex=ET,Te.findLastKey=_gt,Te.floor=zmt,Te.forEach=aD,Te.forEachRight=LT,Te.forIn=vgt,Te.forInRight=bgt,Te.forOwn=ygt,Te.forOwnRight=Cgt,Te.get=iie,Te.gt=Hpt,Te.gte=Vpt,Te.has=Sgt,Te.hasIn=rie,Te.head=U1,Te.identity=Lp,Te.includes=lD,Te.indexOf=Pv,Te.inRange=Wgt,Te.invoke=Tgt,Te.isArguments=NT,Te.isArray=qs,Te.isArrayBuffer=Wpt,Te.isArrayLike=Tp,Te.isArrayLikeObject=iu,Te.isBoolean=zpt,Te.isBuffer=Mx,Te.isDate=Upt,Te.isElement=qpt,Te.isEmpty=Kpt,Te.isEqual=Gpt,Te.isEqualWith=Ypt,Te.isError=tie,Te.isFinite=Qpt,Te.isFunction=X1,Te.isInteger=KIe,Te.isLength=SH,Te.isMap=GIe,Te.isMatch=Xpt,Te.isMatchWith=Zpt,Te.isNaN=Jpt,Te.isNative=egt,Te.isNil=ngt,Te.isNull=tgt,Te.isNumber=YIe,Te.isObject=Cc,Te.isObjectLike=jc,Te.isPlainObject=m5,Te.isRegExp=nie,Te.isSafeInteger=igt,Te.isSet=QIe,Te.isString=EH,Te.isSymbol=$g,Te.isTypedArray=uD,Te.isUndefined=rgt,Te.isWeakMap=sgt,Te.isWeakSet=ogt,Te.join=C0,Te.kebabCase=Ygt,Te.last=rh,Te.lastIndexOf=TT,Te.lowerCase=Qgt,Te.lowerFirst=Xgt,Te.lt=agt,Te.lte=lgt,Te.max=Umt,Te.maxBy=qmt,Te.mean=Kmt,Te.meanBy=Gmt,Te.min=Ymt,Te.minBy=Qmt,Te.stubArray=uie,Te.stubFalse=die,Te.stubObject=Omt,Te.stubString=Mmt,Te.stubTrue=jmt,Te.multiply=Xmt,Te.nth=s5,Te.noConflict=Tmt,Te.noop=cie,Te.now=Ze,Te.pad=Zgt,Te.padEnd=Jgt,Te.padStart=emt,Te.parseInt=tmt,Te.random=zgt,Te.reduce=Jne,Te.reduceRight=cD,Te.repeat=nmt,Te.replace=imt,Te.result=Pgt,Te.round=Zmt,Te.runInContext=Nt,Te.sample=E,Te.size=Y,Te.snakeCase=rmt,Te.some=ee,Te.sortedIndex=a5,Te.sortedIndexBy=Bne,Te.sortedIndexOf=x0,Te.sortedLastIndex=dH,Te.sortedLastIndexBy=l5,Te.sortedLastIndexOf=q1,Te.startCase=omt,Te.startsWith=amt,Te.subtract=Jmt,Te.sum=e_t,Te.sumBy=t_t,Te.template=lmt,Te.times=Fmt,Te.toFinite=Z1,Te.toInteger=io,Te.toLength=ZIe,Te.toLower=cmt,Te.toNumber=p_,Te.toSafeInteger=cgt,Te.toString=Fa,Te.toUpper=umt,Te.trim=dmt,Te.trimEnd=hmt,Te.trimStart=fmt,Te.truncate=pmt,Te.unescape=gmt,Te.uniqueId=$mt,Te.upperCase=mmt,Te.upperFirst=sie,Te.each=aD,Te.eachRight=LT,Te.first=U1,lie(Te,function(){var T={};return Af(Te,function(D,$){ta.call(Te.prototype,$)||(T[$]=D)}),T}(),{chain:!1}),Te.VERSION=i,Su(["bind","bindKey","curry","curryRight","partial","partialRight"],function(T){Te[T].placeholder=Te}),Su(["drop","take"],function(T,D){Us.prototype[T]=function($){$=$===t?1:Oc(io($),0);var te=this.__filtered__&&!D?new Us(this):this.clone();return te.__filtered__?te.__takeCount__=yd($,te.__takeCount__):te.__views__.push({size:yd($,z),type:T+(te.__dir__<0?"Right":"")}),te},Us.prototype[T+"Right"]=function($){return this.reverse()[T]($).reverse()}}),Su(["filter","map","takeWhile"],function(T,D){var $=D+1,te=$==M||$==W;Us.prototype[T]=function(he){var De=this.clone();return De.__iteratees__.push({iteratee:is(he,3),type:$}),De.__filtered__=De.__filtered__||te,De}}),Su(["head","last"],function(T,D){var $="take"+(D?"Right":"");Us.prototype[T]=function(){return this[$](1).value()[0]}}),Su(["initial","tail"],function(T,D){var $="drop"+(D?"":"Right");Us.prototype[T]=function(){return this.__filtered__?new Us(this):this[$](1)}}),Us.prototype.compact=function(){return this.filter(Lp)},Us.prototype.find=function(T){return this.filter(T).head()},Us.prototype.findLast=function(T){return this.reverse().find(T)},Us.prototype.invokeMap=no(function(T,D){return typeof T=="function"?new Us(this):this.map(function($){return Cp($,T,D)})}),Us.prototype.reject=function(T){return this.filter(_i(is(T)))},Us.prototype.slice=function(T,D){T=io(T);var $=this;return $.__filtered__&&(T>0||D<0)?new Us($):(T<0?$=$.takeRight(-T):T&&($=$.drop(T)),D!==t&&(D=io(D),$=D<0?$.dropRight(-D):$.take(D-T)),$)},Us.prototype.takeRightWhile=function(T){return this.reverse().takeWhile(T).reverse()},Us.prototype.toArray=function(){return this.take(z)},Af(Us.prototype,function(T,D){var $=/^(?:filter|find|map|reject)|While$/.test(D),te=/^(?:head|last)$/.test(D),he=Te[te?"take"+(D=="last"?"Right":""):D],De=te||/^find/.test(D);he&&(Te.prototype[D]=function(){var ot=this.__wrapped__,yt=te?[1]:arguments,Pt=ot instanceof Us,jn=yt[0],Bn=Pt||qs(ot),ei=function(xo){var Ho=he.apply(Te,dl([xo],yt));return te&&qi?Ho[0]:Ho};Bn&&$&&typeof jn=="function"&&jn.length!=1&&(Pt=Bn=!1);var qi=this.__chain__,Rr=!!this.__actions__.length,gs=De&&!qi,lo=Pt&&!Rr;if(!De&&Bn){ot=lo?ot:new Us(this);var ms=T.apply(ot,yt);return ms.__actions__.push({func:Bg,args:[ei],thisArg:t}),new Cd(ms,qi)}return gs&&lo?T.apply(this,yt):(ms=this.thru(ei),gs?te?ms.value()[0]:ms.value():ms)})}),Su(["pop","push","shift","sort","splice","unshift"],function(T){var D=Cv[T],$=/^(?:push|sort|unshift)$/.test(T)?"tap":"thru",te=/^(?:pop|shift)$/.test(T);Te.prototype[T]=function(){var he=arguments;if(te&&!this.__chain__){var De=this.value();return D.apply(qs(De)?De:[],he)}return this[$](function(ot){return D.apply(qs(ot)?ot:[],he)})}}),Af(Us.prototype,function(T,D){var $=Te[D];if($){var te=$.name+"";ta.call(gx,te)||(gx[te]=[]),gx[te].push({name:D,func:$})}}),gx[Ax(t,v).name]=[{name:"wrapper",func:t}],Us.prototype.clone=_N,Us.prototype.reverse=w3,Us.prototype.value=vx,Te.prototype.at=iD,Te.prototype.chain=Y1,Te.prototype.commit=rD,Te.prototype.next=d5,Te.prototype.plant=Gne,Te.prototype.reverse=f5,Te.prototype.toJSON=Te.prototype.valueOf=Te.prototype.value=Yne,Te.prototype.first=Te.prototype.head,xv&&(Te.prototype[xv]=h5),Te},cx=Nne();Jd?((Jd.exports=cx)._=cx,Xm._=cx):Sa._=cx}).call($vt)}(Rj,Rj.exports)),Rj.exports}var pn=Hvt();/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.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(){var e;const n=Cu(t=>t.companyUsers);return(e=n.api[n.currentIndex])==null?void 0:e.company}function Vvt(){const n=zi(),e=Nr();return()=>typeof e>"u"?!1:!pn.isEqual(n,e)}var iz={exports:{}},Wvt=iz.exports,OLe;function zvt(){return OLe||(OLe=1,function(n,e){(function(t,i){n.exports=i()})(Wvt,function(){var t=1e3,i=6e4,r=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",u="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var B=["th","st","nd","rd"],W=M%100;return"["+M+(B[(W-20)%10]||B[W]||B[0])+"]"}},y=function(M,B,W){var q=String(M);return!q||q.length>=B?M:""+Array(B+1-q.length).join(W)+M},C={s:y,z:function(M){var B=-M.utcOffset(),W=Math.abs(B),q=Math.floor(W/60),U=W%60;return(B<=0?"+":"-")+y(q,2,"0")+":"+y(U,2,"0")},m:function M(B,W){if(B.date()<W.date())return-M(W,B);var q=12*(W.year()-B.year())+(W.month()-B.month()),U=B.clone().add(q,d),G=W-U<0,H=B.clone().add(q+(G?-1:1),d);return+(-(q+(W-U)/(G?U-H:H-U))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:d,y:p,w:u,d:c,D:g,h:l,m:a,s:o,ms:s,Q:f}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},S="en",k={};k[S]=b;var I="$isDayjsObject",L=function(M){return M instanceof F||!(!M||!M[I])},N=function M(B,W,q){var U;if(!B)return S;if(typeof B=="string"){var G=B.toLowerCase();k[G]&&(U=G),W&&(k[G]=W,U=G);var H=B.split("-");if(!U&&H.length>1)return M(H[0])}else{var z=B.name;k[z]=B,U=z}return!q&&U&&(S=U),U||!q&&S},P=function(M,B){if(L(M))return M.clone();var W=typeof B=="object"?B:{};return W.date=M,W.args=arguments,new F(W)},O=C;O.l=N,O.i=L,O.w=function(M,B){return P(M,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var F=function(){function M(W){this.$L=N(W.locale,null,!0),this.parse(W),this.$x=this.$x||W.x||{},this[I]=!0}var B=M.prototype;return B.parse=function(W){this.$d=function(q){var U=q.date,G=q.utc;if(U===null)return new Date(NaN);if(O.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var H=U.match(_);if(H){var z=H[2]-1||0,Z=(H[7]||"0").substring(0,3);return G?new Date(Date.UTC(H[1],z,H[3]||1,H[4]||0,H[5]||0,H[6]||0,Z)):new Date(H[1],z,H[3]||1,H[4]||0,H[5]||0,H[6]||0,Z)}}return new Date(U)}(W),this.init()},B.init=function(){var W=this.$d;this.$y=W.getFullYear(),this.$M=W.getMonth(),this.$D=W.getDate(),this.$W=W.getDay(),this.$H=W.getHours(),this.$m=W.getMinutes(),this.$s=W.getSeconds(),this.$ms=W.getMilliseconds()},B.$utils=function(){return O},B.isValid=function(){return this.$d.toString()!==m},B.isSame=function(W,q){var U=P(W);return this.startOf(q)<=U&&U<=this.endOf(q)},B.isAfter=function(W,q){return P(W)<this.startOf(q)},B.isBefore=function(W,q){return this.endOf(q)<P(W)},B.$g=function(W,q,U){return O.u(W)?this[q]:this.set(U,W)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(W,q){var U=this,G=!!O.u(q)||q,H=O.p(W),z=function(ge,ye){var Pe=O.w(U.$u?Date.UTC(U.$y,ye,ge):new Date(U.$y,ye,ge),U);return G?Pe:Pe.endOf(c)},Z=function(ge,ye){return O.w(U.toDate()[ge].apply(U.toDate("s"),(G?[0,0,0,0]:[23,59,59,999]).slice(ye)),U)},X=this.$W,oe=this.$M,fe=this.$D,Se="set"+(this.$u?"UTC":"");switch(H){case p:return G?z(1,0):z(31,11);case d:return G?z(1,oe):z(0,oe+1);case u:var Me=this.$locale().weekStart||0,Ie=(X<Me?X+7:X)-Me;return z(G?fe-Ie:fe+(6-Ie),oe);case c:case g:return Z(Se+"Hours",0);case l:return Z(Se+"Minutes",1);case a:return Z(Se+"Seconds",2);case o:return Z(Se+"Milliseconds",3);default:return this.clone()}},B.endOf=function(W){return this.startOf(W,!1)},B.$set=function(W,q){var U,G=O.p(W),H="set"+(this.$u?"UTC":""),z=(U={},U[c]=H+"Date",U[g]=H+"Date",U[d]=H+"Month",U[p]=H+"FullYear",U[l]=H+"Hours",U[a]=H+"Minutes",U[o]=H+"Seconds",U[s]=H+"Milliseconds",U)[G],Z=G===c?this.$D+(q-this.$W):q;if(G===d||G===p){var X=this.clone().set(g,1);X.$d[z](Z),X.init(),this.$d=X.set(g,Math.min(this.$D,X.daysInMonth())).$d}else z&&this.$d[z](Z);return this.init(),this},B.set=function(W,q){return this.clone().$set(W,q)},B.get=function(W){return this[O.p(W)]()},B.add=function(W,q){var U,G=this;W=Number(W);var H=O.p(q),z=function(oe){var fe=P(G);return O.w(fe.date(fe.date()+Math.round(oe*W)),G)};if(H===d)return this.set(d,this.$M+W);if(H===p)return this.set(p,this.$y+W);if(H===c)return z(1);if(H===u)return z(7);var Z=(U={},U[a]=i,U[l]=r,U[o]=t,U)[H]||1,X=this.$d.getTime()+W*Z;return O.w(X,this)},B.subtract=function(W,q){return this.add(-1*W,q)},B.format=function(W){var q=this,U=this.$locale();if(!this.isValid())return U.invalidDate||m;var G=W||"YYYY-MM-DDTHH:mm:ssZ",H=O.z(this),z=this.$H,Z=this.$m,X=this.$M,oe=U.weekdays,fe=U.months,Se=U.meridiem,Me=function(ye,Pe,Be,$e){return ye&&(ye[Pe]||ye(q,G))||Be[Pe].slice(0,$e)},Ie=function(ye){return O.s(z%12||12,ye,"0")},ge=Se||function(ye,Pe,Be){var $e=ye<12?"AM":"PM";return Be?$e.toLowerCase():$e};return G.replace(v,function(ye,Pe){return Pe||function(Be){switch(Be){case"YY":return String(q.$y).slice(-2);case"YYYY":return O.s(q.$y,4,"0");case"M":return X+1;case"MM":return O.s(X+1,2,"0");case"MMM":return Me(U.monthsShort,X,fe,3);case"MMMM":return Me(fe,X);case"D":return q.$D;case"DD":return O.s(q.$D,2,"0");case"d":return String(q.$W);case"dd":return Me(U.weekdaysMin,q.$W,oe,2);case"ddd":return Me(U.weekdaysShort,q.$W,oe,3);case"dddd":return oe[q.$W];case"H":return String(z);case"HH":return O.s(z,2,"0");case"h":return Ie(1);case"hh":return Ie(2);case"a":return ge(z,Z,!0);case"A":return ge(z,Z,!1);case"m":return String(Z);case"mm":return O.s(Z,2,"0");case"s":return String(q.$s);case"ss":return O.s(q.$s,2,"0");case"SSS":return O.s(q.$ms,3,"0");case"Z":return H}return null}(ye)||H.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(W,q,U){var G,H=this,z=O.p(q),Z=P(W),X=(Z.utcOffset()-this.utcOffset())*i,oe=this-Z,fe=function(){return O.m(H,Z)};switch(z){case p:G=fe()/12;break;case d:G=fe();break;case f:G=fe()/3;break;case u:G=(oe-X)/6048e5;break;case c:G=(oe-X)/864e5;break;case l:G=oe/r;break;case a:G=oe/i;break;case o:G=oe/t;break;default:G=oe}return U?G:O.a(G)},B.daysInMonth=function(){return this.endOf(d).$D},B.$locale=function(){return k[this.$L]},B.locale=function(W,q){if(!W)return this.$L;var U=this.clone(),G=N(W,q,!0);return G&&(U.$L=G),U},B.clone=function(){return O.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},M}(),V=F.prototype;return P.prototype=V,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",d],["$y",p],["$D",g]].forEach(function(M){V[M[1]]=function(B){return this.$g(B,M[0],M[1])}}),P.extend=function(M,B){return M.$i||(M(B,F,P),M.$i=!0),P},P.locale=N,P.isDayjs=L,P.unix=function(M){return P(1e3*M)},P.en=k[S],P.Ls=k,P.p={},P})}(iz)),iz.exports}var Uvt=zvt();const Jn=Cl(Uvt);function Mr(n){"@babel/helpers - typeof";return Mr=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},Mr(n)}function Ra(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function qvt(n,e){if(Mr(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(Mr(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function TVe(n){var e=qvt(n,"string");return Mr(e)=="symbol"?e:e+""}function MLe(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,TVe(i.key),i)}}function Pa(n,e,t){return e&&MLe(n.prototype,e),t&&MLe(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Bs(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function fO(n,e){return fO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},fO(n,e)}function $m(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&&fO(n,e)}function zM(n,e){if(e&&(Mr(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bs(n)}function Tm(n){return Tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tm(n)}function wt(n,e,t){return(e=TVe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function IVe(n){if(Array.isArray(n))return n}function LVe(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function pde(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t<e;t++)i[t]=n[t];return i}function z1e(n,e){if(n){if(typeof n=="string")return pde(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?pde(n,e):void 0}}function AVe(){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 NVe(n){return IVe(n)||LVe(n)||z1e(n)||AVe()}function jLe(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 FLe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jLe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jLe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var Kvt={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)}},Gvt=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ra(this,n),this.init(e,t)}return Pa(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||Kvt,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,s){return s&&!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,FLe(FLe({},{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}(),wy=new Gvt,DE=function(){function n(){Ra(this,n),this.observers={}}return Pa(n,[{key:"on",value:function(t,i){var r=this;return t.split(" ").forEach(function(s){r.observers[s]=r.observers[s]||[],r.observers[s].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),s=1;s<i;s++)r[s-1]=arguments[s];if(this.observers[t]){var o=[].concat(this.observers[t]);o.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 v5(){var n,e,t=new Promise(function(i,r){n=i,e=r});return t.resolve=n,t.reject=e,t}function BLe(n){return n==null?"":""+n}function Yvt(n,e,t){n.forEach(function(i){e[i]&&(t[i]=e[i])})}function U1e(n,e,t){function i(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function r(){return!n||typeof n=="string"}for(var s=typeof e!="string"?[].concat(e):e.split(".");s.length>1;){if(r())return{};var o=i(s.shift());!n[o]&&t&&(n[o]=new t),Object.prototype.hasOwnProperty.call(n,o)?n=n[o]:n={}}return r()?{}:{obj:n,k:i(s.shift())}}function $Le(n,e,t){var i=U1e(n,e,Object),r=i.obj,s=i.k;r[s]=t}function Qvt(n,e,t,i){var r=U1e(n,e,Object),s=r.obj,o=r.k;s[o]=s[o]||[],s[o].push(t)}function BU(n,e){var t=U1e(n,e),i=t.obj,r=t.k;if(i)return i[r]}function Xvt(n,e,t){var i=BU(n,t);return i!==void 0?i:BU(e,t)}function DVe(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]):DVe(n[i],e[i],t):n[i]=e[i]);return n}function hD(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Zvt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Jvt(n){return typeof n=="string"?n.replace(/[&<>"'\/]/g,function(e){return Zvt[e]}):n}var aZ=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,ebt=[" ",",","?","!",";"];function tbt(n,e,t){e=e||"",t=t||"";var i=ebt.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("|"),")")),s=!r.test(n);if(!s){var o=n.indexOf(t);o>0&&!r.test(n.substring(0,o))&&(s=!0)}return s}function $U(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,s=0;s<i.length;++s){if(!r||typeof r[i[s]]=="string"&&s+1<i.length)return;if(r[i[s]]===void 0){for(var o=2,a=i.slice(s,s+o).join(t),l=r[a];l===void 0&&i.length>s+o;)o++,a=i.slice(s,s+o).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(s+o).join(t);return c?$U(l,c,t):void 0}r=r[i[s]]}return r}}function HLe(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 TH(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?HLe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):HLe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function nbt(n){var e=ibt();return function(){var i=Tm(n),r;if(e){var s=Tm(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return zM(this,r)}}function ibt(){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 rbt=function(n){$m(t,n);var e=nbt(t);function t(i){var r,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Ra(this,t),r=e.call(this),aZ&&DE.call(Bs(r)),r.data=i||{},r.options=s,r.options.keySeparator===void 0&&(r.options.keySeparator="."),r.options.ignoreJSONStructure===void 0&&(r.options.ignoreJSONStructure=!0),r}return Pa(t,[{key:"addNamespaces",value:function(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}},{key:"removeNamespaces",value:function(r){var s=this.options.ns.indexOf(r);s>-1&&this.options.ns.splice(s,1)}},{key:"getResource",value:function(r,s,o){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,s];o&&typeof o!="string"&&(u=u.concat(o)),o&&typeof o=="string"&&(u=u.concat(l?o.split(l):o)),r.indexOf(".")>-1&&(u=r.split("."));var d=BU(this.data,u);return d||!c||typeof o!="string"?d:$U(this.data&&this.data[r]&&this.data[r][s],o,l)}},{key:"addResource",value:function(r,s,o,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,s];o&&(u=u.concat(c?o.split(c):o)),r.indexOf(".")>-1&&(u=r.split("."),a=s,s=u[1]),this.addNamespaces(s),$Le(this.data,u,a),l.silent||this.emit("added",r,s,o,a)}},{key:"addResources",value:function(r,s,o){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in o)(typeof o[l]=="string"||Object.prototype.toString.apply(o[l])==="[object Array]")&&this.addResource(r,s,l,o[l],{silent:!0});a.silent||this.emit("added",r,s,o)}},{key:"addResourceBundle",value:function(r,s,o,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[r,s];r.indexOf(".")>-1&&(u=r.split("."),a=o,o=s,s=u[1]),this.addNamespaces(s);var d=BU(this.data,u)||{};a?DVe(d,o,l):d=TH(TH({},d),o),$Le(this.data,u,d),c.silent||this.emit("added",r,s,o)}},{key:"removeResourceBundle",value:function(r,s){this.hasResourceBundle(r,s)&&delete this.data[r][s],this.removeNamespaces(s),this.emit("removed",r,s)}},{key:"hasResourceBundle",value:function(r,s){return this.getResource(r,s)!==void 0}},{key:"getResourceBundle",value:function(r,s){return s||(s=this.options.defaultNS),this.options.compatibilityAPI==="v1"?TH(TH({},{}),this.getResource(r,s)):this.getResource(r,s)}},{key:"getDataByLanguage",value:function(r){return this.data[r]}},{key:"hasLanguageSomeTranslations",value:function(r){var s=this.getDataByLanguage(r),o=s&&Object.keys(s)||[];return!!o.find(function(a){return s[a]&&Object.keys(s[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),t}(DE),RVe={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,i,r,s){var o=this;return e.forEach(function(a){o.processors[a]&&(t=o.processors[a].process(t,i,r,s))}),t}};function VLe(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 Kh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?VLe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):VLe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function sbt(n){var e=obt();return function(){var i=Tm(n),r;if(e){var s=Tm(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return zM(this,r)}}function obt(){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 WLe={},zLe=function(n){$m(t,n);var e=sbt(t);function t(i){var r,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ra(this,t),r=e.call(this),aZ&&DE.call(Bs(r)),Yvt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,Bs(r)),r.options=s,r.options.keySeparator===void 0&&(r.options.keySeparator="."),r.logger=wy.create("translator"),r}return Pa(t,[{key:"changeLanguage",value:function(r){r&&(this.language=r)}},{key:"exists",value:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(r==null)return!1;var o=this.resolve(r,s);return o&&o.res!==void 0}},{key:"extractFromKey",value:function(r,s){var o=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");var a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,l=s.ns||this.options.defaultNS||[],c=o&&r.indexOf(o)>-1,u=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!tbt(r,o,a);if(c&&!u){var d=r.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:r,namespaces:l};var f=r.split(o);(o!==a||o===a&&this.options.ns.indexOf(f[0])>-1)&&(l=f.shift()),r=f.join(a)}return typeof l=="string"&&(l=[l]),{key:r,namespaces:l}}},{key:"translate",value:function(r,s,o){var a=this;if(Mr(s)!=="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),Mr(s)==="object"&&(s=Kh({},s)),s||(s={}),r==null)return"";Array.isArray(r)||(r=[String(r)]);var l=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=this.extractFromKey(r[r.length-1],s),d=u.key,f=u.namespaces,p=f[f.length-1],g=s.lng||this.language,m=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(m){var _=s.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(p).concat(_).concat(d),usedKey:d,exactUsedKey:d,usedLng:g,usedNS:p}:"".concat(p).concat(_).concat(d)}return l?{res:d,usedKey:d,exactUsedKey:d,usedLng:g,usedNS:p}:d}var v=this.resolve(r,s),b=v&&v.res,y=v&&v.usedKey||d,C=v&&v.exactUsedKey||d,S=Object.prototype.toString.apply(b),k=["[object Number]","[object Function]","[object RegExp]"],I=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,N=typeof b!="string"&&typeof b!="boolean"&&typeof b!="number";if(L&&b&&N&&k.indexOf(S)<0&&!(typeof I=="string"&&S==="[object Array]")){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,b,Kh(Kh({},s),{},{ns:f})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return l?(v.res=P,v):P}if(c){var O=S==="[object Array]",F=O?[]:{},V=O?C:y;for(var M in b)if(Object.prototype.hasOwnProperty.call(b,M)){var B="".concat(V).concat(c).concat(M);F[M]=this.translate(B,Kh(Kh({},s),{joinArrays:!1,ns:f})),F[M]===B&&(F[M]=b[M])}b=F}}else if(L&&typeof I=="string"&&S==="[object Array]")b=b.join(I),b&&(b=this.extendTranslation(b,r,s,o));else{var W=!1,q=!1,U=s.count!==void 0&&typeof s.count!="string",G=t.hasDefaultValue(s),H=U?this.pluralResolver.getSuffix(g,s.count,s):"",z=s["defaultValue".concat(H)]||s.defaultValue;!this.isValidLookup(b)&&G&&(W=!0,b=z),this.isValidLookup(b)||(q=!0,b=d);var Z=s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,X=Z&&q?void 0:b,oe=G&&z!==b&&this.options.updateMissing;if(q||W||oe){if(this.logger.log(oe?"updateKey":"missingKey",g,p,d,oe?z:b),c){var fe=this.resolve(d,Kh(Kh({},s),{},{keySeparator:!1}));fe&&fe.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 Se=[],Me=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Me&&Me[0])for(var Ie=0;Ie<Me.length;Ie++)Se.push(Me[Ie]);else this.options.saveMissingTo==="all"?Se=this.languageUtils.toResolveHierarchy(s.lng||this.language):Se.push(s.lng||this.language);var ge=function(Pe,Be,$e){var qe=G&&$e!==b?$e:X;a.options.missingKeyHandler?a.options.missingKeyHandler(Pe,p,Be,qe,oe,s):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Pe,p,Be,qe,oe,s),a.emit("missingKey",Pe,p,Be,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&U?Se.forEach(function(ye){a.pluralResolver.getSuffixes(ye,s).forEach(function(Pe){ge([ye],d+Pe,s["defaultValue".concat(Pe)]||z)})}):ge(Se,d,z))}b=this.extendTranslation(b,r,s,v,o),q&&b===d&&this.options.appendNamespaceToMissingKey&&(b="".concat(p,":").concat(d)),(q||W)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(p,":").concat(d):d,W?b:void 0):b=this.options.parseMissingKeyHandler(b))}return l?(v.res=b,v):b}},{key:"extendTranslation",value:function(r,s,o,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)r=this.i18nFormat.parse(r,Kh(Kh({},this.options.interpolation.defaultVariables),o),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(Kh(Kh({},o),{interpolation:Kh(Kh({},this.options.interpolation),o.interpolation)}));var u=typeof r=="string"&&(o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(u){var f=r.match(this.interpolator.nestingRegexp);d=f&&f.length}var p=o.replace&&typeof o.replace!="string"?o.replace:o;if(this.options.interpolation.defaultVariables&&(p=Kh(Kh({},this.options.interpolation.defaultVariables),p)),r=this.interpolator.interpolate(r,p,o.lng||this.language,o),u){var g=r.match(this.interpolator.nestingRegexp),m=g&&g.length;d<m&&(o.nest=!1)}!o.lng&&this.options.compatibilityAPI!=="v1"&&a&&a.res&&(o.lng=a.usedLng),o.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]&&!o.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(y[0]," in key: ").concat(s[0])),null):c.translate.apply(c,y.concat([s]))},o)),o.interpolation&&this.interpolator.reset()}var _=o.postProcess||this.options.postProcess,v=typeof _=="string"?[_]:_;return r!=null&&v&&v.length&&o.applyPostProcessor!==!1&&(r=RVe.handle(v,r,s,this.options&&this.options.postProcessPassResolved?Kh({i18nResolved:a},o):o,this)),r}},{key:"resolve",value:function(r){var s=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,d;return typeof r=="string"&&(r=[r]),r.forEach(function(f){if(!s.isValidLookup(a)){var p=s.extractFromKey(f,o),g=p.key;l=g;var m=p.namespaces;s.options.fallbackNS&&(m=m.concat(s.options.fallbackNS));var _=o.count!==void 0&&typeof o.count!="string",v=_&&!o.ordinal&&o.count===0&&s.pluralResolver.shouldUseIntlApi(),b=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",y=o.lngs?o.lngs:s.languageUtils.toResolveHierarchy(o.lng||s.language,o.fallbackLng);m.forEach(function(C){s.isValidLookup(a)||(d=C,!WLe["".concat(y[0],"-").concat(C)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(d)&&(WLe["".concat(y[0],"-").concat(C)]=!0,s.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(S){if(!s.isValidLookup(a)){u=S;var k=[g];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(k,g,S,C,o);else{var I;_&&(I=s.pluralResolver.getSuffix(S,o.count,o));var L="".concat(s.options.pluralSeparator,"zero");if(_&&(k.push(g+I),v&&k.push(g+L)),b){var N="".concat(g).concat(s.options.contextSeparator).concat(o.context);k.push(N),_&&(k.push(N+I),v&&k.push(N+L))}}for(var P;P=k.pop();)s.isValidLookup(a)||(c=P,a=s.getResource(S,C,P,o))}}))})}}),{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,s,o){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(r,s,o,a):this.resourceStore.getResource(r,s,o,a)}}],[{key:"hasDefaultValue",value:function(r){var s="defaultValue";for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o)&&s===o.substring(0,s.length)&&r[o]!==void 0)return!0;return!1}}]),t}(DE);function Eie(n){return n.charAt(0).toUpperCase()+n.slice(1)}var ULe=function(){function n(e){Ra(this,n),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wy.create("languageUtils")}return Pa(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(s){return s.toLowerCase()}):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),i.indexOf(r[1].toLowerCase())>-1&&(r[1]=Eie(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]=Eie(r[1].toLowerCase())),i.indexOf(r[2].toLowerCase())>-1&&(r[2]=Eie(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(s){if(!r){var o=i.formatLanguageCode(s);(!i.options.supportedLngs||i.isSupportedCode(o))&&(r=o)}}),!r&&this.options.supportedLngs&&t.forEach(function(s){if(!r){var o=i.getLanguagePartFromCode(s);if(i.isSupportedCode(o))return r=o;r=i.options.supportedLngs.find(function(a){if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&a.indexOf(o)===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,s=this.getFallbackCodes(i||this.options.fallbackLng||[],t),o=[],a=function(c){c&&(r.isSupportedCode(c)?o.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)),s.forEach(function(l){o.indexOf(l)<0&&a(r.formatLanguageCode(l))}),o}}]),n}(),abt=[{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}],lbt={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}},cbt=["v1","v2","v3"],qLe={zero:0,one:1,two:2,few:3,many:4,other:5};function ubt(){var n={};return abt.forEach(function(e){e.lngs.forEach(function(t){n[t]={numbers:e.nr,plurals:lbt[e.fc]}})}),n}var dbt=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ra(this,n),this.languageUtils=e,this.options=t,this.logger=wy.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=ubt()}return Pa(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(s){return"".concat(i).concat(s)})}},{key:"getSuffixes",value:function(t){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.getRule(t,r);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort(function(o,a){return qLe[o]-qLe[a]}).map(function(o){return"".concat(i.options.prepend).concat(o)}):s.numbers.map(function(o){return i.getSuffix(t,o,r)}):[]}},{key:"getSuffix",value:function(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.getRule(t,r);return s?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(s.select(i)):this.getSuffixRetroCompatible(s,i):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,i){var r=this,s=t.noAbs?t.plurals(i):t.plurals(Math.abs(i)),o=t.numbers[s];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var a=function(){return r.options.prepend&&o.toString()?r.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?a():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}},{key:"shouldUseIntlApi",value:function(){return!cbt.includes(this.options.compatibilityJSON)}}]),n}();function KLe(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 jv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?KLe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):KLe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function GLe(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,s=Xvt(n,e,t);return!s&&r&&typeof t=="string"&&(s=$U(n,t,i),s===void 0&&(s=$U(e,t,i))),s}var hbt=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ra(this,n),this.logger=wy.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return Pa(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:Jvt,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?hD(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?hD(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?hD(i.nestingPrefix):i.nestingPrefixEscaped||hD("$t("),this.nestingSuffix=i.nestingSuffix?hD(i.nestingSuffix):i.nestingSuffixEscaped||hD(")"),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,s){var o=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(_){return _.replace(/\$/g,"$$$$")}var f=function(v){if(v.indexOf(o.formatSeparator)<0){var b=GLe(i,u,v,o.options.keySeparator,o.options.ignoreJSONStructure);return o.alwaysFormat?o.format(b,void 0,r,jv(jv(jv({},s),i),{},{interpolationkey:v})):b}var y=v.split(o.formatSeparator),C=y.shift().trim(),S=y.join(o.formatSeparator).trim();return o.format(GLe(i,u,C,o.options.keySeparator,o.options.ignoreJSONStructure),S,r,jv(jv(jv({},s),i),{},{interpolationkey:C}))};this.resetRegExp();var p=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,g=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,m=[{regex:this.regexpUnescape,safeValue:function(v){return d(v)}},{regex:this.regexp,safeValue:function(v){return o.escapeValue?d(o.escape(v)):d(v)}}];return m.forEach(function(_){for(c=0;a=_.regex.exec(t);){var v=a[1].trim();if(l=f(v),l===void 0)if(typeof p=="function"){var b=p(t,a,s);l=typeof b=="string"?b:""}else if(s&&Object.prototype.hasOwnProperty.call(s,v))l="";else if(g){l=a[0];continue}else o.logger.warn("missed to pass in variable ".concat(v," for interpolating ").concat(t)),l="";else typeof l!="string"&&!o.useRawValueToEscape&&(l=BLe(l));var y=_.safeValue(l);if(t=t.replace(a[0],y),g?(_.regex.lastIndex+=l.length,_.regex.lastIndex-=a[0].length):_.regex.lastIndex=0,c++,c>=o.maxReplaces)break}}),t}},{key:"nest",value:function(t,i){var r=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,l;function c(p,g){var m=this.nestingOptionsSeparator;if(p.indexOf(m)<0)return p;var _=p.split(new RegExp("".concat(m,"[ ]*{"))),v="{".concat(_[1]);p=_[0],v=this.interpolate(v,l);var b=v.match(/'/g),y=v.match(/"/g);(b&&b.length%2===0&&!y||y.length%2!==0)&&(v=v.replace(/'/g,'"'));try{l=JSON.parse(v),g&&(l=jv(jv({},g),l))}catch(C){return this.logger.warn("failed parsing options string in nesting for key ".concat(p),C),"".concat(p).concat(m).concat(v)}return delete l.defaultValue,p}for(;o=this.nestingRegexp.exec(t);){var u=[];l=jv({},s),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var d=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){var f=o[1].split(this.formatSeparator).map(function(p){return p.trim()});o[1]=f.shift(),u=f,d=!0}if(a=i(c.call(this,o[1].trim(),l),l),a&&o[0]===t&&typeof a!="string")return a;typeof a!="string"&&(a=BLe(a)),a||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(t)),a=""),d&&(a=u.reduce(function(p,g){return r.format(p,g,s.lng,jv(jv({},s),{},{interpolationkey:o[1].trim()}))},a.trim())),t=t.replace(o[0],a),this.regexp.lastIndex=0}return t}}]),n}();function YLe(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 eC(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?YLe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):YLe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function fbt(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 s=r.split(";");s.forEach(function(o){if(o){var a=o.split(":"),l=NVe(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 fD(n){var e={};return function(i,r,s){var o=r+JSON.stringify(s),a=e[o];return a||(a=n(r,s),e[o]=a),a(i)}}var pbt=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ra(this,n),this.logger=wy.create("formatter"),this.options=e,this.formats={number:fD(function(t,i){var r=new Intl.NumberFormat(t,eC({},i));return function(s){return r.format(s)}}),currency:fD(function(t,i){var r=new Intl.NumberFormat(t,eC(eC({},i),{},{style:"currency"}));return function(s){return r.format(s)}}),datetime:fD(function(t,i){var r=new Intl.DateTimeFormat(t,eC({},i));return function(s){return r.format(s)}}),relativetime:fD(function(t,i){var r=new Intl.RelativeTimeFormat(t,eC({},i));return function(s){return r.format(s,i.range||"day")}}),list:fD(function(t,i){var r=new Intl.ListFormat(t,eC({},i));return function(s){return r.format(s)}})},this.init(e)}return Pa(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()]=fD(i)}},{key:"format",value:function(t,i,r){var s=this,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=i.split(this.formatSeparator),l=a.reduce(function(c,u){var d=fbt(u),f=d.formatName,p=d.formatOptions;if(s.formats[f]){var g=c;try{var m=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},_=m.locale||m.lng||o.locale||o.lng||r;g=s.formats[f](c,_,eC(eC(eC({},p),o),m))}catch(v){s.logger.warn(v)}return g}else s.logger.warn("there was no format function for ".concat(f));return c},t);return l}}]),n}();function QLe(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 XLe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?QLe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):QLe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function gbt(n){var e=mbt();return function(){var i=Tm(n),r;if(e){var s=Tm(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return zM(this,r)}}function mbt(){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 _bt(n,e){n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)}var vbt=function(n){$m(t,n);var e=gbt(t);function t(i,r,s){var o,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Ra(this,t),o=e.call(this),aZ&&DE.call(Bs(o)),o.backend=i,o.store=r,o.services=s,o.languageUtils=s.languageUtils,o.options=a,o.logger=wy.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=a.maxParallelReads||10,o.readingCalls=0,o.maxRetries=a.maxRetries>=0?a.maxRetries:5,o.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(s,a.backend,a),o}return Pa(t,[{key:"queueLoad",value:function(r,s,o,a){var l=this,c={},u={},d={},f={};return r.forEach(function(p){var g=!0;s.forEach(function(m){var _="".concat(p,"|").concat(m);!o.reload&&l.store.hasResourceBundle(p,m)?l.state[_]=2:l.state[_]<0||(l.state[_]===1?u[_]===void 0&&(u[_]=!0):(l.state[_]=1,g=!1,u[_]===void 0&&(u[_]=!0),c[_]===void 0&&(c[_]=!0),f[m]===void 0&&(f[m]=!0)))}),g||(d[p]=!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(f)}}},{key:"loaded",value:function(r,s,o){var a=r.split("|"),l=a[0],c=a[1];s&&this.emit("failedLoading",l,c,s),o&&this.store.addResourceBundle(l,c,o),this.state[r]=s?-1:2;var u={};this.queue.forEach(function(d){Qvt(d.loaded,[l],c),_bt(d,r),s&&d.errors.push(s),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(f){u[f]||(u[f]={});var p=d.loaded[f];p.length&&p.forEach(function(g){u[f][g]===void 0&&(u[f][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,s,o){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:s,fcName:o,tried:l,wait:c,callback:u});return}this.readingCalls++;var d=function(m,_){if(a.readingCalls--,a.waitingReads.length>0){var v=a.waitingReads.shift();a.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(m&&_&&l<a.maxRetries){setTimeout(function(){a.read.call(a,r,s,o,l+1,c*2,u)},c);return}u(m,_)},f=this.backend[o].bind(this.backend);if(f.length===2){try{var p=f(r,s);p&&typeof p.then=="function"?p.then(function(g){return d(null,g)}).catch(d):d(null,p)}catch(g){d(g)}return}return f(r,s,d)}},{key:"prepareLoading",value:function(r,s){var o=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 s=="string"&&(s=[s]);var c=this.queueLoad(r,s,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){o.loadOne(u)})}},{key:"load",value:function(r,s,o){this.prepareLoading(r,s,{},o)}},{key:"reload",value:function(r,s,o){this.prepareLoading(r,s,{reload:!0},o)}},{key:"loadOne",value:function(r){var s=this,o=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&&s.logger.warn("".concat(o,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&d&&s.logger.log("".concat(o,"loaded namespace ").concat(c," for language ").concat(l),d),s.loaded(r,u,d)})}},{key:"saveMissing",value:function(r,s,o,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(s)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(s,'" 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(!(o==null||o==="")){if(this.backend&&this.backend.create){var d=XLe(XLe({},c),{},{isUpdate:l}),f=this.backend.create.bind(this.backend);if(f.length<6)try{var p;f.length===5?p=f(r,s,o,a,d):p=f(r,s,o,a),p&&typeof p.then=="function"?p.then(function(g){return u(null,g)}).catch(u):u(null,p)}catch(g){u(g)}else f(r,s,o,a,u,d)}!r||!r[0]||this.store.addResource(r[0],s,o,a)}}}]),t}(DE);function ZLe(){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(Mr(e[1])==="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),Mr(e[2])==="object"||Mr(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 JLe(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 eAe(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 E0(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eAe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):eAe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function bbt(n){var e=ybt();return function(){var i=Tm(n),r;if(e){var s=Tm(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return zM(this,r)}}function ybt(){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 IH(){}function Cbt(n){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(n));e.forEach(function(t){typeof n[t]=="function"&&(n[t]=n[t].bind(n))})}var HU=function(n){$m(t,n);var e=bbt(t);function t(){var i,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;if(Ra(this,t),i=e.call(this),aZ&&DE.call(Bs(i)),i.options=JLe(r),i.services={},i.logger=wy,i.modules={external:[]},Cbt(Bs(i)),s&&!i.isInitialized&&!r.isClone){if(!i.options.initImmediate)return i.init(r,s),zM(i,Bs(i));setTimeout(function(){i.init(r,s)},0)}return i}return Pa(t,[{key:"init",value:function(){var r=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;typeof s=="function"&&(o=s,s={}),!s.defaultNS&&s.defaultNS!==!1&&s.ns&&(typeof s.ns=="string"?s.defaultNS=s.ns:s.ns.indexOf("translation")<0&&(s.defaultNS=s.ns[0]));var a=ZLe();this.options=E0(E0(E0({},a),this.options),JLe(s)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=E0(E0({},a.interpolation),this.options.interpolation)),s.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=s.keySeparator),s.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=s.nsSeparator);function l(v){return v?typeof v=="function"?new v:v:null}if(!this.options.isClone){this.modules.logger?wy.init(l(this.modules.logger),this.options):wy.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=pbt);var u=new ULe(this.options);this.store=new rbt(this.options.resources,this.options);var d=this.services;d.logger=wy,d.resourceStore=this.store,d.languageUtils=u,d.pluralResolver=new dbt(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 hbt(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new vbt(l(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(v){for(var b=arguments.length,y=new Array(b>1?b-1:0),C=1;C<b;C++)y[C-1]=arguments[C];r.emit.apply(r,[v].concat(y))}),this.modules.languageDetector&&(d.languageDetector=l(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=l(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new zLe(this.services,this.options),this.translator.on("*",function(v){for(var b=arguments.length,y=new Array(b>1?b-1:0),C=1;C<b;C++)y[C-1]=arguments[C];r.emit.apply(r,[v].concat(y))}),this.modules.external.forEach(function(v){v.init&&v.init(r)})}if(this.format=this.options.interpolation.format,o||(o=IH),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var p=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];p.forEach(function(v){r[v]=function(){var b;return(b=r.store)[v].apply(b,arguments)}});var g=["addResource","addResources","addResourceBundle","removeResourceBundle"];g.forEach(function(v){r[v]=function(){var b;return(b=r.store)[v].apply(b,arguments),r}});var m=v5(),_=function(){var b=function(C,S){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(S),o(C,S)};if(r.languages&&r.options.compatibilityAPI!=="v1"&&!r.isInitialized)return b(null,r.t.bind(r));r.changeLanguage(r.options.lng,b)};return this.options.resources||!this.options.initImmediate?_():setTimeout(_,0),m}},{key:"loadResources",value:function(r){var s=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:IH,a=o,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(p){if(p){var g=s.services.languageUtils.toResolveHierarchy(p);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(f){return u(f)})}this.options.preload&&this.options.preload.forEach(function(f){return u(f)}),this.services.backendConnector.load(c,this.options.ns,function(f){!f&&!s.resolvedLanguage&&s.language&&s.setResolvedLanguage(s.language),a(f)})}else a(null)}},{key:"reloadResources",value:function(r,s,o){var a=v5();return r||(r=this.languages),s||(s=this.options.ns),o||(o=IH),this.services.backendConnector.reload(r,s,function(l){a.resolve(),o(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"&&RVe.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 s=0;s<this.languages.length;s++){var o=this.languages[s];if(!(["cimode","dev"].indexOf(o)>-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}},{key:"changeLanguage",value:function(r,s){var o=this;this.isLanguageChangingTo=r;var a=v5();this.emit("languageChanging",r);var l=function(f){o.language=f,o.languages=o.services.languageUtils.toResolveHierarchy(f),o.resolvedLanguage=void 0,o.setResolvedLanguage(f)},c=function(f,p){p?(l(p),o.translator.changeLanguage(p),o.isLanguageChangingTo=void 0,o.emit("languageChanged",p),o.logger.log("languageChanged",p)):o.isLanguageChangingTo=void 0,a.resolve(function(){return o.t.apply(o,arguments)}),s&&s(f,function(){return o.t.apply(o,arguments)})},u=function(f){!r&&!f&&o.services.languageDetector&&(f=[]);var p=typeof f=="string"?f:o.services.languageUtils.getBestMatchFromCodes(f);p&&(o.language||l(p),o.translator.language||o.translator.changeLanguage(p),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage&&o.services.languageDetector.cacheUserLanguage(p)),o.loadResources(p,function(g){c(g,p)})};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,s,o){var a=this,l=function c(u,d){var f;if(Mr(d)!=="object"){for(var p=arguments.length,g=new Array(p>2?p-2:0),m=2;m<p;m++)g[m-2]=arguments[m];f=a.options.overloadTranslationOptionHandler([u,d].concat(g))}else f=E0({},d);f.lng=f.lng||c.lng,f.lngs=f.lngs||c.lngs,f.ns=f.ns||c.ns,f.keyPrefix=f.keyPrefix||o||c.keyPrefix;var _=a.options.keySeparator||".",v;return f.keyPrefix&&Array.isArray(u)?v=u.map(function(b){return"".concat(f.keyPrefix).concat(_).concat(b)}):v=f.keyPrefix?"".concat(f.keyPrefix).concat(_).concat(u):u,a.t(v,f)};return typeof r=="string"?l.lng=r:l.lngs=r,l.ns=s,l.keyPrefix=o,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 s=this,o=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=o.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(p,g){var m=s.services.backendConnector.state["".concat(p,"|").concat(g)];return m===-1||m===2};if(o.precheck){var d=o.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,s){var o=this,a=v5();return this.options.ns?(typeof r=="string"&&(r=[r]),r.forEach(function(l){o.options.ns.indexOf(l)<0&&o.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),s&&s(l)}),a):(s&&s(),Promise.resolve())}},{key:"loadLanguages",value:function(r,s){var o=v5();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){o.resolve(),s&&s(c)}),o):(s&&s(),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 s=["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"],o=this.services&&this.services.languageUtils||new ULe(ZLe());return s.indexOf(o.getLanguagePartFromCode(r))>-1||r.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var r=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:IH,a=E0(E0(E0({},this.options),s),{isClone:!0}),l=new t(a);(s.debug!==void 0||s.prefix!==void 0)&&(l.logger=l.logger.clone(s));var c=["store","services","language"];return c.forEach(function(u){l[u]=r[u]}),l.services=E0({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new zLe(l.services,l.options),l.translator.on("*",function(u){for(var d=arguments.length,f=new Array(d>1?d-1:0),p=1;p<d;p++)f[p-1]=arguments[p];l.emit.apply(l,[u].concat(f))}),l.init(a,o),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}(DE);wt(HU,"createInstance",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new HU(n,e)});var gf=HU.createInstance();gf.createInstance=HU.createInstance;gf.createInstance;gf.dir;gf.init;gf.loadResources;gf.reloadResources;gf.use;gf.changeLanguage;gf.getFixedT;var _L=gf.t;gf.exists;gf.setDefaultNamespace;gf.hasLoadedNamespace;gf.loadNamespaces;gf.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 Ut(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 Vr=(n=>(n.Active="active",n.Archived="archived",n.Deleted="deleted",n))(Vr||{});/** * 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 kie={[Vr.Active]:"active",[Vr.Archived]:"archived",[Vr.Deleted]:"deleted"};function PVe(n,e){return function(){return n.apply(e,arguments)}}const{toString:wbt}=Object.prototype,{getPrototypeOf:q1e}=Object,lZ=(n=>e=>{const t=wbt.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),qb=n=>(n=n.toLowerCase(),e=>lZ(e)===n),cZ=n=>e=>typeof e===n,{isArray:UM}=Array,e8=cZ("undefined");function xbt(n){return n!==null&&!e8(n)&&n.constructor!==null&&!e8(n.constructor)&&bm(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const OVe=qb("ArrayBuffer");function Sbt(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&OVe(n.buffer),e}const Ebt=cZ("string"),bm=cZ("function"),MVe=cZ("number"),uZ=n=>n!==null&&typeof n=="object",kbt=n=>n===!0||n===!1,rz=n=>{if(lZ(n)!=="object")return!1;const e=q1e(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},Tbt=qb("Date"),Ibt=qb("File"),Lbt=qb("Blob"),Abt=qb("FileList"),Nbt=n=>uZ(n)&&bm(n.pipe),Dbt=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||bm(n.append)&&((e=lZ(n))==="formdata"||e==="object"&&bm(n.toString)&&n.toString()==="[object FormData]"))},Rbt=qb("URLSearchParams"),[Pbt,Obt,Mbt,jbt]=["ReadableStream","Request","Response","Headers"].map(qb),Fbt=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function DB(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,r;if(typeof n!="object"&&(n=[n]),UM(n))for(i=0,r=n.length;i<r;i++)e.call(null,n[i],i,n);else{const s=t?Object.getOwnPropertyNames(n):Object.keys(n),o=s.length;let a;for(i=0;i<o;i++)a=s[i],e.call(null,n[a],a,n)}}function jVe(n,e){e=e.toLowerCase();const t=Object.keys(n);let i=t.length,r;for(;i-- >0;)if(r=t[i],e===r.toLowerCase())return r;return null}const j2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,FVe=n=>!e8(n)&&n!==j2;function gde(){const{caseless:n}=FVe(this)&&this||{},e={},t=(i,r)=>{const s=n&&jVe(e,r)||r;rz(e[s])&&rz(i)?e[s]=gde(e[s],i):rz(i)?e[s]=gde({},i):UM(i)?e[s]=i.slice():e[s]=i};for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&DB(arguments[i],t);return e}const Bbt=(n,e,t,{allOwnKeys:i}={})=>(DB(e,(r,s)=>{t&&bm(r)?n[s]=PVe(r,t):n[s]=r},{allOwnKeys:i}),n),$bt=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Hbt=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},Vbt=(n,e,t,i)=>{let r,s,o;const a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),s=r.length;s-- >0;)o=r[s],(!i||i(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&q1e(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},Wbt=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},zbt=n=>{if(!n)return null;if(UM(n))return n;let e=n.length;if(!MVe(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},Ubt=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&q1e(Uint8Array)),qbt=(n,e)=>{const i=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=i.next())&&!r.done;){const s=r.value;e.call(n,s[0],s[1])}},Kbt=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},Gbt=qb("HTMLFormElement"),Ybt=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,r){return i.toUpperCase()+r}),tAe=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),Qbt=qb("RegExp"),BVe=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};DB(t,(r,s)=>{let o;(o=e(r,s,n))!==!1&&(i[s]=o||r)}),Object.defineProperties(n,i)},Xbt=n=>{BVe(n,(e,t)=>{if(bm(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(bm(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Zbt=(n,e)=>{const t={},i=r=>{r.forEach(s=>{t[s]=!0})};return UM(n)?i(n):i(String(n).split(e)),t},Jbt=()=>{},e0t=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e;function t0t(n){return!!(n&&bm(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const n0t=n=>{const e=new Array(10),t=(i,r)=>{if(uZ(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const s=UM(i)?[]:{};return DB(i,(o,a)=>{const l=t(o,r+1);!e8(l)&&(s[a]=l)}),e[r]=void 0,s}}return i};return t(n,0)},i0t=qb("AsyncFunction"),r0t=n=>n&&(uZ(n)||bm(n))&&bm(n.then)&&bm(n.catch),$Ve=((n,e)=>n?setImmediate:e?((t,i)=>(j2.addEventListener("message",({source:r,data:s})=>{r===j2&&s===t&&i.length&&i.shift()()},!1),r=>{i.push(r),j2.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",bm(j2.postMessage)),s0t=typeof queueMicrotask<"u"?queueMicrotask.bind(j2):typeof process<"u"&&process.nextTick||$Ve,bn={isArray:UM,isArrayBuffer:OVe,isBuffer:xbt,isFormData:Dbt,isArrayBufferView:Sbt,isString:Ebt,isNumber:MVe,isBoolean:kbt,isObject:uZ,isPlainObject:rz,isReadableStream:Pbt,isRequest:Obt,isResponse:Mbt,isHeaders:jbt,isUndefined:e8,isDate:Tbt,isFile:Ibt,isBlob:Lbt,isRegExp:Qbt,isFunction:bm,isStream:Nbt,isURLSearchParams:Rbt,isTypedArray:Ubt,isFileList:Abt,forEach:DB,merge:gde,extend:Bbt,trim:Fbt,stripBOM:$bt,inherits:Hbt,toFlatObject:Vbt,kindOf:lZ,kindOfTest:qb,endsWith:Wbt,toArray:zbt,forEachEntry:qbt,matchAll:Kbt,isHTMLForm:Gbt,hasOwnProperty:tAe,hasOwnProp:tAe,reduceDescriptors:BVe,freezeMethods:Xbt,toObjectSet:Zbt,toCamelCase:Ybt,noop:Jbt,toFiniteNumber:e0t,findKey:jVe,global:j2,isContextDefined:FVe,isSpecCompliantForm:t0t,toJSONObject:n0t,isAsyncFn:i0t,isThenable:r0t,setImmediate:$Ve,asap:s0t};function eo(n,e,t,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}bn.inherits(eo,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:bn.toJSONObject(this.config),code:this.code,status:this.status}}});const HVe=eo.prototype,VVe={};["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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{VVe[n]={value:n}});Object.defineProperties(eo,VVe);Object.defineProperty(HVe,"isAxiosError",{value:!0});eo.from=(n,e,t,i,r,s)=>{const o=Object.create(HVe);return bn.toFlatObject(n,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),eo.call(o,n.message,e,t,i,r),o.cause=n,o.name=n.name,s&&Object.assign(o,s),o};const o0t=null;function mde(n){return bn.isPlainObject(n)||bn.isArray(n)}function WVe(n){return bn.endsWith(n,"[]")?n.slice(0,-2):n}function nAe(n,e,t){return n?n.concat(e).map(function(r,s){return r=WVe(r),!t&&s?"["+r+"]":r}).join(t?".":""):e}function a0t(n){return bn.isArray(n)&&!n.some(mde)}const l0t=bn.toFlatObject(bn,{},null,function(e){return/^is[A-Z]/.test(e)});function dZ(n,e,t){if(!bn.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=bn.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,_){return!bn.isUndefined(_[m])});const i=t.metaTokens,r=t.visitor||u,s=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&bn.isSpecCompliantForm(e);if(!bn.isFunction(r))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(bn.isDate(g))return g.toISOString();if(!l&&bn.isBlob(g))throw new eo("Blob is not supported. Use a Buffer instead.");return bn.isArrayBuffer(g)||bn.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function u(g,m,_){let v=g;if(g&&!_&&typeof g=="object"){if(bn.endsWith(m,"{}"))m=i?m:m.slice(0,-2),g=JSON.stringify(g);else if(bn.isArray(g)&&a0t(g)||(bn.isFileList(g)||bn.endsWith(m,"[]"))&&(v=bn.toArray(g)))return m=WVe(m),v.forEach(function(y,C){!(bn.isUndefined(y)||y===null)&&e.append(o===!0?nAe([m],C,s):o===null?m:m+"[]",c(y))}),!1}return mde(g)?!0:(e.append(nAe(_,m,s),c(g)),!1)}const d=[],f=Object.assign(l0t,{defaultVisitor:u,convertValue:c,isVisitable:mde});function p(g,m){if(!bn.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(g),bn.forEach(g,function(v,b){(!(bn.isUndefined(v)||v===null)&&r.call(e,v,bn.isString(b)?b.trim():b,m,f))===!0&&p(v,m?m.concat(b):[b])}),d.pop()}}if(!bn.isObject(n))throw new TypeError("data must be an object");return p(n),e}function iAe(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function K1e(n,e){this._pairs=[],n&&dZ(n,this,e)}const zVe=K1e.prototype;zVe.append=function(e,t){this._pairs.push([e,t])};zVe.toString=function(e){const t=e?function(i){return e.call(this,i,iAe)}:iAe;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function c0t(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function UVe(n,e,t){if(!e)return n;const i=t&&t.encode||c0t;bn.isFunction(t)&&(t={serialize:t});const r=t&&t.serialize;let s;if(r?s=r(e,t):s=bn.isURLSearchParams(e)?e.toString():new K1e(e,t).toString(i),s){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+s}return n}class rAe{constructor(){this.handlers=[]}use(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}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){bn.forEach(this.handlers,function(i){i!==null&&e(i)})}}const qVe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},u0t=typeof URLSearchParams<"u"?URLSearchParams:K1e,d0t=typeof FormData<"u"?FormData:null,h0t=typeof Blob<"u"?Blob:null,f0t={isBrowser:!0,classes:{URLSearchParams:u0t,FormData:d0t,Blob:h0t},protocols:["http","https","file","blob","url","data"]},G1e=typeof window<"u"&&typeof document<"u",_de=typeof navigator=="object"&&navigator||void 0,p0t=G1e&&(!_de||["ReactNative","NativeScript","NS"].indexOf(_de.product)<0),g0t=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",m0t=G1e&&window.location.href||"http://localhost",_0t=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:G1e,hasStandardBrowserEnv:p0t,hasStandardBrowserWebWorkerEnv:g0t,navigator:_de,origin:m0t},Symbol.toStringTag,{value:"Module"})),of={..._0t,...f0t};function v0t(n,e){return dZ(n,new of.classes.URLSearchParams,Object.assign({visitor:function(t,i,r,s){return of.isNode&&bn.isBuffer(t)?(this.append(i,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function b0t(n){return bn.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function y0t(n){const e={},t=Object.keys(n);let i;const r=t.length;let s;for(i=0;i<r;i++)s=t[i],e[s]=n[s];return e}function KVe(n){function e(t,i,r,s){let o=t[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=t.length;return o=!o&&bn.isArray(r)?r.length:o,l?(bn.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!a):((!r[o]||!bn.isObject(r[o]))&&(r[o]=[]),e(t,i,r[o],s)&&bn.isArray(r[o])&&(r[o]=y0t(r[o])),!a)}if(bn.isFormData(n)&&bn.isFunction(n.entries)){const t={};return bn.forEachEntry(n,(i,r)=>{e(b0t(i),r,t,0)}),t}return null}function C0t(n,e,t){if(bn.isString(n))try{return(e||JSON.parse)(n),bn.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(n)}const RB={transitional:qVe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const i=t.getContentType()||"",r=i.indexOf("application/json")>-1,s=bn.isObject(e);if(s&&bn.isHTMLForm(e)&&(e=new FormData(e)),bn.isFormData(e))return r?JSON.stringify(KVe(e)):e;if(bn.isArrayBuffer(e)||bn.isBuffer(e)||bn.isStream(e)||bn.isFile(e)||bn.isBlob(e)||bn.isReadableStream(e))return e;if(bn.isArrayBufferView(e))return e.buffer;if(bn.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return v0t(e,this.formSerializer).toString();if((a=bn.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return dZ(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),C0t(e)):e}],transformResponse:[function(e){const t=this.transitional||RB.transitional,i=t&&t.forcedJSONParsing,r=this.responseType==="json";if(bn.isResponse(e)||bn.isReadableStream(e))return e;if(e&&bn.isString(e)&&(i&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?eo.from(a,eo.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:of.classes.FormData,Blob:of.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};bn.forEach(["delete","get","head","post","put","patch"],n=>{RB.headers[n]={}});const w0t=bn.toObjectSet(["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"]),x0t=n=>{const e={};let t,i,r;return n&&n.split(` `).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!t||e[t]&&w0t[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},sAe=Symbol("internals");function b5(n){return n&&String(n).trim().toLowerCase()}function sz(n){return n===!1||n==null?n:bn.isArray(n)?n.map(sz):String(n)}function S0t(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(n);)e[i[1]]=i[2];return e}const E0t=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Tie(n,e,t,i,r){if(bn.isFunction(i))return i.call(this,e,t);if(r&&(e=t),!!bn.isString(e)){if(bn.isString(i))return e.indexOf(i)!==-1;if(bn.isRegExp(i))return i.test(e)}}function k0t(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function T0t(n,e){const t=bn.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+t,{value:function(r,s,o){return this[i].call(this,e,r,s,o)},configurable:!0})})}let sg=class{constructor(e){e&&this.set(e)}set(e,t,i){const r=this;function s(a,l,c){const u=b5(l);if(!u)throw new Error("header name must be a non-empty string");const d=bn.findKey(r,u);(!d||r[d]===void 0||c===!0||c===void 0&&r[d]!==!1)&&(r[d||l]=sz(a))}const o=(a,l)=>bn.forEach(a,(c,u)=>s(c,u,l));if(bn.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(bn.isString(e)&&(e=e.trim())&&!E0t(e))o(x0t(e),t);else if(bn.isHeaders(e))for(const[a,l]of e.entries())s(l,a,i);else e!=null&&s(t,e,i);return this}get(e,t){if(e=b5(e),e){const i=bn.findKey(this,e);if(i){const r=this[i];if(!t)return r;if(t===!0)return S0t(r);if(bn.isFunction(t))return t.call(this,r,i);if(bn.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=b5(e),e){const i=bn.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||Tie(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let r=!1;function s(o){if(o=b5(o),o){const a=bn.findKey(i,o);a&&(!t||Tie(i,i[a],a,t))&&(delete i[a],r=!0)}}return bn.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let i=t.length,r=!1;for(;i--;){const s=t[i];(!e||Tie(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){const t=this,i={};return bn.forEach(this,(r,s)=>{const o=bn.findKey(i,s);if(o){t[o]=sz(r),delete t[s];return}const a=e?k0t(s):String(s).trim();a!==s&&delete t[s],t[a]=sz(r),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return bn.forEach(this,(i,r)=>{i!=null&&i!==!1&&(t[r]=e&&bn.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[sAe]=this[sAe]={accessors:{}}).accessors,r=this.prototype;function s(o){const a=b5(o);i[a]||(T0t(r,o),i[a]=!0)}return bn.isArray(e)?e.forEach(s):s(e),this}};sg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);bn.reduceDescriptors(sg.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(i){this[t]=i}}});bn.freezeMethods(sg);function Iie(n,e){const t=this||RB,i=e||t,r=sg.from(i.headers);let s=i.data;return bn.forEach(n,function(a){s=a.call(t,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function GVe(n){return!!(n&&n.__CANCEL__)}function qM(n,e,t){eo.call(this,n??"canceled",eo.ERR_CANCELED,e,t),this.name="CanceledError"}bn.inherits(qM,eo,{__CANCEL__:!0});function YVe(n,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):e(new eo("Request failed with status code "+t.status,[eo.ERR_BAD_REQUEST,eo.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function I0t(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function L0t(n,e){n=n||10;const t=new Array(n),i=new Array(n);let r=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=i[s];o||(o=c),t[r]=l,i[r]=c;let d=s,f=0;for(;d!==r;)f+=t[d++],d=d%n;if(r=(r+1)%n,r===s&&(s=(s+1)%n),c-o<e)return;const p=u&&c-u;return p?Math.round(f*1e3/p):void 0}}function A0t(n,e){let t=0,i=1e3/e,r,s;const o=(c,u=Date.now())=>{t=u,r=null,s&&(clearTimeout(s),s=null),n.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-t;d>=i?o(c,u):(r=c,s||(s=setTimeout(()=>{s=null,o(r)},i-d)))},()=>r&&o(r)]}const VU=(n,e,t=3)=>{let i=0;const r=L0t(50,250);return A0t(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-i,c=r(l),u=o<=a;i=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(d)},t)},oAe=(n,e)=>{const t=n!=null;return[i=>e[0]({lengthComputable:t,total:n,loaded:i}),e[1]]},aAe=n=>(...e)=>bn.asap(()=>n(...e)),N0t=of.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,of.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(of.origin),of.navigator&&/(msie|trident)/i.test(of.navigator.userAgent)):()=>!0,D0t=of.hasStandardBrowserEnv?{write(n,e,t,i,r,s){const o=[n+"="+encodeURIComponent(e)];bn.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),bn.isString(i)&&o.push("path="+i),bn.isString(r)&&o.push("domain="+r),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function R0t(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function P0t(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function QVe(n,e,t){let i=!R0t(e);return n&&i||t==!1?P0t(n,e):e}const lAe=n=>n instanceof sg?{...n}:n;function vL(n,e){e=e||{};const t={};function i(c,u,d,f){return bn.isPlainObject(c)&&bn.isPlainObject(u)?bn.merge.call({caseless:f},c,u):bn.isPlainObject(u)?bn.merge({},u):bn.isArray(u)?u.slice():u}function r(c,u,d,f){if(bn.isUndefined(u)){if(!bn.isUndefined(c))return i(void 0,c,d,f)}else return i(c,u,d,f)}function s(c,u){if(!bn.isUndefined(u))return i(void 0,u)}function o(c,u){if(bn.isUndefined(u)){if(!bn.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,d){if(d in e)return i(c,u);if(d in n)return i(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,d)=>r(lAe(c),lAe(u),d,!0)};return bn.forEach(Object.keys(Object.assign({},n,e)),function(u){const d=l[u]||r,f=d(n[u],e[u],u);bn.isUndefined(f)&&d!==a||(t[u]=f)}),t}const XVe=n=>{const e=vL({},n);let{data:t,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=sg.from(o),e.url=UVe(QVe(e.baseURL,e.url,e.allowAbsoluteUrls),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(bn.isFormData(t)){if(of.hasStandardBrowserEnv||of.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(of.hasStandardBrowserEnv&&(i&&bn.isFunction(i)&&(i=i(e)),i||i!==!1&&N0t(e.url))){const c=r&&s&&D0t.read(s);c&&o.set(r,c)}return e},O0t=typeof XMLHttpRequest<"u",M0t=O0t&&function(n){return new Promise(function(t,i){const r=XVe(n);let s=r.data;const o=sg.from(r.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=r,u,d,f,p,g;function m(){p&&p(),g&&g(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;_.open(r.method.toUpperCase(),r.url,!0),_.timeout=r.timeout;function v(){if(!_)return;const y=sg.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:y,config:n,request:_};YVe(function(I){t(I),m()},function(I){i(I),m()},S),_=null}"onloadend"in _?_.onloadend=v:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(v)},_.onabort=function(){_&&(i(new eo("Request aborted",eo.ECONNABORTED,n,_)),_=null)},_.onerror=function(){i(new eo("Network Error",eo.ERR_NETWORK,n,_)),_=null},_.ontimeout=function(){let C=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||qVe;r.timeoutErrorMessage&&(C=r.timeoutErrorMessage),i(new eo(C,S.clarifyTimeoutError?eo.ETIMEDOUT:eo.ECONNABORTED,n,_)),_=null},s===void 0&&o.setContentType(null),"setRequestHeader"in _&&bn.forEach(o.toJSON(),function(C,S){_.setRequestHeader(S,C)}),bn.isUndefined(r.withCredentials)||(_.withCredentials=!!r.withCredentials),a&&a!=="json"&&(_.responseType=r.responseType),c&&([f,g]=VU(c,!0),_.addEventListener("progress",f)),l&&_.upload&&([d,p]=VU(l),_.upload.addEventListener("progress",d),_.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(u=y=>{_&&(i(!y||y.type?new qM(null,n,_):y),_.abort(),_=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const b=I0t(r.url);if(b&&of.protocols.indexOf(b)===-1){i(new eo("Unsupported protocol "+b+":",eo.ERR_BAD_REQUEST,n));return}_.send(s||null)})},j0t=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let i=new AbortController,r;const s=function(c){if(!r){r=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof eo?u:new qM(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,s(new eo(`timeout ${e} of ms exceeded`,eo.ETIMEDOUT))},e);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),n=null)};n.forEach(c=>c.addEventListener("abort",s));const{signal:l}=i;return l.unsubscribe=()=>bn.asap(a),l}},F0t=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let i=0,r;for(;i<t;)r=i+e,yield n.slice(i,r),i=r},B0t=async function*(n,e){for await(const t of $0t(n))yield*F0t(t,e)},$0t=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:i}=await e.read();if(t)break;yield i}}finally{await e.cancel()}},cAe=(n,e,t,i)=>{const r=B0t(n,e);let s=0,o,a=l=>{o||(o=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await r.next();if(c){a(),l.close();return}let d=u.byteLength;if(t){let f=s+=d;t(f)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},hZ=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ZVe=hZ&&typeof ReadableStream=="function",H0t=hZ&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),JVe=(n,...e)=>{try{return!!n(...e)}catch{return!1}},V0t=ZVe&&JVe(()=>{let n=!1;const e=new Request(of.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),uAe=64*1024,vde=ZVe&&JVe(()=>bn.isReadableStream(new Response("").body)),WU={stream:vde&&(n=>n.body)};hZ&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!WU[e]&&(WU[e]=bn.isFunction(n[e])?t=>t[e]():(t,i)=>{throw new eo(`Response type '${e}' is not supported`,eo.ERR_NOT_SUPPORT,i)})})})(new Response);const W0t=async n=>{if(n==null)return 0;if(bn.isBlob(n))return n.size;if(bn.isSpecCompliantForm(n))return(await new Request(of.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(bn.isArrayBufferView(n)||bn.isArrayBuffer(n))return n.byteLength;if(bn.isURLSearchParams(n)&&(n=n+""),bn.isString(n))return(await H0t(n)).byteLength},z0t=async(n,e)=>{const t=bn.toFiniteNumber(n.getContentLength());return t??W0t(e)},U0t=hZ&&(async n=>{let{url:e,method:t,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=XVe(n);c=c?(c+"").toLowerCase():"text";let p=j0t([r,s&&s.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let _;try{if(l&&V0t&&t!=="get"&&t!=="head"&&(_=await z0t(u,i))!==0){let S=new Request(e,{method:"POST",body:i,duplex:"half"}),k;if(bn.isFormData(i)&&(k=S.headers.get("content-type"))&&u.setContentType(k),S.body){const[I,L]=oAe(_,VU(aAe(l)));i=cAe(S.body,uAe,I,L)}}bn.isString(d)||(d=d?"include":"omit");const v="credentials"in Request.prototype;g=new Request(e,{...f,signal:p,method:t.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:v?d:void 0});let b=await fetch(g);const y=vde&&(c==="stream"||c==="response");if(vde&&(a||y&&m)){const S={};["status","statusText","headers"].forEach(N=>{S[N]=b[N]});const k=bn.toFiniteNumber(b.headers.get("content-length")),[I,L]=a&&oAe(k,VU(aAe(a),!0))||[];b=new Response(cAe(b.body,uAe,I,()=>{L&&L(),m&&m()}),S)}c=c||"text";let C=await WU[bn.findKey(WU,c)||"text"](b,n);return!y&&m&&m(),await new Promise((S,k)=>{YVe(S,k,{data:C,headers:sg.from(b.headers),status:b.status,statusText:b.statusText,config:n,request:g})})}catch(v){throw m&&m(),v&&v.name==="TypeError"&&/fetch/i.test(v.message)?Object.assign(new eo("Network Error",eo.ERR_NETWORK,n,g),{cause:v.cause||v}):eo.from(v,v&&v.code,n,g)}}),bde={http:o0t,xhr:M0t,fetch:U0t};bn.forEach(bde,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const dAe=n=>`- ${n}`,q0t=n=>bn.isFunction(n)||n===null||n===!1,eWe={getAdapter:n=>{n=bn.isArray(n)?n:[n];const{length:e}=n;let t,i;const r={};for(let s=0;s<e;s++){t=n[s];let o;if(i=t,!q0t(t)&&(i=bde[(o=String(t)).toLowerCase()],i===void 0))throw new eo(`Unknown adapter '${o}'`);if(i)break;r[o||"#"+s]=i}if(!i){const s=Object.entries(r).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since : `+s.map(dAe).join(` `):" "+dAe(s[0]):"as no adapter specified";throw new eo("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:bde};function Lie(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new qM(null,n)}function hAe(n){return Lie(n),n.headers=sg.from(n.headers),n.data=Iie.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),eWe.getAdapter(n.adapter||RB.adapter)(n).then(function(i){return Lie(n),i.data=Iie.call(n,n.transformResponse,i),i.headers=sg.from(i.headers),i},function(i){return GVe(i)||(Lie(n),i&&i.response&&(i.response.data=Iie.call(n,n.transformResponse,i.response),i.response.headers=sg.from(i.response.headers))),Promise.reject(i)})}const tWe="1.8.3",fZ={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{fZ[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});const fAe={};fZ.transitional=function(e,t,i){function r(s,o){return"[Axios v"+tWe+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,a)=>{if(e===!1)throw new eo(r(o," has been removed"+(t?" in "+t:"")),eo.ERR_DEPRECATED);return t&&!fAe[o]&&(fAe[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,o,a):!0}};fZ.spelling=function(e){return(t,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function K0t(n,e,t){if(typeof n!="object")throw new eo("options must be an object",eo.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let r=i.length;for(;r-- >0;){const s=i[r],o=e[s];if(o){const a=n[s],l=a===void 0||o(a,s,n);if(l!==!0)throw new eo("option "+s+" must be "+l,eo.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new eo("Unknown option "+s,eo.ERR_BAD_OPTION)}}const oz={assertOptions:K0t,validators:fZ},k0=oz.validators;let Z2=class{constructor(e){this.defaults=e,this.interceptors={request:new rAe,response:new rAe}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=` `+s):i.stack=s}catch{}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=vL(this.defaults,t);const{transitional:i,paramsSerializer:r,headers:s}=t;i!==void 0&&oz.assertOptions(i,{silentJSONParsing:k0.transitional(k0.boolean),forcedJSONParsing:k0.transitional(k0.boolean),clarifyTimeoutError:k0.transitional(k0.boolean)},!1),r!=null&&(bn.isFunction(r)?t.paramsSerializer={serialize:r}:oz.assertOptions(r,{encode:k0.function,serialize:k0.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),oz.assertOptions(t,{baseUrl:k0.spelling("baseURL"),withXsrfToken:k0.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&bn.merge(s.common,s[t.method]);s&&bn.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),t.headers=sg.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!l){const g=[hAe.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),f=g.length,u=Promise.resolve(t);d<f;)u=u.then(g[d++],g[d++]);return u}f=a.length;let p=t;for(d=0;d<f;){const g=a[d++],m=a[d++];try{p=g(p)}catch(_){m.call(this,_);break}}try{u=hAe.call(this,p)}catch(g){return Promise.reject(g)}for(d=0,f=c.length;d<f;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=vL(this.defaults,e);const t=QVe(e.baseURL,e.url,e.allowAbsoluteUrls);return UVe(t,e.params,e.paramsSerializer)}};bn.forEach(["delete","get","head","options"],function(e){Z2.prototype[e]=function(t,i){return this.request(vL(i||{},{method:e,url:t,data:(i||{}).data}))}});bn.forEach(["post","put","patch"],function(e){function t(i){return function(s,o,a){return this.request(vL(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Z2.prototype[e]=t(),Z2.prototype[e+"Form"]=t(!0)});let G0t=class nWe{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const i=this;this.promise.then(r=>{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(a=>{i.subscribe(a),s=a}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},e(function(s,o,a){i.reason||(i.reason=new qM(s,o,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=i=>{e.abort(i)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new nWe(function(r){e=r}),cancel:e}}};function Y0t(n){return function(t){return n.apply(null,t)}}function Q0t(n){return bn.isObject(n)&&n.isAxiosError===!0}const yde={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(yde).forEach(([n,e])=>{yde[e]=n});function iWe(n){const e=new Z2(n),t=PVe(Z2.prototype.request,e);return bn.extend(t,Z2.prototype,e,{allOwnKeys:!0}),bn.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return iWe(vL(n,r))},t}const Nc=iWe(RB);Nc.Axios=Z2;Nc.CanceledError=qM;Nc.CancelToken=G0t;Nc.isCancel=GVe;Nc.VERSION=tWe;Nc.toFormData=dZ;Nc.AxiosError=eo;Nc.Cancel=Nc.CanceledError;Nc.all=function(e){return Promise.all(e)};Nc.spread=Y0t;Nc.isAxiosError=Q0t;Nc.mergeConfig=vL;Nc.AxiosHeaders=sg;Nc.formToJSON=n=>KVe(bn.isHTMLForm(n)?new FormData(n):n);Nc.getAdapter=eWe.getAdapter;Nc.HttpStatusCode=yde;Nc.default=Nc;const{Axios:i3r,AxiosError:r3r,CanceledError:s3r,isCancel:o3r,CancelToken:a3r,VERSION:l3r,all:c3r,Cancel:u3r,isAxiosError:d3r,spread:h3r,toFormData:f3r,AxiosHeaders:p3r,HttpStatusCode:g3r,formToJSON:m3r,getAdapter:_3r,mergeConfig:v3r}=Nc,Pj={},pAe=(n,e)=>n.unstable_is?n.unstable_is(e):e===n,gAe=n=>"init"in n,Aie=n=>!!n.write,mAe=n=>"v"in n||"e"in n,LH=n=>{if("e"in n)throw n.e;if((Pj?"production":void 0)!=="production"&&!("v"in n))throw new Error("[Bug] atom state is not initialized");return n.v},zU=new WeakMap,_Ae=n=>{var e;return UU(n)&&!!((e=zU.get(n))!=null&&e[0])},X0t=n=>{const e=zU.get(n);e!=null&&e[0]&&(e[0]=!1,e[1].forEach(t=>t()))},rWe=(n,e)=>{let t=zU.get(n);if(!t){t=[!0,new Set],zU.set(n,t);const i=()=>{t[0]=!1};n.then(i,i)}t[1].add(e)},UU=n=>typeof(n==null?void 0:n.then)=="function",sWe=(n,e,t)=>{t.p.has(n)||(t.p.add(n),e.then(()=>{t.p.delete(n)},()=>{t.p.delete(n)}))},Nie=(n,e,t)=>{const i=t(n),r="v"in i,s=i.v;if(UU(e))for(const o of i.d.keys())sWe(n,e,t(o));i.v=e,delete i.e,(!r||!Object.is(s,i.v))&&(++i.n,UU(s)&&X0t(s))},vAe=(n,e,t)=>{var i;const r=new Set;for(const s of((i=t.get(n))==null?void 0:i.t)||[])t.has(s)&&r.add(s);for(const s of e.p)r.add(s);return r},Z0t=()=>{const n=new Set,e=()=>{n.forEach(t=>t())};return e.add=t=>(n.add(t),()=>{n.delete(t)}),e},Die=()=>{const n={},e=new WeakMap,t=i=>{var r,s;(r=e.get(n))==null||r.forEach(o=>o(i)),(s=e.get(i))==null||s.forEach(o=>o())};return t.add=(i,r)=>{const s=i||n,o=(e.has(s)?e:e.set(s,new Set)).get(s);return o.add(r),()=>{o==null||o.delete(r),o.size||e.delete(s)}},t},J0t=n=>(n.c||(n.c=Die()),n.m||(n.m=Die()),n.u||(n.u=Die()),n.f||(n.f=Z0t()),n),eyt=Symbol(),tyt=(n=new WeakMap,e=new WeakMap,t=new WeakMap,i=new Set,r=new Set,s=new Set,o={},a=(f,...p)=>f.read(...p),l=(f,...p)=>f.write(...p),c=(f,p)=>{var g;return(g=f.unstable_onInit)==null?void 0:g.call(f,p)},u=(f,p)=>{var g;return(g=f.onMount)==null?void 0:g.call(f,p)},...d)=>{const f=d[0]||(I=>{if((Pj?"production":void 0)!=="production"&&!I)throw new Error("Atom is undefined or null");let L=n.get(I);return L||(L={d:new Map,p:new Set,n:0},n.set(I,L),c==null||c(I,k)),L}),p=d[1]||(()=>{const I=[],L=N=>{try{N()}catch(P){I.push(P)}};do{o.f&&L(o.f);const N=new Set,P=N.add.bind(N);i.forEach(O=>{var F;return(F=e.get(O))==null?void 0:F.l.forEach(P)}),i.clear(),s.forEach(P),s.clear(),r.forEach(P),r.clear(),N.forEach(L),i.size&&g()}while(i.size||s.size||r.size);if(I.length)throw new AggregateError(I)}),g=d[2]||(()=>{const I=[],L=new WeakSet,N=new WeakSet,P=Array.from(i);for(;P.length;){const O=P[P.length-1],F=f(O);if(N.has(O)){P.pop();continue}if(L.has(O)){if(t.get(O)===F.n)I.push([O,F]);else if((Pj?"production":void 0)!=="production"&&t.has(O))throw new Error("[Bug] invalidated atom exists");N.add(O),P.pop();continue}L.add(O);for(const V of vAe(O,F,e))L.has(V)||P.push(V)}for(let O=I.length-1;O>=0;--O){const[F,V]=I[O];let M=!1;for(const B of V.d.keys())if(B!==F&&i.has(B)){M=!0;break}M&&(m(F),b(F)),t.delete(F)}}),m=d[3]||(I=>{var L;const N=f(I);if(mAe(N)&&(e.has(I)&&t.get(I)!==N.n||Array.from(N.d).every(([q,U])=>m(q).n===U)))return N;N.d.clear();let P=!0;const O=()=>{e.has(I)&&(b(I),g(),p())},F=q=>{var U;if(pAe(I,q)){const H=f(q);if(!mAe(H))if(gAe(q))Nie(q,q.init,f);else throw new Error("no atom init");return LH(H)}const G=m(q);try{return LH(G)}finally{N.d.set(q,G.n),_Ae(N.v)&&sWe(I,N.v,G),(U=e.get(q))==null||U.t.add(I),P||O()}};let V,M;const B={get signal(){return V||(V=new AbortController),V.signal},get setSelf(){return(Pj?"production":void 0)!=="production"&&!Aie(I)&&console.warn("setSelf function cannot be used with read-only atom"),!M&&Aie(I)&&(M=(...q)=>{if((Pj?"production":void 0)!=="production"&&P&&console.warn("setSelf function cannot be called in sync"),!P)try{return v(I,...q)}finally{g(),p()}}),M}},W=N.n;try{const q=a(I,F,B);return Nie(I,q,f),UU(q)&&(rWe(q,()=>V==null?void 0:V.abort()),q.then(O,O)),N}catch(q){return delete N.v,N.e=q,++N.n,N}finally{P=!1,W!==N.n&&t.get(I)===W&&(t.set(I,N.n),i.add(I),(L=o.c)==null||L.call(o,I))}}),_=d[4]||(I=>{const L=[I];for(;L.length;){const N=L.pop(),P=f(N);for(const O of vAe(N,P,e)){const F=f(O);t.set(O,F.n),L.push(O)}}}),v=d[5]||((I,...L)=>{let N=!0;const P=F=>LH(m(F)),O=(F,...V)=>{var M;const B=f(F);try{if(pAe(I,F)){if(!gAe(F))throw new Error("atom not writable");const W=B.n,q=V[0];Nie(F,q,f),b(F),W!==B.n&&(i.add(F),(M=o.c)==null||M.call(o,F),_(F));return}else return v(F,...V)}finally{N||(g(),p())}};try{return l(I,P,O,...L)}finally{N=!1}}),b=d[6]||(I=>{var L;const N=f(I),P=e.get(I);if(P&&!_Ae(N.v)){for(const[O,F]of N.d)if(!P.d.has(O)){const V=f(O);y(O).t.add(I),P.d.add(O),F!==V.n&&(i.add(O),(L=o.c)==null||L.call(o,O),_(O))}for(const O of P.d||[])if(!N.d.has(O)){P.d.delete(O);const F=C(O);F==null||F.t.delete(I)}}}),y=d[7]||(I=>{var L;const N=f(I);let P=e.get(I);if(!P){m(I);for(const O of N.d.keys())y(O).t.add(I);if(P={l:new Set,d:new Set(N.d.keys()),t:new Set},e.set(I,P),(L=o.m)==null||L.call(o,I),Aie(I)){const O=()=>{let F=!0;const V=(...M)=>{try{return v(I,...M)}finally{F||(g(),p())}};try{const M=u(I,V);M&&(P.u=()=>{F=!0;try{M()}finally{F=!1}})}finally{F=!1}};r.add(O)}}return P}),C=d[8]||(I=>{var L;const N=f(I);let P=e.get(I);if(P&&!P.l.size&&!Array.from(P.t).some(O=>{var F;return(F=e.get(O))==null?void 0:F.d.has(I)})){P.u&&s.add(P.u),P=void 0,e.delete(I),(L=o.u)==null||L.call(o,I);for(const O of N.d.keys()){const F=C(O);F==null||F.t.delete(I)}return}return P}),S=[n,e,t,i,r,s,o,a,l,c,u,f,p,g,m,_,v,b,y,C],k={get:I=>LH(m(I)),set:(I,...L)=>{try{return v(I,...L)}finally{g(),p()}},sub:(I,L)=>{const P=y(I).l;return P.add(L),p(),()=>{P.delete(L),C(I),p()}}};return Object.defineProperty(k,eyt,{value:S}),k},oWe=tyt,nyt=J0t,bAe=rWe,Y1e={};let iyt=0;function Ls(n,e){const t=`atom${++iyt}`,i={toString(){return(Y1e?"production":void 0)!=="production"&&this.debugLabel?t+":"+this.debugLabel:t}};return typeof n=="function"?i.read=n:(i.init=n,i.read=ryt,i.write=syt),e&&(i.write=e),i}function ryt(n){return n(this)}function syt(n,e,t){return e(this,typeof t=="function"?t(n(this)):t)}const oyt=()=>{let n=0;const e=nyt({}),t=new WeakMap,i=new WeakMap,r=oWe(t,i,void 0,void 0,void 0,void 0,e,void 0,(a,l,c,...u)=>n?c(a,...u):a.write(l,c,...u)),s=new Set;return e.m.add(void 0,a=>{s.add(a);const l=t.get(a);l.m=i.get(a)}),e.u.add(void 0,a=>{s.delete(a);const l=t.get(a);delete l.m}),Object.assign(r,{dev4_get_internal_weak_map:()=>t,dev4_get_mounted_atoms:()=>s,dev4_restore_atoms:a=>{const l={read:()=>null,write:(c,u)=>{++n;try{for(const[d,f]of a)"init"in d&&u(d,f)}finally{--n}}};r.set(l)}})};function ayt(){return(Y1e?"production":void 0)!=="production"?oyt():oWe()}let y5;function lyt(){return y5||(y5=ayt(),(Y1e?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=y5),globalThis.__JOTAI_DEFAULT_STORE__!==y5&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),y5}const cyt={},uyt=x.createContext(void 0);function aWe(n){return x.useContext(uyt)||lyt()}const lWe=n=>typeof(n==null?void 0:n.then)=="function",dyt=n=>{n.status="pending",n.then(e=>{n.status="fulfilled",n.value=e},e=>{n.status="rejected",n.reason=e})},hyt=we.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(dyt(n),n)}),Rie=new WeakMap,fyt=(n,e)=>{let t=Rie.get(n);return t||(t=new Promise((i,r)=>{let s=n;const o=c=>u=>{s===c&&i(u)},a=c=>u=>{s===c&&r(u)},l=()=>{try{const c=e();lWe(c)?(Rie.set(c,t),s=c,c.then(o(c),a(c)),bAe(c,l)):i(c)}catch(c){r(c)}};n.then(o(n),a(n)),bAe(n,l)}),Rie.set(n,t)),t};function ji(n,e){const t=aWe(),[[i,r,s],o]=x.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;if((r!==t||s!==n)&&(o(),a=t.get(n)),x.useEffect(()=>{const c=t.sub(n,()=>{o()});return o(),c},[t,n,void 0]),x.useDebugValue(a),lWe(a)){const c=fyt(a,()=>t.get(n));return hyt(c)}return a}function ts(n,e){const t=aWe();return x.useCallback((...r)=>{if((cyt?"production":void 0)!=="production"&&!("write"in n))throw new Error("not writable atom");return t.set(n,...r)},[t,n])}function oo(n,e){return[ji(n),ts(n)]}var Pie={exports:{}};/*! * Pusher JavaScript Library v8.4.0 * https://pusher.com/ * * Copyright 2020, Pusher * Released under the MIT licence. */var yAe;function pyt(){return yAe||(yAe=1,function(n,e){(function(i,r){n.exports=r()})(window,function(){return function(t){var i={};function r(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return t[s].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=i,r.d=function(s,o,a){r.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:a})},r.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,o){if(o&1&&(s=r(s)),o&8||o&4&&typeof s=="object"&&s&&s.__esModule)return s;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:s}),o&2&&typeof s!="string")for(var l in s)r.d(a,l,(function(c){return s[c]}).bind(null,l));return a},r.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(o,"a",o),o},r.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},r.p="",r(r.s=2)}([function(t,i,r){var s=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=_}_.prototype=v===null?Object.create(v):(b.prototype=v.prototype,new b)}}();Object.defineProperty(i,"__esModule",{value:!0});var o=256,a=function(){function m(_){_===void 0&&(_="="),this._paddingCharacter=_}return m.prototype.encodedLength=function(_){return this._paddingCharacter?(_+2)/3*4|0:(_*8+5)/6|0},m.prototype.encode=function(_){for(var v="",b=0;b<_.length-2;b+=3){var y=_[b]<<16|_[b+1]<<8|_[b+2];v+=this._encodeByte(y>>>3*6&63),v+=this._encodeByte(y>>>2*6&63),v+=this._encodeByte(y>>>1*6&63),v+=this._encodeByte(y>>>0*6&63)}var C=_.length-b;if(C>0){var y=_[b]<<16|(C===2?_[b+1]<<8:0);v+=this._encodeByte(y>>>3*6&63),v+=this._encodeByte(y>>>2*6&63),C===2?v+=this._encodeByte(y>>>1*6&63):v+=this._paddingCharacter||"",v+=this._paddingCharacter||""}return v},m.prototype.maxDecodedLength=function(_){return this._paddingCharacter?_/4*3|0:(_*6+7)/8|0},m.prototype.decodedLength=function(_){return this.maxDecodedLength(_.length-this._getPaddingLength(_))},m.prototype.decode=function(_){if(_.length===0)return new Uint8Array(0);for(var v=this._getPaddingLength(_),b=_.length-v,y=new Uint8Array(this.maxDecodedLength(b)),C=0,S=0,k=0,I=0,L=0,N=0,P=0;S<b-4;S+=4)I=this._decodeChar(_.charCodeAt(S+0)),L=this._decodeChar(_.charCodeAt(S+1)),N=this._decodeChar(_.charCodeAt(S+2)),P=this._decodeChar(_.charCodeAt(S+3)),y[C++]=I<<2|L>>>4,y[C++]=L<<4|N>>>2,y[C++]=N<<6|P,k|=I&o,k|=L&o,k|=N&o,k|=P&o;if(S<b-1&&(I=this._decodeChar(_.charCodeAt(S)),L=this._decodeChar(_.charCodeAt(S+1)),y[C++]=I<<2|L>>>4,k|=I&o,k|=L&o),S<b-2&&(N=this._decodeChar(_.charCodeAt(S+2)),y[C++]=L<<4|N>>>2,k|=N&o),S<b-3&&(P=this._decodeChar(_.charCodeAt(S+3)),y[C++]=N<<6|P,k|=P&o),k!==0)throw new Error("Base64Coder: incorrect characters for decoding");return y},m.prototype._encodeByte=function(_){var v=_;return v+=65,v+=25-_>>>8&6,v+=51-_>>>8&-75,v+=61-_>>>8&-15,v+=62-_>>>8&3,String.fromCharCode(v)},m.prototype._decodeChar=function(_){var v=o;return v+=(42-_&_-44)>>>8&-256+_-43+62,v+=(46-_&_-48)>>>8&-256+_-47+63,v+=(47-_&_-58)>>>8&-256+_-48+52,v+=(64-_&_-91)>>>8&-256+_-65+0,v+=(96-_&_-123)>>>8&-256+_-97+26,v},m.prototype._getPaddingLength=function(_){var v=0;if(this._paddingCharacter){for(var b=_.length-1;b>=0&&_[b]===this._paddingCharacter;b--)v++;if(_.length<4||v>2)throw new Error("Base64Coder: incorrect padding")}return v},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){s(_,m);function _(){return m!==null&&m.apply(this,arguments)||this}return _.prototype._encodeByte=function(v){var b=v;return b+=65,b+=25-v>>>8&6,b+=51-v>>>8&-75,b+=61-v>>>8&-13,b+=62-v>>>8&49,String.fromCharCode(b)},_.prototype._decodeChar=function(v){var b=o;return b+=(44-v&v-46)>>>8&-256+v-45+62,b+=(94-v&v-96)>>>8&-256+v-95+63,b+=(47-v&v-58)>>>8&-256+v-48+52,b+=(64-v&v-91)>>>8&-256+v-65+0,b+=(96-v&v-123)>>>8&-256+v-97+26,b},_}(a);i.URLSafeCoder=d;var f=new d;function p(m){return f.encode(m)}i.encodeURLSafe=p;function g(m){return f.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 s="utf8: invalid string",o="utf8: invalid source encoding";function a(u){for(var d=new Uint8Array(l(u)),f=0,p=0;p<u.length;p++){var g=u.charCodeAt(p);g<128?d[f++]=g:g<2048?(d[f++]=192|g>>6,d[f++]=128|g&63):g<55296?(d[f++]=224|g>>12,d[f++]=128|g>>6&63,d[f++]=128|g&63):(p++,g=(g&1023)<<10,g|=u.charCodeAt(p)&1023,g+=65536,d[f++]=240|g>>18,d[f++]=128|g>>12&63,d[f++]=128|g>>6&63,d[f++]=128|g&63)}return d}i.encode=a;function l(u){for(var d=0,f=0;f<u.length;f++){var p=u.charCodeAt(f);if(p<128)d+=1;else if(p<2048)d+=2;else if(p<55296)d+=3;else if(p<=57343){if(f>=u.length-1)throw new Error(s);f++,d+=4}else throw new Error(s)}return d}i.encodedLength=l;function c(u){for(var d=[],f=0;f<u.length;f++){var p=u[f];if(p&128){var g=void 0;if(p<224){if(f>=u.length)throw new Error(o);var m=u[++f];if((m&192)!==128)throw new Error(o);p=(p&31)<<6|m&63,g=128}else if(p<240){if(f>=u.length-1)throw new Error(o);var m=u[++f],_=u[++f];if((m&192)!==128||(_&192)!==128)throw new Error(o);p=(p&15)<<12|(m&63)<<6|_&63,g=2048}else if(p<248){if(f>=u.length-2)throw new Error(o);var m=u[++f],_=u[++f],v=u[++f];if((m&192)!==128||(_&192)!==128||(v&192)!==128)throw new Error(o);p=(p&15)<<18|(m&63)<<12|(_&63)<<6|v&63,g=65536}else throw new Error(o);if(p<g||p>=55296&&p<=57343)throw new Error(o);if(p>=65536){if(p>1114111)throw new Error(o);p-=65536,d.push(String.fromCharCode(55296|p>>10)),p=56320|p&1023}}d.push(String.fromCharCode(p))}return d.join("")}i.decode=c},function(t,i,r){t.exports=r(3).default},function(t,i,r){r.r(i);class s{constructor(Q,re){this.lastId=0,this.prefix=Q,this.name=re}create(Q){this.lastId++;var re=this.lastId,Fe=this.prefix+re,st=this.name+"["+re+"]",xn=!1,Ci=function(){xn||(Q.apply(null,arguments),xn=!0)};return this[re]=Ci,{number:re,id:Fe,name:st,callback:Ci}}remove(Q){delete this[Q.number]}}var o=new s("_pusher_script_","Pusher.ScriptReceivers"),a={VERSION:"8.4.0",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(Q){this.options=Q,this.receivers=Q.receivers||o,this.loading={}}load(Q,re,Fe){var st=this;if(st.loading[Q]&&st.loading[Q].length>0)st.loading[Q].push(Fe);else{st.loading[Q]=[Fe];var xn=Qn.createScriptRequest(st.getPath(Q,re)),Ci=st.receivers.create(function(gr){if(st.receivers.remove(Ci),st.loading[Q]){var Ts=st.loading[Q];delete st.loading[Q];for(var wo=function(Sl){Sl||xn.cleanup()},Bo=0;Bo<Ts.length;Bo++)Ts[Bo](gr,wo)}});xn.send(Ci)}}getRoot(Q){var re,Fe=Qn.getDocument().location.protocol;return Q&&Q.useTLS||Fe==="https:"?re=this.options.cdn_https:re=this.options.cdn_http,re.replace(/\/*$/,"")+"/"+this.options.version}getPath(Q,re){return this.getRoot(re)+"/"+Q+this.options.suffix+".js"}}var u=new s("_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 f={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(ae){const Q="See:",re=f.urls[ae];if(!re)return"";let Fe;return re.fullUrl?Fe=re.fullUrl:re.path&&(Fe=f.baseUrl+re.path),Fe?`${Q} ${Fe}`:""}},m;(function(ae){ae.UserAuthentication="user-authentication",ae.ChannelAuthorization="channel-authorization"})(m||(m={}));class _ extends Error{constructor(Q){super(Q),Object.setPrototypeOf(this,new.target.prototype)}}class v extends Error{constructor(Q){super(Q),Object.setPrototypeOf(this,new.target.prototype)}}class b extends Error{constructor(Q){super(Q),Object.setPrototypeOf(this,new.target.prototype)}}class y extends Error{constructor(Q){super(Q),Object.setPrototypeOf(this,new.target.prototype)}}class C extends Error{constructor(Q){super(Q),Object.setPrototypeOf(this,new.target.prototype)}}class S extends Error{constructor(Q){super(Q),Object.setPrototypeOf(this,new.target.prototype)}}class k extends Error{constructor(Q){super(Q),Object.setPrototypeOf(this,new.target.prototype)}}class I extends Error{constructor(Q){super(Q),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(Q,re){super(re),this.status=Q,Object.setPrototypeOf(this,new.target.prototype)}}var P=function(ae,Q,re,Fe,st){const xn=Qn.createXHR();xn.open("POST",re.endpoint,!0),xn.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var Ci in re.headers)xn.setRequestHeader(Ci,re.headers[Ci]);if(re.headersProvider!=null){let gr=re.headersProvider();for(var Ci in gr)xn.setRequestHeader(Ci,gr[Ci])}return xn.onreadystatechange=function(){if(xn.readyState===4)if(xn.status===200){let gr,Ts=!1;try{gr=JSON.parse(xn.responseText),Ts=!0}catch{st(new L(200,`JSON returned from ${Fe.toString()} endpoint was invalid, yet status code was 200. Data was: ${xn.responseText}`),null)}Ts&&st(null,gr)}else{let gr="";switch(Fe){case m.UserAuthentication:gr=g.buildLogSuffix("authenticationEndpoint");break;case m.ChannelAuthorization:gr=`Clients must be authorized to join private or presence channels. ${g.buildLogSuffix("authorizationEndpoint")}`;break}st(new L(xn.status,`Unable to retrieve auth string from ${Fe.toString()} endpoint - received status: ${xn.status} from ${re.endpoint}. ${gr}`),null)}},xn.send(Q),xn};function O(ae){return q(B(ae))}var F=String.fromCharCode,V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M=function(ae){var Q=ae.charCodeAt(0);return Q<128?ae:Q<2048?F(192|Q>>>6)+F(128|Q&63):F(224|Q>>>12&15)+F(128|Q>>>6&63)+F(128|Q&63)},B=function(ae){return ae.replace(/[^\x00-\x7F]/g,M)},W=function(ae){var Q=[0,2,1][ae.length%3],re=ae.charCodeAt(0)<<16|(ae.length>1?ae.charCodeAt(1):0)<<8|(ae.length>2?ae.charCodeAt(2):0),Fe=[V.charAt(re>>>18),V.charAt(re>>>12&63),Q>=2?"=":V.charAt(re>>>6&63),Q>=1?"=":V.charAt(re&63)];return Fe.join("")},q=window.btoa||function(ae){return ae.replace(/[\s\S]{1,3}/g,W)};class U{constructor(Q,re,Fe,st){this.clear=re,this.timer=Q(()=>{this.timer&&(this.timer=st(this.timer))},Fe)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var G=U;function H(ae){window.clearTimeout(ae)}function z(ae){window.clearInterval(ae)}class Z extends G{constructor(Q,re){super(setTimeout,H,Q,function(Fe){return re(),null})}}class X extends G{constructor(Q,re){super(setInterval,z,Q,function(Fe){return re(),Fe})}}var oe={now(){return Date.now?Date.now():new Date().valueOf()},defer(ae){return new Z(0,ae)},method(ae,...Q){var re=Array.prototype.slice.call(arguments,1);return function(Fe){return Fe[ae].apply(Fe,re.concat(arguments))}}},fe=oe;function Se(ae,...Q){for(var re=0;re<Q.length;re++){var Fe=Q[re];for(var st in Fe)Fe[st]&&Fe[st].constructor&&Fe[st].constructor===Object?ae[st]=Se(ae[st]||{},Fe[st]):ae[st]=Fe[st]}return ae}function Me(){for(var ae=["Pusher"],Q=0;Q<arguments.length;Q++)typeof arguments[Q]=="string"?ae.push(arguments[Q]):ae.push(dt(arguments[Q]));return ae.join(" : ")}function Ie(ae,Q){var re=Array.prototype.indexOf;if(ae===null)return-1;if(re&&ae.indexOf===re)return ae.indexOf(Q);for(var Fe=0,st=ae.length;Fe<st;Fe++)if(ae[Fe]===Q)return Fe;return-1}function ge(ae,Q){for(var re in ae)Object.prototype.hasOwnProperty.call(ae,re)&&Q(ae[re],re,ae)}function ye(ae){var Q=[];return ge(ae,function(re,Fe){Q.push(Fe)}),Q}function Pe(ae){var Q=[];return ge(ae,function(re){Q.push(re)}),Q}function Be(ae,Q,re){for(var Fe=0;Fe<ae.length;Fe++)Q.call(re||window,ae[Fe],Fe,ae)}function $e(ae,Q){for(var re=[],Fe=0;Fe<ae.length;Fe++)re.push(Q(ae[Fe],Fe,ae,re));return re}function qe(ae,Q){var re={};return ge(ae,function(Fe,st){re[st]=Q(Fe)}),re}function mt(ae,Q){Q=Q||function(st){return!!st};for(var re=[],Fe=0;Fe<ae.length;Fe++)Q(ae[Fe],Fe,ae,re)&&re.push(ae[Fe]);return re}function vt(ae,Q){var re={};return ge(ae,function(Fe,st){(Q&&Q(Fe,st,ae,re)||Fe)&&(re[st]=Fe)}),re}function ft(ae){var Q=[];return ge(ae,function(re,Fe){Q.push([Fe,re])}),Q}function tt(ae,Q){for(var re=0;re<ae.length;re++)if(Q(ae[re],re,ae))return!0;return!1}function St(ae,Q){for(var re=0;re<ae.length;re++)if(!Q(ae[re],re,ae))return!1;return!0}function Ft(ae){return qe(ae,function(Q){return typeof Q=="object"&&(Q=dt(Q)),encodeURIComponent(O(Q.toString()))})}function en(ae){var Q=vt(ae,function(Fe){return Fe!==void 0}),re=$e(ft(Ft(Q)),fe.method("join","=")).join("&");return re}function Ke(ae){var Q=[],re=[];return function Fe(st,xn){var Ci,gr,Ts;switch(typeof st){case"object":if(!st)return null;for(Ci=0;Ci<Q.length;Ci+=1)if(Q[Ci]===st)return{$ref:re[Ci]};if(Q.push(st),re.push(xn),Object.prototype.toString.apply(st)==="[object Array]")for(Ts=[],Ci=0;Ci<st.length;Ci+=1)Ts[Ci]=Fe(st[Ci],xn+"["+Ci+"]");else{Ts={};for(gr in st)Object.prototype.hasOwnProperty.call(st,gr)&&(Ts[gr]=Fe(st[gr],xn+"["+JSON.stringify(gr)+"]"))}return Ts;case"number":case"string":case"boolean":return st}}(ae,"$")}function dt(ae){try{return JSON.stringify(ae)}catch{return JSON.stringify(Ke(ae))}}class nt{constructor(){this.globalLog=Q=>{window.console&&window.console.log&&window.console.log(Q)}}debug(...Q){this.log(this.globalLog,Q)}warn(...Q){this.log(this.globalLogWarn,Q)}error(...Q){this.log(this.globalLogError,Q)}globalLogWarn(Q){window.console&&window.console.warn?window.console.warn(Q):this.globalLog(Q)}globalLogError(Q){window.console&&window.console.error?window.console.error(Q):this.globalLogWarn(Q)}log(Q,...re){var Fe=Me.apply(this,arguments);k1.log?k1.log(Fe):k1.logToConsole&&Q.bind(this)(Fe)}}var at=new nt,Oe=function(ae,Q,re,Fe,st){(re.headers!==void 0||re.headersProvider!=null)&&at.warn(`To send headers with the ${Fe.toString()} request, you must use AJAX, rather than JSONP.`);var xn=ae.nextAuthCallbackID.toString();ae.nextAuthCallbackID++;var Ci=ae.getDocument(),gr=Ci.createElement("script");ae.auth_callbacks[xn]=function(Bo){st(null,Bo)};var Ts="Pusher.auth_callbacks['"+xn+"']";gr.src=re.endpoint+"?callback="+encodeURIComponent(Ts)+"&"+Q;var wo=Ci.getElementsByTagName("head")[0]||Ci.documentElement;wo.insertBefore(gr,wo.firstChild)},ce=Oe;class Ne{constructor(Q){this.src=Q}send(Q){var re=this,Fe="Error loading "+re.src;re.script=document.createElement("script"),re.script.id=Q.id,re.script.src=re.src,re.script.type="text/javascript",re.script.charset="UTF-8",re.script.addEventListener?(re.script.onerror=function(){Q.callback(Fe)},re.script.onload=function(){Q.callback(null)}):re.script.onreadystatechange=function(){(re.script.readyState==="loaded"||re.script.readyState==="complete")&&Q.callback(null)},re.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(re.errorScript=document.createElement("script"),re.errorScript.id=Q.id+"_error",re.errorScript.text=Q.name+"('"+Fe+"');",re.script.async=re.errorScript.async=!1):re.script.async=!0;var st=document.getElementsByTagName("head")[0];st.insertBefore(re.script,st.firstChild),re.errorScript&&st.insertBefore(re.errorScript,re.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 Xe{constructor(Q,re){this.url=Q,this.data=re}send(Q){if(!this.request){var re=en(this.data),Fe=this.url+"/"+Q.number+"?"+re;this.request=Qn.createScriptRequest(Fe),this.request.send(Q)}}cleanup(){this.request&&this.request.cleanup()}}var it=function(ae,Q){return function(re,Fe){var st="http"+(Q?"s":"")+"://",xn=st+(ae.host||ae.options.host)+ae.options.path,Ci=Qn.createJSONPRequest(xn,re),gr=Qn.ScriptReceivers.create(function(Ts,wo){o.remove(gr),Ci.cleanup(),wo&&wo.host&&(ae.host=wo.host),Fe&&Fe(Ts,wo)});Ci.send(gr)}},Tt={name:"jsonp",getAgent:it},Ct=Tt;function Rt(ae,Q,re){var Fe=ae+(Q.useTLS?"s":""),st=Q.useTLS?Q.hostTLS:Q.hostNonTLS;return Fe+"://"+st+re}function se(ae,Q){var re="/app/"+ae,Fe="?protocol="+l.PROTOCOL+"&client=js&version="+l.VERSION+(Q?"&"+Q:"");return re+Fe}var ke={getInitial:function(ae,Q){var re=(Q.httpPath||"")+se(ae,"flash=false");return Rt("ws",Q,re)}},Ae={getInitial:function(ae,Q){var re=(Q.httpPath||"/pusher")+se(ae);return Rt("http",Q,re)}},je={getInitial:function(ae,Q){return Rt("http",Q,Q.httpPath||"/pusher")},getPath:function(ae,Q){return se(ae)}};class Ve{constructor(){this._callbacks={}}get(Q){return this._callbacks[Qt(Q)]}add(Q,re,Fe){var st=Qt(Q);this._callbacks[st]=this._callbacks[st]||[],this._callbacks[st].push({fn:re,context:Fe})}remove(Q,re,Fe){if(!Q&&!re&&!Fe){this._callbacks={};return}var st=Q?[Qt(Q)]:ye(this._callbacks);re||Fe?this.removeCallback(st,re,Fe):this.removeAllCallbacks(st)}removeCallback(Q,re,Fe){Be(Q,function(st){this._callbacks[st]=mt(this._callbacks[st]||[],function(xn){return re&&re!==xn.fn||Fe&&Fe!==xn.context}),this._callbacks[st].length===0&&delete this._callbacks[st]},this)}removeAllCallbacks(Q){Be(Q,function(re){delete this._callbacks[re]},this)}}function Qt(ae){return"_"+ae}class rt{constructor(Q){this.callbacks=new Ve,this.global_callbacks=[],this.failThrough=Q}bind(Q,re,Fe){return this.callbacks.add(Q,re,Fe),this}bind_global(Q){return this.global_callbacks.push(Q),this}unbind(Q,re,Fe){return this.callbacks.remove(Q,re,Fe),this}unbind_global(Q){return Q?(this.global_callbacks=mt(this.global_callbacks||[],re=>re!==Q),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(Q,re,Fe){for(var st=0;st<this.global_callbacks.length;st++)this.global_callbacks[st](Q,re);var xn=this.callbacks.get(Q),Ci=[];if(Fe?Ci.push(re,Fe):re&&Ci.push(re),xn&&xn.length>0)for(var st=0;st<xn.length;st++)xn[st].fn.apply(xn[st].context||window,Ci);else this.failThrough&&this.failThrough(Q,re);return this}}class Cn extends rt{constructor(Q,re,Fe,st,xn){super(),this.initialize=Qn.transportConnectionInitializer,this.hooks=Q,this.name=re,this.priority=Fe,this.key=st,this.options=xn,this.state="new",this.timeline=xn.timeline,this.activityTimeout=xn.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 Q=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(Q,this.options)}catch(re){return fe.defer(()=>{this.onError(re),this.changeState("closed")}),!1}return this.bindListeners(),at.debug("Connecting",{transport:this.name,url:Q}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(Q){return this.state==="open"?(fe.defer(()=>{this.socket&&this.socket.send(Q)}),!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(Q){this.emit("error",{type:"WebSocketError",error:Q}),this.timeline.error(this.buildTimelineMessage({error:Q.toString()}))}onClose(Q){Q?this.changeState("closed",{code:Q.code,reason:Q.reason,wasClean:Q.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(Q){this.emit("message",Q)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=Q=>{this.onError(Q)},this.socket.onclose=Q=>{this.onClose(Q)},this.socket.onmessage=Q=>{this.onMessage(Q)},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(Q,re){this.state=Q,this.timeline.info(this.buildTimelineMessage({state:Q,params:re})),this.emit(Q,re)}buildTimelineMessage(Q){return Se({cid:this.id},Q)}}class Rn{constructor(Q){this.hooks=Q}isSupported(Q){return this.hooks.isSupported(Q)}createConnection(Q,re,Fe,st){return new Cn(this.hooks,Q,re,Fe,st)}}var li=new Rn({urls:ke,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Qn.getWebSocketAPI()},isSupported:function(){return!!Qn.getWebSocketAPI()},getSocket:function(ae){return Qn.createWebSocket(ae)}}),Mi={urls:Ae,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},si=Se({getSocket:function(ae){return Qn.HTTPFactory.createStreamingSocket(ae)}},Mi),oi=Se({getSocket:function(ae){return Qn.HTTPFactory.createPollingSocket(ae)}},Mi),_n={isSupported:function(){return Qn.isXHRSupported()}},de=new Rn(Se({},si,_n)),_e=new Rn(Se({},oi,_n)),Le={ws:li,xhr_streaming:de,xhr_polling:_e},Ge=Le,gt=new Rn({file:"sockjs",urls:je,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(ae,Q){return new window.SockJS(ae,null,{js_path:d.getPath("sockjs",{useTLS:Q.useTLS}),ignore_null_origin:Q.ignoreNullOrigin})},beforeOpen:function(ae,Q){ae.send(JSON.stringify({path:Q}))}}),pt={isSupported:function(ae){var Q=Qn.isXDRSupported(ae.useTLS);return Q}},Vt=new Rn(Se({},si,pt)),Pn=new Rn(Se({},oi,pt));Ge.xdr_streaming=Vt,Ge.xdr_polling=Pn,Ge.sockjs=gt;var Ln=Ge;class bi extends rt{constructor(){super();var Q=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){Q.emit("online")},!1),window.addEventListener("offline",function(){Q.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var et=new bi;class Lt{constructor(Q,re,Fe){this.manager=Q,this.transport=re,this.minPingDelay=Fe.minPingDelay,this.maxPingDelay=Fe.maxPingDelay,this.pingDelay=void 0}createConnection(Q,re,Fe,st){st=Se({},st,{activityTimeout:this.pingDelay});var xn=this.transport.createConnection(Q,re,Fe,st),Ci=null,gr=function(){xn.unbind("open",gr),xn.bind("closed",Ts),Ci=fe.now()},Ts=wo=>{if(xn.unbind("closed",Ts),wo.code===1002||wo.code===1003)this.manager.reportDeath();else if(!wo.wasClean&&Ci){var Bo=fe.now()-Ci;Bo<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(Bo/2,this.minPingDelay))}};return xn.bind("open",gr),xn}isSupported(Q){return this.manager.isAlive()&&this.transport.isSupported(Q)}}const qt={decodeMessage:function(ae){try{var Q=JSON.parse(ae.data),re=Q.data;if(typeof re=="string")try{re=JSON.parse(Q.data)}catch{}var Fe={event:Q.event,channel:Q.channel,data:re};return Q.user_id&&(Fe.user_id=Q.user_id),Fe}catch(st){throw{type:"MessageParseError",error:st,data:ae.data}}},encodeMessage:function(ae){return JSON.stringify(ae)},processHandshake:function(ae){var Q=qt.decodeMessage(ae);if(Q.event==="pusher:connection_established"){if(!Q.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:Q.data.socket_id,activityTimeout:Q.data.activity_timeout*1e3}}else{if(Q.event==="pusher:error")return{action:this.getCloseAction(Q.data),error:this.getCloseError(Q.data)};throw"Invalid handshake"}},getCloseAction:function(ae){return ae.code<4e3?ae.code>=1002&&ae.code<=1004?"backoff":null:ae.code===4e3?"tls_only":ae.code<4100?"refused":ae.code<4200?"backoff":ae.code<4300?"retry":"refused"},getCloseError:function(ae){return ae.code!==1e3&&ae.code!==1001?{type:"PusherError",data:{code:ae.code,message:ae.reason||ae.message}}:null}};var sn=qt;class ln extends rt{constructor(Q,re){super(),this.id=Q,this.transport=re,this.activityTimeout=re.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(Q){return this.transport.send(Q)}send_event(Q,re,Fe){var st={event:Q,data:re};return Fe&&(st.channel=Fe),at.debug("Event sent",st),this.send(sn.encodeMessage(st))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var Q={message:Fe=>{var st;try{st=sn.decodeMessage(Fe)}catch(xn){this.emit("error",{type:"MessageParseError",error:xn,data:Fe.data})}if(st!==void 0){switch(at.debug("Event recd",st),st.event){case"pusher:error":this.emit("error",{type:"PusherError",data:st.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",st)}},activity:()=>{this.emit("activity")},error:Fe=>{this.emit("error",Fe)},closed:Fe=>{re(),Fe&&Fe.code&&this.handleCloseEvent(Fe),this.transport=null,this.emit("closed")}},re=()=>{ge(Q,(Fe,st)=>{this.transport.unbind(st,Fe)})};ge(Q,(Fe,st)=>{this.transport.bind(st,Fe)})}handleCloseEvent(Q){var re=sn.getCloseAction(Q),Fe=sn.getCloseError(Q);Fe&&this.emit("error",Fe),re&&this.emit(re,{action:re,error:Fe})}}class ti{constructor(Q,re){this.transport=Q,this.callback=re,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=Q=>{this.unbindListeners();var re;try{re=sn.processHandshake(Q)}catch(Fe){this.finish("error",{error:Fe}),this.transport.close();return}re.action==="connected"?this.finish("connected",{connection:new ln(re.id,this.transport),activityTimeout:re.activityTimeout}):(this.finish(re.action,{error:re.error}),this.transport.close())},this.onClosed=Q=>{this.unbindListeners();var re=sn.getCloseAction(Q)||"backoff",Fe=sn.getCloseError(Q);this.finish(re,{error:Fe})},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(Q,re){this.callback(Se({transport:this.transport,action:Q},re))}}class di{constructor(Q,re){this.timeline=Q,this.options=re||{}}send(Q,re){this.timeline.isEmpty()||this.timeline.send(Qn.TimelineTransport.getAgent(this,Q),re)}}class Dt extends rt{constructor(Q,re){super(function(Fe,st){at.debug("No callbacks on "+Q+" for "+Fe)}),this.name=Q,this.pusher=re,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(Q,re){return re(null,{auth:""})}trigger(Q,re){if(Q.indexOf("client-")!==0)throw new _("Event '"+Q+"' does not start with 'client-'");if(!this.subscribed){var Fe=g.buildLogSuffix("triggeringClientEvents");at.warn(`Client event triggered before channel 'subscription_succeeded' event . ${Fe}`)}return this.pusher.send_event(Q,re,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(Q){var re=Q.event,Fe=Q.data;if(re==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(Q);else if(re==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(Q);else if(re.indexOf("pusher_internal:")!==0){var st={};this.emit(re,Fe,st)}}handleSubscriptionSucceededEvent(Q){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",Q.data)}handleSubscriptionCountEvent(Q){Q.data.subscription_count&&(this.subscriptionCount=Q.data.subscription_count),this.emit("pusher:subscription_count",Q.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(Q,re)=>{Q?(this.subscriptionPending=!1,at.error(Q.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:Q.message},Q instanceof L?{status:Q.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:re.auth,channel_data:re.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 le extends Dt{authorize(Q,re){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:Q},re)}}class Qe{constructor(){this.reset()}get(Q){return Object.prototype.hasOwnProperty.call(this.members,Q)?{id:Q,info:this.members[Q]}:null}each(Q){ge(this.members,(re,Fe)=>{Q(this.get(Fe))})}setMyID(Q){this.myID=Q}onSubscription(Q){this.members=Q.presence.hash,this.count=Q.presence.count,this.me=this.get(this.myID)}addMember(Q){return this.get(Q.user_id)===null&&this.count++,this.members[Q.user_id]=Q.user_info,this.get(Q.user_id)}removeMember(Q){var re=this.get(Q.user_id);return re&&(delete this.members[Q.user_id],this.count--),re}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var ht=function(ae,Q,re,Fe){function st(xn){return xn instanceof re?xn:new re(function(Ci){Ci(xn)})}return new(re||(re=Promise))(function(xn,Ci){function gr(Bo){try{wo(Fe.next(Bo))}catch(Sl){Ci(Sl)}}function Ts(Bo){try{wo(Fe.throw(Bo))}catch(Sl){Ci(Sl)}}function wo(Bo){Bo.done?xn(Bo.value):st(Bo.value).then(gr,Ts)}wo((Fe=Fe.apply(ae,Q||[])).next())})};class Bt extends le{constructor(Q,re){super(Q,re),this.members=new Qe}authorize(Q,re){super.authorize(Q,(Fe,st)=>ht(this,void 0,void 0,function*(){if(!Fe)if(st=st,st.channel_data!=null){var xn=JSON.parse(st.channel_data);this.members.setMyID(xn.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 Ci=g.buildLogSuffix("authorizationEndpoint");at.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${Ci}, or the user should be signed in.`),re("Invalid auth response");return}re(Fe,st)}))}handleEvent(Q){var re=Q.event;if(re.indexOf("pusher_internal:")===0)this.handleInternalEvent(Q);else{var Fe=Q.data,st={};Q.user_id&&(st.user_id=Q.user_id),this.emit(re,Fe,st)}}handleInternalEvent(Q){var re=Q.event,Fe=Q.data;switch(re){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(Q);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(Q);break;case"pusher_internal:member_added":var st=this.members.addMember(Fe);this.emit("pusher:member_added",st);break;case"pusher_internal:member_removed":var xn=this.members.removeMember(Fe);xn&&this.emit("pusher:member_removed",xn);break}}handleSubscriptionSucceededEvent(Q){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(Q.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var An=r(1),mn=r(0);class hi extends le{constructor(Q,re,Fe){super(Q,re),this.key=null,this.nacl=Fe}authorize(Q,re){super.authorize(Q,(Fe,st)=>{if(Fe){re(Fe,st);return}let xn=st.shared_secret;if(!xn){re(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(mn.decode)(xn),delete st.shared_secret,re(null,st)})}trigger(Q,re){throw new S("Client events are not currently supported for encrypted channels")}handleEvent(Q){var re=Q.event,Fe=Q.data;if(re.indexOf("pusher_internal:")===0||re.indexOf("pusher:")===0){super.handleEvent(Q);return}this.handleEncryptedEvent(re,Fe)}handleEncryptedEvent(Q,re){if(!this.key){at.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!re.ciphertext||!re.nonce){at.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+re);return}let Fe=Object(mn.decode)(re.ciphertext);if(Fe.length<this.nacl.secretbox.overheadLength){at.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${Fe.length}`);return}let st=Object(mn.decode)(re.nonce);if(st.length<this.nacl.secretbox.nonceLength){at.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${st.length}`);return}let xn=this.nacl.secretbox.open(Fe,st,this.key);if(xn===null){at.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,(Ci,gr)=>{if(Ci){at.error(`Failed to make a request to the authEndpoint: ${gr}. Unable to fetch new key, so dropping encrypted event`);return}if(xn=this.nacl.secretbox.open(Fe,st,this.key),xn===null){at.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(Q,this.getDataToEmit(xn))});return}this.emit(Q,this.getDataToEmit(xn))}getDataToEmit(Q){let re=Object(An.decode)(Q);try{return JSON.parse(re)}catch{return re}}}class Di extends rt{constructor(Q,re){super(),this.state="initialized",this.connection=null,this.key=Q,this.options=re,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 Fe=Qn.getNetwork();Fe.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),Fe.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(Q){return this.connection?this.connection.send(Q):!1}send_event(Q,re,Fe){return this.connection?this.connection.send_event(Q,re,Fe):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var Q=(re,Fe)=>{re?this.runner=this.strategy.connect(0,Q):Fe.action==="error"?(this.emit("error",{type:"HandshakeError",error:Fe.error}),this.timeline.error({handshakeError:Fe.error})):(this.abortConnecting(),this.handshakeCallbacks[Fe.action](Fe))};this.runner=this.strategy.connect(0,Q)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var Q=this.abandonConnection();Q.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(Q){this.timeline.info({action:"retry",delay:Q}),Q>0&&this.emit("connecting_in",Math.round(Q/1e3)),this.retryTimer=new Z(Q||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new Z(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Z(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 Z(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(Q){return Se({},Q,{message:re=>{this.resetActivityCheck(),this.emit("message",re)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:re=>{this.emit("error",re)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(Q){return Se({},Q,{connected:re=>{this.activityTimeout=Math.min(this.options.activityTimeout,re.activityTimeout,re.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(re.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let Q=re=>Fe=>{Fe.error&&this.emit("error",{type:"WebSocketError",error:Fe.error}),re(Fe)};return{tls_only:Q(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:Q(()=>{this.disconnect()}),backoff:Q(()=>{this.retryIn(1e3)}),retry:Q(()=>{this.retryIn(0)})}}setConnection(Q){this.connection=Q;for(var re in this.connectionCallbacks)this.connection.bind(re,this.connectionCallbacks[re]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var Q in this.connectionCallbacks)this.connection.unbind(Q,this.connectionCallbacks[Q]);var re=this.connection;return this.connection=null,re}}updateState(Q,re){var Fe=this.state;if(this.state=Q,Fe!==Q){var st=Q;st==="connected"&&(st+=" with new socket ID "+re.socket_id),at.debug("State changed",Fe+" -> "+st),this.timeline.info({state:Q,params:re}),this.emit("state_change",{previous:Fe,current:Q}),this.emit(Q,re)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class cr{constructor(){this.channels={}}add(Q,re){return this.channels[Q]||(this.channels[Q]=Li(Q,re)),this.channels[Q]}all(){return Pe(this.channels)}find(Q){return this.channels[Q]}remove(Q){var re=this.channels[Q];return delete this.channels[Q],re}disconnect(){ge(this.channels,function(Q){Q.disconnect()})}}function Li(ae,Q){if(ae.indexOf("private-encrypted-")===0){if(Q.config.nacl)return rr.createEncryptedChannel(ae,Q,Q.config.nacl);let re="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",Fe=g.buildLogSuffix("encryptedChannelSupport");throw new S(`${re}. ${Fe}`)}else{if(ae.indexOf("private-")===0)return rr.createPrivateChannel(ae,Q);if(ae.indexOf("presence-")===0)return rr.createPresenceChannel(ae,Q);if(ae.indexOf("#")===0)throw new v('Cannot create a channel with name "'+ae+'".');return rr.createChannel(ae,Q)}}var Sr={createChannels(){return new cr},createConnectionManager(ae,Q){return new Di(ae,Q)},createChannel(ae,Q){return new Dt(ae,Q)},createPrivateChannel(ae,Q){return new le(ae,Q)},createPresenceChannel(ae,Q){return new Bt(ae,Q)},createEncryptedChannel(ae,Q,re){return new hi(ae,Q,re)},createTimelineSender(ae,Q){return new di(ae,Q)},createHandshake(ae,Q){return new ti(ae,Q)},createAssistantToTheTransportManager(ae,Q,re){return new Lt(ae,Q,re)}},rr=Sr;class ws{constructor(Q){this.options=Q||{},this.livesLeft=this.options.lives||1/0}getAssistant(Q){return rr.createAssistantToTheTransportManager(this,Q,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Er{constructor(Q,re){this.strategies=Q,this.loop=!!re.loop,this.failFast=!!re.failFast,this.timeout=re.timeout,this.timeoutLimit=re.timeoutLimit}isSupported(){return tt(this.strategies,fe.method("isSupported"))}connect(Q,re){var Fe=this.strategies,st=0,xn=this.timeout,Ci=null,gr=(Ts,wo)=>{wo?re(null,wo):(st=st+1,this.loop&&(st=st%Fe.length),st<Fe.length?(xn&&(xn=xn*2,this.timeoutLimit&&(xn=Math.min(xn,this.timeoutLimit))),Ci=this.tryStrategy(Fe[st],Q,{timeout:xn,failFast:this.failFast},gr)):re(!0))};return Ci=this.tryStrategy(Fe[st],Q,{timeout:xn,failFast:this.failFast},gr),{abort:function(){Ci.abort()},forceMinPriority:function(Ts){Q=Ts,Ci&&Ci.forceMinPriority(Ts)}}}tryStrategy(Q,re,Fe,st){var xn=null,Ci=null;return Fe.timeout>0&&(xn=new Z(Fe.timeout,function(){Ci.abort(),st(!0)})),Ci=Q.connect(re,function(gr,Ts){gr&&xn&&xn.isRunning()&&!Fe.failFast||(xn&&xn.ensureAborted(),st(gr,Ts))}),{abort:function(){xn&&xn.ensureAborted(),Ci.abort()},forceMinPriority:function(gr){Ci.forceMinPriority(gr)}}}}class xa{constructor(Q){this.strategies=Q}isSupported(){return tt(this.strategies,fe.method("isSupported"))}connect(Q,re){return No(this.strategies,Q,function(Fe,st){return function(xn,Ci){if(st[Fe].error=xn,xn){Do(st)&&re(!0);return}Be(st,function(gr){gr.forceMinPriority(Ci.transport.priority)}),re(null,Ci)}})}}function No(ae,Q,re){var Fe=$e(ae,function(st,xn,Ci,gr){return st.connect(Q,re(xn,gr))});return{abort:function(){Be(Fe,Zs)},forceMinPriority:function(st){Be(Fe,function(xn){xn.forceMinPriority(st)})}}}function Do(ae){return St(ae,function(Q){return!!Q.error})}function Zs(ae){!ae.error&&!ae.aborted&&(ae.abort(),ae.aborted=!0)}class ua{constructor(Q,re,Fe){this.strategy=Q,this.transports=re,this.ttl=Fe.ttl||1800*1e3,this.usingTLS=Fe.useTLS,this.timeline=Fe.timeline}isSupported(){return this.strategy.isSupported()}connect(Q,re){var Fe=this.usingTLS,st=Co(Fe),xn=st&&st.cacheSkipCount?st.cacheSkipCount:0,Ci=[this.strategy];if(st&&st.timestamp+this.ttl>=fe.now()){var gr=this.transports[st.transport];gr&&(["ws","wss"].includes(st.transport)||xn>3?(this.timeline.info({cached:!0,transport:st.transport,latency:st.latency}),Ci.push(new Er([gr],{timeout:st.latency*2+1e3,failFast:!0}))):xn++)}var Ts=fe.now(),wo=Ci.pop().connect(Q,function Bo(Sl,T1){Sl?(Qi(Fe),Ci.length>0?(Ts=fe.now(),wo=Ci.pop().connect(Q,Bo)):re(Sl)):(ul(Fe,T1.transport.name,fe.now()-Ts,xn),re(null,T1))});return{abort:function(){wo.abort()},forceMinPriority:function(Bo){Q=Bo,wo&&wo.forceMinPriority(Bo)}}}}function Os(ae){return"pusherTransport"+(ae?"TLS":"NonTLS")}function Co(ae){var Q=Qn.getLocalStorage();if(Q)try{var re=Q[Os(ae)];if(re)return JSON.parse(re)}catch{Qi(ae)}return null}function ul(ae,Q,re,Fe){var st=Qn.getLocalStorage();if(st)try{st[Os(ae)]=dt({timestamp:fe.now(),transport:Q,latency:re,cacheSkipCount:Fe})}catch{}}function Qi(ae){var Q=Qn.getLocalStorage();if(Q)try{delete Q[Os(ae)]}catch{}}class Ms{constructor(Q,{delay:re}){this.strategy=Q,this.options={delay:re}}isSupported(){return this.strategy.isSupported()}connect(Q,re){var Fe=this.strategy,st,xn=new Z(this.options.delay,function(){st=Fe.connect(Q,re)});return{abort:function(){xn.ensureAborted(),st&&st.abort()},forceMinPriority:function(Ci){Q=Ci,st&&st.forceMinPriority(Ci)}}}}class js{constructor(Q,re,Fe){this.test=Q,this.trueBranch=re,this.falseBranch=Fe}isSupported(){var Q=this.test()?this.trueBranch:this.falseBranch;return Q.isSupported()}connect(Q,re){var Fe=this.test()?this.trueBranch:this.falseBranch;return Fe.connect(Q,re)}}class Ro{constructor(Q){this.strategy=Q}isSupported(){return this.strategy.isSupported()}connect(Q,re){var Fe=this.strategy.connect(Q,function(st,xn){xn&&Fe.abort(),re(st,xn)});return Fe}}function Bi(ae){return function(){return ae.isSupported()}}var Vi=function(ae,Q,re){var Fe={};function st(Kk,r0,s0,p3,g3){var L1=re(ae,Kk,r0,s0,p3,g3);return Fe[Kk]=L1,L1}var xn=Object.assign({},Q,{hostNonTLS:ae.wsHost+":"+ae.wsPort,hostTLS:ae.wsHost+":"+ae.wssPort,httpPath:ae.wsPath}),Ci=Object.assign({},xn,{useTLS:!0}),gr=Object.assign({},Q,{hostNonTLS:ae.httpHost+":"+ae.httpPort,hostTLS:ae.httpHost+":"+ae.httpsPort,httpPath:ae.httpPath}),Ts={loop:!0,timeout:15e3,timeoutLimit:6e4},wo=new ws({minPingDelay:1e4,maxPingDelay:ae.activityTimeout}),Bo=new ws({lives:2,minPingDelay:1e4,maxPingDelay:ae.activityTimeout}),Sl=st("ws","ws",3,xn,wo),T1=st("wss","ws",3,Ci,wo),f3=st("sockjs","sockjs",1,gr),sx=st("xhr_streaming","xhr_streaming",1,gr,Bo),zk=st("xdr_streaming","xdr_streaming",1,gr,Bo),iN=st("xhr_polling","xhr_polling",1,gr),rN=st("xdr_polling","xdr_polling",1,gr),bd=new Er([Sl],Ts),I1=new Er([T1],Ts),Ag=new Er([f3],Ts),Uk=new Er([new js(Bi(sx),sx,zk)],Ts),ox=new Er([new js(Bi(iN),iN,rN)],Ts),qk=new Er([new js(Bi(Uk),new xa([Uk,new Ms(ox,{delay:4e3})]),ox)],Ts),ax=new js(Bi(qk),qk,Ag),lx;return Q.useTLS?lx=new xa([bd,new Ms(ax,{delay:2e3})]):lx=new xa([bd,new Ms(I1,{delay:2e3}),new Ms(ax,{delay:5e3})]),new ua(new Ro(new js(Bi(Sl),lx,ax)),Fe,{ttl:18e5,timeline:Q.timeline,useTLS:Q.useTLS})},Br=Vi,Gr=function(){var ae=this;ae.timeline.info(ae.buildTimelineMessage({transport:ae.name+(ae.options.useTLS?"s":"")})),ae.hooks.isInitialized()?ae.changeState("initialized"):ae.hooks.file?(ae.changeState("initializing"),d.load(ae.hooks.file,{useTLS:ae.options.useTLS},function(Q,re){ae.hooks.isInitialized()?(ae.changeState("initialized"),re(!0)):(Q&&ae.onError(Q),ae.onClose(),re(!1))})):ae.onClose()},xs={getRequest:function(ae){var Q=new window.XDomainRequest;return Q.ontimeout=function(){ae.emit("error",new b),ae.close()},Q.onerror=function(re){ae.emit("error",re),ae.close()},Q.onprogress=function(){Q.responseText&&Q.responseText.length>0&&ae.onChunk(200,Q.responseText)},Q.onload=function(){Q.responseText&&Q.responseText.length>0&&ae.onChunk(200,Q.responseText),ae.emit("finished",200),ae.close()},Q},abortRequest:function(ae){ae.ontimeout=ae.onerror=ae.onprogress=ae.onload=null,ae.abort()}},sr=xs;const Ns=256*1024;class uo extends rt{constructor(Q,re,Fe){super(),this.hooks=Q,this.method=re,this.url=Fe}start(Q){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},Qn.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(Q)}close(){this.unloader&&(Qn.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(Q,re){for(;;){var Fe=this.advanceBuffer(re);if(Fe)this.emit("chunk",{status:Q,data:Fe});else break}this.isBufferTooLong(re)&&this.emit("buffer_too_long")}advanceBuffer(Q){var re=Q.slice(this.position),Fe=re.indexOf(` `);return Fe!==-1?(this.position+=Fe+1,re.slice(0,Fe)):null}isBufferTooLong(Q){return this.position===Q.length&&Q.length>Ns}}var yi;(function(ae){ae[ae.CONNECTING=0]="CONNECTING",ae[ae.OPEN=1]="OPEN",ae[ae.CLOSED=3]="CLOSED"})(yi||(yi={}));var vn=yi,Un=1;class Mn{constructor(Q,re){this.hooks=Q,this.session=Wn(1e3)+"/"+Ei(8),this.location=fi(re),this.readyState=vn.CONNECTING,this.openStream()}send(Q){return this.sendRaw(JSON.stringify([Q]))}ping(){this.hooks.sendHeartbeat(this)}close(Q,re){this.onClose(Q,re,!0)}sendRaw(Q){if(this.readyState===vn.OPEN)try{return Qn.createSocketRequest("POST",or(Wi(this.location,this.session))).start(Q),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(Q,re,Fe){this.closeStream(),this.readyState=vn.CLOSED,this.onclose&&this.onclose({code:Q,reason:re,wasClean:Fe})}onChunk(Q){if(Q.status===200){this.readyState===vn.OPEN&&this.onActivity();var re,Fe=Q.data.slice(0,1);switch(Fe){case"o":re=JSON.parse(Q.data.slice(1)||"{}"),this.onOpen(re);break;case"a":re=JSON.parse(Q.data.slice(1)||"[]");for(var st=0;st<re.length;st++)this.onEvent(re[st]);break;case"m":re=JSON.parse(Q.data.slice(1)||"null"),this.onEvent(re);break;case"h":this.hooks.onHeartbeat(this);break;case"c":re=JSON.parse(Q.data.slice(1)||"[]"),this.onClose(re[0],re[1],!0);break}}}onOpen(Q){this.readyState===vn.CONNECTING?(Q&&Q.hostname&&(this.location.base=qn(this.location.base,Q.hostname)),this.readyState=vn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(Q){this.readyState===vn.OPEN&&this.onmessage&&this.onmessage({data:Q})}onActivity(){this.onactivity&&this.onactivity()}onError(Q){this.onerror&&this.onerror(Q)}openStream(){this.stream=Qn.createSocketRequest("POST",or(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",Q=>{this.onChunk(Q)}),this.stream.bind("finished",Q=>{this.hooks.onFinished(this,Q)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(Q){fe.defer(()=>{this.onError(Q),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function fi(ae){var Q=/([^\?]*)\/*(\??.*)/.exec(ae);return{base:Q[1],queryString:Q[2]}}function Wi(ae,Q){return ae.base+"/"+Q+"/xhr_send"}function or(ae){var Q=ae.indexOf("?")===-1?"?":"&";return ae+Q+"t="+ +new Date+"&n="+Un++}function qn(ae,Q){var re=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(ae);return re[1]+Q+re[3]}function Wn(ae){return Qn.randomInt(ae)}function Ei(ae){for(var Q=[],re=0;re<ae;re++)Q.push(Wn(32).toString(32));return Q.join("")}var Kn=Mn,Hn={getReceiveURL:function(ae,Q){return ae.base+"/"+Q+"/xhr_streaming"+ae.queryString},onHeartbeat:function(ae){ae.sendRaw("[]")},sendHeartbeat:function(ae){ae.sendRaw("[]")},onFinished:function(ae,Q){ae.onClose(1006,"Connection interrupted ("+Q+")",!1)}},ki=Hn,Sn={getReceiveURL:function(ae,Q){return ae.base+"/"+Q+"/xhr"+ae.queryString},onHeartbeat:function(){},sendHeartbeat:function(ae){ae.sendRaw("[]")},onFinished:function(ae,Q){Q===200?ae.reconnect():ae.onClose(1006,"Connection interrupted ("+Q+")",!1)}},On=Sn,wi={getRequest:function(ae){var Q=Qn.getXHRAPI(),re=new Q;return re.onreadystatechange=re.onprogress=function(){switch(re.readyState){case 3:re.responseText&&re.responseText.length>0&&ae.onChunk(re.status,re.responseText);break;case 4:re.responseText&&re.responseText.length>0&&ae.onChunk(re.status,re.responseText),ae.emit("finished",re.status),ae.close();break}},re},abortRequest:function(ae){ae.onreadystatechange=null,ae.abort()}},Cr=wi,br={createStreamingSocket(ae){return this.createSocket(ki,ae)},createPollingSocket(ae){return this.createSocket(On,ae)},createSocket(ae,Q){return new Kn(ae,Q)},createXHR(ae,Q){return this.createRequest(Cr,ae,Q)},createRequest(ae,Q,re){return new uo(ae,Q,re)}},zs=br;zs.createXDR=function(ae,Q){return this.createRequest(sr,ae,Q)};var Oa=zs,$r={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:o,DependenciesReceivers:u,getDefaultStrategy:Br,Transports:Ln,transportConnectionInitializer:Gr,HTTPFactory:Oa,TimelineTransport:Ct,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(ae){window.Pusher=ae;var Q=()=>{this.onDocumentBody(ae.ready)};window.JSON?Q():d.load("json2",{},Q)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:P,jsonp:ce}},onDocumentBody(ae){document.body?ae():setTimeout(()=>{this.onDocumentBody(ae)},0)},createJSONPRequest(ae,Q){return new Xe(ae,Q)},createScriptRequest(ae){return new Ne(ae)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var ae=this.getXHRAPI();return new ae},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return et},createWebSocket(ae){var Q=this.getWebSocketAPI();return new Q(ae)},createSocketRequest(ae,Q){if(this.isXHRSupported())return this.HTTPFactory.createXHR(ae,Q);if(this.isXDRSupported(Q.indexOf("https:")===0))return this.HTTPFactory.createXDR(ae,Q);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var ae=this.getXHRAPI();return!!ae&&new ae().withCredentials!==void 0},isXDRSupported(ae){var Q=ae?"https:":"http:",re=this.getProtocol();return!!window.XDomainRequest&&re===Q},addUnloadListener(ae){window.addEventListener!==void 0?window.addEventListener("unload",ae,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",ae)},removeUnloadListener(ae){window.addEventListener!==void 0?window.removeEventListener("unload",ae,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",ae)},randomInt(ae){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*ae)}},Qn=$r,Po;(function(ae){ae[ae.ERROR=3]="ERROR",ae[ae.INFO=6]="INFO",ae[ae.DEBUG=7]="DEBUG"})(Po||(Po={}));var jl=Po;class Ku{constructor(Q,re,Fe){this.key=Q,this.session=re,this.events=[],this.options=Fe||{},this.sent=0,this.uniqueID=0}log(Q,re){Q<=this.options.level&&(this.events.push(Se({},re,{timestamp:fe.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(Q){this.log(jl.ERROR,Q)}info(Q){this.log(jl.INFO,Q)}debug(Q){this.log(jl.DEBUG,Q)}isEmpty(){return this.events.length===0}send(Q,re){var Fe=Se({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=[],Q(Fe,(st,xn)=>{st||this.sent++,re&&re(st,xn)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Jo{constructor(Q,re,Fe,st){this.name=Q,this.priority=re,this.transport=Fe,this.options=st||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(Q,re){if(this.isSupported()){if(this.priority<Q)return _c(new y,re)}else return _c(new I,re);var Fe=!1,st=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),xn=null,Ci=function(){st.unbind("initialized",Ci),st.connect()},gr=function(){xn=rr.createHandshake(st,function(Sl){Fe=!0,Bo(),re(null,Sl)})},Ts=function(Sl){Bo(),re(Sl)},wo=function(){Bo();var Sl;Sl=dt(st),re(new C(Sl))},Bo=function(){st.unbind("initialized",Ci),st.unbind("open",gr),st.unbind("error",Ts),st.unbind("closed",wo)};return st.bind("initialized",Ci),st.bind("open",gr),st.bind("error",Ts),st.bind("closed",wo),st.initialize(),{abort:()=>{Fe||(Bo(),xn?xn.close():st.close())},forceMinPriority:Sl=>{Fe||this.priority<Sl&&(xn?xn.close():st.close())}}}}function _c(ae,Q){return fe.defer(function(){Q(ae)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:sc}=Qn;var pp=function(ae,Q,re,Fe,st,xn){var Ci=sc[re];if(!Ci)throw new k(re);var gr=(!ae.enabledTransports||Ie(ae.enabledTransports,Q)!==-1)&&(!ae.disabledTransports||Ie(ae.disabledTransports,Q)===-1),Ts;return gr?(st=Object.assign({ignoreNullOrigin:ae.ignoreNullOrigin},st),Ts=new Jo(Q,Fe,xn?xn.getAssistant(Ci):Ci,st)):Ts=E1,Ts},E1={isSupported:function(){return!1},connect:function(ae,Q){var re=fe.defer(function(){Q(new I)});return{abort:function(){re.ensureAborted()},forceMinPriority:function(){}}}};function Sa(ae){if(ae==null)throw"You must pass an options object";if(ae.cluster==null)throw"Options object must provide a cluster";"disableStats"in ae&&at.warn("The disableStats option is deprecated in favor of enableStats")}const Xm=(ae,Q)=>{var re="socket_id="+encodeURIComponent(ae.socketId);for(var Fe in Q.params)re+="&"+encodeURIComponent(Fe)+"="+encodeURIComponent(Q.params[Fe]);if(Q.paramsProvider!=null){let st=Q.paramsProvider();for(var Fe in st)re+="&"+encodeURIComponent(Fe)+"="+encodeURIComponent(st[Fe])}return re};var Zm=ae=>{if(typeof Qn.getAuthorizers()[ae.transport]>"u")throw`'${ae.transport}' is not a recognized auth transport`;return(Q,re)=>{const Fe=Xm(Q,ae);Qn.getAuthorizers()[ae.transport](Qn,Fe,ae,m.UserAuthentication,re)}};const Jc=(ae,Q)=>{var re="socket_id="+encodeURIComponent(ae.socketId);re+="&channel_name="+encodeURIComponent(ae.channelName);for(var Fe in Q.params)re+="&"+encodeURIComponent(Fe)+"="+encodeURIComponent(Q.params[Fe]);if(Q.paramsProvider!=null){let st=Q.paramsProvider();for(var Fe in st)re+="&"+encodeURIComponent(Fe)+"="+encodeURIComponent(st[Fe])}return re};var n0=ae=>{if(typeof Qn.getAuthorizers()[ae.transport]>"u")throw`'${ae.transport}' is not a recognized auth transport`;return(Q,re)=>{const Fe=Jc(Q,ae);Qn.getAuthorizers()[ae.transport](Qn,Fe,ae,m.ChannelAuthorization,re)}};const vc=(ae,Q,re)=>{const Fe={authTransport:Q.transport,authEndpoint:Q.endpoint,auth:{params:Q.params,headers:Q.headers}};return(st,xn)=>{const Ci=ae.channel(st.channelName);re(Ci,Fe).authorize(st.socketId,xn)}};function Ef(ae,Q){let re={activityTimeout:ae.activityTimeout||l.activityTimeout,cluster:ae.cluster,httpPath:ae.httpPath||l.httpPath,httpPort:ae.httpPort||l.httpPort,httpsPort:ae.httpsPort||l.httpsPort,pongTimeout:ae.pongTimeout||l.pongTimeout,statsHost:ae.statsHost||l.stats_host,unavailableTimeout:ae.unavailableTimeout||l.unavailableTimeout,wsPath:ae.wsPath||l.wsPath,wsPort:ae.wsPort||l.wsPort,wssPort:ae.wssPort||l.wssPort,enableStats:Hk(ae),httpHost:kf(ae),useTLS:Gu(ae),wsHost:i0(ae),userAuthenticator:Su(ae),channelAuthorizer:Vk(ae,Q)};return"disabledTransports"in ae&&(re.disabledTransports=ae.disabledTransports),"enabledTransports"in ae&&(re.enabledTransports=ae.enabledTransports),"ignoreNullOrigin"in ae&&(re.ignoreNullOrigin=ae.ignoreNullOrigin),"timelineParams"in ae&&(re.timelineParams=ae.timelineParams),"nacl"in ae&&(re.nacl=ae.nacl),re}function kf(ae){return ae.httpHost?ae.httpHost:ae.cluster?`sockjs-${ae.cluster}.pusher.com`:l.httpHost}function i0(ae){return ae.wsHost?ae.wsHost:nN(ae.cluster)}function nN(ae){return`ws-${ae}.pusher.com`}function Gu(ae){return Qn.getProtocol()==="https:"?!0:ae.forceTLS!==!1}function Hk(ae){return"enableStats"in ae?ae.enableStats:"disableStats"in ae?!ae.disableStats:!1}function Su(ae){const Q=Object.assign(Object.assign({},l.userAuthentication),ae.userAuthentication);return"customHandler"in Q&&Q.customHandler!=null?Q.customHandler:Zm(Q)}function ix(ae,Q){let re;return"channelAuthorization"in ae?re=Object.assign(Object.assign({},l.channelAuthorization),ae.channelAuthorization):(re={transport:ae.authTransport||l.authTransport,endpoint:ae.authEndpoint||l.authEndpoint},"auth"in ae&&("params"in ae.auth&&(re.params=ae.auth.params),"headers"in ae.auth&&(re.headers=ae.auth.headers)),"authorizer"in ae&&(re.customHandler=vc(Q,re,ae.authorizer))),re}function Vk(ae,Q){const re=ix(ae,Q);return"customHandler"in re&&re.customHandler!=null?re.customHandler:n0(re)}class Jm extends rt{constructor(Q){super(function(re,Fe){at.debug(`No callbacks on watchlist events for ${re}`)}),this.pusher=Q,this.bindWatchlistInternalEvent()}handleEvent(Q){Q.data.events.forEach(re=>{this.emit(re.name,re)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",Q=>{var re=Q.event;re==="pusher_internal:watchlist_events"&&this.handleEvent(Q)})}}function rx(){let ae,Q;return{promise:new Promise((Fe,st)=>{ae=Fe,Q=st}),resolve:ae,reject:Q}}var Wk=rx;class Ma extends rt{constructor(Q){super(function(re,Fe){at.debug("No callbacks on user for "+re)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(re,Fe)=>{if(re){at.warn(`Error during signin: ${re}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:Fe.auth,user_data:Fe.user_data})},this.pusher=Q,this.pusher.connection.bind("state_change",({previous:re,current:Fe})=>{re!=="connected"&&Fe==="connected"&&this._signin(),re==="connected"&&Fe!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Jm(Q),this.pusher.connection.bind("message",re=>{var Fe=re.event;Fe==="pusher:signin_success"&&this._onSigninSuccess(re.data),this.serverToUserChannel&&this.serverToUserChannel.name===re.channel&&this.serverToUserChannel.handleEvent(re)})}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(Q){try{this.user_data=JSON.parse(Q.user_data)}catch{at.error(`Failed parsing user data after signin: ${Q.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){at.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const Q=re=>{re.subscriptionPending&&re.subscriptionCancelled?re.reinstateSubscription():!re.subscriptionPending&&this.pusher.connection.state==="connected"&&re.subscribe()};this.serverToUserChannel=new Dt(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((re,Fe)=>{re.indexOf("pusher_internal:")===0||re.indexOf("pusher:")===0||this.emit(re,Fe)}),Q(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:Q,resolve:re}=Wk();Q.done=!1;const Fe=()=>{Q.done=!0};Q.then(Fe).catch(Fe),this.signinDonePromise=Q,this._signinDoneResolve=re}}class dl{static ready(){dl.isReady=!0;for(var Q=0,re=dl.instances.length;Q<re;Q++)dl.instances[Q].connect()}static getClientFeatures(){return ye(vt({ws:Qn.Transports.ws},function(Q){return Q.isSupported({})}))}constructor(Q,re){h3(Q),Sa(re),this.key=Q,this.config=Ef(re,this),this.channels=rr.createChannels(),this.global_emitter=new rt,this.sessionID=Qn.randomInt(1e9),this.timeline=new Ku(this.key,this.sessionID,{cluster:this.config.cluster,features:dl.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:jl.INFO,version:l.VERSION}),this.config.enableStats&&(this.timelineSender=rr.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Qn.TimelineTransport.name}));var Fe=st=>Qn.getDefaultStrategy(this.config,st,pp);this.connection=rr.createConnectionManager(this.key,{getStrategy:Fe,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",st=>{var xn=st.event,Ci=xn.indexOf("pusher_internal:")===0;if(st.channel){var gr=this.channel(st.channel);gr&&gr.handleEvent(st)}Ci||this.global_emitter.emit(st.event,st.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",st=>{at.warn(st)}),dl.instances.push(this),this.timeline.info({instances:dl.instances.length}),this.user=new Ma(this),dl.isReady&&this.connect()}channel(Q){return this.channels.find(Q)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var Q=this.connection.isUsingTLS(),re=this.timelineSender;this.timelineSenderTimer=new X(6e4,function(){re.send(Q)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(Q,re,Fe){return this.global_emitter.bind(Q,re,Fe),this}unbind(Q,re,Fe){return this.global_emitter.unbind(Q,re,Fe),this}bind_global(Q){return this.global_emitter.bind_global(Q),this}unbind_global(Q){return this.global_emitter.unbind_global(Q),this}unbind_all(Q){return this.global_emitter.unbind_all(),this}subscribeAll(){var Q;for(Q in this.channels.channels)this.channels.channels.hasOwnProperty(Q)&&this.subscribe(Q)}subscribe(Q){var re=this.channels.add(Q,this);return re.subscriptionPending&&re.subscriptionCancelled?re.reinstateSubscription():!re.subscriptionPending&&this.connection.state==="connected"&&re.subscribe(),re}unsubscribe(Q){var re=this.channels.find(Q);re&&re.subscriptionPending?re.cancelSubscription():(re=this.channels.remove(Q),re&&re.subscribed&&re.unsubscribe())}send_event(Q,re,Fe){return this.connection.send_event(Q,re,Fe)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}dl.instances=[],dl.isReady=!1,dl.logToConsole=!1,dl.Runtime=Qn,dl.ScriptReceivers=Qn.ScriptReceivers,dl.DependenciesReceivers=Qn.DependenciesReceivers,dl.auth_callbacks=Qn.auth_callbacks;var k1=i.default=dl;function h3(ae){if(ae==null)throw"You must pass your app key when you instantiate Pusher."}Qn.setup(dl)}])})}(Pie)),Pie.exports}var gyt=pyt();const myt=Cl(gyt);function P_(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 K_(n){return!!n&&!!n[ic]}function _w(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)===Eyt}(n)||Array.isArray(n)||!!n[TAe]||!!(!((e=n.constructor)===null||e===void 0)&&e[TAe])||Q1e(n)||X1e(n))}function _yt(n){return K_(n)||P_(23,n),n[ic].t}function bL(n,e,t){t===void 0&&(t=!1),KM(n)===0?(t?Object.keys:pP)(n).forEach(function(i){t&&typeof i=="symbol"||e(i,n[i],n)}):n.forEach(function(i,r){return e(r,i,n)})}function KM(n){var e=n[ic];return e?e.i>3?e.i-4:e.i:Array.isArray(n)?1:Q1e(n)?2:X1e(n)?3:0}function fP(n,e){return KM(n)===2?n.has(e):Object.prototype.hasOwnProperty.call(n,e)}function vyt(n,e){return KM(n)===2?n.get(e):n[e]}function cWe(n,e,t){var i=KM(n);i===2?n.set(e,t):i===3?n.add(t):n[e]=t}function uWe(n,e){return n===e?n!==0||1/n==1/e:n!=n&&e!=e}function Q1e(n){return xyt&&n instanceof Map}function X1e(n){return Syt&&n instanceof Set}function YT(n){return n.o||n.t}function Z1e(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var e=hWe(n);delete e[ic];for(var t=pP(e),i=0;i<t.length;i++){var r=t[i],s=e[r];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[r]={configurable:!0,writable:!0,enumerable:s.enumerable,value:n[r]})}return Object.create(Object.getPrototypeOf(n),e)}function pZ(n,e){return e===void 0&&(e=!1),J1e(n)||K_(n)||!_w(n)||(KM(n)>1&&(n.set=n.add=n.clear=n.delete=byt),Object.freeze(n),e&&bL(n,function(t,i){return pZ(i,!0)},!0)),n}function byt(){P_(2)}function J1e(n){return n==null||typeof n!="object"||Object.isFrozen(n)}function Iy(n){var e=Sde[n];return e||P_(18,n),e}function yyt(n,e){Sde[n]||(Sde[n]=e)}function Cde(){return t8}function Oie(n,e){e&&(Iy("Patches"),n.u=[],n.s=[],n.v=e)}function qU(n){wde(n),n.p.forEach(Cyt),n.p=null}function wde(n){n===t8&&(t8=n.l)}function CAe(n){return t8={p:[],l:t8,h:n,m:!0,_:0}}function Cyt(n){var e=n[ic];e.i===0||e.i===1?e.j():e.g=!0}function Mie(n,e){e._=e.p.length;var t=e.p[0],i=n!==void 0&&n!==t;return e.h.O||Iy("ES5").S(e,n,i),i?(t[ic].P&&(qU(e),P_(4)),_w(n)&&(n=KU(e,n),e.l||GU(e,n)),e.u&&Iy("Patches").M(t[ic].t,n,e.u,e.s)):n=KU(e,t,[]),qU(e),e.u&&e.v(e.u,e.s),n!==dWe?n:void 0}function KU(n,e,t){if(J1e(e))return e;var i=e[ic];if(!i)return bL(e,function(a,l){return wAe(n,i,e,a,l,t)},!0),e;if(i.A!==n)return e;if(!i.P)return GU(n,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var r=i.i===4||i.i===5?i.o=Z1e(i.k):i.o,s=r,o=!1;i.i===3&&(s=new Set(r),r.clear(),o=!0),bL(s,function(a,l){return wAe(n,i,r,a,l,t,o)}),GU(n,r,!1),t&&n.u&&Iy("Patches").N(i,t,n.u,n.s)}return i.o}function wAe(n,e,t,i,r,s,o){if(K_(r)){var a=KU(n,r,s&&e&&e.i!==3&&!fP(e.R,i)?s.concat(i):void 0);if(cWe(t,i,a),!K_(a))return;n.m=!1}else o&&t.add(r);if(_w(r)&&!J1e(r)){if(!n.h.D&&n._<1)return;KU(n,r),e&&e.A.l||GU(n,r)}}function GU(n,e,t){t===void 0&&(t=!1),!n.l&&n.h.D&&n.m&&pZ(e,t)}function jie(n,e){var t=n[ic];return(t?YT(t):n)[e]}function xAe(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 mS(n){n.P||(n.P=!0,n.l&&mS(n.l))}function Fie(n){n.o||(n.o=Z1e(n.t))}function xde(n,e,t){var i=Q1e(e)?Iy("MapSet").F(e,t):X1e(e)?Iy("MapSet").T(e,t):n.O?function(r,s){var o=Array.isArray(r),a={i:o?1:0,A:s?s.A:Cde(),P:!1,I:!1,R:{},l:s,t:r,k:null,o:null,j:null,C:!1},l=a,c=n8;o&&(l=[a],c=Oj);var u=Proxy.revocable(l,c),d=u.revoke,f=u.proxy;return a.k=f,a.j=d,f}(e,t):Iy("ES5").J(e,t);return(t?t.A:Cde()).p.push(i),i}function eCe(n){return K_(n)||P_(22,n),function e(t){if(!_w(t))return t;var i,r=t[ic],s=KM(t);if(r){if(!r.P&&(r.i<4||!Iy("ES5").K(r)))return r.t;r.I=!0,i=SAe(t,s),r.I=!1}else i=SAe(t,s);return bL(i,function(o,a){r&&vyt(r.t,o)===a||cWe(i,o,e(a))}),s===3?new Set(i):i}(n)}function SAe(n,e){switch(e){case 2:return new Map(n);case 3:return Array.from(n)}return Z1e(n)}function wyt(){function n(s,o){var a=r[s];return a?a.enumerable=o:r[s]=a={configurable:!0,enumerable:o,get:function(){var l=this[ic];return n8.get(l,s)},set:function(l){var c=this[ic];n8.set(c,s,l)}},a}function e(s){for(var o=s.length-1;o>=0;o--){var a=s[o][ic];if(!a.P)switch(a.i){case 5:i(a)&&mS(a);break;case 4:t(a)&&mS(a)}}}function t(s){for(var o=s.t,a=s.k,l=pP(a),c=l.length-1;c>=0;c--){var u=l[c];if(u!==ic){var d=o[u];if(d===void 0&&!fP(o,u))return!0;var f=a[u],p=f&&f[ic];if(p?p.t!==d:!uWe(f,d))return!0}}var g=!!o[ic];return l.length!==pP(o).length+(g?0:1)}function i(s){var o=s.k;if(o.length!==s.t.length)return!0;var a=Object.getOwnPropertyDescriptor(o,o.length-1);if(a&&!a.get)return!0;for(var l=0;l<o.length;l++)if(!o.hasOwnProperty(l))return!0;return!1}var r={};yyt("ES5",{J:function(s,o){var a=Array.isArray(s),l=function(u,d){if(u){for(var f=Array(d.length),p=0;p<d.length;p++)Object.defineProperty(f,""+p,n(p,!0));return f}var g=hWe(d);delete g[ic];for(var m=pP(g),_=0;_<m.length;_++){var v=m[_];g[v]=n(v,u||!!g[v].enumerable)}return Object.create(Object.getPrototypeOf(d),g)}(a,s),c={i:a?5:4,A:o?o.A:Cde(),P:!1,I:!1,R:{},l:o,t:s,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,ic,{value:c,writable:!0}),l},S:function(s,o,a){a?K_(o)&&o[ic].A===s&&e(s.p):(s.u&&function l(c){if(c&&typeof c=="object"){var u=c[ic];if(u){var d=u.t,f=u.k,p=u.R,g=u.i;if(g===4)bL(f,function(y){y!==ic&&(d[y]!==void 0||fP(d,y)?p[y]||l(f[y]):(p[y]=!0,mS(u)))}),bL(d,function(y){f[y]!==void 0||fP(f,y)||(p[y]=!1,mS(u))});else if(g===5){if(i(u)&&(mS(u),p.length=!0),f.length<d.length)for(var m=f.length;m<d.length;m++)p[m]=!1;else for(var _=d.length;_<f.length;_++)p[_]=!0;for(var v=Math.min(f.length,d.length),b=0;b<v;b++)f.hasOwnProperty(b)||(p[b]=!0),p[b]===void 0&&l(f[b])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?t(s):i(s)}})}var EAe,t8,tCe=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",xyt=typeof Map<"u",Syt=typeof Set<"u",kAe=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",dWe=tCe?Symbol.for("immer-nothing"):((EAe={})["immer-nothing"]=!0,EAe),TAe=tCe?Symbol.for("immer-draftable"):"__$immer_draftable",ic=tCe?Symbol.for("immer-state"):"__$immer_state",Eyt=""+Object.prototype.constructor,pP=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,hWe=Object.getOwnPropertyDescriptors||function(n){var e={};return pP(n).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(n,t)}),e},Sde={},n8={get:function(n,e){if(e===ic)return n;var t=YT(n);if(!fP(t,e))return function(r,s,o){var a,l=xAe(s,o);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||!_w(i)?i:i===jie(n.t,e)?(Fie(n),n.o[e]=xde(n.A.h,i,n)):i},has:function(n,e){return e in YT(n)},ownKeys:function(n){return Reflect.ownKeys(YT(n))},set:function(n,e,t){var i=xAe(YT(n),e);if(i!=null&&i.set)return i.set.call(n.k,t),!0;if(!n.P){var r=jie(YT(n),e),s=r==null?void 0:r[ic];if(s&&s.t===t)return n.o[e]=t,n.R[e]=!1,!0;if(uWe(t,r)&&(t!==void 0||fP(n.t,e)))return!0;Fie(n),mS(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 jie(n.t,e)!==void 0||e in n.t?(n.R[e]=!1,Fie(n),mS(n)):delete n.R[e],n.o&&delete n.o[e],!0},getOwnPropertyDescriptor:function(n,e){var t=YT(n),i=Reflect.getOwnPropertyDescriptor(t,e);return i&&{writable:!0,configurable:n.i!==1||e!=="length",enumerable:i.enumerable,value:t[e]}},defineProperty:function(){P_(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){P_(12)}},Oj={};bL(n8,function(n,e){Oj[n]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Oj.deleteProperty=function(n,e){return Oj.set.call(this,n,e,void 0)},Oj.set=function(n,e,t){return n8.set.call(this,n[0],e,t,n[0])};var kyt=function(){function n(t){var i=this;this.O=kAe,this.D=!0,this.produce=function(r,s,o){if(typeof r=="function"&&typeof s!="function"){var a=s;s=r;var l=i;return function(m){var _=this;m===void 0&&(m=a);for(var v=arguments.length,b=Array(v>1?v-1:0),y=1;y<v;y++)b[y-1]=arguments[y];return l.produce(m,function(C){var S;return(S=s).call.apply(S,[_,C].concat(b))})}}var c;if(typeof s!="function"&&P_(6),o!==void 0&&typeof o!="function"&&P_(7),_w(r)){var u=CAe(i),d=xde(i,r,void 0),f=!0;try{c=s(d),f=!1}finally{f?qU(u):wde(u)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return Oie(u,o),Mie(m,u)},function(m){throw qU(u),m}):(Oie(u,o),Mie(c,u))}if(!r||typeof r!="object"){if((c=s(r))===void 0&&(c=r),c===dWe&&(c=void 0),i.D&&pZ(c,!0),o){var p=[],g=[];Iy("Patches").M(r,c,p,g),o(p,g)}return c}P_(21,r)},this.produceWithPatches=function(r,s){if(typeof r=="function")return function(c){for(var u=arguments.length,d=Array(u>1?u-1:0),f=1;f<u;f++)d[f-1]=arguments[f];return i.produceWithPatches(c,function(p){return r.apply(void 0,[p].concat(d))})};var o,a,l=i.produce(r,s,function(c,u){o=c,a=u});return typeof Promise<"u"&&l instanceof Promise?l.then(function(c){return[c,o,a]}):[l,o,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){_w(t)||P_(8),K_(t)&&(t=eCe(t));var i=CAe(this),r=xde(this,t,void 0);return r[ic].C=!0,wde(i),r},e.finishDraft=function(t,i){var r=t&&t[ic],s=r.A;return Oie(s,i),Mie(void 0,s)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!kAe&&P_(20),this.O=t},e.applyPatches=function(t,i){var r;for(r=i.length-1;r>=0;r--){var s=i[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(i=i.slice(r+1));var o=Iy("Patches").$;return K_(t)?o(t,i):this.produce(t,function(a){return o(a,i)})},n}(),Im=new kyt,gZ=Im.produce;Im.produceWithPatches.bind(Im);Im.setAutoFreeze.bind(Im);Im.setUseProxies.bind(Im);Im.applyPatches.bind(Im);Im.createDraft.bind(Im);Im.finishDraft.bind(Im);function IAe(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 ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?IAe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):IAe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ch(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 LAe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Bie=function(){return Math.random().toString(36).substring(7).split("").join(".")},i8={INIT:"@@redux/INIT"+Bie(),REPLACE:"@@redux/REPLACE"+Bie(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Bie()}};function Tyt(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 PB(n,e,t){var i;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(ch(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(ch(1));return t(PB)(n,e)}if(typeof n!="function")throw new Error(ch(2));var r=n,s=e,o=[],a=o,l=!1;function c(){a===o&&(a=o.slice())}function u(){if(l)throw new Error(ch(3));return s}function d(m){if(typeof m!="function")throw new Error(ch(4));if(l)throw new Error(ch(5));var _=!0;return c(),a.push(m),function(){if(_){if(l)throw new Error(ch(6));_=!1,c();var b=a.indexOf(m);a.splice(b,1),o=null}}}function f(m){if(!Tyt(m))throw new Error(ch(7));if(typeof m.type>"u")throw new Error(ch(8));if(l)throw new Error(ch(9));try{l=!0,s=r(s,m)}finally{l=!1}for(var _=o=a,v=0;v<_.length;v++){var b=_[v];b()}return m}function p(m){if(typeof m!="function")throw new Error(ch(10));r=m,f({type:i8.REPLACE})}function g(){var m,_=d;return m={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(ch(11));function y(){b.next&&b.next(u())}y();var C=_(y);return{unsubscribe:C}}},m[LAe]=function(){return this},m}return f({type:i8.INIT}),i={dispatch:f,subscribe:d,getState:u,replaceReducer:p},i[LAe]=g,i}var Iyt=PB;function Lyt(n){Object.keys(n).forEach(function(e){var t=n[e],i=t(void 0,{type:i8.INIT});if(typeof i>"u")throw new Error(ch(12));if(typeof t(void 0,{type:i8.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ch(13))})}function fWe(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 s=Object.keys(t),o;try{Lyt(t)}catch(a){o=a}return function(l,c){if(l===void 0&&(l={}),o)throw o;for(var u=!1,d={},f=0;f<s.length;f++){var p=s[f],g=t[p],m=l[p],_=g(m,c);if(typeof _>"u")throw c&&c.type,new Error(ch(14));d[p]=_,u=u||_!==m}return u=u||s.length!==Object.keys(l).length,u?d:l}}function AAe(n,e){return function(){return e(n.apply(this,arguments))}}function Ede(n,e){if(typeof n=="function")return AAe(n,e);if(typeof n!="object"||n===null)throw new Error(ch(16));var t={};for(var i in n){var r=n[i];typeof r=="function"&&(t[i]=AAe(r,e))}return t}function pO(){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 nCe(){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),s=function(){throw new Error(ch(15))},o={getState:r.getState,dispatch:function(){return s.apply(void 0,arguments)}},a=e.map(function(l){return l(o)});return s=pO.apply(void 0,a)(r.dispatch),ut(ut({},r),{},{dispatch:s})}}}var YU="NOT_FOUND";function Ayt(n){var e;return{get:function(i){return e&&n(e.key,i)?e.value:YU},put:function(i,r){e={key:i,value:r}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function Nyt(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 YU}function r(a,l){i(a)===YU&&(t.unshift({key:a,value:l}),t.length>n&&t.pop())}function s(){return t}function o(){t=[]}return{get:i,put:r,getEntries:s,clear:o}}var pWe=function(e,t){return e===t};function Dyt(n){return function(t,i){if(t===null||i===null||t.length!==i.length)return!1;for(var r=t.length,s=0;s<r;s++)if(!n(t[s],i[s]))return!1;return!0}}function gWe(n,e){var t=typeof e=="object"?e:{equalityCheck:e},i=t.equalityCheck,r=i===void 0?pWe:i,s=t.maxSize,o=s===void 0?1:s,a=t.resultEqualityCheck,l=Dyt(r),c=o===1?Ayt(l):Nyt(o,l);function u(){var d=c.get(arguments);if(d===YU){if(d=n.apply(null,arguments),a){var f=c.getEntries(),p=f.find(function(g){return a(g.value,d)});p&&(d=p.value)}c.put(arguments,d)}return d}return u.clearCache=function(){return c.clear()},u}function Ryt(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 mWe(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 o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];var c=0,u,d={memoizeOptions:void 0},f=a.pop();if(typeof f=="object"&&(d=f,f=a.pop()),typeof f!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof f+"]");var p=d,g=p.memoizeOptions,m=g===void 0?t:g,_=Array.isArray(m)?m:[m],v=Ryt(a),b=n.apply(void 0,[function(){return c++,f.apply(null,arguments)}].concat(_)),y=n(function(){for(var S=[],k=v.length,I=0;I<k;I++)S.push(v[I].apply(null,arguments));return u=b.apply(null,S),u});return Object.assign(y,{resultFunc:f,memoizedResultFunc:b,dependencies:v,lastResult:function(){return u},recomputations:function(){return c},resetRecomputations:function(){return c=0}}),y};return r}var mZ=mWe(gWe),Pyt=function(e,t){if(t===void 0&&(t=mZ),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(s){return e[s]}),function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return o.reduce(function(l,c,u){return l[i[u]]=c,l},{})});return r};const Oyt=Object.freeze(Object.defineProperty({__proto__:null,createSelector:mZ,createSelectorCreator:mWe,createStructuredSelector:Pyt,defaultEqualityCheck:pWe,defaultMemoize:gWe},Symbol.toStringTag,{value:"Module"}));function _We(n){var e=function(i){var r=i.dispatch,s=i.getState;return function(o){return function(a){return typeof a=="function"?a(r,s,n):o(a)}}};return e}var kde=_We();kde.withExtraArgument=_We;var vWe=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},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)}}(),OB=function(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;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&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=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(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},RE=function(n,e){for(var t=0,i=e.length,r=n.length;t<i;t++,r++)n[r]=e[t];return n},Myt=Object.defineProperty,jyt=Object.defineProperties,Fyt=Object.getOwnPropertyDescriptors,NAe=Object.getOwnPropertySymbols,Byt=Object.prototype.hasOwnProperty,$yt=Object.prototype.propertyIsEnumerable,DAe=function(n,e,t){return e in n?Myt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},Zp=function(n,e){for(var t in e||(e={}))Byt.call(e,t)&&DAe(n,t,e[t]);if(NAe)for(var i=0,r=NAe(e);i<r.length;i++){var t=r[i];$yt.call(e,t)&&DAe(n,t,e[t])}return n},$ie=function(n,e){return jyt(n,Fyt(e))},MB=function(n,e,t){return new Promise(function(i,r){var s=function(l){try{a(t.next(l))}catch(c){r(c)}},o=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(s,o)};a((t=t.apply(n,e)).next())})},cC=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=mZ.apply(void 0,n),i=function(r){for(var s=[],o=1;o<arguments.length;o++)s[o-1]=arguments[o];return t.apply(void 0,RE([K_(r)?eCe(r):r],s))};return i},Hyt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?pO:pO.apply(null,arguments)};function _Z(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 bWe=function(n){return n&&typeof n.match=="function"};function Ly(n,e){function t(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];if(e){var s=e.apply(void 0,i);if(!s)throw new Error("prepareAction did not return an object");return Zp(Zp({type:n,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.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 iCe(n){return _Z(n)&&"type"in n}function Vyt(n){return typeof n=="function"&&"type"in n&&bWe(n)}function yWe(n){return iCe(n)&&typeof n.type=="string"&&Object.keys(n).every(Wyt)}function Wyt(n){return["type","payload","error","meta"].indexOf(n)>-1}function zyt(n){return""+n}function Uyt(n){return function(){return function(e){return function(t){return e(t)}}}}var CWe=function(n){vWe(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,RE([void 0],t[0].concat(this)))):new(e.bind.apply(e,RE([void 0],t.concat(this))))},e}(Array),wWe=function(n){vWe(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,RE([void 0],t[0].concat(this)))):new(e.bind.apply(e,RE([void 0],t.concat(this))))},e}(Array);function Tde(n){return _w(n)?gZ(n,function(){}):n}function qyt(n){return typeof n!="object"||n==null||Object.isFrozen(n)}function Kyt(n){return function(){return function(e){return function(t){return e(t)}}}}function xWe(n){var e=typeof n;return n==null||e==="string"||e==="boolean"||e==="number"||Array.isArray(n)||_Z(n)}function SWe(n,e,t,i,r,s){e===void 0&&(e=""),t===void 0&&(t=xWe),r===void 0&&(r=[]);var o;if(!t(n))return{keyPath:e||"<root>",value:n};if(typeof n!="object"||n===null||s!=null&&s.has(n))return!1;for(var a=i!=null?i(n):Object.entries(n),l=r.length>0,c=function(_,v){var b=e?e+"."+_:_;if(l){var y=r.some(function(C){return C instanceof RegExp?C.test(b):b===C});if(y)return"continue"}if(!t(v))return{value:{keyPath:b,value:v}};if(typeof v=="object"&&(o=SWe(v,b,t,i,r,s),o))return{value:o}},u=0,d=a;u<d.length;u++){var f=d[u],p=f[0],g=f[1],m=c(p,g);if(typeof m=="object")return m.value}return s&&EWe(n)&&s.add(n),!1}function EWe(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)&&!EWe(i))return!1}return!0}function Gyt(n){return function(){return function(e){return function(t){return e(t)}}}}function Yyt(n){return typeof n=="boolean"}function Qyt(){return function(e){return kWe(e)}}function kWe(n){n===void 0&&(n={});var e=n.thunk,t=e===void 0?!0:e;n.immutableCheck,n.serializableCheck,n.actionCreatorCheck;var i=new CWe;return t&&(Yyt(t)?i.push(kde):i.push(kde.withExtraArgument(t.extraArgument))),i}function TWe(n){var e=Qyt(),t=n||{},i=t.reducer,r=i===void 0?void 0:i,s=t.middleware,o=s===void 0?e():s,a=t.devTools,l=a===void 0?!0:a,c=t.preloadedState,u=c===void 0?void 0:c,d=t.enhancers,f=d===void 0?void 0:d,p;if(typeof r=="function")p=r;else if(_Z(r))p=fWe(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=o;typeof g=="function"&&(g=g(e));var m=nCe.apply(void 0,g),_=pO;l&&(_=Hyt(Zp({trace:!1},typeof l=="object"&&l)));var v=new wWe(m),b=v;Array.isArray(f)?b=RE([m],f):typeof f=="function"&&(b=f(v));var y=_.apply(void 0,b);return PB(p,u,y)}function IWe(n){var e={},t=[],i,r={addCase:function(s,o){var a=typeof s=="string"?s:s.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]=o,r},addMatcher:function(s,o){return t.push({matcher:s,reducer:o}),r},addDefaultCase:function(s){return i=s,r}};return n(r),[e,t,i]}function Xyt(n){return typeof n=="function"}function LWe(n,e,t,i){t===void 0&&(t=[]);var r=typeof e=="function"?IWe(e):[e,t,i],s=r[0],o=r[1],a=r[2],l;if(Xyt(n))l=function(){return Tde(n())};else{var c=Tde(n);l=function(){return c}}function u(d,f){d===void 0&&(d=l());var p=RE([s[f.type]],o.filter(function(g){var m=g.matcher;return m(f)}).map(function(g){var m=g.reducer;return m}));return p.filter(function(g){return!!g}).length===0&&(p=[a]),p.reduce(function(g,m){if(m)if(K_(g)){var _=g,v=m(_,f);return v===void 0?g:v}else{if(_w(g))return gZ(g,function(b){return m(b,f)});var v=m(g,f);if(v===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}return g},d)}return u.getInitialState=l,u}function Zyt(n,e){return n+"/"+e}function GM(n){var e=n.name;if(!e)throw new Error("`name` is a required option for createSlice");var t=typeof n.initialState=="function"?n.initialState:Tde(n.initialState),i=n.reducers||{},r=Object.keys(i),s={},o={},a={};r.forEach(function(u){var d=i[u],f=Zyt(e,u),p,g;"reducer"in d?(p=d.reducer,g=d.prepare):p=d,s[u]=p,o[f]=p,a[u]=g?Ly(f,g):Ly(f)});function l(){var u=typeof n.extraReducers=="function"?IWe(n.extraReducers):[n.extraReducers],d=u[0],f=d===void 0?{}:d,p=u[1],g=p===void 0?[]:p,m=u[2],_=m===void 0?void 0:m,v=Zp(Zp({},f),o);return LWe(t,function(b){for(var y in v)b.addCase(y,v[y]);for(var C=0,S=g;C<S.length;C++){var k=S[C];b.addMatcher(k.matcher,k.reducer)}_&&b.addDefaultCase(_)})}var c;return{name:e,reducer:function(u,d){return c||(c=l()),c(u,d)},actions:a,caseReducers:s,getInitialState:function(){return c||(c=l()),c.getInitialState()}}}function Jyt(){return{ids:[],entities:{}}}function e1t(){function n(e){return e===void 0&&(e={}),Object.assign(Jyt(),e)}return{getInitialState:n}}function t1t(){function n(e){var t=function(c){return c.ids},i=function(c){return c.entities},r=cC(t,i,function(c,u){return c.map(function(d){return u[d]})}),s=function(c,u){return u},o=function(c,u){return c[u]},a=cC(t,function(c){return c.length});if(!e)return{selectIds:t,selectEntities:i,selectAll:r,selectTotal:a,selectById:cC(i,s,o)};var l=cC(e,i);return{selectIds:cC(e,t),selectEntities:l,selectAll:cC(e,r),selectTotal:cC(e,a),selectById:cC(l,s,o)}}return{getSelectors:n}}function n1t(n){var e=lu(function(t,i){return n(i)});return function(i){return e(i,void 0)}}function lu(n){return function(t,i){function r(o){return yWe(o)}var s=function(o){r(i)?n(i.payload,o):n(i,o)};return K_(t)?(s(t),t):gZ(t,s)}}function mF(n,e){var t=e(n);return t}function J2(n){return Array.isArray(n)||(n=Object.values(n)),n}function AWe(n,e,t){n=J2(n);for(var i=[],r=[],s=0,o=n;s<o.length;s++){var a=o[s],l=mF(a,e);l in t.entities?r.push({id:l,changes:a}):i.push(a)}return[i,r]}function NWe(n){function e(g,m){var _=mF(g,n);_ in m.entities||(m.ids.push(_),m.entities[_]=g)}function t(g,m){g=J2(g);for(var _=0,v=g;_<v.length;_++){var b=v[_];e(b,m)}}function i(g,m){var _=mF(g,n);_ in m.entities||m.ids.push(_),m.entities[_]=g}function r(g,m){g=J2(g);for(var _=0,v=g;_<v.length;_++){var b=v[_];i(b,m)}}function s(g,m){g=J2(g),m.ids=[],m.entities={},t(g,m)}function o(g,m){return a([g],m)}function a(g,m){var _=!1;g.forEach(function(v){v in m.entities&&(delete m.entities[v],_=!0)}),_&&(m.ids=m.ids.filter(function(v){return v in m.entities}))}function l(g){Object.assign(g,{ids:[],entities:{}})}function c(g,m,_){var v=_.entities[m.id],b=Object.assign({},v,m.changes),y=mF(b,n),C=y!==m.id;return C&&(g[m.id]=y,delete _.entities[m.id]),_.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&&(v[C.id]={id:C.id,changes:Zp(Zp({},v[C.id]?v[C.id].changes:null),C.changes)})}),g=Object.values(v);var b=g.length>0;if(b){var y=g.filter(function(C){return c(_,C,m)}).length>0;y&&(m.ids=Object.keys(m.entities))}}function f(g,m){return p([g],m)}function p(g,m){var _=AWe(g,n,m),v=_[0],b=_[1];d(b,m),t(v,m)}return{removeAll:n1t(l),addOne:lu(e),addMany:lu(t),setOne:lu(i),setMany:lu(r),setAll:lu(s),updateOne:lu(u),updateMany:lu(d),upsertOne:lu(f),upsertMany:lu(p),removeOne:lu(o),removeMany:lu(a)}}function i1t(n,e){var t=NWe(n),i=t.removeOne,r=t.removeMany,s=t.removeAll;function o(b,y){return a([b],y)}function a(b,y){b=J2(b);var C=b.filter(function(S){return!(mF(S,n)in y.entities)});C.length!==0&&_(C,y)}function l(b,y){return c([b],y)}function c(b,y){b=J2(b),b.length!==0&&_(b,y)}function u(b,y){b=J2(b),y.entities={},y.ids=[],a(b,y)}function d(b,y){return f([b],y)}function f(b,y){for(var C=!1,S=0,k=b;S<k.length;S++){var I=k[S],L=y.entities[I.id];if(L){C=!0,Object.assign(L,I.changes);var N=n(L);I.id!==N&&(delete y.entities[I.id],y.entities[N]=L)}}C&&v(y)}function p(b,y){return g([b],y)}function g(b,y){var C=AWe(b,n,y),S=C[0],k=C[1];f(k,y),a(S,y)}function m(b,y){if(b.length!==y.length)return!1;for(var C=0;C<b.length&&C<y.length;C++)if(b[C]!==y[C])return!1;return!0}function _(b,y){b.forEach(function(C){y.entities[n(C)]=C}),v(y)}function v(b){var y=Object.values(b.entities);y.sort(e);var C=y.map(n),S=b.ids;m(S,C)||(b.ids=C)}return{removeOne:i,removeMany:r,removeAll:s,addOne:lu(o),updateOne:lu(d),upsertOne:lu(p),setOne:lu(l),setMany:lu(c),setAll:lu(u),addMany:lu(a),updateMany:lu(f),upsertMany:lu(g)}}function r1t(n){n===void 0&&(n={});var e=Zp({sortComparer:!1,selectId:function(a){return a.id}},n),t=e.selectId,i=e.sortComparer,r=e1t(),s=t1t(),o=i?i1t(t,i):NWe(t);return Zp(Zp(Zp({selectId:t,sortComparer:i},r),s),o)}var s1t="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",rCe=function(n){n===void 0&&(n=21);for(var e="",t=n;t--;)e+=s1t[Math.random()*64|0];return e},o1t=["name","message","stack","code"],Hie=function(){function n(e,t){this.payload=e,this.meta=t}return n}(),RAe=function(){function n(e,t){this.payload=e,this.meta=t}return n}(),DWe=function(n){if(typeof n=="object"&&n!==null){for(var e={},t=0,i=o1t;t<i.length;t++){var r=i[t];typeof n[r]=="string"&&(e[r]=n[r])}return e}return{message:String(n)}},a1t=function(){function n(e,t,i){var r=Ly(e+"/fulfilled",function(c,u,d,f){return{payload:c,meta:$ie(Zp({},f||{}),{arg:d,requestId:u,requestStatus:"fulfilled"})}}),s=Ly(e+"/pending",function(c,u,d){return{payload:void 0,meta:$ie(Zp({},d||{}),{arg:u,requestId:c,requestStatus:"pending"})}}),o=Ly(e+"/rejected",function(c,u,d,f,p){return{payload:f,error:(i&&i.serializeError||DWe)(c||"Rejected"),meta:$ie(Zp({},p||{}),{arg:d,requestId:u,rejectedWithValue:!!f,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,f){var p=i!=null&&i.idGenerator?i.idGenerator(c):rCe(),g=new a,m;function _(b){m=b,g.abort()}var v=function(){return MB(this,null,function(){var b,y,C,S,k,I,L;return OB(this,function(N){switch(N.label){case 0:return N.trys.push([0,4,,5]),S=(b=i==null?void 0:i.condition)==null?void 0:b.call(i,c,{getState:d,extra:f}),l1t(S)?[4,S]:[3,2];case 1:S=N.sent(),N.label=2;case 2:if(S===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return k=new Promise(function(P,O){return g.signal.addEventListener("abort",function(){return O({name:"AbortError",message:m||"Aborted"})})}),u(s(p,c,(y=i==null?void 0:i.getPendingMeta)==null?void 0:y.call(i,{requestId:p,arg:c},{getState:d,extra:f}))),[4,Promise.race([k,Promise.resolve(t(c,{dispatch:u,getState:d,extra:f,requestId:p,signal:g.signal,abort:_,rejectWithValue:function(P,O){return new Hie(P,O)},fulfillWithValue:function(P,O){return new RAe(P,O)}})).then(function(P){if(P instanceof Hie)throw P;return P instanceof RAe?r(P.payload,p,c,P.meta):r(P,p,c)})])];case 3:return C=N.sent(),[3,5];case 4:return I=N.sent(),C=I instanceof Hie?o(null,p,c,I.payload,I.meta):o(I,p,c),[3,5];case 5:return L=i&&!i.dispatchConditionRejection&&o.match(C)&&C.meta.condition,L||u(C),[2,C]}})})}();return Object.assign(v,{abort:_,requestId:p,arg:c,unwrap:function(){return v.then(RWe)}})}}return Object.assign(l,{pending:s,rejected:o,fulfilled:r,typePrefix:e})}return n.withTypes=function(){return n},n}();function RWe(n){if(n.meta&&n.meta.rejectedWithValue)throw n.payload;if(n.error)throw n.error;return n.payload}function l1t(n){return n!==null&&typeof n=="object"&&typeof n.then=="function"}var PWe=function(n,e){return bWe(n)?n.match(e):n(e)};function jB(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return n.some(function(i){return PWe(i,t)})}}function Ide(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return n.every(function(i){return PWe(i,t)})}}function vZ(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 FB(n){return typeof n[0]=="function"&&"pending"in n[0]&&"fulfilled"in n[0]&&"rejected"in n[0]}function OWe(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return vZ(t,["pending"])}:FB(n)?function(t){var i=n.map(function(s){return s.pending}),r=jB.apply(void 0,i);return r(t)}:OWe()(n[0])}function QU(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return vZ(t,["rejected"])}:FB(n)?function(t){var i=n.map(function(s){return s.rejected}),r=jB.apply(void 0,i);return r(t)}:QU()(n[0])}function MWe(){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=Ide(QU.apply(void 0,n),t);return r(i)}:FB(n)?function(i){var r=Ide(QU.apply(void 0,n),t);return r(i)}:MWe()(n[0])}function jWe(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return vZ(t,["fulfilled"])}:FB(n)?function(t){var i=n.map(function(s){return s.fulfilled}),r=jB.apply(void 0,i);return r(t)}:jWe()(n[0])}function FWe(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return vZ(t,["pending","fulfilled","rejected"])}:FB(n)?function(t){for(var i=[],r=0,s=n;r<s.length;r++){var o=s[r];i.push(o.pending,o.rejected,o.fulfilled)}var a=jB.apply(void 0,i);return a(t)}:FWe()(n[0])}var sCe=function(n,e){if(typeof n!="function")throw new TypeError(e+" is not a function")},Lde=function(){},BWe=function(n,e){return e===void 0&&(e=Lde),n.catch(e),n},$We=function(n,e){return n.addEventListener("abort",e,{once:!0}),function(){return n.removeEventListener("abort",e)}},gP=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))},c1t="task",HWe="listener",VWe="completed",oCe="cancelled",u1t="task-"+oCe,d1t="task-"+VWe,WWe=HWe+"-"+oCe,h1t=HWe+"-"+VWe,BB=function(){function n(e){this.code=e,this.name="TaskAbortError",this.message=c1t+" "+oCe+" (reason: "+e+")"}return n}(),mP=function(n){if(n.aborted)throw new BB(n.reason)};function zWe(n,e){var t=Lde;return new Promise(function(i,r){var s=function(){return r(new BB(n.reason))};if(n.aborted){s();return}t=$We(n,s),e.finally(function(){return t()}).then(i,r)}).finally(function(){t=Lde})}var f1t=function(n,e){return MB(void 0,null,function(){var t,i;return OB(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 BB?"cancelled":"rejected",error:i}];case 4:return e==null||e(),[7];case 5:return[2]}})})},XU=function(n){return function(e){return BWe(zWe(n,e).then(function(t){return mP(n),t}))}},UWe=function(n){var e=XU(n);return function(t){return e(new Promise(function(i){return setTimeout(i,t)}))}},p1t=Object.assign,PAe={},$B="listenerMiddleware",g1t=function(n,e){var t=function(i){return $We(n,function(){return gP(i,n.reason)})};return function(i,r){sCe(i,"taskExecutor");var s=new AbortController;t(s);var o=f1t(function(){return MB(void 0,null,function(){var a;return OB(this,function(l){switch(l.label){case 0:return mP(n),mP(s.signal),[4,i({pause:XU(s.signal),delay:UWe(s.signal),signal:s.signal})];case 1:return a=l.sent(),mP(s.signal),[2,a]}})})},function(){return gP(s,d1t)});return r!=null&&r.autoJoin&&e.push(o),{result:XU(n)(o),cancel:function(){gP(s,u1t)}}}},m1t=function(n,e){var t=function(i,r){return MB(void 0,null,function(){var s,o,a,l;return OB(this,function(c){switch(c.label){case 0:mP(e),s=function(){},o=new Promise(function(u,d){var f=n({predicate:i,effect:function(p,g){g.unsubscribe(),u([p,g.getState(),g.getOriginalState()])}});s=function(){f(),d()}}),a=[o],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,zWe(e,Promise.race(a))];case 2:return l=c.sent(),mP(e),[2,l];case 3:return s(),[7];case 4:return[2]}})})};return function(i,r){return BWe(t(i,r))}},qWe=function(n){var e=n.type,t=n.actionCreator,i=n.matcher,r=n.predicate,s=n.effect;if(e)r=Ly(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 sCe(s,"options.listener"),{predicate:r,type:e,effect:s}},_1t=function(n){var e=qWe(n),t=e.type,i=e.predicate,r=e.effect,s=rCe(),o={id:s,effect:r,type:t,predicate:i,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return o},Ade=function(n){n.pending.forEach(function(e){gP(e,WWe)})},v1t=function(n){return function(){n.forEach(Ade),n.clear()}},OAe=function(n,e,t){try{n(e,t)}catch(i){setTimeout(function(){throw i},0)}},KWe=Ly($B+"/add"),GWe=Ly($B+"/removeAll"),YWe=Ly($B+"/remove"),b1t=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,RE([$B+"/error"],n))};function y1t(n){var e=this;n===void 0&&(n={});var t=new Map,i=n.extra,r=n.onError,s=r===void 0?b1t:r;sCe(s,"onError");var o=function(p){return p.unsubscribe=function(){return t.delete(p.id)},t.set(p.id,p),function(g){p.unsubscribe(),g!=null&&g.cancelActive&&Ade(p)}},a=function(p){for(var g=0,m=Array.from(t.values());g<m.length;g++){var _=m[g];if(p(_))return _}},l=function(p){var g=a(function(m){return m.effect===p.effect});return g||(g=_1t(p)),o(g)},c=function(p){var g=qWe(p),m=g.type,_=g.effect,v=g.predicate,b=a(function(y){var C=typeof m=="string"?y.type===m:y.predicate===v;return C&&y.effect===_});return b&&(b.unsubscribe(),p.cancelActive&&Ade(b)),!!b},u=function(p,g,m,_){return MB(e,null,function(){var v,b,y,C;return OB(this,function(S){switch(S.label){case 0:v=new AbortController,b=m1t(l,v.signal),y=[],S.label=1;case 1:return S.trys.push([1,3,4,6]),p.pending.add(v),[4,Promise.resolve(p.effect(g,p1t({},m,{getOriginalState:_,condition:function(k,I){return b(k,I).then(Boolean)},take:b,delay:UWe(v.signal),pause:XU(v.signal),extra:i,signal:v.signal,fork:g1t(v.signal,y),unsubscribe:p.unsubscribe,subscribe:function(){t.set(p.id,p)},cancelActiveListeners:function(){p.pending.forEach(function(k,I,L){k!==v&&(gP(k,WWe),L.delete(k))})}})))];case 2:return S.sent(),[3,6];case 3:return C=S.sent(),C instanceof BB||OAe(s,C,{raisedBy:"effect"}),[3,6];case 4:return[4,Promise.allSettled(y)];case 5:return S.sent(),gP(v,h1t),p.pending.delete(v),[7];case 6:return[2]}})})},d=v1t(t),f=function(p){return function(g){return function(m){if(!iCe(m))return g(m);if(KWe.match(m))return l(m.payload);if(GWe.match(m)){d();return}if(YWe.match(m))return c(m.payload);var _=p.getState(),v=function(){if(_===PAe)throw new Error($B+": getOriginalState can only be called synchronously");return _},b;try{if(b=g(m),t.size>0)for(var y=p.getState(),C=Array.from(t.values()),S=0,k=C;S<k.length;S++){var I=k[S],L=!1;try{L=I.predicate(m,y,_)}catch(N){L=!1,OAe(s,N,{raisedBy:"predicate"})}L&&u(I,m,p,v)}}finally{_=PAe}return b}}};return{middleware:f,startListening:l,stopListening:c,clearListeners:d}}var aCe="RTK_autoBatch",C1t=function(){return function(n){var e;return{payload:n,meta:(e={},e[aCe]=!0,e)}}},MAe,w1t=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(n){return(MAe||(MAe=Promise.resolve())).then(n).catch(function(e){return setTimeout(function(){throw e},0)})},QWe=function(n){return function(e){setTimeout(e,n)}},x1t=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:QWe(10),S1t=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),s=!0,o=!1,a=!1,l=new Set,c=n.type==="tick"?w1t:n.type==="raf"?x1t:n.type==="callback"?n.queueNotification:QWe(n.timeout),u=function(){a=!1,o&&(o=!1,l.forEach(function(d){return d()}))};return Object.assign({},r,{subscribe:function(d){var f=function(){return s&&d()},p=r.subscribe(f);return l.add(d),function(){p(),l.delete(d)}},dispatch:function(d){var f;try{return s=!((f=d==null?void 0:d.meta)!=null&&f[aCe]),o=!s,o&&(a||(a=!0,c(u))),r.dispatch(d)}finally{s=!0}}})}}};wyt();const E1t=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:wWe,MiddlewareArray:CWe,SHOULD_AUTOBATCH:aCe,TaskAbortError:BB,__DO_NOT_USE__ActionTypes:i8,addListener:KWe,applyMiddleware:nCe,autoBatchEnhancer:S1t,bindActionCreators:Ede,clearAllListeners:GWe,combineReducers:fWe,compose:pO,configureStore:TWe,createAction:Ly,createActionCreatorInvariantMiddleware:Uyt,createAsyncThunk:a1t,createDraftSafeSelector:cC,createEntityAdapter:r1t,createImmutableStateInvariantMiddleware:Kyt,createListenerMiddleware:y1t,createNextState:gZ,createReducer:LWe,createSelector:mZ,createSerializableStateInvariantMiddleware:Gyt,createSlice:GM,createStore:PB,current:eCe,findNonSerializableValue:SWe,freeze:pZ,getDefaultMiddleware:kWe,getType:zyt,isAction:iCe,isActionCreator:Vyt,isAllOf:Ide,isAnyOf:jB,isAsyncThunkAction:FWe,isDraft:K_,isFluxStandardAction:yWe,isFulfilled:jWe,isImmutableDefault:qyt,isPending:OWe,isPlain:xWe,isPlainObject:_Z,isRejected:QU,isRejectedWithValue:MWe,legacy_createStore:Iyt,miniSerializeError:DWe,nanoid:rCe,original:_yt,prepareAutoBatched:C1t,removeListener:YWe,unwrapResult:RWe},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 k1t={authenticated:!1,user:{},changes:{}},XWe=GM({name:"user",initialState:k1t,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)=>{pn.set(n.changes,e.payload.property,e.payload.value)},deletePassword:n=>{delete n.changes.password,delete n.user.password}}}),{updateUser:iw,injectInChanges:ZWe,injectInChangesWithData:Mj,resetChanges:rw,authenticate:HB,register:T1t,updateChanges:uA,deletePassword:I1t}=XWe.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 Ml(){return Cu(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 bZ(){return Cu(n=>n.user.changes)}function hv(n){const e=Ml(),t=Fr(),i=bZ();return x.useEffect(()=>{Object.keys(i||{}).length&&!(n!=null&&n.overwrite)||t(ZWe())},[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 ZU={dashboard_charts:{default_view:"month",currency:1,range:"this_month"},datatables:{clients:{sort:"id|desc"}},reports:{columns:{}},auto_expand_product_table_notes:!1,enable_public_notifications:null,use_system_fonts:!1};function Qo(n){var s,o;const e=hv({overwrite:n==null?void 0:n.overwrite}),t=Cu(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:{...(o=(s=e==null?void 0:e.company_user)==null?void 0:s.settings)==null?void 0:o.react_table_columns,...t.react_table_columns},preferences:pn.cloneDeep(ZU)};return pn.merge({...r},{...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 L1t=Ls(null),JWe=Ls([]);function lCe(){const[n,e]=oo(L1t),[,t]=oo(JWe),i=zi(),r=Qo();return A1t(),x.useEffect(()=>{if(!i||!r.preferences.enable_public_notifications||n)return;const s=new myt("f0111a02782708da651f",{cluster:"eu",authEndpoint:YM()+"/broadcasting/auth",forceTLS:!1,wsHost:"socket.invoicing.co",wsPort:6002,enabledTransports:["ws","wss"],auth:{headers:PE()},enableStats:!1,disableStats:!0});return e(s),s.connection.bind("connected",()=>{localStorage.setItem("X-SOCKET-ID",s.connection.socket_id),t(o=>[...o,s])}),()=>{s.disconnect()}},[i,r.preferences.enable_public_notifications]),n}function A1t(){const[n]=oo(JWe);x.useEffect(()=>{const e=setTimeout(()=>(n.length>1&&n.map(t=>{t!==n[n.length-1]&&t.disconnect()}),()=>clearTimeout(e)),5e3)},[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 N1t(){const n=lCe(),e=zi();return x.useEffect(()=>{},[n,e]),null}function cCe({on:n,callback:e}){x.useEffect(()=>{},[n,e])}function D1t(){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 PE(){const n={"X-Api-Token":localStorage.getItem("X-NINJA-TOKEN"),"X-Requested-With":"XMLHttpRequest","X-React":"true"};return D1t()&&To(),n}let R1t={data:""},P1t=n=>typeof window=="object"?((n?n.querySelector("#_goober"):window._goober)||Object.assign((n||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:n||R1t,O1t=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,M1t=/\/\*[^]*?\*\/| +/g,jAe=/\n+/g,_S=(n,e)=>{let t="",i="",r="";for(let s in n){let o=n[s];s[0]=="@"?s[1]=="i"?t=s+" "+o+";":i+=s[1]=="f"?_S(o,s):s+"{"+_S(o,s[1]=="k"?"":e)+"}":typeof o=="object"?i+=_S(o,e?e.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=_S.p?_S.p(s,o):s+":"+o+";")}return t+(e&&r?e+"{"+r+"}":r)+i},tC={},eze=n=>{if(typeof n=="object"){let e="";for(let t in n)e+=t+eze(n[t]);return e}return n},j1t=(n,e,t,i,r)=>{let s=eze(n),o=tC[s]||(tC[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!tC[o]){let l=s!==n?n:(c=>{let u,d,f=[{}];for(;u=O1t.exec(c.replace(M1t,""));)u[4]?f.shift():u[3]?(d=u[3].replace(jAe," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(jAe," ").trim();return f[0]})(n);tC[o]=_S(r?{["@keyframes "+o]:l}:l,t?"":"."+o)}let a=t&&tC.g?tC.g:null;return t&&(tC.g=tC[o]),((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)})(tC[o],e,i,a),o},F1t=(n,e,t)=>n.reduce((i,r,s)=>{let o=e[s];if(o&&o.call){let a=o(t),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":_S(a,""):a===!1?"":a}return i+r+(o??"")},"");function yZ(n){let e=this||{},t=n.call?n(e.p):n;return j1t(t.unshift?t.raw?F1t(t,[].slice.call(arguments,1),e.p):t.reduce((i,r)=>Object.assign(i,r&&r.call?r(e.p):r),{}):t,P1t(e.target),e.g,e.o,e.k)}let tze,Nde,Dde;yZ.bind({g:1});let vw=yZ.bind({k:1});function B1t(n,e,t,i){_S.p=e,tze=n,Nde=t,Dde=i}function fk(n,e){let t=this||{};return function(){let i=arguments;function r(s,o){let a=Object.assign({},s),l=a.className||r.className;t.p=Object.assign({theme:Nde&&Nde()},a),t.o=/ *go\d+/.test(l),a.className=yZ.apply(t,i)+(l?" "+l:"");let c=n;return n[0]&&(c=a.as||n,delete a.as),Dde&&c[0]&&Dde(a),tze(c,a)}return r}}var $1t=n=>typeof n=="function",JU=(n,e)=>$1t(n)?n(e):n,H1t=(()=>{let n=0;return()=>(++n).toString()})(),nze=(()=>{let n;return()=>{if(n===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");n=!e||e.matches}return n}})(),V1t=20,ize=(n,e)=>{switch(e.type){case 0:return{...n,toasts:[e.toast,...n.toasts].slice(0,V1t)};case 1:return{...n,toasts:n.toasts.map(s=>s.id===e.toast.id?{...s,...e.toast}:s)};case 2:let{toast:t}=e;return ize(n,{type:n.toasts.find(s=>s.id===t.id)?1:0,toast:t});case 3:let{toastId:i}=e;return{...n,toasts:n.toasts.map(s=>s.id===i||i===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(s=>s.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(s=>({...s,pauseDuration:s.pauseDuration+r}))}}},az=[],F2={toasts:[],pausedAt:void 0},dA=n=>{F2=ize(F2,n),az.forEach(e=>{e(F2)})},W1t={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},z1t=(n={})=>{let[e,t]=x.useState(F2),i=x.useRef(F2);x.useEffect(()=>(i.current!==F2&&t(F2),az.push(t),()=>{let s=az.indexOf(t);s>-1&&az.splice(s,1)}),[]);let r=e.toasts.map(s=>{var o,a,l;return{...n,...n[s.type],...s,removeDelay:s.removeDelay||((o=n[s.type])==null?void 0:o.removeDelay)||(n==null?void 0:n.removeDelay),duration:s.duration||((a=n[s.type])==null?void 0:a.duration)||(n==null?void 0:n.duration)||W1t[s.type],style:{...n.style,...(l=n[s.type])==null?void 0:l.style,...s.style}}});return{...e,toasts:r}},U1t=(n,e="blank",t)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:e,ariaProps:{role:"status","aria-live":"polite"},message:n,pauseDuration:0,...t,id:(t==null?void 0:t.id)||H1t()}),VB=n=>(e,t)=>{let i=U1t(e,n,t);return dA({type:2,toast:i}),i.id},nd=(n,e)=>VB("blank")(n,e);nd.error=VB("error");nd.success=VB("success");nd.loading=VB("loading");nd.custom=VB("custom");nd.dismiss=n=>{dA({type:3,toastId:n})};nd.remove=n=>dA({type:4,toastId:n});nd.promise=(n,e,t)=>{let i=nd.loading(e.loading,{...t,...t==null?void 0:t.loading});return typeof n=="function"&&(n=n()),n.then(r=>{let s=e.success?JU(e.success,r):void 0;return s?nd.success(s,{id:i,...t,...t==null?void 0:t.success}):nd.dismiss(i),r}).catch(r=>{let s=e.error?JU(e.error,r):void 0;s?nd.error(s,{id:i,...t,...t==null?void 0:t.error}):nd.dismiss(i)}),n};var q1t=(n,e)=>{dA({type:1,toast:{id:n,height:e}})},K1t=()=>{dA({type:5,time:Date.now()})},_F=new Map,G1t=1e3,Y1t=(n,e=G1t)=>{if(_F.has(n))return;let t=setTimeout(()=>{_F.delete(n),dA({type:4,toastId:n})},e);_F.set(n,t)},Q1t=n=>{let{toasts:e,pausedAt:t}=z1t(n);x.useEffect(()=>{if(t)return;let s=Date.now(),o=e.map(a=>{if(a.duration===1/0)return;let l=(a.duration||0)+a.pauseDuration-(s-a.createdAt);if(l<0){a.visible&&nd.dismiss(a.id);return}return setTimeout(()=>nd.dismiss(a.id),l)});return()=>{o.forEach(a=>a&&clearTimeout(a))}},[e,t]);let i=x.useCallback(()=>{t&&dA({type:6,time:Date.now()})},[t]),r=x.useCallback((s,o)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=o||{},u=e.filter(p=>(p.position||c)===(s.position||c)&&p.height),d=u.findIndex(p=>p.id===s.id),f=u.filter((p,g)=>g<d&&p.visible).length;return u.filter(p=>p.visible).slice(...a?[f+1]:[0,f]).reduce((p,g)=>p+(g.height||0)+l,0)},[e]);return x.useEffect(()=>{e.forEach(s=>{if(s.dismissed)Y1t(s.id,s.removeDelay);else{let o=_F.get(s.id);o&&(clearTimeout(o),_F.delete(s.id))}})},[e]),{toasts:e,handlers:{updateHeight:q1t,startPause:K1t,endPause:i,calculateOffset:r}}},X1t=vw` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Z1t=vw` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,J1t=vw` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,eCt=fk("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${n=>n.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${X1t} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${Z1t} 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: ${J1t} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,tCt=vw` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,nCt=fk("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: ${tCt} 1s linear infinite; `,iCt=vw` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,rCt=vw` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,sCt=fk("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${n=>n.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${iCt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${rCt} 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; } `,oCt=fk("div")` position: absolute; `,aCt=fk("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,lCt=vw` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,cCt=fk("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${lCt} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,uCt=({toast:n})=>{let{icon:e,type:t,iconTheme:i}=n;return e!==void 0?typeof e=="string"?x.createElement(cCt,null,e):e:t==="blank"?null:x.createElement(aCt,null,x.createElement(nCt,{...i}),t!=="loading"&&x.createElement(oCt,null,t==="error"?x.createElement(eCt,{...i}):x.createElement(sCt,{...i})))},dCt=n=>` 0% {transform: translate3d(0,${n*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,hCt=n=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${n*-150}%,-1px) scale(.6); opacity:0;} `,fCt="0%{opacity:0;} 100%{opacity:1;}",pCt="0%{opacity:1;} 100%{opacity:0;}",gCt=fk("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; `,mCt=fk("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,_Ct=(n,e)=>{let t=n.includes("top")?1:-1,[i,r]=nze()?[fCt,pCt]:[dCt(t),hCt(t)];return{animation:e?`${vw(i)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${vw(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},vCt=x.memo(({toast:n,position:e,style:t,children:i})=>{let r=n.height?_Ct(n.position||e||"top-center",n.visible):{opacity:0},s=x.createElement(uCt,{toast:n}),o=x.createElement(mCt,{...n.ariaProps},JU(n.message,n));return x.createElement(gCt,{className:n.className,style:{...r,...t,...n.style}},typeof i=="function"?i({icon:s,message:o}):x.createElement(x.Fragment,null,s,o))});B1t(x.createElement);var bCt=({id:n,className:e,style:t,onHeightUpdate:i,children:r})=>{let s=x.useCallback(o=>{if(o){let a=()=>{let l=o.getBoundingClientRect().height;i(n,l)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[n,i]);return x.createElement("div",{ref:s,className:e,style:t},r)},yCt=(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:nze()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(t?1:-1)}px)`,...i,...r}},CCt=yZ` z-index: 9999; > * { pointer-events: auto; } `,AH=16,wCt=({reverseOrder:n,position:e="top-center",toastOptions:t,gutter:i,children:r,containerStyle:s,containerClassName:o})=>{let{toasts:a,handlers:l}=Q1t(t);return x.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:AH,left:AH,right:AH,bottom:AH,pointerEvents:"none",...s},className:o,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(c=>{let u=c.position||e,d=l.calculateOffset(c,{reverseOrder:n,gutter:i,defaultPosition:e}),f=yCt(u,d);return x.createElement(bCt,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?CCt:"",style:f},c.type==="custom"?JU(c.message,c):r?r(c):x.createElement(vCt,{toast:c,position:u}))}))},rze=nd;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 xCt{processing(){return this.currentId=nd.loading(_L("processing",{}),{id:this.currentId}),this}success(e="success",t={}){return this.currentId=nd.success(Ua(e,t),{id:this.currentId}),this}error(e="error_title"){return this.currentId=nd.error(_L(e),{id:this.currentId}),this}dismiss(){return nd.dismiss(this.currentId),this}}const pe=new xCt;function WB(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,fO(n,e)}var zB=function(){function n(){this.listeners=[]}var e=n.prototype;return e.subscribe=function(i){var r=this,s=i||function(){};return this.listeners.push(s),this.onSubscribe(),function(){r.listeners=r.listeners.filter(function(o){return o!==s}),r.onUnsubscribe()}},e.hasListeners=function(){return this.listeners.length>0},e.onSubscribe=function(){},e.onUnsubscribe=function(){},n}(),eq=typeof window>"u";function Zh(){}function SCt(n,e){return typeof n=="function"?n(e):n}function Rde(n){return typeof n=="number"&&n>=0&&n!==1/0}function tq(n){return Array.isArray(n)?n:[n]}function sze(n,e){return Math.max(n+(e||0)-Date.now(),0)}function lz(n,e,t){return CZ(n)?typeof e=="function"?hn({},t,{queryKey:n,queryFn:e}):hn({},e,{queryKey:n}):n}function oS(n,e,t){return CZ(n)?[hn({},e,{queryKey:n}),t]:[n||{},e]}function ECt(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 FAe(n,e){var t=n.active,i=n.exact,r=n.fetching,s=n.inactive,o=n.predicate,a=n.queryKey,l=n.stale;if(CZ(a)){if(i){if(e.queryHash!==uCe(a,e.options))return!1}else if(!nq(e.queryKey,a))return!1}var c=ECt(t,s);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||o&&!o(e))}function BAe(n,e){var t=n.exact,i=n.fetching,r=n.predicate,s=n.mutationKey;if(CZ(s)){if(!e.options.mutationKey)return!1;if(t){if(B2(e.options.mutationKey)!==B2(s))return!1}else if(!nq(e.options.mutationKey,s))return!1}return!(typeof i=="boolean"&&e.state.status==="loading"!==i||r&&!r(e))}function uCe(n,e){var t=(e==null?void 0:e.queryKeyHashFn)||B2;return t(n)}function B2(n){var e=tq(n);return kCt(e)}function kCt(n){return JSON.stringify(n,function(e,t){return Pde(t)?Object.keys(t).sort().reduce(function(i,r){return i[r]=t[r],i},{}):t})}function nq(n,e){return oze(tq(n),tq(e))}function oze(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!oze(n[t],e[t])}):!1}function iq(n,e){if(n===e)return n;var t=Array.isArray(n)&&Array.isArray(e);if(t||Pde(n)&&Pde(e)){for(var i=t?n.length:Object.keys(n).length,r=t?e:Object.keys(e),s=r.length,o=t?[]:{},a=0,l=0;l<s;l++){var c=t?l:r[l];o[c]=iq(n[c],e[c]),o[c]===n[c]&&a++}return i===s&&a===i?n:o}return e}function TCt(n,e){if(n&&!e||e&&!n)return!1;for(var t in n)if(n[t]!==e[t])return!1;return!0}function Pde(n){if(!$Ae(n))return!1;var e=n.constructor;if(typeof e>"u")return!0;var t=e.prototype;return!(!$Ae(t)||!t.hasOwnProperty("isPrototypeOf"))}function $Ae(n){return Object.prototype.toString.call(n)==="[object Object]"}function CZ(n){return typeof n=="string"||Array.isArray(n)}function ICt(n){return new Promise(function(e){setTimeout(e,n)})}function HAe(n){Promise.resolve().then(n).catch(function(e){return setTimeout(function(){throw e})})}function aze(){if(typeof AbortController=="function")return new AbortController}var LCt=function(n){WB(e,n);function e(){var i;return i=n.call(this)||this,i.setup=function(r){var s;if(!eq&&((s=window)!=null&&s.addEventListener)){var o=function(){return r()};return window.addEventListener("visibilitychange",o,!1),window.addEventListener("focus",o,!1),function(){window.removeEventListener("visibilitychange",o),window.removeEventListener("focus",o)}}},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 s,o=this;this.setup=r,(s=this.cleanup)==null||s.call(this),this.cleanup=r(function(a){typeof a=="boolean"?o.setFocused(a):o.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}(zB),vF=new LCt,ACt=function(n){WB(e,n);function e(){var i;return i=n.call(this)||this,i.setup=function(r){var s;if(!eq&&((s=window)!=null&&s.addEventListener)){var o=function(){return r()};return window.addEventListener("online",o,!1),window.addEventListener("offline",o,!1),function(){window.removeEventListener("online",o),window.removeEventListener("offline",o)}}},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 s,o=this;this.setup=r,(s=this.cleanup)==null||s.call(this),this.cleanup=r(function(a){typeof a=="boolean"?o.setOnline(a):o.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}(zB),cz=new ACt;function NCt(n){return Math.min(1e3*Math.pow(2,n),3e4)}function rq(n){return typeof(n==null?void 0:n.cancel)=="function"}var lze=function(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent};function uz(n){return n instanceof lze}var cze=function(e){var t=this,i=!1,r,s,o,a;this.abort=e.abort,this.cancel=function(f){return r==null?void 0:r(f)},this.cancelRetry=function(){i=!0},this.continueRetry=function(){i=!1},this.continue=function(){return s==null?void 0:s()},this.failureCount=0,this.isPaused=!1,this.isResolved=!1,this.isTransportCancelable=!1,this.promise=new Promise(function(f,p){o=f,a=p});var l=function(p){t.isResolved||(t.isResolved=!0,e.onSuccess==null||e.onSuccess(p),s==null||s(),o(p))},c=function(p){t.isResolved||(t.isResolved=!0,e.onError==null||e.onError(p),s==null||s(),a(p))},u=function(){return new Promise(function(p){s=p,t.isPaused=!0,e.onPause==null||e.onPause()}).then(function(){s=void 0,t.isPaused=!1,e.onContinue==null||e.onContinue()})},d=function f(){if(!t.isResolved){var p;try{p=e.fn()}catch(g){p=Promise.reject(g)}r=function(m){if(!t.isResolved&&(c(new lze(m)),t.abort==null||t.abort(),rq(p)))try{p.cancel()}catch{}},t.isTransportCancelable=rq(p),Promise.resolve(p).then(l).catch(function(g){var m,_;if(!t.isResolved){var v=(m=e.retry)!=null?m:3,b=(_=e.retryDelay)!=null?_:NCt,y=typeof b=="function"?b(t.failureCount,g):b,C=v===!0||typeof v=="number"&&t.failureCount<v||typeof v=="function"&&v(t.failureCount,g);if(i||!C){c(g);return}t.failureCount++,e.onFail==null||e.onFail(t.failureCount,g),ICt(y).then(function(){if(!vF.isFocused()||!cz.isOnline())return u()}).then(function(){i?c(g):f()})}})}};d()},DCt=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):HAe(function(){r.notifyFn(i)})},e.batchCalls=function(i){var r=this;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];r.schedule(function(){i.apply(void 0,o)})}},e.flush=function(){var i=this,r=this.queue;this.queue=[],r.length&&HAe(function(){i.batchNotifyFn(function(){r.forEach(function(s){i.notifyFn(s)})})})},e.setNotifyFunction=function(i){this.notifyFn=i},e.setBatchNotifyFunction=function(i){this.batchNotifyFn=i},n}(),Vc=new DCt,uze=console;function sq(){return uze}function RCt(n){uze=n}var PCt=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=hn({},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(),Rde(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 s,o,a=this.state.data,l=SCt(i,a);return(s=(o=this.options).isDataEqual)!=null&&s.call(o,a,l)?l=a:this.options.structuralSharing!==!1&&(l=iq(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,s=this.promise;return(r=this.retryer)==null||r.cancel(i),s?s.then(Zh).catch(Zh):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||!sze(this.state.dataUpdatedAt,i)},e.onFocus=function(){var i,r=this.observers.find(function(s){return s.shouldFetchOnWindowFocus()});r&&r.refetch(),(i=this.retryer)==null||i.continue()},e.onOnline=function(){var i,r=this.observers.find(function(s){return s.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 s=this,o,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=tq(this.queryKey),f=aze(),p={queryKey:d,pageParam:void 0,meta:this.meta};Object.defineProperty(p,"signal",{enumerable:!0,get:function(){if(f)return s.abortSignalConsumed=!0,f.signal}});var g=function(){return s.options.queryFn?(s.abortSignalConsumed=!1,s.options.queryFn(p)):Promise.reject("Missing queryFn")},m={fetchOptions:r,options:this.options,queryKey:d,state:this.state,fetchFn:g,meta:this.meta};if((o=this.options.behavior)!=null&&o.onFetch){var _;(_=this.options.behavior)==null||_.onFetch(m)}if(this.revertState=this.state,!this.state.isFetching||this.state.fetchMeta!==((a=m.fetchOptions)==null?void 0:a.meta)){var v;this.dispatch({type:"fetch",meta:(v=m.fetchOptions)==null?void 0:v.meta})}return this.retryer=new cze({fn:m.fetchFn,abort:f==null||(l=f.abort)==null?void 0:l.bind(f),onSuccess:function(y){s.setData(y),s.cache.config.onSuccess==null||s.cache.config.onSuccess(y,s),s.cacheTime===0&&s.optionalRemove()},onError:function(y){uz(y)&&y.silent||s.dispatch({type:"error",error:y}),uz(y)||(s.cache.config.onError==null||s.cache.config.onError(y,s),sq().error(y)),s.cacheTime===0&&s.optionalRemove()},onFail:function(){s.dispatch({type:"failed"})},onPause:function(){s.dispatch({type:"pause"})},onContinue:function(){s.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),Vc.batch(function(){r.observers.forEach(function(s){s.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,s=typeof i.initialData<"u",o=s?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0,a=typeof r<"u";return{data:r,dataUpdateCount:0,dataUpdatedAt:a?o??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 s,o;switch(r.type){case"failed":return hn({},i,{fetchFailureCount:i.fetchFailureCount+1});case"pause":return hn({},i,{isPaused:!0});case"continue":return hn({},i,{isPaused:!1});case"fetch":return hn({},i,{fetchFailureCount:0,fetchMeta:(s=r.meta)!=null?s:null,isFetching:!0,isPaused:!1},!i.dataUpdatedAt&&{error:null,status:"loading"});case"success":return hn({},i,{data:r.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:(o=r.dataUpdatedAt)!=null?o:Date.now(),error:null,fetchFailureCount:0,isFetching:!1,isInvalidated:!1,isPaused:!1,status:"success"});case"error":var a=r.error;return uz(a)&&a.revert&&this.revertState?hn({},this.revertState):hn({},i,{error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,isFetching:!1,isPaused:!1,status:"error"});case"invalidate":return hn({},i,{isInvalidated:!0});case"setState":return hn({},i,r.state);default:return i}},n}(),OCt=function(n){WB(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,s,o){var a,l=s.queryKey,c=(a=s.queryHash)!=null?a:uCe(l,s),u=this.get(c);return u||(u=new PCt({cache:this,queryKey:l,queryHash:c,options:r.defaultQueryOptions(s),state:o,defaultOptions:r.getQueryDefaults(l),meta:s.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 s=this.queriesMap[r.queryHash];s&&(r.destroy(),this.queries=this.queries.filter(function(o){return o!==r}),s===r&&delete this.queriesMap[r.queryHash],this.notify({type:"queryRemoved",query:r}))},t.clear=function(){var r=this;Vc.batch(function(){r.queries.forEach(function(s){r.remove(s)})})},t.get=function(r){return this.queriesMap[r]},t.getAll=function(){return this.queries},t.find=function(r,s){var o=oS(r,s),a=o[0];return typeof a.exact>"u"&&(a.exact=!0),this.queries.find(function(l){return FAe(a,l)})},t.findAll=function(r,s){var o=oS(r,s),a=o[0];return Object.keys(a).length>0?this.queries.filter(function(l){return FAe(a,l)}):this.queries},t.notify=function(r){var s=this;Vc.batch(function(){s.listeners.forEach(function(o){o(r)})})},t.onFocus=function(){var r=this;Vc.batch(function(){r.queries.forEach(function(s){s.onFocus()})})},t.onOnline=function(){var r=this;Vc.batch(function(){r.queries.forEach(function(s){s.onOnline()})})},e}(zB),MCt=function(){function n(t){this.options=hn({},t.defaultOptions,t.options),this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.observers=[],this.state=t.state||jCt(),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(Zh).catch(Zh)):Promise.resolve()},e.continue=function(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()},e.execute=function(){var i=this,r,s=this.state.status==="loading",o=Promise.resolve();return s||(this.dispatch({type:"loading",variables:this.options.variables}),o=o.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})})),o.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),sq().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 cze({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=FCt(this.state,i),Vc.batch(function(){r.observers.forEach(function(s){s.onMutationUpdate(i)}),r.mutationCache.notify(r)})},n}();function jCt(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}function FCt(n,e){switch(e.type){case"failed":return hn({},n,{failureCount:n.failureCount+1});case"pause":return hn({},n,{isPaused:!0});case"continue":return hn({},n,{isPaused:!1});case"loading":return hn({},n,{context:e.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:e.variables});case"success":return hn({},n,{data:e.data,error:null,status:"success",isPaused:!1});case"error":return hn({},n,{data:void 0,error:e.error,failureCount:n.failureCount+1,isPaused:!1,status:"error"});case"setState":return hn({},n,e.state);default:return n}}var BCt=function(n){WB(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,s,o){var a=new MCt({mutationCache:this,mutationId:++this.mutationId,options:r.defaultMutationOptions(s),state:o,defaultOptions:s.mutationKey?r.getMutationDefaults(s.mutationKey):void 0,meta:s.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(s){return s!==r}),r.cancel(),this.notify(r)},t.clear=function(){var r=this;Vc.batch(function(){r.mutations.forEach(function(s){r.remove(s)})})},t.getAll=function(){return this.mutations},t.find=function(r){return typeof r.exact>"u"&&(r.exact=!0),this.mutations.find(function(s){return BAe(r,s)})},t.findAll=function(r){return this.mutations.filter(function(s){return BAe(r,s)})},t.notify=function(r){var s=this;Vc.batch(function(){s.listeners.forEach(function(o){o(r)})})},t.onFocus=function(){this.resumePausedMutations()},t.onOnline=function(){this.resumePausedMutations()},t.resumePausedMutations=function(){var r=this.mutations.filter(function(s){return s.state.isPaused});return Vc.batch(function(){return r.reduce(function(s,o){return s.then(function(){return o.continue().catch(Zh)})},Promise.resolve())})},e}(zB);function $Ct(){return{onFetch:function(e){e.fetchFn=function(){var t,i,r,s,o,a,l=(t=e.fetchOptions)==null||(i=t.meta)==null?void 0:i.refetchPage,c=(r=e.fetchOptions)==null||(s=r.meta)==null?void 0:s.fetchMore,u=c==null?void 0:c.pageParam,d=(c==null?void 0:c.direction)==="forward",f=(c==null?void 0:c.direction)==="backward",p=((o=e.state.data)==null?void 0:o.pages)||[],g=((a=e.state.data)==null?void 0:a.pageParams)||[],m=aze(),_=m==null?void 0:m.signal,v=g,b=!1,y=e.options.queryFn||function(){return Promise.reject("Missing queryFn")},C=function(M,B,W,q){return v=q?[B].concat(v):[].concat(v,[B]),q?[W].concat(M):[].concat(M,[W])},S=function(M,B,W,q){if(b)return Promise.reject("Cancelled");if(typeof W>"u"&&!B&&M.length)return Promise.resolve(M);var U={queryKey:e.queryKey,signal:_,pageParam:W,meta:e.meta},G=y(U),H=Promise.resolve(G).then(function(Z){return C(M,W,Z,q)});if(rq(G)){var z=H;z.cancel=G.cancel}return H},k;if(!p.length)k=S([]);else if(d){var I=typeof u<"u",L=I?u:VAe(e.options,p);k=S(p,I,L)}else if(f){var N=typeof u<"u",P=N?u:HCt(e.options,p);k=S(p,N,P,!0)}else(function(){v=[];var V=typeof e.options.getNextPageParam>"u",M=l&&p[0]?l(p[0],0,p):!0;k=M?S([],V,g[0]):Promise.resolve(C([],g[0],p[0]));for(var B=function(U){k=k.then(function(G){var H=l&&p[U]?l(p[U],U,p):!0;if(H){var z=V?g[U]:VAe(e.options,G);return S(G,V,z)}return Promise.resolve(C(G,g[U],p[U]))})},W=1;W<p.length;W++)B(W)})();var O=k.then(function(V){return{pages:V,pageParams:v}}),F=O;return F.cancel=function(){b=!0,m==null||m.abort(),rq(k)&&k.cancel()},O}}}}function VAe(n,e){return n.getNextPageParam==null?void 0:n.getNextPageParam(e[e.length-1],e)}function HCt(n,e){return n.getPreviousPageParam==null?void 0:n.getPreviousPageParam(e[0],e)}var VCt=function(){function n(t){t===void 0&&(t={}),this.queryCache=t.queryCache||new OCt,this.mutationCache=t.mutationCache||new BCt,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}var e=n.prototype;return e.mount=function(){var i=this;this.unsubscribeFocus=vF.subscribe(function(){vF.isFocused()&&cz.isOnline()&&(i.mutationCache.onFocus(),i.queryCache.onFocus())}),this.unsubscribeOnline=cz.subscribe(function(){vF.isFocused()&&cz.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 s=oS(i,r),o=s[0];return o.fetching=!0,this.queryCache.findAll(o).length},e.isMutating=function(i){return this.mutationCache.findAll(hn({},i,{fetching:!0})).length},e.getQueryData=function(i,r){var s;return(s=this.queryCache.find(i,r))==null?void 0:s.state.data},e.getQueriesData=function(i){return this.getQueryCache().findAll(i).map(function(r){var s=r.queryKey,o=r.state,a=o.data;return[s,a]})},e.setQueryData=function(i,r,s){var o=lz(i),a=this.defaultQueryOptions(o);return this.queryCache.build(this,a).setData(r,s)},e.setQueriesData=function(i,r,s){var o=this;return Vc.batch(function(){return o.getQueryCache().findAll(i).map(function(a){var l=a.queryKey;return[l,o.setQueryData(l,r,s)]})})},e.getQueryState=function(i,r){var s;return(s=this.queryCache.find(i,r))==null?void 0:s.state},e.removeQueries=function(i,r){var s=oS(i,r),o=s[0],a=this.queryCache;Vc.batch(function(){a.findAll(o).forEach(function(l){a.remove(l)})})},e.resetQueries=function(i,r,s){var o=this,a=oS(i,r,s),l=a[0],c=a[1],u=this.queryCache,d=hn({},l,{active:!0});return Vc.batch(function(){return u.findAll(l).forEach(function(f){f.reset()}),o.refetchQueries(d,c)})},e.cancelQueries=function(i,r,s){var o=this,a=oS(i,r,s),l=a[0],c=a[1],u=c===void 0?{}:c;typeof u.revert>"u"&&(u.revert=!0);var d=Vc.batch(function(){return o.queryCache.findAll(l).map(function(f){return f.cancel(u)})});return Promise.all(d).then(Zh).catch(Zh)},e.invalidateQueries=function(i,r,s){var o,a,l,c=this,u=oS(i,r,s),d=u[0],f=u[1],p=hn({},d,{active:(o=(a=d.refetchActive)!=null?a:d.active)!=null?o:!0,inactive:(l=d.refetchInactive)!=null?l:!1});return Vc.batch(function(){return c.queryCache.findAll(d).forEach(function(g){g.invalidate()}),c.refetchQueries(p,f)})},e.refetchQueries=function(i,r,s){var o=this,a=oS(i,r,s),l=a[0],c=a[1],u=Vc.batch(function(){return o.queryCache.findAll(l).map(function(f){return f.fetch(void 0,hn({},c,{meta:{refetchPage:l==null?void 0:l.refetchPage}}))})}),d=Promise.all(u).then(Zh);return c!=null&&c.throwOnError||(d=d.catch(Zh)),d},e.fetchQuery=function(i,r,s){var o=lz(i,r,s),a=this.defaultQueryOptions(o);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,s){return this.fetchQuery(i,r,s).then(Zh).catch(Zh)},e.fetchInfiniteQuery=function(i,r,s){var o=lz(i,r,s);return o.behavior=$Ct(),this.fetchQuery(o)},e.prefetchInfiniteQuery=function(i,r,s){return this.fetchInfiniteQuery(i,r,s).then(Zh).catch(Zh)},e.cancelMutations=function(){var i=this,r=Vc.batch(function(){return i.mutationCache.getAll().map(function(s){return s.cancel()})});return Promise.all(r).then(Zh).catch(Zh)},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 s=this.queryDefaults.find(function(o){return B2(i)===B2(o.queryKey)});s?s.defaultOptions=r:this.queryDefaults.push({queryKey:i,defaultOptions:r})},e.getQueryDefaults=function(i){var r;return i?(r=this.queryDefaults.find(function(s){return nq(i,s.queryKey)}))==null?void 0:r.defaultOptions:void 0},e.setMutationDefaults=function(i,r){var s=this.mutationDefaults.find(function(o){return B2(i)===B2(o.mutationKey)});s?s.defaultOptions=r:this.mutationDefaults.push({mutationKey:i,defaultOptions:r})},e.getMutationDefaults=function(i){var r;return i?(r=this.mutationDefaults.find(function(s){return nq(i,s.mutationKey)}))==null?void 0:r.defaultOptions:void 0},e.defaultQueryOptions=function(i){if(i!=null&&i._defaulted)return i;var r=hn({},this.defaultOptions.queries,this.getQueryDefaults(i==null?void 0:i.queryKey),i,{_defaulted:!0});return!r.queryHash&&r.queryKey&&(r.queryHash=uCe(r.queryKey,r)),r},e.defaultQueryObserverOptions=function(i){return this.defaultQueryOptions(i)},e.defaultMutationOptions=function(i){return i!=null&&i._defaulted?i:hn({},this.defaultOptions.mutations,this.getMutationDefaults(i==null?void 0:i.mutationKey),i,{_defaulted:!0})},e.clear=function(){this.queryCache.clear(),this.mutationCache.clear()},n}(),WCt=function(n){WB(e,n);function e(i,r){var s;return s=n.call(this)||this,s.client=i,s.options=r,s.trackedProps=[],s.selectError=null,s.bindMethods(),s.setOptions(r),s}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),WAe(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())},t.onUnsubscribe=function(){this.listeners.length||this.destroy()},t.shouldFetchOnReconnect=function(){return Ode(this.currentQuery,this.options,this.options.refetchOnReconnect)},t.shouldFetchOnWindowFocus=function(){return Ode(this.currentQuery,this.options,this.options.refetchOnWindowFocus)},t.destroy=function(){this.listeners=[],this.clearTimers(),this.currentQuery.removeObserver(this)},t.setOptions=function(r,s){var o=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=o.queryKey),this.updateQuery();var l=this.hasListeners();l&&zAe(this.currentQuery,a,this.options,o)&&this.executeFetch(),this.updateResult(s),l&&(this.currentQuery!==a||this.options.enabled!==o.enabled||this.options.staleTime!==o.staleTime)&&this.updateStaleTimeout();var c=this.computeRefetchInterval();l&&(this.currentQuery!==a||this.options.enabled!==o.enabled||c!==this.currentRefetchInterval)&&this.updateRefetchInterval(c)},t.getOptimisticResult=function(r){var s=this.client.defaultQueryObserverOptions(r),o=this.client.getQueryCache().build(this.client,s);return this.createResult(o,s)},t.getCurrentResult=function(){return this.currentResult},t.trackResult=function(r,s){var o=this,a={},l=function(u){o.trackedProps.includes(u)||o.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]}})}),(s.useErrorBoundary||s.suspense)&&l("error"),a},t.getNextResult=function(r){var s=this;return new Promise(function(o,a){var l=s.subscribe(function(c){c.isFetching||(l(),c.isError&&(r!=null&&r.throwOnError)?a(c.error):o(c))})})},t.getCurrentQuery=function(){return this.currentQuery},t.remove=function(){this.client.getQueryCache().remove(this.currentQuery)},t.refetch=function(r){return this.fetch(hn({},r,{meta:{refetchPage:r==null?void 0:r.refetchPage}}))},t.fetchOptimistic=function(r){var s=this,o=this.client.defaultQueryObserverOptions(r),a=this.client.getQueryCache().build(this.client,o);return a.fetch().then(function(){return s.createResult(a,o)})},t.fetch=function(r){var s=this;return this.executeFetch(r).then(function(){return s.updateResult(),s.currentResult})},t.executeFetch=function(r){this.updateQuery();var s=this.currentQuery.fetch(this.options,r);return r!=null&&r.throwOnError||(s=s.catch(Zh)),s},t.updateStaleTimeout=function(){var r=this;if(this.clearStaleTimeout(),!(eq||this.currentResult.isStale||!Rde(this.options.staleTime))){var s=sze(this.currentResult.dataUpdatedAt,this.options.staleTime),o=s+1;this.staleTimeoutId=setTimeout(function(){r.currentResult.isStale||r.updateResult()},o)}},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 s=this;this.clearRefetchInterval(),this.currentRefetchInterval=r,!(eq||this.options.enabled===!1||!Rde(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(function(){(s.options.refetchIntervalInBackground||vF.isFocused())&&s.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,s){var o=this.currentQuery,a=this.options,l=this.currentResult,c=this.currentResultState,u=this.currentResultOptions,d=r!==o,f=d?r.state:this.currentQueryInitialState,p=d?this.currentResult:this.previousQueryResult,g=r.state,m=g.dataUpdatedAt,_=g.error,v=g.errorUpdatedAt,b=g.isFetching,y=g.status,C=!1,S=!1,k;if(s.optimisticResults){var I=this.hasListeners(),L=!I&&WAe(r,s),N=I&&zAe(r,o,s,a);(L||N)&&(b=!0,m||(y="loading"))}if(s.keepPreviousData&&!g.dataUpdateCount&&(p!=null&&p.isSuccess)&&y!=="error")k=p.data,m=p.dataUpdatedAt,y=p.status,C=!0;else if(s.select&&typeof g.data<"u")if(l&&g.data===(c==null?void 0:c.data)&&s.select===this.selectFn)k=this.selectResult;else try{this.selectFn=s.select,k=s.select(g.data),s.structuralSharing!==!1&&(k=iq(l==null?void 0:l.data,k)),this.selectResult=k,this.selectError=null}catch(F){sq().error(F),this.selectError=F}else k=g.data;if(typeof s.placeholderData<"u"&&typeof k>"u"&&(y==="loading"||y==="idle")){var P;if(l!=null&&l.isPlaceholderData&&s.placeholderData===(u==null?void 0:u.placeholderData))P=l.data;else if(P=typeof s.placeholderData=="function"?s.placeholderData():s.placeholderData,s.select&&typeof P<"u")try{P=s.select(P),s.structuralSharing!==!1&&(P=iq(l==null?void 0:l.data,P)),this.selectError=null}catch(F){sq().error(F),this.selectError=F}typeof P<"u"&&(y="success",k=P,S=!0)}this.selectError&&(_=this.selectError,k=this.selectResult,v=Date.now(),y="error");var O={status:y,isLoading:y==="loading",isSuccess:y==="success",isError:y==="error",isIdle:y==="idle",data:k,dataUpdatedAt:m,error:_,errorUpdatedAt:v,failureCount:g.fetchFailureCount,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:b,isRefetching:b&&y!=="loading",isLoadingError:y==="error"&&g.dataUpdatedAt===0,isPlaceholderData:S,isPreviousData:C,isRefetchError:y==="error"&&g.dataUpdatedAt!==0,isStale:dCe(r,s),refetch:this.refetch,remove:this.remove};return O},t.shouldNotifyListeners=function(r,s){if(!s)return!0;var o=this.options,a=o.notifyOnChangeProps,l=o.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,f=r[d]!==s[d],p=c==null?void 0:c.some(function(m){return m===u}),g=l==null?void 0:l.some(function(m){return m===u});return f&&!g&&(!c||p)})},t.updateResult=function(r){var s=this.currentResult;if(this.currentResult=this.createResult(this.currentQuery,this.options),this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!TCt(this.currentResult,s)){var o={cache:!0};(r==null?void 0:r.listeners)!==!1&&this.shouldNotifyListeners(this.currentResult,s)&&(o.listeners=!0),this.notify(hn({},o,r))}},t.updateQuery=function(){var r=this.client.getQueryCache().build(this.client,this.options);if(r!==this.currentQuery){var s=this.currentQuery;this.currentQuery=r,this.currentQueryInitialState=r.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(s==null||s.removeObserver(this),r.addObserver(this))}},t.onQueryUpdate=function(r){var s={};r.type==="success"?s.onSuccess=!0:r.type==="error"&&!uz(r.error)&&(s.onError=!0),this.updateResult(s),this.hasListeners()&&this.updateTimers()},t.notify=function(r){var s=this;Vc.batch(function(){r.onSuccess?(s.options.onSuccess==null||s.options.onSuccess(s.currentResult.data),s.options.onSettled==null||s.options.onSettled(s.currentResult.data,null)):r.onError&&(s.options.onError==null||s.options.onError(s.currentResult.error),s.options.onSettled==null||s.options.onSettled(void 0,s.currentResult.error)),r.listeners&&s.listeners.forEach(function(o){o(s.currentResult)}),r.cache&&s.client.getQueryCache().notify({query:s.currentQuery,type:"observerResultsUpdated"})})},e}(zB);function zCt(n,e){return e.enabled!==!1&&!n.state.dataUpdatedAt&&!(n.state.status==="error"&&e.retryOnMount===!1)}function WAe(n,e){return zCt(n,e)||n.state.dataUpdatedAt>0&&Ode(n,e,e.refetchOnMount)}function Ode(n,e,t){if(e.enabled!==!1){var i=typeof t=="function"?t(n):t;return i==="always"||i!==!1&&dCe(n,e)}return!1}function zAe(n,e,t,i){return t.enabled!==!1&&(n!==e||i.enabled===!1)&&(!t.suspense||n.state.status!=="error")&&dCe(n,t)}function dCe(n,e){return n.isStaleByTime(e.staleTime)}var UCt=J6.unstable_batchedUpdates;Vc.setBatchNotifyFunction(UCt);var qCt=console;RCt(qCt);var UAe=we.createContext(void 0),dze=we.createContext(!1);function hze(n){return n&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=UAe),window.ReactQueryClientContext):UAe}var Vs=function(){var e=we.useContext(hze(we.useContext(dze)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},KCt=function(e){var t=e.client,i=e.contextSharing,r=i===void 0?!1:i,s=e.children;we.useEffect(function(){return t.mount(),function(){t.unmount()}},[t]);var o=hze(r);return we.createElement(dze.Provider,{value:r},we.createElement(o.Provider,{value:t},s))};function GCt(){var n=!1;return{clearReset:function(){n=!1},reset:function(){n=!0},isReset:function(){return n}}}var YCt=we.createContext(GCt()),QCt=function(){return we.useContext(YCt)};function XCt(n,e,t){return typeof e=="function"?e.apply(void 0,t):typeof e=="boolean"?e:!!n}function ZCt(n,e){var t=we.useRef(!1),i=we.useState(0),r=i[1],s=Vs(),o=QCt(),a=s.defaultQueryObserverOptions(n);a.optimisticResults=!0,a.onError&&(a.onError=Vc.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=Vc.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=Vc.batchCalls(a.onSettled)),a.suspense&&(typeof a.staleTime!="number"&&(a.staleTime=1e3),a.cacheTime===0&&(a.cacheTime=1)),(a.suspense||a.useErrorBoundary)&&(o.isReset()||(a.retryOnMount=!1));var l=we.useState(function(){return new e(s,a)}),c=l[0],u=c.getOptimisticResult(a);if(we.useEffect(function(){t.current=!0,o.clearReset();var d=c.subscribe(Vc.batchCalls(function(){t.current&&r(function(f){return f+1})}));return c.updateResult(),function(){t.current=!1,d()}},[o,c]),we.useEffect(function(){c.setOptions(a,{listeners:!1})},[a,c]),a.suspense&&u.isLoading)throw c.fetchOptimistic(a).then(function(d){var f=d.data;a.onSuccess==null||a.onSuccess(f),a.onSettled==null||a.onSettled(f,null)}).catch(function(d){o.clearReset(),a.onError==null||a.onError(d),a.onSettled==null||a.onSettled(void 0,d)});if(u.isError&&!o.isReset()&&!u.isFetching&&XCt(a.suspense,a.useErrorBoundary,[u.error,c.getCurrentQuery()]))throw u.error;return a.notifyOnChangeProps==="tracked"&&(u=c.trackResult(u,a)),u}function lr(n,e,t){var i=lz(n,e,t);return ZCt(i,WCt)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 _P={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","/api/v1/tasks"]},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","/api/v1/clients/show_settings"]},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","/api/v1/activities/entity","/api/v1/charts/totals_v2","/api/v1/charts/chart_summary_v2","/api/v1/activities"]},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","/api/v1/clients/show_settings"]},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"]},entity_validations:{path:"/api/v1/einvoice/validateEntity",dependencies:[]}};function fze(){const n=Vs();return e=>{e.map(t=>{_P[t]&&(n.invalidateQueries(_P[t].path),_P[t].dependencies.map(i=>{n.invalidateQueries(i)}))})}}function ii(n){window.dispatchEvent(new CustomEvent("refetch",{detail:{property:n}}))}function JCt(n){return Object.keys(_P).find(t=>_P[t].path.startsWith(n)||n.startsWith(_P[t].path))}function ewt(n){n.map(e=>{const t=JCt(e);t&&ii([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 hCe(){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 pze=Nc.create();pze.interceptors.response.use(n=>{var i,r;const e=twt(n.config.data),t=n.config.method;return((r=(i=n.config)==null?void 0:i.headers)==null?void 0:r["X-Api-Password"])!==void 0&&window.dispatchEvent(new CustomEvent("reset.password.required")),(t==="put"||t==="post"&&(e==null?void 0:e.action)==="delete"||t==="delete")&&ii(["activities"]),n},n=>{var t,i,r,s,o,a,l,c,u,d,f,p,g,m;const e=(t=n.response)==null?void 0:t.config.url;if(e!=null&&e.includes("einvoice")&&(((i=n.response)==null?void 0:i.status)===401||((r=n.response)==null?void 0:r.status)===403||((s=n.response)==null?void 0:s.status)===404)){console.error(n);return}if(e!=null&&e.endsWith("/api/v1/einvoice/token/update")&&((o=n.response)==null?void 0:o.status)===500)return Promise.reject(n);if(((a=n.response)==null?void 0:a.status)===403){pe.error("unauthorized_action");return}return(((l=n.response)==null?void 0:l.status)===429||((c=n.response)==null?void 0:c.status)===401)&&(window.location.reload(),hCe()),((u=n.response)==null?void 0:u.status)===404&&window.dispatchEvent(new CustomEvent("navigate.invalid.page")),(d=n.response)!=null&&d.status&&n.response.status!==412&&n.response.status!==422&&n.response.status>399&&n.response.status<500&&pe.error(((f=n.response)==null?void 0:f.data.message)||"error_title"),(p=n.response)!=null&&p.status&&n.response.status===500&&pe.error("error_title"),((g=n.response)==null?void 0:g.status)===409&&pe.processing(),((m=n.response)==null?void 0:m.status)===422&&window.dispatchEvent(new CustomEvent("display.error.toaster",{detail:{error:n}})),console.error(n),Promise.reject(n)});function Je(n,e,t,i){return pze({method:n,url:e,data:t,...i,headers:{...PE(),...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 Zc(){const n=zi(),{data:e}=Zd(),[t,i]=x.useState("0"),[r,s]=x.useState("DD/MMM/YYYY");return x.useEffect(()=>{if(e!=null&&e.date_formats){const o=e.date_formats.find(a=>{var l;return a.id===(((l=n==null?void 0:n.settings)==null?void 0:l.date_format_id)??"0")});o&&(s(o.format_moment),i(o.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 To(){return!1}function UB(){return!0}function YM(){return window.location.origin||"https://invoicing.co"}function ze(n,e={}){return YM()+Ut(n,e)}function Vie(...n){return n.filter(Boolean).join(" ")}function so(n,e){return n===0||n===""||n===void 0?"":typeof n=="number"?Jn.unix(n).format(e):Jn(n).format(e)}function b3r(){const{dateFormat:n}=Zc(),e=["DD. MMM. YYYY","ddd MMM D, YYYY"];return t=>Jn(t,e.includes(n)?void 0:n)}function hs(n){if(!n.is_deleted&&!n.archived_at)return kie.active;if(n.archived_at&&!n.is_deleted)return kie.archived;if(n.is_deleted)return kie.deleted}function Ua(n,e){let t=_L(n);for(const i in e)t=t.replace(`:${i}`,e[i]);return t}function y3r(n,e={}){return YM()+Ut(n,e)}function bw(){return"https://demo.invoiceninja.com"===YM()}function twt(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 Zd(){return lr(["/api/v1/statics"],()=>Je("GET",ze("/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 wZ(){const{data:n}=Zd(),[e,t]=x.useState([]);return x.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 gze(){const n=wZ();return e=>n.find(t=>t.id.toString()===e.toString())}function Na(n,e){if(n==null)return{};var t,i,r=V1e(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function nwt(){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 qAe={};function Mde(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];typeof e[0]=="string"&&qAe[e[0]]||(typeof e[0]=="string"&&(qAe[e[0]]=new Date),nwt.apply(void 0,e))}var mze=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 KAe(n,e,t){n.loadNamespaces(e,mze(n,t))}function GAe(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,mze(n,i))}function iwt(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=e.languages[0],r=e.options?e.options.fallbackLng:!1,s=e.languages[e.languages.length-1];if(i.toLowerCase()==="cimode")return!0;var o=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&&!o(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(i,n)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||o(i,n)&&(!r||o(s,n)))}function rwt(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return Mde("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(s,o){if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!o(s.isLanguageChangingTo,n))return!1}}):iwt(n,e,t)}var swt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,owt={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},awt=function(e){return owt[e]},lwt=function(e){return e.replace(swt,awt)};function YAe(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 QAe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?YAe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):YAe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var jde={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:lwt};function cwt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jde=QAe(QAe({},jde),n)}function uwt(){return jde}var _ze;function dwt(n){_ze=n}function hwt(){return _ze}var fwt={type:"3rdParty",init:function(e){cwt(e.options.react),dwt(e)}},pwt=x.createContext(),gwt=function(){function n(){Ra(this,n),this.usedNamespaces={}}return Pa(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 mwt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(i=s.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&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}function Mt(n,e){return IVe(n)||mwt(n,e)||z1e(n,e)||AVe()}function XAe(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 Wie(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?XAe(Object(t),!0).forEach(function(i){wt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):XAe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var _wt=function(e,t){var i=x.useRef();return x.useEffect(function(){i.current=e},[e,t]),i.current};function xe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.i18n,i=x.useContext(pwt)||{},r=i.i18n,s=i.defaultNS,o=t||r||hwt();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new gwt),!o){Mde("You will need to pass in an i18next instance by using initReactI18next");var a=function(N,P){return typeof P=="string"?P:P&&Mr(P)==="object"&&typeof P.defaultValue=="string"?P.defaultValue:Array.isArray(N)?N[N.length-1]:N},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}o.options.react&&o.options.react.wait!==void 0&&Mde("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=Wie(Wie(Wie({},uwt()),o.options.react),e),u=c.useSuspense,d=c.keyPrefix,f=s||o.options&&o.options.defaultNS;f=typeof f=="string"?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(f);var p=(o.isInitialized||o.initializedStoreOnce)&&f.every(function(L){return rwt(L,o,c)});function g(){return o.getFixedT(e.lng||null,c.nsMode==="fallback"?f:f[0],d)}var m=x.useState(g),_=Mt(m,2),v=_[0],b=_[1],y=f.join();e.lng&&(y="".concat(e.lng).concat(y));var C=_wt(y),S=x.useRef(!0);x.useEffect(function(){var L=c.bindI18n,N=c.bindI18nStore;S.current=!0,!p&&!u&&(e.lng?GAe(o,e.lng,f,function(){S.current&&b(g)}):KAe(o,f,function(){S.current&&b(g)})),p&&C&&C!==y&&S.current&&b(g);function P(){S.current&&b(g)}return L&&o&&o.on(L,P),N&&o&&o.store.on(N,P),function(){S.current=!1,L&&o&&L.split(" ").forEach(function(O){return o.off(O,P)}),N&&o&&N.split(" ").forEach(function(O){return o.store.off(O,P)})}},[o,y]);var k=x.useRef(!0);x.useEffect(function(){S.current&&!k.current&&b(g),k.current=!1},[o,d]);var I=[v,o,p];if(I.t=v,I.i18n=o,I.ready=p,p||!p&&!u)return I;throw new Promise(function(L){e.lng?GAe(o,e.lng,f,function(){return L()}):KAe(o,f,function(){return L()})})}const vwt="modulepreload",bwt=function(n){return"/"+n},ZAe={},ue=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(t.map(l=>{if(l=bwt(l),l in ZAe)return;ZAe[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":vwt,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};/** * @remix-run/router v1.23.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 r8(){return r8=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},r8.apply(this,arguments)}var AS;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(AS||(AS={}));const JAe="popstate";function ywt(n){n===void 0&&(n={});function e(i,r){let{pathname:s,search:o,hash:a}=i.location;return Fde("",{pathname:s,search:o,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function t(i,r){return typeof r=="string"?r:oq(r)}return wwt(e,t,null,n)}function qc(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function fCe(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Cwt(){return Math.random().toString(36).substr(2,8)}function eNe(n,e){return{usr:n.state,key:n.key,idx:e}}function Fde(n,e,t,i){return t===void 0&&(t=null),r8({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?QM(e):e,{state:t,key:e&&e.key||i||Cwt()})}function oq(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 QM(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 wwt(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,a=AS.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(r8({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function d(){a=AS.Pop;let _=u(),v=_==null?null:_-c;c=_,l&&l({action:a,location:m.location,delta:v})}function f(_,v){a=AS.Push;let b=Fde(m.location,_,v);c=u()+1;let y=eNe(b,c),C=m.createHref(b);try{o.pushState(y,"",C)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;r.location.assign(C)}s&&l&&l({action:a,location:m.location,delta:1})}function p(_,v){a=AS.Replace;let b=Fde(m.location,_,v);c=u();let y=eNe(b,c),C=m.createHref(b);o.replaceState(y,"",C),s&&l&&l({action:a,location:m.location,delta:0})}function g(_){let v=r.location.origin!=="null"?r.location.origin:r.location.href,b=typeof _=="string"?_:oq(_);return b=b.replace(/ $/,"%20"),qc(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let m={get action(){return a},get location(){return n(r,o)},listen(_){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(JAe,d),l=_,()=>{r.removeEventListener(JAe,d),l=null}},createHref(_){return e(r,_)},createURL:g,encodeLocation(_){let v=g(_);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:p,go(_){return o.go(_)}};return m}var tNe;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(tNe||(tNe={}));function xwt(n,e,t){return t===void 0&&(t="/"),Swt(n,e,t)}function Swt(n,e,t,i){let r=typeof e=="string"?QM(e):e,s=pCe(r.pathname||"/",t);if(s==null)return null;let o=vze(n);Ewt(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=jwt(s);a=Pwt(o[l],c)}return a}function vze(n,e,t,i){e===void 0&&(e=[]),t===void 0&&(t=[]),i===void 0&&(i="");let r=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(qc(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=QS([i,l.relativePath]),u=t.concat(l);s.children&&s.children.length>0&&(qc(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),vze(s.children,e,u,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:Dwt(c,s.index),routesMeta:u})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))r(s,o);else for(let l of bze(s.path))r(s,o,l)}),e}function bze(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),s=t.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=bze(i.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),r&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function Ewt(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:Rwt(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const kwt=/^:[\w-]+$/,Twt=3,Iwt=2,Lwt=1,Awt=10,Nwt=-2,nNe=n=>n==="*";function Dwt(n,e){let t=n.split("/"),i=t.length;return t.some(nNe)&&(i+=Nwt),e&&(i+=Iwt),t.filter(r=>!nNe(r)).reduce((r,s)=>r+(kwt.test(s)?Twt:s===""?Lwt:Awt),i)}function Rwt(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 Pwt(n,e,t){let{routesMeta:i}=n,r={},s="/",o=[];for(let a=0;a<i.length;++a){let l=i[a],c=a===i.length-1,u=s==="/"?e:e.slice(s.length)||"/",d=Owt({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:QS([s,d.pathname]),pathnameBase:Hwt(QS([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=QS([s,d.pathnameBase]))}return o}function C3r(n,e){e===void 0&&(e={});let t=n;t.endsWith("*")&&t!=="*"&&!t.endsWith("/*")&&(fCe(!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=o=>o==null?"":typeof o=="string"?o:String(o),s=t.split(/\/+/).map((o,a,l)=>{if(a===l.length-1&&o==="*")return r(e["*"]);const u=o.match(/^:([\w-]+)(\??)$/);if(u){const[,d,f]=u;let p=e[d];return qc(f==="?"||p!=null,'Missing ":'+d+'" param'),r(p)}return o.replace(/\?$/g,"")}).filter(o=>!!o);return i+s.join("/")}function Owt(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,i]=Mwt(n.path,n.caseSensitive,n.end),r=e.match(t);if(!r)return null;let s=r[0],o=s.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:i.reduce((c,u,d)=>{let{paramName:f,isOptional:p}=u;if(f==="*"){let m=a[d]||"";o=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const g=a[d];return p&&!g?c[f]=void 0:c[f]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:n}}function Mwt(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),fCe(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,(o,a,l)=>(i.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function jwt(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return fCe(!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 pCe(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 Fwt(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?QM(n):n;return{pathname:t?t.startsWith("/")?t:Bwt(t,e):e,search:Vwt(i),hash:Wwt(r)}}function Bwt(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 zie(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 $wt(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function gCe(n,e){let t=$wt(n);return e?t.map((i,r)=>r===t.length-1?i.pathname:i.pathnameBase):t.map(i=>i.pathnameBase)}function mCe(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=QM(n):(r=r8({},n),qc(!r.pathname||!r.pathname.includes("?"),zie("?","pathname","search",r)),qc(!r.pathname||!r.pathname.includes("#"),zie("#","pathname","hash",r)),qc(!r.search||!r.search.includes("#"),zie("#","search","hash",r)));let s=n===""||r.pathname==="",o=s?"/":r.pathname,a;if(o==null)a=t;else{let d=e.length-1;if(!i&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}a=d>=0?e[d]:"/"}let l=Fwt(r,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const QS=n=>n.join("/").replace(/\/\/+/g,"/"),Hwt=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Vwt=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Wwt=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function zwt(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const yze=["post","put","patch","delete"];new Set(yze);const Uwt=["get",...yze];new Set(Uwt);/** * React Router v6.30.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 s8(){return s8=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},s8.apply(this,arguments)}const _Ce=x.createContext(null),qwt=x.createContext(null),pk=x.createContext(null),xZ=x.createContext(null),i1=x.createContext({outlet:null,matches:[],isDataRoute:!1}),Cze=x.createContext(null);function Kwt(n,e){let{relative:t}=e===void 0?{}:e;XM()||qc(!1);let{basename:i,navigator:r}=x.useContext(pk),{hash:s,pathname:o,search:a}=Eze(n,{relative:t}),l=o;return i!=="/"&&(l=o==="/"?i:QS([i,o])),r.createHref({pathname:l,search:a,hash:s})}function XM(){return x.useContext(xZ)!=null}function gc(){return XM()||qc(!1),x.useContext(xZ).location}function wze(n){x.useContext(pk).static||x.useLayoutEffect(n)}function Yi(){let{isDataRoute:n}=x.useContext(i1);return n?axt():Gwt()}function Gwt(){XM()||qc(!1);let n=x.useContext(_Ce),{basename:e,future:t,navigator:i}=x.useContext(pk),{matches:r}=x.useContext(i1),{pathname:s}=gc(),o=JSON.stringify(gCe(r,t.v7_relativeSplatPath)),a=x.useRef(!1);return wze(()=>{a.current=!0}),x.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){i.go(c);return}let d=mCe(c,JSON.parse(o),s,u.relative==="path");n==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:QS([e,d.pathname])),(u.replace?i.replace:i.push)(d,u.state,u)},[e,i,o,s,n])}const xze=x.createContext(null);function Sze(){return x.useContext(xze)}function Ywt(n){let e=x.useContext(i1).outlet;return e&&x.createElement(xze.Provider,{value:n},e)}function Yl(){let{matches:n}=x.useContext(i1),e=n[n.length-1];return e?e.params:{}}function Eze(n,e){let{relative:t}=e===void 0?{}:e,{future:i}=x.useContext(pk),{matches:r}=x.useContext(i1),{pathname:s}=gc(),o=JSON.stringify(gCe(r,i.v7_relativeSplatPath));return x.useMemo(()=>mCe(n,JSON.parse(o),s,t==="path"),[n,o,s,t])}function Qwt(n,e){return Xwt(n,e)}function Xwt(n,e,t,i){XM()||qc(!1);let{navigator:r,static:s}=x.useContext(pk),{matches:o}=x.useContext(i1),a=o[o.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=gc(),d;if(e){var f;let v=typeof e=="string"?QM(e):e;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||qc(!1),d=v}else d=u;let p=d.pathname||"/",g=p;if(c!=="/"){let v=c.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=xwt(n,{pathname:g}),_=nxt(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:QS([c,r.encodeLocation?r.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:QS([c,r.encodeLocation?r.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,t,i);return e&&_?x.createElement(xZ.Provider,{value:{location:s8({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:AS.Pop}},_):_}function Zwt(){let n=oxt(),e=zwt(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)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},e),t?x.createElement("pre",{style:r},t):null,null)}const Jwt=x.createElement(Zwt,null);class ext extends x.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!==void 0?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!==void 0?x.createElement(i1.Provider,{value:this.props.routeContext},x.createElement(Cze.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function txt(n){let{routeContext:e,match:t,children:i}=n,r=x.useContext(_Ce);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(i1.Provider,{value:e},i)}function nxt(n,e,t,i){var r;if(e===void 0&&(e=[]),t===void 0&&(t=null),i===void 0&&(i=null),n==null){var s;if(!t)return null;if(t.errors)n=t.matches;else if((s=i)!=null&&s.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let o=n,a=(r=t)==null?void 0:r.errors;if(a!=null){let u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||qc(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(t&&i&&i.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:f,errors:p}=t,g=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||g){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let p,g=!1,m=null,_=null;t&&(p=a&&d.route.id?a[d.route.id]:void 0,m=d.route.errorElement||Jwt,l&&(c<0&&f===0?(lxt("route-fallback"),g=!0,_=null):c===f&&(g=!0,_=d.route.hydrateFallbackElement||null)));let v=e.concat(o.slice(0,f+1)),b=()=>{let y;return p?y=m:g?y=_:d.route.Component?y=x.createElement(d.route.Component,null):d.route.element?y=d.route.element:y=u,x.createElement(txt,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:t!=null},children:y})};return t&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?x.createElement(ext,{location:t.location,revalidation:t.revalidation,component:m,error:p,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var kze=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(kze||{}),Tze=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}(Tze||{});function ixt(n){let e=x.useContext(_Ce);return e||qc(!1),e}function rxt(n){let e=x.useContext(qwt);return e||qc(!1),e}function sxt(n){let e=x.useContext(i1);return e||qc(!1),e}function Ize(n){let e=sxt(),t=e.matches[e.matches.length-1];return t.route.id||qc(!1),t.route.id}function oxt(){var n;let e=x.useContext(Cze),t=rxt(),i=Ize();return e!==void 0?e:(n=t.errors)==null?void 0:n[i]}function axt(){let{router:n}=ixt(kze.UseNavigateStable),e=Ize(Tze.UseNavigateStable),t=x.useRef(!1);return wze(()=>{t.current=!0}),x.useCallback(function(r,s){s===void 0&&(s={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,s8({fromRouteId:e},s)))},[n,e])}const iNe={};function lxt(n,e,t){iNe[n]||(iNe[n]=!0)}function cxt(n,e){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function OE(n){let{to:e,replace:t,state:i,relative:r}=n;XM()||qc(!1);let{future:s,static:o}=x.useContext(pk),{matches:a}=x.useContext(i1),{pathname:l}=gc(),c=Yi(),u=mCe(e,gCe(a,s.v7_relativeSplatPath),l,r==="path"),d=JSON.stringify(u);return x.useEffect(()=>c(JSON.parse(d),{replace:t,state:i,relative:r}),[c,d,r,t,i]),null}function Hm(n){return Ywt(n.context)}function Ee(n){qc(!1)}function uxt(n){let{basename:e="/",children:t=null,location:i,navigationType:r=AS.Pop,navigator:s,static:o=!1,future:a}=n;XM()&&qc(!1);let l=e.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:l,navigator:s,static:o,future:s8({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof i=="string"&&(i=QM(i));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:g="default"}=i,m=x.useMemo(()=>{let _=pCe(u,l);return _==null?null:{location:{pathname:_,search:d,hash:f,state:p,key:g},navigationType:r}},[l,u,d,f,p,g,r]);return m==null?null:x.createElement(pk.Provider,{value:c},x.createElement(xZ.Provider,{children:t,value:m}))}function dxt(n){let{children:e,location:t}=n;return Qwt(Bde(e),t)}new Promise(()=>{});function Bde(n,e){e===void 0&&(e=[]);let t=[];return x.Children.forEach(n,(i,r)=>{if(!x.isValidElement(i))return;let s=[...e,r];if(i.type===x.Fragment){t.push.apply(t,Bde(i.props.children,s));return}i.type!==Ee&&qc(!1),!i.props.index||!i.props.children||qc(!1);let o={id:i.props.id||s.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&&(o.children=Bde(i.props.children,s)),t.push(o)}),t}/** * React Router DOM v6.30.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 $de(){return $de=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},$de.apply(this,arguments)}function hxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function fxt(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function pxt(n,e){return n.button===0&&(!e||e==="_self")&&!fxt(n)}function Hde(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 gxt(n,e){let t=Hde(n);return e&&e.forEach((i,r)=>{t.has(r)||e.getAll(r).forEach(s=>{t.append(r,s)})}),t}const mxt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_xt="6";try{window.__reactRouterVersion=_xt}catch{}const vxt="startTransition",rNe=q_[vxt];function bxt(n){let{basename:e,children:t,future:i,window:r}=n,s=x.useRef();s.current==null&&(s.current=ywt({window:r,v5Compat:!0}));let o=s.current,[a,l]=x.useState({action:o.action,location:o.location}),{v7_startTransition:c}=i||{},u=x.useCallback(d=>{c&&rNe?rNe(()=>l(d)):l(d)},[l,c]);return x.useLayoutEffect(()=>o.listen(u),[o,u]),x.useEffect(()=>cxt(i),[i]),x.createElement(uxt,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,future:i})}const yxt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Cxt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,r1=x.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d}=e,f=hxt(e,mxt),{basename:p}=x.useContext(pk),g,m=!1;if(typeof c=="string"&&Cxt.test(c)&&(g=c,yxt))try{let y=new URL(window.location.href),C=c.startsWith("//")?new URL(y.protocol+c):new URL(c),S=pCe(C.pathname,p);C.origin===y.origin&&S!=null?c=S+C.search+C.hash:m=!0}catch{}let _=Kwt(c,{relative:r}),v=wxt(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:r,viewTransition:d});function b(y){i&&i(y),y.defaultPrevented||v(y)}return x.createElement("a",$de({},f,{href:g||_,onClick:m||s?i:b,ref:t,target:l}))});var sNe;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(sNe||(sNe={}));var oNe;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(oNe||(oNe={}));function wxt(n,e){let{target:t,replace:i,state:r,preventScrollReset:s,relative:o,viewTransition:a}=e===void 0?{}:e,l=Yi(),c=gc(),u=Eze(n,{relative:o});return x.useCallback(d=>{if(pxt(d,t)){d.preventDefault();let f=i!==void 0?i:oq(c)===oq(u);l(n,{replace:f,state:r,preventScrollReset:s,relative:o,viewTransition:a})}},[c,l,u,i,r,t,n,s,o,a])}function qB(n){let e=x.useRef(Hde(n)),t=x.useRef(!1),i=gc(),r=x.useMemo(()=>gxt(i.search,t.current?null:e.current),[i.search]),s=Yi(),o=x.useCallback((a,l)=>{const c=Hde(typeof a=="function"?a(r):a);t.current=!0,s("?"+c,l)},[s,r]);return[r,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 */const xxt={currentIndex:localStorage.getItem("X-CURRENT-INDEX")?parseInt(localStorage.getItem("X-CURRENT-INDEX")):0,api:{},changes:{company:void 0}},Lze=GM({name:"companyUser",initialState:xxt,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]=pn.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:SZ,updateCompanyUsers:s1,injectInChanges:ME,resetChanges:zu,updateChanges:Uo,updateRecord:gk}=Lze.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 ZM=(n=>(n.TOKEN="invoiceninja_token",n.GOOGLE_SSO="google_sso",n))(ZM||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function vCe(){const n=Cu(s=>s.user),e=localStorage.getItem("X-NINJA-TOKEN"),t=Yi(),i=Fr(),r=Vs();return e===null?!1:(n.authenticated||r.fetchQuery("/api/v1/refresh",()=>Je("POST",ze("/api/v1/refresh?updated_at=:updatedAt",{updatedAt:Jn().unix()})).then(s=>{let o=0;if(localStorage.getItem("X-CURRENT-INDEX"))o=parseInt(localStorage.getItem("X-CURRENT-INDEX")||"0");else{const a=s.data.data,l=a[0].account.default_company_id;o=a.findIndex(c=>c.company.id===l)||0}o===-1&&(o=0),i(HB({type:ZM.TOKEN,user:s.data.data[o].user,token:localStorage.getItem("X-NINJA-TOKEN")})),i(s1(s.data.data)),i(zu("company")),i(SZ(o))}).catch(s=>{console.error(s),localStorage.removeItem("X-NINJA-TOKEN"),t("/login")})),!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 Aze={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",$14:"#121212",$15:"#323236",$16:"#A1A1AA",$17:"#9D9DA8",$18:"#FFFFFF",$19:"#323236",$20:"#323236",$21:"#1f2e41",$22:"#a1a1aa",$23:"#121212",$24:"#323236",$25:"#1f2e41"},Nze={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",$14:"#27272A",$15:"#E4E4E7",$16:"#717179",$17:"#A1A1AA",$18:"#27272A",$19:"#09090B12",$20:"#09090B13",$21:"#09090B1A",$22:"#717179",$23:"#F4F4F5",$24:"#09090B26",$25:"#09090B0D"};function xt(){return Qo({overwrite:!1}).dark_mode?Aze:Nze}function yo(n){const e=xt();return h.jsxs("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:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("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 Sxt(){return h.jsx("div",{className:"flex items-center justify-center h-screen",children:h.jsx(yo,{variant:"dark"})})}var Uie={exports:{}},qie,aNe;function Ext(){if(aNe)return qie;aNe=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return qie=n,qie}var Kie,lNe;function kxt(){if(lNe)return Kie;lNe=1;var n=Ext();function e(){}function t(){}return t.resetWarningCache=e,Kie=function(){function i(o,a,l,c,u,d){if(d!==n){var f=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 f.name="Invariant Violation",f}}i.isRequired=i;function r(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:r,element:i,elementType:i,instanceOf:r,node:i,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},Kie}var cNe;function bCe(){return cNe||(cNe=1,Uie.exports=kxt()()),Uie.exports}var Vn=bCe();const nn=Cl(Vn);function Vde(){return Vde=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},Vde.apply(this,arguments)}function Txt(n,e){if(n==null)return{};var t=Ixt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Ixt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var yCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Txt(n,["color","size"]);return we.createElement("svg",Vde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"}))});yCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};yCe.displayName="Activity";function Wde(){return Wde=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},Wde.apply(this,arguments)}function Lxt(n,e){if(n==null)return{};var t=Axt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Axt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var EZ=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Lxt(n,["color","size"]);return we.createElement("svg",Wde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.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"}),we.createElement("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),we.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))});EZ.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};EZ.displayName="AlertTriangle";function zde(){return zde=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},zde.apply(this,arguments)}function Nxt(n,e){if(n==null)return{};var t=Dxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Dxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var CCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Nxt(n,["color","size"]);return we.createElement("svg",zde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("line",{x1:"21",y1:"10",x2:"3",y2:"10"}),we.createElement("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),we.createElement("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),we.createElement("line",{x1:"21",y1:"18",x2:"3",y2:"18"}))});CCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};CCe.displayName="AlignJustify";function Ude(){return Ude=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},Ude.apply(this,arguments)}function Rxt(n,e){if(n==null)return{};var t=Pxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Pxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var wCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Rxt(n,["color","size"]);return we.createElement("svg",Ude({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),we.createElement("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"}))});wCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};wCe.displayName="Bell";function qde(){return qde=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},qde.apply(this,arguments)}function Oxt(n,e){if(n==null)return{};var t=Mxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Mxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var xCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Oxt(n,["color","size"]);return we.createElement("svg",qde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),we.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"}))});xCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};xCe.displayName="Book";function Kde(){return Kde=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},Kde.apply(this,arguments)}function jxt(n,e){if(n==null)return{};var t=Fxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Fxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var SCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=jxt(n,["color","size"]);return we.createElement("svg",Kde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),we.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),we.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),we.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"}))});SCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};SCe.displayName="Calendar";function Gde(){return Gde=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},Gde.apply(this,arguments)}function Bxt(n,e){if(n==null)return{};var t=$xt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function $xt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var bF=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Bxt(n,["color","size"]);return we.createElement("svg",Gde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),we.createElement("polyline",{points:"22 4 12 14.01 9 11.01"}))});bF.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};bF.displayName="CheckCircle";function Yde(){return Yde=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},Yde.apply(this,arguments)}function Hxt(n,e){if(n==null)return{};var t=Vxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Vxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var o8=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Hxt(n,["color","size"]);return we.createElement("svg",Yde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("polyline",{points:"20 6 9 17 4 12"}))});o8.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};o8.displayName="Check";function Qde(){return Qde=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},Qde.apply(this,arguments)}function Wxt(n,e){if(n==null)return{};var t=zxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function zxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var kZ=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Wxt(n,["color","size"]);return we.createElement("svg",Qde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("polyline",{points:"6 9 12 15 18 9"}))});kZ.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};kZ.displayName="ChevronDown";function Xde(){return Xde=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},Xde.apply(this,arguments)}function Uxt(n,e){if(n==null)return{};var t=qxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function qxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ECe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Uxt(n,["color","size"]);return we.createElement("svg",Xde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("polyline",{points:"18 15 12 9 6 15"}))});ECe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};ECe.displayName="ChevronUp";function Zde(){return Zde=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},Zde.apply(this,arguments)}function Kxt(n,e){if(n==null)return{};var t=Gxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Gxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var kCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Kxt(n,["color","size"]);return we.createElement("svg",Zde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("polyline",{points:"8 17 12 21 16 17"}),we.createElement("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),we.createElement("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"}))});kCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};kCe.displayName="DownloadCloud";function Jde(){return Jde=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},Jde.apply(this,arguments)}function Yxt(n,e){if(n==null)return{};var t=Qxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Qxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var TZ=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Yxt(n,["color","size"]);return we.createElement("svg",Jde({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),we.createElement("polyline",{points:"15 3 21 3 21 9"}),we.createElement("line",{x1:"10",y1:"14",x2:"21",y2:"3"}))});TZ.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};TZ.displayName="ExternalLink";function ehe(){return ehe=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},ehe.apply(this,arguments)}function Xxt(n,e){if(n==null)return{};var t=Zxt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Zxt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var TCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Xxt(n,["color","size"]);return we.createElement("svg",ehe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"}))});TCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};TCe.displayName="Facebook";function the(){return the=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},the.apply(this,arguments)}function Jxt(n,e){if(n==null)return{};var t=eSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function eSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var jE=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=Jxt(n,["color","size"]);return we.createElement("svg",the({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),we.createElement("polyline",{points:"14 2 14 8 20 8"}),we.createElement("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),we.createElement("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),we.createElement("polyline",{points:"10 9 9 9 8 9"}))});jE.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};jE.displayName="FileText";function nhe(){return nhe=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},nhe.apply(this,arguments)}function tSt(n,e){if(n==null)return{};var t=nSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function nSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var IZ=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=tSt(n,["color","size"]);return we.createElement("svg",nhe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),we.createElement("polyline",{points:"13 2 13 9 20 9"}))});IZ.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};IZ.displayName="File";function ihe(){return ihe=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},ihe.apply(this,arguments)}function iSt(n,e){if(n==null)return{};var t=rSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function rSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ICe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=iSt(n,["color","size"]);return we.createElement("svg",ihe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.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"}))});ICe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};ICe.displayName="GitHub";function rhe(){return rhe=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},rhe.apply(this,arguments)}function sSt(n,e){if(n==null)return{};var t=oSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function oSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var aq=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=sSt(n,["color","size"]);return we.createElement("svg",rhe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("circle",{cx:"12",cy:"12",r:"10"}),we.createElement("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),we.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))});aq.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};aq.displayName="HelpCircle";function she(){return she=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},she.apply(this,arguments)}function aSt(n,e){if(n==null)return{};var t=lSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function lSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var LCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=aSt(n,["color","size"]);return we.createElement("svg",she({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),we.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),we.createElement("polyline",{points:"21 15 16 10 5 21"}))});LCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};LCe.displayName="Image";function ohe(){return ohe=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},ohe.apply(this,arguments)}function cSt(n,e){if(n==null)return{};var t=uSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function uSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ACe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=cSt(n,["color","size"]);return we.createElement("svg",ohe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("circle",{cx:"12",cy:"12",r:"10"}),we.createElement("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),we.createElement("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"}))});ACe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};ACe.displayName="Info";function ahe(){return ahe=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},ahe.apply(this,arguments)}function dSt(n,e){if(n==null)return{};var t=hSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function hSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var NCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=dSt(n,["color","size"]);return we.createElement("svg",ahe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("polygon",{points:"12 2 2 7 12 12 22 7 12 2"}),we.createElement("polyline",{points:"2 17 12 22 22 17"}),we.createElement("polyline",{points:"2 12 12 17 22 12"}))});NCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};NCe.displayName="Layers";function lhe(){return lhe=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},lhe.apply(this,arguments)}function fSt(n,e){if(n==null)return{};var t=pSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function pSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var DCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=fSt(n,["color","size"]);return we.createElement("svg",lhe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),we.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}))});DCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};DCe.displayName="Lock";function che(){return che=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},che.apply(this,arguments)}function gSt(n,e){if(n==null)return{};var t=mSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function mSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var RCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=gSt(n,["color","size"]);return we.createElement("svg",che({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),we.createElement("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),we.createElement("line",{x1:"3",y1:"18",x2:"21",y2:"18"}))});RCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};RCe.displayName="Menu";function uhe(){return uhe=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},uhe.apply(this,arguments)}function _St(n,e){if(n==null)return{};var t=vSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function vSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var PCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=_St(n,["color","size"]);return we.createElement("svg",uhe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),we.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))});PCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};PCe.displayName="Plus";function dhe(){return dhe=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},dhe.apply(this,arguments)}function bSt(n,e){if(n==null)return{};var t=ySt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function ySt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var LZ=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=bSt(n,["color","size"]);return we.createElement("svg",dhe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("polyline",{points:"17 1 21 5 17 9"}),we.createElement("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),we.createElement("polyline",{points:"7 23 3 19 7 15"}),we.createElement("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}))});LZ.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};LZ.displayName="Repeat";function hhe(){return hhe=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},hhe.apply(this,arguments)}function CSt(n,e){if(n==null)return{};var t=wSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function wSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var AZ=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=CSt(n,["color","size"]);return we.createElement("svg",hhe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("circle",{cx:"12",cy:"12",r:"3"}),we.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"}))});AZ.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};AZ.displayName="Settings";function fhe(){return fhe=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},fhe.apply(this,arguments)}function xSt(n,e){if(n==null)return{};var t=SSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function SSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var OCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=xSt(n,["color","size"]);return we.createElement("svg",fhe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.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"}),we.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"}),we.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"}),we.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"}),we.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"}),we.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"}),we.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"}),we.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"}))});OCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};OCe.displayName="Slack";function phe(){return phe=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},phe.apply(this,arguments)}function ESt(n,e){if(n==null)return{};var t=kSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function kSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var MCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=ESt(n,["color","size"]);return we.createElement("svg",phe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),we.createElement("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"}))});MCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};MCe.displayName="Smartphone";function ghe(){return ghe=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},ghe.apply(this,arguments)}function TSt(n,e){if(n==null)return{};var t=ISt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function ISt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var jCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=TSt(n,["color","size"]);return we.createElement("svg",ghe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("polyline",{points:"3 6 5 6 21 6"}),we.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"}),we.createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),we.createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"}))});jCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};jCe.displayName="Trash2";function mhe(){return mhe=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},mhe.apply(this,arguments)}function LSt(n,e){if(n==null)return{};var t=ASt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function ASt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var FCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=LSt(n,["color","size"]);return we.createElement("svg",mhe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.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"}))});FCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};FCe.displayName="Twitter";function _he(){return _he=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},_he.apply(this,arguments)}function NSt(n,e){if(n==null)return{};var t=DSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function DSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var JM=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=NSt(n,["color","size"]);return we.createElement("svg",_he({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),we.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))});JM.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};JM.displayName="X";function vhe(){return vhe=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},vhe.apply(this,arguments)}function RSt(n,e){if(n==null)return{};var t=PSt(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function PSt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var BCe=x.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,s=r===void 0?24:r,o=RSt(n,["color","size"]);return we.createElement("svg",vhe({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),we.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"}),we.createElement("polygon",{points:"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"}))});BCe.propTypes={color:nn.string,size:nn.oneOfType([nn.string,nn.number])};BCe.displayName="Youtube";var Gie={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */var uNe;function OSt(){return uNe||(uNe=1,function(n){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=r(s,i(a)))}return s}function i(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)e.call(s,a)&&s[a]&&(o=r(o,a));return o}function r(s,o){return o?s?s+" "+o:s+o:s}n.exports?(t.default=t,n.exports=t):window.classNames=t})()}(Gie)),Gie.exports}var MSt=OSt();const $t=Cl(MSt);/** * 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 Dze={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 Lo(){var t,i,r,s,o;const n=Ml();return((r=(i=(t=Cu(a=>a.user).changes)==null?void 0:t.company_user)==null?void 0:i.settings)==null?void 0:r.accent_color)||((o=(s=n==null?void 0:n.company_user)==null?void 0:s.settings)==null?void 0:o.accent_color)||Dze.accent}var Jp=function(){return Jp=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Jp.apply(this,arguments)};function lq(n,e,t){if(t||arguments.length===2)for(var i=0,r=e.length,s;i<r;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return n.concat(s||Array.prototype.slice.call(e))}var Jl="-ms-",yF="-moz-",za="-webkit-",Rze="comm",NZ="rule",$Ce="decl",jSt="@import",Pze="@keyframes",FSt="@layer",Oze=Math.abs,HCe=String.fromCharCode,bhe=Object.assign;function BSt(n,e){return Bd(n,0)^45?(((e<<2^Bd(n,0))<<2^Bd(n,1))<<2^Bd(n,2))<<2^Bd(n,3):0}function Mze(n){return n.trim()}function hC(n,e){return(n=e.exec(n))?n[0]:n}function co(n,e,t){return n.replace(e,t)}function dz(n,e,t){return n.indexOf(e,t)}function Bd(n,e){return n.charCodeAt(e)|0}function gO(n,e,t){return n.slice(e,t)}function ey(n){return n.length}function jze(n){return n.length}function jj(n,e){return e.push(n),n}function $St(n,e){return n.map(e).join("")}function dNe(n,e){return n.filter(function(t){return!hC(t,e)})}var DZ=1,mO=1,Fze=0,G_=0,Ou=0,e4="";function RZ(n,e,t,i,r,s,o,a){return{value:n,root:e,parent:t,type:i,props:r,children:s,line:DZ,column:mO,length:o,return:"",siblings:a}}function Xx(n,e){return bhe(RZ("",null,null,"",null,null,0,n.siblings),n,{length:-n.length},e)}function pD(n){for(;n.root;)n=Xx(n.root,{children:[n]});jj(n,n.siblings)}function HSt(){return Ou}function VSt(){return Ou=G_>0?Bd(e4,--G_):0,mO--,Ou===10&&(mO=1,DZ--),Ou}function Cb(){return Ou=G_<Fze?Bd(e4,G_++):0,mO++,Ou===10&&(mO=1,DZ++),Ou}function eI(){return Bd(e4,G_)}function hz(){return G_}function PZ(n,e){return gO(e4,n,e)}function yhe(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 WSt(n){return DZ=mO=1,Fze=ey(e4=n),G_=0,[]}function zSt(n){return e4="",n}function Yie(n){return Mze(PZ(G_-1,Che(n===91?n+2:n===40?n+1:n)))}function USt(n){for(;(Ou=eI())&&Ou<33;)Cb();return yhe(n)>2||yhe(Ou)>3?"":" "}function qSt(n,e){for(;--e&&Cb()&&!(Ou<48||Ou>102||Ou>57&&Ou<65||Ou>70&&Ou<97););return PZ(n,hz()+(e<6&&eI()==32&&Cb()==32))}function Che(n){for(;Cb();)switch(Ou){case n:return G_;case 34:case 39:n!==34&&n!==39&&Che(Ou);break;case 40:n===41&&Che(n);break;case 92:Cb();break}return G_}function KSt(n,e){for(;Cb()&&n+Ou!==57;)if(n+Ou===84&&eI()===47)break;return"/*"+PZ(e,G_-1)+"*"+HCe(n===47?n:Cb())}function GSt(n){for(;!yhe(eI());)Cb();return PZ(n,G_)}function YSt(n){return zSt(fz("",null,null,null,[""],n=WSt(n),0,[0],n))}function fz(n,e,t,i,r,s,o,a,l){for(var c=0,u=0,d=o,f=0,p=0,g=0,m=1,_=1,v=1,b=0,y="",C=r,S=s,k=i,I=y;_;)switch(g=b,b=Cb()){case 40:if(g!=108&&Bd(I,d-1)==58){dz(I+=co(Yie(b),"&","&\f"),"&\f",Oze(c?a[c-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:I+=Yie(b);break;case 9:case 10:case 13:case 32:I+=USt(g);break;case 92:I+=qSt(hz()-1,7);continue;case 47:switch(eI()){case 42:case 47:jj(QSt(KSt(Cb(),hz()),e,t,l),l);break;default:I+="/"}break;case 123*m:a[c++]=ey(I)*v;case 125*m:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:v==-1&&(I=co(I,/\f/g,"")),p>0&&ey(I)-d&&jj(p>32?fNe(I+";",i,t,d-1,l):fNe(co(I," ","")+";",i,t,d-2,l),l);break;case 59:I+=";";default:if(jj(k=hNe(I,e,t,c,u,r,a,y,C=[],S=[],d,s),s),b===123)if(u===0)fz(I,e,k,k,C,s,d,a,S);else switch(f===99&&Bd(I,3)===110?100:f){case 100:case 108:case 109:case 115:fz(n,k,k,i&&jj(hNe(n,k,k,0,0,r,a,y,r,C=[],d,S),S),r,S,d,a,i?C:S);break;default:fz(I,k,k,k,[""],S,0,a,S)}}c=u=p=0,m=v=1,y=I="",d=o;break;case 58:d=1+ey(I),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&VSt()==125)continue}switch(I+=HCe(b),b*m){case 38:v=u>0?1:(I+="\f",-1);break;case 44:a[c++]=(ey(I)-1)*v,v=1;break;case 64:eI()===45&&(I+=Yie(Cb())),f=eI(),u=d=ey(y=I+=GSt(hz())),b++;break;case 45:g===45&&ey(I)==2&&(m=0)}}return s}function hNe(n,e,t,i,r,s,o,a,l,c,u,d){for(var f=r-1,p=r===0?s:[""],g=jze(p),m=0,_=0,v=0;m<i;++m)for(var b=0,y=gO(n,f+1,f=Oze(_=o[m])),C=n;b<g;++b)(C=Mze(_>0?p[b]+" "+y:co(y,/&\f/g,p[b])))&&(l[v++]=C);return RZ(n,e,t,r===0?NZ:a,l,c,u,d)}function QSt(n,e,t,i){return RZ(n,e,t,Rze,HCe(HSt()),gO(n,2,-2),0,i)}function fNe(n,e,t,i,r){return RZ(n,e,t,$Ce,gO(n,0,i),gO(n,i+1,-1),i,r)}function Bze(n,e,t){switch(BSt(n,e)){case 5103:return za+"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 za+n+n;case 4789:return yF+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return za+n+yF+n+Jl+n+n;case 5936:switch(Bd(n,e+11)){case 114:return za+n+Jl+co(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return za+n+Jl+co(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return za+n+Jl+co(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return za+n+Jl+n+n;case 6165:return za+n+Jl+"flex-"+n+n;case 5187:return za+n+co(n,/(\w+).+(:[^]+)/,za+"box-$1$2"+Jl+"flex-$1$2")+n;case 5443:return za+n+Jl+"flex-item-"+co(n,/flex-|-self/g,"")+(hC(n,/flex-|baseline/)?"":Jl+"grid-row-"+co(n,/flex-|-self/g,""))+n;case 4675:return za+n+Jl+"flex-line-pack"+co(n,/align-content|flex-|-self/g,"")+n;case 5548:return za+n+Jl+co(n,"shrink","negative")+n;case 5292:return za+n+Jl+co(n,"basis","preferred-size")+n;case 6060:return za+"box-"+co(n,"-grow","")+za+n+Jl+co(n,"grow","positive")+n;case 4554:return za+co(n,/([^-])(transform)/g,"$1"+za+"$2")+n;case 6187:return co(co(co(n,/(zoom-|grab)/,za+"$1"),/(image-set)/,za+"$1"),n,"")+n;case 5495:case 3959:return co(n,/(image-set\([^]*)/,za+"$1$`$1");case 4968:return co(co(n,/(.+:)(flex-)?(.*)/,za+"box-pack:$3"+Jl+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+za+n+n;case 4200:if(!hC(n,/flex-|baseline/))return Jl+"grid-column-align"+gO(n,e)+n;break;case 2592:case 3360:return Jl+co(n,"template-","")+n;case 4384:case 3616:return t&&t.some(function(i,r){return e=r,hC(i.props,/grid-\w+-end/)})?~dz(n+(t=t[e].value),"span",0)?n:Jl+co(n,"-start","")+n+Jl+"grid-row-span:"+(~dz(t,"span",0)?hC(t,/\d+/):+hC(t,/\d+/)-+hC(n,/\d+/))+";":Jl+co(n,"-start","")+n;case 4896:case 4128:return t&&t.some(function(i){return hC(i.props,/grid-\w+-start/)})?n:Jl+co(co(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return co(n,/(.+)-inline(.+)/,za+"$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(ey(n)-1-e>6)switch(Bd(n,e+1)){case 109:if(Bd(n,e+4)!==45)break;case 102:return co(n,/(.+:)(.+)-([^]+)/,"$1"+za+"$2-$3$1"+yF+(Bd(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~dz(n,"stretch",0)?Bze(co(n,"stretch","fill-available"),e,t)+n:n}break;case 5152:case 5920:return co(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(i,r,s,o,a,l,c){return Jl+r+":"+s+c+(o?Jl+r+"-span:"+(a?l:+l-+s)+c:"")+n});case 4949:if(Bd(n,e+6)===121)return co(n,":",":"+za)+n;break;case 6444:switch(Bd(n,Bd(n,14)===45?18:11)){case 120:return co(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+za+(Bd(n,14)===45?"inline-":"")+"box$3$1"+za+"$2$3$1"+Jl+"$2box$3")+n;case 100:return co(n,":",":"+Jl)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return co(n,"scroll-","scroll-snap-")+n}return n}function cq(n,e){for(var t="",i=0;i<n.length;i++)t+=e(n[i],i,n,e)||"";return t}function XSt(n,e,t,i){switch(n.type){case FSt:if(n.children.length)break;case jSt:case $Ce:return n.return=n.return||n.value;case Rze:return"";case Pze:return n.return=n.value+"{"+cq(n.children,i)+"}";case NZ:if(!ey(n.value=n.props.join(",")))return""}return ey(t=cq(n.children,i))?n.return=n.value+"{"+t+"}":""}function ZSt(n){var e=jze(n);return function(t,i,r,s){for(var o="",a=0;a<e;a++)o+=n[a](t,i,r,s)||"";return o}}function JSt(n){return function(e){e.root||(e=e.return)&&n(e)}}function eEt(n,e,t,i){if(n.length>-1&&!n.return)switch(n.type){case $Ce:n.return=Bze(n.value,n.length,t);return;case Pze:return cq([Xx(n,{value:co(n.value,"@","@"+za)})],i);case NZ:if(n.length)return $St(t=n.props,function(r){switch(hC(r,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":pD(Xx(n,{props:[co(r,/:(read-\w+)/,":"+yF+"$1")]})),pD(Xx(n,{props:[r]})),bhe(n,{props:dNe(t,i)});break;case"::placeholder":pD(Xx(n,{props:[co(r,/:(plac\w+)/,":"+za+"input-$1")]})),pD(Xx(n,{props:[co(r,/:(plac\w+)/,":"+yF+"$1")]})),pD(Xx(n,{props:[co(r,/:(plac\w+)/,Jl+"input-$1")]})),pD(Xx(n,{props:[r]})),bhe(n,{props:dNe(t,i)});break}return""})}}var tEt={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},Jg={},_O=typeof process<"u"&&Jg!==void 0&&(Jg.REACT_APP_SC_ATTR||Jg.SC_ATTR)||"data-styled",$ze="active",Hze="data-styled-version",OZ="6.1.15",VCe=`/*!sc*/ `,uq=typeof window<"u"&&"HTMLElement"in window,nEt=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Jg!==void 0&&Jg.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Jg.REACT_APP_SC_DISABLE_SPEEDY!==""?Jg.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Jg.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Jg!==void 0&&Jg.SC_DISABLE_SPEEDY!==void 0&&Jg.SC_DISABLE_SPEEDY!==""&&Jg.SC_DISABLE_SPEEDY!=="false"&&Jg.SC_DISABLE_SPEEDY),MZ=Object.freeze([]),vO=Object.freeze({});function iEt(n,e,t){return t===void 0&&(t=vO),n.theme!==t.theme&&n.theme||e||t.theme}var Vze=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"]),rEt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,sEt=/(^-|-$)/g;function pNe(n){return n.replace(rEt,"-").replace(sEt,"")}var oEt=/(a)(d)/gi,NH=52,gNe=function(n){return String.fromCharCode(n+(n>25?39:97))};function whe(n){var e,t="";for(e=Math.abs(n);e>NH;e=e/NH|0)t=gNe(e%NH)+t;return(gNe(e%NH)+t).replace(oEt,"$1-$2")}var Qie,Wze=5381,hR=function(n,e){for(var t=e.length;t;)n=33*n^e.charCodeAt(--t);return n},zze=function(n){return hR(Wze,n)};function aEt(n){return whe(zze(n)>>>0)}function lEt(n){return n.displayName||n.name||"Component"}function Xie(n){return typeof n=="string"&&!0}var Uze=typeof Symbol=="function"&&Symbol.for,qze=Uze?Symbol.for("react.memo"):60115,cEt=Uze?Symbol.for("react.forward_ref"):60112,uEt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},dEt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Kze={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},hEt=((Qie={})[cEt]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Qie[qze]=Kze,Qie);function mNe(n){return("type"in(e=n)&&e.type.$$typeof)===qze?Kze:"$$typeof"in n?hEt[n.$$typeof]:uEt;var e}var fEt=Object.defineProperty,pEt=Object.getOwnPropertyNames,_Ne=Object.getOwnPropertySymbols,gEt=Object.getOwnPropertyDescriptor,mEt=Object.getPrototypeOf,vNe=Object.prototype;function Gze(n,e,t){if(typeof e!="string"){if(vNe){var i=mEt(e);i&&i!==vNe&&Gze(n,i,t)}var r=pEt(e);_Ne&&(r=r.concat(_Ne(e)));for(var s=mNe(n),o=mNe(e),a=0;a<r.length;++a){var l=r[a];if(!(l in dEt||t&&t[l]||o&&l in o||s&&l in s)){var c=gEt(e,l);try{fEt(n,l,c)}catch{}}}}return n}function bO(n){return typeof n=="function"}function WCe(n){return typeof n=="object"&&"styledComponentId"in n}function $2(n,e){return n&&e?"".concat(n," ").concat(e):n||e||""}function bNe(n,e){if(n.length===0)return"";for(var t=n[0],i=1;i<n.length;i++)t+=n[i];return t}function a8(n){return n!==null&&typeof n=="object"&&n.constructor.name===Object.name&&!("props"in n&&n.$$typeof)}function xhe(n,e,t){if(t===void 0&&(t=!1),!t&&!a8(n)&&!Array.isArray(n))return e;if(Array.isArray(e))for(var i=0;i<e.length;i++)n[i]=xhe(n[i],e[i]);else if(a8(e))for(var i in e)n[i]=xhe(n[i],e[i]);return n}function zCe(n,e){Object.defineProperty(n,"toString",{value:e})}function KB(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 _Et=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,s=r;e>=s;)if((s<<=1)<0)throw KB(16,"".concat(e));this.groupSizes=new Uint32Array(s),this.groupSizes.set(i),this.length=s;for(var o=r;o<s;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(e+1),l=(o=0,t.length);o<l;o++)this.tag.insertRule(a,t[o])&&(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 s=i;s<r;s++)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),s=r+i,o=r;o<s;o++)t+="".concat(this.tag.getRule(o)).concat(VCe);return t},n}(),pz=new Map,dq=new Map,gz=1,DH=function(n){if(pz.has(n))return pz.get(n);for(;dq.has(gz);)gz++;var e=gz++;return pz.set(n,e),dq.set(e,n),e},vEt=function(n,e){gz=e+1,pz.set(n,e),dq.set(e,n)},bEt="style[".concat(_O,"][").concat(Hze,'="').concat(OZ,'"]'),yEt=new RegExp("^".concat(_O,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),CEt=function(n,e,t){for(var i,r=t.split(","),s=0,o=r.length;s<o;s++)(i=r[s])&&n.registerName(e,i)},wEt=function(n,e){for(var t,i=((t=e.textContent)!==null&&t!==void 0?t:"").split(VCe),r=[],s=0,o=i.length;s<o;s++){var a=i[s].trim();if(a){var l=a.match(yEt);if(l){var c=0|parseInt(l[1],10),u=l[2];c!==0&&(vEt(u,c),CEt(n,u,l[3]),n.getTag().insertRules(c,r)),r.length=0}else r.push(a)}}},yNe=function(n){for(var e=document.querySelectorAll(bEt),t=0,i=e.length;t<i;t++){var r=e[t];r&&r.getAttribute(_O)!==$ze&&(wEt(n,r),r.parentNode&&r.parentNode.removeChild(r))}};function xEt(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Yze=function(n){var e=document.head,t=n||e,i=document.createElement("style"),r=function(a){var l=Array.from(a.querySelectorAll("style[".concat(_O,"]")));return l[l.length-1]}(t),s=r!==void 0?r.nextSibling:null;i.setAttribute(_O,$ze),i.setAttribute(Hze,OZ);var o=xEt();return o&&i.setAttribute("nonce",o),t.insertBefore(i,s),i},SEt=function(){function n(e){this.element=Yze(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var i=document.styleSheets,r=0,s=i.length;r<s;r++){var o=i[r];if(o.ownerNode===t)return o}throw KB(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}(),EEt=function(){function n(e){this.element=Yze(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}(),kEt=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}(),CNe=uq,TEt={isServer:!uq,useCSSOMInjection:!nEt},Qze=function(){function n(e,t,i){e===void 0&&(e=vO),t===void 0&&(t={});var r=this;this.options=Jp(Jp({},TEt),e),this.gs=t,this.names=new Map(i),this.server=!!e.isServer,!this.server&&uq&&CNe&&(CNe=!1,yNe(this)),zCe(this,function(){return function(s){for(var o=s.getTag(),a=o.length,l="",c=function(d){var f=function(v){return dq.get(v)}(d);if(f===void 0)return"continue";var p=s.names.get(f),g=o.getGroup(d);if(p===void 0||!p.size||g.length===0)return"continue";var m="".concat(_O,".g").concat(d,'[id="').concat(f,'"]'),_="";p!==void 0&&p.forEach(function(v){v.length>0&&(_+="".concat(v,","))}),l+="".concat(g).concat(m,'{content:"').concat(_,'"}').concat(VCe)},u=0;u<a;u++)c(u);return l}(r)})}return n.registerId=function(e){return DH(e)},n.prototype.rehydrate=function(){!this.server&&uq&&yNe(this)},n.prototype.reconstructWithOptions=function(e,t){return t===void 0&&(t=!0),new n(Jp(Jp({},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 kEt(r):i?new SEt(r):new EEt(r)}(this.options),new _Et(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(DH(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(DH(e),i)},n.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},n.prototype.clearRules=function(e){this.getTag().clearGroup(DH(e)),this.clearNames(e)},n.prototype.clearTag=function(){this.tag=void 0},n}(),IEt=/&/g,LEt=/^\s*\/\/.*$/gm;function Xze(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=Xze(t.children,e)),t})}function AEt(n){var e,t,i,r=vO,s=r.options,o=s===void 0?vO:s,a=r.plugins,l=a===void 0?MZ:a,c=function(f,p,g){return g.startsWith(t)&&g.endsWith(t)&&g.replaceAll(t,"").length>0?".".concat(e):f},u=l.slice();u.push(function(f){f.type===NZ&&f.value.includes("&")&&(f.props[0]=f.props[0].replace(IEt,t).replace(i,c))}),o.prefix&&u.push(eEt),u.push(XSt);var d=function(f,p,g,m){p===void 0&&(p=""),g===void 0&&(g=""),m===void 0&&(m="&"),e=m,t=p,i=new RegExp("\\".concat(t,"\\b"),"g");var _=f.replace(LEt,""),v=YSt(g||p?"".concat(g," ").concat(p," { ").concat(_," }"):_);o.namespace&&(v=Xze(v,o.namespace));var b=[];return cq(v,ZSt(u.concat(JSt(function(y){return b.push(y)})))),b};return d.hash=l.length?l.reduce(function(f,p){return p.name||KB(15),hR(f,p.name)},Wze).toString():"",d}var NEt=new Qze,She=AEt(),Zze=we.createContext({shouldForwardProp:void 0,styleSheet:NEt,stylis:She});Zze.Consumer;we.createContext(void 0);function wNe(){return x.useContext(Zze)}var DEt=function(){function n(e,t){var i=this;this.inject=function(r,s){s===void 0&&(s=She);var o=i.name+s.hash;r.hasNameForId(i.id,o)||r.insertRules(i.id,o,s(i.rules,o,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,zCe(this,function(){throw KB(12,String(i.name))})}return n.prototype.getName=function(e){return e===void 0&&(e=She),this.name+e.hash},n}(),REt=function(n){return n>="A"&&n<="Z"};function xNe(n){for(var e="",t=0;t<n.length;t++){var i=n[t];if(t===1&&i==="-"&&n[0]==="-")return n;REt(i)?e+="-"+i.toLowerCase():e+=i}return e.startsWith("ms-")?"-"+e:e}var Jze=function(n){return n==null||n===!1||n===""},eUe=function(n){var e,t,i=[];for(var r in n){var s=n[r];n.hasOwnProperty(r)&&!Jze(s)&&(Array.isArray(s)&&s.isCss||bO(s)?i.push("".concat(xNe(r),":"),s,";"):a8(s)?i.push.apply(i,lq(lq(["".concat(r," {")],eUe(s),!1),["}"],!1)):i.push("".concat(xNe(r),": ").concat((e=r,(t=s)==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in tEt||e.startsWith("--")?String(t).trim():"".concat(t,"px")),";")))}return i};function tI(n,e,t,i){if(Jze(n))return[];if(WCe(n))return[".".concat(n.styledComponentId)];if(bO(n)){if(!bO(s=n)||s.prototype&&s.prototype.isReactComponent||!e)return[n];var r=n(e);return tI(r,e,t,i)}var s;return n instanceof DEt?t?(n.inject(t,i),[n.getName(i)]):[n]:a8(n)?eUe(n):Array.isArray(n)?Array.prototype.concat.apply(MZ,n.map(function(o){return tI(o,e,t,i)})):[n.toString()]}function PEt(n){for(var e=0;e<n.length;e+=1){var t=n[e];if(bO(t)&&!WCe(t))return!1}return!0}var OEt=zze(OZ),MEt=function(){function n(e,t,i){this.rules=e,this.staticRulesId="",this.isStatic=(i===void 0||i.isStatic)&&PEt(e),this.componentId=t,this.baseHash=hR(OEt,t),this.baseStyle=i,Qze.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=$2(r,this.staticRulesId);else{var s=bNe(tI(this.rules,e,t,i)),o=whe(hR(this.baseHash,s)>>>0);if(!t.hasNameForId(this.componentId,o)){var a=i(s,".".concat(o),void 0,this.componentId);t.insertRules(this.componentId,o,a)}r=$2(r,o),this.staticRulesId=o}else{for(var l=hR(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 f=bNe(tI(d,e,t,i));l=hR(l,f+u),c+=f}}if(c){var p=whe(l>>>0);t.hasNameForId(this.componentId,p)||t.insertRules(this.componentId,p,i(c,".".concat(p),void 0,this.componentId)),r=$2(r,p)}}return r},n}(),tUe=we.createContext(void 0);tUe.Consumer;var Zie={};function jEt(n,e,t){var i=WCe(n),r=n,s=!Xie(n),o=e.attrs,a=o===void 0?MZ:o,l=e.componentId,c=l===void 0?function(C,S){var k=typeof C!="string"?"sc":pNe(C);Zie[k]=(Zie[k]||0)+1;var I="".concat(k,"-").concat(aEt(OZ+k+Zie[k]));return S?"".concat(S,"-").concat(I):I}(e.displayName,e.parentComponentId):l,u=e.displayName,d=u===void 0?function(C){return Xie(C)?"styled.".concat(C):"Styled(".concat(lEt(C),")")}(n):u,f=e.displayName&&e.componentId?"".concat(pNe(e.displayName),"-").concat(e.componentId):e.componentId||c,p=i&&r.attrs?r.attrs.concat(a).filter(Boolean):a,g=e.shouldForwardProp;if(i&&r.shouldForwardProp){var m=r.shouldForwardProp;if(e.shouldForwardProp){var _=e.shouldForwardProp;g=function(C,S){return m(C,S)&&_(C,S)}}else g=m}var v=new MEt(t,f,i?r.componentStyle:void 0);function b(C,S){return function(k,I,L){var N=k.attrs,P=k.componentStyle,O=k.defaultProps,F=k.foldedComponentIds,V=k.styledComponentId,M=k.target,B=we.useContext(tUe),W=wNe(),q=k.shouldForwardProp||W.shouldForwardProp,U=iEt(I,B,O)||vO,G=function(fe,Se,Me){for(var Ie,ge=Jp(Jp({},Se),{className:void 0,theme:Me}),ye=0;ye<fe.length;ye+=1){var Pe=bO(Ie=fe[ye])?Ie(ge):Ie;for(var Be in Pe)ge[Be]=Be==="className"?$2(ge[Be],Pe[Be]):Be==="style"?Jp(Jp({},ge[Be]),Pe[Be]):Pe[Be]}return Se.className&&(ge.className=$2(ge.className,Se.className)),ge}(N,I,U),H=G.as||M,z={};for(var Z in G)G[Z]===void 0||Z[0]==="$"||Z==="as"||Z==="theme"&&G.theme===U||(Z==="forwardedAs"?z.as=G.forwardedAs:q&&!q(Z,H)||(z[Z]=G[Z]));var X=function(fe,Se){var Me=wNe(),Ie=fe.generateAndInjectStyles(Se,Me.styleSheet,Me.stylis);return Ie}(P,G),oe=$2(F,V);return X&&(oe+=" "+X),G.className&&(oe+=" "+G.className),z[Xie(H)&&!Vze.has(H)?"class":"className"]=oe,L&&(z.ref=L),x.createElement(H,z)}(y,C,S)}b.displayName=d;var y=we.forwardRef(b);return y.attrs=p,y.componentStyle=v,y.displayName=d,y.shouldForwardProp=g,y.foldedComponentIds=i?$2(r.foldedComponentIds,r.styledComponentId):"",y.styledComponentId=f,y.target=i?r.target:n,Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(C){this._foldedDefaultProps=i?function(S){for(var k=[],I=1;I<arguments.length;I++)k[I-1]=arguments[I];for(var L=0,N=k;L<N.length;L++)xhe(S,N[L],!0);return S}({},r.defaultProps,C):C}}),zCe(y,function(){return".".concat(y.styledComponentId)}),s&&Gze(y,n,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),y}function SNe(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 ENe=function(n){return Object.assign(n,{isCss:!0})};function FEt(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(bO(n)||a8(n))return ENe(tI(SNe(MZ,lq([n],e,!0))));var i=n;return e.length===0&&i.length===1&&typeof i[0]=="string"?tI(i):ENe(tI(SNe(i,e)))}function Ehe(n,e,t){if(t===void 0&&(t=vO),!e)throw KB(1,e);var i=function(r){for(var s=[],o=1;o<arguments.length;o++)s[o-1]=arguments[o];return n(e,t,FEt.apply(void 0,lq([r],s,!1)))};return i.attrs=function(r){return Ehe(n,e,Jp(Jp({},t),{attrs:Array.prototype.concat(t.attrs,r).filter(Boolean)}))},i.withConfig=function(r){return Ehe(n,e,Jp(Jp({},t),r))},i}var nUe=function(n){return Ehe(jEt,n)},As=nUe;Vze.forEach(function(n){As[n]=nUe(n)});const BEt={type:"primary",behavior:"submit"},$Et=As(r1)` color: ${n=>n.theme.color} !important; background-color: ${n=>n.theme.backgroundColor} !important; border-color: ${n=>n.theme.borderColor} !important; `,HEt=As.button` color: ${n=>n.theme.color} !important; border-color: ${n=>n.theme.borderColor} !important; background-color: ${n=>n.theme.backgroundColor} !important; &:hover { background-color: ${n=>n.theme.hoverColor} !important; } `;function dn(n){n={...BEt,...n};const e=xt(),t=Lo(),i={backgroundColor:n.type==="primary"?t:n.noBackgroundColor?"transparent":"white",color:n.type!=="primary"&&n.type!=="secondary"?t:""};return n.to?h.jsx($Et,{to:n.to,theme:{backgroundColor:n.type==="primary"?e.$18:e.$1,color:n.type==="primary"?e.$1:e.$3,borderColor:n.type==="primary"?"transparent":e.$24,hoverColor:n.type==="primary"?e.$18:e.$4},className:$t(`border inline-flex items-center space-x-2 px-4 shadow-sm justify-center rounded-md 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?h.jsx(yo,{variant:"light"}):n.children}):h.jsx(HEt,{type:n.behavior,disabled:n.disabled,theme:{backgroundColor:n.type==="primary"?e.$18:e.$1,color:n.type==="primary"?e.$1:e.$3,borderColor:n.type==="primary"?"transparent":e.$24,hoverColor:n.type==="primary"?e.$18:e.$4},className:$t(`border inline-flex items-center space-x-2 px-4 shadow-sm justify-center rounded-md 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,form:n.form,children:n.disabled&&!n.disableWithoutIcon?h.jsx(yo,{variant:"light"}):n.children})}function Lh(n){const e=xt();return h.jsx("label",{className:`text-sm font-medium block ${n.className}`,htmlFor:n.for,style:{color:e.$22},children:n.children})}const VEt=As.input` background-color: ${n=>n.theme.backgroundColor}; border-color: ${n=>n.theme.borderColor}; &:checked { background-color: #000000 !important; border-color: ${n=>n.theme.checkedBorderColor} !important; } &:focus { outline: none; box-shadow: none; } `,WEt=n=>{const e=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="0.4rem" height="0.4rem" viewBox="0 0 12 12"><path d="m4.21,10.329h-.011c-.289-.004-.549-.174-.67-.436-.622-1.35-1.334-2.387-2.31-3.363-.293-.293-.293-.768,0-1.061.293-.293.768-.293,1.061,0,.772.773,1.398,1.577,1.943,2.508,1.4-2.384,3.272-4.451,5.58-6.16.333-.246.802-.177,1.049.157.246.333.176.803-.157,1.049-2.516,1.861-4.471,4.179-5.814,6.888-.126.256-.387.417-.672.417Z" strokeWidth="1" fill="${n}"></path></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(e)}")`};function Vd(n){const e=xt(),t=WEt(e.$9);return h.jsxs("div",{className:"relative flex items-start",children:[h.jsx("div",{className:"flex items-center h-5",children:h.jsx(VEt,{ref:n.innerRef,value:n.value,id:n.id,"aria-describedby":"comments-description",type:"checkbox",className:$t("rounded border disabled:opacity-50 cursor-pointer disabled:cursor-not-allowed",n.className),style:{backgroundImage:n.checked?t:"none",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"85%",width:"1.1rem",height:"1.1rem"},theme:{backgroundColor:e.$1,checkedBorderColor:e.$3,borderColor:e.$5},onChange:i=>{n.onChange&&n.onChange(i),n.onValueChange&&n.onValueChange(i.target.value,i.target.checked)},checked:!!n.checked,disabled:n.disabled,"data-cy":n.cypressRef})}),n.label&&h.jsx("div",{className:"ml-3 text-sm",children:h.jsx(Lh,{children:n.label})})]})}function UCe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UCe=function(){return!!n})()}function Hw(n){var e=UCe();return function(){var t,i=Tm(n);if(e){var r=Tm(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return zM(this,t)}}var og="top",Y_="bottom",Q_="right",ag="left",qCe="auto",GB=[og,Y_,Q_,ag],yO="start",l8="end",zEt="clippingParents",iUe="viewport",C5="popper",UEt="reference",kNe=GB.reduce(function(n,e){return n.concat([e+"-"+yO,e+"-"+l8])},[]),rUe=[].concat(GB,[qCe]).reduce(function(n,e){return n.concat([e,e+"-"+yO,e+"-"+l8])},[]),qEt="beforeRead",KEt="read",GEt="afterRead",YEt="beforeMain",QEt="main",XEt="afterMain",ZEt="beforeWrite",JEt="write",ekt="afterWrite",tkt=[qEt,KEt,GEt,YEt,QEt,XEt,ZEt,JEt,ekt];function By(n){return n?(n.nodeName||"").toLowerCase():null}function Lm(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function yL(n){var e=Lm(n).Element;return n instanceof e||n instanceof Element}function V_(n){var e=Lm(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function KCe(n){if(typeof ShadowRoot>"u")return!1;var e=Lm(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function nkt(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},s=e.elements[t];!V_(s)||!By(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(o){var a=r[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function ikt(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],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!V_(r)||!By(r)||(Object.assign(r.style,a),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}const GCe={name:"applyStyles",enabled:!0,phase:"write",fn:nkt,effect:ikt,requires:["computeStyles"]};function Ay(n){return n.split("-")[0]}var nI=Math.max,hq=Math.min,CO=Math.round;function khe(){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 sUe(){return!/^((?!chrome|android).)*safari/i.test(khe())}function wO(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),r=1,s=1;e&&V_(n)&&(r=n.offsetWidth>0&&CO(i.width)/n.offsetWidth||1,s=n.offsetHeight>0&&CO(i.height)/n.offsetHeight||1);var o=yL(n)?Lm(n):window,a=o.visualViewport,l=!sUe()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/r,u=(i.top+(l&&a?a.offsetTop:0))/s,d=i.width/r,f=i.height/s;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function YCe(n){var e=wO(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 oUe(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&KCe(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function yw(n){return Lm(n).getComputedStyle(n)}function rkt(n){return["table","td","th"].indexOf(By(n))>=0}function mk(n){return((yL(n)?n.ownerDocument:n.document)||window.document).documentElement}function jZ(n){return By(n)==="html"?n:n.assignedSlot||n.parentNode||(KCe(n)?n.host:null)||mk(n)}function TNe(n){return!V_(n)||yw(n).position==="fixed"?null:n.offsetParent}function skt(n){var e=/firefox/i.test(khe()),t=/Trident/i.test(khe());if(t&&V_(n)){var i=yw(n);if(i.position==="fixed")return null}var r=jZ(n);for(KCe(r)&&(r=r.host);V_(r)&&["html","body"].indexOf(By(r))<0;){var s=yw(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function YB(n){for(var e=Lm(n),t=TNe(n);t&&rkt(t)&&yw(t).position==="static";)t=TNe(t);return t&&(By(t)==="html"||By(t)==="body"&&yw(t).position==="static")?e:t||skt(n)||e}function QCe(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function CF(n,e,t){return nI(n,hq(e,t))}function okt(n,e,t){var i=CF(n,e,t);return i>t?t:i}function aUe(){return{top:0,right:0,bottom:0,left:0}}function lUe(n){return Object.assign({},aUe(),n)}function cUe(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var akt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,lUe(typeof e!="number"?e:cUe(e,GB))};function lkt(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=Ay(t.placement),l=QCe(a),c=[ag,Q_].indexOf(a)>=0,u=c?"height":"width";if(!(!s||!o)){var d=akt(r.padding,t),f=YCe(s),p=l==="y"?og:ag,g=l==="y"?Y_:Q_,m=t.rects.reference[u]+t.rects.reference[l]-o[l]-t.rects.popper[u],_=o[l]-t.rects.reference[l],v=YB(s),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-_/2,C=d[p],S=b-f[u]-d[g],k=b/2-f[u]/2+y,I=CF(C,k,S),L=l;t.modifiersData[i]=(e={},e[L]=I,e.centerOffset=I-k,e)}}function ckt(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)||oUe(e.elements.popper,r)&&(e.elements.arrow=r))}const ukt={name:"arrow",enabled:!0,phase:"main",fn:lkt,effect:ckt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xO(n){return n.split("-")[1]}var dkt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function hkt(n,e){var t=n.x,i=n.y,r=e.devicePixelRatio||1;return{x:CO(t*r)/r||0,y:CO(i*r)/r||0}}function INe(n){var e,t=n.popper,i=n.popperRect,r=n.placement,s=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,d=n.isFixed,f=o.x,p=f===void 0?0:f,g=o.y,m=g===void 0?0:g,_=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=_.x,m=_.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=ag,C=og,S=window;if(c){var k=YB(t),I="clientHeight",L="clientWidth";if(k===Lm(t)&&(k=mk(t),yw(k).position!=="static"&&a==="absolute"&&(I="scrollHeight",L="scrollWidth")),k=k,r===og||(r===ag||r===Q_)&&s===l8){C=Y_;var N=d&&k===S&&S.visualViewport?S.visualViewport.height:k[I];m-=N-i.height,m*=l?1:-1}if(r===ag||(r===og||r===Y_)&&s===l8){y=Q_;var P=d&&k===S&&S.visualViewport?S.visualViewport.width:k[L];p-=P-i.width,p*=l?1:-1}}var O=Object.assign({position:a},c&&dkt),F=u===!0?hkt({x:p,y:m},Lm(t)):{x:p,y:m};if(p=F.x,m=F.y,l){var V;return Object.assign({},O,(V={},V[C]=b?"0":"",V[y]=v?"0":"",V.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",V))}return Object.assign({},O,(e={},e[C]=b?m+"px":"",e[y]=v?p+"px":"",e.transform="",e))}function fkt(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:Ay(e.placement),variation:xO(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,INe(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,INe(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 pkt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fkt,data:{}};var RH={passive:!0};function gkt(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,o=i.resize,a=o===void 0?!0:o,l=Lm(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",t.update,RH)}),a&&l.addEventListener("resize",t.update,RH),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",t.update,RH)}),a&&l.removeEventListener("resize",t.update,RH)}}const mkt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:gkt,data:{}};var _kt={left:"right",right:"left",bottom:"top",top:"bottom"};function mz(n){return n.replace(/left|right|bottom|top/g,function(e){return _kt[e]})}var vkt={start:"end",end:"start"};function LNe(n){return n.replace(/start|end/g,function(e){return vkt[e]})}function XCe(n){var e=Lm(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function ZCe(n){return wO(mk(n)).left+XCe(n).scrollLeft}function bkt(n,e){var t=Lm(n),i=mk(n),r=t.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=sUe();(c||!c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+ZCe(n),y:l}}function ykt(n){var e,t=mk(n),i=XCe(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=nI(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=nI(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+ZCe(n),l=-i.scrollTop;return yw(r||t).direction==="rtl"&&(a+=nI(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function JCe(n){var e=yw(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function uUe(n){return["html","body","#document"].indexOf(By(n))>=0?n.ownerDocument.body:V_(n)&&JCe(n)?n:uUe(jZ(n))}function wF(n,e){var t;e===void 0&&(e=[]);var i=uUe(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=Lm(i),o=r?[s].concat(s.visualViewport||[],JCe(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(wF(jZ(o)))}function The(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Ckt(n,e){var t=wO(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 ANe(n,e,t){return e===iUe?The(bkt(n,t)):yL(e)?Ckt(e,t):The(ykt(mk(n)))}function wkt(n){var e=wF(jZ(n)),t=["absolute","fixed"].indexOf(yw(n).position)>=0,i=t&&V_(n)?YB(n):n;return yL(i)?e.filter(function(r){return yL(r)&&oUe(r,i)&&By(r)!=="body"}):[]}function xkt(n,e,t,i){var r=e==="clippingParents"?wkt(n):[].concat(e),s=[].concat(r,[t]),o=s[0],a=s.reduce(function(l,c){var u=ANe(n,c,i);return l.top=nI(u.top,l.top),l.right=hq(u.right,l.right),l.bottom=hq(u.bottom,l.bottom),l.left=nI(u.left,l.left),l},ANe(n,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function dUe(n){var e=n.reference,t=n.element,i=n.placement,r=i?Ay(i):null,s=i?xO(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(r){case og:l={x:o,y:e.y-t.height};break;case Y_:l={x:o,y:e.y+e.height};break;case Q_:l={x:e.x+e.width,y:a};break;case ag:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=r?QCe(r):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case yO:l[c]=l[c]-(e[u]/2-t[u]/2);break;case l8:l[c]=l[c]+(e[u]/2-t[u]/2);break}}return l}function c8(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,s=t.strategy,o=s===void 0?n.strategy:s,a=t.boundary,l=a===void 0?zEt:a,c=t.rootBoundary,u=c===void 0?iUe:c,d=t.elementContext,f=d===void 0?C5:d,p=t.altBoundary,g=p===void 0?!1:p,m=t.padding,_=m===void 0?0:m,v=lUe(typeof _!="number"?_:cUe(_,GB)),b=f===C5?UEt:C5,y=n.rects.popper,C=n.elements[g?b:f],S=xkt(yL(C)?C:C.contextElement||mk(n.elements.popper),l,u,o),k=wO(n.elements.reference),I=dUe({reference:k,element:y,placement:r}),L=The(Object.assign({},y,I)),N=f===C5?L:k,P={top:S.top-N.top+v.top,bottom:N.bottom-S.bottom+v.bottom,left:S.left-N.left+v.left,right:N.right-S.right+v.right},O=n.modifiersData.offset;if(f===C5&&O){var F=O[r];Object.keys(P).forEach(function(V){var M=[Q_,Y_].indexOf(V)>=0?1:-1,B=[og,Y_].indexOf(V)>=0?"y":"x";P[V]+=F[B]*M})}return P}function Skt(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?rUe:l,u=xO(i),d=u?a?kNe:kNe.filter(function(g){return xO(g)===u}):GB,f=d.filter(function(g){return c.indexOf(g)>=0});f.length===0&&(f=d);var p=f.reduce(function(g,m){return g[m]=c8(n,{placement:m,boundary:r,rootBoundary:s,padding:o})[Ay(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function Ekt(n){if(Ay(n)===qCe)return[];var e=mz(n);return[LNe(n),e,LNe(e)]}function kkt(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,c=t.padding,u=t.boundary,d=t.rootBoundary,f=t.altBoundary,p=t.flipVariations,g=p===void 0?!0:p,m=t.allowedAutoPlacements,_=e.options.placement,v=Ay(_),b=v===_,y=l||(b||!g?[mz(_)]:Ekt(_)),C=[_].concat(y).reduce(function(oe,fe){return oe.concat(Ay(fe)===qCe?Skt(e,{placement:fe,boundary:u,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:m}):fe)},[]),S=e.rects.reference,k=e.rects.popper,I=new Map,L=!0,N=C[0],P=0;P<C.length;P++){var O=C[P],F=Ay(O),V=xO(O)===yO,M=[og,Y_].indexOf(F)>=0,B=M?"width":"height",W=c8(e,{placement:O,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),q=M?V?Q_:ag:V?Y_:og;S[B]>k[B]&&(q=mz(q));var U=mz(q),G=[];if(s&&G.push(W[F]<=0),a&&G.push(W[q]<=0,W[U]<=0),G.every(function(oe){return oe})){N=O,L=!1;break}I.set(O,G)}if(L)for(var H=g?3:1,z=function(fe){var Se=C.find(function(Me){var Ie=I.get(Me);if(Ie)return Ie.slice(0,fe).every(function(ge){return ge})});if(Se)return N=Se,"break"},Z=H;Z>0;Z--){var X=z(Z);if(X==="break")break}e.placement!==N&&(e.modifiersData[i]._skip=!0,e.placement=N,e.reset=!0)}}const Tkt={name:"flip",enabled:!0,phase:"main",fn:kkt,requiresIfExists:["offset"],data:{_skip:!1}};function NNe(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 DNe(n){return[og,Q_,Y_,ag].some(function(e){return n[e]>=0})}function Ikt(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=c8(e,{elementContext:"reference"}),a=c8(e,{altBoundary:!0}),l=NNe(o,i),c=NNe(a,r,s),u=DNe(l),d=DNe(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 Lkt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ikt};function Akt(n,e,t){var i=Ay(n),r=[ag,og].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[ag,Q_].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Nkt(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,o=rUe.reduce(function(u,d){return u[d]=Akt(d,e.rects,s),u},{}),a=o[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]=o}const Dkt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Nkt};function Rkt(n){var e=n.state,t=n.name;e.modifiersData[t]=dUe({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const Pkt={name:"popperOffsets",enabled:!0,phase:"read",fn:Rkt,data:{}};function Okt(n){return n==="x"?"y":"x"}function Mkt(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,c=t.rootBoundary,u=t.altBoundary,d=t.padding,f=t.tether,p=f===void 0?!0:f,g=t.tetherOffset,m=g===void 0?0:g,_=c8(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Ay(e.placement),b=xO(e.placement),y=!b,C=QCe(v),S=Okt(C),k=e.modifiersData.popperOffsets,I=e.rects.reference,L=e.rects.popper,N=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,P=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,F={x:0,y:0};if(k){if(s){var V,M=C==="y"?og:ag,B=C==="y"?Y_:Q_,W=C==="y"?"height":"width",q=k[C],U=q+_[M],G=q-_[B],H=p?-L[W]/2:0,z=b===yO?I[W]:L[W],Z=b===yO?-L[W]:-I[W],X=e.elements.arrow,oe=p&&X?YCe(X):{width:0,height:0},fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:aUe(),Se=fe[M],Me=fe[B],Ie=CF(0,I[W],oe[W]),ge=y?I[W]/2-H-Ie-Se-P.mainAxis:z-Ie-Se-P.mainAxis,ye=y?-I[W]/2+H+Ie+Me+P.mainAxis:Z+Ie+Me+P.mainAxis,Pe=e.elements.arrow&&YB(e.elements.arrow),Be=Pe?C==="y"?Pe.clientTop||0:Pe.clientLeft||0:0,$e=(V=O==null?void 0:O[C])!=null?V:0,qe=q+ge-$e-Be,mt=q+ye-$e,vt=CF(p?hq(U,qe):U,q,p?nI(G,mt):G);k[C]=vt,F[C]=vt-q}if(a){var ft,tt=C==="x"?og:ag,St=C==="x"?Y_:Q_,Ft=k[S],en=S==="y"?"height":"width",Ke=Ft+_[tt],dt=Ft-_[St],nt=[og,ag].indexOf(v)!==-1,at=(ft=O==null?void 0:O[S])!=null?ft:0,Oe=nt?Ke:Ft-I[en]-L[en]-at+P.altAxis,ce=nt?Ft+I[en]+L[en]-at-P.altAxis:dt,Ne=p&&nt?okt(Oe,Ft,ce):CF(p?Oe:Ke,Ft,p?ce:dt);k[S]=Ne,F[S]=Ne-Ft}e.modifiersData[i]=F}}const jkt={name:"preventOverflow",enabled:!0,phase:"main",fn:Mkt,requiresIfExists:["offset"]};function Fkt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Bkt(n){return n===Lm(n)||!V_(n)?XCe(n):Fkt(n)}function $kt(n){var e=n.getBoundingClientRect(),t=CO(e.width)/n.offsetWidth||1,i=CO(e.height)/n.offsetHeight||1;return t!==1||i!==1}function Hkt(n,e,t){t===void 0&&(t=!1);var i=V_(e),r=V_(e)&&$kt(e),s=mk(e),o=wO(n,r,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((By(e)!=="body"||JCe(s))&&(a=Bkt(e)),V_(e)?(l=wO(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=ZCe(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Vkt(n){var e=new Map,t=new Set,i=[];n.forEach(function(s){e.set(s.name,s)});function r(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&r(l)}}),i.push(s)}return n.forEach(function(s){t.has(s.name)||r(s)}),i}function Wkt(n){var e=Vkt(n);return tkt.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function zkt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function Ukt(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 RNe={placement:"bottom",modifiers:[],strategy:"absolute"};function PNe(){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 qkt(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,s=r===void 0?RNe:r;return function(a,l,c){c===void 0&&(c=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},RNe,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:u,setOptions:function(v){var b=typeof v=="function"?v(u.options):v;m(),u.options=Object.assign({},s,u.options,b),u.scrollParents={reference:yL(a)?wF(a):a.contextElement?wF(a.contextElement):[],popper:wF(l)};var y=Wkt(Ukt([].concat(i,u.options.modifiers)));return u.orderedModifiers=y.filter(function(C){return C.enabled}),g(),p.update()},forceUpdate:function(){if(!f){var v=u.elements,b=v.reference,y=v.popper;if(PNe(b,y)){u.rects={reference:Hkt(b,YB(y),u.options.strategy==="fixed"),popper:YCe(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(P){return u.modifiersData[P.name]=Object.assign({},P.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var S=u.orderedModifiers[C],k=S.fn,I=S.options,L=I===void 0?{}:I,N=S.name;typeof k=="function"&&(u=k({state:u,options:L,name:N,instance:p})||u)}}}},update:zkt(function(){return new Promise(function(_){p.forceUpdate(),_(u)})}),destroy:function(){m(),f=!0}};if(!PNe(a,l))return p;p.setOptions(c).then(function(_){!f&&c.onFirstUpdate&&c.onFirstUpdate(_)});function g(){u.orderedModifiers.forEach(function(_){var v=_.name,b=_.options,y=b===void 0?{}:b,C=_.effect;if(typeof C=="function"){var S=C({state:u,name:v,instance:p,options:y}),k=function(){};d.push(S||k)}})}function m(){d.forEach(function(_){return _()}),d=[]}return p}}var Kkt=[mkt,Pkt,pkt,GCe,Dkt,Tkt,jkt,ukt,Lkt],hUe=qkt({defaultModifiers:Kkt});function an(n){xt();const e=Lo(),t=x.createElement(n.element);return x.isValidElement(t)?x.cloneElement(t,{fontSize:n.size||20,color:n.color||e,className:n.className,onClick:n.onClick,style:n.style}):h.jsx(h.Fragment,{})}var fUe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ONe=we.createContext&&we.createContext(fUe),XS=function(){return XS=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},XS.apply(this,arguments)},Gkt=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 pUe(n){return n&&n.map(function(e,t){return we.createElement(e.tag,XS({key:t},e.attr),pUe(e.child))})}function Ui(n){return function(e){return we.createElement(Ykt,XS({attr:XS({},n.attr)},e),pUe(n.child))}}function Ykt(n){var e=function(t){var i=n.attr,r=n.size,s=n.title,o=Gkt(n,["attr","size","title"]),a=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),we.createElement("svg",XS({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,o,{className:l,style:XS(XS({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&we.createElement("title",null,s),n.children)};return ONe!==void 0?we.createElement(ONe.Consumer,null,function(t){return e(t)}):e(fUe)}function Qkt(n){return Ui({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 w3r(n){return Ui({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-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}}]})(n)}function x3r(n){return Ui({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 S3r(n){return Ui({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 Xkt(n){return Ui({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 fc(n){return Ui({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 ewe(n){return Ui({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 gUe(n){return Ui({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 Ihe(n){return Ui({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 E3r(n){return Ui({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 mUe(n){return Ui({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 twe(n){return Ui({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 nwe(n){return Ui({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 k3r(n){return Ui({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 T3r(n){return Ui({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 I3r(n){return Ui({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 _Ue(n){return Ui({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 bu(n){return Ui({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 iwe(n){return Ui({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 L3r(n){return Ui({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 Zkt(n){return Ui({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 jC(n){return Ui({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 Jkt(n){return Ui({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 5v14l11-7z"}}]})(n)}function rwe(n){return Ui({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 FZ(n){return Ui({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 vUe(n){return Ui({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 eTt(n){return Ui({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 A3r(n){return Ui({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 yu(n){return Ui({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 N3r(n){return Ui({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 tTt(n){return Ui({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 D3r(n){return Ui({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 nTt(n){return Ui({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 iTt(n){return Ui({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 13H5v-2h14v2z"}}]})(n)}function BZ(n){return Ui({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 R3r(n){return Ui({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 swe(n){return Ui({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 FE(n){return Ui({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 rTt(n){return Ui({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 sTt(n){return Ui({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 hA(n){return Ui({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 Pb(n){return Ui({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 $Z(n){return Ui({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 HZ(n){return Ui({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 P3r(n){return Ui({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 t4(n){return Ui({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 O3r(n){return Ui({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 M3r(n){return Ui({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 SO(n){return Ui({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 j3r(n){return Ui({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 oTt(n){return Ui({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 aTt(n){return Ui({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 bUe(n){return Ui({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 yUe(n){return Ui({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 lTt(n){return Ui({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 cTt(n){return Ui({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}}]})(n)}function uTt(n){return Ui({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 dTt(n){return Ui({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M20 6h-8l-2-2H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h2v-2h2v-2h-2v-2h-2v2h-2z"}}]})(n)}var hTt=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function fTt(n){var e=n.defaultInputValue,t=e===void 0?"":e,i=n.defaultMenuIsOpen,r=i===void 0?!1:i,s=n.defaultValue,o=s===void 0?null:s,a=n.inputValue,l=n.menuIsOpen,c=n.onChange,u=n.onInputChange,d=n.onMenuClose,f=n.onMenuOpen,p=n.value,g=Na(n,hTt),m=x.useState(a!==void 0?a:t),_=Mt(m,2),v=_[0],b=_[1],y=x.useState(l!==void 0?l:r),C=Mt(y,2),S=C[0],k=C[1],I=x.useState(p!==void 0?p:o),L=Mt(I,2),N=L[0],P=L[1],O=x.useCallback(function(U,G){typeof c=="function"&&c(U,G),P(U)},[c]),F=x.useCallback(function(U,G){var H;typeof u=="function"&&(H=u(U,G)),b(H!==void 0?H:U)},[u]),V=x.useCallback(function(){typeof f=="function"&&f(),k(!0)},[f]),M=x.useCallback(function(){typeof d=="function"&&d(),k(!1)},[d]),B=a!==void 0?a:v,W=l!==void 0?l:S,q=p!==void 0?p:N;return ut(ut({},g),{},{inputValue:B,menuIsOpen:W,onChange:O,onInputChange:F,onMenuClose:M,onMenuOpen:V,value:q})}function pTt(n){if(Array.isArray(n))return pde(n)}function gTt(){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 _r(n){return pTt(n)||LVe(n)||z1e(n)||gTt()}function mTt(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 _Tt(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 vTt=function(){function n(t){var i=this;this._insertTag=function(r){var s;i.tags.length===0?i.insertionPoint?s=i.insertionPoint.nextSibling:i.prepend?s=i.container.firstChild:s=i.before:s=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(r,s),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(_Tt(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=mTt(r);try{s.insertRule(i,s.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}(),Gh="-ms-",fq="-moz-",Ea="-webkit-",CUe="comm",owe="rule",awe="decl",bTt="@import",wUe="@keyframes",yTt="@layer",CTt=Math.abs,VZ=String.fromCharCode,wTt=Object.assign;function xTt(n,e){return fh(n,0)^45?(((e<<2^fh(n,0))<<2^fh(n,1))<<2^fh(n,2))<<2^fh(n,3):0}function xUe(n){return n.trim()}function STt(n,e){return(n=e.exec(n))?n[0]:n}function ka(n,e,t){return n.replace(e,t)}function Lhe(n,e){return n.indexOf(e)}function fh(n,e){return n.charCodeAt(e)|0}function u8(n,e,t){return n.slice(e,t)}function ty(n){return n.length}function lwe(n){return n.length}function PH(n,e){return e.push(n),n}function ETt(n,e){return n.map(e).join("")}var WZ=1,EO=1,SUe=0,fg=0,Mu=0,n4="";function zZ(n,e,t,i,r,s,o){return{value:n,root:e,parent:t,type:i,props:r,children:s,line:WZ,column:EO,length:o,return:""}}function w5(n,e){return wTt(zZ("",null,null,"",null,null,0),n,{length:-n.length},e)}function kTt(){return Mu}function TTt(){return Mu=fg>0?fh(n4,--fg):0,EO--,Mu===10&&(EO=1,WZ--),Mu}function ym(){return Mu=fg<SUe?fh(n4,fg++):0,EO++,Mu===10&&(EO=1,WZ++),Mu}function Ny(){return fh(n4,fg)}function _z(){return fg}function QB(n,e){return u8(n4,n,e)}function d8(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 EUe(n){return WZ=EO=1,SUe=ty(n4=n),fg=0,[]}function kUe(n){return n4="",n}function vz(n){return xUe(QB(fg-1,Ahe(n===91?n+2:n===40?n+1:n)))}function ITt(n){for(;(Mu=Ny())&&Mu<33;)ym();return d8(n)>2||d8(Mu)>3?"":" "}function LTt(n,e){for(;--e&&ym()&&!(Mu<48||Mu>102||Mu>57&&Mu<65||Mu>70&&Mu<97););return QB(n,_z()+(e<6&&Ny()==32&&ym()==32))}function Ahe(n){for(;ym();)switch(Mu){case n:return fg;case 34:case 39:n!==34&&n!==39&&Ahe(Mu);break;case 40:n===41&&Ahe(n);break;case 92:ym();break}return fg}function ATt(n,e){for(;ym()&&n+Mu!==57;)if(n+Mu===84&&Ny()===47)break;return"/*"+QB(e,fg-1)+"*"+VZ(n===47?n:ym())}function NTt(n){for(;!d8(Ny());)ym();return QB(n,fg)}function DTt(n){return kUe(bz("",null,null,null,[""],n=EUe(n),0,[0],n))}function bz(n,e,t,i,r,s,o,a,l){for(var c=0,u=0,d=o,f=0,p=0,g=0,m=1,_=1,v=1,b=0,y="",C=r,S=s,k=i,I=y;_;)switch(g=b,b=ym()){case 40:if(g!=108&&fh(I,d-1)==58){Lhe(I+=ka(vz(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:I+=vz(b);break;case 9:case 10:case 13:case 32:I+=ITt(g);break;case 92:I+=LTt(_z()-1,7);continue;case 47:switch(Ny()){case 42:case 47:PH(RTt(ATt(ym(),_z()),e,t),l);break;default:I+="/"}break;case 123*m:a[c++]=ty(I)*v;case 125*m:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:v==-1&&(I=ka(I,/\f/g,"")),p>0&&ty(I)-d&&PH(p>32?jNe(I+";",i,t,d-1):jNe(ka(I," ","")+";",i,t,d-2),l);break;case 59:I+=";";default:if(PH(k=MNe(I,e,t,c,u,r,a,y,C=[],S=[],d),s),b===123)if(u===0)bz(I,e,k,k,C,s,d,a,S);else switch(f===99&&fh(I,3)===110?100:f){case 100:case 108:case 109:case 115:bz(n,k,k,i&&PH(MNe(n,k,k,0,0,r,a,y,r,C=[],d),S),r,S,d,a,i?C:S);break;default:bz(I,k,k,k,[""],S,0,a,S)}}c=u=p=0,m=v=1,y=I="",d=o;break;case 58:d=1+ty(I),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&TTt()==125)continue}switch(I+=VZ(b),b*m){case 38:v=u>0?1:(I+="\f",-1);break;case 44:a[c++]=(ty(I)-1)*v,v=1;break;case 64:Ny()===45&&(I+=vz(ym())),f=Ny(),u=d=ty(y=I+=NTt(_z())),b++;break;case 45:g===45&&ty(I)==2&&(m=0)}}return s}function MNe(n,e,t,i,r,s,o,a,l,c,u){for(var d=r-1,f=r===0?s:[""],p=lwe(f),g=0,m=0,_=0;g<i;++g)for(var v=0,b=u8(n,d+1,d=CTt(m=o[g])),y=n;v<p;++v)(y=xUe(m>0?f[v]+" "+b:ka(b,/&\f/g,f[v])))&&(l[_++]=y);return zZ(n,e,t,r===0?owe:a,l,c,u)}function RTt(n,e,t){return zZ(n,e,t,CUe,VZ(kTt()),u8(n,2,-2),0)}function jNe(n,e,t,i){return zZ(n,e,t,awe,u8(n,0,i),u8(n,i+1,-1),i)}function vP(n,e){for(var t="",i=lwe(n),r=0;r<i;r++)t+=e(n[r],r,n,e)||"";return t}function PTt(n,e,t,i){switch(n.type){case yTt:if(n.children.length)break;case bTt:case awe:return n.return=n.return||n.value;case CUe:return"";case wUe:return n.return=n.value+"{"+vP(n.children,i)+"}";case owe:n.value=n.props.join(",")}return ty(t=vP(n.children,i))?n.return=n.value+"{"+t+"}":""}function OTt(n){var e=lwe(n);return function(t,i,r,s){for(var o="",a=0;a<e;a++)o+=n[a](t,i,r,s)||"";return o}}function MTt(n){return function(e){e.root||(e=e.return)&&n(e)}}var jTt=function(e,t,i){for(var r=0,s=0;r=s,s=Ny(),r===38&&s===12&&(t[i]=1),!d8(s);)ym();return QB(e,fg)},FTt=function(e,t){var i=-1,r=44;do switch(d8(r)){case 0:r===38&&Ny()===12&&(t[i]=1),e[i]+=jTt(fg-1,t,i);break;case 2:e[i]+=vz(r);break;case 4:if(r===44){e[++i]=Ny()===58?"&\f":"",t[i]=e[i].length;break}default:e[i]+=VZ(r)}while(r=ym());return e},BTt=function(e,t){return kUe(FTt(EUe(e),t))},FNe=new WeakMap,$Tt=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&&!FNe.get(i))&&!r){FNe.set(e,!0);for(var s=[],o=BTt(t,s),a=i.props,l=0,c=0;l<o.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=s[l]?o[l].replace(/&\f/g,a[u]):a[u]+" "+o[l]}}},HTt=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function TUe(n,e){switch(xTt(n,e)){case 5103:return Ea+"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 Ea+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return Ea+n+fq+n+Gh+n+n;case 6828:case 4268:return Ea+n+Gh+n+n;case 6165:return Ea+n+Gh+"flex-"+n+n;case 5187:return Ea+n+ka(n,/(\w+).+(:[^]+)/,Ea+"box-$1$2"+Gh+"flex-$1$2")+n;case 5443:return Ea+n+Gh+"flex-item-"+ka(n,/flex-|-self/,"")+n;case 4675:return Ea+n+Gh+"flex-line-pack"+ka(n,/align-content|flex-|-self/,"")+n;case 5548:return Ea+n+Gh+ka(n,"shrink","negative")+n;case 5292:return Ea+n+Gh+ka(n,"basis","preferred-size")+n;case 6060:return Ea+"box-"+ka(n,"-grow","")+Ea+n+Gh+ka(n,"grow","positive")+n;case 4554:return Ea+ka(n,/([^-])(transform)/g,"$1"+Ea+"$2")+n;case 6187:return ka(ka(ka(n,/(zoom-|grab)/,Ea+"$1"),/(image-set)/,Ea+"$1"),n,"")+n;case 5495:case 3959:return ka(n,/(image-set\([^]*)/,Ea+"$1$`$1");case 4968:return ka(ka(n,/(.+:)(flex-)?(.*)/,Ea+"box-pack:$3"+Gh+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ea+n+n;case 4095:case 3583:case 4068:case 2532:return ka(n,/(.+)-inline(.+)/,Ea+"$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(ty(n)-1-e>6)switch(fh(n,e+1)){case 109:if(fh(n,e+4)!==45)break;case 102:return ka(n,/(.+:)(.+)-([^]+)/,"$1"+Ea+"$2-$3$1"+fq+(fh(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~Lhe(n,"stretch")?TUe(ka(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(fh(n,e+1)!==115)break;case 6444:switch(fh(n,ty(n)-3-(~Lhe(n,"!important")&&10))){case 107:return ka(n,":",":"+Ea)+n;case 101:return ka(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ea+(fh(n,14)===45?"inline-":"")+"box$3$1"+Ea+"$2$3$1"+Gh+"$2box$3")+n}break;case 5936:switch(fh(n,e+11)){case 114:return Ea+n+Gh+ka(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return Ea+n+Gh+ka(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return Ea+n+Gh+ka(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return Ea+n+Gh+n+n}return n}var VTt=function(e,t,i,r){if(e.length>-1&&!e.return)switch(e.type){case awe:e.return=TUe(e.value,e.length);break;case wUe:return vP([w5(e,{value:ka(e.value,"@","@"+Ea)})],r);case owe:if(e.length)return ETt(e.props,function(s){switch(STt(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return vP([w5(e,{props:[ka(s,/:(read-\w+)/,":"+fq+"$1")]})],r);case"::placeholder":return vP([w5(e,{props:[ka(s,/:(plac\w+)/,":"+Ea+"input-$1")]}),w5(e,{props:[ka(s,/:(plac\w+)/,":"+fq+"$1")]}),w5(e,{props:[ka(s,/:(plac\w+)/,Gh+"input-$1")]})],r)}return""})}},WTt=[VTt],zTt=function(e){var t=e.key;if(t==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(m){var _=m.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var r=e.stylisPlugins||WTt,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(m){for(var _=m.getAttribute("data-emotion").split(" "),v=1;v<_.length;v++)s[_[v]]=!0;a.push(m)});var l,c=[$Tt,HTt];{var u,d=[PTt,MTt(function(m){u.insert(m)})],f=OTt(c.concat(r,d)),p=function(_){return vP(DTt(_),f)};l=function(_,v,b,y){u=b,p(_?_+"{"+v.styles+"}":v.styles),y&&(g.inserted[v.name]=!0)}}var g={key:t,sheet:new vTt({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:l};return g.sheet.hydrate(a),g},UTt=!0;function qTt(n,e,t){var i="";return t.split(" ").forEach(function(r){n[r]!==void 0?e.push(n[r]+";"):r&&(i+=r+" ")}),i}var IUe=function(e,t,i){var r=e.key+"-"+t.name;(i===!1||UTt===!1)&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},KTt=function(e,t,i){IUe(e,t,i);var r=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var s=t;do e.insert(t===s?"."+r:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function GTt(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 YTt={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,scale: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};function QTt(n){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=n(t)),e[t]}}var XTt=/[A-Z]|^ms/g,ZTt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,LUe=function(e){return e.charCodeAt(1)===45},BNe=function(e){return e!=null&&typeof e!="boolean"},Jie=QTt(function(n){return LUe(n)?n:n.replace(XTt,"-$&").toLowerCase()}),$Ne=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(ZTt,function(i,r,s){return ny={name:r,styles:s,next:ny},r})}return YTt[e]!==1&&!LUe(e)&&typeof t=="number"&&t!==0?t+"px":t};function h8(n,e,t){if(t==null)return"";var i=t;if(i.__emotion_styles!==void 0)return i;switch(typeof t){case"boolean":return"";case"object":{var r=t;if(r.anim===1)return ny={name:r.name,styles:r.styles,next:ny},r.name;var s=t;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)ny={name:o.name,styles:o.styles,next:ny},o=o.next;var a=s.styles+";";return a}return JTt(n,e,t)}case"function":{if(n!==void 0){var l=ny,c=t(n);return ny=l,h8(n,e,c)}break}}var u=t;return u}function JTt(n,e,t){var i="";if(Array.isArray(t))for(var r=0;r<t.length;r++)i+=h8(n,e,t[r])+";";else for(var s in t){var o=t[s];if(typeof o!="object"){var a=o;BNe(a)&&(i+=Jie(s)+":"+$Ne(s,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&e==null)for(var l=0;l<o.length;l++)BNe(o[l])&&(i+=Jie(s)+":"+$Ne(s,o[l])+";");else{var c=h8(n,e,o);switch(s){case"animation":case"animationName":{i+=Jie(s)+":"+c+";";break}default:i+=s+"{"+c+"}"}}}return i}var HNe=/label:\s*([^\s;{]+)\s*(;|$)/g,ny;function AUe(n,e,t){if(n.length===1&&typeof n[0]=="object"&&n[0]!==null&&n[0].styles!==void 0)return n[0];var i=!0,r="";ny=void 0;var s=n[0];if(s==null||s.raw===void 0)i=!1,r+=h8(t,e,s);else{var o=s;r+=o[0]}for(var a=1;a<n.length;a++)if(r+=h8(t,e,n[a]),i){var l=s;r+=l[a]}HNe.lastIndex=0;for(var c="",u;(u=HNe.exec(r))!==null;)c+="-"+u[1];var d=GTt(r)+c;return{name:d,styles:r,next:ny}}var e2t=function(e){return e()},t2t=q_.useInsertionEffect?q_.useInsertionEffect:!1,n2t=t2t||e2t,cwe={}.hasOwnProperty,NUe=x.createContext(typeof HTMLElement<"u"?zTt({key:"css"}):null);NUe.Provider;var i2t=function(e){return x.forwardRef(function(t,i){var r=x.useContext(NUe);return e(t,r,i)})},r2t=x.createContext({}),Nhe="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",s2t=function(e,t){var i={};for(var r in t)cwe.call(t,r)&&(i[r]=t[r]);return i[Nhe]=e,i},o2t=function(e){var t=e.cache,i=e.serialized,r=e.isStringTag;return IUe(t,i,r),n2t(function(){return KTt(t,i,r)}),null},a2t=i2t(function(n,e,t){var i=n.css;typeof i=="string"&&e.registered[i]!==void 0&&(i=e.registered[i]);var r=n[Nhe],s=[i],o="";typeof n.className=="string"?o=qTt(e.registered,s,n.className):n.className!=null&&(o=n.className+" ");var a=AUe(s,void 0,x.useContext(r2t));o+=e.key+"-"+a.name;var l={};for(var c in n)cwe.call(n,c)&&c!=="css"&&c!==Nhe&&(l[c]=n[c]);return l.ref=t,l.className=o,x.createElement(x.Fragment,null,x.createElement(o2t,{cache:e,serialized:a,isStringTag:typeof r=="string"}),x.createElement(r,l))}),l2t=a2t,rs=function(e,t){var i=arguments;if(t==null||!cwe.call(t,"css"))return x.createElement.apply(void 0,i);var r=i.length,s=new Array(r);s[0]=l2t,s[1]=s2t(e,t);for(var o=2;o<r;o++)s[o]=i[o];return x.createElement.apply(null,s)};function uwe(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return AUe(e)}var c2t=function(){var e=uwe.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 u2t(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}const d2t=Math.min,h2t=Math.max,pq=Math.round,OH=Math.floor,gq=n=>({x:n,y:n});function f2t(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function DUe(n){return PUe(n)?(n.nodeName||"").toLowerCase():"#document"}function Cw(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function RUe(n){var e;return(e=(PUe(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function PUe(n){return n instanceof Node||n instanceof Cw(n).Node}function p2t(n){return n instanceof Element||n instanceof Cw(n).Element}function dwe(n){return n instanceof HTMLElement||n instanceof Cw(n).HTMLElement}function VNe(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Cw(n).ShadowRoot}function OUe(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=hwe(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(r)}function g2t(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function m2t(n){return["html","body","#document"].includes(DUe(n))}function hwe(n){return Cw(n).getComputedStyle(n)}function _2t(n){if(DUe(n)==="html")return n;const e=n.assignedSlot||n.parentNode||VNe(n)&&n.host||RUe(n);return VNe(e)?e.host:e}function MUe(n){const e=_2t(n);return m2t(e)?n.ownerDocument?n.ownerDocument.body:n.body:dwe(e)&&OUe(e)?e:MUe(e)}function mq(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=MUe(n),s=r===((i=n.ownerDocument)==null?void 0:i.body),o=Cw(r);return s?e.concat(o,o.visualViewport||[],OUe(r)?r:[],o.frameElement&&t?mq(o.frameElement):[]):e.concat(r,mq(r,[],t))}function v2t(n){const e=hwe(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=dwe(n),s=r?n.offsetWidth:t,o=r?n.offsetHeight:i,a=pq(t)!==s||pq(i)!==o;return a&&(t=s,i=o),{width:t,height:i,$:a}}function fwe(n){return p2t(n)?n:n.contextElement}function WNe(n){const e=fwe(n);if(!dwe(e))return gq(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:s}=v2t(e);let o=(s?pq(t.width):t.width)/i,a=(s?pq(t.height):t.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const b2t=gq(0);function y2t(n){const e=Cw(n);return!g2t()||!e.visualViewport?b2t:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function C2t(n,e,t){return!1}function zNe(n,e,t,i){e===void 0&&(e=!1);const r=n.getBoundingClientRect(),s=fwe(n);let o=gq(1);e&&(o=WNe(n));const a=C2t()?y2t(s):gq(0);let l=(r.left+a.x)/o.x,c=(r.top+a.y)/o.y,u=r.width/o.x,d=r.height/o.y;if(s){const f=Cw(s),p=i;let g=f.frameElement;for(;g&&i&&p!==f;){const m=WNe(g),_=g.getBoundingClientRect(),v=hwe(g),b=_.left+(g.clientLeft+parseFloat(v.paddingLeft))*m.x,y=_.top+(g.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=b,c+=y,g=Cw(g).frameElement}}return f2t({width:u,height:d,x:l,y:c})}function w2t(n,e){let t=null,i;const r=RUe(n);function s(){clearTimeout(i),t&&t.disconnect(),t=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=n.getBoundingClientRect();if(a||e(),!d||!f)return;const p=OH(u),g=OH(r.clientWidth-(c+d)),m=OH(r.clientHeight-(u+f)),_=OH(c),b={rootMargin:-p+"px "+-g+"px "+-m+"px "+-_+"px",threshold:h2t(0,d2t(1,l))||1};let y=!0;function C(S){const k=S[0].intersectionRatio;if(k!==l){if(!y)return o();k?o(!1,k):i=setTimeout(()=>{o(!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 o(!0),s}function x2t(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=fwe(n),u=r||s?[...c?mq(c):[],...mq(e)]:[];u.forEach(v=>{r&&v.addEventListener("scroll",t,{passive:!0}),s&&v.addEventListener("resize",t)});const d=c&&a?w2t(c,t):null;let f=-1,p=null;o&&(p=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p&&p.observe(e)})),t()}),c&&!l&&p.observe(c),p.observe(e));let g,m=l?zNe(n):null;l&&_();function _(){const v=zNe(n);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&t(),m=v,g=requestAnimationFrame(_)}return t(),()=>{u.forEach(v=>{r&&v.removeEventListener("scroll",t),s&&v.removeEventListener("resize",t)}),d&&d(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(g)}}var Dhe=x.useLayoutEffect,S2t=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],_q=function(){};function E2t(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function k2t(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 s=[].concat(i);if(e&&n)for(var o in e)e.hasOwnProperty(o)&&e[o]&&s.push("".concat(E2t(n,o)));return s.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var UNe=function(e){return O2t(e)?e.filter(Boolean):Mr(e)==="object"&&e!==null?[e]:[]},jUe=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=Na(e,S2t);return ut({},t)},Kc=function(e,t,i){var r=e.cx,s=e.getStyles,o=e.getClassNames,a=e.className;return{css:s(t,e),className:r(i??{},o(t,e),a)}};function UZ(n){return[document.documentElement,document.body,window].indexOf(n)>-1}function T2t(n){return UZ(n)?window.innerHeight:n.clientHeight}function FUe(n){return UZ(n)?window.pageYOffset:n.scrollTop}function vq(n,e){if(UZ(n)){window.scrollTo(0,e);return}n.scrollTop=e}function I2t(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 L2t(n,e,t,i){return t*((n=n/i-1)*n*n+1)+e}function MH(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:_q,r=FUe(n),s=e-r,o=10,a=0;function l(){a+=o;var c=L2t(a,r,s,t);vq(n,c),a<t?window.requestAnimationFrame(l):i(n)}l()}function qNe(n,e){var t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=e.offsetHeight/3;i.bottom+r>t.bottom?vq(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+r,n.scrollHeight)):i.top-r<t.top&&vq(n,Math.max(e.offsetTop-r,0))}function A2t(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 KNe(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function N2t(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var BUe=!1,D2t={get passive(){return BUe=!0}},jH=typeof window<"u"?window:{};jH.addEventListener&&jH.removeEventListener&&(jH.addEventListener("p",_q,D2t),jH.removeEventListener("p",_q,!1));var R2t=BUe;function P2t(n){return n!=null}function O2t(n){return Array.isArray(n)}function FH(n,e,t){return n?e:t}var M2t=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 s=Object.entries(e).filter(function(o){var a=Mt(o,1),l=a[0];return!i.includes(l)});return s.reduce(function(o,a){var l=Mt(a,2),c=l[0],u=l[1];return o[c]=u,o},{})},j2t=["children","innerProps"],F2t=["children","innerProps"];function B2t(n){var e=n.maxHeight,t=n.menuEl,i=n.minHeight,r=n.placement,s=n.shouldScroll,o=n.isFixedPosition,a=n.controlHeight,l=I2t(t),c={placement:"bottom",maxHeight:e};if(!t||!t.offsetParent)return c;var u=l.getBoundingClientRect(),d=u.height,f=t.getBoundingClientRect(),p=f.bottom,g=f.height,m=f.top,_=t.offsetParent.getBoundingClientRect(),v=_.top,b=o?window.innerHeight:T2t(l),y=FUe(l),C=parseInt(getComputedStyle(t).marginBottom,10),S=parseInt(getComputedStyle(t).marginTop,10),k=v-S,I=b-m,L=k+y,N=d-y-m,P=p-b+y+C,O=y+m-S,F=160;switch(r){case"auto":case"bottom":if(I>=g)return{placement:"bottom",maxHeight:e};if(N>=g&&!o)return s&&MH(l,P,F),{placement:"bottom",maxHeight:e};if(!o&&N>=i||o&&I>=i){s&&MH(l,P,F);var V=o?I-C:N-C;return{placement:"bottom",maxHeight:V}}if(r==="auto"||o){var M=e,B=o?k:L;return B>=i&&(M=Math.min(B-C-a,e)),{placement:"top",maxHeight:M}}if(r==="bottom")return s&&vq(l,P),{placement:"bottom",maxHeight:e};break;case"top":if(k>=g)return{placement:"top",maxHeight:e};if(L>=g&&!o)return s&&MH(l,O,F),{placement:"top",maxHeight:e};if(!o&&L>=i||o&&k>=i){var W=e;return(!o&&L>=i||o&&k>=i)&&(W=o?k-S:L-S),s&&MH(l,O,F),{placement:"top",maxHeight:W}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function $2t(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var $Ue=function(e){return e==="auto"?"bottom":e},H2t=function(e,t){var i,r=e.placement,s=e.theme,o=s.borderRadius,a=s.spacing,l=s.colors;return ut((i={label:"menu"},wt(i,$2t(r),"100%"),wt(i,"position","absolute"),wt(i,"width","100%"),wt(i,"zIndex",1),i),t?{}:{backgroundColor:l.neutral0,borderRadius:o,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})},HUe=x.createContext(null),V2t=function(e){var t=e.children,i=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,o=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,c=x.useContext(HUe)||{},u=c.setPortalPlacement,d=x.useRef(null),f=x.useState(r),p=Mt(f,2),g=p[0],m=p[1],_=x.useState(null),v=Mt(_,2),b=v[0],y=v[1],C=l.spacing.controlHeight;return Dhe(function(){var S=d.current;if(S){var k=o==="fixed",I=a&&!k,L=B2t({maxHeight:r,menuEl:S,minHeight:i,placement:s,shouldScroll:I,isFixedPosition:k,controlHeight:C});m(L.maxHeight),y(L.placement),u==null||u(L.placement)}},[r,s,o,a,i,u,C]),t({ref:d,placerProps:ut(ut({},e),{},{placement:b||$Ue(s),maxHeight:g})})},W2t=function(e){var t=e.children,i=e.innerRef,r=e.innerProps;return rs("div",hn({},Kc(e,"menu",{menu:!0}),{ref:i},r),t)},z2t=W2t,U2t=function(e,t){var i=e.maxHeight,r=e.theme.spacing.baseUnit;return ut({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},q2t=function(e){var t=e.children,i=e.innerProps,r=e.innerRef,s=e.isMulti;return rs("div",hn({},Kc(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},i),t)},VUe=function(e,t){var i=e.theme,r=i.spacing.baseUnit,s=i.colors;return ut({textAlign:"center"},t?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},K2t=VUe,G2t=VUe,Y2t=function(e){var t=e.children,i=t===void 0?"No options":t,r=e.innerProps,s=Na(e,j2t);return rs("div",hn({},Kc(ut(ut({},s),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},Q2t=function(e){var t=e.children,i=t===void 0?"Loading...":t,r=e.innerProps,s=Na(e,F2t);return rs("div",hn({},Kc(ut(ut({},s),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},X2t=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}},Z2t=function(e){var t=e.appendTo,i=e.children,r=e.controlElement,s=e.innerProps,o=e.menuPlacement,a=e.menuPosition,l=x.useRef(null),c=x.useRef(null),u=x.useState($Ue(o)),d=Mt(u,2),f=d[0],p=d[1],g=x.useMemo(function(){return{setPortalPlacement:p}},[]),m=x.useState(null),_=Mt(m,2),v=_[0],b=_[1],y=x.useCallback(function(){if(r){var I=A2t(r),L=a==="fixed"?0:window.pageYOffset,N=I[f]+L;(N!==(v==null?void 0:v.offset)||I.left!==(v==null?void 0:v.rect.left)||I.width!==(v==null?void 0:v.rect.width))&&b({offset:N,rect:I})}},[r,a,f,v==null?void 0:v.offset,v==null?void 0:v.rect.left,v==null?void 0:v.rect.width]);Dhe(function(){y()},[y]);var C=x.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&l.current&&(c.current=x2t(r,l.current,y,{elementResize:"ResizeObserver"in window}))},[r,y]);Dhe(function(){C()},[C]);var S=x.useCallback(function(I){l.current=I,C()},[C]);if(!t&&a!=="fixed"||!v)return null;var k=rs("div",hn({ref:S},Kc(ut(ut({},e),{},{offset:v.offset,position:a,rect:v.rect}),"menuPortal",{"menu-portal":!0}),s),i);return rs(HUe.Provider,{value:g},t?Bm.createPortal(k,t):k)},J2t=function(e){var t=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},eIt=function(e){var t=e.children,i=e.innerProps,r=e.isDisabled,s=e.isRtl;return rs("div",hn({},Kc(e,"container",{"--is-disabled":r,"--is-rtl":s}),i),t)},tIt=function(e,t){var i=e.theme.spacing,r=e.isMulti,s=e.hasValue,o=e.selectProps.controlShouldRenderValue;return ut({alignItems:"center",display:r&&s&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},nIt=function(e){var t=e.children,i=e.innerProps,r=e.isMulti,s=e.hasValue;return rs("div",hn({},Kc(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),i),t)},iIt=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},rIt=function(e){var t=e.children,i=e.innerProps;return rs("div",hn({},Kc(e,"indicatorsContainer",{indicators:!0}),i),t)},GNe,sIt=["size"],oIt=["innerProps","isRtl","size"],aIt={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},WUe=function(e){var t=e.size,i=Na(e,sIt);return rs("svg",hn({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:aIt},i))},pwe=function(e){return rs(WUe,hn({size:20},e),rs("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"}))},zUe=function(e){return rs(WUe,hn({size:20},e),rs("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"}))},UUe=function(e,t){var i=e.isFocused,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return ut({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:i?o.neutral60:o.neutral20,padding:s*2,":hover":{color:i?o.neutral80:o.neutral40}})},lIt=UUe,cIt=function(e){var t=e.children,i=e.innerProps;return rs("div",hn({},Kc(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),t||rs(zUe,null))},uIt=UUe,dIt=function(e){var t=e.children,i=e.innerProps;return rs("div",hn({},Kc(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),t||rs(pwe,null))},hIt=function(e,t){var i=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return ut({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:i?o.neutral10:o.neutral20,marginBottom:s*2,marginTop:s*2})},fIt=function(e){var t=e.innerProps;return rs("span",hn({},t,Kc(e,"indicatorSeparator",{"indicator-separator":!0})))},pIt=c2t(GNe||(GNe=u2t([` 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } `]))),gIt=function(e,t){var i=e.isFocused,r=e.size,s=e.theme,o=s.colors,a=s.spacing.baseUnit;return ut({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:i?o.neutral60:o.neutral20,padding:a*2})},ere=function(e){var t=e.delay,i=e.offset;return rs("span",{css:uwe({animation:"".concat(pIt," 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"},"","")})},mIt=function(e){var t=e.innerProps,i=e.isRtl,r=e.size,s=r===void 0?4:r,o=Na(e,oIt);return rs("div",hn({},Kc(ut(ut({},o),{},{innerProps:t,isRtl:i,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),rs(ere,{delay:0,offset:i}),rs(ere,{delay:160,offset:!0}),rs(ere,{delay:320,offset:!i}))},_It=function(e,t){var i=e.isDisabled,r=e.isFocused,s=e.theme,o=s.colors,a=s.borderRadius,l=s.spacing;return ut({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?o.neutral5:o.neutral0,borderColor:i?o.neutral10:r?o.primary:o.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:r?o.primary:o.neutral30}})},vIt=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,s=e.innerRef,o=e.innerProps,a=e.menuIsOpen;return rs("div",hn({ref:s},Kc(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":a}),o,{"aria-disabled":i||void 0}),t)},bIt=vIt,yIt=["data"],CIt=function(e,t){var i=e.theme.spacing;return t?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},wIt=function(e){var t=e.children,i=e.cx,r=e.getStyles,s=e.getClassNames,o=e.Heading,a=e.headingProps,l=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return rs("div",hn({},Kc(e,"group",{group:!0}),l),rs(o,hn({},a,{selectProps:d,theme:u,getStyles:r,getClassNames:s,cx:i}),c),rs("div",null,t))},xIt=function(e,t){var i=e.theme,r=i.colors,s=i.spacing;return ut({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},SIt=function(e){var t=jUe(e);t.data;var i=Na(t,yIt);return rs("div",hn({},Kc(e,"groupHeading",{"group-heading":!0}),i))},EIt=wIt,kIt=["innerRef","isDisabled","isHidden","inputClassName"],TIt=function(e,t){var i=e.isDisabled,r=e.value,s=e.theme,o=s.spacing,a=s.colors;return ut(ut({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},IIt),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:a.neutral80})},qUe={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},IIt={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ut({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},qUe)},LIt=function(e){return ut({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},qUe)},AIt=function(e){var t=e.cx,i=e.value,r=jUe(e),s=r.innerRef,o=r.isDisabled,a=r.isHidden,l=r.inputClassName,c=Na(r,kIt);return rs("div",hn({},Kc(e,"input",{"input-container":!0}),{"data-value":i||""}),rs("input",hn({className:t({input:!0},l),ref:s,style:LIt(a),disabled:o},c)))},NIt=AIt,DIt=function(e,t){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors;return ut({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:s/2,margin:r.baseUnit/2})},RIt=function(e,t){var i=e.theme,r=i.borderRadius,s=i.colors,o=e.cropWithEllipsis;return ut({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},PIt=function(e,t){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors,a=e.isFocused;return ut({alignItems:"center",display:"flex"},t?{}:{borderRadius:s/2,backgroundColor:a?o.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},KUe=function(e){var t=e.children,i=e.innerProps;return rs("div",i,t)},OIt=KUe,MIt=KUe;function jIt(n){var e=n.children,t=n.innerProps;return rs("div",hn({role:"button"},t),e||rs(pwe,{size:14}))}var FIt=function(e){var t=e.children,i=e.components,r=e.data,s=e.innerProps,o=e.isDisabled,a=e.removeProps,l=e.selectProps,c=i.Container,u=i.Label,d=i.Remove;return rs(c,{data:r,innerProps:ut(ut({},Kc(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),s),selectProps:l},rs(u,{data:r,innerProps:ut({},Kc(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),rs(d,{data:r,innerProps:ut(ut({},Kc(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},BIt=FIt,$It=function(e,t){var i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.theme,a=o.spacing,l=o.colors;return ut({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:s?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:s?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:s?l.primary:l.primary50}})},HIt=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.innerRef,a=e.innerProps;return rs("div",hn({},Kc(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":s}),{ref:o,"aria-disabled":i},a),t)},VIt=HIt,WIt=function(e,t){var i=e.theme,r=i.spacing,s=i.colors;return ut({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},zIt=function(e){var t=e.children,i=e.innerProps;return rs("div",hn({},Kc(e,"placeholder",{placeholder:!0}),i),t)},UIt=zIt,qIt=function(e,t){var i=e.isDisabled,r=e.theme,s=r.spacing,o=r.colors;return ut({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:i?o.neutral40:o.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},KIt=function(e){var t=e.children,i=e.isDisabled,r=e.innerProps;return rs("div",hn({},Kc(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),t)},GIt=KIt,o1={ClearIndicator:dIt,Control:bIt,DropdownIndicator:cIt,DownChevron:zUe,CrossIcon:pwe,Group:EIt,GroupHeading:SIt,IndicatorsContainer:rIt,IndicatorSeparator:fIt,Input:NIt,LoadingIndicator:mIt,Menu:z2t,MenuList:q2t,MenuPortal:Z2t,LoadingMessage:Q2t,NoOptionsMessage:Y2t,MultiValue:BIt,MultiValueContainer:OIt,MultiValueLabel:MIt,MultiValueRemove:jIt,Option:VIt,Placeholder:UIt,SelectContainer:eIt,SingleValue:GIt,ValueContainer:nIt},YIt=function(e){return ut(ut({},o1),e.components)},YNe=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function QIt(n,e){return!!(n===e||YNe(n)&&YNe(e))}function XIt(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!QIt(n[t],e[t]))return!1;return!0}function ad(n,e){e===void 0&&(e=XIt);var t=null;function i(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var o=n.apply(this,r);return t={lastResult:o,lastArgs:r,lastThis:this},o}return i.clear=function(){t=null},i}var ZIt={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"},JIt=function(e){return rs("span",hn({css:ZIt},e))},QNe=JIt,eLt={guidance:function(e){var t=e.isSearchable,i=e.isMulti,r=e.tabSelectsValue,s=e.context,o=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".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,s=e.labels,o=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(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return o?"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,s=e.label,o=s===void 0?"":s,a=e.selectValue,l=e.isDisabled,c=e.isSelected,u=e.isAppleDevice,d=function(m,_){return m&&m.length?"".concat(m.indexOf(_)+1," of ").concat(m.length):""};if(t==="value"&&a)return"value ".concat(o," focused, ").concat(d(a,i),".");if(t==="menu"&&u){var f=l?" disabled":"",p="".concat(c?" selected":"").concat(f);return"".concat(o).concat(p,", ").concat(d(r,i),".")}return""},onFilter:function(e){var t=e.inputValue,i=e.resultsMessage;return"".concat(i).concat(t?" for search term "+t:"",".")}},tLt=function(e){var t=e.ariaSelection,i=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,o=e.isFocused,a=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,p=l.inputValue,g=l.isMulti,m=l.isOptionDisabled,_=l.isSearchable,v=l.menuIsOpen,b=l.options,y=l.screenReaderStatus,C=l.tabSelectsValue,S=l.isLoading,k=l["aria-label"],I=l["aria-live"],L=x.useMemo(function(){return ut(ut({},eLt),d||{})},[d]),N=x.useMemo(function(){var B="";if(t&&L.onChange){var W=t.option,q=t.options,U=t.removedValue,G=t.removedValues,H=t.value,z=function(Ie){return Array.isArray(Ie)?null:Ie},Z=U||W||z(H),X=Z?f(Z):"",oe=q||G||void 0,fe=oe?oe.map(f):[],Se=ut({isDisabled:Z&&m(Z,a),label:X,labels:fe},t);B=L.onChange(Se)}return B},[t,L,m,a,f]),P=x.useMemo(function(){var B="",W=i||r,q=!!(i&&a&&a.includes(i));if(W&&L.onFocus){var U={focused:W,label:f(W),isDisabled:m(W,a),isSelected:q,options:s,context:W===i?"menu":"value",selectValue:a,isAppleDevice:u};B=L.onFocus(U)}return B},[i,r,f,m,L,s,a,u]),O=x.useMemo(function(){var B="";if(v&&b.length&&!S&&L.onFilter){var W=y({count:s.length});B=L.onFilter({inputValue:p,resultsMessage:W})}return B},[s,p,v,L,b,y,S]),F=(t==null?void 0:t.action)==="initial-input-focus",V=x.useMemo(function(){var B="";if(L.guidance){var W=r?"value":v?"menu":"input";B=L.guidance({"aria-label":k,context:W,isDisabled:i&&m(i,a),isMulti:g,isSearchable:_,tabSelectsValue:C,isInitialFocus:F})}return B},[k,i,r,g,m,_,v,L,a,C,F]),M=rs(x.Fragment,null,rs("span",{id:"aria-selection"},N),rs("span",{id:"aria-focused"},P),rs("span",{id:"aria-results"},O),rs("span",{id:"aria-guidance"},V));return rs(x.Fragment,null,rs(QNe,{id:c},F&&M),rs(QNe,{"aria-live":I,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!F&&M))},nLt=tLt,Rhe=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],iLt=new RegExp("["+Rhe.map(function(n){return n.letters}).join("")+"]","g"),GUe={};for(var tre=0;tre<Rhe.length;tre++)for(var nre=Rhe[tre],ire=0;ire<nre.letters.length;ire++)GUe[nre.letters[ire]]=nre.base;var YUe=function(e){return e.replace(iLt,function(t){return GUe[t]})},rLt=ad(YUe),XNe=function(e){return e.replace(/^\s+|\s+$/g,"")},sLt=function(e){return"".concat(e.label," ").concat(e.value)},oLt=function(e){return function(t,i){if(t.data.__isNew__)return!0;var r=ut({ignoreCase:!0,ignoreAccents:!0,stringify:sLt,trim:!0,matchFrom:"any"},e),s=r.ignoreCase,o=r.ignoreAccents,a=r.stringify,l=r.trim,c=r.matchFrom,u=l?XNe(i):i,d=l?XNe(a(t)):a(t);return s&&(u=u.toLowerCase(),d=d.toLowerCase()),o&&(u=rLt(u),d=YUe(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},aLt=["innerRef"];function lLt(n){var e=n.innerRef,t=Na(n,aLt),i=M2t(t,"onExited","in","enter","exit","appear");return rs("input",hn({ref:e},i,{css:uwe({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 cLt=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function uLt(n){var e=n.isEnabled,t=n.onBottomArrive,i=n.onBottomLeave,r=n.onTopArrive,s=n.onTopLeave,o=x.useRef(!1),a=x.useRef(!1),l=x.useRef(0),c=x.useRef(null),u=x.useCallback(function(_,v){if(c.current!==null){var b=c.current,y=b.scrollTop,C=b.scrollHeight,S=b.clientHeight,k=c.current,I=v>0,L=C-S-y,N=!1;L>v&&o.current&&(i&&i(_),o.current=!1),I&&a.current&&(s&&s(_),a.current=!1),I&&v>L?(t&&!o.current&&t(_),k.scrollTop=C,N=!0,o.current=!0):!I&&-v>y&&(r&&!a.current&&r(_),k.scrollTop=0,N=!0,a.current=!0),N&&cLt(_)}},[t,i,r,s]),d=x.useCallback(function(_){u(_,_.deltaY)},[u]),f=x.useCallback(function(_){l.current=_.changedTouches[0].clientY},[]),p=x.useCallback(function(_){var v=l.current-_.changedTouches[0].clientY;u(_,v)},[u]),g=x.useCallback(function(_){if(_){var v=R2t?{passive:!1}:!1;_.addEventListener("wheel",d,v),_.addEventListener("touchstart",f,v),_.addEventListener("touchmove",p,v)}},[p,f,d]),m=x.useCallback(function(_){_&&(_.removeEventListener("wheel",d,!1),_.removeEventListener("touchstart",f,!1),_.removeEventListener("touchmove",p,!1))},[p,f,d]);return x.useEffect(function(){if(e){var _=c.current;return g(_),function(){m(_)}}},[e,g,m]),function(_){c.current=_}}var ZNe=["boxSizing","height","overflow","paddingRight","position"],JNe={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function eDe(n){n.cancelable&&n.preventDefault()}function tDe(n){n.stopPropagation()}function nDe(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function iDe(){return"ontouchstart"in window||navigator.maxTouchPoints}var rDe=!!(typeof window<"u"&&window.document&&window.document.createElement),x5=0,gD={capture:!1,passive:!1};function dLt(n){var e=n.isEnabled,t=n.accountForScrollbars,i=t===void 0?!0:t,r=x.useRef({}),s=x.useRef(null),o=x.useCallback(function(l){if(rDe){var c=document.body,u=c&&c.style;if(i&&ZNe.forEach(function(g){var m=u&&u[g];r.current[g]=m}),i&&x5<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,p=window.innerWidth-f+d||0;Object.keys(JNe).forEach(function(g){var m=JNe[g];u&&(u[g]=m)}),u&&(u.paddingRight="".concat(p,"px"))}c&&iDe()&&(c.addEventListener("touchmove",eDe,gD),l&&(l.addEventListener("touchstart",nDe,gD),l.addEventListener("touchmove",tDe,gD))),x5+=1}},[i]),a=x.useCallback(function(l){if(rDe){var c=document.body,u=c&&c.style;x5=Math.max(x5-1,0),i&&x5<1&&ZNe.forEach(function(d){var f=r.current[d];u&&(u[d]=f)}),c&&iDe()&&(c.removeEventListener("touchmove",eDe,gD),l&&(l.removeEventListener("touchstart",nDe,gD),l.removeEventListener("touchmove",tDe,gD)))}},[i]);return x.useEffect(function(){if(e){var l=s.current;return o(l),function(){a(l)}}},[e,o,a]),function(l){s.current=l}}var hLt=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},fLt={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function pLt(n){var e=n.children,t=n.lockEnabled,i=n.captureEnabled,r=i===void 0?!0:i,s=n.onBottomArrive,o=n.onBottomLeave,a=n.onTopArrive,l=n.onTopLeave,c=uLt({isEnabled:r,onBottomArrive:s,onBottomLeave:o,onTopArrive:a,onTopLeave:l}),u=dLt({isEnabled:t}),d=function(p){c(p),u(p)};return rs(x.Fragment,null,t&&rs("div",{onClick:hLt,css:fLt}),e(d))}var gLt={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},mLt=function(e){var t=e.name,i=e.onFocus;return rs("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:gLt,value:"",onChange:function(){}})},_Lt=mLt;function gwe(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function vLt(){return gwe(/^iPhone/i)}function QUe(){return gwe(/^Mac/i)}function bLt(){return gwe(/^iPad/i)||QUe()&&navigator.maxTouchPoints>1}function yLt(){return vLt()||bLt()}function CLt(){return QUe()||yLt()}var wLt=function(e){return e.label},xLt=function(e){return e.label},SLt=function(e){return e.value},ELt=function(e){return!!e.isDisabled},kLt={clearIndicator:uIt,container:J2t,control:_It,dropdownIndicator:lIt,group:CIt,groupHeading:xIt,indicatorsContainer:iIt,indicatorSeparator:hIt,input:TIt,loadingIndicator:gIt,loadingMessage:G2t,menu:H2t,menuList:U2t,menuPortal:X2t,multiValue:DIt,multiValueLabel:RIt,multiValueRemove:PIt,noOptionsMessage:K2t,option:$It,placeholder:WIt,singleValue:qIt,valueContainer:tIt},TLt={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%)"},ILt=4,XUe=4,LLt=38,ALt=XUe*2,NLt={baseUnit:XUe,controlHeight:LLt,menuGutter:ALt},rre={borderRadius:ILt,colors:TLt,spacing:NLt},DLt={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:KNe(),captureMenuScroll:!KNe(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:oLt(),formatGroupLabel:wLt,getOptionLabel:xLt,getOptionValue:SLt,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ELt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!N2t(),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 sDe(n,e,t,i){var r=eqe(n,e,t),s=tqe(n,e,t),o=JUe(n,e),a=bq(n,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:o,value:a,index:i}}function yz(n,e){return n.options.map(function(t,i){if("options"in t){var r=t.options.map(function(o,a){return sDe(n,o,e,a)}).filter(function(o){return aDe(n,o)});return r.length>0?{type:"group",data:t,options:r,index:i}:void 0}var s=sDe(n,t,e,i);return aDe(n,s)?s:void 0}).filter(P2t)}function ZUe(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,_r(t.options.map(function(i){return i.data}))):e.push(t.data),e},[])}function oDe(n,e){return n.reduce(function(t,i){return i.type==="group"?t.push.apply(t,_r(i.options.map(function(r){return{data:r.data,id:"".concat(e,"-").concat(i.index,"-").concat(r.index)}}))):t.push({data:i.data,id:"".concat(e,"-").concat(i.index)}),t},[])}function RLt(n,e){return ZUe(yz(n,e))}function aDe(n,e){var t=n.inputValue,i=t===void 0?"":t,r=e.data,s=e.isSelected,o=e.label,a=e.value;return(!iqe(n)||!s)&&nqe(n,{label:o,value:a,data:r},i)}function PLt(n,e){var t=n.focusedValue,i=n.selectValue,r=i.indexOf(t);if(r>-1){var s=e.indexOf(t);if(s>-1)return t;if(r<e.length)return e[r]}return null}function OLt(n,e){var t=n.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}var sre=function(e,t){var i,r=(i=e.find(function(s){return s.data===t}))===null||i===void 0?void 0:i.id;return r||null},JUe=function(e,t){return e.getOptionLabel(t)},bq=function(e,t){return e.getOptionValue(t)};function eqe(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function tqe(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var i=bq(n,e);return t.some(function(r){return bq(n,r)===i})}function nqe(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var iqe=function(e){var t=e.hideSelectedOptions,i=e.isMulti;return t===void 0?i:t},MLt=1,rqe=function(n){$m(t,n);var e=Hw(t);function t(i){var r;if(Ra(this,t),r=e.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=CLt(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,c){var u=r.props,d=u.onChange,f=u.name;c.name=f,r.ariaOnChange(l,c),d(l,c)},r.setValue=function(l,c,u){var d=r.props,f=d.closeMenuOnSelect,p=d.isMulti,g=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:g}),f&&(r.setState({inputIsHiddenAfterUpdate:!p}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:c,option:u})},r.selectOption=function(l){var c=r.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,p=r.state.selectValue,g=d&&r.isOptionSelected(l,p),m=r.isOptionDisabled(l,p);if(g){var _=r.getOptionValue(l);r.setValue(p.filter(function(v){return r.getOptionValue(v)!==_}),"deselect-option",l)}else if(!m)d?r.setValue([].concat(_r(p),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}u&&r.blurInput()},r.removeValue=function(l){var c=r.props.isMulti,u=r.state.selectValue,d=r.getOptionValue(l),f=u.filter(function(g){return r.getOptionValue(g)!==d}),p=FH(c,f,f[0]||null);r.onChange(p,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(FH(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,c=r.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=FH(l,d,d[0]||null);u&&r.onChange(f,{action:"pop-value",removedValue:u})},r.getFocusedOptionId=function(l){return sre(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return oDe(yz(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return k2t.apply(void 0,[r.props.classNamePrefix].concat(c))},r.getOptionLabel=function(l){return JUe(r.props,l)},r.getOptionValue=function(l){return bq(r.props,l)},r.getStyles=function(l,c){var u=r.props.unstyled,d=kLt[l](c,u);d.boxSizing="border-box";var f=r.props.styles[l];return f?f(d,c):d},r.getClassNames=function(l,c){var u,d;return(u=(d=r.props.classNames)[l])===null||u===void 0?void 0:u.call(d,c)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return YIt(r.props)},r.buildCategorizedOptions=function(){return yz(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return ZUe(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,c){r.setState({ariaSelection:ut({value:l},c)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var c=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():c&&r.openMenu("first"):(c&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var c=r.props,u=c.isMulti,d=c.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!u}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&UZ(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var c=l.touches,u=c&&c.item(0);u&&(r.initialTouchX=u.clientX,r.initialTouchY=u.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var c=l.touches,u=c&&c.item(0);if(u){var d=Math.abs(u.clientX-r.initialTouchX),f=Math.abs(u.clientY-r.initialTouchY),p=5;r.userIsDragging=d>p||f>p}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var c=r.props.inputValue,u=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(u,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var c=r.getFocusableOptions(),u=c.indexOf(l);r.setState({focusedOption:l,focusedOptionId:u>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return iqe(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var c=r.props,u=c.isMulti,d=c.backspaceRemovesValue,f=c.escapeClearsValue,p=c.inputValue,g=c.isClearable,m=c.isDisabled,_=c.menuIsOpen,v=c.onKeyDown,b=c.tabSelectsValue,y=c.openMenuOnFocus,C=r.state,S=C.focusedOption,k=C.focusedValue,I=C.selectValue;if(!m&&!(typeof v=="function"&&(v(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!u||p)return;r.focusValue("previous");break;case"ArrowRight":if(!u||p)return;r.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(k)r.removeValue(k);else{if(!d)return;u?r.popValue():g&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!_||!b||!S||y&&r.isOptionSelected(S,I))return;r.selectOption(S);break;case"Enter":if(l.keyCode===229)break;if(_){if(!S||r.isComposing)return;r.selectOption(S);break}return;case"Escape":_?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:p}),r.onMenuClose()):g&&f&&r.clearValue();break;case" ":if(p)return;if(!_){r.openMenu("first");break}if(!S)return;r.selectOption(S);break;case"ArrowUp":_?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":_?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!_)return;r.focusOption("pageup");break;case"PageDown":if(!_)return;r.focusOption("pagedown");break;case"Home":if(!_)return;r.focusOption("first");break;case"End":if(!_)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++MLt),r.state.selectValue=UNe(i.value),i.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),o=r.buildFocusableOptions(),a=o.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=o[a],r.state.focusedOptionId=sre(s,o[a])}return r}return Pa(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&&qNe(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var s=this.props,o=s.isDisabled,a=s.menuIsOpen,l=this.state.isFocused;(l&&!o&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&o&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!o&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(qNe(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,s){this.props.onInputChange(r,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var s=this,o=this.state,a=o.selectValue,l=o.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],focusedOptionId:this.getFocusedOptionId(c[u])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(r){var s=this.state,o=s.selectValue,a=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=o.indexOf(a);a||(l=-1);var c=o.length-1,u=-1;if(o.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:o[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,o=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(o);o||(c=-1),r==="up"?l=c>0?c-1:a.length-1:r==="down"?l=(c+1)%a.length:r==="pageup"?(l=c-s,l<0&&(l=0)):r==="pagedown"?(l=c+s,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(rre):ut(ut({},rre),this.props.theme):rre}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,o=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,u=this.setValue,d=this.props,f=d.isMulti,p=d.isRtl,g=d.options,m=this.hasValue();return{clearValue:r,cx:s,getStyles:o,getClassNames:a,getValue:l,hasValue:m,isMulti:f,isRtl:p,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,s=r.isClearable,o=r.isMulti;return s===void 0?o:s}},{key:"isOptionDisabled",value:function(r,s){return eqe(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return tqe(this.props,r,s)}},{key:"filterOption",value:function(r,s){return nqe(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:o,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,s=r.isDisabled,o=r.isSearchable,a=r.inputId,l=r.inputValue,c=r.tabIndex,u=r.form,d=r.menuIsOpen,f=r.required,p=this.getComponents(),g=p.Input,m=this.state,_=m.inputIsHidden,v=m.ariaSelection,b=this.commonProps,y=a||this.getElementId("input"),C=ut(ut(ut({"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":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(v==null?void 0:v.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?x.createElement(g,hn({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:y,innerRef:this.getInputRef,isDisabled:s,isHidden:_,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:u,type:"text",value:l},C)):x.createElement(lLt,hn({id:y,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:_q,onFocus:this.onInputFocus,disabled:s,tabIndex:c,inputMode:"none",form:u,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),o=s.MultiValue,a=s.MultiValueContainer,l=s.MultiValueLabel,c=s.MultiValueRemove,u=s.SingleValue,d=s.Placeholder,f=this.commonProps,p=this.props,g=p.controlShouldRenderValue,m=p.isDisabled,_=p.isMulti,v=p.inputValue,b=p.placeholder,y=this.state,C=y.selectValue,S=y.focusedValue,k=y.isFocused;if(!this.hasValue()||!g)return v?null:x.createElement(d,hn({},f,{key:"placeholder",isDisabled:m,isFocused:k,innerProps:{id:this.getElementId("placeholder")}}),b);if(_)return C.map(function(L,N){var P=L===S,O="".concat(r.getOptionLabel(L),"-").concat(r.getOptionValue(L));return x.createElement(o,hn({},f,{components:{Container:a,Label:l,Remove:c},isFocused:P,isDisabled:m,key:O,index:N,removeProps:{onClick:function(){return r.removeValue(L)},onTouchEnd:function(){return r.removeValue(L)},onMouseDown:function(V){V.preventDefault()}},data:L}),r.formatOptionLabel(L,"value"))});if(v)return null;var I=C[0];return x.createElement(u,hn({},f,{data:I,isDisabled:m}),this.formatOptionLabel(I,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,o=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!this.isClearable()||!s||l||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return x.createElement(s,hn({},o,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,o=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!s||!c)return null;var d={"aria-hidden":"true"};return x.createElement(s,hn({},o,{innerProps:d,isDisabled:l,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,o=r.IndicatorSeparator;if(!s||!o)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return x.createElement(o,hn({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var o=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return x.createElement(s,hn({},o,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),o=s.Group,a=s.GroupHeading,l=s.Menu,c=s.MenuList,u=s.MenuPortal,d=s.LoadingMessage,f=s.NoOptionsMessage,p=s.Option,g=this.commonProps,m=this.state.focusedOption,_=this.props,v=_.captureMenuScroll,b=_.inputValue,y=_.isLoading,C=_.loadingMessage,S=_.minMenuHeight,k=_.maxMenuHeight,I=_.menuIsOpen,L=_.menuPlacement,N=_.menuPosition,P=_.menuPortalTarget,O=_.menuShouldBlockScroll,F=_.menuShouldScrollIntoView,V=_.noOptionsMessage,M=_.onMenuScrollToTop,B=_.onMenuScrollToBottom;if(!I)return null;var W=function(X,oe){var fe=X.type,Se=X.data,Me=X.isDisabled,Ie=X.isSelected,ge=X.label,ye=X.value,Pe=m===Se,Be=Me?void 0:function(){return r.onOptionHover(Se)},$e=Me?void 0:function(){return r.selectOption(Se)},qe="".concat(r.getElementId("option"),"-").concat(oe),mt={id:qe,onClick:$e,onMouseMove:Be,onMouseOver:Be,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:Ie};return x.createElement(p,hn({},g,{innerProps:mt,data:Se,isDisabled:Me,isSelected:Ie,key:qe,label:ge,type:fe,value:ye,isFocused:Pe,innerRef:Pe?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(X.data,"menu"))},q;if(this.hasOptions())q=this.getCategorizedOptions().map(function(Z){if(Z.type==="group"){var X=Z.data,oe=Z.options,fe=Z.index,Se="".concat(r.getElementId("group"),"-").concat(fe),Me="".concat(Se,"-heading");return x.createElement(o,hn({},g,{key:Se,data:X,options:oe,Heading:a,headingProps:{id:Me,data:Z.data},label:r.formatGroupLabel(Z.data)}),Z.options.map(function(Ie){return W(Ie,"".concat(fe,"-").concat(Ie.index))}))}else if(Z.type==="option")return W(Z,"".concat(Z.index))});else if(y){var U=C({inputValue:b});if(U===null)return null;q=x.createElement(d,g,U)}else{var G=V({inputValue:b});if(G===null)return null;q=x.createElement(f,g,G)}var H={minMenuHeight:S,maxMenuHeight:k,menuPlacement:L,menuPosition:N,menuShouldScrollIntoView:F},z=x.createElement(V2t,hn({},g,H),function(Z){var X=Z.ref,oe=Z.placerProps,fe=oe.placement,Se=oe.maxHeight;return x.createElement(l,hn({},g,H,{innerRef:X,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:y,placement:fe}),x.createElement(pLt,{captureEnabled:v,onTopArrive:M,onBottomArrive:B,lockEnabled:O},function(Me){return x.createElement(c,hn({},g,{innerRef:function(ge){r.getMenuListRef(ge),Me(ge)},innerProps:{role:"listbox","aria-multiselectable":g.isMulti,id:r.getElementId("listbox")},isLoading:y,maxHeight:Se,focusedOption:m}),q)}))});return P||N==="fixed"?x.createElement(u,hn({},g,{appendTo:P,controlElement:this.controlRef,menuPlacement:L,menuPosition:N}),z):z}},{key:"renderFormField",value:function(){var r=this,s=this.props,o=s.delimiter,a=s.isDisabled,l=s.isMulti,c=s.name,u=s.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!a)return x.createElement(_Lt,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(o){var f=d.map(function(m){return r.getOptionValue(m)}).join(o);return x.createElement("input",{name:c,type:"hidden",value:f})}else{var p=d.length>0?d.map(function(m,_){return x.createElement("input",{key:"i-".concat(_),name:c,type:"hidden",value:r.getOptionValue(m)})}):x.createElement("input",{name:c,type:"hidden",value:""});return x.createElement("div",null,p)}else{var g=d[0]?this.getOptionValue(d[0]):"";return x.createElement("input",{name:c,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,o=s.ariaSelection,a=s.focusedOption,l=s.focusedValue,c=s.isFocused,u=s.selectValue,d=this.getFocusableOptions();return x.createElement(nLt,hn({},r,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:a,focusedValue:l,isFocused:c,selectValue:u,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,o=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,c=this.props,u=c.className,d=c.id,f=c.isDisabled,p=c.menuIsOpen,g=this.state.isFocused,m=this.commonProps=this.getCommonProps();return x.createElement(a,hn({},m,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:g}),this.renderLiveRegion(),x.createElement(s,hn({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:g,menuIsOpen:p}),x.createElement(l,hn({},m,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),x.createElement(o,hn({},m,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,s){var o=s.prevProps,a=s.clearFocusValueOnUpdate,l=s.inputIsHiddenAfterUpdate,c=s.ariaSelection,u=s.isFocused,d=s.prevWasFocused,f=s.instancePrefix,p=r.options,g=r.value,m=r.menuIsOpen,_=r.inputValue,v=r.isMulti,b=UNe(g),y={};if(o&&(g!==o.value||p!==o.options||m!==o.menuIsOpen||_!==o.inputValue)){var C=m?RLt(r,b):[],S=m?oDe(yz(r,b),"".concat(f,"-option")):[],k=a?PLt(s,b):null,I=OLt(s,C),L=sre(S,I);y={selectValue:b,focusedOption:I,focusedOptionId:L,focusableOptionsWithIds:S,focusedValue:k,clearFocusValueOnUpdate:!1}}var N=l!=null&&r!==o?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},P=c,O=u&&d;return u&&!O&&(P={value:FH(v,b,b[0]||null),options:b,action:"initial-input-focus"},O=!d),(c==null?void 0:c.action)==="initial-input-focus"&&(P=null),ut(ut(ut({},y),N),{},{prevProps:r,ariaSelection:P,prevWasFocused:O})}}]),t}(x.Component);rqe.defaultProps=DLt;var jLt=x.forwardRef(function(n,e){var t=fTt(n);return x.createElement(rqe,hn({ref:e},t))}),qZ=jLt;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function $y(n){const{color:e="#000",size:t="1.2rem",withoutColor:i=!1,strokeWidth:r="2"}=n;return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:t,height:t},viewBox:"0 0 20 20",children:h.jsx("polyline",{points:"3.5 7.5 10 14 16.5 7.5",fill:"none",...!i&&{stroke:e},strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:r})})}function KZ(n){const[e,t]=x.useState(!0),i=xt();return h.jsx("div",{style:{color:i.$3,colorScheme:i.$0,backgroundColor:i.$1},className:$t(`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:h.jsx("div",{className:"mx-4",children:h.jsx("div",{style:{color:i.$3,colorScheme:i.$0,backgroundColor:i.$1,borderColor:i.$4},className:$t("text-sm",{"text-red-700":n.type==="danger","text-yellow-700":n.type==="warning","text-green-700":n.type==="success"}),children:h.jsxs("div",{className:"flex items-center justify-between space-x-2",style:{backgroundColor:i.$1,borderColor:i.$4},children:[h.jsx("div",{className:"w-full break-all",style:{backgroundColor:i.$1,borderColor:i.$4},children:n.children}),!n.disableClosing&&h.jsx("button",{type:"button",children:h.jsx(JM,{onClick:()=>t(!1)})})]})})})})}function Kl({children:n,className:e}){return x.useEffect(()=>{const t=document.querySelector(".error-message-box");t&&t.scrollIntoView({behavior:"smooth",block:"center"})},[n]),n?h.jsx(KZ,{className:$t("error-message-box",e),type:"danger",children:n}):null}function Dn(n){const e=xt(),{blankOptionValue:t,withBlank:i,children:r,value:s,defaultValue:o,customSelector:a,onValueChange:l,className:c,disabled:u,cypressRef:d,dismissable:f=!0,clearAfterSelection:p,searchable:g=!0,controlIcon:m,controlStyle:_,dropdownIndicatorClassName:v}=n,b=h.jsx("option",{value:t??""}),y=we.Children.map([i?b:[],r],I=>x.isValidElement(I)&&{label:Array.isArray(I.props.children)?I.props.children.join(""):I.props.children,value:I.props.value}),C=y==null?void 0:y.find(I=>I.value===s),S=y==null?void 0:y.find(I=>I.value===o),k={input:I=>pn.merge(I,{color:e.$3}),singleValue:I=>pn.merge(I,{color:e.$3}),menu:I=>pn.merge(I,{width:"max-content",minWidth:"100%",backgroundColor:e.$4,borderColor:e.$4,zIndex:50}),control:(I,{isDisabled:L,isFocused:N})=>pn.merge(I,{borderRadius:"0.375rem",backgroundColor:e.$1,color:e.$3,borderColor:N?e.$3:e.$24,cursor:L?"not-allowed":"pointer",pointerEvents:L?"auto":"unset",boxShadow:"none","&:hover":{borderColor:N?e.$3:e.$24},..._}),option:(I,{isSelected:L,isFocused:N})=>pn.merge(I,{display:"flex",alignItems:"center",color:e.$3,backgroundColor:L||N?e.$7:e.$1,":hover":{backgroundColor:e.$7},minHeight:"1.875rem"}),indicatorSeparator:()=>({display:"none"})};return h.jsxs("div",{className:$t({"space-y-2":!!a}),children:[n.label&&h.jsxs(Lh,{className:"mb-1",for:n.id,children:[n.label,n.required&&h.jsx("span",{className:"ml-1 text-red-600",children:"*"})]}),a?h.jsx(qZ,{className:c,options:y,defaultValue:S,value:p?{label:"",value:""}:C,onChange:I=>I?l==null?void 0:l(I.value):l==null?void 0:l(t??""),menuPosition:n.menuPosition,isDisabled:u,styles:k,isSearchable:g,isClearable:!!(f&&(C!=null&&C.value)&&(C==null?void 0:C.value)!==t),blurInputOnSelect:!0,"data-cy":d,components:{...(m||n.menuPosition!=="fixed")&&{Control:({children:I,...L})=>h.jsxs("div",{className:$t("flex items-center rounded-md border cursor-pointer",{"pl-2":m,"pl-1":!m}),style:{height:"2.5rem",backgroundColor:e.$1,borderColor:L.isFocused?e.$3:e.$24,..._},...L.innerProps,children:[m,I]})},DropdownIndicator:()=>h.jsx("div",{className:$t("flex items-center justify-center px-3 hover:opacity-75 h-full w-full",v),style:{color:e.$3},children:h.jsx($y,{color:e.$3,size:"1rem"})})}}):h.jsxs("select",{onChange:I=>{n.onValueChange&&n.onValueChange(I.target.value),n.onChange&&n.onChange(I)},id:n.id,className:$t(`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&&h.jsx("option",{value:n.blankOptionValue??""}),n.children]}),h.jsx(Kl,{className:"mt-2",children:n.errorMessage})]})}const FLt=Ls(null);var S5={},ore,lDe;function BLt(){if(lDe)return ore;lDe=1;var n="Expected a function",e=NaN,t="[object Symbol]",i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,l=typeof hb=="object"&&hb&&hb.Object===Object&&hb,c=typeof self=="object"&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype,f=d.toString,p=Math.max,g=Math.min,m=function(){return u.Date.now()};function _(S,k,I){var L,N,P,O,F,V,M=0,B=!1,W=!1,q=!0;if(typeof S!="function")throw new TypeError(n);k=C(k)||0,v(I)&&(B=!!I.leading,W="maxWait"in I,P=W?p(C(I.maxWait)||0,k):P,q="trailing"in I?!!I.trailing:q);function U(Me){var Ie=L,ge=N;return L=N=void 0,M=Me,O=S.apply(ge,Ie),O}function G(Me){return M=Me,F=setTimeout(Z,k),B?U(Me):O}function H(Me){var Ie=Me-V,ge=Me-M,ye=k-Ie;return W?g(ye,P-ge):ye}function z(Me){var Ie=Me-V,ge=Me-M;return V===void 0||Ie>=k||Ie<0||W&&ge>=P}function Z(){var Me=m();if(z(Me))return X(Me);F=setTimeout(Z,H(Me))}function X(Me){return F=void 0,q&&L?U(Me):(L=N=void 0,O)}function oe(){F!==void 0&&clearTimeout(F),M=0,L=V=N=F=void 0}function fe(){return F===void 0?O:X(m())}function Se(){var Me=m(),Ie=z(Me);if(L=arguments,N=this,V=Me,Ie){if(F===void 0)return G(V);if(W)return F=setTimeout(Z,k),U(V)}return F===void 0&&(F=setTimeout(Z,k)),O}return Se.cancel=oe,Se.flush=fe,Se}function v(S){var k=typeof S;return!!S&&(k=="object"||k=="function")}function b(S){return!!S&&typeof S=="object"}function y(S){return typeof S=="symbol"||b(S)&&f.call(S)==t}function C(S){if(typeof S=="number")return S;if(y(S))return e;if(v(S)){var k=typeof S.valueOf=="function"?S.valueOf():S;S=v(k)?k+"":k}if(typeof S!="string")return S===0?S:+S;S=S.replace(i,"");var I=s.test(S);return I||o.test(S)?a(S.slice(2),I?2:8):r.test(S)?e:+S}return ore=_,ore}var cDe;function $Lt(){if(cDe)return S5;cDe=1;function n(S){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},n(S)}Object.defineProperty(S5,"__esModule",{value:!0}),S5.DebounceInput=void 0;var e=r(dv()),t=r(BLt()),i=["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"];function r(S){return S&&S.__esModule?S:{default:S}}function s(S,k){if(S==null)return{};var I=o(S,k),L,N;if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(S);for(N=0;N<P.length;N++)L=P[N],!(k.indexOf(L)>=0)&&Object.prototype.propertyIsEnumerable.call(S,L)&&(I[L]=S[L])}return I}function o(S,k){if(S==null)return{};var I={},L=Object.keys(S),N,P;for(P=0;P<L.length;P++)N=L[P],!(k.indexOf(N)>=0)&&(I[N]=S[N]);return I}function a(S,k){var I=Object.keys(S);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(S);k&&(L=L.filter(function(N){return Object.getOwnPropertyDescriptor(S,N).enumerable})),I.push.apply(I,L)}return I}function l(S){for(var k=1;k<arguments.length;k++){var I=arguments[k]!=null?arguments[k]:{};k%2?a(Object(I),!0).forEach(function(L){y(S,L,I[L])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(I)):a(Object(I)).forEach(function(L){Object.defineProperty(S,L,Object.getOwnPropertyDescriptor(I,L))})}return S}function c(S,k){if(!(S instanceof k))throw new TypeError("Cannot call a class as a function")}function u(S,k){for(var I=0;I<k.length;I++){var L=k[I];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(S,L.key,L)}}function d(S,k,I){return k&&u(S.prototype,k),Object.defineProperty(S,"prototype",{writable:!1}),S}function f(S,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(k&&k.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),Object.defineProperty(S,"prototype",{writable:!1}),k&&p(S,k)}function p(S,k){return p=Object.setPrototypeOf||function(L,N){return L.__proto__=N,L},p(S,k)}function g(S){var k=v();return function(){var L=b(S),N;if(k){var P=b(this).constructor;N=Reflect.construct(L,arguments,P)}else N=L.apply(this,arguments);return m(this,N)}}function m(S,k){if(k&&(n(k)==="object"||typeof k=="function"))return k;if(k!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _(S)}function _(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function v(){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 b(S){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},b(S)}function y(S,k,I){return k in S?Object.defineProperty(S,k,{value:I,enumerable:!0,configurable:!0,writable:!0}):S[k]=I,S}var C=function(S){f(I,S);var k=g(I);function I(L){var N;c(this,I),N=k.call(this,L),y(_(N),"onChange",function(O){O.persist();var F=N.state.value,V=N.props.minLength;N.setState({value:O.target.value},function(){var M=N.state.value;if(M.length>=V){N.notify(O);return}F.length>M.length&&N.notify(l(l({},O),{},{target:l(l({},O.target),{},{value:""})}))})}),y(_(N),"onKeyDown",function(O){O.key==="Enter"&&N.forceNotify(O);var F=N.props.onKeyDown;F&&(O.persist(),F(O))}),y(_(N),"onBlur",function(O){N.forceNotify(O);var F=N.props.onBlur;F&&(O.persist(),F(O))}),y(_(N),"createNotifier",function(O){if(O<0)N.notify=function(){return null};else if(O===0)N.notify=N.doNotify;else{var F=(0,t.default)(function(V){N.isDebouncing=!1,N.doNotify(V)},O);N.notify=function(V){N.isDebouncing=!0,F(V)},N.flush=function(){return F.flush()},N.cancel=function(){N.isDebouncing=!1,F.cancel()}}}),y(_(N),"doNotify",function(){var O=N.props.onChange;O.apply(void 0,arguments)}),y(_(N),"forceNotify",function(O){var F=N.props.debounceTimeout;if(!(!N.isDebouncing&&F>0)){N.cancel&&N.cancel();var V=N.state.value,M=N.props.minLength;V.length>=M?N.doNotify(O):N.doNotify(l(l({},O),{},{target:l(l({},O.target),{},{value:V})}))}}),N.isDebouncing=!1,N.state={value:typeof L.value>"u"||L.value===null?"":L.value};var P=N.props.debounceTimeout;return N.createNotifier(P),N}return d(I,[{key:"componentDidUpdate",value:function(N){if(!this.isDebouncing){var P=this.props,O=P.value,F=P.debounceTimeout,V=N.debounceTimeout,M=N.value,B=this.state.value;typeof O<"u"&&M!==O&&B!==O&&this.setState({value:O}),F!==V&&this.createNotifier(F)}}},{key:"componentWillUnmount",value:function(){this.flush&&this.flush()}},{key:"render",value:function(){var N=this.props,P=N.element;N.onChange,N.value,N.minLength,N.debounceTimeout;var O=N.forceNotifyByEnter,F=N.forceNotifyOnBlur,V=N.onKeyDown,M=N.onBlur,B=N.inputRef,W=s(N,i),q=this.state.value,U;O?U={onKeyDown:this.onKeyDown}:V?U={onKeyDown:V}:U={};var G;F?G={onBlur:this.onBlur}:M?G={onBlur:M}:G={};var H=B?{ref:B}:{};return e.default.createElement(P,l(l(l(l({},W),{},{onChange:this.onChange,value:q},U),G),H))}}]),I}(e.default.PureComponent);return S5.DebounceInput=C,y(C,"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}),S5}var are,uDe;function HLt(){if(uDe)return are;uDe=1;var n=$Lt(),e=n.DebounceInput;return e.DebounceInput=e,are=e,are}var VLt=HLt();function sqe(n){return Ui({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 oqe(n){return Ui({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 WLt(n){return Ui({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]})(n)}function lt(n){const e=xt(),t=Qo({overwrite:!1}),i=n.type==="password",[r,s]=x.useState(!0),o=x.useMemo(()=>n.type==="password"&&r?"password":n.type==="password"&&!r?"text":n.type,[n.type,r]);return h.jsxs("section",{style:{width:n.width},children:[n.label&&h.jsxs(Lh,{className:$t("mb-1",{"whitespace-nowrap":n.withoutLabelWrapping}),for:n.id,children:[n.label,n.required&&h.jsx("span",{className:"ml-1 text-red-600",children:"*"})]}),h.jsxs("div",{className:"relative",children:[h.jsx(VLt.DebounceInput,{style:{backgroundColor:e.$1,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:o,className:$t(`w-full py-2 px-3 rounded-md text-sm disabled:opacity-75 disabled:cursor-not-allowed focus:outline-none focus:ring-0 ${n.className}`,{border:n.border!==!1,"border-[#09090B26] focus:border-black":!t.dark_mode,"border-[#1f2e41] focus:border-white":t.dark_mode}),placeholder:n.placeholder||"",onBlur:a=>{n.changeOverride||(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.onClick&&n.onClick(),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&&h.jsx("span",{className:"absolute top-1/4 right-3 cursor-pointer",children:r?h.jsx(oqe,{className:"text-gray-400",fontSize:19,onClick:()=>s(!1)}):h.jsx(sqe,{className:"text-gray-400",fontSize:19,onClick:()=>s(!0)})})]}),h.jsx(Kl,{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 */const i4=Ls({prevent:!1,actionKey:void 0}),aqe=Ls({lastLocation:"",nonPreventedLocations:[]});function zLt(){const n=gc(),e=ts(GZ),[t,i]=oo(i4),[r,s]=oo(aqe);x.useEffect(()=>{const o=c=>{if(t.prevent&&t.actionKey!=="switchCompany")return c.preventDefault(),!0},a=r.lastLocation!==window.location.href;a&&t.prevent&&(s(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",o),()=>{window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",o)}},[t]),x.useEffect(()=>{!t.prevent&&s(o=>({...o,nonPreventedLocations:[...o.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 GZ=Ls(!1),lqe=Ls(void 0);function Vw(n){const{disablePrevention:e}=n||{},t=Yi(),[i,r]=oo(i4),s=ts(GZ),o=ts(lqe);return({url:a,externalLink:l=!1,fn:c,actionKey:u})=>(i.prevent&&!e?(o({url:a,externalLink:l,fn:c}),r(d=>d&&{...d,actionKey:u}),s(!0)):(a&&(l?window.open(a,"_blank"):t(a)),c==null||c()),i.prevent)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function cqe({color:n="#000",size:e="1.3rem"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 20 20",children:[h.jsx("polyline",{points:"17 8 17 3 12 3",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","data-color":"color-2"}),h.jsx("line",{x1:"17",y1:"3",x2:"10",y2:"10",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","data-color":"color-2"}),h.jsx("path",{d:"m8,3h-2c-1.657,0-3,1.343-3,3v8c0,1.657,1.343,3,3,3h8c1.657,0,3-1.343,3-3v-2",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Ji(n){const{prevent:e}=ji(i4),t=Vw(),{withoutDefaultStyling:i,setBaseFont:r,disableHoverUnderline:s,withoutExternalIcon:o=!1}=n,a={color:"#0062FF",...n.style},l=()=>n.to.startsWith("http://")||n.to.startsWith("https://")?n.to:`https://${n.to}`;return n.external?h.jsxs("div",{className:$t("flex space-x-2 items-center",n.className),children:[!o&&h.jsx("div",{children:h.jsx(cqe,{size:"1rem",color:"#0062FF"})}),h.jsx("a",{target:"_blank",href:n.withoutAdjustedHref?n.to:l(),className:$t("text-center",{"text-sm":!r,"text-base":r,"hover:underline":!i&&!s}),style:i?void 0:a,rel:"noreferrer",onClick:c=>{e&&(c.preventDefault(),t({url:n.to,externalLink:!0}))},children:n.children})]}):h.jsx(r1,{className:$t(`${n.className}`,{"text-sm":!r,"text-base":r,"hover:underline":!i&&!s}),style:i?void 0:a,to:n.to,onClick:c=>{e&&(c.preventDefault(),t({url:n.to}))},children:n.children})}function uqe(n){const e=xt();return h.jsxs("fieldset",{children:[h.jsx("legend",{className:"sr-only",children:"Notification method"}),h.jsx("div",{className:"space-y-4 sm:flex sm:items-center sm:space-y-0 sm:space-x-10",children:n.options.map(t=>h.jsxs("div",{className:"flex items-center",onChange:i=>{var r;return(r=n.onValueChange)==null?void 0:r.call(n,i.target.value)},children:[h.jsx("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-0 h-4 w-4 disabled:opacity-75 disabled:cursor-not-allowed cursor-pointer",style:{color:e.$3}}),h.jsx("label",{htmlFor:t.id,className:$t("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 mD(n,e,t){let i=t.initialDeps??[],r;return()=>{var s,o,a,l;let c;t.key&&((s=t.debug)!=null&&s.call(t))&&(c=Date.now());const u=n();if(!(u.length!==i.length||u.some((p,g)=>i[g]!==p)))return r;i=u;let f;if(t.key&&((o=t.debug)!=null&&o.call(t))&&(f=Date.now()),r=e(...u),t.key&&((a=t.debug)!=null&&a.call(t))){const p=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-f)*100)/100,m=g/16,_=(v,b)=>{for(v=String(v);v.length<b;)v=" "+v;return v};console.info(`%c⏱ ${_(g,5)} /${_(p,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 lre(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const ULt=(n,e)=>Math.abs(n-e)<1,qLt=(n,e,t)=>{let i;return function(...r){n.clearTimeout(i),i=n.setTimeout(()=>e.apply(this,r),t)}},KLt=n=>n,GLt=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},YLt=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;const r=o=>{const{width:a,height:l}=o;e({width:Math.round(a),height:Math.round(l)})};if(r(t.getBoundingClientRect()),!i.ResizeObserver)return()=>{};const s=new i.ResizeObserver(o=>{const a=o[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 s.observe(t,{box:"border-box"}),()=>{s.unobserve(t)}},dDe={passive:!0},QLt=typeof window>"u"?!0:"onscrollend"in window,XLt=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;let r=0;const s=QLt?()=>{}:qLt(i,()=>{e(r,!1)},n.options.isScrollingResetDelay),o=c=>()=>{const{horizontal:u,isRtl:d}=n.options;r=u?t.scrollLeft*(d&&-1||1):t.scrollTop,s(),e(r,c)},a=o(!0),l=o(!1);return l(),t.addEventListener("scroll",a,dDe),t.addEventListener("scrollend",l,dDe),()=>{t.removeEventListener("scroll",a),t.removeEventListener("scrollend",l)}},ZLt=(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"])},JLt=(n,{adjustments:e=0,behavior:t},i)=>{var r,s;const o=n+e;(s=(r=i.scrollElement)==null?void 0:r.scrollTo)==null||s.call(r,{[i.options.horizontal?"left":"top"]:o,behavior:t})};class eAt{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(s=>{this._measureElement(s.target,s)})}));return{disconnect:()=>{var r;(r=i())==null||r.disconnect(),t=null},observe:r=>{var s;return(s=i())==null?void 0:s.observe(r,{box:"border-box"})},unobserve:r=>{var s;return(s=i())==null?void 0:s.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:KLt,rangeExtractor:GLt,onChange:()=>{},measureElement:ZLt,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=mD(()=>(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,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=s,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,s=new Map;for(let o=i-1;o>=0;o--){const a=t[o];if(r.has(a.lane))continue;const l=s.get(a.lane);if(l==null||a.end>l.end?s.set(a.lane,a):a.end<l.end&&r.set(a.lane,!0),r.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((o,a)=>o.end===a.end?o.index-a.index:o.end-a.end)[0]:void 0},this.getMeasurementOptions=mD(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,i,r,s,o)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:r,getItemKey:s,enabled:o}),{key:!1}),this.getMeasurements=mD(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:r,getItemKey:s,enabled:o},a)=>{if(!o)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=s(u),f=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),p=f?f.end+this.options.gap:i+r,g=a.get(d),m=typeof g=="number"?g:this.options.estimateSize(u),_=p+m,v=f?f.lane:u%this.options.lanes;c[u]={index:u,start:p,size:m,end:_,key:d,lane:v}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=mD(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(t,i,r)=>this.range=t.length>0&&i>0?tAt({measurements:t,outerSize:i,scrollOffset:r}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=mD(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(t,i,r,s)=>i===null?[]:t({startIndex:i.startIndex,endIndex:i.endIndex,overscan:r,count:s}),{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),s=this.measurementsCache[r];if(!s)return;const o=s.key,a=this.elementsCache.get(o);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(o,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 s=this.itemSizeCache.get(r.key)??r.size,o=i-s;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,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=mD(()=>[this.getIndexes(),this.getMeasurements()],(t,i)=>{const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],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 lre(i[dqe(0,i.length-1,r=>lre(i[r]).start,t)])},this.getOffsetForAlignment=(t,i)=>{const r=this.getSize(),s=this.getScrollOffset();i==="auto"&&(t<=s?i="start":t>=s+r?i="end":i="start"),i==="start"?t=t:i==="end"?t=t-r:i==="center"&&(t=t-r/2);const o=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[o]:this.scrollElement[o]: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 s=this.getSize(),o=this.getScrollOffset();if(i==="auto")if(r.end>=o+s-this.options.scrollPaddingEnd)i="end";else if(r.start<=o+this.options.scrollPaddingStart)i="start";else return[o,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 s=this.getOffsetForIndex(t,i);if(!s)return;const[o,a]=s;this._scrollToOffset(o,{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]=lre(this.getOffsetForIndex(t,a));ULt(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(s=>s.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 dqe=(n,e,t,i)=>{for(;n<=e;){const r=(n+e)/2|0,s=t(r);if(s<i)n=r+1;else if(s>i)e=r-1;else return r}return n>0?n-1:0};function tAt({measurements:n,outerSize:e,scrollOffset:t}){const i=n.length-1,s=dqe(0,i,a=>n[a].start,t);let o=s;for(;o<i&&n[o].end<t+e;)o++;return{startIndex:s,endIndex:o}}const nAt=typeof document<"u"?x.useLayoutEffect:x.useEffect;function iAt(n){const e=x.useReducer(()=>({}),{})[1],t={...n,onChange:(r,s)=>{var o;s?Bm.flushSync(e):e(),(o=n.onChange)==null||o.call(n,r,s)}},[i]=x.useState(()=>new eAt(t));return i.setOptions(t),x.useEffect(()=>i._didMount(),[]),nAt(()=>i._willUpdate()),i}function rAt(n){return iAt({observeElementRect:YLt,observeElementOffset:XLt,scrollToFn:JLt,...n})}var sAt=Object.defineProperty,oAt=(n,e,t)=>e in n?sAt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,cre=(n,e,t)=>(oAt(n,typeof e!="symbol"?e+"":e,t),t);let aAt=class{constructor(){cre(this,"current",this.detect()),cre(this,"handoffState","pending"),cre(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"}},sw=new aAt,Xa=(n,e)=>{sw.isServer?x.useEffect(n,e):x.useLayoutEffect(n,e)};function Cm(n){let e=x.useRef(n);return Xa(()=>{e.current=n},[n]),e}function mwe(n,e){let[t,i]=x.useState(n),r=Cm(n);return Xa(()=>i(r.current),[r,i,...e]),t}let Ai=function(n){let e=Cm(n);return we.useCallback((...t)=>e.current(...t),[e])};function hqe(n,e,t){let[i,r]=x.useState(t),s=n!==void 0,o=x.useRef(s),a=x.useRef(!1),l=x.useRef(!1);return s&&!o.current&&!a.current?(a.current=!0,o.current=s,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.")):!s&&o.current&&!l.current&&(l.current=!0,o.current=s,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.")),[s?n:i,Ai(c=>(s||r(c),e==null?void 0:e(c)))]}function YZ(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(e=>setTimeout(()=>{throw e}))}function Am(){let n=[],e={addEventListener(t,i,r,s){return t.addEventListener(i,r,s),e.add(()=>t.removeEventListener(i,r,s))},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 YZ(()=>{i.current&&t[0]()}),e.add(()=>{i.current=!1})},style(t,i,r){let s=t.style.getPropertyValue(i);return Object.assign(t.style,{[i]:r}),this.add(()=>{Object.assign(t.style,{[i]:s})})},group(t){let i=Am();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 Ww(){let[n]=x.useState(Am);return x.useEffect(()=>()=>n.dispose(),[n]),n}function lAt(){let n=typeof document>"u";return"useSyncExternalStore"in q_?(e=>e.useSyncExternalStore)(q_)(()=>()=>{},()=>!1,()=>!n):!1}function r4(){let n=lAt(),[e,t]=x.useState(sw.isHandoffComplete);return e&&sw.isHandoffComplete===!1&&t(!1),x.useEffect(()=>{e!==!0&&t(!0)},[e]),x.useEffect(()=>sw.handoff(),[]),n?!1:e}var hDe;let Gc=(hDe=we.useId)!=null?hDe:function(){let n=r4(),[e,t]=we.useState(n?()=>sw.nextId():null);return Xa(()=>{e===null&&t(sw.nextId())},[e]),e!=null?""+e:void 0};function La(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,La),i}function XB(n){return sw.isServer?null:n instanceof Node?n.ownerDocument:n!=null&&n.hasOwnProperty("current")&&n.current instanceof Node?n.current.ownerDocument:document}let Phe=["[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 _h=(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))(_h||{}),f8=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(f8||{}),cAt=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(cAt||{});function ZB(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(Phe)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var QZ=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(QZ||{});function XZ(n,e=0){var t;return n===((t=XB(n))==null?void 0:t.body)?!1:La(e,{0(){return n.matches(Phe)},1(){let i=n;for(;i!==null;){if(i.matches(Phe))return!0;i=i.parentElement}return!1}})}function fqe(n){let e=XB(n);Am().nextFrame(()=>{e&&!XZ(e.activeElement,0)&&ZS(n)})}var uAt=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(uAt||{});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 ZS(n){n==null||n.focus({preventScroll:!0})}let dAt=["textarea","input"].join(",");function hAt(n){var e,t;return(t=(e=n==null?void 0:n.matches)==null?void 0:e.call(n,dAt))!=null?t:!1}function _we(n,e=t=>t){return n.slice().sort((t,i)=>{let r=e(t),s=e(i);if(r===null||s===null)return 0;let o=r.compareDocumentPosition(s);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function fAt(n,e){return M_(ZB(),e,{relativeTo:n})}function M_(n,e,{sorted:t=!0,relativeTo:i=null,skipElements:r=[]}={}){let s=Array.isArray(n)?n.length>0?n[0].ownerDocument:document:n.ownerDocument,o=Array.isArray(n)?t?_we(n):n:ZB(n);r.length>0&&o.length>1&&(o=o.filter(p=>!r.includes(p))),i=i??s.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,o.indexOf(i))-1;if(e&4)return Math.max(0,o.indexOf(i))+1;if(e&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=e&32?{preventScroll:!0}:{},u=0,d=o.length,f;do{if(u>=d||u+d<=0)return 0;let p=l+u;if(e&16)p=(p+d)%d;else{if(p<0)return 3;if(p>=d)return 1}f=o[p],f==null||f.focus(c),u+=a}while(f!==s.activeElement);return e&6&&hAt(f)&&f.select(),2}function pqe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function pAt(){return/Android/gi.test(window.navigator.userAgent)}function gqe(){return pqe()||pAt()}function BH(n,e,t){let i=Cm(e);x.useEffect(()=>{function r(s){i.current(s)}return document.addEventListener(n,r,t),()=>document.removeEventListener(n,r,t)},[n,t])}function mqe(n,e,t){let i=Cm(e);x.useEffect(()=>{function r(s){i.current(s)}return window.addEventListener(n,r,t),()=>window.removeEventListener(n,r,t)},[n,t])}function ZZ(n,e,t=!0){let i=x.useRef(!1);x.useEffect(()=>{requestAnimationFrame(()=>{i.current=t})},[t]);function r(o,a){if(!i.current||o.defaultPrevented)return;let l=a(o);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)||o.composed&&o.composedPath().includes(d))return}return!XZ(l,QZ.Loose)&&l.tabIndex!==-1&&o.preventDefault(),e(o,l)}let s=x.useRef(null);BH("pointerdown",o=>{var a,l;i.current&&(s.current=((l=(a=o.composedPath)==null?void 0:a.call(o))==null?void 0:l[0])||o.target)},!0),BH("mousedown",o=>{var a,l;i.current&&(s.current=((l=(a=o.composedPath)==null?void 0:a.call(o))==null?void 0:l[0])||o.target)},!0),BH("click",o=>{gqe()||s.current&&(r(o,()=>s.current),s.current=null)},!0),BH("touchend",o=>r(o,()=>o.target instanceof HTMLElement?o.target:null),!0),mqe("blur",o=>r(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function a1(...n){return x.useMemo(()=>XB(...n),[...n])}function fDe(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 JZ(n,e){let[t,i]=x.useState(()=>fDe(n));return Xa(()=>{i(fDe(n))},[n.type,n.as]),Xa(()=>{t||e.current&&e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&i("button")},[t,e]),t}let _qe=Symbol();function vqe(n,e=!0){return Object.assign(n,{[_qe]:e})}function yl(...n){let e=x.useRef(n);x.useEffect(()=>{e.current=n},[n]);let t=Ai(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[_qe]))?void 0:t}function pDe(n){return[n.screenX,n.screenY]}function bqe(){let n=x.useRef([-1,-1]);return{wasMoved(e){let t=pDe(e);return n.current[0]===t[0]&&n.current[1]===t[1]?!1:(n.current=t,!0)},update(e){n.current=pDe(e)}}}function yqe({container:n,accept:e,walk:t,enabled:i=!0}){let r=x.useRef(e),s=x.useRef(t);x.useEffect(()=>{r.current=e,s.current=t},[e,t]),Xa(()=>{if(!n||!i)return;let o=XB(n);if(!o)return;let a=r.current,l=s.current,c=Object.assign(d=>a(d),{acceptNode:a}),u=o.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[n,i,r,s])}function p8(n,e){let t=x.useRef([]),i=Ai(n);x.useEffect(()=>{let r=[...t.current];for(let[s,o]of e.entries())if(t.current[s]!==o){let a=i(e,r);return t.current=e,a}},[i,...e])}function yq(...n){return Array.from(new Set(n.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}var X_=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(X_||{}),NS=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(NS||{});function Za({ourProps:n,theirProps:e,slot:t,defaultTag:i,features:r,visible:s=!0,name:o,mergeRefs:a}){a=a??mAt;let l=Cqe(e,n);if(s)return $H(l,t,i,o,a);let c=r??0;if(c&2){let{static:u=!1,...d}=l;if(u)return $H(d,t,i,o,a)}if(c&1){let{unmount:u=!0,...d}=l;return La(u?0:1,{0(){return null},1(){return $H({...d,hidden:!0,style:{display:"none"}},t,i,o,a)}})}return $H(l,t,i,o,a)}function $H(n,e={},t,i,r){let{as:s=t,children:o,refName:a="ref",...l}=ure(n,["unmount","static"]),c=n.ref!==void 0?{[a]:n.ref}:{},u=typeof o=="function"?o(e):o;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(e));let d={};if(e){let f=!1,p=[];for(let[g,m]of Object.entries(e))typeof m=="boolean"&&(f=!0),m===!0&&p.push(g);f&&(d["data-headlessui-state"]=p.join(" "))}if(s===x.Fragment&&Object.keys(Cq(l)).length>0){if(!x.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 f=u.props,p=typeof(f==null?void 0:f.className)=="function"?(...m)=>yq(f==null?void 0:f.className(...m),l.className):yq(f==null?void 0:f.className,l.className),g=p?{className:p}:{};return x.cloneElement(u,Object.assign({},Cqe(u.props,Cq(ure(l,["ref"]))),d,c,{ref:r(u.ref,c.ref)},g))}return x.createElement(s,Object.assign({},ure(l,["ref"]),s!==x.Fragment&&c,s!==x.Fragment&&d),u)}function gAt(){let n=x.useRef([]),e=x.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 mAt(...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 Cqe(...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,...s){let o=t[i];for(let a of o){if((r instanceof Event||(r==null?void 0:r.nativeEvent)instanceof Event)&&r.defaultPrevented)return;a(r,...s)}}});return e}function Ja(n){var e;return Object.assign(x.forwardRef(n),{displayName:(e=n.displayName)!=null?e:n.name})}function Cq(n){let e=Object.assign({},n);for(let t in e)e[t]===void 0&&delete e[t];return e}function ure(n,e=[]){let t=Object.assign({},n);for(let i of e)i in t&&delete t[i];return t}let _At="div";var Hy=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(Hy||{});function vAt(n,e){var t;let{features:i=1,...r}=n,s={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 Za({ourProps:s,theirProps:r,slot:{},defaultTag:_At,name:"Hidden"})}let ww=Ja(vAt),vwe=x.createContext(null);vwe.displayName="OpenClosedContext";var Nl=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(Nl||{});function fA(){return x.useContext(vwe)}function eJ({value:n,children:e}){return we.createElement(vwe.Provider,{value:n},e)}function bAt(n){function e(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let dy=[];bAt(()=>{function n(e){e.target instanceof HTMLElement&&e.target!==document.body&&dy[0]!==e.target&&(dy.unshift(e.target),dy=dy.filter(t=>t!=null&&t.isConnected),dy.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 s4(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&&yAt(t)?!1:i}function yAt(n){if(!n)return!1;let e=n.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}function CAt(n){throw new Error("Unexpected object: "+n)}var sl=(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))(sl||{});function Ohe(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 s=0;s<t.length;++s)if(!e.resolveDisabled(t[s],s,t))return s;return i}case 1:{for(let s=r-1;s>=0;--s)if(!e.resolveDisabled(t[s],s,t))return s;return i}case 2:{for(let s=r+1;s<t.length;++s)if(!e.resolveDisabled(t[s],s,t))return s;return i}case 3:{for(let s=t.length-1;s>=0;--s)if(!e.resolveDisabled(t[s],s,t))return s;return i}case 4:{for(let s=0;s<t.length;++s)if(e.resolveId(t[s],s,t)===n.id)return s;return i}case 5:return null;default:CAt(n)}}function wqe(n={},e=null,t=[]){for(let[i,r]of Object.entries(n))Sqe(t,xqe(e,i),r);return t}function xqe(n,e){return n?n+"["+e+"]":e}function Sqe(n,e,t){if(Array.isArray(t))for(let[i,r]of t.entries())Sqe(n,xqe(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,""]):wqe(t,e,n)}function wAt(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 po=(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))(po||{}),xAt={},SAt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(SAt||{}),EAt=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(EAt||{}),kAt=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(kAt||{}),TAt=(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))(TAt||{});function dre(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((o,a)=>o.dataRef.current.order-a.dataRef.current.order):_we(i,o=>o.dataRef.current.domRef.current),s=t?r.indexOf(t):null;return s===-1&&(s=null),{options:r,activeOptionIndex:s}}let IAt={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,s,o;if((t=n.dataRef.current)!=null&&t.disabled||(i=n.dataRef.current)!=null&&i.optionsRef.current&&!((r=n.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&n.comboboxState===1)return n;if(n.virtual){let u=e.focus===sl.Specific?e.idx:Ohe(e,{resolveItems:()=>n.virtual.options,resolveActiveIndex:()=>{var f,p;return(p=(f=n.activeOptionIndex)!=null?f:n.virtual.options.findIndex(g=>!n.virtual.disabled(g)))!=null?p:null},resolveDisabled:n.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),d=(s=e.trigger)!=null?s:2;return n.activeOptionIndex===u&&n.activationTrigger===d?n:{...n,activeOptionIndex:u,activationTrigger:d}}let a=dre(n);if(a.activeOptionIndex===null){let u=a.options.findIndex(d=>!d.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=e.focus===sl.Specific?e.idx:Ohe(e,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(o=e.trigger)!=null?o: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 s=e.payload,o=dre(n,l=>(l.push(s),l));n.activeOptionIndex===null&&(i=n.dataRef.current)!=null&&i.isSelected(e.payload.dataRef.current.value)&&(o.activeOptionIndex=o.options.indexOf(s));let a={...n,...o,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=dre(n,r=>{let s=r.findIndex(o=>o.id===e.id);return s!==-1&&r.splice(s,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})}}},bwe=x.createContext(null);bwe.displayName="ComboboxActionsContext";function JB(n){let e=x.useContext(bwe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,JB),t}return e}let Eqe=x.createContext(null);function LAt(n){var e;let t=pA("VirtualProvider"),[i,r]=x.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]),s=rAt({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}),[o,a]=x.useState(0);return Xa(()=>{a(l=>l+1)},[(e=t.virtual)==null?void 0:e.options]),we.createElement(Eqe.Provider,{value:s},we.createElement("div",{style:{position:"relative",width:"100%",height:`${s.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&xAt.JEST_WORKER_ID!==void 0||t.activationTrigger===0)return;t.activeOptionIndex!==null&&t.virtual.options.length>t.activeOptionIndex&&s.scrollToIndex(t.activeOptionIndex)}}},s.getVirtualItems().map(l=>{var c;return we.createElement(x.Fragment,{key:l.key},we.cloneElement((c=n.children)==null?void 0:c.call(n,{option:t.virtual.options[l.index],open:t.comboboxState===0}),{key:`${o}-${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 ywe=x.createContext(null);ywe.displayName="ComboboxDataContext";function pA(n){let e=x.useContext(ywe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,pA),t}return e}function AAt(n,e){return La(e.type,IAt,n,e)}let NAt=x.Fragment;function DAt(n,e){let{value:t,defaultValue:i,onChange:r,form:s,name:o,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:d=!1,immediate:f=!1,virtual:p=null,...g}=n,m=!1,_=null,[v=d?[]:void 0,b]=hqe(t,r,i),[y,C]=x.useReducer(AAt,{dataRef:x.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),S=x.useRef(!1),k=x.useRef({static:!1,hold:!1}),I=x.useRef(null),L=x.useRef(null),N=x.useRef(null),P=x.useRef(null),O=Ai(typeof a=="string"?(ge,ye)=>{let Pe=a;return(ge==null?void 0:ge[Pe])===(ye==null?void 0:ye[Pe])}:a??((ge,ye)=>ge===ye)),F=Ai(ge=>y.options.findIndex(ye=>O(ye.dataRef.current.value,ge))),V=x.useCallback(ge=>La(B.mode,{1:()=>v.some(ye=>O(ye,ge)),0:()=>O(v,ge)}),[v]),M=Ai(ge=>y.activeOptionIndex===F(ge)),B=x.useMemo(()=>({...y,immediate:m,optionsPropsRef:k,labelRef:I,inputRef:L,buttonRef:N,optionsRef:P,value:v,defaultValue:i,disabled:l,mode:d?1:0,virtual:y.virtual,get activeOptionIndex(){if(S.current&&y.activeOptionIndex===null&&y.options.length>0){let ge=y.options.findIndex(ye=>!ye.dataRef.current.disabled);if(ge!==-1)return ge}return y.activeOptionIndex},calculateIndex:F,compare:O,isSelected:V,isActive:M,nullable:u,__demoMode:c}),[v,i,l,d,u,c,y,_]);Xa(()=>{},[_,void 0]),Xa(()=>{y.dataRef.current=B},[B]),ZZ([B.buttonRef,B.inputRef,B.optionsRef],()=>fe.closeCombobox(),B.comboboxState===0);let W=x.useMemo(()=>{var ge,ye,Pe;return{open:B.comboboxState===0,disabled:l,activeIndex:B.activeOptionIndex,activeOption:B.activeOptionIndex===null?null:B.virtual?B.virtual.options[(ge=B.activeOptionIndex)!=null?ge:0]:(Pe=(ye=B.options[B.activeOptionIndex])==null?void 0:ye.dataRef.current.value)!=null?Pe:null,value:v}},[B,l,v]),q=Ai(()=>{if(B.activeOptionIndex!==null){if(B.virtual)X(B.virtual.options[B.activeOptionIndex]);else{let{dataRef:ge}=B.options[B.activeOptionIndex];X(ge.current.value)}fe.goToOption(sl.Specific,B.activeOptionIndex)}}),U=Ai(()=>{C({type:0}),S.current=!0}),G=Ai(()=>{C({type:1}),S.current=!1}),H=Ai((ge,ye,Pe)=>(S.current=!1,ge===sl.Specific?C({type:2,focus:sl.Specific,idx:ye,trigger:Pe}):C({type:2,focus:ge,trigger:Pe}))),z=Ai((ge,ye)=>(C({type:3,payload:{id:ge,dataRef:ye}}),()=>{B.isActive(ye.current.value)&&(S.current=!0),C({type:4,id:ge})})),Z=Ai(ge=>(C({type:5,id:ge}),()=>C({type:5,id:null}))),X=Ai(ge=>La(B.mode,{0(){return b==null?void 0:b(ge)},1(){let ye=B.value.slice(),Pe=ye.findIndex(Be=>O(Be,ge));return Pe===-1?ye.push(ge):ye.splice(Pe,1),b==null?void 0:b(ye)}})),oe=Ai(ge=>{C({type:6,trigger:ge})}),fe=x.useMemo(()=>({onChange:X,registerOption:z,registerLabel:Z,goToOption:H,closeCombobox:G,openCombobox:U,setActivationTrigger:oe,selectActiveOption:q}),[]),Se=e===null?{}:{ref:e},Me=x.useRef(null),Ie=Ww();return x.useEffect(()=>{Me.current&&i!==void 0&&Ie.addEventListener(Me.current,"reset",()=>{b==null||b(i)})},[Me,b]),we.createElement(bwe.Provider,{value:fe},we.createElement(ywe.Provider,{value:B},we.createElement(eJ,{value:La(B.comboboxState,{0:Nl.Open,1:Nl.Closed})},o!=null&&v!=null&&wqe({[o]:v}).map(([ge,ye],Pe)=>we.createElement(ww,{features:Hy.Hidden,ref:Pe===0?Be=>{var $e;Me.current=($e=Be==null?void 0:Be.closest("form"))!=null?$e:null}:void 0,...Cq({key:ge,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:s,disabled:l,name:ge,value:ye})})),Za({ourProps:Se,theirProps:g,slot:W,defaultTag:NAt,name:"Combobox"}))))}let RAt="input";function PAt(n,e){var t,i,r,s,o;let a=Gc(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:d="text",...f}=n,p=pA("Combobox.Input"),g=JB("Combobox.Input"),m=yl(p.inputRef,e),_=a1(p.inputRef),v=x.useRef(!1),b=Ww(),y=Ai(()=>{g.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),g.goToOption(sl.Nothing)}),C=function(){var B;return typeof u=="function"&&p.value!==void 0?(B=u(p.value))!=null?B:"":typeof p.value=="string"?p.value:""}();p8(([B,W],[q,U])=>{if(v.current)return;let G=p.inputRef.current;G&&((U===0&&W===1||B!==q)&&(G.value=B),requestAnimationFrame(()=>{if(v.current||!G||(_==null?void 0:_.activeElement)!==G)return;let{selectionStart:H,selectionEnd:z}=G;Math.abs((z??0)-(H??0))===0&&H===0&&G.setSelectionRange(G.value.length,G.value.length)}))},[C,p.comboboxState,_]),p8(([B],[W])=>{if(B===0&&W===1){if(v.current)return;let q=p.inputRef.current;if(!q)return;let U=q.value,{selectionStart:G,selectionEnd:H,selectionDirection:z}=q;q.value="",q.value=U,z!==null?q.setSelectionRange(G,H,z):q.setSelectionRange(G,H)}},[p.comboboxState]);let S=x.useRef(!1),k=Ai(()=>{S.current=!0}),I=Ai(()=>{b.nextFrame(()=>{S.current=!1})}),L=Ai(B=>{switch(v.current=!0,B.key){case po.Enter:if(v.current=!1,p.comboboxState!==0||S.current)return;if(B.preventDefault(),B.stopPropagation(),p.activeOptionIndex===null){g.closeCombobox();return}g.selectActiveOption(),p.mode===0&&g.closeCombobox();break;case po.ArrowDown:return v.current=!1,B.preventDefault(),B.stopPropagation(),La(p.comboboxState,{0:()=>g.goToOption(sl.Next),1:()=>g.openCombobox()});case po.ArrowUp:return v.current=!1,B.preventDefault(),B.stopPropagation(),La(p.comboboxState,{0:()=>g.goToOption(sl.Previous),1:()=>{g.openCombobox(),b.nextFrame(()=>{p.value||g.goToOption(sl.Last)})}});case po.Home:if(B.shiftKey)break;return v.current=!1,B.preventDefault(),B.stopPropagation(),g.goToOption(sl.First);case po.PageUp:return v.current=!1,B.preventDefault(),B.stopPropagation(),g.goToOption(sl.First);case po.End:if(B.shiftKey)break;return v.current=!1,B.preventDefault(),B.stopPropagation(),g.goToOption(sl.Last);case po.PageDown:return v.current=!1,B.preventDefault(),B.stopPropagation(),g.goToOption(sl.Last);case po.Escape:return v.current=!1,p.comboboxState!==0?void 0:(B.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&B.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&y(),g.closeCombobox());case po.Tab:if(v.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&g.selectActiveOption(),g.closeCombobox();break}}),N=Ai(B=>{c==null||c(B),p.nullable&&p.mode===0&&B.target.value===""&&y(),g.openCombobox()}),P=Ai(B=>{var W,q,U;let G=(W=B.relatedTarget)!=null?W:dy.find(H=>H!==B.currentTarget);if(v.current=!1,!((q=p.optionsRef.current)!=null&&q.contains(G))&&!((U=p.buttonRef.current)!=null&&U.contains(G))&&p.comboboxState===0)return B.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?y():p.activationTrigger!==1&&g.selectActiveOption()),g.closeCombobox()}),O=Ai(B=>{var W,q,U;let G=(W=B.relatedTarget)!=null?W:dy.find(H=>H!==B.currentTarget);(q=p.buttonRef.current)!=null&&q.contains(G)||(U=p.optionsRef.current)!=null&&U.contains(G)||p.disabled||p.immediate&&p.comboboxState!==0&&(g.openCombobox(),b.nextFrame(()=>{g.setActivationTrigger(1)}))}),F=mwe(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),V=x.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),M={ref:m,id:l,role:"combobox",type:d,"aria-controls":(t=p.optionsRef.current)==null?void 0:t.id,"aria-expanded":p.comboboxState===0,"aria-activedescendant":p.activeOptionIndex===null?void 0:p.virtual?(i=p.options.find(B=>{var W;return!((W=p.virtual)!=null&&W.disabled(B.dataRef.current.value))&&p.compare(B.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:i.id:(r=p.options[p.activeOptionIndex])==null?void 0:r.id,"aria-labelledby":F,"aria-autocomplete":"list",defaultValue:(o=(s=n.defaultValue)!=null?s:p.defaultValue!==void 0?u==null?void 0:u(p.defaultValue):null)!=null?o:p.defaultValue,disabled:p.disabled,onCompositionStart:k,onCompositionEnd:I,onKeyDown:L,onChange:N,onFocus:O,onBlur:P};return Za({ourProps:M,theirProps:f,slot:V,defaultTag:RAt,name:"Combobox.Input"})}let OAt="button";function MAt(n,e){var t;let i=pA("Combobox.Button"),r=JB("Combobox.Button"),s=yl(i.buttonRef,e),o=Gc(),{id:a=`headlessui-combobox-button-${o}`,...l}=n,c=Ww(),u=Ai(m=>{switch(m.key){case po.ArrowDown:return m.preventDefault(),m.stopPropagation(),i.comboboxState===1&&r.openCombobox(),c.nextFrame(()=>{var _;return(_=i.inputRef.current)==null?void 0:_.focus({preventScroll:!0})});case po.ArrowUp:return m.preventDefault(),m.stopPropagation(),i.comboboxState===1&&(r.openCombobox(),c.nextFrame(()=>{i.value||r.goToOption(sl.Last)})),c.nextFrame(()=>{var _;return(_=i.inputRef.current)==null?void 0:_.focus({preventScroll:!0})});case po.Escape:return i.comboboxState!==0?void 0:(m.preventDefault(),i.optionsRef.current&&!i.optionsPropsRef.current.static&&m.stopPropagation(),r.closeCombobox(),c.nextFrame(()=>{var _;return(_=i.inputRef.current)==null?void 0:_.focus({preventScroll:!0})}));default:return}}),d=Ai(m=>{if(s4(m.currentTarget))return m.preventDefault();i.comboboxState===0?r.closeCombobox():(m.preventDefault(),r.openCombobox()),c.nextFrame(()=>{var _;return(_=i.inputRef.current)==null?void 0:_.focus({preventScroll:!0})})}),f=mwe(()=>{if(i.labelId)return[i.labelId,a].join(" ")},[i.labelId,a]),p=x.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled,value:i.value}),[i]),g={ref:s,id:a,type:JZ(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":f,disabled:i.disabled,onClick:d,onKeyDown:u};return Za({ourProps:g,theirProps:l,slot:p,defaultTag:OAt,name:"Combobox.Button"})}let jAt="label";function FAt(n,e){let t=Gc(),{id:i=`headlessui-combobox-label-${t}`,...r}=n,s=pA("Combobox.Label"),o=JB("Combobox.Label"),a=yl(s.labelRef,e);Xa(()=>o.registerLabel(i),[i]);let l=Ai(()=>{var u;return(u=s.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=x.useMemo(()=>({open:s.comboboxState===0,disabled:s.disabled}),[s]);return Za({ourProps:{ref:a,id:i,onClick:l},theirProps:r,slot:c,defaultTag:jAt,name:"Combobox.Label"})}let BAt="ul",$At=X_.RenderStrategy|X_.Static;function HAt(n,e){let t=Gc(),{id:i=`headlessui-combobox-options-${t}`,hold:r=!1,...s}=n,o=pA("Combobox.Options"),a=yl(o.optionsRef,e),l=fA(),c=l!==null?(l&Nl.Open)===Nl.Open:o.comboboxState===0;Xa(()=>{var p;o.optionsPropsRef.current.static=(p=n.static)!=null?p:!1},[o.optionsPropsRef,n.static]),Xa(()=>{o.optionsPropsRef.current.hold=r},[o.optionsPropsRef,r]),yqe({container:o.optionsRef.current,enabled:o.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none")}});let u=mwe(()=>{var p,g;return(g=o.labelId)!=null?g:(p=o.buttonRef.current)==null?void 0:p.id},[o.labelId,o.buttonRef.current]),d=x.useMemo(()=>({open:o.comboboxState===0,option:void 0}),[o]),f={"aria-labelledby":u,role:"listbox","aria-multiselectable":o.mode===1?!0:void 0,id:i,ref:a};return o.virtual&&o.comboboxState===0&&Object.assign(s,{children:we.createElement(LAt,null,s.children)}),Za({ourProps:f,theirProps:s,slot:d,defaultTag:BAt,features:$At,visible:c,name:"Combobox.Options"})}let VAt="li";function WAt(n,e){var t;let i=Gc(),{id:r=`headlessui-combobox-option-${i}`,disabled:s=!1,value:o,order:a=null,...l}=n,c=pA("Combobox.Option"),u=JB("Combobox.Option"),d=c.virtual?c.activeOptionIndex===c.calculateIndex(o):c.activeOptionIndex===null?!1:((t=c.options[c.activeOptionIndex])==null?void 0:t.id)===r,f=c.isSelected(o),p=x.useRef(null),g=Cm({disabled:s,value:o,domRef:p,order:a}),m=x.useContext(Eqe),_=yl(e,p,m?m.measureElement:null),v=Ai(()=>u.onChange(o));Xa(()=>u.registerOption(r,g),[g,r]);let b=x.useRef(!(c.virtual||c.__demoMode));Xa(()=>{if(!c.virtual||!c.__demoMode)return;let P=Am();return P.requestAnimationFrame(()=>{b.current=!0}),P.dispose},[c.virtual,c.__demoMode]),Xa(()=>{if(!b.current||c.comboboxState!==0||!d||c.activationTrigger===0)return;let P=Am();return P.requestAnimationFrame(()=>{var O,F;(F=(O=p.current)==null?void 0:O.scrollIntoView)==null||F.call(O,{block:"nearest"})}),P.dispose},[p,d,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let y=Ai(P=>{var O;if(s||(O=c.virtual)!=null&&O.disabled(o))return P.preventDefault();v(),gqe()||requestAnimationFrame(()=>{var F;return(F=c.inputRef.current)==null?void 0:F.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),C=Ai(()=>{var P;if(s||(P=c.virtual)!=null&&P.disabled(o))return u.goToOption(sl.Nothing);let O=c.calculateIndex(o);u.goToOption(sl.Specific,O)}),S=bqe(),k=Ai(P=>S.update(P)),I=Ai(P=>{var O;if(!S.wasMoved(P)||s||(O=c.virtual)!=null&&O.disabled(o)||d)return;let F=c.calculateIndex(o);u.goToOption(sl.Specific,F,0)}),L=Ai(P=>{var O;S.wasMoved(P)&&(s||(O=c.virtual)!=null&&O.disabled(o)||d&&(c.optionsPropsRef.current.hold||u.goToOption(sl.Nothing)))}),N=x.useMemo(()=>({active:d,selected:f,disabled:s}),[d,f,s]);return Za({ourProps:{id:r,ref:_,role:"option",tabIndex:s===!0?void 0:-1,"aria-disabled":s===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:y,onFocus:C,onPointerEnter:k,onMouseEnter:k,onPointerMove:I,onMouseMove:I,onPointerLeave:L,onMouseLeave:L},theirProps:l,slot:N,defaultTag:VAt,name:"Combobox.Option"})}let zAt=Ja(DAt),UAt=Ja(MAt),qAt=Ja(PAt),KAt=Ja(FAt),GAt=Ja(HAt),YAt=Ja(WAt),XD=Object.assign(zAt,{Input:qAt,Button:UAt,Label:KAt,Options:GAt,Option:YAt});function Cwe(n,e,t,i){let r=Cm(t);x.useEffect(()=>{n=n??window;function s(o){r.current(o)}return n.addEventListener(e,s,i),()=>n.removeEventListener(e,s,i)},[n,e,i])}function e9(){let n=x.useRef(!1);return Xa(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function kqe(n){let e=Ai(n),t=x.useRef(!1);x.useEffect(()=>(t.current=!1,()=>{t.current=!0,YZ(()=>{t.current&&e()})}),[e])}var dm=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(dm||{});function wwe(){let n=x.useRef(0);return mqe("keydown",e=>{e.key==="Tab"&&(n.current=e.shiftKey?1:0)},!0),n}function Tqe(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 QAt="div";var Iqe=(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))(Iqe||{});function XAt(n,e){let t=x.useRef(null),i=yl(t,e),{initialFocus:r,containers:s,features:o=30,...a}=n;r4()||(o=1);let l=a1(t);eNt({ownerDocument:l},!!(o&16));let c=tNt({ownerDocument:l,container:t,initialFocus:r},!!(o&2));nNt({ownerDocument:l,container:t,containers:s,previousActiveElement:c},!!(o&8));let u=wwe(),d=Ai(m=>{let _=t.current;_&&(v=>v())(()=>{La(u.current,{[dm.Forwards]:()=>{M_(_,_h.First,{skipElements:[m.relatedTarget]})},[dm.Backwards]:()=>{M_(_,_h.Last,{skipElements:[m.relatedTarget]})}})})}),f=Ww(),p=x.useRef(!1),g={ref:i,onKeyDown(m){m.key=="Tab"&&(p.current=!0,f.requestAnimationFrame(()=>{p.current=!1}))},onBlur(m){let _=Tqe(s);t.current instanceof HTMLElement&&_.add(t.current);let v=m.relatedTarget;v instanceof HTMLElement&&v.dataset.headlessuiFocusGuard!=="true"&&(Lqe(_,v)||(p.current?M_(t.current,La(u.current,{[dm.Forwards]:()=>_h.Next,[dm.Backwards]:()=>_h.Previous})|_h.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&ZS(m.target)))}};return we.createElement(we.Fragment,null,!!(o&4)&&we.createElement(ww,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:Hy.Focusable}),Za({ourProps:g,theirProps:a,defaultTag:QAt,name:"FocusTrap"}),!!(o&4)&&we.createElement(ww,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:Hy.Focusable}))}let ZAt=Ja(XAt),E5=Object.assign(ZAt,{features:Iqe});function JAt(n=!0){let e=x.useRef(dy.slice());return p8(([t],[i])=>{i===!0&&t===!1&&YZ(()=>{e.current.splice(0)}),i===!1&&t===!0&&(e.current=dy.slice())},[n,dy,e]),Ai(()=>{var t;return(t=e.current.find(i=>i!=null&&i.isConnected))!=null?t:null})}function eNt({ownerDocument:n},e){let t=JAt(e);p8(()=>{e||(n==null?void 0:n.activeElement)===(n==null?void 0:n.body)&&ZS(t())},[e]),kqe(()=>{e&&ZS(t())})}function tNt({ownerDocument:n,container:e,initialFocus:t},i){let r=x.useRef(null),s=e9();return p8(()=>{if(!i)return;let o=e.current;o&&YZ(()=>{if(!s.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(o.contains(a)){r.current=a;return}t!=null&&t.current?ZS(t.current):M_(o,_h.First)===f8.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),r.current=n==null?void 0:n.activeElement})},[i]),r}function nNt({ownerDocument:n,container:e,containers:t,previousActiveElement:i},r){let s=e9();Cwe(n==null?void 0:n.defaultView,"focus",o=>{if(!r||!s.current)return;let a=Tqe(t);e.current instanceof HTMLElement&&a.add(e.current);let l=i.current;if(!l)return;let c=o.target;c&&c instanceof HTMLElement?Lqe(a,c)?(i.current=c,ZS(c)):(o.preventDefault(),o.stopPropagation(),ZS(l)):ZS(i.current)},!0)}function Lqe(n,e){for(let t of n)if(t.contains(e))return!0;return!1}let Aqe=x.createContext(!1);function iNt(){return x.useContext(Aqe)}function Mhe(n){return we.createElement(Aqe.Provider,{value:n.force},n.children)}function rNt(n){let e=iNt(),t=x.useContext(Nqe),i=a1(n),[r,s]=x.useState(()=>{if(!e&&t!==null||sw.isServer)return null;let o=i==null?void 0:i.getElementById("headlessui-portal-root");if(o)return o;if(i===null)return null;let a=i.createElement("div");return a.setAttribute("id","headlessui-portal-root"),i.body.appendChild(a)});return x.useEffect(()=>{r!==null&&(i!=null&&i.body.contains(r)||i==null||i.body.appendChild(r))},[r,i]),x.useEffect(()=>{e||t!==null&&s(t.current)},[t,s,e]),r}let sNt=x.Fragment;function oNt(n,e){let t=n,i=x.useRef(null),r=yl(vqe(u=>{i.current=u}),e),s=a1(i),o=rNt(i),[a]=x.useState(()=>{var u;return sw.isServer?null:(u=s==null?void 0:s.createElement("div"))!=null?u:null}),l=x.useContext(jhe),c=r4();return Xa(()=>{!o||!a||o.contains(a)||(a.setAttribute("data-headlessui-portal",""),o.appendChild(a))},[o,a]),Xa(()=>{if(a&&l)return l.register(a)},[l,a]),kqe(()=>{var u;!o||!a||(a instanceof Node&&o.contains(a)&&o.removeChild(a),o.childNodes.length<=0&&((u=o.parentElement)==null||u.removeChild(o)))}),c?!o||!a?null:Bm.createPortal(Za({ourProps:{ref:r},theirProps:t,defaultTag:sNt,name:"Portal"}),a):null}let aNt=x.Fragment,Nqe=x.createContext(null);function lNt(n,e){let{target:t,...i}=n,r={ref:yl(e)};return we.createElement(Nqe.Provider,{value:t},Za({ourProps:r,theirProps:i,defaultTag:aNt,name:"Popover.Group"}))}let jhe=x.createContext(null);function Dqe(){let n=x.useContext(jhe),e=x.useRef([]),t=Ai(s=>(e.current.push(s),n&&n.register(s),()=>i(s))),i=Ai(s=>{let o=e.current.indexOf(s);o!==-1&&e.current.splice(o,1),n&&n.unregister(s)}),r=x.useMemo(()=>({register:t,unregister:i,portals:e}),[t,i,e]);return[e,x.useMemo(()=>function({children:s}){return we.createElement(jhe.Provider,{value:r},s)},[r])]}let cNt=Ja(oNt),uNt=Ja(lNt),Fhe=Object.assign(cNt,{Group:uNt});function dNt(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const hNt=typeof Object.is=="function"?Object.is:dNt,{useState:fNt,useEffect:pNt,useLayoutEffect:gNt,useDebugValue:mNt}=q_;function _Nt(n,e,t){const i=e(),[{inst:r},s]=fNt({inst:{value:i,getSnapshot:e}});return gNt(()=>{r.value=i,r.getSnapshot=e,hre(r)&&s({inst:r})},[n,i,e]),pNt(()=>(hre(r)&&s({inst:r}),n(()=>{hre(r)&&s({inst:r})})),[n]),mNt(i),i}function hre(n){const e=n.getSnapshot,t=n.value;try{const i=e();return!hNt(t,i)}catch{return!0}}function vNt(n,e,t){return e()}const bNt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yNt=!bNt,CNt=yNt?vNt:_Nt,wNt="useSyncExternalStore"in q_?(n=>n.useSyncExternalStore)(q_):CNt;function xNt(n){return wNt(n.subscribe,n.getSnapshot,n.getSnapshot)}function SNt(n,e){let t=n(),i=new Set;return{getSnapshot(){return t},subscribe(r){return i.add(r),()=>i.delete(r)},dispatch(r,...s){let o=e[r].call(t,...s);o&&(t=o,i.forEach(a=>a()))}}}function ENt(){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,s=n-r;t.style(i,"paddingRight",`${s}px`)}}}function kNt(){return pqe()?{before({doc:n,d:e,meta:t}){function i(r){return t.containers.flatMap(s=>s()).some(s=>s.contains(r))}e.microTask(()=>{var r;if(window.getComputedStyle(n.documentElement).scrollBehavior!=="auto"){let a=Am();a.style(n.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>a.dispose()))}let s=(r=window.scrollY)!=null?r:window.pageYOffset,o=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)&&(o=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;s!==l&&window.scrollTo(0,s),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function TNt(){return{before({doc:n,d:e}){e.style(n.documentElement,"overflow","hidden")}}}function INt(n){let e={};for(let t of n)Object.assign(e,t(e));return e}let H2=SNt(()=>new Map,{PUSH(n,e){var t;let i=(t=this.get(n))!=null?t:{doc:n,count:0,d:Am(),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:INt(t)},r=[kNt(),ENt(),TNt()];r.forEach(({before:s})=>s==null?void 0:s(i)),r.forEach(({after:s})=>s==null?void 0:s(i))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});H2.subscribe(()=>{let n=H2.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)&&H2.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&H2.dispatch("TEARDOWN",t)}});function LNt(n,e,t){let i=xNt(H2),r=n?i.get(n):void 0,s=r?r.count>0:!1;return Xa(()=>{if(!(!n||!e))return H2.dispatch("PUSH",n,t),()=>H2.dispatch("POP",n,t)},[e,n]),s}let fre=new Map,k5=new Map;function gDe(n,e=!0){Xa(()=>{var t;if(!e)return;let i=typeof n=="function"?n():n.current;if(!i)return;function r(){var o;if(!i)return;let a=(o=k5.get(i))!=null?o:1;if(a===1?k5.delete(i):k5.set(i,a-1),a!==1)return;let l=fre.get(i);l&&(l["aria-hidden"]===null?i.removeAttribute("aria-hidden"):i.setAttribute("aria-hidden",l["aria-hidden"]),i.inert=l.inert,fre.delete(i))}let s=(t=k5.get(i))!=null?t:0;return k5.set(i,s+1),s!==0||(fre.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),i.setAttribute("aria-hidden","true"),i.inert=!0),r},[n,e])}function Rqe({defaultContainers:n=[],portals:e,mainTreeNodeRef:t}={}){var i;let r=x.useRef((i=t==null?void 0:t.current)!=null?i:null),s=a1(r),o=Ai(()=>{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=s==null?void 0:s.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(f=>d.contains(f))||u.push(d));return u});return{resolveContainers:o,contains:Ai(a=>o().some(l=>l.contains(a))),mainTreeNodeRef:r,MainTreeNode:x.useMemo(()=>function(){return t!=null?null:we.createElement(ww,{features:Hy.Hidden,ref:r})},[r,t])}}function ANt(){let n=x.useRef(null);return{mainTreeNodeRef:n,MainTreeNode:x.useMemo(()=>function(){return we.createElement(ww,{features:Hy.Hidden,ref:n})},[n])}}let xwe=x.createContext(()=>{});xwe.displayName="StackContext";var Bhe=(n=>(n[n.Add=0]="Add",n[n.Remove=1]="Remove",n))(Bhe||{});function NNt(){return x.useContext(xwe)}function DNt({children:n,onUpdate:e,type:t,element:i,enabled:r}){let s=NNt(),o=Ai((...a)=>{e==null||e(...a),s(...a)});return Xa(()=>{let a=r===void 0||r===!0;return a&&o(0,t,i),()=>{a&&o(1,t,i)}},[o,t,i,r]),we.createElement(xwe.Provider,{value:o},n)}let Pqe=x.createContext(null);function Oqe(){let n=x.useContext(Pqe);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,Oqe),e}return n}function Mqe(){let[n,e]=x.useState([]);return[n.length>0?n.join(" "):void 0,x.useMemo(()=>function(t){let i=Ai(s=>(e(o=>[...o,s]),()=>e(o=>{let a=o.slice(),l=a.indexOf(s);return l!==-1&&a.splice(l,1),a}))),r=x.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props}),[i,t.slot,t.name,t.props]);return we.createElement(Pqe.Provider,{value:r},t.children)},[e])]}let RNt="p";function PNt(n,e){let t=Gc(),{id:i=`headlessui-description-${t}`,...r}=n,s=Oqe(),o=yl(e);Xa(()=>s.register(i),[i,s.register]);let a={ref:o,...s.props,id:i};return Za({ourProps:a,theirProps:r,slot:s.slot||{},defaultTag:RNt,name:s.name||"Description"})}let ONt=Ja(PNt),jqe=Object.assign(ONt,{});var MNt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(MNt||{}),jNt=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(jNt||{});let FNt={0(n,e){return n.titleId===e.id?n:{...n,titleId:e.id}}},wq=x.createContext(null);wq.displayName="DialogContext";function t9(n){let e=x.useContext(wq);if(e===null){let t=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,t9),t}return e}function BNt(n,e,t=()=>[document.body]){LNt(n,e,i=>{var r;return{containers:[...(r=i.containers)!=null?r:[],t]}})}function $Nt(n,e){return La(e.type,FNt,n,e)}let HNt="div",VNt=X_.RenderStrategy|X_.Static;function WNt(n,e){let t=Gc(),{id:i=`headlessui-dialog-${t}`,open:r,onClose:s,initialFocus:o,role:a="dialog",__demoMode:l=!1,...c}=n,[u,d]=x.useState(0),f=x.useRef(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(f.current||(f.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=fA();r===void 0&&p!==null&&(r=(p&Nl.Open)===Nl.Open);let g=x.useRef(null),m=yl(g,e),_=a1(g),v=n.hasOwnProperty("open")||p!==null,b=n.hasOwnProperty("onClose");if(!v&&!b)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)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 s!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${s}`);let y=r?0:1,[C,S]=x.useReducer($Nt,{titleId:null,descriptionId:null,panelRef:x.createRef()}),k=Ai(()=>s(!1)),I=Ai(Pe=>S({type:0,id:Pe})),L=r4()?l?!1:y===0:!1,N=u>1,P=x.useContext(wq)!==null,[O,F]=Dqe(),V={get current(){var Pe;return(Pe=C.panelRef.current)!=null?Pe:g.current}},{resolveContainers:M,mainTreeNodeRef:B,MainTreeNode:W}=Rqe({portals:O,defaultContainers:[V]}),q=N?"parent":"leaf",U=p!==null?(p&Nl.Closing)===Nl.Closing:!1,G=P||U?!1:L,H=x.useCallback(()=>{var Pe,Be;return(Be=Array.from((Pe=_==null?void 0:_.querySelectorAll("body > *"))!=null?Pe:[]).find($e=>$e.id==="headlessui-portal-root"?!1:$e.contains(B.current)&&$e instanceof HTMLElement))!=null?Be:null},[B]);gDe(H,G);let z=N?!0:L,Z=x.useCallback(()=>{var Pe,Be;return(Be=Array.from((Pe=_==null?void 0:_.querySelectorAll("[data-headlessui-portal]"))!=null?Pe:[]).find($e=>$e.contains(B.current)&&$e instanceof HTMLElement))!=null?Be:null},[B]);gDe(Z,z),ZZ(M,Pe=>{Pe.preventDefault(),k()},!(!L||N));let oe=!(N||y!==0);Cwe(_==null?void 0:_.defaultView,"keydown",Pe=>{oe&&(Pe.defaultPrevented||Pe.key===po.Escape&&(Pe.preventDefault(),Pe.stopPropagation(),k()))}),BNt(_,!(U||y!==0||P),M),x.useEffect(()=>{if(y!==0||!g.current)return;let Pe=new ResizeObserver(Be=>{for(let $e of Be){let qe=$e.target.getBoundingClientRect();qe.x===0&&qe.y===0&&qe.width===0&&qe.height===0&&k()}});return Pe.observe(g.current),()=>Pe.disconnect()},[y,g,k]);let[Se,Me]=Mqe(),Ie=x.useMemo(()=>[{dialogState:y,close:k,setTitleId:I},C],[y,C,k,I]),ge=x.useMemo(()=>({open:y===0}),[y]),ye={ref:m,id:i,role:a,"aria-modal":y===0?!0:void 0,"aria-labelledby":C.titleId,"aria-describedby":Se};return we.createElement(DNt,{type:"Dialog",enabled:y===0,element:g,onUpdate:Ai((Pe,Be)=>{Be==="Dialog"&&La(Pe,{[Bhe.Add]:()=>d($e=>$e+1),[Bhe.Remove]:()=>d($e=>$e-1)})})},we.createElement(Mhe,{force:!0},we.createElement(Fhe,null,we.createElement(wq.Provider,{value:Ie},we.createElement(Fhe.Group,{target:g},we.createElement(Mhe,{force:!1},we.createElement(Me,{slot:ge,name:"Dialog.Description"},we.createElement(E5,{initialFocus:o,containers:M,features:L?La(q,{parent:E5.features.RestoreFocus,leaf:E5.features.All&~E5.features.FocusLock}):E5.features.None},we.createElement(F,null,Za({ourProps:ye,theirProps:c,slot:ge,defaultTag:HNt,features:VNt,visible:y===0,name:"Dialog"}))))))))),we.createElement(W,null))}let zNt="div";function UNt(n,e){let t=Gc(),{id:i=`headlessui-dialog-overlay-${t}`,...r}=n,[{dialogState:s,close:o}]=t9("Dialog.Overlay"),a=yl(e),l=Ai(u=>{if(u.target===u.currentTarget){if(s4(u.currentTarget))return u.preventDefault();u.preventDefault(),u.stopPropagation(),o()}}),c=x.useMemo(()=>({open:s===0}),[s]);return Za({ourProps:{ref:a,id:i,"aria-hidden":!0,onClick:l},theirProps:r,slot:c,defaultTag:zNt,name:"Dialog.Overlay"})}let qNt="div";function KNt(n,e){let t=Gc(),{id:i=`headlessui-dialog-backdrop-${t}`,...r}=n,[{dialogState:s},o]=t9("Dialog.Backdrop"),a=yl(e);x.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[o.panelRef]);let l=x.useMemo(()=>({open:s===0}),[s]);return we.createElement(Mhe,{force:!0},we.createElement(Fhe,null,Za({ourProps:{ref:a,id:i,"aria-hidden":!0},theirProps:r,slot:l,defaultTag:qNt,name:"Dialog.Backdrop"})))}let GNt="div";function YNt(n,e){let t=Gc(),{id:i=`headlessui-dialog-panel-${t}`,...r}=n,[{dialogState:s},o]=t9("Dialog.Panel"),a=yl(e,o.panelRef),l=x.useMemo(()=>({open:s===0}),[s]),c=Ai(u=>{u.stopPropagation()});return Za({ourProps:{ref:a,id:i,onClick:c},theirProps:r,slot:l,defaultTag:GNt,name:"Dialog.Panel"})}let QNt="h2";function XNt(n,e){let t=Gc(),{id:i=`headlessui-dialog-title-${t}`,...r}=n,[{dialogState:s,setTitleId:o}]=t9("Dialog.Title"),a=yl(e);x.useEffect(()=>(o(i),()=>o(null)),[i,o]);let l=x.useMemo(()=>({open:s===0}),[s]);return Za({ourProps:{ref:a,id:i},theirProps:r,slot:l,defaultTag:QNt,name:"Dialog.Title"})}let ZNt=Ja(WNt),JNt=Ja(KNt),eDt=Ja(YNt),tDt=Ja(UNt),nDt=Ja(XNt),iI=Object.assign(ZNt,{Backdrop:JNt,Panel:eDt,Overlay:tDt,Title:nDt,Description:jqe}),mDe=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function _De(n){var e,t;let i=(e=n.innerText)!=null?e:"",r=n.cloneNode(!0);if(!(r instanceof HTMLElement))return i;let s=!1;for(let a of r.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),s=!0;let o=s?(t=r.innerText)!=null?t:"":i;return mDe.test(o)&&(o=o.replace(mDe,"")),o}function iDt(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 s=document.getElementById(r);if(s){let o=s.getAttribute("aria-label");return typeof o=="string"?o.trim():_De(s).trim()}return null}).filter(Boolean);if(i.length>0)return i.join(", ")}return _De(n).trim()}function rDt(n){let e=x.useRef(""),t=x.useRef("");return Ai(()=>{let i=n.current;if(!i)return"";let r=i.innerText;if(e.current===r)return t.current;let s=iDt(i).trim().toLowerCase();return e.current=r,t.current=s,s})}var sDt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(sDt||{}),oDt=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(oDt||{}),aDt=(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))(aDt||{});function pre(n,e=t=>t){let t=n.activeItemIndex!==null?n.items[n.activeItemIndex]:null,i=_we(e(n.items.slice()),s=>s.dataRef.current.domRef.current),r=t?i.indexOf(t):null;return r===-1&&(r=null),{items:i,activeItemIndex:r}}let lDt={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=pre(n),r=Ohe(e,{resolveItems:()=>i.items,resolveActiveIndex:()=>i.activeItemIndex,resolveId:s=>s.id,resolveDisabled:s=>s.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(o=>{var a;return((a=o.dataRef.current.textValue)==null?void 0:a.startsWith(i))&&!o.dataRef.current.disabled}),s=r?n.items.indexOf(r):-1;return s===-1||s===n.activeItemIndex?{...n,searchQuery:i}:{...n,searchQuery:i,activeItemIndex:s,activationTrigger:1}},4(n){return n.searchQuery===""?n:{...n,searchQuery:"",searchActiveItemIndex:null}},5:(n,e)=>{let t=pre(n,i=>[...i,{id:e.id,dataRef:e.dataRef}]);return{...n,...t}},6:(n,e)=>{let t=pre(n,i=>{let r=i.findIndex(s=>s.id===e.id);return r!==-1&&i.splice(r,1),i});return{...n,...t,activationTrigger:1}}},Swe=x.createContext(null);Swe.displayName="MenuContext";function tJ(n){let e=x.useContext(Swe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,tJ),t}return e}function cDt(n,e){return La(e.type,lDt,n,e)}let uDt=x.Fragment;function dDt(n,e){let{__demoMode:t=!1,...i}=n,r=x.useReducer(cDt,{__demoMode:t,menuState:t?0:1,buttonRef:x.createRef(),itemsRef:x.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:s,itemsRef:o,buttonRef:a},l]=r,c=yl(e);ZZ([a,o],(p,g)=>{var m;l({type:1}),XZ(g,QZ.Loose)||(p.preventDefault(),(m=a.current)==null||m.focus())},s===0);let u=Ai(()=>{l({type:1})}),d=x.useMemo(()=>({open:s===0,close:u}),[s,u]),f={ref:c};return we.createElement(Swe.Provider,{value:r},we.createElement(eJ,{value:La(s,{0:Nl.Open,1:Nl.Closed})},Za({ourProps:f,theirProps:i,slot:d,defaultTag:uDt,name:"Menu"})))}let hDt="button";function fDt(n,e){var t;let i=Gc(),{id:r=`headlessui-menu-button-${i}`,...s}=n,[o,a]=tJ("Menu.Button"),l=yl(o.buttonRef,e),c=Ww(),u=Ai(m=>{switch(m.key){case po.Space:case po.Enter:case po.ArrowDown:m.preventDefault(),m.stopPropagation(),a({type:0}),c.nextFrame(()=>a({type:2,focus:sl.First}));break;case po.ArrowUp:m.preventDefault(),m.stopPropagation(),a({type:0}),c.nextFrame(()=>a({type:2,focus:sl.Last}));break}}),d=Ai(m=>{switch(m.key){case po.Space:m.preventDefault();break}}),f=Ai(m=>{if(s4(m.currentTarget))return m.preventDefault();n.disabled||(o.menuState===0?(a({type:1}),c.nextFrame(()=>{var _;return(_=o.buttonRef.current)==null?void 0:_.focus({preventScroll:!0})})):(m.preventDefault(),a({type:0})))}),p=x.useMemo(()=>({open:o.menuState===0}),[o]),g={ref:l,id:r,type:JZ(n,o.buttonRef),"aria-haspopup":"menu","aria-controls":(t=o.itemsRef.current)==null?void 0:t.id,"aria-expanded":o.menuState===0,onKeyDown:u,onKeyUp:d,onClick:f};return Za({ourProps:g,theirProps:s,slot:p,defaultTag:hDt,name:"Menu.Button"})}let pDt="div",gDt=X_.RenderStrategy|X_.Static;function mDt(n,e){var t,i;let r=Gc(),{id:s=`headlessui-menu-items-${r}`,...o}=n,[a,l]=tJ("Menu.Items"),c=yl(a.itemsRef,e),u=a1(a.itemsRef),d=Ww(),f=fA(),p=f!==null?(f&Nl.Open)===Nl.Open:a.menuState===0;x.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]),yqe({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=Ai(b=>{var y,C;switch(d.dispose(),b.key){case po.Space:if(a.searchQuery!=="")return b.preventDefault(),b.stopPropagation(),l({type:3,value:b.key});case po.Enter:if(b.preventDefault(),b.stopPropagation(),l({type:1}),a.activeItemIndex!==null){let{dataRef:S}=a.items[a.activeItemIndex];(C=(y=S.current)==null?void 0:y.domRef.current)==null||C.click()}fqe(a.buttonRef.current);break;case po.ArrowDown:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:sl.Next});case po.ArrowUp:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:sl.Previous});case po.Home:case po.PageUp:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:sl.First});case po.End:case po.PageDown:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:sl.Last});case po.Escape:b.preventDefault(),b.stopPropagation(),l({type:1}),Am().nextFrame(()=>{var S;return(S=a.buttonRef.current)==null?void 0:S.focus({preventScroll:!0})});break;case po.Tab:b.preventDefault(),b.stopPropagation(),l({type:1}),Am().nextFrame(()=>{fAt(a.buttonRef.current,b.shiftKey?_h.Previous:_h.Next)});break;default:b.key.length===1&&(l({type:3,value:b.key}),d.setTimeout(()=>l({type:4}),350));break}}),m=Ai(b=>{switch(b.key){case po.Space:b.preventDefault();break}}),_=x.useMemo(()=>({open:a.menuState===0}),[a]),v={"aria-activedescendant":a.activeItemIndex===null||(t=a.items[a.activeItemIndex])==null?void 0:t.id,"aria-labelledby":(i=a.buttonRef.current)==null?void 0:i.id,id:s,onKeyDown:g,onKeyUp:m,role:"menu",tabIndex:0,ref:c};return Za({ourProps:v,theirProps:o,slot:_,defaultTag:pDt,features:gDt,visible:p,name:"Menu.Items"})}let _Dt=x.Fragment;function vDt(n,e){let t=Gc(),{id:i=`headlessui-menu-item-${t}`,disabled:r=!1,...s}=n,[o,a]=tJ("Menu.Item"),l=o.activeItemIndex!==null?o.items[o.activeItemIndex].id===i:!1,c=x.useRef(null),u=yl(e,c);Xa(()=>{if(o.__demoMode||o.menuState!==0||!l||o.activationTrigger===0)return;let S=Am();return S.requestAnimationFrame(()=>{var k,I;(I=(k=c.current)==null?void 0:k.scrollIntoView)==null||I.call(k,{block:"nearest"})}),S.dispose},[o.__demoMode,c,l,o.menuState,o.activationTrigger,o.activeItemIndex]);let d=rDt(c),f=x.useRef({disabled:r,domRef:c,get textValue(){return d()}});Xa(()=>{f.current.disabled=r},[f,r]),Xa(()=>(a({type:5,id:i,dataRef:f}),()=>a({type:6,id:i})),[f,i]);let p=Ai(()=>{a({type:1})}),g=Ai(S=>{if(r)return S.preventDefault();a({type:1}),fqe(o.buttonRef.current)}),m=Ai(()=>{if(r)return a({type:2,focus:sl.Nothing});a({type:2,focus:sl.Specific,id:i})}),_=bqe(),v=Ai(S=>_.update(S)),b=Ai(S=>{_.wasMoved(S)&&(r||l||a({type:2,focus:sl.Specific,id:i,trigger:0}))}),y=Ai(S=>{_.wasMoved(S)&&(r||l&&a({type:2,focus:sl.Nothing}))}),C=x.useMemo(()=>({active:l,disabled:r,close:p}),[l,r,p]);return Za({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:v,onMouseEnter:v,onPointerMove:b,onMouseMove:b,onPointerLeave:y,onMouseLeave:y},theirProps:s,slot:C,defaultTag:_Dt,name:"Menu.Item"})}let bDt=Ja(dDt),yDt=Ja(fDt),CDt=Ja(mDt),wDt=Ja(vDt),jx=Object.assign(bDt,{Button:yDt,Items:CDt,Item:wDt});var xDt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(xDt||{}),SDt=(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))(SDt||{});let EDt={0:n=>{let e={...n,popoverState:La(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}}},Ewe=x.createContext(null);Ewe.displayName="PopoverContext";function nJ(n){let e=x.useContext(Ewe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,nJ),t}return e}let kwe=x.createContext(null);kwe.displayName="PopoverAPIContext";function Twe(n){let e=x.useContext(kwe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Twe),t}return e}let Iwe=x.createContext(null);Iwe.displayName="PopoverGroupContext";function Fqe(){return x.useContext(Iwe)}let iJ=x.createContext(null);iJ.displayName="PopoverPanelContext";function kDt(){return x.useContext(iJ)}function TDt(n,e){return La(e.type,EDt,n,e)}let IDt="div";function LDt(n,e){var t;let{__demoMode:i=!1,...r}=n,s=x.useRef(null),o=yl(e,vqe(W=>{s.current=W})),a=x.useRef([]),l=x.useReducer(TDt,{__demoMode:i,popoverState:i?0:1,buttons:a,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:x.createRef(),afterPanelSentinel:x.createRef()}),[{popoverState:c,button:u,buttonId:d,panel:f,panelId:p,beforePanelSentinel:g,afterPanelSentinel:m},_]=l,v=a1((t=s.current)!=null?t:u),b=x.useMemo(()=>{if(!u||!f)return!1;for(let Z of document.querySelectorAll("body > *"))if(Number(Z==null?void 0:Z.contains(u))^Number(Z==null?void 0:Z.contains(f)))return!0;let W=ZB(),q=W.indexOf(u),U=(q+W.length-1)%W.length,G=(q+1)%W.length,H=W[U],z=W[G];return!f.contains(H)&&!f.contains(z)},[u,f]),y=Cm(d),C=Cm(p),S=x.useMemo(()=>({buttonId:y,panelId:C,close:()=>_({type:1})}),[y,C,_]),k=Fqe(),I=k==null?void 0:k.registerPopover,L=Ai(()=>{var W;return(W=k==null?void 0:k.isFocusWithinPopoverGroup())!=null?W:(v==null?void 0:v.activeElement)&&((u==null?void 0:u.contains(v.activeElement))||(f==null?void 0:f.contains(v.activeElement)))});x.useEffect(()=>I==null?void 0:I(S),[I,S]);let[N,P]=Dqe(),O=Rqe({mainTreeNodeRef:k==null?void 0:k.mainTreeNodeRef,portals:N,defaultContainers:[u,f]});Cwe(v==null?void 0:v.defaultView,"focus",W=>{var q,U,G,H;W.target!==window&&W.target instanceof HTMLElement&&c===0&&(L()||u&&f&&(O.contains(W.target)||(U=(q=g.current)==null?void 0:q.contains)!=null&&U.call(q,W.target)||(H=(G=m.current)==null?void 0:G.contains)!=null&&H.call(G,W.target)||_({type:1})))},!0),ZZ(O.resolveContainers,(W,q)=>{_({type:1}),XZ(q,QZ.Loose)||(W.preventDefault(),u==null||u.focus())},c===0);let F=Ai(W=>{_({type:1});let q=W?W instanceof HTMLElement?W:"current"in W&&W.current instanceof HTMLElement?W.current:u:u;q==null||q.focus()}),V=x.useMemo(()=>({close:F,isPortalled:b}),[F,b]),M=x.useMemo(()=>({open:c===0,close:F}),[c,F]),B={ref:o};return we.createElement(iJ.Provider,{value:null},we.createElement(Ewe.Provider,{value:l},we.createElement(kwe.Provider,{value:V},we.createElement(eJ,{value:La(c,{0:Nl.Open,1:Nl.Closed})},we.createElement(P,null,Za({ourProps:B,theirProps:r,slot:M,defaultTag:IDt,name:"Popover"}),we.createElement(O.MainTreeNode,null))))))}let ADt="button";function NDt(n,e){let t=Gc(),{id:i=`headlessui-popover-button-${t}`,...r}=n,[s,o]=nJ("Popover.Button"),{isPortalled:a}=Twe("Popover.Button"),l=x.useRef(null),c=`headlessui-focus-sentinel-${Gc()}`,u=Fqe(),d=u==null?void 0:u.closeOthers,f=kDt()!==null;x.useEffect(()=>{if(!f)return o({type:3,buttonId:i}),()=>{o({type:3,buttonId:null})}},[f,i,o]);let[p]=x.useState(()=>Symbol()),g=yl(l,e,f?null:O=>{if(O)s.buttons.current.push(p);else{let F=s.buttons.current.indexOf(p);F!==-1&&s.buttons.current.splice(F,1)}s.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),O&&o({type:2,button:O})}),m=yl(l,e),_=a1(l),v=Ai(O=>{var F,V,M;if(f){if(s.popoverState===1)return;switch(O.key){case po.Space:case po.Enter:O.preventDefault(),(V=(F=O.target).click)==null||V.call(F),o({type:1}),(M=s.button)==null||M.focus();break}}else switch(O.key){case po.Space:case po.Enter:O.preventDefault(),O.stopPropagation(),s.popoverState===1&&(d==null||d(s.buttonId)),o({type:0});break;case po.Escape:if(s.popoverState!==0)return d==null?void 0:d(s.buttonId);if(!l.current||_!=null&&_.activeElement&&!l.current.contains(_.activeElement))return;O.preventDefault(),O.stopPropagation(),o({type:1});break}}),b=Ai(O=>{f||O.key===po.Space&&O.preventDefault()}),y=Ai(O=>{var F,V;s4(O.currentTarget)||n.disabled||(f?(o({type:1}),(F=s.button)==null||F.focus()):(O.preventDefault(),O.stopPropagation(),s.popoverState===1&&(d==null||d(s.buttonId)),o({type:0}),(V=s.button)==null||V.focus()))}),C=Ai(O=>{O.preventDefault(),O.stopPropagation()}),S=s.popoverState===0,k=x.useMemo(()=>({open:S}),[S]),I=JZ(n,l),L=f?{ref:m,type:I,onKeyDown:v,onClick:y}:{ref:g,id:s.buttonId,type:I,"aria-expanded":s.popoverState===0,"aria-controls":s.panel?s.panelId:void 0,onKeyDown:v,onKeyUp:b,onClick:y,onMouseDown:C},N=wwe(),P=Ai(()=>{let O=s.panel;if(!O)return;function F(){La(N.current,{[dm.Forwards]:()=>M_(O,_h.First),[dm.Backwards]:()=>M_(O,_h.Last)})===f8.Error&&M_(ZB().filter(V=>V.dataset.headlessuiFocusGuard!=="true"),La(N.current,{[dm.Forwards]:_h.Next,[dm.Backwards]:_h.Previous}),{relativeTo:s.button})}F()});return we.createElement(we.Fragment,null,Za({ourProps:L,theirProps:r,slot:k,defaultTag:ADt,name:"Popover.Button"}),S&&!f&&a&&we.createElement(ww,{id:c,features:Hy.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:P}))}let DDt="div",RDt=X_.RenderStrategy|X_.Static;function PDt(n,e){let t=Gc(),{id:i=`headlessui-popover-overlay-${t}`,...r}=n,[{popoverState:s},o]=nJ("Popover.Overlay"),a=yl(e),l=fA(),c=l!==null?(l&Nl.Open)===Nl.Open:s===0,u=Ai(f=>{if(s4(f.currentTarget))return f.preventDefault();o({type:1})}),d=x.useMemo(()=>({open:s===0}),[s]);return Za({ourProps:{ref:a,id:i,"aria-hidden":!0,onClick:u},theirProps:r,slot:d,defaultTag:DDt,features:RDt,visible:c,name:"Popover.Overlay"})}let ODt="div",MDt=X_.RenderStrategy|X_.Static;function jDt(n,e){let t=Gc(),{id:i=`headlessui-popover-panel-${t}`,focus:r=!1,...s}=n,[o,a]=nJ("Popover.Panel"),{close:l,isPortalled:c}=Twe("Popover.Panel"),u=`headlessui-focus-sentinel-before-${Gc()}`,d=`headlessui-focus-sentinel-after-${Gc()}`,f=x.useRef(null),p=yl(f,e,L=>{a({type:4,panel:L})}),g=a1(f),m=gAt();Xa(()=>(a({type:5,panelId:i}),()=>{a({type:5,panelId:null})}),[i,a]);let _=fA(),v=_!==null?(_&Nl.Open)===Nl.Open:o.popoverState===0,b=Ai(L=>{var N;switch(L.key){case po.Escape:if(o.popoverState!==0||!f.current||g!=null&&g.activeElement&&!f.current.contains(g.activeElement))return;L.preventDefault(),L.stopPropagation(),a({type:1}),(N=o.button)==null||N.focus();break}});x.useEffect(()=>{var L;n.static||o.popoverState===1&&((L=n.unmount)==null||L)&&a({type:4,panel:null})},[o.popoverState,n.unmount,n.static,a]),x.useEffect(()=>{if(o.__demoMode||!r||o.popoverState!==0||!f.current)return;let L=g==null?void 0:g.activeElement;f.current.contains(L)||M_(f.current,_h.First)},[o.__demoMode,r,f,o.popoverState]);let y=x.useMemo(()=>({open:o.popoverState===0,close:l}),[o,l]),C={ref:p,id:i,onKeyDown:b,onBlur:r&&o.popoverState===0?L=>{var N,P,O,F,V;let M=L.relatedTarget;M&&f.current&&((N=f.current)!=null&&N.contains(M)||(a({type:1}),((O=(P=o.beforePanelSentinel.current)==null?void 0:P.contains)!=null&&O.call(P,M)||(V=(F=o.afterPanelSentinel.current)==null?void 0:F.contains)!=null&&V.call(F,M))&&M.focus({preventScroll:!0})))}:void 0,tabIndex:-1},S=wwe(),k=Ai(()=>{let L=f.current;if(!L)return;function N(){La(S.current,{[dm.Forwards]:()=>{var P;M_(L,_h.First)===f8.Error&&((P=o.afterPanelSentinel.current)==null||P.focus())},[dm.Backwards]:()=>{var P;(P=o.button)==null||P.focus({preventScroll:!0})}})}N()}),I=Ai(()=>{let L=f.current;if(!L)return;function N(){La(S.current,{[dm.Forwards]:()=>{var P;if(!o.button)return;let O=ZB(),F=O.indexOf(o.button),V=O.slice(0,F+1),M=[...O.slice(F+1),...V];for(let B of M.slice())if(B.dataset.headlessuiFocusGuard==="true"||(P=o.panel)!=null&&P.contains(B)){let W=M.indexOf(B);W!==-1&&M.splice(W,1)}M_(M,_h.First,{sorted:!1})},[dm.Backwards]:()=>{var P;M_(L,_h.Previous)===f8.Error&&((P=o.button)==null||P.focus())}})}N()});return we.createElement(iJ.Provider,{value:i},v&&c&&we.createElement(ww,{id:u,ref:o.beforePanelSentinel,features:Hy.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:k}),Za({mergeRefs:m,ourProps:C,theirProps:s,slot:y,defaultTag:ODt,features:MDt,visible:v,name:"Popover.Panel"}),v&&c&&we.createElement(ww,{id:d,ref:o.afterPanelSentinel,features:Hy.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:I}))}let FDt="div";function BDt(n,e){let t=x.useRef(null),i=yl(t,e),[r,s]=x.useState([]),o=ANt(),a=Ai(m=>{s(_=>{let v=_.indexOf(m);if(v!==-1){let b=_.slice();return b.splice(v,1),b}return _})}),l=Ai(m=>(s(_=>[..._,m]),()=>a(m))),c=Ai(()=>{var m;let _=XB(t);if(!_)return!1;let v=_.activeElement;return(m=t.current)!=null&&m.contains(v)?!0:r.some(b=>{var y,C;return((y=_.getElementById(b.buttonId.current))==null?void 0:y.contains(v))||((C=_.getElementById(b.panelId.current))==null?void 0:C.contains(v))})}),u=Ai(m=>{for(let _ of r)_.buttonId.current!==m&&_.close()}),d=x.useMemo(()=>({registerPopover:l,unregisterPopover:a,isFocusWithinPopoverGroup:c,closeOthers:u,mainTreeNodeRef:o.mainTreeNodeRef}),[l,a,c,u,o.mainTreeNodeRef]),f=x.useMemo(()=>({}),[]),p=n,g={ref:i};return we.createElement(Iwe.Provider,{value:d},Za({ourProps:g,theirProps:p,slot:f,defaultTag:FDt,name:"Popover.Group"}),we.createElement(o.MainTreeNode,null))}let $Dt=Ja(LDt),HDt=Ja(NDt),VDt=Ja(PDt),WDt=Ja(jDt),zDt=Ja(BDt),CL=Object.assign($Dt,{Button:HDt,Overlay:VDt,Panel:WDt,Group:zDt}),Bqe=x.createContext(null);function $qe(){let n=x.useContext(Bqe);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,$qe),e}return n}function UDt(){let[n,e]=x.useState([]);return[n.length>0?n.join(" "):void 0,x.useMemo(()=>function(t){let i=Ai(s=>(e(o=>[...o,s]),()=>e(o=>{let a=o.slice(),l=a.indexOf(s);return l!==-1&&a.splice(l,1),a}))),r=x.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props}),[i,t.slot,t.name,t.props]);return we.createElement(Bqe.Provider,{value:r},t.children)},[e])]}let qDt="label";function KDt(n,e){let t=Gc(),{id:i=`headlessui-label-${t}`,passive:r=!1,...s}=n,o=$qe(),a=yl(e);Xa(()=>o.register(i),[i,o.register]);let l={ref:a,...o.props,id:i};return r&&("onClick"in l&&(delete l.htmlFor,delete l.onClick),"onClick"in s&&delete s.onClick),Za({ourProps:l,theirProps:s,slot:o.slot||{},defaultTag:qDt,name:o.name||"Label"})}let GDt=Ja(KDt),YDt=Object.assign(GDt,{});function QDt(n=0){let[e,t]=x.useState(n),i=e9(),r=x.useCallback(l=>{i.current&&t(c=>c|l)},[e,i]),s=x.useCallback(l=>!!(e&l),[e]),o=x.useCallback(l=>{i.current&&t(c=>c&~l)},[t,i]),a=x.useCallback(l=>{i.current&&t(c=>c^l)},[t]);return{flags:e,addFlag:r,hasFlag:s,removeFlag:o,toggleFlag:a}}let Lwe=x.createContext(null);Lwe.displayName="GroupContext";let XDt=x.Fragment;function ZDt(n){var e;let[t,i]=x.useState(null),[r,s]=UDt(),[o,a]=Mqe(),l=x.useMemo(()=>({switch:t,setSwitch:i,labelledby:r,describedby:o}),[t,i,r,o]),c={},u=n;return we.createElement(a,{name:"Switch.Description"},we.createElement(s,{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}))}}},we.createElement(Lwe.Provider,{value:l},Za({ourProps:c,theirProps:u,defaultTag:XDt,name:"Switch.Group"}))))}let JDt="button";function eRt(n,e){var t;let i=Gc(),{id:r=`headlessui-switch-${i}`,checked:s,defaultChecked:o=!1,onChange:a,disabled:l=!1,name:c,value:u,form:d,...f}=n,p=x.useContext(Lwe),g=x.useRef(null),m=yl(g,e,p===null?null:p.setSwitch),[_,v]=hqe(s,a,o),b=Ai(()=>v==null?void 0:v(!_)),y=Ai(N=>{if(s4(N.currentTarget))return N.preventDefault();N.preventDefault(),b()}),C=Ai(N=>{N.key===po.Space?(N.preventDefault(),b()):N.key===po.Enter&&wAt(N.currentTarget)}),S=Ai(N=>N.preventDefault()),k=x.useMemo(()=>({checked:_}),[_]),I={id:r,ref:m,role:"switch",type:JZ(n,g),tabIndex:n.tabIndex===-1?0:(t=n.tabIndex)!=null?t:0,"aria-checked":_,"aria-labelledby":p==null?void 0:p.labelledby,"aria-describedby":p==null?void 0:p.describedby,disabled:l,onClick:y,onKeyUp:C,onKeyPress:S},L=Ww();return x.useEffect(()=>{var N;let P=(N=g.current)==null?void 0:N.closest("form");P&&o!==void 0&&L.addEventListener(P,"reset",()=>{v(o)})},[g,v]),we.createElement(we.Fragment,null,c!=null&&_&&we.createElement(ww,{features:Hy.Hidden,...Cq({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:l,form:d,checked:_,name:c,value:u})}),Za({ourProps:I,theirProps:f,slot:k,defaultTag:JDt,name:"Switch"}))}let tRt=Ja(eRt),nRt=ZDt,$he=Object.assign(tRt,{Group:nRt,Label:YDt,Description:jqe});function iRt(n){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,n(...t)}}function gre(n,...e){n&&e.length>0&&n.classList.add(...e)}function mre(n,...e){n&&e.length>0&&n.classList.remove(...e)}function rRt(n,e){let t=Am();if(!n)return t.dispose;let{transitionDuration:i,transitionDelay:r}=getComputedStyle(n),[s,o]=[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=s+o;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 sRt(n,e,t,i){let r=t?"enter":"leave",s=Am(),o=i!==void 0?iRt(i):()=>{};r==="enter"&&(n.removeAttribute("hidden"),n.style.display="");let a=La(r,{enter:()=>e.enter,leave:()=>e.leave}),l=La(r,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),c=La(r,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return mre(n,...e.base,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),gre(n,...e.base,...a,...c),s.nextFrame(()=>{mre(n,...e.base,...a,...c),gre(n,...e.base,...a,...l),rRt(n,()=>(mre(n,...e.base,...a),gre(n,...e.base,...e.entered),o()))}),s.dispose}function oRt({immediate:n,container:e,direction:t,classes:i,onStart:r,onStop:s}){let o=e9(),a=Ww(),l=Cm(t);Xa(()=>{n&&(l.current="enter")},[n]),Xa(()=>{let c=Am();a.add(c.dispose);let u=e.current;if(u&&l.current!=="idle"&&o.current)return c.dispose(),r.current(l.current),c.add(sRt(u,i.current,l.current==="enter",()=>{c.dispose(),s.current(l.current)})),c.dispose},[t])}function Fx(n=""){return n.split(/\s+/).filter(e=>e.length>1)}let rJ=x.createContext(null);rJ.displayName="TransitionContext";var aRt=(n=>(n.Visible="visible",n.Hidden="hidden",n))(aRt||{});function lRt(){let n=x.useContext(rJ);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function cRt(){let n=x.useContext(sJ);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let sJ=x.createContext(null);sJ.displayName="NestingContext";function oJ(n){return"children"in n?oJ(n.children):n.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Hqe(n,e){let t=Cm(n),i=x.useRef([]),r=e9(),s=Ww(),o=Ai((p,g=NS.Hidden)=>{let m=i.current.findIndex(({el:_})=>_===p);m!==-1&&(La(g,{[NS.Unmount](){i.current.splice(m,1)},[NS.Hidden](){i.current[m].state="hidden"}}),s.microTask(()=>{var _;!oJ(i)&&r.current&&((_=t.current)==null||_.call(t))}))}),a=Ai(p=>{let g=i.current.find(({el:m})=>m===p);return g?g.state!=="visible"&&(g.state="visible"):i.current.push({el:p,state:"visible"}),()=>o(p,NS.Unmount)}),l=x.useRef([]),c=x.useRef(Promise.resolve()),u=x.useRef({enter:[],leave:[],idle:[]}),d=Ai((p,g,m)=>{l.current.splice(0),e&&(e.chains.current[g]=e.chains.current[g].filter(([_])=>_!==p)),e==null||e.chains.current[g].push([p,new Promise(_=>{l.current.push(_)})]),e==null||e.chains.current[g].push([p,new Promise(_=>{Promise.all(u.current[g].map(([v,b])=>b)).then(()=>_())})]),g==="enter"?c.current=c.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(g)):m(g)}),f=Ai((p,g,m)=>{Promise.all(u.current[g].splice(0).map(([_,v])=>v)).then(()=>{var _;(_=l.current.shift())==null||_()}).then(()=>m(g))});return x.useMemo(()=>({children:i,register:a,unregister:o,onStart:d,onStop:f,wait:c,chains:u}),[a,o,i,d,f,u,c])}function uRt(){}let dRt=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function vDe(n){var e;let t={};for(let i of dRt)t[i]=(e=n[i])!=null?e:uRt;return t}function hRt(n){let e=x.useRef(vDe(n));return x.useEffect(()=>{e.current=vDe(n)},[n]),e}let fRt="div",Vqe=X_.RenderStrategy;function pRt(n,e){var t,i;let{beforeEnter:r,afterEnter:s,beforeLeave:o,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:d,leave:f,leaveFrom:p,leaveTo:g,...m}=n,_=x.useRef(null),v=yl(_,e),b=(t=m.unmount)==null||t?NS.Unmount:NS.Hidden,{show:y,appear:C,initial:S}=lRt(),[k,I]=x.useState(y?"visible":"hidden"),L=cRt(),{register:N,unregister:P}=L;x.useEffect(()=>N(_),[N,_]),x.useEffect(()=>{if(b===NS.Hidden&&_.current){if(y&&k!=="visible"){I("visible");return}return La(k,{hidden:()=>P(_),visible:()=>N(_)})}},[k,_,N,P,y,b]);let O=Cm({base:Fx(m.className),enter:Fx(l),enterFrom:Fx(c),enterTo:Fx(u),entered:Fx(d),leave:Fx(f),leaveFrom:Fx(p),leaveTo:Fx(g)}),F=hRt({beforeEnter:r,afterEnter:s,beforeLeave:o,afterLeave:a}),V=r4();x.useEffect(()=>{if(V&&k==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,k,V]);let M=S&&!C,B=C&&y&&S,W=!V||M?"idle":y?"enter":"leave",q=QDt(0),U=Ai(oe=>La(oe,{enter:()=>{q.addFlag(Nl.Opening),F.current.beforeEnter()},leave:()=>{q.addFlag(Nl.Closing),F.current.beforeLeave()},idle:()=>{}})),G=Ai(oe=>La(oe,{enter:()=>{q.removeFlag(Nl.Opening),F.current.afterEnter()},leave:()=>{q.removeFlag(Nl.Closing),F.current.afterLeave()},idle:()=>{}})),H=Hqe(()=>{I("hidden"),P(_)},L),z=x.useRef(!1);oRt({immediate:B,container:_,classes:O,direction:W,onStart:Cm(oe=>{z.current=!0,H.onStart(_,oe,U)}),onStop:Cm(oe=>{z.current=!1,H.onStop(_,oe,G),oe==="leave"&&!oJ(H)&&(I("hidden"),P(_))})});let Z=m,X={ref:v};return B?Z={...Z,className:yq(m.className,...O.current.enter,...O.current.enterFrom)}:z.current&&(Z.className=yq(m.className,(i=_.current)==null?void 0:i.className),Z.className===""&&delete Z.className),we.createElement(sJ.Provider,{value:H},we.createElement(eJ,{value:La(k,{visible:Nl.Open,hidden:Nl.Closed})|q.flags},Za({ourProps:X,theirProps:Z,defaultTag:fRt,features:Vqe,visible:k==="visible",name:"Transition.Child"})))}function gRt(n,e){let{show:t,appear:i=!1,unmount:r=!0,...s}=n,o=x.useRef(null),a=yl(o,e);r4();let l=fA();if(t===void 0&&l!==null&&(t=(l&Nl.Open)===Nl.Open),![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=x.useState(t?"visible":"hidden"),d=Hqe(()=>{u("hidden")}),[f,p]=x.useState(!0),g=x.useRef([t]);Xa(()=>{f!==!1&&g.current[g.current.length-1]!==t&&(g.current.push(t),p(!1))},[g,t]);let m=x.useMemo(()=>({show:t,appear:i,initial:f}),[t,i,f]);x.useEffect(()=>{if(t)u("visible");else if(!oJ(d))u("hidden");else{let y=o.current;if(!y)return;let C=y.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&u("hidden")}},[t,d]);let _={unmount:r},v=Ai(()=>{var y;f&&p(!1),(y=n.beforeEnter)==null||y.call(n)}),b=Ai(()=>{var y;f&&p(!1),(y=n.beforeLeave)==null||y.call(n)});return we.createElement(sJ.Provider,{value:d},we.createElement(rJ.Provider,{value:m},Za({ourProps:{..._,as:x.Fragment,children:we.createElement(Wqe,{ref:a,..._,...s,beforeEnter:v,beforeLeave:b})},theirProps:{},defaultTag:x.Fragment,features:Vqe,visible:c==="visible",name:"Transition"})))}function mRt(n,e){let t=x.useContext(rJ)!==null,i=fA()!==null;return we.createElement(we.Fragment,null,!t&&i?we.createElement(Hhe,{ref:e,...n}):we.createElement(Wqe,{ref:e,...n}))}let Hhe=Ja(gRt),Wqe=Ja(pRt),_Rt=Ja(mRt),fb=Object.assign(Hhe,{Child:_Rt,Root:Hhe});const vRt=As($he)` &:focus { outline: 2px solid ${n=>n.theme.ringColor}; } border-color: ${n=>n.theme.borderColor}; background-color: ${n=>n.theme.backgroundColor}; `;function jt(n){const e=xt(),[t,i]=x.useState(!1),[r,s]=x.useState(!1);return x.useEffect(()=>{i(!!n.checked),s(!!n.disabled)},[n.checked,n.disabled]),h.jsxs($he.Group,{as:"div",className:"flex items-center",children:[h.jsx(vRt,{theme:{ringColor:e.$5,borderColor:e.$5,backgroundColor:t?e.$3:e.$5},className:$t("relative inline-flex items-center flex-shrink-0 h-6 w-11 rounded-full transition-colors ease-in-out duration-200",{"cursor-not-allowed opacity-75":r,"border cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2":!r}),checked:t,onChange:o=>{r||(i(o),n.onChange&&n.onChange(o),n.onValueChange&&n.onValueChange(o))},"data-cy":n.cypressRef,children:h.jsx("span",{"aria-hidden":"true",className:$t(t?"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&&h.jsx($he.Label,{as:"span",className:"ml-3",children:h.jsx("span",{className:"text-sm",style:{color:e.$3},children:n.label})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function zqe({size:n="1rem",color:e="#A1A1AA",className:t}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",className:t,children:[h.jsx("path",{d:"M7.25,16.25v-3.75c0-.966,.784-1.75,1.75-1.75h0c.966,0,1.75,.784,1.75,1.75v3.75",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M3.145,6.2l5.25-3.99c.358-.272,.853-.272,1.21,0l5.25,3.99c.249,.189,.395,.484,.395,.796v7.254c0,1.105-.895,2-2,2H4.75c-1.105,0-2-.895-2-2V6.996c0-.313,.146-.607,.395-.796Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}function Awe(n){const e=xt();return n.pages.length===0?null:h.jsx("nav",{className:"flex","aria-label":"Breadcrumb",children:h.jsxs("ol",{role:"list",className:"flex items-center space-x-4",children:[h.jsx("li",{children:h.jsx(Ji,{to:"/dashboard",withoutDefaultStyling:!0,children:h.jsx(zqe,{size:"1.3rem",color:e.$22})})}),n.pages.map(t=>h.jsx("li",{children:h.jsxs("div",{className:"flex items-center",children:[h.jsx("span",{style:{color:e.$22},children:"/"}),h.jsxs("div",{className:$t("flex items-center",{"space-x-2":t.afterName}),children:[h.jsx(Ji,{to:t.href,className:"ml-4 text-sm font-medium",style:{color:e.$22},disableHoverUnderline:!0,children:t.name}),t.afterName&&h.jsx("div",{children:t.afterName})]})]})},t.name))]})})}const bRt="/invoiceninja-logo@light-DGXl4hZT.png",yRt="/logo180.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 Vhe={logo:bRt,smallLogo: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 Uqe(n){var r,s;const{fallbackSmallLogo:e}=n||{},t=Nr(),i=zi();return((r=t==null?void 0:t.settings)==null?void 0:r.company_logo)||((s=i==null?void 0:i.settings)==null?void 0:s.company_logo)||(e?Vhe.smallLogo:Vhe.logo)}function CRt(){var t;const n=zi(),[e]=xe();return((t=n==null?void 0:n.settings)==null?void 0:t.name)||e("untitled_company")}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function gA({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 12 12",children:[h.jsx("path",{d:"m2.25,10.5c-.192,0-.384-.073-.53-.22-.293-.293-.293-.768,0-1.061L9.22,1.72c.293-.293.768-.293,1.061,0s.293.768,0,1.061l-7.5,7.5c-.146.146-.338.22-.53.22Z",fill:e,"stroke-width":"0","data-color":"color-2"}),h.jsx("path",{d:"m9.75,10.5c-.192,0-.384-.073-.53-.22L1.72,2.78c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l7.5,7.5c.293.293.293.768,0,1.061-.146.146-.338.22-.53.22Z","stroke-width":"0",fill:e})]})}function wRt(n){const{renderFragmentOnly:e,children:t}=n;return e?h.jsx(h.Fragment,{children:t}):h.jsx(fb.Child,{as:x.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 pr(n){const[e,t]=x.useState(!1),{enableCloseOnClickAway:i,disableClosing:r}=n;x.useEffect(()=>{t(n.visible)},[n.visible]);const s=xt();return h.jsx(fb.Root,{show:e,as:x.Fragment,children:h.jsx(iI,{as:"div",className:"fixed z-10 inset-0 overflow-y-auto",onClose:o=>{(!r||i)&&t(o),(!r||i)&&n.onClose(o)},initialFocus:n.initialFocusRef,children:h.jsxs("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[h.jsx(fb.Child,{as:x.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:h.jsx(iI.Overlay,{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),h.jsx("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),h.jsx(wRt,{renderFragmentOnly:!!n.renderTransitionChildAsFragment&&e,children:h.jsxs("div",{style:{backgroundColor:s.$1,color:s.$3,colorScheme:s.$0},className:$t("inline-block align-bottom rounded-md text-left shadow-xl transform transition-all sm:my-8 sm:align-middle w-full",{"max-w-xs":n.size==="micro","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,"pt-5 pb-5":!n.withoutPadding}),onClick:o=>n.stopPropagationInHeader&&o.stopPropagation(),children:[n.title&&h.jsxs("div",{className:$t("flex flex-col justify-between items-start pb-5",{"px-5":!n.withoutPadding,"border-b":!n.withoutBorderLine}),style:{backgroundColor:s.$1,color:s.$3,colorScheme:s.$0,borderColor:s.$20},children:[h.jsxs("div",{className:"flex w-full justify-between isolate",children:[h.jsx(iI.Title,{as:"h3",className:"text-lg leading-6 font-semibold",style:{backgroundColor:s.$1,color:s.$3,colorScheme:s.$0},children:n.title}),!n.disableClosing&&h.jsx("div",{className:"cursor-pointer",onClick:()=>n.onClose(!1),"data-cy":n.closeButtonCypressRef,children:h.jsx(gA,{color:s.$3,size:"1rem"})})]}),n.text&&h.jsx("div",{className:"mt-2",children:h.jsx("p",{style:{backgroundColor:s.$1,color:s.$3,colorScheme:s.$0},className:"text-sm",children:n.text})})]}),n.children&&h.jsx("div",{style:{backgroundColor:s.$1,color:s.$3,colorScheme:s.$0},className:$t("text-sm flex flex-col space-y-4",{"justify-center items-center":n.centerContent,"mt-5 sm:mt-6":!n.disableClosing&&!n.withoutVerticalMargin,"px-5":!n.withoutPadding&&!n.withoutHorizontalPadding}),children:n.children})]})})]})})})}function xRt(n){const[e]=xe(),t=Fr(),i=Yi(),{id:r}=Yl(),s=gc(),o=xt(),a=Vs(),[l,c]=x.useState(!1),u=(f,p,g)=>{if(t(HB({type:ZM.TOKEN,user:p,token:g})),localStorage.setItem("X-CURRENT-INDEX",f.toString()),a.invalidateQueries(),r){const m="/"+(s.pathname.includes("/settings/gateways")?"settings/online_payments":s.pathname.split("/")[1]||"dashboard");i(m)}window.location.reload()},d=async()=>{l||(pe.processing(),c(!0),Je("POST",ze("/api/v1/companies")).then(()=>{Je("POST",ze("/api/v1/refresh?updated_at=:updatedAt",{updatedAt:Jn().unix()})).then(f=>{const p=f.data.data,g=p.length-1,m=p[g];t(s1(p)),t(zu("company")),pe.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 h.jsxs(pr,{title:e("add_company"),visible:n.isModalOpen,onClose:()=>n.setIsModalOpen(!1),backgroundColor:"white",children:[h.jsx("span",{className:"text-lg",style:{backgroundColor:o.$2,color:o.$3,colorScheme:o.$0},children:e("are_you_sure")}),h.jsxs("div",{className:"flex justify-end space-x-4 mt-5",children:[h.jsx(dn,{className:"text-gray-900",onClick:()=>n.setIsModalOpen(!1),type:"minimal",children:h.jsx("span",{className:"text-base mx-3",children:e("cancel")})}),h.jsx(dn,{onClick:d,children:h.jsx("span",{className:"text-base mx-3",children:e("yes")})})]})]})}var _re={exports:{}},DT={};const Wg=$1e(E1t);var vre={exports:{}},Zl={},bDe;function SRt(){if(bDe)return Zl;bDe=1;function n(ce){for(var Ne=arguments.length,Xe=Array(Ne>1?Ne-1:0),it=1;it<Ne;it++)Xe[it-1]=arguments[it];throw Error("[Immer] minified error nr: "+ce+(Xe.length?" "+Xe.map(function(Tt){return"'"+Tt+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function e(ce){return!!ce&&!!ce[ye]}function t(ce){var Ne;return!!ce&&(function(Xe){if(!Xe||typeof Xe!="object")return!1;var it=Object.getPrototypeOf(Xe);if(it===null)return!0;var Tt=Object.hasOwnProperty.call(it,"constructor")&&it.constructor;return Tt===Object||typeof Tt=="function"&&Function.toString.call(Tt)===Be}(ce)||Array.isArray(ce)||!!ce[ge]||!!(!((Ne=ce.constructor)===null||Ne===void 0)&&Ne[ge])||c(ce)||u(ce))}function i(ce,Ne,Xe){Xe===void 0&&(Xe=!1),r(ce)===0?(Xe?Object.keys:$e)(ce).forEach(function(it){Xe&&typeof it=="symbol"||Ne(it,ce[it],ce)}):ce.forEach(function(it,Tt){return Ne(Tt,it,ce)})}function r(ce){var Ne=ce[ye];return Ne?Ne.t>3?Ne.t-4:Ne.t:Array.isArray(ce)?1:c(ce)?2:u(ce)?3:0}function s(ce,Ne){return r(ce)===2?ce.has(Ne):Object.prototype.hasOwnProperty.call(ce,Ne)}function o(ce,Ne){return r(ce)===2?ce.get(Ne):ce[Ne]}function a(ce,Ne,Xe){var it=r(ce);it===2?ce.set(Ne,Xe):it===3?ce.add(Xe):ce[Ne]=Xe}function l(ce,Ne){return ce===Ne?ce!==0||1/ce==1/Ne:ce!=ce&&Ne!=Ne}function c(ce){return fe&&ce instanceof Map}function u(ce){return Se&&ce instanceof Set}function d(ce){return ce.i||ce.u}function f(ce){if(Array.isArray(ce))return Array.prototype.slice.call(ce);var Ne=qe(ce);delete Ne[ye];for(var Xe=$e(Ne),it=0;it<Xe.length;it++){var Tt=Xe[it],Ct=Ne[Tt];Ct.writable===!1&&(Ct.writable=!0,Ct.configurable=!0),(Ct.get||Ct.set)&&(Ne[Tt]={configurable:!0,writable:!0,enumerable:Ct.enumerable,value:ce[Tt]})}return Object.create(Object.getPrototypeOf(ce),Ne)}function p(ce,Ne){return Ne===void 0&&(Ne=!1),m(ce)||e(ce)||!t(ce)||(r(ce)>1&&(ce.set=ce.add=ce.clear=ce.delete=g),Object.freeze(ce),Ne&&i(ce,function(Xe,it){return p(it,!0)},!0)),ce}function g(){n(2)}function m(ce){return ce==null||typeof ce!="object"||Object.isFrozen(ce)}function _(ce){var Ne=mt[ce];return Ne||n(18,ce),Ne}function v(ce,Ne){mt[ce]||(mt[ce]=Ne)}function b(){return X}function y(ce,Ne){Ne&&(_("Patches"),ce.o=[],ce.v=[],ce.s=Ne)}function C(ce){S(ce),ce.p.forEach(I),ce.p=null}function S(ce){ce===X&&(X=ce.l)}function k(ce){return X={p:[],l:X,h:ce,_:!0,m:0}}function I(ce){var Ne=ce[ye];Ne.t===0||Ne.t===1?Ne.j():Ne.O=!0}function L(ce,Ne){Ne.m=Ne.p.length;var Xe=Ne.p[0],it=ce!==void 0&&ce!==Xe;return Ne.h.S||_("ES5").P(Ne,ce,it),it?(Xe[ye].g&&(C(Ne),n(4)),t(ce)&&(ce=N(Ne,ce),Ne.l||O(Ne,ce)),Ne.o&&_("Patches").M(Xe[ye].u,ce,Ne.o,Ne.v)):ce=N(Ne,Xe,[]),C(Ne),Ne.o&&Ne.s(Ne.o,Ne.v),ce!==Ie?ce:void 0}function N(ce,Ne,Xe){if(m(Ne))return Ne;var it=Ne[ye];if(!it)return i(Ne,function(se,ke){return P(ce,it,Ne,se,ke,Xe)},!0),Ne;if(it.A!==ce)return Ne;if(!it.g)return O(ce,it.u,!0),it.u;if(!it.R){it.R=!0,it.A.m--;var Tt=it.t===4||it.t===5?it.i=f(it.k):it.i,Ct=Tt,Rt=!1;it.t===3&&(Ct=new Set(Tt),Tt.clear(),Rt=!0),i(Ct,function(se,ke){return P(ce,it,Tt,se,ke,Xe,Rt)}),O(ce,Tt,!1),Xe&&ce.o&&_("Patches").F(it,Xe,ce.o,ce.v)}return it.i}function P(ce,Ne,Xe,it,Tt,Ct,Rt){if(e(Tt)){var se=N(ce,Tt,Ct&&Ne&&Ne.t!==3&&!s(Ne.N,it)?Ct.concat(it):void 0);if(a(Xe,it,se),!e(se))return;ce._=!1}else Rt&&Xe.add(Tt);if(t(Tt)&&!m(Tt)){if(!ce.h.D&&ce.m<1)return;N(ce,Tt),Ne&&Ne.A.l||O(ce,Tt)}}function O(ce,Ne,Xe){Xe===void 0&&(Xe=!1),!ce.l&&ce.h.D&&ce._&&p(Ne,Xe)}function F(ce,Ne){var Xe=ce[ye];return(Xe?d(Xe):ce)[Ne]}function V(ce,Ne){if(Ne in ce)for(var Xe=Object.getPrototypeOf(ce);Xe;){var it=Object.getOwnPropertyDescriptor(Xe,Ne);if(it)return it;Xe=Object.getPrototypeOf(Xe)}}function M(ce){ce.g||(ce.g=!0,ce.l&&M(ce.l))}function B(ce){ce.i||(ce.i=f(ce.u))}function W(ce,Ne,Xe){var it=c(Ne)?_("MapSet").K(Ne,Xe):u(Ne)?_("MapSet").$(Ne,Xe):ce.S?function(Tt,Ct){var Rt=Array.isArray(Tt),se={t:Rt?1:0,A:Ct?Ct.A:b(),g:!1,R:!1,N:{},l:Ct,u:Tt,k:null,i:null,j:null,C:!1},ke=se,Ae=vt;Rt&&(ke=[se],Ae=ft);var je=Proxy.revocable(ke,Ae),Ve=je.revoke,Qt=je.proxy;return se.k=Qt,se.j=Ve,Qt}(Ne,Xe):_("ES5").I(Ne,Xe);return(Xe?Xe.A:b()).p.push(it),it}function q(ce){return e(ce)||n(22,ce),function Ne(Xe){if(!t(Xe))return Xe;var it,Tt=Xe[ye],Ct=r(Xe);if(Tt){if(!Tt.g&&(Tt.t<4||!_("ES5").J(Tt)))return Tt.u;Tt.R=!0,it=U(Xe,Ct),Tt.R=!1}else it=U(Xe,Ct);return i(it,function(Rt,se){Tt&&o(Tt.u,Rt)===se||a(it,Rt,Ne(se))}),Ct===3?new Set(it):it}(ce)}function U(ce,Ne){switch(Ne){case 2:return new Map(ce);case 3:return Array.from(ce)}return f(ce)}function G(){function ce(Ct,Rt){var se=Tt[Ct];return se?se.enumerable=Rt:Tt[Ct]=se={configurable:!0,enumerable:Rt,get:function(){return vt.get(this[ye],Ct)},set:function(ke){vt.set(this[ye],Ct,ke)}},se}function Ne(Ct){for(var Rt=Ct.length-1;Rt>=0;Rt--){var se=Ct[Rt][ye];if(!se.g)switch(se.t){case 5:it(se)&&M(se);break;case 4:Xe(se)&&M(se)}}}function Xe(Ct){for(var Rt=Ct.u,se=Ct.k,ke=$e(se),Ae=ke.length-1;Ae>=0;Ae--){var je=ke[Ae];if(je!==ye){var Ve=Rt[je];if(Ve===void 0&&!s(Rt,je))return!0;var Qt=se[je],rt=Qt&&Qt[ye];if(rt?rt.u!==Ve:!l(Qt,Ve))return!0}}var Cn=!!Rt[ye];return ke.length!==$e(Rt).length+(Cn?0:1)}function it(Ct){var Rt=Ct.k;if(Rt.length!==Ct.u.length)return!0;var se=Object.getOwnPropertyDescriptor(Rt,Rt.length-1);if(se&&!se.get)return!0;for(var ke=0;ke<Rt.length;ke++)if(!Rt.hasOwnProperty(ke))return!0;return!1}var Tt={};v("ES5",{I:function(Ct,Rt){var se=Array.isArray(Ct),ke=function(je,Ve){if(je){for(var Qt=Array(Ve.length),rt=0;rt<Ve.length;rt++)Object.defineProperty(Qt,""+rt,ce(rt,!0));return Qt}var Cn=qe(Ve);delete Cn[ye];for(var Rn=$e(Cn),li=0;li<Rn.length;li++){var Mi=Rn[li];Cn[Mi]=ce(Mi,je||!!Cn[Mi].enumerable)}return Object.create(Object.getPrototypeOf(Ve),Cn)}(se,Ct),Ae={t:se?5:4,A:Rt?Rt.A:b(),g:!1,R:!1,N:{},l:Rt,u:Ct,k:ke,i:null,O:!1,C:!1};return Object.defineProperty(ke,ye,{value:Ae,writable:!0}),ke},P:function(Ct,Rt,se){se?e(Rt)&&Rt[ye].A===Ct&&Ne(Ct.p):(Ct.o&&function ke(Ae){if(Ae&&typeof Ae=="object"){var je=Ae[ye];if(je){var Ve=je.u,Qt=je.k,rt=je.N,Cn=je.t;if(Cn===4)i(Qt,function(oi){oi!==ye&&(Ve[oi]!==void 0||s(Ve,oi)?rt[oi]||ke(Qt[oi]):(rt[oi]=!0,M(je)))}),i(Ve,function(oi){Qt[oi]!==void 0||s(Qt,oi)||(rt[oi]=!1,M(je))});else if(Cn===5){if(it(je)&&(M(je),rt.length=!0),Qt.length<Ve.length)for(var Rn=Qt.length;Rn<Ve.length;Rn++)rt[Rn]=!1;else for(var li=Ve.length;li<Qt.length;li++)rt[li]=!0;for(var Mi=Math.min(Qt.length,Ve.length),si=0;si<Mi;si++)Qt.hasOwnProperty(si)||(rt[si]=!0),rt[si]===void 0&&ke(Qt[si])}}}}(Ct.p[0]),Ne(Ct.p))},J:function(Ct){return Ct.t===4?Xe(Ct):it(Ct)}})}function H(){function ce(it){if(!t(it))return it;if(Array.isArray(it))return it.map(ce);if(c(it))return new Map(Array.from(it.entries()).map(function(Rt){return[Rt[0],ce(Rt[1])]}));if(u(it))return new Set(Array.from(it).map(ce));var Tt=Object.create(Object.getPrototypeOf(it));for(var Ct in it)Tt[Ct]=ce(it[Ct]);return s(it,ge)&&(Tt[ge]=it[ge]),Tt}function Ne(it){return e(it)?ce(it):it}var Xe="add";v("Patches",{W:function(it,Tt){return Tt.forEach(function(Ct){for(var Rt=Ct.path,se=Ct.op,ke=it,Ae=0;Ae<Rt.length-1;Ae++){var je=r(ke),Ve=Rt[Ae];typeof Ve!="string"&&typeof Ve!="number"&&(Ve=""+Ve),je!==0&&je!==1||Ve!=="__proto__"&&Ve!=="constructor"||n(24),typeof ke=="function"&&Ve==="prototype"&&n(24),typeof(ke=o(ke,Ve))!="object"&&n(15,Rt.join("/"))}var Qt=r(ke),rt=ce(Ct.value),Cn=Rt[Rt.length-1];switch(se){case"replace":switch(Qt){case 2:return ke.set(Cn,rt);case 3:n(16);default:return ke[Cn]=rt}case Xe:switch(Qt){case 1:return Cn==="-"?ke.push(rt):ke.splice(Cn,0,rt);case 2:return ke.set(Cn,rt);case 3:return ke.add(rt);default:return ke[Cn]=rt}case"remove":switch(Qt){case 1:return ke.splice(Cn,1);case 2:return ke.delete(Cn);case 3:return ke.delete(Ct.value);default:return delete ke[Cn]}default:n(17,se)}}),it},F:function(it,Tt,Ct,Rt){switch(it.t){case 0:case 4:case 2:return function(se,ke,Ae,je){var Ve=se.u,Qt=se.i;i(se.N,function(rt,Cn){var Rn=o(Ve,rt),li=o(Qt,rt),Mi=Cn?s(Ve,rt)?"replace":Xe:"remove";if(Rn!==li||Mi!=="replace"){var si=ke.concat(rt);Ae.push(Mi==="remove"?{op:Mi,path:si}:{op:Mi,path:si,value:li}),je.push(Mi===Xe?{op:"remove",path:si}:Mi==="remove"?{op:Xe,path:si,value:Ne(Rn)}:{op:"replace",path:si,value:Ne(Rn)})}})}(it,Tt,Ct,Rt);case 5:case 1:return function(se,ke,Ae,je){var Ve=se.u,Qt=se.N,rt=se.i;if(rt.length<Ve.length){var Cn=[rt,Ve];Ve=Cn[0],rt=Cn[1];var Rn=[je,Ae];Ae=Rn[0],je=Rn[1]}for(var li=0;li<Ve.length;li++)if(Qt[li]&&rt[li]!==Ve[li]){var Mi=ke.concat([li]);Ae.push({op:"replace",path:Mi,value:Ne(rt[li])}),je.push({op:"replace",path:Mi,value:Ne(Ve[li])})}for(var si=Ve.length;si<rt.length;si++){var oi=ke.concat([si]);Ae.push({op:Xe,path:oi,value:Ne(rt[si])})}Ve.length<rt.length&&je.push({op:"replace",path:ke.concat(["length"]),value:Ve.length})}(it,Tt,Ct,Rt);case 3:return function(se,ke,Ae,je){var Ve=se.u,Qt=se.i,rt=0;Ve.forEach(function(Cn){if(!Qt.has(Cn)){var Rn=ke.concat([rt]);Ae.push({op:"remove",path:Rn,value:Cn}),je.unshift({op:Xe,path:Rn,value:Cn})}rt++}),rt=0,Qt.forEach(function(Cn){if(!Ve.has(Cn)){var Rn=ke.concat([rt]);Ae.push({op:Xe,path:Rn,value:Cn}),je.unshift({op:"remove",path:Rn,value:Cn})}rt++})}(it,Tt,Ct,Rt)}},M:function(it,Tt,Ct,Rt){Ct.push({op:"replace",path:[],value:Tt===Ie?void 0:Tt}),Rt.push({op:"replace",path:[],value:it})}})}function z(){function ce(se,ke){function Ae(){this.constructor=se}Tt(se,ke),se.prototype=(Ae.prototype=ke.prototype,new Ae)}function Ne(se){se.i||(se.N=new Map,se.i=new Map(se.u))}function Xe(se){se.i||(se.i=new Set,se.u.forEach(function(ke){if(t(ke)){var Ae=W(se.A.h,ke,se);se.p.set(ke,Ae),se.i.add(Ae)}else se.i.add(ke)}))}function it(se){se.O&&n(3,JSON.stringify(d(se)))}var Tt=function(se,ke){return(Tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ae,je){Ae.__proto__=je}||function(Ae,je){for(var Ve in je)je.hasOwnProperty(Ve)&&(Ae[Ve]=je[Ve])})(se,ke)},Ct=function(){function se(Ae,je){return this[ye]={t:2,l:je,A:je?je.A:b(),g:!1,R:!1,i:void 0,N:void 0,u:Ae,k:this,C:!1,O:!1},this}ce(se,Map);var ke=se.prototype;return Object.defineProperty(ke,"size",{get:function(){return d(this[ye]).size}}),ke.has=function(Ae){return d(this[ye]).has(Ae)},ke.set=function(Ae,je){var Ve=this[ye];return it(Ve),d(Ve).has(Ae)&&d(Ve).get(Ae)===je||(Ne(Ve),M(Ve),Ve.N.set(Ae,!0),Ve.i.set(Ae,je),Ve.N.set(Ae,!0)),this},ke.delete=function(Ae){if(!this.has(Ae))return!1;var je=this[ye];return it(je),Ne(je),M(je),je.u.has(Ae)?je.N.set(Ae,!1):je.N.delete(Ae),je.i.delete(Ae),!0},ke.clear=function(){var Ae=this[ye];it(Ae),d(Ae).size&&(Ne(Ae),M(Ae),Ae.N=new Map,i(Ae.u,function(je){Ae.N.set(je,!1)}),Ae.i.clear())},ke.forEach=function(Ae,je){var Ve=this;d(this[ye]).forEach(function(Qt,rt){Ae.call(je,Ve.get(rt),rt,Ve)})},ke.get=function(Ae){var je=this[ye];it(je);var Ve=d(je).get(Ae);if(je.R||!t(Ve)||Ve!==je.u.get(Ae))return Ve;var Qt=W(je.A.h,Ve,je);return Ne(je),je.i.set(Ae,Qt),Qt},ke.keys=function(){return d(this[ye]).keys()},ke.values=function(){var Ae,je=this,Ve=this.keys();return(Ae={})[Pe]=function(){return je.values()},Ae.next=function(){var Qt=Ve.next();return Qt.done?Qt:{done:!1,value:je.get(Qt.value)}},Ae},ke.entries=function(){var Ae,je=this,Ve=this.keys();return(Ae={})[Pe]=function(){return je.entries()},Ae.next=function(){var Qt=Ve.next();if(Qt.done)return Qt;var rt=je.get(Qt.value);return{done:!1,value:[Qt.value,rt]}},Ae},ke[Pe]=function(){return this.entries()},se}(),Rt=function(){function se(Ae,je){return this[ye]={t:3,l:je,A:je?je.A:b(),g:!1,R:!1,i:void 0,u:Ae,k:this,p:new Map,O:!1,C:!1},this}ce(se,Set);var ke=se.prototype;return Object.defineProperty(ke,"size",{get:function(){return d(this[ye]).size}}),ke.has=function(Ae){var je=this[ye];return it(je),je.i?!!je.i.has(Ae)||!(!je.p.has(Ae)||!je.i.has(je.p.get(Ae))):je.u.has(Ae)},ke.add=function(Ae){var je=this[ye];return it(je),this.has(Ae)||(Xe(je),M(je),je.i.add(Ae)),this},ke.delete=function(Ae){if(!this.has(Ae))return!1;var je=this[ye];return it(je),Xe(je),M(je),je.i.delete(Ae)||!!je.p.has(Ae)&&je.i.delete(je.p.get(Ae))},ke.clear=function(){var Ae=this[ye];it(Ae),d(Ae).size&&(Xe(Ae),M(Ae),Ae.i.clear())},ke.values=function(){var Ae=this[ye];return it(Ae),Xe(Ae),Ae.i.values()},ke.entries=function(){var Ae=this[ye];return it(Ae),Xe(Ae),Ae.i.entries()},ke.keys=function(){return this.values()},ke[Pe]=function(){return this.values()},ke.forEach=function(Ae,je){for(var Ve=this.values(),Qt=Ve.next();!Qt.done;)Ae.call(je,Qt.value,Qt.value,this),Qt=Ve.next()},se}();v("MapSet",{K:function(se,ke){return new Ct(se,ke)},$:function(se,ke){return new Rt(se,ke)}})}var Z;Object.defineProperty(Zl,"__esModule",{value:!0});var X,oe=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",fe=typeof Map<"u",Se=typeof Set<"u",Me=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Ie=oe?Symbol.for("immer-nothing"):((Z={})["immer-nothing"]=!0,Z),ge=oe?Symbol.for("immer-draftable"):"__$immer_draftable",ye=oe?Symbol.for("immer-state"):"__$immer_state",Pe=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",Be=""+Object.prototype.constructor,$e=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(ce){return Object.getOwnPropertyNames(ce).concat(Object.getOwnPropertySymbols(ce))}:Object.getOwnPropertyNames,qe=Object.getOwnPropertyDescriptors||function(ce){var Ne={};return $e(ce).forEach(function(Xe){Ne[Xe]=Object.getOwnPropertyDescriptor(ce,Xe)}),Ne},mt={},vt={get:function(ce,Ne){if(Ne===ye)return ce;var Xe=d(ce);if(!s(Xe,Ne))return function(Tt,Ct,Rt){var se,ke=V(Ct,Rt);return ke?"value"in ke?ke.value:(se=ke.get)===null||se===void 0?void 0:se.call(Tt.k):void 0}(ce,Xe,Ne);var it=Xe[Ne];return ce.R||!t(it)?it:it===F(ce.u,Ne)?(B(ce),ce.i[Ne]=W(ce.A.h,it,ce)):it},has:function(ce,Ne){return Ne in d(ce)},ownKeys:function(ce){return Reflect.ownKeys(d(ce))},set:function(ce,Ne,Xe){var it=V(d(ce),Ne);if(it!=null&&it.set)return it.set.call(ce.k,Xe),!0;if(!ce.g){var Tt=F(d(ce),Ne),Ct=Tt==null?void 0:Tt[ye];if(Ct&&Ct.u===Xe)return ce.i[Ne]=Xe,ce.N[Ne]=!1,!0;if(l(Xe,Tt)&&(Xe!==void 0||s(ce.u,Ne)))return!0;B(ce),M(ce)}return ce.i[Ne]===Xe&&(Xe!==void 0||Ne in ce.i)||Number.isNaN(Xe)&&Number.isNaN(ce.i[Ne])||(ce.i[Ne]=Xe,ce.N[Ne]=!0),!0},deleteProperty:function(ce,Ne){return F(ce.u,Ne)!==void 0||Ne in ce.u?(ce.N[Ne]=!1,B(ce),M(ce)):delete ce.N[Ne],ce.i&&delete ce.i[Ne],!0},getOwnPropertyDescriptor:function(ce,Ne){var Xe=d(ce),it=Reflect.getOwnPropertyDescriptor(Xe,Ne);return it&&{writable:!0,configurable:ce.t!==1||Ne!=="length",enumerable:it.enumerable,value:Xe[Ne]}},defineProperty:function(){n(11)},getPrototypeOf:function(ce){return Object.getPrototypeOf(ce.u)},setPrototypeOf:function(){n(12)}},ft={};i(vt,function(ce,Ne){ft[ce]=function(){return arguments[0]=arguments[0][0],Ne.apply(this,arguments)}}),ft.deleteProperty=function(ce,Ne){return ft.set.call(this,ce,Ne,void 0)},ft.set=function(ce,Ne,Xe){return vt.set.call(this,ce[0],Ne,Xe,ce[0])};var tt=function(){function ce(Xe){var it=this;this.S=Me,this.D=!0,this.produce=function(Tt,Ct,Rt){if(typeof Tt=="function"&&typeof Ct!="function"){var se=Ct;Ct=Tt;var ke=it;return function(Rn){var li=this;Rn===void 0&&(Rn=se);for(var Mi=arguments.length,si=Array(Mi>1?Mi-1:0),oi=1;oi<Mi;oi++)si[oi-1]=arguments[oi];return ke.produce(Rn,function(_n){var de;return(de=Ct).call.apply(de,[li,_n].concat(si))})}}var Ae;if(typeof Ct!="function"&&n(6),Rt!==void 0&&typeof Rt!="function"&&n(7),t(Tt)){var je=k(it),Ve=W(it,Tt,void 0),Qt=!0;try{Ae=Ct(Ve),Qt=!1}finally{Qt?C(je):S(je)}return typeof Promise<"u"&&Ae instanceof Promise?Ae.then(function(Rn){return y(je,Rt),L(Rn,je)},function(Rn){throw C(je),Rn}):(y(je,Rt),L(Ae,je))}if(!Tt||typeof Tt!="object"){if((Ae=Ct(Tt))===void 0&&(Ae=Tt),Ae===Ie&&(Ae=void 0),it.D&&p(Ae,!0),Rt){var rt=[],Cn=[];_("Patches").M(Tt,Ae,rt,Cn),Rt(rt,Cn)}return Ae}n(21,Tt)},this.produceWithPatches=function(Tt,Ct){if(typeof Tt=="function")return function(Ae){for(var je=arguments.length,Ve=Array(je>1?je-1:0),Qt=1;Qt<je;Qt++)Ve[Qt-1]=arguments[Qt];return it.produceWithPatches(Ae,function(rt){return Tt.apply(void 0,[rt].concat(Ve))})};var Rt,se,ke=it.produce(Tt,Ct,function(Ae,je){Rt=Ae,se=je});return typeof Promise<"u"&&ke instanceof Promise?ke.then(function(Ae){return[Ae,Rt,se]}):[ke,Rt,se]},typeof(Xe==null?void 0:Xe.useProxies)=="boolean"&&this.setUseProxies(Xe.useProxies),typeof(Xe==null?void 0:Xe.autoFreeze)=="boolean"&&this.setAutoFreeze(Xe.autoFreeze)}var Ne=ce.prototype;return Ne.createDraft=function(Xe){t(Xe)||n(8),e(Xe)&&(Xe=q(Xe));var it=k(this),Tt=W(this,Xe,void 0);return Tt[ye].C=!0,S(it),Tt},Ne.finishDraft=function(Xe,it){var Tt=(Xe&&Xe[ye]).A;return y(Tt,it),L(void 0,Tt)},Ne.setAutoFreeze=function(Xe){this.D=Xe},Ne.setUseProxies=function(Xe){Xe&&!Me&&n(20),this.S=Xe},Ne.applyPatches=function(Xe,it){var Tt;for(Tt=it.length-1;Tt>=0;Tt--){var Ct=it[Tt];if(Ct.path.length===0&&Ct.op==="replace"){Xe=Ct.value;break}}Tt>-1&&(it=it.slice(Tt+1));var Rt=_("Patches").W;return e(Xe)?Rt(Xe,it):this.produce(Xe,function(se){return Rt(se,it)})},ce}(),St=new tt,Ft=St.produce,en=St.produceWithPatches.bind(St),Ke=St.setAutoFreeze.bind(St),dt=St.setUseProxies.bind(St),nt=St.applyPatches.bind(St),at=St.createDraft.bind(St),Oe=St.finishDraft.bind(St);return Zl.Immer=tt,Zl.applyPatches=nt,Zl.castDraft=function(ce){return ce},Zl.castImmutable=function(ce){return ce},Zl.createDraft=at,Zl.current=q,Zl.default=Ft,Zl.enableAllPlugins=function(){G(),z(),H()},Zl.enableES5=G,Zl.enableMapSet=z,Zl.enablePatches=H,Zl.finishDraft=Oe,Zl.freeze=p,Zl.immerable=ge,Zl.isDraft=e,Zl.isDraftable=t,Zl.nothing=Ie,Zl.original=function(ce){return e(ce)||n(23,ce),ce[ye].u},Zl.produce=Ft,Zl.produceWithPatches=en,Zl.setAutoFreeze=Ke,Zl.setUseProxies=dt,Zl}var yDe;function T5(){return yDe||(yDe=1,vre.exports=SRt()),vre.exports}const ERt=$1e(Oyt);var CDe;function kRt(){return CDe||(CDe=1,function(n){var e,t,i=DT&&DT.__generator||function(et,Lt){var qt,sn,ln,ti,di={label:0,sent:function(){if(1&ln[0])throw ln[1];return ln[1]},trys:[],ops:[]};return ti={next:Dt(0),throw:Dt(1),return:Dt(2)},typeof Symbol=="function"&&(ti[Symbol.iterator]=function(){return this}),ti;function Dt(le){return function(Qe){return function(ht){if(qt)throw new TypeError("Generator is already executing.");for(;di;)try{if(qt=1,sn&&(ln=2&ht[0]?sn.return:ht[0]?sn.throw||((ln=sn.return)&&ln.call(sn),0):sn.next)&&!(ln=ln.call(sn,ht[1])).done)return ln;switch(sn=0,ln&&(ht=[2&ht[0],ln.value]),ht[0]){case 0:case 1:ln=ht;break;case 4:return di.label++,{value:ht[1],done:!1};case 5:di.label++,sn=ht[1],ht=[0];continue;case 7:ht=di.ops.pop(),di.trys.pop();continue;default:if(!((ln=(ln=di.trys).length>0&&ln[ln.length-1])||ht[0]!==6&&ht[0]!==2)){di=0;continue}if(ht[0]===3&&(!ln||ht[1]>ln[0]&&ht[1]<ln[3])){di.label=ht[1];break}if(ht[0]===6&&di.label<ln[1]){di.label=ln[1],ln=ht;break}if(ln&&di.label<ln[2]){di.label=ln[2],di.ops.push(ht);break}ln[2]&&di.ops.pop(),di.trys.pop();continue}ht=Lt.call(et,di)}catch(Bt){ht=[6,Bt],sn=0}finally{qt=ln=0}if(5&ht[0])throw ht[1];return{value:ht[0]?ht[1]:void 0,done:!0}}([le,Qe])}}},r=DT&&DT.__spreadArray||function(et,Lt){for(var qt=0,sn=Lt.length,ln=et.length;qt<sn;qt++,ln++)et[ln]=Lt[qt];return et},s=Object.create,o=Object.defineProperty,a=Object.defineProperties,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,m=function(et,Lt,qt){return Lt in et?o(et,Lt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):et[Lt]=qt},_=function(et,Lt){for(var qt in Lt||(Lt={}))p.call(Lt,qt)&&m(et,qt,Lt[qt]);if(d)for(var sn=0,ln=d(Lt);sn<ln.length;sn++)g.call(Lt,qt=ln[sn])&&m(et,qt,Lt[qt]);return et},v=function(et,Lt){return a(et,c(Lt))},b=function(et){return o(et,"__esModule",{value:!0})},y=function(et,Lt){var qt={};for(var sn in et)p.call(et,sn)&&Lt.indexOf(sn)<0&&(qt[sn]=et[sn]);if(et!=null&&d)for(var ln=0,ti=d(et);ln<ti.length;ln++)Lt.indexOf(sn=ti[ln])<0&&g.call(et,sn)&&(qt[sn]=et[sn]);return qt},C=function(et){return function(Lt,qt,sn){if(qt&&typeof qt=="object"||typeof qt=="function")for(var ln=function(Dt){p.call(Lt,Dt)||Dt==="default"||o(Lt,Dt,{get:function(){return qt[Dt]},enumerable:!(sn=l(qt,Dt))||sn.enumerable})},ti=0,di=u(qt);ti<di.length;ti++)ln(di[ti]);return Lt}(b(o(et!=null?s(f(et)):{},"default",et&&et.__esModule&&"default"in et?{get:function(){return et.default},enumerable:!0}:{value:et,enumerable:!0})),et)},S=function(et,Lt,qt){return new Promise(function(sn,ln){var ti=function(le){try{Dt(qt.next(le))}catch(Qe){ln(Qe)}},di=function(le){try{Dt(qt.throw(le))}catch(Qe){ln(Qe)}},Dt=function(le){return le.done?sn(le.value):Promise.resolve(le.value).then(ti,di)};Dt((qt=qt.apply(et,Lt)).next())})};b(n),function(et,Lt){for(var qt in Lt)o(et,qt,{get:Lt[qt],enumerable:!0})}(n,{QueryStatus:function(){return e},buildCreateApi:function(){return je},copyWithStructuralSharing:function(){return L},coreModule:function(){return Ln},coreModuleName:function(){return Pn},createApi:function(){return bi},defaultSerializeQueryArgs:function(){return se},fakeBaseQuery:function(){return Ve},fetchBaseQuery:function(){return M},retry:function(){return U},setupListeners:function(){return fe},skipSelector:function(){return Ne},skipToken:function(){return ce}}),(t=e||(e={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var k=function(et){return[].concat.apply([],et)},I=C(Wg).isPlainObject;function L(et,Lt){if(et===Lt||!(I(et)&&I(Lt)||Array.isArray(et)&&Array.isArray(Lt)))return Lt;for(var qt=Object.keys(Lt),sn=Object.keys(et),ln=qt.length===sn.length,ti=Array.isArray(Lt)?[]:{},di=0,Dt=qt;di<Dt.length;di++){var le=Dt[di];ti[le]=L(et[le],Lt[le]),ln&&(ln=et[le]===ti[le])}return ln?et:ti}var N=C(Wg),P=function(){for(var et=[],Lt=0;Lt<arguments.length;Lt++)et[Lt]=arguments[Lt];return fetch.apply(void 0,et)},O=function(et){return et.status>=200&&et.status<=299},F=function(et){return/ion\/(vnd\.api\+)?json/.test(et.get("content-type")||"")};function V(et){if(!(0,N.isPlainObject)(et))return et;for(var Lt=_({},et),qt=0,sn=Object.entries(Lt);qt<sn.length;qt++){var ln=sn[qt];ln[1]===void 0&&delete Lt[ln[0]]}return Lt}function M(et){var Lt=this;et===void 0&&(et={});var qt=et.baseUrl,sn=et.prepareHeaders,ln=sn===void 0?function(Sr){return Sr}:sn,ti=et.fetchFn,di=ti===void 0?P:ti,Dt=et.paramsSerializer,le=et.isJsonContentType,Qe=le===void 0?F:le,ht=et.jsonContentType,Bt=ht===void 0?"application/json":ht,An=et.jsonReplacer,mn=et.timeout,hi=et.responseHandler,Di=et.validateStatus,cr=y(et,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&di===P&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(Sr,rr){return S(Lt,null,function(){var ws,Er,xa,No,Do,Zs,ua,Os,Co,ul,Qi,Ms,js,Ro,Bi,Vi,Br,Gr,xs,sr,Ns,uo,yi,vn,Un,Mn,fi,Wi,or,qn,Wn,Ei,Kn,Hn,ki,Sn;return i(this,function(On){switch(On.label){case 0:return ws=rr.signal,Er=rr.getState,xa=rr.extra,No=rr.endpoint,Do=rr.forced,Zs=rr.type,Co=(Os=typeof Sr=="string"?{url:Sr}:Sr).url,Qi=(ul=Os.headers)===void 0?new Headers(cr.headers):ul,js=(Ms=Os.params)===void 0?void 0:Ms,Bi=(Ro=Os.responseHandler)===void 0?hi??"json":Ro,Br=(Vi=Os.validateStatus)===void 0?Di??O:Vi,xs=(Gr=Os.timeout)===void 0?mn:Gr,sr=y(Os,["url","headers","params","responseHandler","validateStatus","timeout"]),Ns=_(v(_({},cr),{signal:ws}),sr),Qi=new Headers(V(Qi)),uo=Ns,[4,ln(Qi,{getState:Er,extra:xa,endpoint:No,forced:Do,type:Zs})];case 1:uo.headers=On.sent()||Qi,yi=function(wi){return typeof wi=="object"&&((0,N.isPlainObject)(wi)||Array.isArray(wi)||typeof wi.toJSON=="function")},!Ns.headers.has("content-type")&&yi(Ns.body)&&Ns.headers.set("content-type",Bt),yi(Ns.body)&&Qe(Ns.headers)&&(Ns.body=JSON.stringify(Ns.body,An)),js&&(vn=~Co.indexOf("?")?"&":"?",Un=Dt?Dt(js):new URLSearchParams(V(js)),Co+=vn+Un),Co=function(wi,Cr){if(!wi)return Cr;if(!Cr)return wi;if(function(zs){return new RegExp("(^|:)//").test(zs)}(Cr))return Cr;var br=wi.endsWith("/")||!Cr.startsWith("?")?"/":"";return wi=function(zs){return zs.replace(/\/$/,"")}(wi),""+wi+br+function(zs){return zs.replace(/^\//,"")}(Cr)}(qt,Co),Mn=new Request(Co,Ns),fi=new Request(Co,Ns),ua={request:fi},or=!1,qn=xs&&setTimeout(function(){or=!0,rr.abort()},xs),On.label=2;case 2:return On.trys.push([2,4,5,6]),[4,di(Mn)];case 3:return Wi=On.sent(),[3,6];case 4:return Wn=On.sent(),[2,{error:{status:or?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Wn)},meta:ua}];case 5:return qn&&clearTimeout(qn),[7];case 6:Ei=Wi.clone(),ua.response=Ei,Hn="",On.label=7;case 7:return On.trys.push([7,9,,10]),[4,Promise.all([Li(Wi,Bi).then(function(wi){return Kn=wi},function(wi){return ki=wi}),Ei.text().then(function(wi){return Hn=wi},function(){})])];case 8:if(On.sent(),ki)throw ki;return[3,10];case 9:return Sn=On.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:Wi.status,data:Hn,error:String(Sn)},meta:ua}];case 10:return[2,Br(Wi,Kn)?{data:Kn,meta:ua}:{error:{status:Wi.status,data:Kn},meta:ua}]}})})};function Li(Sr,rr){return S(this,null,function(){var ws;return i(this,function(Er){switch(Er.label){case 0:return typeof rr=="function"?[2,rr(Sr)]:(rr==="content-type"&&(rr=Qe(Sr.headers)?"json":"text"),rr!=="json"?[3,2]:[4,Sr.text()]);case 1:return[2,(ws=Er.sent()).length?JSON.parse(ws):null];case 2:return[2,Sr.text()]}})})}}var B=function(et,Lt){Lt===void 0&&(Lt=void 0),this.value=et,this.meta=Lt};function W(et,Lt){return et===void 0&&(et=0),Lt===void 0&&(Lt=5),S(this,null,function(){var qt,sn;return i(this,function(ln){switch(ln.label){case 0:return qt=Math.min(et,Lt),sn=~~((Math.random()+.4)*(300<<qt)),[4,new Promise(function(ti){return setTimeout(function(di){return ti(di)},sn)})];case 1:return ln.sent(),[2]}})})}var q={},U=Object.assign(function(et,Lt){return function(qt,sn,ln){return S(void 0,null,function(){var ti,di,Dt,le,Qe,ht,Bt;return i(this,function(An){switch(An.label){case 0:ti=[5,(Lt||q).maxRetries,(ln||q).maxRetries].filter(function(mn){return mn!==void 0}),di=ti.slice(-1)[0],Dt=function(mn,hi,Di){return Di.attempt<=di},le=_(_({maxRetries:di,backoff:W,retryCondition:Dt},Lt),ln),Qe=0,An.label=1;case 1:An.label=2;case 2:return An.trys.push([2,4,,6]),[4,et(qt,sn,ln)];case 3:if((ht=An.sent()).error)throw new B(ht);return[2,ht];case 4:if(Bt=An.sent(),Qe++,Bt.throwImmediately){if(Bt instanceof B)return[2,Bt.value];throw Bt}return Bt instanceof B&&!le.retryCondition(Bt.value.error,qt,{attempt:Qe,baseQueryApi:sn,extraOptions:ln})?[2,Bt.value]:[4,le.backoff(Qe,le.maxRetries)];case 5:return An.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(et){throw Object.assign(new B({error:et}),{throwImmediately:!0})}}),G=C(Wg),H=(0,G.createAction)("__rtkq/focused"),z=(0,G.createAction)("__rtkq/unfocused"),Z=(0,G.createAction)("__rtkq/online"),X=(0,G.createAction)("__rtkq/offline"),oe=!1;function fe(et,Lt){return Lt?Lt(et,{onFocus:H,onFocusLost:z,onOffline:X,onOnline:Z}):(qt=function(){return et(H())},sn=function(){return et(Z())},ln=function(){return et(X())},ti=function(){window.document.visibilityState==="visible"?qt():et(z())},oe||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",ti,!1),window.addEventListener("focus",qt,!1),window.addEventListener("online",sn,!1),window.addEventListener("offline",ln,!1),oe=!0),function(){window.removeEventListener("focus",qt),window.removeEventListener("visibilitychange",ti),window.removeEventListener("online",sn),window.removeEventListener("offline",ln),oe=!1});var qt,sn,ln,ti}var Se,Me,Ie=C(Wg);function ge(et){return et.type===Se.query}function ye(et,Lt,qt,sn,ln,ti){return typeof et=="function"?et(Lt,qt,sn,ln).map(Pe).map(ti):Array.isArray(et)?et.map(Pe).map(ti):[]}function Pe(et){return typeof et=="string"?{type:et}:et}(Me=Se||(Se={})).query="query",Me.mutation="mutation";var Be=C(Wg);function $e(et){return et!=null}var qe=Symbol("forceQueryFn"),mt=function(et){return typeof et[qe]=="function"},vt=C(Wg),ft=C(T5()),tt=C(Wg);function St(et){return et}function Ft(et,Lt,qt,sn){return ye(qt[et.meta.arg.endpointName][Lt],(0,vt.isFulfilled)(et)?et.payload:void 0,(0,vt.isRejectedWithValue)(et)?et.payload:void 0,et.meta.arg.originalArgs,"baseQueryMeta"in et.meta?et.meta.baseQueryMeta:void 0,sn)}var en=C(T5()),Ke=C(T5());function dt(et,Lt,qt){var sn=et[Lt];sn&&qt(sn)}function nt(et){var Lt;return(Lt="arg"in et?et.arg.fixedCacheKey:et.fixedCacheKey)!=null?Lt:et.requestId}function at(et,Lt,qt){var sn=et[nt(Lt)];sn&&qt(sn)}var Oe={},ce=Symbol.for("RTKQ/skipToken"),Ne=ce,Xe={status:e.uninitialized},it=(0,Ie.createNextState)(Xe,function(){}),Tt=(0,Ie.createNextState)(Xe,function(){}),Ct=C(Wg),Rt=WeakMap?new WeakMap:void 0,se=function(et){var Lt=et.endpointName,qt=et.queryArgs,sn="",ln=Rt==null?void 0:Rt.get(qt);if(typeof ln=="string")sn=ln;else{var ti=JSON.stringify(qt,function(di,Dt){return(0,Ct.isPlainObject)(Dt)?Object.keys(Dt).sort().reduce(function(le,Qe){return le[Qe]=Dt[Qe],le},{}):Dt});(0,Ct.isPlainObject)(qt)&&(Rt==null||Rt.set(qt,ti)),sn=ti}return Lt+"("+sn+")"},ke=C(Wg),Ae=C(ERt);function je(){for(var et=[],Lt=0;Lt<arguments.length;Lt++)et[Lt]=arguments[Lt];return function(qt){var sn=(0,Ae.defaultMemoize)(function(le){var Qe,ht;return(ht=qt.extractRehydrationInfo)==null?void 0:ht.call(qt,le,{reducerPath:(Qe=qt.reducerPath)!=null?Qe:"api"})}),ln=v(_({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},qt),{extractRehydrationInfo:sn,serializeQueryArgs:function(le){var Qe=se;if("serializeQueryArgs"in le.endpointDefinition){var ht=le.endpointDefinition.serializeQueryArgs;Qe=function(Bt){var An=ht(Bt);return typeof An=="string"?An:se(v(_({},Bt),{queryArgs:An}))}}else qt.serializeQueryArgs&&(Qe=qt.serializeQueryArgs);return Qe(le)},tagTypes:r([],qt.tagTypes||[])}),ti={endpointDefinitions:{},batch:function(le){le()},apiUid:(0,ke.nanoid)(),extractRehydrationInfo:sn,hasRehydrationInfo:(0,Ae.defaultMemoize)(function(le){return sn(le)!=null})},di={injectEndpoints:function(le){for(var Qe=le.endpoints({query:function(Li){return v(_({},Li),{type:Se.query})},mutation:function(Li){return v(_({},Li),{type:Se.mutation})}}),ht=0,Bt=Object.entries(Qe);ht<Bt.length;ht++){var An=Bt[ht],mn=An[0],hi=An[1];if(le.overrideExisting||!(mn in ti.endpointDefinitions)){ti.endpointDefinitions[mn]=hi;for(var Di=0,cr=Dt;Di<cr.length;Di++)cr[Di].injectEndpoint(mn,hi)}}return di},enhanceEndpoints:function(le){var Qe=le.addTagTypes,ht=le.endpoints;if(Qe)for(var Bt=0,An=Qe;Bt<An.length;Bt++){var mn=An[Bt];ln.tagTypes.includes(mn)||ln.tagTypes.push(mn)}if(ht)for(var hi=0,Di=Object.entries(ht);hi<Di.length;hi++){var cr=Di[hi],Li=cr[0],Sr=cr[1];typeof Sr=="function"?Sr(ti.endpointDefinitions[Li]):Object.assign(ti.endpointDefinitions[Li]||{},Sr)}return di}},Dt=et.map(function(le){return le.init(di,ln,ti)});return di.injectEndpoints({endpoints:qt.endpoints})}}function Ve(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Qt,rt=C(Wg),Cn=function(et){var Lt=et.reducerPath,qt=et.api,sn=et.context,ln=et.internalState,ti=qt.internalActions,di=ti.removeQueryResult,Dt=ti.unsubscribeQueryResult;function le(Bt){var An=ln.currentSubscriptions[Bt];return!!An&&!function(mn){for(var hi in mn)return!1;return!0}(An)}var Qe={};function ht(Bt,An,mn,hi){var Di,cr=sn.endpointDefinitions[An],Li=(Di=cr==null?void 0:cr.keepUnusedDataFor)!=null?Di:hi.keepUnusedDataFor;if(Li!==1/0){var Sr=Math.max(0,Math.min(Li,2147482647e-3));if(!le(Bt)){var rr=Qe[Bt];rr&&clearTimeout(rr),Qe[Bt]=setTimeout(function(){le(Bt)||mn.dispatch(di({queryCacheKey:Bt})),delete Qe[Bt]},1e3*Sr)}}}return function(Bt,An,mn){var hi;if(Dt.match(Bt)){var Di=An.getState()[Lt];ht(Do=Bt.payload.queryCacheKey,(hi=Di.queries[Do])==null?void 0:hi.endpointName,An,Di.config)}if(qt.util.resetApiState.match(Bt))for(var cr=0,Li=Object.entries(Qe);cr<Li.length;cr++){var Sr=Li[cr],rr=Sr[0],ws=Sr[1];ws&&clearTimeout(ws),delete Qe[rr]}if(sn.hasRehydrationInfo(Bt)){Di=An.getState()[Lt];for(var Er=sn.extractRehydrationInfo(Bt).queries,xa=0,No=Object.entries(Er);xa<No.length;xa++){var Do,Zs=No[xa],ua=Zs[1];ht(Do=Zs[0],ua==null?void 0:ua.endpointName,An,Di.config)}}}},Rn=C(Wg),li=function(et){var Lt=et.reducerPath,qt=et.context,sn=et.context.endpointDefinitions,ln=et.mutationThunk,ti=et.api,di=et.assertTagType,Dt=et.refetchQuery,le=ti.internalActions.removeQueryResult,Qe=(0,Rn.isAnyOf)((0,Rn.isFulfilled)(ln),(0,Rn.isRejectedWithValue)(ln));function ht(Bt,An){var mn=An.getState(),hi=mn[Lt],Di=ti.util.selectInvalidatedBy(mn,Bt);qt.batch(function(){for(var cr,Li=0,Sr=Array.from(Di.values());Li<Sr.length;Li++){var rr=Sr[Li].queryCacheKey,ws=hi.queries[rr],Er=(cr=hi.subscriptions[rr])!=null?cr:{};ws&&(Object.keys(Er).length===0?An.dispatch(le({queryCacheKey:rr})):ws.status!==e.uninitialized&&An.dispatch(Dt(ws,rr)))}})}return function(Bt,An){Qe(Bt)&&ht(Ft(Bt,"invalidatesTags",sn,di),An),ti.util.invalidateTags.match(Bt)&&ht(ye(Bt.payload,void 0,void 0,void 0,void 0,di),An)}},Mi=function(et){var Lt=et.reducerPath,qt=et.queryThunk,sn=et.api,ln=et.refetchQuery,ti=et.internalState,di={};function Dt(Bt,An){var mn=Bt.queryCacheKey,hi=An.getState()[Lt].queries[mn];if(hi&&hi.status!==e.uninitialized){var Di=ht(ti.currentSubscriptions[mn]);if(Number.isFinite(Di)){var cr=di[mn];cr!=null&&cr.timeout&&(clearTimeout(cr.timeout),cr.timeout=void 0);var Li=Date.now()+Di,Sr=di[mn]={nextPollTimestamp:Li,pollingInterval:Di,timeout:setTimeout(function(){Sr.timeout=void 0,An.dispatch(ln(hi,mn))},Di)}}}}function le(Bt,An){var mn=Bt.queryCacheKey,hi=An.getState()[Lt].queries[mn];if(hi&&hi.status!==e.uninitialized){var Di=ht(ti.currentSubscriptions[mn]);if(Number.isFinite(Di)){var cr=di[mn],Li=Date.now()+Di;(!cr||Li<cr.nextPollTimestamp)&&Dt({queryCacheKey:mn},An)}else Qe(mn)}}function Qe(Bt){var An=di[Bt];An!=null&&An.timeout&&clearTimeout(An.timeout),delete di[Bt]}function ht(Bt){Bt===void 0&&(Bt={});var An=Number.POSITIVE_INFINITY;for(var mn in Bt)Bt[mn].pollingInterval&&(An=Math.min(Bt[mn].pollingInterval,An));return An}return function(Bt,An){(sn.internalActions.updateSubscriptionOptions.match(Bt)||sn.internalActions.unsubscribeQueryResult.match(Bt))&&le(Bt.payload,An),(qt.pending.match(Bt)||qt.rejected.match(Bt)&&Bt.meta.condition)&&le(Bt.meta.arg,An),(qt.fulfilled.match(Bt)||qt.rejected.match(Bt)&&!Bt.meta.condition)&&Dt(Bt.meta.arg,An),sn.util.resetApiState.match(Bt)&&function(){for(var mn=0,hi=Object.keys(di);mn<hi.length;mn++)Qe(hi[mn])}()}},si=C(Wg),oi=new Error("Promise never resolved before cacheEntryRemoved."),_n=function(et){var Lt=et.api,qt=et.reducerPath,sn=et.context,ln=et.queryThunk,ti=et.mutationThunk,di=(0,si.isAsyncThunkAction)(ln),Dt=(0,si.isAsyncThunkAction)(ti),le=(0,si.isFulfilled)(ln,ti),Qe={};function ht(Bt,An,mn,hi,Di){var cr=sn.endpointDefinitions[Bt],Li=cr==null?void 0:cr.onCacheEntryAdded;if(Li){var Sr={},rr=new Promise(function(Zs){Sr.cacheEntryRemoved=Zs}),ws=Promise.race([new Promise(function(Zs){Sr.valueResolved=Zs}),rr.then(function(){throw oi})]);ws.catch(function(){}),Qe[mn]=Sr;var Er=Lt.endpoints[Bt].select(cr.type===Se.query?An:mn),xa=hi.dispatch(function(Zs,ua,Os){return Os}),No=v(_({},hi),{getCacheEntry:function(){return Er(hi.getState())},requestId:Di,extra:xa,updateCachedData:cr.type===Se.query?function(Zs){return hi.dispatch(Lt.util.updateQueryData(Bt,An,Zs))}:void 0,cacheDataLoaded:ws,cacheEntryRemoved:rr}),Do=Li(An,No);Promise.resolve(Do).catch(function(Zs){if(Zs!==oi)throw Zs})}}return function(Bt,An,mn){var hi=function(Er){return di(Er)?Er.meta.arg.queryCacheKey:Dt(Er)?Er.meta.requestId:Lt.internalActions.removeQueryResult.match(Er)?Er.payload.queryCacheKey:Lt.internalActions.removeMutationResult.match(Er)?nt(Er.payload):""}(Bt);if(ln.pending.match(Bt)){var Di=mn[qt].queries[hi],cr=An.getState()[qt].queries[hi];!Di&&cr&&ht(Bt.meta.arg.endpointName,Bt.meta.arg.originalArgs,hi,An,Bt.meta.requestId)}else if(ti.pending.match(Bt))(cr=An.getState()[qt].mutations[hi])&&ht(Bt.meta.arg.endpointName,Bt.meta.arg.originalArgs,hi,An,Bt.meta.requestId);else if(le(Bt))(ws=Qe[hi])!=null&&ws.valueResolved&&(ws.valueResolved({data:Bt.payload,meta:Bt.meta.baseQueryMeta}),delete ws.valueResolved);else if(Lt.internalActions.removeQueryResult.match(Bt)||Lt.internalActions.removeMutationResult.match(Bt))(ws=Qe[hi])&&(delete Qe[hi],ws.cacheEntryRemoved());else if(Lt.util.resetApiState.match(Bt))for(var Li=0,Sr=Object.entries(Qe);Li<Sr.length;Li++){var rr=Sr[Li],ws=rr[1];delete Qe[rr[0]],ws.cacheEntryRemoved()}}},de=C(Wg),_e=function(et){var Lt=et.api,qt=et.context,sn=et.queryThunk,ln=et.mutationThunk,ti=(0,de.isPending)(sn,ln),di=(0,de.isRejected)(sn,ln),Dt=(0,de.isFulfilled)(sn,ln),le={};return function(Qe,ht){var Bt,An,mn;if(ti(Qe)){var hi=Qe.meta,Di=hi.requestId,cr=hi.arg,Li=cr.endpointName,Sr=cr.originalArgs,rr=qt.endpointDefinitions[Li],ws=rr==null?void 0:rr.onQueryStarted;if(ws){var Er={},xa=new Promise(function(ul,Qi){Er.resolve=ul,Er.reject=Qi});xa.catch(function(){}),le[Di]=Er;var No=Lt.endpoints[Li].select(rr.type===Se.query?Sr:Di),Do=ht.dispatch(function(ul,Qi,Ms){return Ms}),Zs=v(_({},ht),{getCacheEntry:function(){return No(ht.getState())},requestId:Di,extra:Do,updateCachedData:rr.type===Se.query?function(ul){return ht.dispatch(Lt.util.updateQueryData(Li,Sr,ul))}:void 0,queryFulfilled:xa});ws(Sr,Zs)}}else if(Dt(Qe)){var ua=Qe.meta,Os=ua.baseQueryMeta;(Bt=le[Di=ua.requestId])==null||Bt.resolve({data:Qe.payload,meta:Os}),delete le[Di]}else if(di(Qe)){var Co=Qe.meta;Os=Co.baseQueryMeta,(mn=le[Di=Co.requestId])==null||mn.reject({error:(An=Qe.payload)!=null?An:Qe.error,isUnhandledError:!Co.rejectedWithValue,meta:Os}),delete le[Di]}}},Le=function(et){var Lt=et.api,qt=et.context.apiUid;return function(sn,ln){Lt.util.resetApiState.match(sn)&&ln.dispatch(Lt.internalActions.middlewareRegistered(qt))}},Ge=C(T5()),gt=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof hb<"u"?hb:globalThis):function(et){return(Qt||(Qt=Promise.resolve())).then(et).catch(function(Lt){return setTimeout(function(){throw Lt},0)})};function pt(et){for(var Lt=[],qt=1;qt<arguments.length;qt++)Lt[qt-1]=arguments[qt];Object.assign.apply(Object,r([et],Lt))}var Vt=C(T5()),Pn=Symbol(),Ln=function(){return{name:Pn,init:function(et,Lt,qt){var sn=Lt.baseQuery,ln=Lt.reducerPath,ti=Lt.serializeQueryArgs,di=Lt.keepUnusedDataFor,Dt=Lt.refetchOnMountOrArgChange,le=Lt.refetchOnFocus,Qe=Lt.refetchOnReconnect;(0,Vt.enablePatches)();var ht=function(Qi){return Qi};Object.assign(et,{reducerPath:ln,endpoints:{},internalActions:{onOnline:Z,onOffline:X,onFocus:H,onFocusLost:z},util:{}});var Bt=function(Qi){var Ms=this,js=Qi.reducerPath,Ro=Qi.baseQuery,Bi=Qi.context.endpointDefinitions,Vi=Qi.serializeQueryArgs,Br=Qi.api,Gr=Qi.assertTagType,xs=function(vn,Un){return S(Ms,[vn,Un],function(Mn,fi){var Wi,or,qn,Wn,Ei,Kn,Hn,ki,Sn,On,wi,Cr,br,zs=fi.signal,Oa=fi.abort,$r=fi.rejectWithValue,Qn=fi.fulfillWithValue,Po=fi.dispatch,jl=fi.getState,Ku=fi.extra;return i(this,function(Jo){switch(Jo.label){case 0:Wi=Bi[Mn.endpointName],Jo.label=1;case 1:return Jo.trys.push([1,8,,13]),or=St,qn=void 0,Wn={signal:zs,abort:Oa,dispatch:Po,getState:jl,extra:Ku,endpoint:Mn.endpointName,type:Mn.type,forced:Mn.type==="query"?sr(Mn,jl()):void 0},(Ei=Mn.type==="query"?Mn[qe]:void 0)?(qn=Ei(),[3,6]):[3,2];case 2:return Wi.query?[4,Ro(Wi.query(Mn.originalArgs),Wn,Wi.extraOptions)]:[3,4];case 3:return qn=Jo.sent(),Wi.transformResponse&&(or=Wi.transformResponse),[3,6];case 4:return[4,Wi.queryFn(Mn.originalArgs,Wn,Wi.extraOptions,function(_c){return Ro(_c,Wn,Wi.extraOptions)})];case 5:qn=Jo.sent(),Jo.label=6;case 6:if(qn.error)throw new B(qn.error,qn.meta);return Kn=Qn,[4,or(qn.data,qn.meta,Mn.originalArgs)];case 7:return[2,Kn.apply(void 0,[Jo.sent(),(Cr={fulfilledTimeStamp:Date.now(),baseQueryMeta:qn.meta},Cr[tt.SHOULD_AUTOBATCH]=!0,Cr)])];case 8:if(Hn=Jo.sent(),!((ki=Hn)instanceof B))return[3,12];Sn=St,Wi.query&&Wi.transformErrorResponse&&(Sn=Wi.transformErrorResponse),Jo.label=9;case 9:return Jo.trys.push([9,11,,12]),On=$r,[4,Sn(ki.value,ki.meta,Mn.originalArgs)];case 10:return[2,On.apply(void 0,[Jo.sent(),(br={baseQueryMeta:ki.meta},br[tt.SHOULD_AUTOBATCH]=!0,br)])];case 11:return wi=Jo.sent(),ki=wi,[3,12];case 12:throw console.error(ki),ki;case 13:return[2]}})})};function sr(vn,Un){var Mn,fi,Wi,or,qn=(fi=(Mn=Un[js])==null?void 0:Mn.queries)==null?void 0:fi[vn.queryCacheKey],Wn=(Wi=Un[js])==null?void 0:Wi.config.refetchOnMountOrArgChange,Ei=qn==null?void 0:qn.fulfilledTimeStamp,Kn=(or=vn.forceRefetch)!=null?or:vn.subscribe&&Wn;return!!Kn&&(Kn===!0||(Number(new Date)-Number(Ei))/1e3>=Kn)}var Ns=(0,tt.createAsyncThunk)(js+"/executeQuery",xs,{getPendingMeta:function(){var vn;return(vn={startedTimeStamp:Date.now()})[tt.SHOULD_AUTOBATCH]=!0,vn},condition:function(vn,Un){var Mn,fi,Wi,or=(0,Un.getState)(),qn=(fi=(Mn=or[js])==null?void 0:Mn.queries)==null?void 0:fi[vn.queryCacheKey],Wn=qn==null?void 0:qn.fulfilledTimeStamp,Ei=vn.originalArgs,Kn=qn==null?void 0:qn.originalArgs,Hn=Bi[vn.endpointName];return!(!mt(vn)&&((qn==null?void 0:qn.status)==="pending"||!sr(vn,or)&&(!ge(Hn)||!((Wi=Hn==null?void 0:Hn.forceRefetch)!=null&&Wi.call(Hn,{currentArg:Ei,previousArg:Kn,endpointState:qn,state:or})))&&Wn))},dispatchConditionRejection:!0}),uo=(0,tt.createAsyncThunk)(js+"/executeMutation",xs,{getPendingMeta:function(){var vn;return(vn={startedTimeStamp:Date.now()})[tt.SHOULD_AUTOBATCH]=!0,vn}});function yi(vn){return function(Un){var Mn,fi;return((fi=(Mn=Un==null?void 0:Un.meta)==null?void 0:Mn.arg)==null?void 0:fi.endpointName)===vn}}return{queryThunk:Ns,mutationThunk:uo,prefetch:function(vn,Un,Mn){return function(fi,Wi){var or=function(Hn){return"force"in Hn}(Mn)&&Mn.force,qn=function(Hn){return"ifOlderThan"in Hn}(Mn)&&Mn.ifOlderThan,Wn=function(Hn){return Hn===void 0&&(Hn=!0),Br.endpoints[vn].initiate(Un,{forceRefetch:Hn})},Ei=Br.endpoints[vn].select(Un)(Wi());if(or)fi(Wn());else if(qn){var Kn=Ei==null?void 0:Ei.fulfilledTimeStamp;if(!Kn)return void fi(Wn());(Number(new Date)-Number(new Date(Kn)))/1e3>=qn&&fi(Wn())}else fi(Wn(!1))}},updateQueryData:function(vn,Un,Mn,fi){return fi===void 0&&(fi=!0),function(Wi,or){var qn,Wn,Ei,Kn=Br.endpoints[vn].select(Un)(or()),Hn={patches:[],inversePatches:[],undo:function(){return Wi(Br.util.patchQueryData(vn,Un,Hn.inversePatches,fi))}};if(Kn.status===e.uninitialized)return Hn;if("data"in Kn)if((0,ft.isDraftable)(Kn.data)){var ki=(0,ft.produceWithPatches)(Kn.data,Mn),Sn=ki[0],On=ki[2];(qn=Hn.patches).push.apply(qn,ki[1]),(Wn=Hn.inversePatches).push.apply(Wn,On),Ei=Sn}else Ei=Mn(Kn.data),Hn.patches.push({op:"replace",path:[],value:Ei}),Hn.inversePatches.push({op:"replace",path:[],value:Kn.data});return Wi(Br.util.patchQueryData(vn,Un,Hn.patches,fi)),Hn}},upsertQueryData:function(vn,Un,Mn){return function(fi){var Wi;return fi(Br.endpoints[vn].initiate(Un,((Wi={subscribe:!1,forceRefetch:!0})[qe]=function(){return{data:Mn}},Wi)))}},patchQueryData:function(vn,Un,Mn,fi){return function(Wi,or){var qn=Bi[vn],Wn=Vi({queryArgs:Un,endpointDefinition:qn,endpointName:vn});if(Wi(Br.internalActions.queryResultPatched({queryCacheKey:Wn,patches:Mn})),fi){var Ei=Br.endpoints[vn].select(Un)(or()),Kn=ye(qn.providesTags,Ei.data,void 0,Un,{},Gr);Wi(Br.internalActions.updateProvidedBy({queryCacheKey:Wn,providedTags:Kn}))}}},buildMatchThunkActions:function(vn,Un){return{matchPending:(0,vt.isAllOf)((0,vt.isPending)(vn),yi(Un)),matchFulfilled:(0,vt.isAllOf)((0,vt.isFulfilled)(vn),yi(Un)),matchRejected:(0,vt.isAllOf)((0,vt.isRejected)(vn),yi(Un))}}}}({baseQuery:sn,reducerPath:ln,context:qt,api:et,serializeQueryArgs:ti,assertTagType:ht}),An=Bt.queryThunk,mn=Bt.mutationThunk,hi=Bt.patchQueryData,Di=Bt.updateQueryData,cr=Bt.upsertQueryData,Li=Bt.prefetch,Sr=Bt.buildMatchThunkActions,rr=function(Qi){var Ms=Qi.reducerPath,js=Qi.queryThunk,Ro=Qi.mutationThunk,Bi=Qi.context,Vi=Bi.endpointDefinitions,Br=Bi.apiUid,Gr=Bi.extractRehydrationInfo,xs=Bi.hasRehydrationInfo,sr=Qi.assertTagType,Ns=Qi.config,uo=(0,Be.createAction)(Ms+"/resetApiState"),yi=(0,Be.createSlice)({name:Ms+"/queries",initialState:Oe,reducers:{removeQueryResult:{reducer:function(qn,Wn){delete qn[Wn.payload.queryCacheKey]},prepare:(0,Be.prepareAutoBatched)()},queryResultPatched:{reducer:function(qn,Wn){var Ei=Wn.payload,Kn=Ei.patches;dt(qn,Ei.queryCacheKey,function(Hn){Hn.data=(0,Ke.applyPatches)(Hn.data,Kn.concat())})},prepare:(0,Be.prepareAutoBatched)()}},extraReducers:function(qn){qn.addCase(js.pending,function(Wn,Ei){var Kn,Hn=Ei.meta,ki=Ei.meta.arg,Sn=mt(ki);(ki.subscribe||Sn)&&(Wn[Kn=ki.queryCacheKey]!=null||(Wn[Kn]={status:e.uninitialized,endpointName:ki.endpointName})),dt(Wn,ki.queryCacheKey,function(On){On.status=e.pending,On.requestId=Sn&&On.requestId?On.requestId:Hn.requestId,ki.originalArgs!==void 0&&(On.originalArgs=ki.originalArgs),On.startedTimeStamp=Hn.startedTimeStamp})}).addCase(js.fulfilled,function(Wn,Ei){var Kn=Ei.meta,Hn=Ei.payload;dt(Wn,Kn.arg.queryCacheKey,function(ki){var Sn;if(ki.requestId===Kn.requestId||mt(Kn.arg)){var On=Vi[Kn.arg.endpointName].merge;if(ki.status=e.fulfilled,On)if(ki.data!==void 0){var wi=Kn.fulfilledTimeStamp,Cr=Kn.arg,br=Kn.baseQueryMeta,zs=Kn.requestId,Oa=(0,Be.createNextState)(ki.data,function($r){return On($r,Hn,{arg:Cr.originalArgs,baseQueryMeta:br,fulfilledTimeStamp:wi,requestId:zs})});ki.data=Oa}else ki.data=Hn;else ki.data=(Sn=Vi[Kn.arg.endpointName].structuralSharing)==null||Sn?L((0,en.isDraft)(ki.data)?(0,Ke.original)(ki.data):ki.data,Hn):Hn;delete ki.error,ki.fulfilledTimeStamp=Kn.fulfilledTimeStamp}})}).addCase(js.rejected,function(Wn,Ei){var Kn=Ei.meta,Hn=Kn.condition,ki=Kn.requestId,Sn=Ei.error,On=Ei.payload;dt(Wn,Kn.arg.queryCacheKey,function(wi){if(!Hn){if(wi.requestId!==ki)return;wi.status=e.rejected,wi.error=On??Sn}})}).addMatcher(xs,function(Wn,Ei){for(var Kn=Gr(Ei).queries,Hn=0,ki=Object.entries(Kn);Hn<ki.length;Hn++){var Sn=ki[Hn],On=Sn[1];(On==null?void 0:On.status)!==e.fulfilled&&(On==null?void 0:On.status)!==e.rejected||(Wn[Sn[0]]=On)}})}}),vn=(0,Be.createSlice)({name:Ms+"/mutations",initialState:Oe,reducers:{removeMutationResult:{reducer:function(qn,Wn){var Ei=nt(Wn.payload);Ei in qn&&delete qn[Ei]},prepare:(0,Be.prepareAutoBatched)()}},extraReducers:function(qn){qn.addCase(Ro.pending,function(Wn,Ei){var Kn=Ei.meta,Hn=Kn.requestId,ki=Kn.arg,Sn=Kn.startedTimeStamp;ki.track&&(Wn[nt(Ei.meta)]={requestId:Hn,status:e.pending,endpointName:ki.endpointName,startedTimeStamp:Sn})}).addCase(Ro.fulfilled,function(Wn,Ei){var Kn=Ei.payload,Hn=Ei.meta;Hn.arg.track&&at(Wn,Hn,function(ki){ki.requestId===Hn.requestId&&(ki.status=e.fulfilled,ki.data=Kn,ki.fulfilledTimeStamp=Hn.fulfilledTimeStamp)})}).addCase(Ro.rejected,function(Wn,Ei){var Kn=Ei.payload,Hn=Ei.error,ki=Ei.meta;ki.arg.track&&at(Wn,ki,function(Sn){Sn.requestId===ki.requestId&&(Sn.status=e.rejected,Sn.error=Kn??Hn)})}).addMatcher(xs,function(Wn,Ei){for(var Kn=Gr(Ei).mutations,Hn=0,ki=Object.entries(Kn);Hn<ki.length;Hn++){var Sn=ki[Hn],On=Sn[0],wi=Sn[1];(wi==null?void 0:wi.status)!==e.fulfilled&&(wi==null?void 0:wi.status)!==e.rejected||On===(wi==null?void 0:wi.requestId)||(Wn[On]=wi)}})}}),Un=(0,Be.createSlice)({name:Ms+"/invalidation",initialState:Oe,reducers:{updateProvidedBy:{reducer:function(qn,Wn){for(var Ei,Kn,Hn,ki,Sn=Wn.payload,On=Sn.queryCacheKey,wi=Sn.providedTags,Cr=0,br=Object.values(qn);Cr<br.length;Cr++)for(var zs=0,Oa=Object.values(br[Cr]);zs<Oa.length;zs++){var $r=Oa[zs],Qn=$r.indexOf(On);Qn!==-1&&$r.splice(Qn,1)}for(var Po=0,jl=wi;Po<jl.length;Po++){var Ku=jl[Po],Jo=Ku.type,_c=Ku.id,sc=(ki=(Kn=(Ei=qn[Jo])!=null?Ei:qn[Jo]={})[Hn=_c||"__internal_without_id"])!=null?ki:Kn[Hn]=[];sc.includes(On)||sc.push(On)}},prepare:(0,Be.prepareAutoBatched)()}},extraReducers:function(qn){qn.addCase(yi.actions.removeQueryResult,function(Wn,Ei){for(var Kn=Ei.payload.queryCacheKey,Hn=0,ki=Object.values(Wn);Hn<ki.length;Hn++)for(var Sn=0,On=Object.values(ki[Hn]);Sn<On.length;Sn++){var wi=On[Sn],Cr=wi.indexOf(Kn);Cr!==-1&&wi.splice(Cr,1)}}).addMatcher(xs,function(Wn,Ei){for(var Kn,Hn,ki,Sn,On=Gr(Ei).provided,wi=0,Cr=Object.entries(On);wi<Cr.length;wi++)for(var br=Cr[wi],zs=br[0],Oa=0,$r=Object.entries(br[1]);Oa<$r.length;Oa++)for(var Qn=$r[Oa],Po=Qn[0],jl=Qn[1],Ku=(Sn=(Hn=(Kn=Wn[zs])!=null?Kn:Wn[zs]={})[ki=Po||"__internal_without_id"])!=null?Sn:Hn[ki]=[],Jo=0,_c=jl;Jo<_c.length;Jo++){var sc=_c[Jo];Ku.includes(sc)||Ku.push(sc)}}).addMatcher((0,Be.isAnyOf)((0,Be.isFulfilled)(js),(0,Be.isRejectedWithValue)(js)),function(Wn,Ei){var Kn=Ft(Ei,"providesTags",Vi,sr);Un.caseReducers.updateProvidedBy(Wn,Un.actions.updateProvidedBy({queryCacheKey:Ei.meta.arg.queryCacheKey,providedTags:Kn}))})}}),Mn=(0,Be.createSlice)({name:Ms+"/subscriptions",initialState:Oe,reducers:{updateSubscriptionOptions:function(qn,Wn){},unsubscribeQueryResult:function(qn,Wn){},internal_probeSubscription:function(qn,Wn){}}}),fi=(0,Be.createSlice)({name:Ms+"/internalSubscriptions",initialState:Oe,reducers:{subscriptionsUpdated:{reducer:function(qn,Wn){return(0,Ke.applyPatches)(qn,Wn.payload)},prepare:(0,Be.prepareAutoBatched)()}}}),Wi=(0,Be.createSlice)({name:Ms+"/config",initialState:_({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},Ns),reducers:{middlewareRegistered:function(qn,Wn){qn.middlewareRegistered=qn.middlewareRegistered!=="conflict"&&Br===Wn.payload||"conflict"}},extraReducers:function(qn){qn.addCase(Z,function(Wn){Wn.online=!0}).addCase(X,function(Wn){Wn.online=!1}).addCase(H,function(Wn){Wn.focused=!0}).addCase(z,function(Wn){Wn.focused=!1}).addMatcher(xs,function(Wn){return _({},Wn)})}}),or=(0,Be.combineReducers)({queries:yi.reducer,mutations:vn.reducer,provided:Un.reducer,subscriptions:fi.reducer,config:Wi.reducer});return{reducer:function(qn,Wn){return or(uo.match(Wn)?void 0:qn,Wn)},actions:v(_(_(_(_(_(_({},Wi.actions),yi.actions),Mn.actions),fi.actions),vn.actions),Un.actions),{unsubscribeMutationResult:vn.actions.removeMutationResult,resetApiState:uo})}}({context:qt,queryThunk:An,mutationThunk:mn,reducerPath:ln,assertTagType:ht,config:{refetchOnFocus:le,refetchOnReconnect:Qe,refetchOnMountOrArgChange:Dt,keepUnusedDataFor:di,reducerPath:ln}}),ws=rr.reducer,Er=rr.actions;pt(et.util,{patchQueryData:hi,updateQueryData:Di,upsertQueryData:cr,prefetch:Li,resetApiState:Er.resetApiState}),pt(et.internalActions,Er);var xa=function(Qi){var Ms=Qi.reducerPath,js=Qi.queryThunk,Ro=Qi.api,Bi=Qi.context,Vi=Bi.apiUid,Br={invalidateTags:(0,rt.createAction)(Ms+"/invalidateTags")},Gr=[Le,Cn,li,Mi,_n,_e];return{middleware:function(sr){var Ns=!1,uo=v(_({},Qi),{internalState:{currentSubscriptions:{}},refetchQuery:xs}),yi=Gr.map(function(Mn){return Mn(uo)}),vn=function(Mn){var fi=Mn.api,Wi=Mn.queryThunk,or=Mn.internalState,qn=fi.reducerPath+"/subscriptions",Wn=null,Ei=!1,Kn=fi.internalActions,Hn=Kn.updateSubscriptionOptions,ki=Kn.unsubscribeQueryResult;return function(Sn,On){var wi,Cr;if(Wn||(Wn=JSON.parse(JSON.stringify(or.currentSubscriptions))),fi.util.resetApiState.match(Sn))return Wn=or.currentSubscriptions={},[!0,!1];if(fi.internalActions.internal_probeSubscription.match(Sn)){var br=Sn.payload;return[!1,!!((wi=or.currentSubscriptions[br.queryCacheKey])!=null&&wi[br.requestId])]}var zs=function(Qn,Po){var jl,Ku,Jo,_c,sc,pp,E1,Sa,Xm;if(Hn.match(Po)){var Jd=Po.payload,Zm=Jd.queryCacheKey,Jc=Jd.requestId;return(jl=Qn==null?void 0:Qn[Zm])!=null&&jl[Jc]&&(Qn[Zm][Jc]=Jd.options),!0}if(ki.match(Po)){var eu=Po.payload;return Jc=eu.requestId,Qn[Zm=eu.queryCacheKey]&&delete Qn[Zm][Jc],!0}if(fi.internalActions.removeQueryResult.match(Po))return delete Qn[Po.payload.queryCacheKey],!0;if(Wi.pending.match(Po)){var n0=Po.meta;if(Jc=n0.requestId,(kf=n0.arg).subscribe)return(vc=(Jo=Qn[Ku=kf.queryCacheKey])!=null?Jo:Qn[Ku]={})[Jc]=(sc=(_c=kf.subscriptionOptions)!=null?_c:vc[Jc])!=null?sc:{},!0}if(Wi.rejected.match(Po)){var vc,Ef=Po.meta,kf=Ef.arg;if(Jc=Ef.requestId,Ef.condition&&kf.subscribe)return(vc=(E1=Qn[pp=kf.queryCacheKey])!=null?E1:Qn[pp]={})[Jc]=(Xm=(Sa=kf.subscriptionOptions)!=null?Sa:vc[Jc])!=null?Xm:{},!0}return!1}(or.currentSubscriptions,Sn);if(zs){Ei||(gt(function(){var Qn=JSON.parse(JSON.stringify(or.currentSubscriptions)),Po=(0,Ge.produceWithPatches)(Wn,function(){return Qn});On.next(fi.internalActions.subscriptionsUpdated(Po[1])),Wn=Qn,Ei=!1}),Ei=!0);var Oa=!!((Cr=Sn.type)!=null&&Cr.startsWith(qn)),$r=Wi.rejected.match(Sn)&&Sn.meta.condition&&!!Sn.meta.arg.subscribe;return[!Oa&&!$r,!1]}return[!0,!1]}}(uo),Un=function(Mn){var fi=Mn.reducerPath,Wi=Mn.context,or=Mn.refetchQuery,qn=Mn.internalState,Wn=Mn.api.internalActions.removeQueryResult;function Ei(Kn,Hn){var ki=Kn.getState()[fi],Sn=ki.queries,On=qn.currentSubscriptions;Wi.batch(function(){for(var wi=0,Cr=Object.keys(On);wi<Cr.length;wi++){var br=Cr[wi],zs=Sn[br],Oa=On[br];Oa&&zs&&(Object.values(Oa).some(function($r){return $r[Hn]===!0})||Object.values(Oa).every(function($r){return $r[Hn]===void 0})&&ki.config[Hn])&&(Object.keys(Oa).length===0?Kn.dispatch(Wn({queryCacheKey:br})):zs.status!==e.uninitialized&&Kn.dispatch(or(zs,br)))}})}return function(Kn,Hn){H.match(Kn)&&Ei(Hn,"refetchOnFocus"),Z.match(Kn)&&Ei(Hn,"refetchOnReconnect")}}(uo);return function(Mn){return function(fi){Ns||(Ns=!0,sr.dispatch(Ro.internalActions.middlewareRegistered(Vi)));var Wi,or=v(_({},sr),{next:Mn}),qn=sr.getState(),Wn=vn(fi,or,qn),Ei=Wn[1];if(Wi=Wn[0]?Mn(fi):Ei,sr.getState()[Ms]&&(Un(fi,or,qn),function(ki){return!!ki&&typeof ki.type=="string"&&ki.type.startsWith(Ms+"/")}(fi)||Bi.hasRehydrationInfo(fi)))for(var Kn=0,Hn=yi;Kn<Hn.length;Kn++)(0,Hn[Kn])(fi,or,qn);return Wi}}},actions:Br};function xs(sr,Ns,uo){return uo===void 0&&(uo={}),js(_({type:"query",endpointName:sr.endpointName,originalArgs:sr.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:Ns},uo))}}({reducerPath:ln,context:qt,queryThunk:An,mutationThunk:mn,api:et,assertTagType:ht}),No=xa.middleware;pt(et.util,xa.actions),pt(et,{reducer:ws,middleware:No});var Do=function(Qi){var Ms=Qi.serializeQueryArgs,js=Qi.reducerPath,Ro=function(Gr){return it},Bi=function(Gr){return Tt};return{buildQuerySelector:function(Gr,xs){return function(sr){var Ns=Ms({queryArgs:sr,endpointDefinition:xs,endpointName:Gr});return(0,Ie.createSelector)(sr===ce?Ro:function(uo){var yi,vn,Un;return(Un=(vn=(yi=Br(uo))==null?void 0:yi.queries)==null?void 0:vn[Ns])!=null?Un:it},Vi)}},buildMutationSelector:function(){return function(Gr){var xs,sr;return sr=typeof Gr=="object"?(xs=nt(Gr))!=null?xs:ce:Gr,(0,Ie.createSelector)(sr===ce?Bi:function(Ns){var uo,yi,vn;return(vn=(yi=(uo=Br(Ns))==null?void 0:uo.mutations)==null?void 0:yi[sr])!=null?vn:Tt},Vi)}},selectInvalidatedBy:function(Gr,xs){for(var sr,Ns=Gr[js],uo=new Set,yi=0,vn=xs.map(Pe);yi<vn.length;yi++){var Un=vn[yi],Mn=Ns.provided[Un.type];if(Mn)for(var fi=0,Wi=(sr=Un.id!==void 0?Mn[Un.id]:k(Object.values(Mn)))!=null?sr:[];fi<Wi.length;fi++)uo.add(Wi[fi])}return k(Array.from(uo.values()).map(function(or){var qn=Ns.queries[or];return qn?[{queryCacheKey:or,endpointName:qn.endpointName,originalArgs:qn.originalArgs}]:[]}))}};function Vi(Gr){return _(_({},Gr),{status:xs=Gr.status,isUninitialized:xs===e.uninitialized,isLoading:xs===e.pending,isSuccess:xs===e.fulfilled,isError:xs===e.rejected});var xs}function Br(Gr){return Gr[js]}}({serializeQueryArgs:ti,reducerPath:ln}),Zs=Do.buildQuerySelector,ua=Do.buildMutationSelector;pt(et.util,{selectInvalidatedBy:Do.selectInvalidatedBy});var Os=function(Qi){var Ms=Qi.serializeQueryArgs,js=Qi.queryThunk,Ro=Qi.mutationThunk,Bi=Qi.api,Vi=Qi.context,Br=new Map,Gr=new Map,xs=Bi.internalActions,sr=xs.unsubscribeQueryResult,Ns=xs.removeMutationResult,uo=xs.updateSubscriptionOptions;return{buildInitiateQuery:function(yi,vn){var Un=function(Mn,fi){var Wi=fi===void 0?{}:fi,or=Wi.subscribe,qn=or===void 0||or,Wn=Wi.forceRefetch,Ei=Wi.subscriptionOptions,Kn=Wi[qe];return function(Hn,ki){var Sn,On,wi=Ms({queryArgs:Mn,endpointDefinition:vn,endpointName:yi}),Cr=js(((Sn={type:"query",subscribe:qn,forceRefetch:Wn,subscriptionOptions:Ei,endpointName:yi,originalArgs:Mn,queryCacheKey:wi})[qe]=Kn,Sn)),br=Bi.endpoints[yi].select(Mn),zs=Hn(Cr),Oa=br(ki()),$r=zs.requestId,Qn=zs.abort,Po=Oa.requestId!==$r,jl=(On=Br.get(Hn))==null?void 0:On[wi],Ku=function(){return br(ki())},Jo=Object.assign(Kn?zs.then(Ku):Po&&!jl?Promise.resolve(Oa):Promise.all([jl,zs]).then(Ku),{arg:Mn,requestId:$r,subscriptionOptions:Ei,queryCacheKey:wi,abort:Qn,unwrap:function(){return S(this,null,function(){var sc;return i(this,function(pp){switch(pp.label){case 0:return[4,Jo];case 1:if((sc=pp.sent()).isError)throw sc.error;return[2,sc.data]}})})},refetch:function(){return Hn(Un(Mn,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){qn&&Hn(sr({queryCacheKey:wi,requestId:$r}))},updateSubscriptionOptions:function(sc){Jo.subscriptionOptions=sc,Hn(uo({endpointName:yi,requestId:$r,queryCacheKey:wi,options:sc}))}});if(!jl&&!Po&&!Kn){var _c=Br.get(Hn)||{};_c[wi]=Jo,Br.set(Hn,_c),Jo.then(function(){delete _c[wi],Object.keys(_c).length||Br.delete(Hn)})}return Jo}};return Un},buildInitiateMutation:function(yi){return function(vn,Un){var Mn=Un===void 0?{}:Un,fi=Mn.track,Wi=fi===void 0||fi,or=Mn.fixedCacheKey;return function(qn,Wn){var Ei=Ro({type:"mutation",endpointName:yi,originalArgs:vn,track:Wi,fixedCacheKey:or}),Kn=qn(Ei),Hn=Kn.requestId,ki=Kn.abort,Sn=Kn.unwrap,On=Kn.unwrap().then(function(zs){return{data:zs}}).catch(function(zs){return{error:zs}}),wi=function(){qn(Ns({requestId:Hn,fixedCacheKey:or}))},Cr=Object.assign(On,{arg:Kn.arg,requestId:Hn,abort:ki,unwrap:Sn,unsubscribe:wi,reset:wi}),br=Gr.get(qn)||{};return Gr.set(qn,br),br[Hn]=Cr,Cr.then(function(){delete br[Hn],Object.keys(br).length||Gr.delete(qn)}),or&&(br[or]=Cr,Cr.then(function(){br[or]===Cr&&(delete br[or],Object.keys(br).length||Gr.delete(qn))})),Cr}}},getRunningQueryThunk:function(yi,vn){return function(Un){var Mn,fi=Ms({queryArgs:vn,endpointDefinition:Vi.endpointDefinitions[yi],endpointName:yi});return(Mn=Br.get(Un))==null?void 0:Mn[fi]}},getRunningMutationThunk:function(yi,vn){return function(Un){var Mn;return(Mn=Gr.get(Un))==null?void 0:Mn[vn]}},getRunningQueriesThunk:function(){return function(yi){return Object.values(Br.get(yi)||{}).filter($e)}},getRunningMutationsThunk:function(){return function(yi){return Object.values(Gr.get(yi)||{}).filter($e)}},getRunningOperationPromises:function(){var yi=function(vn){return Array.from(vn.values()).flatMap(function(Un){return Un?Object.values(Un):[]})};return r(r([],yi(Br)),yi(Gr)).filter($e)},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:An,mutationThunk:mn,api:et,serializeQueryArgs:ti,context:qt}),Co=Os.buildInitiateQuery,ul=Os.buildInitiateMutation;return pt(et.util,{getRunningOperationPromises:Os.getRunningOperationPromises,getRunningOperationPromise:Os.removalWarning,getRunningMutationThunk:Os.getRunningMutationThunk,getRunningMutationsThunk:Os.getRunningMutationsThunk,getRunningQueryThunk:Os.getRunningQueryThunk,getRunningQueriesThunk:Os.getRunningQueriesThunk}),{name:Pn,injectEndpoint:function(Qi,Ms){var js,Ro=et;(js=Ro.endpoints)[Qi]!=null||(js[Qi]={}),ge(Ms)?pt(Ro.endpoints[Qi],{name:Qi,select:Zs(Qi,Ms),initiate:Co(Qi,Ms)},Sr(An,Qi)):Ms.type===Se.mutation&&pt(Ro.endpoints[Qi],{name:Qi,select:ua(),initiate:ul(Qi)},Sr(mn,Qi))}}}}},bi=je(Ln())}(DT)),DT}var wDe;function TRt(){return wDe||(wDe=1,_re.exports=kRt()),_re.exports}var IRt=TRt();/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 LRt={api:{},latestQueryUrl:""},qqe=GM({name:"companyDocuments",initialState:LRt,reducers:{updateLatestQueryUrl:(n,e)=>{n.latestQueryUrl=e.payload.url}}}),{updateLatestQueryUrl:B3r}=qqe.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 ARt={currentPage:1,filter:""},Kqe=GM({name:"products",initialState:ARt,reducers:{updateCurrentPage:(n,e)=>{n.currentPage=e.payload.number},updateFilter:(n,e)=>{n.filter=e.payload.filter}}}),{updateCurrentPage:$3r,updateFilter:H3r}=Kqe.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 NRt={colors:{primary:"#117DC0"},darkMode:!1,activeSettings:{name:"",level:"company"}},Gqe=GM({name:"settings",initialState:NRt,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:V3r,setDarkMode:W3r,setActiveSettings:n9}=Gqe.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 kO=TWe({reducer:{companyUsers:Lze.reducer,companyDocuments:qqe.reducer,user:XWe.reducer,products:Kqe.reducer,settings:Gqe.reducer},middleware:n=>n({serializableCheck:!1})});IRt.setupListeners(kO.dispatch);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function xDe(){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 i9(){return Cu(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 jo(){const n=i9();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 go(){const n=i9();return{isAdmin:!!(n!=null&&n.is_admin),isOwner:!!(n!=null&&n.is_owner||n!=null&&n.is_owner)}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function DRt({color:n="#FFFFFF",size:e="1.3rem"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 20 20",children:[h.jsx("polyline",{points:"13 7 10 4 7 7",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),h.jsx("polyline",{points:"13 13 10 16 7 13",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","data-color":"color-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 */function Nwe({color:n="#000",size:e="1.1rem"}){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 12 12",children:h.jsx("path",{d:"m1.75,6c1.047,1.048,1.803,2.153,2.461,3.579,1.524-3.076,3.659-5.397,6.039-7.158",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function nc({size:n="1rem",color:e="#A1A1AA"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 20 20",children:[h.jsx("line",{x1:"10",y1:"16.5",x2:"10",y2:"3.5",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","data-color":"color-2"}),h.jsx("line",{x1:"3.5",y1:"10",x2:"16.5",y2:"10",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"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 */function RRt({color:n="#A1A1AA",size:e="1rem",fill:t="#A1A1AA"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 20 20",children:[h.jsx("circle",{cx:"10",cy:"5.5",r:"2.5",fill:t,stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","data-color":"color-2"}),h.jsx("path",{d:"m14.664,16.455c.947-.221,1.469-1.303.991-2.15-1.114-1.973-3.227-3.305-5.655-3.305s-4.541,1.332-5.655,3.305c-.478.847.044,1.929.991,2.15,3.11.727,6.219.727,9.329,0Z",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",fill: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 PRt(){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:"0.85rem",height:"0.85rem"},viewBox:"0 0 12 12",children:[h.jsx("path",{d:"m11.78,5.47l-2.25-2.25c-.293-.293-.768-.293-1.061,0s-.293.768,0,1.061l.97.97h-2.689c-.414,0-.75.336-.75.75s.336.75.75.75h2.689l-.97.97c-.293.293-.293.768,0,1.061.146.146.338.22.53.22s.384-.073.53-.22l2.25-2.25c.293-.293.293-.768,0-1.061Z",fill:"#A1A1AA",strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m7.353,9.269c-.413-.075-.797.202-.867.61-.062.36-.372.621-.735.621h-2.929l1.049-.874c.4-.333.63-.823.63-1.344V3.718c0-.521-.229-1.011-.63-1.344l-1.049-.874h2.929c.363,0,.673.261.735.621.071.408.458.685.867.61.408-.071.682-.459.61-.867-.188-1.08-1.118-1.864-2.213-1.864h-3.5C1.009,0,0,1.009,0,2.25v7.5c0,1.241,1.009,2.25,2.25,2.25h3.5c1.095,0,2.025-.784,2.213-1.864.071-.408-.202-.796-.61-.867Z",strokeWidth:"0",fill:"#A1A1AA"})]})}const HH=As.div` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function Yqe(){var I,L,N,P;const[n]=xe(),e=Fr(),t=Yi(),i=Cu(O=>O.companyUsers),{id:r}=Yl(),s=UB(),o=Uqe({fallbackSmallLogo:!0}),a=gc(),l=xt(),c=CRt(),u=Vs(),{isAdmin:d,isOwner:f}=go(),p=zi(),g=Ml(),m=hv(),_=!!((L=(I=m==null?void 0:m.company_user)==null?void 0:I.react_settings)!=null&&L.show_mini_sidebar),v=Vw(),[b,y]=x.useState(!1),[C,S]=x.useState(!1),k=O=>{if(e(HB({type:ZM.TOKEN,user:i.api[O].user,token:i.api[O].token.token})),localStorage.setItem("X-CURRENT-INDEX",O.toString()),localStorage.setItem("COMPANY-EDIT-OPENED","false"),sessionStorage.setItem("COMPANY-ACTIVITY-SHOWN","false"),u.invalidateQueries(),r){const F="/"+(a.pathname.includes("/settings/gateways")?"settings/online_payments":a.pathname.split("/")[1]||"dashboard");t(F)}window.location.reload()};return x.useEffect(()=>{i.api.length<10&&y(!0),bw()&&y(!1)},[p]),_?h.jsx(h.Fragment,{children:h.jsx("img",{className:"rounded-full border overflow-hidden aspect-square object-cover",src:o,alt:"Company logo",style:{borderColor:"#e5e7eb",width:"1.66rem"}})}):h.jsxs(h.Fragment,{children:[h.jsx(xRt,{isModalOpen:C,setIsModalOpen:S}),h.jsxs(jx,{as:"div",className:"relative inline-block text-left w-full","data-cy":"companyDropdown",children:[h.jsx(jx.Button,{className:"flex items-center justify-start space-x-3 w-full",children:h.jsxs("div",{className:"flex items-center space-x-3 p-1.5 rounded-md hover:bg-gray-700",children:[h.jsx("img",{className:"rounded-full border overflow-hidden aspect-square object-cover",src:o,alt:"Company logo",style:{borderColor:"#e5e7eb",width:"1.65rem"}}),h.jsx("span",{className:"text-sm text-start w-36 truncate text-gray-200",children:c}),h.jsx(DRt,{color:"#e5e7eb"})]})}),h.jsx(fb,{as:x.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:h.jsxs(jx.Items,{className:"origin-top-right absolute left-0 mt-2 rounded shadow-lg border",style:{backgroundColor:l.$1,width:"14.5rem",borderColor:l.$4},children:[h.jsx("div",{className:"border-b",style:{borderColor:l.$4},children:h.jsx(jx.Item,{children:h.jsxs("div",{className:"px-3 pb-1.5 pt-2",children:[h.jsx("p",{className:"text-xs text-gray-500",children:n("signed_in_as")}),h.jsx("p",{className:"font-medium truncate text-sm",children:g==null?void 0:g.email})]})})}),h.jsx("div",{className:"flex flex-col pb-1 pt-2 border-b",style:{borderColor:l.$4},children:((N=i==null?void 0:i.api)==null?void 0:N.length)>=1&&((P=i==null?void 0:i.api)==null?void 0:P.map((O,F)=>h.jsx(jx.Item,{children:h.jsxs("div",{className:"px-1 space-y-0.5",children:[F===0&&h.jsx("p",{className:"pl-2 text-xs text-gray-500",children:n("company")}),h.jsxs(HH,{className:"flex items-center px-2 justify-between py-1.5 rounded-md cursor-pointer",theme:{hoverColor:l.$5},onClick:()=>v({fn:()=>k(F),actionKey:"switchCompany"}),children:[h.jsxs("div",{className:"flex items-center space-x-2 flex-1",children:[h.jsx("img",{className:"rounded-full border overflow-hidden aspect-square object-cover",src:O.company.settings.company_logo||Vhe.smallLogo,alt:"Company logo",style:{borderColor:l.$5,width:"1.5rem"}}),h.jsx("div",{className:"w-36 truncate text-sm",children:O.company.settings.name||n("untitled_company")})]}),i.currentIndex===F&&h.jsx(Nwe,{color:l.$3})]})]})},F)))}),h.jsxs("div",{className:"py-1",children:[b&&s&&f&&h.jsx(jx.Item,{children:h.jsx("div",{className:"px-1",children:h.jsxs(HH,{className:"flex items-center pl-3 space-x-3 py-2 rounded-md cursor-pointer",theme:{hoverColor:l.$5},onClick:()=>S(!0),children:[h.jsx(nc,{}),h.jsx("span",{className:"text-sm",children:n("add_company")})]})})}),(d||f)&&h.jsx(jx.Item,{children:h.jsx("div",{className:"px-1",children:h.jsxs(HH,{className:"flex items-center space-x-3 pl-3 py-2 rounded-md cursor-pointer",theme:{hoverColor:l.$5},onClick:()=>v({url:"/settings/account_management"}),children:[h.jsx(RRt,{}),h.jsx("span",{className:"text-sm",children:n("account_management")})]})})}),h.jsx(jx.Item,{children:h.jsx("div",{className:"pl-1.5 pr-1",children:h.jsxs(HH,{className:"flex items-center space-x-3 pl-3 py-2 rounded-md cursor-pointer",theme:{hoverColor:l.$5},onClick:()=>v({url:"/logout"}),children:[h.jsx(PRt,{}),h.jsx("span",{className:"text-sm",children:n("logout")})]})})})]})]})})]})]})}var ORt="tippy-box",Qqe="tippy-content",MRt="tippy-backdrop",Xqe="tippy-arrow",Zqe="tippy-svg-arrow",QT={passive:!0,capture:!0},Jqe=function(){return document.body};function bre(n,e,t){if(Array.isArray(n)){var i=n[e];return i??(Array.isArray(t)?t[e]:t)}return n}function Dwe(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function eKe(n,e){return typeof n=="function"?n.apply(void 0,e):n}function SDe(n,e){if(e===0)return n;var t;return function(i){clearTimeout(t),t=setTimeout(function(){n(i)},e)}}function jRt(n){return n.split(/\s+/).filter(Boolean)}function ZD(n){return[].concat(n)}function EDe(n,e){n.indexOf(e)===-1&&n.push(e)}function FRt(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function BRt(n){return n.split("-")[0]}function xq(n){return[].slice.call(n)}function kDe(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function xF(){return document.createElement("div")}function aJ(n){return["Element","Fragment"].some(function(e){return Dwe(n,e)})}function $Rt(n){return Dwe(n,"NodeList")}function HRt(n){return Dwe(n,"MouseEvent")}function VRt(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function WRt(n){return aJ(n)?[n]:$Rt(n)?xq(n):Array.isArray(n)?n:xq(document.querySelectorAll(n))}function yre(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function TDe(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function zRt(n){var e,t=ZD(n),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function URt(n,e){var t=e.clientX,i=e.clientY;return n.every(function(r){var s=r.popperRect,o=r.popperState,a=r.props,l=a.interactiveBorder,c=BRt(o.placement),u=o.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=s.top-i+d>l,_=i-s.bottom-f>l,v=s.left-t+p>l,b=t-s.right-g>l;return m||_||v||b})}function Cre(n,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){n[i](r,t)})}function IDe(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 iy={isTouch:!1},LDe=0;function qRt(){iy.isTouch||(iy.isTouch=!0,window.performance&&document.addEventListener("mousemove",tKe))}function tKe(){var n=performance.now();n-LDe<20&&(iy.isTouch=!1,document.removeEventListener("mousemove",tKe)),LDe=n}function KRt(){var n=document.activeElement;if(VRt(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function GRt(){document.addEventListener("touchstart",qRt,QT),window.addEventListener("blur",KRt)}var YRt=typeof window<"u"&&typeof document<"u",QRt=YRt?!!window.msCrypto:!1,XRt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},ZRt={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},pb=Object.assign({appendTo:Jqe,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},XRt,ZRt),JRt=Object.keys(pb),ePt=function(e){var t=Object.keys(e);t.forEach(function(i){pb[i]=e[i]})};function nKe(n){var e=n.plugins||[],t=e.reduce(function(i,r){var s=r.name,o=r.defaultValue;if(s){var a;i[s]=n[s]!==void 0?n[s]:(a=pb[s])!=null?a:o}return i},{});return Object.assign({},n,t)}function tPt(n,e){var t=e?Object.keys(nKe(Object.assign({},pb,{plugins:e}))):JRt,i=t.reduce(function(r,s){var o=(n.getAttribute("data-tippy-"+s)||"").trim();if(!o)return r;if(s==="content")r[s]=o;else try{r[s]=JSON.parse(o)}catch{r[s]=o}return r},{});return i}function ADe(n,e){var t=Object.assign({},e,{content:eKe(e.content,[n])},e.ignoreAttributes?{}:tPt(n,e.plugins));return t.aria=Object.assign({},pb.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 nPt=function(){return"innerHTML"};function Whe(n,e){n[nPt()]=e}function NDe(n){var e=xF();return n===!0?e.className=Xqe:(e.className=Zqe,aJ(n)?e.appendChild(n):Whe(e,n)),e}function DDe(n,e){aJ(e.content)?(Whe(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Whe(n,e.content):n.textContent=e.content)}function zhe(n){var e=n.firstElementChild,t=xq(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(Qqe)}),arrow:t.find(function(i){return i.classList.contains(Xqe)||i.classList.contains(Zqe)}),backdrop:t.find(function(i){return i.classList.contains(MRt)})}}function iKe(n){var e=xF(),t=xF();t.className=ORt,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=xF();i.className=Qqe,i.setAttribute("data-state","hidden"),DDe(i,n.props),e.appendChild(t),t.appendChild(i),r(n.props,n.props);function r(s,o){var a=zhe(e),l=a.box,c=a.content,u=a.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&DDe(c,n.props),o.arrow?u?s.arrow!==o.arrow&&(l.removeChild(u),l.appendChild(NDe(o.arrow))):l.appendChild(NDe(o.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:r}}iKe.$$tippy=!0;var iPt=1,VH=[],wre=[];function rPt(n,e){var t=ADe(n,Object.assign({},pb,nKe(kDe(e)))),i,r,s,o=!1,a=!1,l=!1,c=!1,u,d,f,p=[],g=SDe(qe,t.interactiveDebounce),m,_=iPt++,v=null,b=FRt(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:_,reference:n,popper:xF(),popperInstance:v,props:t,state:y,plugins:b,clearDelayTimeouts:Oe,setProps:ce,setContent:Ne,show:Xe,hide:it,hideWithInteractivity:Tt,enable:nt,disable:at,unmount:Ct,destroy:Rt};if(!t.render)return C;var S=t.render(C),k=S.popper,I=S.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+C.id,C.popper=k,n._tippy=C,k._tippy=C;var L=b.map(function(se){return se.fn(C)}),N=n.hasAttribute("aria-expanded");return Pe(),H(),q(),U("onCreate",[C]),t.showOnCreate&&Ke(),k.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&M().addEventListener("mousemove",g)}),C;function P(){var se=C.props.touch;return Array.isArray(se)?se:[se,0]}function O(){return P()[0]==="hold"}function F(){var se;return!!((se=C.props.render)!=null&&se.$$tippy)}function V(){return m||n}function M(){var se=V().parentNode;return se?zRt(se):document}function B(){return zhe(k)}function W(se){return C.state.isMounted&&!C.state.isVisible||iy.isTouch||u&&u.type==="focus"?0:bre(C.props.delay,se?0:1,pb.delay)}function q(se){se===void 0&&(se=!1),k.style.pointerEvents=C.props.interactive&&!se?"":"none",k.style.zIndex=""+C.props.zIndex}function U(se,ke,Ae){if(Ae===void 0&&(Ae=!0),L.forEach(function(Ve){Ve[se]&&Ve[se].apply(Ve,ke)}),Ae){var je;(je=C.props)[se].apply(je,ke)}}function G(){var se=C.props.aria;if(se.content){var ke="aria-"+se.content,Ae=k.id,je=ZD(C.props.triggerTarget||n);je.forEach(function(Ve){var Qt=Ve.getAttribute(ke);if(C.state.isVisible)Ve.setAttribute(ke,Qt?Qt+" "+Ae:Ae);else{var rt=Qt&&Qt.replace(Ae,"").trim();rt?Ve.setAttribute(ke,rt):Ve.removeAttribute(ke)}})}}function H(){if(!(N||!C.props.aria.expanded)){var se=ZD(C.props.triggerTarget||n);se.forEach(function(ke){C.props.interactive?ke.setAttribute("aria-expanded",C.state.isVisible&&ke===V()?"true":"false"):ke.removeAttribute("aria-expanded")})}}function z(){M().removeEventListener("mousemove",g),VH=VH.filter(function(se){return se!==g})}function Z(se){if(!(iy.isTouch&&(l||se.type==="mousedown"))){var ke=se.composedPath&&se.composedPath()[0]||se.target;if(!(C.props.interactive&&IDe(k,ke))){if(ZD(C.props.triggerTarget||n).some(function(Ae){return IDe(Ae,ke)})){if(iy.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else U("onClickOutside",[C,se]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Se())}}}function X(){l=!0}function oe(){l=!1}function fe(){var se=M();se.addEventListener("mousedown",Z,!0),se.addEventListener("touchend",Z,QT),se.addEventListener("touchstart",oe,QT),se.addEventListener("touchmove",X,QT)}function Se(){var se=M();se.removeEventListener("mousedown",Z,!0),se.removeEventListener("touchend",Z,QT),se.removeEventListener("touchstart",oe,QT),se.removeEventListener("touchmove",X,QT)}function Me(se,ke){ge(se,function(){!C.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&ke()})}function Ie(se,ke){ge(se,ke)}function ge(se,ke){var Ae=B().box;function je(Ve){Ve.target===Ae&&(Cre(Ae,"remove",je),ke())}if(se===0)return ke();Cre(Ae,"remove",d),Cre(Ae,"add",je),d=je}function ye(se,ke,Ae){Ae===void 0&&(Ae=!1);var je=ZD(C.props.triggerTarget||n);je.forEach(function(Ve){Ve.addEventListener(se,ke,Ae),p.push({node:Ve,eventType:se,handler:ke,options:Ae})})}function Pe(){O()&&(ye("touchstart",$e,{passive:!0}),ye("touchend",mt,{passive:!0})),jRt(C.props.trigger).forEach(function(se){if(se!=="manual")switch(ye(se,$e),se){case"mouseenter":ye("mouseleave",mt);break;case"focus":ye(QRt?"focusout":"blur",vt);break;case"focusin":ye("focusout",vt);break}})}function Be(){p.forEach(function(se){var ke=se.node,Ae=se.eventType,je=se.handler,Ve=se.options;ke.removeEventListener(Ae,je,Ve)}),p=[]}function $e(se){var ke,Ae=!1;if(!(!C.state.isEnabled||ft(se)||a)){var je=((ke=u)==null?void 0:ke.type)==="focus";u=se,m=se.currentTarget,H(),!C.state.isVisible&&HRt(se)&&VH.forEach(function(Ve){return Ve(se)}),se.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?Ae=!0:Ke(se),se.type==="click"&&(o=!Ae),Ae&&!je&&dt(se)}}function qe(se){var ke=se.target,Ae=V().contains(ke)||k.contains(ke);if(!(se.type==="mousemove"&&Ae)){var je=en().concat(k).map(function(Ve){var Qt,rt=Ve._tippy,Cn=(Qt=rt.popperInstance)==null?void 0:Qt.state;return Cn?{popperRect:Ve.getBoundingClientRect(),popperState:Cn,props:t}:null}).filter(Boolean);URt(je,se)&&(z(),dt(se))}}function mt(se){var ke=ft(se)||C.props.trigger.indexOf("click")>=0&&o;if(!ke){if(C.props.interactive){C.hideWithInteractivity(se);return}dt(se)}}function vt(se){C.props.trigger.indexOf("focusin")<0&&se.target!==V()||C.props.interactive&&se.relatedTarget&&k.contains(se.relatedTarget)||dt(se)}function ft(se){return iy.isTouch?O()!==se.type.indexOf("touch")>=0:!1}function tt(){St();var se=C.props,ke=se.popperOptions,Ae=se.placement,je=se.offset,Ve=se.getReferenceClientRect,Qt=se.moveTransition,rt=F()?zhe(k).arrow:null,Cn=Ve?{getBoundingClientRect:Ve,contextElement:Ve.contextElement||V()}:n,Rn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(si){var oi=si.state;if(F()){var _n=B(),de=_n.box;["placement","reference-hidden","escaped"].forEach(function(_e){_e==="placement"?de.setAttribute("data-placement",oi.placement):oi.attributes.popper["data-popper-"+_e]?de.setAttribute("data-"+_e,""):de.removeAttribute("data-"+_e)}),oi.attributes.popper={}}}},li=[{name:"offset",options:{offset:je}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Qt}},Rn];F()&&rt&&li.push({name:"arrow",options:{element:rt,padding:3}}),li.push.apply(li,(ke==null?void 0:ke.modifiers)||[]),C.popperInstance=hUe(Cn,k,Object.assign({},ke,{placement:Ae,onFirstUpdate:f,modifiers:li}))}function St(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Ft(){var se=C.props.appendTo,ke,Ae=V();C.props.interactive&&se===Jqe||se==="parent"?ke=Ae.parentNode:ke=eKe(se,[Ae]),ke.contains(k)||ke.appendChild(k),C.state.isMounted=!0,tt()}function en(){return xq(k.querySelectorAll("[data-tippy-root]"))}function Ke(se){C.clearDelayTimeouts(),se&&U("onTrigger",[C,se]),fe();var ke=W(!0),Ae=P(),je=Ae[0],Ve=Ae[1];iy.isTouch&&je==="hold"&&Ve&&(ke=Ve),ke?i=setTimeout(function(){C.show()},ke):C.show()}function dt(se){if(C.clearDelayTimeouts(),U("onUntrigger",[C,se]),!C.state.isVisible){Se();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(se.type)>=0&&o)){var ke=W(!1);ke?r=setTimeout(function(){C.state.isVisible&&C.hide()},ke):s=requestAnimationFrame(function(){C.hide()})}}function nt(){C.state.isEnabled=!0}function at(){C.hide(),C.state.isEnabled=!1}function Oe(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(s)}function ce(se){if(!C.state.isDestroyed){U("onBeforeUpdate",[C,se]),Be();var ke=C.props,Ae=ADe(n,Object.assign({},ke,kDe(se),{ignoreAttributes:!0}));C.props=Ae,Pe(),ke.interactiveDebounce!==Ae.interactiveDebounce&&(z(),g=SDe(qe,Ae.interactiveDebounce)),ke.triggerTarget&&!Ae.triggerTarget?ZD(ke.triggerTarget).forEach(function(je){je.removeAttribute("aria-expanded")}):Ae.triggerTarget&&n.removeAttribute("aria-expanded"),H(),q(),I&&I(ke,Ae),C.popperInstance&&(tt(),en().forEach(function(je){requestAnimationFrame(je._tippy.popperInstance.forceUpdate)})),U("onAfterUpdate",[C,se])}}function Ne(se){C.setProps({content:se})}function Xe(){var se=C.state.isVisible,ke=C.state.isDestroyed,Ae=!C.state.isEnabled,je=iy.isTouch&&!C.props.touch,Ve=bre(C.props.duration,0,pb.duration);if(!(se||ke||Ae||je)&&!V().hasAttribute("disabled")&&(U("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,F()&&(k.style.visibility="visible"),q(),fe(),C.state.isMounted||(k.style.transition="none"),F()){var Qt=B(),rt=Qt.box,Cn=Qt.content;yre([rt,Cn],0)}f=function(){var li;if(!(!C.state.isVisible||c)){if(c=!0,k.offsetHeight,k.style.transition=C.props.moveTransition,F()&&C.props.animation){var Mi=B(),si=Mi.box,oi=Mi.content;yre([si,oi],Ve),TDe([si,oi],"visible")}G(),H(),EDe(wre,C),(li=C.popperInstance)==null||li.forceUpdate(),U("onMount",[C]),C.props.animation&&F()&&Ie(Ve,function(){C.state.isShown=!0,U("onShown",[C])})}},Ft()}}function it(){var se=!C.state.isVisible,ke=C.state.isDestroyed,Ae=!C.state.isEnabled,je=bre(C.props.duration,1,pb.duration);if(!(se||ke||Ae)&&(U("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,c=!1,o=!1,F()&&(k.style.visibility="hidden"),z(),Se(),q(!0),F()){var Ve=B(),Qt=Ve.box,rt=Ve.content;C.props.animation&&(yre([Qt,rt],je),TDe([Qt,rt],"hidden"))}G(),H(),C.props.animation?F()&&Me(je,C.unmount):C.unmount()}}function Tt(se){M().addEventListener("mousemove",g),EDe(VH,g),g(se)}function Ct(){C.state.isVisible&&C.hide(),C.state.isMounted&&(St(),en().forEach(function(se){se._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),wre=wre.filter(function(se){return se!==C}),C.state.isMounted=!1,U("onHidden",[C]))}function Rt(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),Be(),delete n._tippy,C.state.isDestroyed=!0,U("onDestroy",[C]))}}function r9(n,e){e===void 0&&(e={});var t=pb.plugins.concat(e.plugins||[]);GRt();var i=Object.assign({},e,{plugins:t}),r=WRt(n),s=r.reduce(function(o,a){var l=a&&rPt(a,i);return l&&o.push(l),o},[]);return aJ(n)?s[0]:s}r9.defaultProps=pb;r9.setDefaultProps=ePt;r9.currentInput=iy;Object.assign({},GCe,{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)}});r9.setDefaultProps({render:iKe});function rKe(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var sKe=typeof window<"u"&&typeof document<"u";function Uhe(n,e){n&&(typeof n=="function"&&n(e),{}.hasOwnProperty.call(n,"current")&&(n.current=e))}function RDe(){return sKe&&document.createElement("div")}function sPt(n){var e={"data-placement":n.placement};return n.referenceHidden&&(e["data-reference-hidden"]=""),n.escaped&&(e["data-escaped"]=""),e}function oKe(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(!oKe(n[t],e[t]))return!1}else return!1;return!0}else return!1}function oPt(n){var e=[];return n.forEach(function(t){e.find(function(i){return oKe(t,i)})||e.push(t)}),e}function aPt(n,e){var t,i;return Object.assign({},e,{popperOptions:Object.assign({},n.popperOptions,e.popperOptions,{modifiers:oPt([].concat(((t=n.popperOptions)==null?void 0:t.modifiers)||[],((i=e.popperOptions)==null?void 0:i.modifiers)||[]))})})}var xre=sKe?x.useLayoutEffect:x.useEffect;function lPt(n){var e=x.useRef();return e.current||(e.current=typeof n=="function"?n():n),e.current}function PDe(n,e,t){t.split(/\s+/).forEach(function(i){i&&n.classList[e](i)})}var cPt={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()||PDe(t,"add",e.props.className)}function s(){i()&&PDe(t,"remove",e.props.className)}return{onCreate:r,onBeforeUpdate:s,onAfterUpdate:r}}};function uPt(n){function e(t){var i=t.children,r=t.content,s=t.visible,o=t.singleton,a=t.render,l=t.reference,c=t.disabled,u=c===void 0?!1:c,d=t.ignoreAttributes,f=d===void 0?!0:d;t.__source,t.__self;var p=rKe(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=s!==void 0,m=o!==void 0,_=x.useState(!1),v=_[0],b=_[1],y=x.useState({}),C=y[0],S=y[1],k=x.useState(),I=k[0],L=k[1],N=lPt(function(){return{container:RDe(),renders:1}}),P=Object.assign({ignoreAttributes:f},p,{content:N.container});g&&(P.trigger="manual",P.hideOnClick=!1),m&&(u=!0);var O=P,F=P.plugins||[];a&&(O=Object.assign({},P,{plugins:m&&o.data!=null?[].concat(F,[{fn:function(){return{onTrigger:function(W,q){var U=o.data.children.find(function(G){var H=G.instance;return H.reference===q.currentTarget});W.state.$$activeSingletonInstance=U.instance,L(U.content)}}}}]):F,render:function(){return{popper:N.container}}}));var V=[l].concat(i?[i.type]:[]);return xre(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var B=n(M||N.ref||RDe(),Object.assign({},O,{plugins:[cPt].concat(P.plugins||[])}));return N.instance=B,u&&B.disable(),s&&B.show(),m&&o.hook({instance:B,content:r,props:O,setSingletonContent:L}),b(!0),function(){B.destroy(),o==null||o.cleanup(B)}},V),xre(function(){var M;if(N.renders===1){N.renders++;return}var B=N.instance;B.setProps(aPt(B.props,O)),(M=B.popperInstance)==null||M.forceUpdate(),u?B.disable():B.enable(),g&&(s?B.show():B.hide()),m&&o.hook({instance:B,content:r,props:O,setSingletonContent:L})}),xre(function(){var M;if(a){var B=N.instance;B.setProps({popperOptions:Object.assign({},B.props.popperOptions,{modifiers:[].concat((((M=B.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function(W){var q=W.name;return q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var U,G=q.state,H=(U=G.modifiersData)==null?void 0:U.hide;(C.placement!==G.placement||C.referenceHidden!==(H==null?void 0:H.isReferenceHidden)||C.escaped!==(H==null?void 0:H.hasPopperEscaped))&&S({placement:G.placement,referenceHidden:H==null?void 0:H.isReferenceHidden,escaped:H==null?void 0:H.hasPopperEscaped}),G.attributes.popper={}}}])})})}},[C.placement,C.referenceHidden,C.escaped].concat(V)),we.createElement(we.Fragment,null,i?x.cloneElement(i,{ref:function(B){N.ref=B,Uhe(i.ref,B)}}):null,v&&Bm.createPortal(a?a(sPt(C),I,N.instance):r,N.container))}return e}var dPt=function(n,e){return x.forwardRef(function(i,r){var s=i.children,o=rKe(i,["children"]);return we.createElement(n,Object.assign({},e,o),s?x.cloneElement(s,{ref:function(l){Uhe(r,l),Uhe(s.ref,l)}}):null)})},Bx=dPt(uPt(r9));/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Vm(){var e;const n=Cu(t=>t.companyUsers);return(e=n.api[n.currentIndex])==null?void 0:e.account}var hPt=function(e){return fPt(e)&&!pPt(e)};function fPt(n){return!!n&&typeof n=="object"}function pPt(n){var e=Object.prototype.toString.call(n);return e==="[object RegExp]"||e==="[object Date]"||_Pt(n)}var gPt=typeof Symbol=="function"&&Symbol.for,mPt=gPt?Symbol.for("react.element"):60103;function _Pt(n){return n.$$typeof===mPt}function vPt(n){return Array.isArray(n)?[]:{}}function Sq(n,e){return e.clone!==!1&&e.isMergeableObject(n)?g8(vPt(n),n,e):n}function bPt(n,e,t){return n.concat(e).map(function(i){return Sq(i,t)})}function yPt(n,e,t){var i={};return t.isMergeableObject(n)&&Object.keys(n).forEach(function(r){i[r]=Sq(n[r],t)}),Object.keys(e).forEach(function(r){!t.isMergeableObject(e[r])||!n[r]?i[r]=Sq(e[r],t):i[r]=g8(n[r],e[r],t)}),i}function g8(n,e,t){t=t||{},t.arrayMerge=t.arrayMerge||bPt,t.isMergeableObject=t.isMergeableObject||hPt;var i=Array.isArray(e),r=Array.isArray(n),s=i===r;return s?i?t.arrayMerge(n,e,t):yPt(n,e,t):Sq(e,t)}g8.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(i,r){return g8(i,r,t)},{})};var qhe=g8,aKe=typeof global=="object"&&global&&global.Object===Object&&global,CPt=typeof self=="object"&&self&&self.Object===Object&&self,Cg=aKe||CPt||Function("return this")(),BE=Cg.Symbol,lKe=Object.prototype,wPt=lKe.hasOwnProperty,xPt=lKe.toString,I5=BE?BE.toStringTag:void 0;function SPt(n){var e=wPt.call(n,I5),t=n[I5];try{n[I5]=void 0;var i=!0}catch{}var r=xPt.call(n);return i&&(e?n[I5]=t:delete n[I5]),r}var EPt=Object.prototype,kPt=EPt.toString;function TPt(n){return kPt.call(n)}var IPt="[object Null]",LPt="[object Undefined]",ODe=BE?BE.toStringTag:void 0;function mA(n){return n==null?n===void 0?LPt:IPt:ODe&&ODe in Object(n)?SPt(n):TPt(n)}function cKe(n,e){return function(t){return n(e(t))}}var Rwe=cKe(Object.getPrototypeOf,Object);function _k(n){return n!=null&&typeof n=="object"}var APt="[object Object]",NPt=Function.prototype,DPt=Object.prototype,uKe=NPt.toString,RPt=DPt.hasOwnProperty,PPt=uKe.call(Object);function MDe(n){if(!_k(n)||mA(n)!=APt)return!1;var e=Rwe(n);if(e===null)return!0;var t=RPt.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&uKe.call(t)==PPt}function OPt(){this.__data__=[],this.size=0}function dKe(n,e){return n===e||n!==n&&e!==e}function lJ(n,e){for(var t=n.length;t--;)if(dKe(n[t][0],e))return t;return-1}var MPt=Array.prototype,jPt=MPt.splice;function FPt(n){var e=this.__data__,t=lJ(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():jPt.call(e,t,1),--this.size,!0}function BPt(n){var e=this.__data__,t=lJ(e,n);return t<0?void 0:e[t][1]}function $Pt(n){return lJ(this.__data__,n)>-1}function HPt(n,e){var t=this.__data__,i=lJ(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function zw(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])}}zw.prototype.clear=OPt;zw.prototype.delete=FPt;zw.prototype.get=BPt;zw.prototype.has=$Pt;zw.prototype.set=HPt;function VPt(){this.__data__=new zw,this.size=0}function WPt(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function zPt(n){return this.__data__.get(n)}function UPt(n){return this.__data__.has(n)}function $E(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var qPt="[object AsyncFunction]",KPt="[object Function]",GPt="[object GeneratorFunction]",YPt="[object Proxy]";function hKe(n){if(!$E(n))return!1;var e=mA(n);return e==KPt||e==GPt||e==qPt||e==YPt}var Sre=Cg["__core-js_shared__"],jDe=function(){var n=/[^.]+$/.exec(Sre&&Sre.keys&&Sre.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function QPt(n){return!!jDe&&jDe in n}var XPt=Function.prototype,ZPt=XPt.toString;function _A(n){if(n!=null){try{return ZPt.call(n)}catch{}try{return n+""}catch{}}return""}var JPt=/[\\^$.*+?()[\]{}|]/g,eOt=/^\[object .+?Constructor\]$/,tOt=Function.prototype,nOt=Object.prototype,iOt=tOt.toString,rOt=nOt.hasOwnProperty,sOt=RegExp("^"+iOt.call(rOt).replace(JPt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oOt(n){if(!$E(n)||QPt(n))return!1;var e=hKe(n)?sOt:eOt;return e.test(_A(n))}function aOt(n,e){return n==null?void 0:n[e]}function vA(n,e){var t=aOt(n,e);return oOt(t)?t:void 0}var m8=vA(Cg,"Map"),_8=vA(Object,"create");function lOt(){this.__data__=_8?_8(null):{},this.size=0}function cOt(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var uOt="__lodash_hash_undefined__",dOt=Object.prototype,hOt=dOt.hasOwnProperty;function fOt(n){var e=this.__data__;if(_8){var t=e[n];return t===uOt?void 0:t}return hOt.call(e,n)?e[n]:void 0}var pOt=Object.prototype,gOt=pOt.hasOwnProperty;function mOt(n){var e=this.__data__;return _8?e[n]!==void 0:gOt.call(e,n)}var _Ot="__lodash_hash_undefined__";function vOt(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=_8&&e===void 0?_Ot:e,this}function wL(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])}}wL.prototype.clear=lOt;wL.prototype.delete=cOt;wL.prototype.get=fOt;wL.prototype.has=mOt;wL.prototype.set=vOt;function bOt(){this.size=0,this.__data__={hash:new wL,map:new(m8||zw),string:new wL}}function yOt(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function cJ(n,e){var t=n.__data__;return yOt(e)?t[typeof e=="string"?"string":"hash"]:t.map}function COt(n){var e=cJ(this,n).delete(n);return this.size-=e?1:0,e}function wOt(n){return cJ(this,n).get(n)}function xOt(n){return cJ(this,n).has(n)}function SOt(n,e){var t=cJ(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function vk(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])}}vk.prototype.clear=bOt;vk.prototype.delete=COt;vk.prototype.get=wOt;vk.prototype.has=xOt;vk.prototype.set=SOt;var EOt=200;function kOt(n,e){var t=this.__data__;if(t instanceof zw){var i=t.__data__;if(!m8||i.length<EOt-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new vk(i)}return t.set(n,e),this.size=t.size,this}function o4(n){var e=this.__data__=new zw(n);this.size=e.size}o4.prototype.clear=VPt;o4.prototype.delete=WPt;o4.prototype.get=zPt;o4.prototype.has=UPt;o4.prototype.set=kOt;function fKe(n,e){for(var t=-1,i=n==null?0:n.length;++t<i&&e(n[t],t,n)!==!1;);return n}var Eq=function(){try{var n=vA(Object,"defineProperty");return n({},"",{}),n}catch{}}();function pKe(n,e,t){e=="__proto__"&&Eq?Eq(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}var TOt=Object.prototype,IOt=TOt.hasOwnProperty;function gKe(n,e,t){var i=n[e];(!(IOt.call(n,e)&&dKe(i,t))||t===void 0&&!(e in n))&&pKe(n,e,t)}function uJ(n,e,t,i){var r=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=void 0;l===void 0&&(l=n[a]),r?pKe(t,a,l):gKe(t,a,l)}return t}function LOt(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var AOt="[object Arguments]";function FDe(n){return _k(n)&&mA(n)==AOt}var mKe=Object.prototype,NOt=mKe.hasOwnProperty,DOt=mKe.propertyIsEnumerable,ROt=FDe(function(){return arguments}())?FDe:function(n){return _k(n)&&NOt.call(n,"callee")&&!DOt.call(n,"callee")},a4=Array.isArray;function POt(){return!1}var _Ke=typeof exports=="object"&&exports&&!exports.nodeType&&exports,BDe=_Ke&&typeof module=="object"&&module&&!module.nodeType&&module,OOt=BDe&&BDe.exports===_Ke,$De=OOt?Cg.Buffer:void 0,MOt=$De?$De.isBuffer:void 0,vKe=MOt||POt,jOt=9007199254740991,FOt=/^(?:0|[1-9]\d*)$/;function bKe(n,e){var t=typeof n;return e=e??jOt,!!e&&(t=="number"||t!="symbol"&&FOt.test(n))&&n>-1&&n%1==0&&n<e}var BOt=9007199254740991;function yKe(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=BOt}var $Ot="[object Arguments]",HOt="[object Array]",VOt="[object Boolean]",WOt="[object Date]",zOt="[object Error]",UOt="[object Function]",qOt="[object Map]",KOt="[object Number]",GOt="[object Object]",YOt="[object RegExp]",QOt="[object Set]",XOt="[object String]",ZOt="[object WeakMap]",JOt="[object ArrayBuffer]",eMt="[object DataView]",tMt="[object Float32Array]",nMt="[object Float64Array]",iMt="[object Int8Array]",rMt="[object Int16Array]",sMt="[object Int32Array]",oMt="[object Uint8Array]",aMt="[object Uint8ClampedArray]",lMt="[object Uint16Array]",cMt="[object Uint32Array]",tc={};tc[tMt]=tc[nMt]=tc[iMt]=tc[rMt]=tc[sMt]=tc[oMt]=tc[aMt]=tc[lMt]=tc[cMt]=!0;tc[$Ot]=tc[HOt]=tc[JOt]=tc[VOt]=tc[eMt]=tc[WOt]=tc[zOt]=tc[UOt]=tc[qOt]=tc[KOt]=tc[GOt]=tc[YOt]=tc[QOt]=tc[XOt]=tc[ZOt]=!1;function uMt(n){return _k(n)&&yKe(n.length)&&!!tc[mA(n)]}function Pwe(n){return function(e){return n(e)}}var CKe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,SF=CKe&&typeof module=="object"&&module&&!module.nodeType&&module,dMt=SF&&SF.exports===CKe,Ere=dMt&&aKe.process,TO=function(){try{var n=SF&&SF.require&&SF.require("util").types;return n||Ere&&Ere.binding&&Ere.binding("util")}catch{}}(),HDe=TO&&TO.isTypedArray,hMt=HDe?Pwe(HDe):uMt,fMt=Object.prototype,pMt=fMt.hasOwnProperty;function wKe(n,e){var t=a4(n),i=!t&&ROt(n),r=!t&&!i&&vKe(n),s=!t&&!i&&!r&&hMt(n),o=t||i||r||s,a=o?LOt(n.length,String):[],l=a.length;for(var c in n)(e||pMt.call(n,c))&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||bKe(c,l)))&&a.push(c);return a}var gMt=Object.prototype;function Owe(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||gMt;return n===t}var mMt=cKe(Object.keys,Object),_Mt=Object.prototype,vMt=_Mt.hasOwnProperty;function bMt(n){if(!Owe(n))return mMt(n);var e=[];for(var t in Object(n))vMt.call(n,t)&&t!="constructor"&&e.push(t);return e}function xKe(n){return n!=null&&yKe(n.length)&&!hKe(n)}function Mwe(n){return xKe(n)?wKe(n):bMt(n)}function yMt(n,e){return n&&uJ(e,Mwe(e),n)}function CMt(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var wMt=Object.prototype,xMt=wMt.hasOwnProperty;function SMt(n){if(!$E(n))return CMt(n);var e=Owe(n),t=[];for(var i in n)i=="constructor"&&(e||!xMt.call(n,i))||t.push(i);return t}function jwe(n){return xKe(n)?wKe(n,!0):SMt(n)}function EMt(n,e){return n&&uJ(e,jwe(e),n)}var SKe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,VDe=SKe&&typeof module=="object"&&module&&!module.nodeType&&module,kMt=VDe&&VDe.exports===SKe,WDe=kMt?Cg.Buffer:void 0,zDe=WDe?WDe.allocUnsafe:void 0;function TMt(n,e){if(e)return n.slice();var t=n.length,i=zDe?zDe(t):new n.constructor(t);return n.copy(i),i}function dJ(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}function IMt(n,e){for(var t=-1,i=n==null?0:n.length,r=0,s=[];++t<i;){var o=n[t];e(o,t,n)&&(s[r++]=o)}return s}function EKe(){return[]}var LMt=Object.prototype,AMt=LMt.propertyIsEnumerable,UDe=Object.getOwnPropertySymbols,Fwe=UDe?function(n){return n==null?[]:(n=Object(n),IMt(UDe(n),function(e){return AMt.call(n,e)}))}:EKe;function NMt(n,e){return uJ(n,Fwe(n),e)}function kKe(n,e){for(var t=-1,i=e.length,r=n.length;++t<i;)n[r+t]=e[t];return n}var DMt=Object.getOwnPropertySymbols,TKe=DMt?function(n){for(var e=[];n;)kKe(e,Fwe(n)),n=Rwe(n);return e}:EKe;function RMt(n,e){return uJ(n,TKe(n),e)}function IKe(n,e,t){var i=e(n);return a4(n)?i:kKe(i,t(n))}function PMt(n){return IKe(n,Mwe,Fwe)}function OMt(n){return IKe(n,jwe,TKe)}var Khe=vA(Cg,"DataView"),Ghe=vA(Cg,"Promise"),Yhe=vA(Cg,"Set"),v8=vA(Cg,"WeakMap"),qDe="[object Map]",MMt="[object Object]",KDe="[object Promise]",GDe="[object Set]",YDe="[object WeakMap]",QDe="[object DataView]",jMt=_A(Khe),FMt=_A(m8),BMt=_A(Ghe),$Mt=_A(Yhe),HMt=_A(v8),EC=mA;(Khe&&EC(new Khe(new ArrayBuffer(1)))!=QDe||m8&&EC(new m8)!=qDe||Ghe&&EC(Ghe.resolve())!=KDe||Yhe&&EC(new Yhe)!=GDe||v8&&EC(new v8)!=YDe)&&(EC=function(n){var e=mA(n),t=e==MMt?n.constructor:void 0,i=t?_A(t):"";if(i)switch(i){case jMt:return QDe;case FMt:return qDe;case BMt:return KDe;case $Mt:return GDe;case HMt:return YDe}return e});var VMt=Object.prototype,WMt=VMt.hasOwnProperty;function zMt(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&WMt.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var XDe=Cg.Uint8Array;function Bwe(n){var e=new n.constructor(n.byteLength);return new XDe(e).set(new XDe(n)),e}function UMt(n,e){var t=e?Bwe(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var qMt=/\w*$/;function KMt(n){var e=new n.constructor(n.source,qMt.exec(n));return e.lastIndex=n.lastIndex,e}var ZDe=BE?BE.prototype:void 0,JDe=ZDe?ZDe.valueOf:void 0;function GMt(n){return JDe?Object(JDe.call(n)):{}}function YMt(n,e){var t=e?Bwe(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var QMt="[object Boolean]",XMt="[object Date]",ZMt="[object Map]",JMt="[object Number]",e4t="[object RegExp]",t4t="[object Set]",n4t="[object String]",i4t="[object Symbol]",r4t="[object ArrayBuffer]",s4t="[object DataView]",o4t="[object Float32Array]",a4t="[object Float64Array]",l4t="[object Int8Array]",c4t="[object Int16Array]",u4t="[object Int32Array]",d4t="[object Uint8Array]",h4t="[object Uint8ClampedArray]",f4t="[object Uint16Array]",p4t="[object Uint32Array]";function g4t(n,e,t){var i=n.constructor;switch(e){case r4t:return Bwe(n);case QMt:case XMt:return new i(+n);case s4t:return UMt(n,t);case o4t:case a4t:case l4t:case c4t:case u4t:case d4t:case h4t:case f4t:case p4t:return YMt(n,t);case ZMt:return new i;case JMt:case n4t:return new i(n);case e4t:return KMt(n);case t4t:return new i;case i4t:return GMt(n)}}var eRe=Object.create,hJ=function(){function n(){}return function(e){if(!$E(e))return{};if(eRe)return eRe(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function m4t(n){return typeof n.constructor=="function"&&!Owe(n)?hJ(Rwe(n)):{}}var _4t="[object Map]";function v4t(n){return _k(n)&&EC(n)==_4t}var tRe=TO&&TO.isMap,b4t=tRe?Pwe(tRe):v4t,y4t="[object Set]";function C4t(n){return _k(n)&&EC(n)==y4t}var nRe=TO&&TO.isSet,w4t=nRe?Pwe(nRe):C4t,x4t=1,S4t=2,E4t=4,LKe="[object Arguments]",k4t="[object Array]",T4t="[object Boolean]",I4t="[object Date]",L4t="[object Error]",AKe="[object Function]",A4t="[object GeneratorFunction]",N4t="[object Map]",D4t="[object Number]",NKe="[object Object]",R4t="[object RegExp]",P4t="[object Set]",O4t="[object String]",M4t="[object Symbol]",j4t="[object WeakMap]",F4t="[object ArrayBuffer]",B4t="[object DataView]",$4t="[object Float32Array]",H4t="[object Float64Array]",V4t="[object Int8Array]",W4t="[object Int16Array]",z4t="[object Int32Array]",U4t="[object Uint8Array]",q4t="[object Uint8ClampedArray]",K4t="[object Uint16Array]",G4t="[object Uint32Array]",Hl={};Hl[LKe]=Hl[k4t]=Hl[F4t]=Hl[B4t]=Hl[T4t]=Hl[I4t]=Hl[$4t]=Hl[H4t]=Hl[V4t]=Hl[W4t]=Hl[z4t]=Hl[N4t]=Hl[D4t]=Hl[NKe]=Hl[R4t]=Hl[P4t]=Hl[O4t]=Hl[M4t]=Hl[U4t]=Hl[q4t]=Hl[K4t]=Hl[G4t]=!0;Hl[L4t]=Hl[AKe]=Hl[j4t]=!1;function EF(n,e,t,i,r,s){var o,a=e&x4t,l=e&S4t,c=e&E4t;if(o!==void 0)return o;if(!$E(n))return n;var u=a4(n);if(u){if(o=zMt(n),!a)return dJ(n,o)}else{var d=EC(n),f=d==AKe||d==A4t;if(vKe(n))return TMt(n,a);if(d==NKe||d==LKe||f&&!r){if(o=l||f?{}:m4t(n),!a)return l?RMt(n,EMt(o,n)):NMt(n,yMt(o,n))}else{if(!Hl[d])return r?n:{};o=g4t(n,d,a)}}s||(s=new o4);var p=s.get(n);if(p)return p;s.set(n,o),w4t(n)?n.forEach(function(_){o.add(EF(_,e,t,_,n,s))}):b4t(n)&&n.forEach(function(_,v){o.set(v,EF(_,e,t,v,n,s))});var g=c?l?OMt:PMt:l?jwe:Mwe,m=u?void 0:g(n);return fKe(m||n,function(_,v){m&&(v=_,_=n[v]),gKe(o,v,EF(_,e,t,v,n,s))}),o}var Y4t=1,Q4t=4;function WH(n){return EF(n,Y4t|Q4t)}var kre,iRe;function X4t(){if(iRe)return kre;iRe=1;var n=Array.isArray,e=Object.keys,t=Object.prototype.hasOwnProperty,i=typeof Element<"u";function r(s,o){if(s===o)return!0;if(s&&o&&typeof s=="object"&&typeof o=="object"){var a=n(s),l=n(o),c,u,d;if(a&&l){if(u=s.length,u!=o.length)return!1;for(c=u;c--!==0;)if(!r(s[c],o[c]))return!1;return!0}if(a!=l)return!1;var f=s instanceof Date,p=o instanceof Date;if(f!=p)return!1;if(f&&p)return s.getTime()==o.getTime();var g=s instanceof RegExp,m=o instanceof RegExp;if(g!=m)return!1;if(g&&m)return s.toString()==o.toString();var _=e(s);if(u=_.length,u!==e(o).length)return!1;for(c=u;c--!==0;)if(!t.call(o,_[c]))return!1;if(i&&s instanceof Element&&o instanceof Element)return s===o;for(c=u;c--!==0;)if(d=_[c],!(d==="_owner"&&s.$$typeof)&&!r(s[d],o[d]))return!1;return!0}return s!==s&&o!==o}return kre=function(o,a){try{return r(o,a)}catch(l){if(l.message&&l.message.match(/stack|recursion/i)||l.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",l.name,l.message),!1;throw l}},kre}var Z4t=X4t();const XT=Cl(Z4t);var J4t=4;function rRe(n){return EF(n,J4t)}function DKe(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 e3t="[object Symbol]";function fJ(n){return typeof n=="symbol"||_k(n)&&mA(n)==e3t}var t3t="Expected a function";function $we(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(t3t);var t=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=t.cache;if(s.has(r))return s.get(r);var o=n.apply(this,i);return t.cache=s.set(r,o)||s,o};return t.cache=new($we.Cache||vk),t}$we.Cache=vk;var n3t=500;function i3t(n){var e=$we(n,function(i){return t.size===n3t&&t.clear(),i}),t=e.cache;return e}var r3t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s3t=/\\(\\)?/g,o3t=i3t(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(r3t,function(t,i,r,s){e.push(r?s.replace(s3t,"$1"):i||t)}),e});function a3t(n){if(typeof n=="string"||fJ(n))return n;var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}var sRe=BE?BE.prototype:void 0,oRe=sRe?sRe.toString:void 0;function RKe(n){if(typeof n=="string")return n;if(a4(n))return DKe(n,RKe)+"";if(fJ(n))return oRe?oRe.call(n):"";var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function l3t(n){return n==null?"":RKe(n)}function PKe(n){return a4(n)?DKe(n,a3t):fJ(n)?[n]:dJ(o3t(l3t(n)))}function Od(){return Od=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},Od.apply(this,arguments)}function OKe(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var pJ=x.createContext(void 0);pJ.displayName="FormikContext";pJ.Provider;pJ.Consumer;function c3t(){var n=x.useContext(pJ);return n}var Bv=function(e){return typeof e=="function"},gJ=function(e){return e!==null&&typeof e=="object"},u3t=function(e){return String(Math.floor(Number(e)))===e},Tre=function(e){return Object.prototype.toString.call(e)==="[object String]"},Ire=function(e){return gJ(e)&&Bv(e.then)};function Yg(n,e,t,i){i===void 0&&(i=0);for(var r=PKe(e);n&&i<r.length;)n=n[r[i++]];return i!==r.length&&!n||n===void 0?t:n}function rI(n,e,t){for(var i=rRe(n),r=i,s=0,o=PKe(e);s<o.length-1;s++){var a=o[s],l=Yg(n,o.slice(0,s+1));if(l&&(gJ(l)||Array.isArray(l)))r=r[a]=rRe(l);else{var c=o[s+1];r=r[a]=u3t(c)&&Number(c)>=0?[]:{}}}return(s===0?n:r)[o[s]]===t?n:(t===void 0?delete r[o[s]]:r[o[s]]=t,s===0&&t===void 0&&delete i[o[s]],i)}function MKe(n,e,t,i){t===void 0&&(t=new WeakMap),i===void 0&&(i={});for(var r=0,s=Object.keys(n);r<s.length;r++){var o=s[r],a=n[o];gJ(a)?t.get(a)||(t.set(a,!0),i[o]=Array.isArray(a)?[]:{},MKe(a,e,t,i[o])):i[o]=e}return i}function d3t(n,e){switch(e.type){case"SET_VALUES":return Od({},n,{values:e.payload});case"SET_TOUCHED":return Od({},n,{touched:e.payload});case"SET_ERRORS":return XT(n.errors,e.payload)?n:Od({},n,{errors:e.payload});case"SET_STATUS":return Od({},n,{status:e.payload});case"SET_ISSUBMITTING":return Od({},n,{isSubmitting:e.payload});case"SET_ISVALIDATING":return Od({},n,{isValidating:e.payload});case"SET_FIELD_VALUE":return Od({},n,{values:rI(n.values,e.payload.field,e.payload.value)});case"SET_FIELD_TOUCHED":return Od({},n,{touched:rI(n.touched,e.payload.field,e.payload.value)});case"SET_FIELD_ERROR":return Od({},n,{errors:rI(n.errors,e.payload.field,e.payload.value)});case"RESET_FORM":return Od({},n,e.payload);case"SET_FORMIK_STATE":return e.payload(n);case"SUBMIT_ATTEMPT":return Od({},n,{touched:MKe(n.values,!0),isSubmitting:!0,submitCount:n.submitCount+1});case"SUBMIT_FAILURE":return Od({},n,{isSubmitting:!1});case"SUBMIT_SUCCESS":return Od({},n,{isSubmitting:!1});default:return n}}var RT={},zH={};function fd(n){var e=n.validateOnChange,t=e===void 0?!0:e,i=n.validateOnBlur,r=i===void 0?!0:i,s=n.validateOnMount,o=s===void 0?!1:s,a=n.isInitialValid,l=n.enableReinitialize,c=l===void 0?!1:l,u=n.onSubmit,d=OKe(n,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),f=Od({validateOnChange:t,validateOnBlur:r,validateOnMount:o,onSubmit:u},d),p=x.useRef(f.initialValues),g=x.useRef(f.initialErrors||RT),m=x.useRef(f.initialTouched||zH),_=x.useRef(f.initialStatus),v=x.useRef(!1),b=x.useRef({});x.useEffect(function(){return v.current=!0,function(){v.current=!1}},[]);var y=x.useState(0),C=y[1],S=x.useRef({values:WH(f.initialValues),errors:WH(f.initialErrors)||RT,touched:WH(f.initialTouched)||zH,status:WH(f.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),k=S.current,I=x.useCallback(function(Ke){var dt=S.current;S.current=d3t(dt,Ke),dt!==S.current&&C(function(nt){return nt+1})},[]),L=x.useCallback(function(Ke,dt){return new Promise(function(nt,at){var Oe=f.validate(Ke,dt);Oe==null?nt(RT):Ire(Oe)?Oe.then(function(ce){nt(ce||RT)},function(ce){at(ce)}):nt(Oe)})},[f.validate]),N=x.useCallback(function(Ke,dt){var nt=f.validationSchema,at=Bv(nt)?nt(dt):nt,Oe=dt&&at.validateAt?at.validateAt(dt,Ke):f3t(Ke,at);return new Promise(function(ce,Ne){Oe.then(function(){ce(RT)},function(Xe){Xe.name==="ValidationError"?ce(h3t(Xe)):Ne(Xe)})})},[f.validationSchema]),P=x.useCallback(function(Ke,dt){return new Promise(function(nt){return nt(b.current[Ke].validate(dt))})},[]),O=x.useCallback(function(Ke){var dt=Object.keys(b.current).filter(function(at){return Bv(b.current[at].validate)}),nt=dt.length>0?dt.map(function(at){return P(at,Yg(Ke,at))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(nt).then(function(at){return at.reduce(function(Oe,ce,Ne){return ce==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||ce&&(Oe=rI(Oe,dt[Ne],ce)),Oe},{})})},[P]),F=x.useCallback(function(Ke){return Promise.all([O(Ke),f.validationSchema?N(Ke):{},f.validate?L(Ke):{}]).then(function(dt){var nt=dt[0],at=dt[1],Oe=dt[2],ce=qhe.all([nt,at,Oe],{arrayMerge:p3t});return ce})},[f.validate,f.validationSchema,O,L,N]),V=g_(function(Ke){return Ke===void 0&&(Ke=k.values),I({type:"SET_ISVALIDATING",payload:!0}),F(Ke).then(function(dt){return v.current&&(I({type:"SET_ISVALIDATING",payload:!1}),I({type:"SET_ERRORS",payload:dt})),dt})});x.useEffect(function(){o&&v.current===!0&&XT(p.current,f.initialValues)&&V(p.current)},[o,V]);var M=x.useCallback(function(Ke){var dt=Ke&&Ke.values?Ke.values:p.current,nt=Ke&&Ke.errors?Ke.errors:g.current?g.current:f.initialErrors||{},at=Ke&&Ke.touched?Ke.touched:m.current?m.current:f.initialTouched||{},Oe=Ke&&Ke.status?Ke.status:_.current?_.current:f.initialStatus;p.current=dt,g.current=nt,m.current=at,_.current=Oe;var ce=function(){I({type:"RESET_FORM",payload:{isSubmitting:!!Ke&&!!Ke.isSubmitting,errors:nt,touched:at,status:Oe,values:dt,isValidating:!!Ke&&!!Ke.isValidating,submitCount:Ke&&Ke.submitCount&&typeof Ke.submitCount=="number"?Ke.submitCount:0}})};if(f.onReset){var Ne=f.onReset(k.values,$e);Ire(Ne)?Ne.then(ce):ce()}else ce()},[f.initialErrors,f.initialStatus,f.initialTouched,f.onReset]);x.useEffect(function(){v.current===!0&&!XT(p.current,f.initialValues)&&c&&(p.current=f.initialValues,M(),o&&V(p.current))},[c,f.initialValues,M,o,V]),x.useEffect(function(){c&&v.current===!0&&!XT(g.current,f.initialErrors)&&(g.current=f.initialErrors||RT,I({type:"SET_ERRORS",payload:f.initialErrors||RT}))},[c,f.initialErrors]),x.useEffect(function(){c&&v.current===!0&&!XT(m.current,f.initialTouched)&&(m.current=f.initialTouched||zH,I({type:"SET_TOUCHED",payload:f.initialTouched||zH}))},[c,f.initialTouched]),x.useEffect(function(){c&&v.current===!0&&!XT(_.current,f.initialStatus)&&(_.current=f.initialStatus,I({type:"SET_STATUS",payload:f.initialStatus}))},[c,f.initialStatus,f.initialTouched]);var B=g_(function(Ke){if(b.current[Ke]&&Bv(b.current[Ke].validate)){var dt=Yg(k.values,Ke),nt=b.current[Ke].validate(dt);return Ire(nt)?(I({type:"SET_ISVALIDATING",payload:!0}),nt.then(function(at){return at}).then(function(at){I({type:"SET_FIELD_ERROR",payload:{field:Ke,value:at}}),I({type:"SET_ISVALIDATING",payload:!1})})):(I({type:"SET_FIELD_ERROR",payload:{field:Ke,value:nt}}),Promise.resolve(nt))}else if(f.validationSchema)return I({type:"SET_ISVALIDATING",payload:!0}),N(k.values,Ke).then(function(at){return at}).then(function(at){I({type:"SET_FIELD_ERROR",payload:{field:Ke,value:Yg(at,Ke)}}),I({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),W=x.useCallback(function(Ke,dt){var nt=dt.validate;b.current[Ke]={validate:nt}},[]),q=x.useCallback(function(Ke){delete b.current[Ke]},[]),U=g_(function(Ke,dt){I({type:"SET_TOUCHED",payload:Ke});var nt=dt===void 0?r:dt;return nt?V(k.values):Promise.resolve()}),G=x.useCallback(function(Ke){I({type:"SET_ERRORS",payload:Ke})},[]),H=g_(function(Ke,dt){var nt=Bv(Ke)?Ke(k.values):Ke;I({type:"SET_VALUES",payload:nt});var at=dt===void 0?t:dt;return at?V(nt):Promise.resolve()}),z=x.useCallback(function(Ke,dt){I({type:"SET_FIELD_ERROR",payload:{field:Ke,value:dt}})},[]),Z=g_(function(Ke,dt,nt){I({type:"SET_FIELD_VALUE",payload:{field:Ke,value:dt}});var at=nt===void 0?t:nt;return at?V(rI(k.values,Ke,dt)):Promise.resolve()}),X=x.useCallback(function(Ke,dt){var nt=dt,at=Ke,Oe;if(!Tre(Ke)){Ke.persist&&Ke.persist();var ce=Ke.target?Ke.target:Ke.currentTarget,Ne=ce.type,Xe=ce.name,it=ce.id,Tt=ce.value,Ct=ce.checked;ce.outerHTML;var Rt=ce.options,se=ce.multiple;nt=dt||Xe||it,at=/number|range/.test(Ne)?(Oe=parseFloat(Tt),isNaN(Oe)?"":Oe):/checkbox/.test(Ne)?m3t(Yg(k.values,nt),Ct,Tt):Rt&&se?g3t(Rt):Tt}nt&&Z(nt,at)},[Z,k.values]),oe=g_(function(Ke){if(Tre(Ke))return function(dt){return X(dt,Ke)};X(Ke)}),fe=g_(function(Ke,dt,nt){dt===void 0&&(dt=!0),I({type:"SET_FIELD_TOUCHED",payload:{field:Ke,value:dt}});var at=nt===void 0?r:nt;return at?V(k.values):Promise.resolve()}),Se=x.useCallback(function(Ke,dt){Ke.persist&&Ke.persist();var nt=Ke.target,at=nt.name,Oe=nt.id;nt.outerHTML;var ce=dt||at||Oe;fe(ce,!0)},[fe]),Me=g_(function(Ke){if(Tre(Ke))return function(dt){return Se(dt,Ke)};Se(Ke)}),Ie=x.useCallback(function(Ke){Bv(Ke)?I({type:"SET_FORMIK_STATE",payload:Ke}):I({type:"SET_FORMIK_STATE",payload:function(){return Ke}})},[]),ge=x.useCallback(function(Ke){I({type:"SET_STATUS",payload:Ke})},[]),ye=x.useCallback(function(Ke){I({type:"SET_ISSUBMITTING",payload:Ke})},[]),Pe=g_(function(){return I({type:"SUBMIT_ATTEMPT"}),V().then(function(Ke){var dt=Ke instanceof Error,nt=!dt&&Object.keys(Ke).length===0;if(nt){var at;try{if(at=qe(),at===void 0)return}catch(Oe){throw Oe}return Promise.resolve(at).then(function(Oe){return v.current&&I({type:"SUBMIT_SUCCESS"}),Oe}).catch(function(Oe){if(v.current)throw I({type:"SUBMIT_FAILURE"}),Oe})}else if(v.current&&(I({type:"SUBMIT_FAILURE"}),dt))throw Ke})}),Be=g_(function(Ke){Ke&&Ke.preventDefault&&Bv(Ke.preventDefault)&&Ke.preventDefault(),Ke&&Ke.stopPropagation&&Bv(Ke.stopPropagation)&&Ke.stopPropagation(),Pe().catch(function(dt){console.warn("Warning: An unhandled error was caught from submitForm()",dt)})}),$e={resetForm:M,validateForm:V,validateField:B,setErrors:G,setFieldError:z,setFieldTouched:fe,setFieldValue:Z,setStatus:ge,setSubmitting:ye,setTouched:U,setValues:H,setFormikState:Ie,submitForm:Pe},qe=g_(function(){return u(k.values,$e)}),mt=g_(function(Ke){Ke&&Ke.preventDefault&&Bv(Ke.preventDefault)&&Ke.preventDefault(),Ke&&Ke.stopPropagation&&Bv(Ke.stopPropagation)&&Ke.stopPropagation(),M()}),vt=x.useCallback(function(Ke){return{value:Yg(k.values,Ke),error:Yg(k.errors,Ke),touched:!!Yg(k.touched,Ke),initialValue:Yg(p.current,Ke),initialTouched:!!Yg(m.current,Ke),initialError:Yg(g.current,Ke)}},[k.errors,k.touched,k.values]),ft=x.useCallback(function(Ke){return{setValue:function(nt,at){return Z(Ke,nt,at)},setTouched:function(nt,at){return fe(Ke,nt,at)},setError:function(nt){return z(Ke,nt)}}},[Z,fe,z]),tt=x.useCallback(function(Ke){var dt=gJ(Ke),nt=dt?Ke.name:Ke,at=Yg(k.values,nt),Oe={name:nt,value:at,onChange:oe,onBlur:Me};if(dt){var ce=Ke.type,Ne=Ke.value,Xe=Ke.as,it=Ke.multiple;ce==="checkbox"?Ne===void 0?Oe.checked=!!at:(Oe.checked=!!(Array.isArray(at)&&~at.indexOf(Ne)),Oe.value=Ne):ce==="radio"?(Oe.checked=at===Ne,Oe.value=Ne):Xe==="select"&&it&&(Oe.value=Oe.value||[],Oe.multiple=!0)}return Oe},[Me,oe,k.values]),St=x.useMemo(function(){return!XT(p.current,k.values)},[p.current,k.values]),Ft=x.useMemo(function(){return typeof a<"u"?St?k.errors&&Object.keys(k.errors).length===0:a!==!1&&Bv(a)?a(f):a:k.errors&&Object.keys(k.errors).length===0},[a,St,k.errors,f]),en=Od({},k,{initialValues:p.current,initialErrors:g.current,initialTouched:m.current,initialStatus:_.current,handleBlur:Me,handleChange:oe,handleReset:mt,handleSubmit:Be,resetForm:M,setErrors:G,setFormikState:Ie,setFieldTouched:fe,setFieldValue:Z,setFieldError:z,setStatus:ge,setSubmitting:ye,setTouched:U,setValues:H,submitForm:Pe,validateForm:V,validateField:B,isValid:Ft,dirty:St,unregisterField:q,registerField:W,getFieldProps:tt,getFieldMeta:vt,getFieldHelpers:ft,validateOnBlur:r,validateOnChange:t,validateOnMount:o});return en}function h3t(n){var e={};if(n.inner){if(n.inner.length===0)return rI(e,n.path,n.message);for(var r=n.inner,t=Array.isArray(r),i=0,r=t?r:r[Symbol.iterator]();;){var s;if(t){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var o=s;Yg(e,o.path)||(e=rI(e,o.path,o.message))}}return e}function f3t(n,e,t,i){t===void 0&&(t=!1);var r=Qhe(n);return e[t?"validateSync":"validate"](r,{abortEarly:!1,context:r})}function Qhe(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||MDe(r)?Qhe(r):r!==""?r:void 0}):MDe(n[i])?e[i]=Qhe(n[i]):e[i]=n[i]!==""?n[i]:void 0}return e}function p3t(n,e,t){var i=n.slice();return e.forEach(function(s,o){if(typeof i[o]>"u"){var a=t.clone!==!1,l=a&&t.isMergeableObject(s);i[o]=l?qhe(Array.isArray(s)?[]:{},s,t):s}else t.isMergeableObject(s)?i[o]=qhe(n[o],s,t):n.indexOf(s)===-1&&i.push(s)}),i}function g3t(n){return Array.from(n).filter(function(e){return e.selected}).map(function(e){return e.value})}function m3t(n,e,t){if(typeof n=="boolean")return!!e;var i=[],r=!1,s=-1;if(Array.isArray(n))i=n,s=n.indexOf(t),r=s>=0;else if(!t||t=="true"||t=="false")return!!e;return e&&t&&!r?i.concat(t):r?i.slice(0,s).concat(i.slice(s+1)):i}var _3t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?x.useLayoutEffect:x.useEffect;function g_(n){var e=x.useRef(n);return _3t(function(){e.current=n}),x.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 v3t=x.forwardRef(function(n,e){var t=n.action,i=OKe(n,["action"]),r=t??"#",s=c3t(),o=s.handleReset,a=s.handleSubmit;return x.createElement("form",Od({onSubmit:a,ref:e,onReset:o,action:r},i))});v3t.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 */const Hwe=Ls(!1);function wg(n){const[e]=xe(),t=Yi(),i=gc(),r=x.useRef(null),[s,o]=x.useState(""),[a,l]=x.useState(n.show??!1),c=ji(Hwe);x.useEffect(()=>{l(n.show)},[n.show]);const u=d=>{d==null||d.preventDefault(),n.onSave(s,!!s),o(""),n.onClose(!1)};return x.useEffect(()=>{a&&!c&&u()},[a]),h.jsxs(pr,{onClose:()=>{i.pathname.startsWith("/settings/users")&&!n.tableActions?t("/settings/users"):n.onClose(!1),o("")},visible:a&&c,title:e("confirmation"),text:e("please_enter_your_password"),initialFocusRef:r,children:[h.jsx("form",{onSubmit:d=>u(d),children:h.jsx(lt,{innerRef:r,id:"current_password",type:"password",label:e("current_password"),required:!0,changeOverride:!0,value:s,onChange:d=>o(d.target.value)})}),h.jsx(dn,{disabled:s.length===0,onClick:d=>u(d),disableWithoutIcon:!0,children:e("continue")})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Wm(){const n=ts(Hwe);return e=>{e?pe.error("password_error_incorrect"):pe.dismiss(),n(!0)}}const Lre=As.div` background-color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function b3t(n){const[e]=xe(),t=Ml(),i=Fr(),r=xt(),s=Wm(),{isAboutVisible:o,setIsAboutVisible:a,currentSystemInfo:l,latestVersion:c}=n,[u,d]=x.useState(!1),[f,p]=x.useState(!1),[g,m]=x.useState(!1),[_,v]=x.useState(!1),[b,y]=x.useState(!1),[C,S]=x.useState(l),k=N=>{(!u||N)&&(pe.processing(),d(!0),Je("GET",ze("/api/v1/health_check")).then(P=>{S(P.data),p(!0),pe.dismiss()}).finally(()=>d(!1)))},I=()=>{u||(pe.processing(),d(!0),Je("GET",ze("/api/v1/ping?clear_cache=true")).then(()=>{Je("POST",ze("/api/v1/refresh?current_company=true&updated_at=:updatedAt",{updatedAt:Jn().unix()})).then(N=>{i(s1(N.data.data)),i(zu("company")),pe.dismiss(),k(!0)}).finally(()=>d(!1))}).catch(()=>d(!1)))},L=(N,P)=>{u||(d(!0),y(!0),Je("POST",ze("/api/v1/self-update"),{},{headers:{"X-Api-Password":N}}).then(()=>window.location.reload()).catch(O=>{var F;((F=O.response)==null?void 0:F.status)===412&&(s(P),v(!0))}).finally(()=>{d(!1),y(!1)}))};return h.jsxs(h.Fragment,{children:[h.jsxs(pr,{title:e("about"),visible:o,onClose:()=>!u&&a(!1),disableClosing:f||g||_||b,children:[h.jsxs("div",{className:"flex flex-col text-center",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("span",{className:"text-gray-800",children:[t==null?void 0:t.first_name," ",t==null?void 0:t.last_name]}),h.jsx("span",{children:t==null?void 0:t.email})]}),h.jsxs("span",{className:"mt-4",children:["v",l==null?void 0:l.api_version]})]}),h.jsxs(dn,{behavior:"button",className:"flex items-center",onClick:k,disableWithoutIcon:!0,disabled:u,children:[h.jsx(an,{element:yCe,color:"white"}),h.jsx("span",{children:e("health_check")})]}),c&&(l==null?void 0:l.api_version)&&l.api_version!==c&&!(l!=null&&l.is_docker)&&h.jsxs(dn,{behavior:"button",className:"flex items-center",onClick:()=>m(!0),disableWithoutIcon:!0,disabled:u,children:[h.jsx(an,{element:kCe,color:"white"}),h.jsx("span",{children:e("force_update")})]}),h.jsxs("div",{className:"flex flex-wrap justify-center items-center space-x-4 pt-6",children:[h.jsx("a",{href:"https://twitter.com/invoiceninja",target:"_blank",rel:"noreferrer",children:h.jsx(FCe,{})}),h.jsx("a",{href:"https://www.facebook.com/invoiceninja",target:"_blank",rel:"noreferrer",children:h.jsx(TCe,{})}),h.jsx("a",{href:"https://github.com/invoiceninja",target:"_blank",rel:"noreferrer",children:h.jsx(ICe,{})}),h.jsx("a",{href:"https://www.youtube.com/channel/UCXAHcBvhW05PDtWYIq7WDFA/videos",target:"_blank",rel:"noreferrer",children:h.jsx(BCe,{})}),h.jsx("a",{href:"http://slack.invoiceninja.com/",target:"_blank",rel:"noreferrer",children:h.jsx(OCe,{})})]})]}),h.jsxs(pr,{title:e("health_check"),visible:f,onClose:()=>p(!1),children:[h.jsxs("div",{className:"flex flex-col space-y-3",children:[h.jsxs("div",{className:"flex justify-between items-center py-1 px-3",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium text-base mb-1",children:e("system")}),h.jsxs("span",{children:[e("email"),": ",C==null?void 0:C.mail_mailer]}),h.jsxs("span",{children:[e("queue"),": ",C==null?void 0:C.queue]}),h.jsxs("span",{children:[e("pdf"),": ",C==null?void 0:C.pdf_engine]})]}),h.jsx("div",{children:h.jsx(an,{element:C!=null&&C.system_health?bF:jC,color:C!=null&&C.system_health?"green":"red",size:25})})]}),h.jsxs("div",{className:"flex justify-between items-center py-1 px-3",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium text-base mb-1",children:e("database_connection")}),h.jsx("span",{children:C!=null&&C.simple_db_check?e("passed"):e("failed")})]}),h.jsx("div",{children:h.jsx(an,{element:C!=null&&C.simple_db_check?bF:jC,color:C!=null&&C.simple_db_check?"green":"red",size:25})})]}),h.jsxs("div",{className:"flex justify-between items-center py-1 px-3",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium text-base mb-1",children:"PHP"}),h.jsxs("span",{children:[e("web"),": ",C==null?void 0:C.php_version.current_php_version]}),h.jsxs("span",{children:[e("cli"),": ",C==null?void 0:C.php_version.current_php_cli_version]}),h.jsxs("span",{children:["Memory: ",C==null?void 0:C.php_version.memory_limit]}),h.jsxs("span",{children:["API: ",C==null?void 0:C.api_version]})]}),h.jsx("div",{children:h.jsx(an,{element:C!=null&&C.php_version.is_okay?bF:jC,color:C!=null&&C.php_version.is_okay?"green":"red",size:25})})]}),(!(C!=null&&C.env_writable)||(C==null?void 0:C.file_permissions)!=="Ok")&&!(C!=null&&C.is_docker)&&h.jsxs(Lre,{className:"flex justify-between items-center cursor-pointer py-1 px-3",theme:{hoverColor:r.$5},onClick:()=>{var N;return(N=window.open("https://invoiceninja.github.io/en/self-host-installation/#file-permissions","_blank"))==null?void 0:N.focus()},children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium text-base mb-1",children:e("permissions")}),h.jsx("span",{children:C!=null&&C.env_writable?C==null?void 0:C.file_permissions:e("env_not_writable")})]}),h.jsx("div",{children:h.jsx(an,{element:jC,color:"red",size:25})})]}),(C==null?void 0:C.pdf_engine)!=="SnapPDF PDF Generator"&&h.jsxs(Lre,{className:"flex justify-between items-center cursor-pointer py-1 px-3",theme:{hoverColor:r.$5},onClick:()=>{var N;return(N=window.open("https://invoiceninja.github.io/en/self-host-troubleshooting/#pdf-conversion-issues","_blank"))==null?void 0:N.focus()},children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium text-base mb-1",children:e("snappdf_not_enabled")}),h.jsx("span",{children:e("use_snappdf")})]}),h.jsx("div",{children:h.jsx(an,{element:Ihe,size:25})})]}),!!(C!=null&&C.exchange_rate_api_not_configured)&&h.jsxs(Lre,{className:"flex justify-between items-center cursor-pointer py-1 px-3",theme:{hoverColor:r.$5},onClick:()=>{var N;return(N=window.open("https://invoiceninja.github.io/en/self-host-installation/#currency-conversion","_blank"))==null?void 0:N.focus()},children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium text-base mb-1",children:e("exchange_rate_not_enabled")}),h.jsx("span",{children:e("add_open_exchange")})]}),h.jsx("div",{children:h.jsx(an,{element:Ihe,size:25})})]})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx(dn,{behavior:"button",type:"secondary",onClick:I,disableWithoutIcon:!0,disabled:u,children:e("clear_cache")}),h.jsx(dn,{behavior:"button",onClick:k,disableWithoutIcon:!0,disabled:u,children:e("refresh")})]})]}),h.jsx(pr,{title:e("update_available"),visible:g,onClose:()=>m(!1),disableClosing:u||_||b,children:h.jsxs("div",{className:"flex flex-col space-y-5",children:[h.jsx("span",{className:"font-medium text-base",children:e("a_new_version_is_available")}),h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("span",{children:["· ",e("installed_version"),":"," ",l==null?void 0:l.api_version]}),h.jsxs("span",{children:["· ",e("latest_version"),": ",c]})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx(dn,{behavior:"button",type:"secondary",onClick:()=>{var N;return(N=window.open("https://github.com/invoiceninja/invoiceninja/releases","_blank"))==null?void 0:N.focus()},disableWithoutIcon:!0,disabled:u,children:e("release_notes")}),h.jsx(dn,{behavior:"button",onClick:()=>{a(!1),m(!1),v(!0)},disableWithoutIcon:!0,disabled:u,children:e("update_now")})]})]})}),h.jsx(pr,{title:e("self-update"),visible:b,onClose:()=>{},disableClosing:!0,children:h.jsx("span",{className:"text-center py-3 font-medium",children:e("in_progress")})}),h.jsx(wg,{show:_,onClose:v,onSave:L})]})}function z3r(n){return Ui({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 y3t(n){return Ui({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 C3t(n){return Ui({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 w3t(n){const[e]=xe(),{isVisible:t,setIsVisible:i,installedVersion:r,latestVersion:s}=n,o=Wm(),[a,l]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(!1),p=(g,m)=>{a||(l(!0),u(!0),Je("POST",ze("/api/v1/self-update"),{},{headers:{"X-Api-Password":g}}).then(()=>window.location.reload()).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===412&&(o(m),f(!0))}).finally(()=>{l(!1),u(!1)}))};return h.jsxs(h.Fragment,{children:[h.jsx(pr,{title:e("update"),visible:t,onClose:()=>i(!1),disableClosing:a,children:h.jsxs("div",{className:"flex flex-col space-y-6",children:[h.jsxs("div",{className:"flex flex-col space-y-2",children:[h.jsxs("div",{className:"flex space-x-2",children:[h.jsxs("span",{className:"font-medium",children:[e("installed_version"),":"]}),h.jsx("span",{children:r})]}),h.jsxs("div",{className:"flex space-x-2",children:[h.jsxs("span",{className:"font-medium",children:[e("latest_version"),":"]}),h.jsx("span",{children:s})]})]}),h.jsx(dn,{behavior:"button",onClick:()=>f(!0),disabled:a,disableWithoutIcon:!0,children:e("update")})]})}),h.jsx(pr,{title:e("self-update"),visible:c,onClose:()=>{},disableClosing:!0,children:h.jsxs("span",{className:"text-center py-3 font-medium",children:[e("in_progress"),"."]})}),h.jsx(wg,{show:d,onClose:f,onSave:p})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function x3t({color:n="#74747C",size:e="1.3rem"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("line",{x1:"11.75",y1:"2.75",x2:"11.75",y2:"15.25",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("polyline",{points:"5.75 6.5 8.25 9 5.75 11.5",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("rect",{x:"1.75",y:"2.75",width:"14.5",height:"12.5",rx:"2",ry:"2",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function jKe(){const n=Fr();return e=>{Je("PUT",ze("/api/v1/company_users/:id",{id:e.id}),e).then(t=>{pn.set({...e},"company_user",t.data.data),ii(["company_users"]),n(iw(e)),n(rw())})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function l4(){const n=Fr();return(e,t)=>{n(uA({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 S3t(){const n=hv(),e=jKe(),t=l4();return i=>{if(t("company_user.react_settings.show_mini_sidebar",i),n){const r=pn.cloneDeep(n);pn.set(r,"company_user.react_settings.show_mini_sidebar",i),e(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 E3t({color:n="#A1A1AA",size:e="1.3rem"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("line",{x1:"6.25",y1:"2.75",x2:"6.25",y2:"15.25",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("polyline",{points:"12.25 6.5 9.75 9 12.25 11.5",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("rect",{x:"1.75",y:"2.75",width:"14.5",height:"12.5",rx:"2",ry:"2",transform:"translate(18 18) rotate(180)",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function k3t(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M13,11.75c-3.452,0-6.25-2.798-6.25-6.25,0-1.352,.433-2.599,1.162-3.622-3.364,.628-5.912,3.575-5.912,7.122,0,4.004,3.246,7.25,7.25,7.25,3.372,0,6.198-2.306,7.009-5.424-.95,.583-2.063,.924-3.259,.924Z",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M12.743,4.492l-.946-.315-.316-.947c-.102-.306-.609-.306-.711,0l-.316,.947-.946,.315c-.153,.051-.257,.194-.257,.356s.104,.305,.257,.356l.946,.315,.316,.947c.051,.153,.194,.256,.355,.256s.305-.104,.355-.256l.316-.947,.946-.315c.153-.051,.257-.194,.257-.356s-.104-.305-.257-.356Z",fill:t,"data-color":"color-2","data-stroke":"none"}),h.jsx("circle",{cx:"14.25",cy:"7.75",r:".75",fill:t,"data-color":"color-2","data-stroke":"none"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function T3t(){const n=hv(),e=jKe(),t=l4();return i=>{if(t("company_user.react_settings.dark_mode",i),n){const r=pn.cloneDeep(n);pn.set(r,"company_user.react_settings.dark_mode",i),e(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 I3t(n){const{color:e="#000",size:t="1.2rem"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:t,height:t},viewBox:"0 0 12 12",children:[h.jsx("circle",{cx:"6",cy:"6",r:"3",strokeWidth:"0",fill:e}),h.jsx("path",{d:"m6,2.25c-.414,0-.75-.336-.75-.75v-.75c0-.414.336-.75.75-.75s.75.336.75.75v.75c0,.414-.336.75-.75.75Z",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m9.182,3.568c-.192,0-.384-.073-.53-.22-.293-.293-.293-.768,0-1.061l.53-.53c.293-.293.768-.293,1.061,0s.293.768,0,1.061l-.53.53c-.146.146-.338.22-.53.22Z",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m11.25,6.75h-.75c-.414,0-.75-.336-.75-.75s.336-.75.75-.75h.75c.414,0,.75.336.75.75s-.336.75-.75.75Z",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m9.712,10.462c-.192,0-.384-.073-.53-.22l-.53-.53c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l.53.53c.293.293.293.768,0,1.061-.146.146-.338.22-.53.22Z",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m6,12c-.414,0-.75-.336-.75-.75v-.75c0-.414.336-.75.75-.75s.75.336.75.75v.75c0,.414-.336.75-.75.75Z",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m2.288,10.462c-.192,0-.384-.073-.53-.22-.293-.293-.293-.768,0-1.061l.53-.53c.293-.293.768-.293,1.061,0s.293.768,0,1.061l-.53.53c-.146.146-.338.22-.53.22Z",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m1.5,6.75h-.75c-.414,0-.75-.336-.75-.75s.336-.75.75-.75h.75c.414,0,.75.336.75.75s-.336.75-.75.75Z",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m2.818,3.568c-.192,0-.384-.073-.53-.22l-.53-.53c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l.53.53c.293.293.293.768,0,1.061-.146.146-.338.22-.53.22Z",fill:e,strokeWidth:"0","data-color":"color-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 */function L3t(n){const{color:e="#000",size:t="1.2rem"}=n;return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:t,height:t},viewBox:"0 0 24 24",children:h.jsx("path",{d:"m22.596,17.346L14.697,3.562c-.561-.979-1.569-1.562-2.697-1.562s-2.136.584-2.697,1.562L1.404,17.346c-.558.974-.555,2.134.008,3.104.562.971,1.568,1.55,2.689,1.55h15.798c1.122,0,2.127-.579,2.689-1.55.562-.971.565-2.131.008-3.104Zm-11.596-9.346h2v6h-2v-6Zm1,10c-.689,0-1.25-.561-1.25-1.25s.561-1.25,1.25-1.25,1.25.561,1.25,1.25-.561,1.25-1.25,1.25Z",strokeWidth:"0",fill: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 A3t(n){const{color:e="#000",size:t="1.2rem"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:t,height:t},viewBox:"0 0 24 24",children:[h.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:e,strokeLinecap:"square",strokeMiterlimit:"10",strokeWidth:"2"}),h.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"13",fill:"none",stroke:e,strokeLinecap:"square",strokeMiterlimit:"10",strokeWidth:"2","data-color":"color-2"}),h.jsx("circle",{cx:"12",cy:"16.75",r:"1.25",fill:e,strokeWidth:"0","data-color":"color-2","data-cap":"butt"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function N3t(n){const{color:e="#000",size:t="1.2rem"}=n;return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:t,height:t},viewBox:"0 0 18 18",children:h.jsx("path",{d:"M14.25,2.25H3.75c-1.105,0-2,.896-2,2v7c0,1.104,.895,2,2,2h2v3l3.75-3h4.75c1.105,0,2-.896,2-2V4.25c0-1.104-.895-2-2-2Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function kq(n){const{color:e="#000",size:t="1.2rem"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:t,height:t},viewBox:"0 0 18 18",children:[h.jsx("circle",{cx:"9",cy:"9",r:"7.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M6.925,6.619c.388-1.057,1.294-1.492,2.18-1.492,.895,0,1.818,.638,1.818,1.808,0,1.784-1.816,1.468-2.096,3.065",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M8.791,13.567c-.552,0-1-.449-1-1s.448-1,1-1,1,.449,1,1-.448,1-1,1Z",fill:e,"data-color":"color-2","data-stroke":"none"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function D3t(n){const{color:e="#000",size:t="1.2rem"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:t,height:t},viewBox:"0 0 12 12",children:[h.jsx("circle",{cx:"6",cy:"6",r:"5.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("circle",{cx:"6",cy:"3.125",r:".875",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("line",{x1:"6",y1:"8.5",x2:"6",y2:"5.5",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"})]})}function FKe(n){var P;const[e]=xe(),t=xt(),i=hv(),r=Vm(),s=Qo(),{mobileNavbar:o}=n,a=Fr(),l=T3t(),c=S3t(),{data:u}=lr({queryKey:["/pdf.invoicing.co/api/version"],queryFn:()=>Nc.get("https://pdf.invoicing.co/api/version").then(O=>O.data),staleTime:1/0}),{data:d}=lr({queryKey:["/api/v1/health_check"],queryFn:()=>Je("GET",ze("/api/v1/health_check")).then(O=>O.data),staleTime:1/0,enabled:UB()}),[f,p]=x.useState(!1),[g,m]=x.useState(!1),[_,v]=x.useState(!1),[b,y]=x.useState(!1),[C,S]=x.useState(!1),k=!!((P=i==null?void 0:i.company_user)!=null&&P.react_settings.show_mini_sidebar),I=u&&(d==null?void 0:d.api_version)&&d.api_version!==u&&!(d!=null&&d.is_docker),L=fd({initialValues:{message:"",platform:"R",send_logs:!1},onSubmit:O=>{pe.processing(),Je("POST",ze("/api/v1/support/messages/send"),O).then(()=>pe.success("your_message_has_been_received")).finally(()=>{L.setSubmitting(!1),p(!1)})}}),N=()=>{y(!0),Je("POST",ze("/api/v1/refresh?updated_at=:updatedAt",{updatedAt:Jn().unix()})).then(O=>{a(s1(O.data.data)),a(zu("company")),y(!1),v(!1)})};return h.jsxs(h.Fragment,{children:[h.jsxs(pr,{title:e("contact_us"),visible:f,onClose:p,children:[h.jsx(lt,{label:e("from"),id:"from",value:`${i==null?void 0:i.first_name} - ${i==null?void 0:i.email}`,disabled:!0}),h.jsx(lt,{element:"textarea",label:e("message"),id:"message",onChange:L.handleChange}),h.jsx(jt,{id:"send_errors",label:e("include_recent_errors"),onChange:O=>L.setFieldValue("send_logs",O)}),h.jsx(dn,{onClick:()=>L.submitForm(),disabled:L.isSubmitting,children:e("send")})]}),h.jsxs(pr,{title:e("crons_not_enabled"),visible:_,onClose:v,children:[h.jsx(dn,{onClick:()=>{window.open("https://invoiceninja.github.io/en/self-host-troubleshooting/#cron-not-running-queue-not-running","_blank")},children:e("learn_more")}),h.jsx(dn,{disabled:b,onClick:N,children:e("refresh_data")}),h.jsx(dn,{onClick:()=>{v(!1)},children:e("dismiss")})]}),h.jsx(w3t,{isVisible:C,setIsVisible:S,installedVersion:d==null?void 0:d.api_version,latestVersion:u}),h.jsx(b3t,{isAboutVisible:g,setIsAboutVisible:m,currentSystemInfo:d,latestVersion:u}),h.jsxs("nav",{style:{borderColor:t.$5},className:$t("flex space-x-2.5 py-4 text-white border-t",{"justify-end":o,"justify-around":!o,"px-2":!I}),children:[!k&&!o&&h.jsxs(h.Fragment,{children:[I&&h.jsx(Bx,{duration:0,content:e("update_available"),className:"rounded-md text-xs p-2 bg-[#F2F2F2]",children:h.jsx("div",{className:"cursor-pointer",onClick:()=>S(!0),children:h.jsx(L3t,{color:"white",size:"1.3rem"})})}),r&&!r.is_scheduler_running&&h.jsx(Bx,{duration:0,content:e("error"),className:"rounded-md text-xs p-2 bg-[#F2F2F2]",children:h.jsx("div",{className:"cursor-pointer",onClick:()=>v(!0),children:h.jsx(A3t,{color:"white",size:"1.3rem"})})}),h.jsx(Bx,{duration:0,content:e("contact_us"),className:"rounded-md text-xs p-2 bg-[#F2F2F2]",children:h.jsx("div",{className:"cursor-pointer",onClick:()=>window.open("https://slack.invoiceninja.com","_blank"),children:h.jsx(an,{element:y3t,color:"white",size:21.5})})}),!I&&h.jsx(Bx,{duration:0,content:e("support_forum"),className:"rounded-md text-xs p-2 bg-[#F2F2F2]",children:h.jsx("div",{className:"cursor-pointer",onClick:()=>window.open("https://forum.invoiceninja.com","_blank"),children:h.jsx(N3t,{color:"white",size:"1.3rem"})})}),!(r&&!r.is_scheduler_running)&&h.jsx(Bx,{duration:0,content:e("user_guide"),className:"rounded-md text-xs p-2 bg-[#F2F2F2]",children:h.jsx("div",{className:"cursor-pointer",onClick:()=>window.open(n.docsLink?`https://invoiceninja.github.io/${n.docsLink}`:"https://invoiceninja.github.io","_blank"),children:h.jsx(kq,{color:"white",size:"1.3rem"})})}),h.jsx(Bx,{duration:0,content:e("about"),className:"rounded-md text-xs p-2 bg-[#F2F2F2]",children:h.jsx("div",{className:"cursor-pointer",onClick:()=>m(!0),children:h.jsx(D3t,{color:"white",size:"1.3rem"})})}),h.jsx(Bx,{duration:0,content:e("dark_mode"),className:"rounded-md text-xs p-2 bg-[#F2F2F2]",children:h.jsx("div",{className:"cursor-pointer",onClick:()=>l(!(s!=null&&s.dark_mode)),children:s!=null&&s.dark_mode?h.jsx(I3t,{color:"white",size:"1.3rem"}):h.jsx(k3t,{color:"white",size:"1.3rem"})})})]}),h.jsx(Bx,{duration:0,content:h.jsx("span",{style:{fontSize:k?"0.6rem":"0.75rem"},children:e(k?"show_menu":"hide_menu")}),className:"rounded-md text-xs p-2 bg-[#F2F2F2]",children:h.jsx("div",{className:"cursor-pointer",onClick:()=>c(!k),children:k?h.jsx(x3t,{color:"#e5e7eb",size:"1.5rem"}):h.jsx(E3t,{color:"#e5e7eb",size:"1.35rem"})})})]})]})}function ne(n){const e=xt(),{style:t}=n;return h.jsxs("div",{className:$t(`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,"sm: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,...t},children:[h.jsxs("dt",{className:$t("text-sm flex flex-col",{"opacity-75":n.disabledLabels,"h-full justify-start":n.textVerticalAlign==="top"}),style:{color:e.$3,colorScheme:e.$0},children:[h.jsxs("span",{className:$t("font-medium",{"whitespace-nowrap":n.withoutWrappingLeftSide}),style:{color:e.$22,colorScheme:e.$0},children:[n.leftSide,n.required&&h.jsx("span",{className:"ml-1 text-red-600",children:"*"})]}),n.leftSideHelp&&(typeof n.leftSideHelp=="object"?n.leftSideHelp:h.jsx("span",{className:"text-xs",dangerouslySetInnerHTML:{__html:n.leftSideHelp},style:{color:e.$22,colorScheme:e.$0,opacity:.8}}))]}),h.jsx("dd",{className:$t("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 R3t="tippy-content",P3t="tippy-backdrop",O3t="tippy-arrow",M3t="tippy-svg-arrow",ZT={passive:!0,capture:!0},BKe=function(){return document.body};function Are(n,e,t){if(Array.isArray(n)){var i=n[e];return i??(Array.isArray(t)?t[e]:t)}return n}function Vwe(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function $Ke(n,e){return typeof n=="function"?n.apply(void 0,e):n}function aRe(n,e){if(e===0)return n;var t;return function(i){clearTimeout(t),t=setTimeout(function(){n(i)},e)}}function j3t(n){return n.split(/\s+/).filter(Boolean)}function JD(n){return[].concat(n)}function lRe(n,e){n.indexOf(e)===-1&&n.push(e)}function F3t(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function B3t(n){return n.split("-")[0]}function Tq(n){return[].slice.call(n)}function cRe(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function $3t(){return document.createElement("div")}function HKe(n){return["Element","Fragment"].some(function(e){return Vwe(n,e)})}function H3t(n){return Vwe(n,"NodeList")}function V3t(n){return Vwe(n,"MouseEvent")}function W3t(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function z3t(n){return HKe(n)?[n]:H3t(n)?Tq(n):Array.isArray(n)?n:Tq(document.querySelectorAll(n))}function Nre(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function uRe(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function U3t(n){var e,t=JD(n),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function q3t(n,e){var t=e.clientX,i=e.clientY;return n.every(function(r){var s=r.popperRect,o=r.popperState,a=r.props,l=a.interactiveBorder,c=B3t(o.placement),u=o.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=s.top-i+d>l,_=i-s.bottom-f>l,v=s.left-t+p>l,b=t-s.right-g>l;return m||_||v||b})}function Dre(n,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){n[i](r,t)})}function dRe(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 ry={isTouch:!1},hRe=0;function K3t(){ry.isTouch||(ry.isTouch=!0,window.performance&&document.addEventListener("mousemove",VKe))}function VKe(){var n=performance.now();n-hRe<20&&(ry.isTouch=!1,document.removeEventListener("mousemove",VKe)),hRe=n}function G3t(){var n=document.activeElement;if(W3t(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function Y3t(){document.addEventListener("touchstart",K3t,ZT),window.addEventListener("blur",G3t)}var Q3t=typeof window<"u"&&typeof document<"u",X3t=Q3t?!!window.msCrypto:!1,Z3t={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},J3t={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},gb=Object.assign({appendTo:BKe,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},Z3t,J3t),e5t=Object.keys(gb),t5t=function(e){var t=Object.keys(e);t.forEach(function(i){gb[i]=e[i]})};function WKe(n){var e=n.plugins||[],t=e.reduce(function(i,r){var s=r.name,o=r.defaultValue;if(s){var a;i[s]=n[s]!==void 0?n[s]:(a=gb[s])!=null?a:o}return i},{});return Object.assign({},n,t)}function n5t(n,e){var t=e?Object.keys(WKe(Object.assign({},gb,{plugins:e}))):e5t,i=t.reduce(function(r,s){var o=(n.getAttribute("data-tippy-"+s)||"").trim();if(!o)return r;if(s==="content")r[s]=o;else try{r[s]=JSON.parse(o)}catch{r[s]=o}return r},{});return i}function fRe(n,e){var t=Object.assign({},e,{content:$Ke(e.content,[n])},e.ignoreAttributes?{}:n5t(n,e.plugins));return t.aria=Object.assign({},gb.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 pRe(n){var e=n.firstElementChild,t=Tq(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(R3t)}),arrow:t.find(function(i){return i.classList.contains(O3t)||i.classList.contains(M3t)}),backdrop:t.find(function(i){return i.classList.contains(P3t)})}}var i5t=1,UH=[],Rre=[];function r5t(n,e){var t=fRe(n,Object.assign({},gb,WKe(cRe(e)))),i,r,s,o=!1,a=!1,l=!1,c=!1,u,d,f,p=[],g=aRe(qe,t.interactiveDebounce),m,_=i5t++,v=null,b=F3t(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:_,reference:n,popper:$3t(),popperInstance:v,props:t,state:y,plugins:b,clearDelayTimeouts:Oe,setProps:ce,setContent:Ne,show:Xe,hide:it,hideWithInteractivity:Tt,enable:nt,disable:at,unmount:Ct,destroy:Rt};if(!t.render)return C;var S=t.render(C),k=S.popper,I=S.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+C.id,C.popper=k,n._tippy=C,k._tippy=C;var L=b.map(function(se){return se.fn(C)}),N=n.hasAttribute("aria-expanded");return Pe(),H(),q(),U("onCreate",[C]),t.showOnCreate&&Ke(),k.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&M().addEventListener("mousemove",g)}),C;function P(){var se=C.props.touch;return Array.isArray(se)?se:[se,0]}function O(){return P()[0]==="hold"}function F(){var se;return!!((se=C.props.render)!=null&&se.$$tippy)}function V(){return m||n}function M(){var se=V().parentNode;return se?U3t(se):document}function B(){return pRe(k)}function W(se){return C.state.isMounted&&!C.state.isVisible||ry.isTouch||u&&u.type==="focus"?0:Are(C.props.delay,se?0:1,gb.delay)}function q(se){se===void 0&&(se=!1),k.style.pointerEvents=C.props.interactive&&!se?"":"none",k.style.zIndex=""+C.props.zIndex}function U(se,ke,Ae){if(Ae===void 0&&(Ae=!0),L.forEach(function(Ve){Ve[se]&&Ve[se].apply(Ve,ke)}),Ae){var je;(je=C.props)[se].apply(je,ke)}}function G(){var se=C.props.aria;if(se.content){var ke="aria-"+se.content,Ae=k.id,je=JD(C.props.triggerTarget||n);je.forEach(function(Ve){var Qt=Ve.getAttribute(ke);if(C.state.isVisible)Ve.setAttribute(ke,Qt?Qt+" "+Ae:Ae);else{var rt=Qt&&Qt.replace(Ae,"").trim();rt?Ve.setAttribute(ke,rt):Ve.removeAttribute(ke)}})}}function H(){if(!(N||!C.props.aria.expanded)){var se=JD(C.props.triggerTarget||n);se.forEach(function(ke){C.props.interactive?ke.setAttribute("aria-expanded",C.state.isVisible&&ke===V()?"true":"false"):ke.removeAttribute("aria-expanded")})}}function z(){M().removeEventListener("mousemove",g),UH=UH.filter(function(se){return se!==g})}function Z(se){if(!(ry.isTouch&&(l||se.type==="mousedown"))){var ke=se.composedPath&&se.composedPath()[0]||se.target;if(!(C.props.interactive&&dRe(k,ke))){if(JD(C.props.triggerTarget||n).some(function(Ae){return dRe(Ae,ke)})){if(ry.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else U("onClickOutside",[C,se]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Se())}}}function X(){l=!0}function oe(){l=!1}function fe(){var se=M();se.addEventListener("mousedown",Z,!0),se.addEventListener("touchend",Z,ZT),se.addEventListener("touchstart",oe,ZT),se.addEventListener("touchmove",X,ZT)}function Se(){var se=M();se.removeEventListener("mousedown",Z,!0),se.removeEventListener("touchend",Z,ZT),se.removeEventListener("touchstart",oe,ZT),se.removeEventListener("touchmove",X,ZT)}function Me(se,ke){ge(se,function(){!C.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&ke()})}function Ie(se,ke){ge(se,ke)}function ge(se,ke){var Ae=B().box;function je(Ve){Ve.target===Ae&&(Dre(Ae,"remove",je),ke())}if(se===0)return ke();Dre(Ae,"remove",d),Dre(Ae,"add",je),d=je}function ye(se,ke,Ae){Ae===void 0&&(Ae=!1);var je=JD(C.props.triggerTarget||n);je.forEach(function(Ve){Ve.addEventListener(se,ke,Ae),p.push({node:Ve,eventType:se,handler:ke,options:Ae})})}function Pe(){O()&&(ye("touchstart",$e,{passive:!0}),ye("touchend",mt,{passive:!0})),j3t(C.props.trigger).forEach(function(se){if(se!=="manual")switch(ye(se,$e),se){case"mouseenter":ye("mouseleave",mt);break;case"focus":ye(X3t?"focusout":"blur",vt);break;case"focusin":ye("focusout",vt);break}})}function Be(){p.forEach(function(se){var ke=se.node,Ae=se.eventType,je=se.handler,Ve=se.options;ke.removeEventListener(Ae,je,Ve)}),p=[]}function $e(se){var ke,Ae=!1;if(!(!C.state.isEnabled||ft(se)||a)){var je=((ke=u)==null?void 0:ke.type)==="focus";u=se,m=se.currentTarget,H(),!C.state.isVisible&&V3t(se)&&UH.forEach(function(Ve){return Ve(se)}),se.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?Ae=!0:Ke(se),se.type==="click"&&(o=!Ae),Ae&&!je&&dt(se)}}function qe(se){var ke=se.target,Ae=V().contains(ke)||k.contains(ke);if(!(se.type==="mousemove"&&Ae)){var je=en().concat(k).map(function(Ve){var Qt,rt=Ve._tippy,Cn=(Qt=rt.popperInstance)==null?void 0:Qt.state;return Cn?{popperRect:Ve.getBoundingClientRect(),popperState:Cn,props:t}:null}).filter(Boolean);q3t(je,se)&&(z(),dt(se))}}function mt(se){var ke=ft(se)||C.props.trigger.indexOf("click")>=0&&o;if(!ke){if(C.props.interactive){C.hideWithInteractivity(se);return}dt(se)}}function vt(se){C.props.trigger.indexOf("focusin")<0&&se.target!==V()||C.props.interactive&&se.relatedTarget&&k.contains(se.relatedTarget)||dt(se)}function ft(se){return ry.isTouch?O()!==se.type.indexOf("touch")>=0:!1}function tt(){St();var se=C.props,ke=se.popperOptions,Ae=se.placement,je=se.offset,Ve=se.getReferenceClientRect,Qt=se.moveTransition,rt=F()?pRe(k).arrow:null,Cn=Ve?{getBoundingClientRect:Ve,contextElement:Ve.contextElement||V()}:n,Rn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(si){var oi=si.state;if(F()){var _n=B(),de=_n.box;["placement","reference-hidden","escaped"].forEach(function(_e){_e==="placement"?de.setAttribute("data-placement",oi.placement):oi.attributes.popper["data-popper-"+_e]?de.setAttribute("data-"+_e,""):de.removeAttribute("data-"+_e)}),oi.attributes.popper={}}}},li=[{name:"offset",options:{offset:je}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Qt}},Rn];F()&&rt&&li.push({name:"arrow",options:{element:rt,padding:3}}),li.push.apply(li,(ke==null?void 0:ke.modifiers)||[]),C.popperInstance=hUe(Cn,k,Object.assign({},ke,{placement:Ae,onFirstUpdate:f,modifiers:li}))}function St(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Ft(){var se=C.props.appendTo,ke,Ae=V();C.props.interactive&&se===BKe||se==="parent"?ke=Ae.parentNode:ke=$Ke(se,[Ae]),ke.contains(k)||ke.appendChild(k),C.state.isMounted=!0,tt()}function en(){return Tq(k.querySelectorAll("[data-tippy-root]"))}function Ke(se){C.clearDelayTimeouts(),se&&U("onTrigger",[C,se]),fe();var ke=W(!0),Ae=P(),je=Ae[0],Ve=Ae[1];ry.isTouch&&je==="hold"&&Ve&&(ke=Ve),ke?i=setTimeout(function(){C.show()},ke):C.show()}function dt(se){if(C.clearDelayTimeouts(),U("onUntrigger",[C,se]),!C.state.isVisible){Se();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(se.type)>=0&&o)){var ke=W(!1);ke?r=setTimeout(function(){C.state.isVisible&&C.hide()},ke):s=requestAnimationFrame(function(){C.hide()})}}function nt(){C.state.isEnabled=!0}function at(){C.hide(),C.state.isEnabled=!1}function Oe(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(s)}function ce(se){if(!C.state.isDestroyed){U("onBeforeUpdate",[C,se]),Be();var ke=C.props,Ae=fRe(n,Object.assign({},ke,cRe(se),{ignoreAttributes:!0}));C.props=Ae,Pe(),ke.interactiveDebounce!==Ae.interactiveDebounce&&(z(),g=aRe(qe,Ae.interactiveDebounce)),ke.triggerTarget&&!Ae.triggerTarget?JD(ke.triggerTarget).forEach(function(je){je.removeAttribute("aria-expanded")}):Ae.triggerTarget&&n.removeAttribute("aria-expanded"),H(),q(),I&&I(ke,Ae),C.popperInstance&&(tt(),en().forEach(function(je){requestAnimationFrame(je._tippy.popperInstance.forceUpdate)})),U("onAfterUpdate",[C,se])}}function Ne(se){C.setProps({content:se})}function Xe(){var se=C.state.isVisible,ke=C.state.isDestroyed,Ae=!C.state.isEnabled,je=ry.isTouch&&!C.props.touch,Ve=Are(C.props.duration,0,gb.duration);if(!(se||ke||Ae||je)&&!V().hasAttribute("disabled")&&(U("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,F()&&(k.style.visibility="visible"),q(),fe(),C.state.isMounted||(k.style.transition="none"),F()){var Qt=B(),rt=Qt.box,Cn=Qt.content;Nre([rt,Cn],0)}f=function(){var li;if(!(!C.state.isVisible||c)){if(c=!0,k.offsetHeight,k.style.transition=C.props.moveTransition,F()&&C.props.animation){var Mi=B(),si=Mi.box,oi=Mi.content;Nre([si,oi],Ve),uRe([si,oi],"visible")}G(),H(),lRe(Rre,C),(li=C.popperInstance)==null||li.forceUpdate(),U("onMount",[C]),C.props.animation&&F()&&Ie(Ve,function(){C.state.isShown=!0,U("onShown",[C])})}},Ft()}}function it(){var se=!C.state.isVisible,ke=C.state.isDestroyed,Ae=!C.state.isEnabled,je=Are(C.props.duration,1,gb.duration);if(!(se||ke||Ae)&&(U("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,c=!1,o=!1,F()&&(k.style.visibility="hidden"),z(),Se(),q(!0),F()){var Ve=B(),Qt=Ve.box,rt=Ve.content;C.props.animation&&(Nre([Qt,rt],je),uRe([Qt,rt],"hidden"))}G(),H(),C.props.animation?F()&&Me(je,C.unmount):C.unmount()}}function Tt(se){M().addEventListener("mousemove",g),lRe(UH,g),g(se)}function Ct(){C.state.isVisible&&C.hide(),C.state.isMounted&&(St(),en().forEach(function(se){se._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),Rre=Rre.filter(function(se){return se!==C}),C.state.isMounted=!1,U("onHidden",[C]))}function Rt(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),Be(),delete n._tippy,C.state.isDestroyed=!0,U("onDestroy",[C]))}}function s9(n,e){e===void 0&&(e={});var t=gb.plugins.concat(e.plugins||[]);Y3t();var i=Object.assign({},e,{plugins:t}),r=z3t(n),s=r.reduce(function(o,a){var l=a&&r5t(a,i);return l&&o.push(l),o},[]);return HKe(n)?s[0]:s}s9.defaultProps=gb;s9.setDefaultProps=t5t;s9.currentInput=ry;Object.assign({},GCe,{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)}});s9.setDefaultProps({animation:!1});function zKe(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var UKe=typeof window<"u"&&typeof document<"u";function Xhe(n,e){n&&(typeof n=="function"&&n(e),{}.hasOwnProperty.call(n,"current")&&(n.current=e))}function gRe(){return UKe&&document.createElement("div")}function s5t(n){var e={"data-placement":n.placement};return n.referenceHidden&&(e["data-reference-hidden"]=""),n.escaped&&(e["data-escaped"]=""),e}function qKe(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(!qKe(n[t],e[t]))return!1}else return!1;return!0}else return!1}function o5t(n){var e=[];return n.forEach(function(t){e.find(function(i){return qKe(t,i)})||e.push(t)}),e}function a5t(n,e){var t,i;return Object.assign({},e,{popperOptions:Object.assign({},n.popperOptions,e.popperOptions,{modifiers:o5t([].concat(((t=n.popperOptions)==null?void 0:t.modifiers)||[],((i=e.popperOptions)==null?void 0:i.modifiers)||[]))})})}var Pre=UKe?x.useLayoutEffect:x.useEffect;function l5t(n){var e=x.useRef();return e.current||(e.current=typeof n=="function"?n():n),e.current}function mRe(n,e,t){t.split(/\s+/).forEach(function(i){i&&n.classList[e](i)})}var c5t={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()||mRe(t,"add",e.props.className)}function s(){i()&&mRe(t,"remove",e.props.className)}return{onCreate:r,onBeforeUpdate:s,onAfterUpdate:r}}};function u5t(n){function e(t){var i=t.children,r=t.content,s=t.visible,o=t.singleton,a=t.render,l=t.reference,c=t.disabled,u=c===void 0?!1:c,d=t.ignoreAttributes,f=d===void 0?!0:d;t.__source,t.__self;var p=zKe(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=s!==void 0,m=o!==void 0,_=x.useState(!1),v=_[0],b=_[1],y=x.useState({}),C=y[0],S=y[1],k=x.useState(),I=k[0],L=k[1],N=l5t(function(){return{container:gRe(),renders:1}}),P=Object.assign({ignoreAttributes:f},p,{content:N.container});g&&(P.trigger="manual",P.hideOnClick=!1),m&&(u=!0);var O=P,F=P.plugins||[];a&&(O=Object.assign({},P,{plugins:m&&o.data!=null?[].concat(F,[{fn:function(){return{onTrigger:function(W,q){var U=o.data.children.find(function(G){var H=G.instance;return H.reference===q.currentTarget});W.state.$$activeSingletonInstance=U.instance,L(U.content)}}}}]):F,render:function(){return{popper:N.container}}}));var V=[l].concat(i?[i.type]:[]);return Pre(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var B=n(M||N.ref||gRe(),Object.assign({},O,{plugins:[c5t].concat(P.plugins||[])}));return N.instance=B,u&&B.disable(),s&&B.show(),m&&o.hook({instance:B,content:r,props:O,setSingletonContent:L}),b(!0),function(){B.destroy(),o==null||o.cleanup(B)}},V),Pre(function(){var M;if(N.renders===1){N.renders++;return}var B=N.instance;B.setProps(a5t(B.props,O)),(M=B.popperInstance)==null||M.forceUpdate(),u?B.disable():B.enable(),g&&(s?B.show():B.hide()),m&&o.hook({instance:B,content:r,props:O,setSingletonContent:L})}),Pre(function(){var M;if(a){var B=N.instance;B.setProps({popperOptions:Object.assign({},B.props.popperOptions,{modifiers:[].concat((((M=B.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function(W){var q=W.name;return q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var U,G=q.state,H=(U=G.modifiersData)==null?void 0:U.hide;(C.placement!==G.placement||C.referenceHidden!==(H==null?void 0:H.isReferenceHidden)||C.escaped!==(H==null?void 0:H.hasPopperEscaped))&&S({placement:G.placement,referenceHidden:H==null?void 0:H.isReferenceHidden,escaped:H==null?void 0:H.hasPopperEscaped}),G.attributes.popper={}}}])})})}},[C.placement,C.referenceHidden,C.escaped].concat(V)),we.createElement(we.Fragment,null,i?x.cloneElement(i,{ref:function(B){N.ref=B,Xhe(i.ref,B)}}):null,v&&Bm.createPortal(a?a(s5t(C),I,N.instance):r,N.container))}return e}var d5t=function(n,e){return x.forwardRef(function(i,r){var s=i.children,o=zKe(i,["children"]);return we.createElement(n,Object.assign({},e,o),s?x.cloneElement(s,{ref:function(l){Xhe(r,l),Xhe(s.ref,l)}}):null)})},o9=d5t(u5t(s9),{render:function(){return""}});const h5t=As.button` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `,f5t=As(r1)` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function $n(n){const e=xt(),{prevent:t}=ji(i4),i=Vw({disablePrevention:n.disablePreventNavigation}),{actionKey:r}=n;return n.to?h.jsx("div",{className:"p-1",children:h.jsxs(f5t,{theme:{color:e.$3,hoverColor:e.$20},to:n.to,className:$t({"flex items-center":n.icon},`w-full text-left z-50 block px-4 py-2 text-sm text-gray-700 rounded-[0.1875rem] ${n.className}`),onClick:s=>{t&&(s.preventDefault(),i({url:n.to}))},children:[n.icon&&h.jsx("div",{children:n.icon}),h.jsx("div",{className:$t({"ml-2":n.icon}),children:n.children})]})}):h.jsx("div",{className:"p-1",children:h.jsxs(h5t,{theme:{color:e.$3,hoverColor:e.$20},type:"button",onClick:s=>i({fn:()=>{var o,a;(o=n.onClick)==null||o.call(n,s),(a=n.setVisible)==null||a.call(n,!1)},actionKey:r}),ref:n.innerRef,className:$t({"flex items-center":n.icon},`w-full text-left z-50 block px-4 py-2 text-sm rounded-[0.1875rem] ${n.className} `),"data-cy":n.cypressRef,children:[n.icon&&h.jsx("div",{children:n.icon}),h.jsx("div",{className:$t({"ml-2":n.icon}),children:n.children})]})})}function p5t(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];n&&n.addEventListener&&n.addEventListener.apply(n,e)}function g5t(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];n&&n.removeEventListener&&n.removeEventListener.apply(n,e)}var m5t=["mousedown","touchstart"],Uw=function(n,e,t){t===void 0&&(t=m5t);var i=x.useRef(e);x.useEffect(function(){i.current=e},[e]),x.useEffect(function(){for(var r=function(l){var c=n.current;c&&!c.contains(l.target)&&i.current(l)},s=0,o=t;s<o.length;s++){var a=o[s];p5t(document,a,r)}return function(){for(var l=0,c=t;l<c.length;l++){var u=c[l];g5t(document,u,r)}}},[t,n])};function _5t(n,e){e===void 0&&(e=0);var t=x.useRef(!1),i=x.useRef(),r=x.useRef(n),s=x.useCallback(function(){return t.current},[]),o=x.useCallback(function(){t.current=!1,i.current&&clearTimeout(i.current),i.current=setTimeout(function(){t.current=!0,r.current()},e)},[e]),a=x.useCallback(function(){t.current=null,i.current&&clearTimeout(i.current)},[]);return x.useEffect(function(){r.current=n},[n]),x.useEffect(function(){return o(),a},[e]),[s,a,o]}function xL(n,e,t){e===void 0&&(e=0),t===void 0&&(t=[]);var i=_5t(n,e),r=i[0],s=i[1],o=i[2];return x.useEffect(o,t),[r,s]}const v5t=As.button` color: ${n=>n.theme.color} !important; background-color: ${n=>n.theme.backgroundColor} !important; border-color: ${n=>n.theme.borderColor} !important; `,b5t=As.div` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function Z_(n){const e=x.useRef(null),[t,i]=x.useState(!1),r=xt(),s=Lo(),[o,a]=x.useState(),l=(c,u)=>c==="div"?{onClick:()=>i(!1),key:u}:{setVisible:i,key:u};return Uw(e,()=>{t&&i(!1)}),x.useEffect(()=>{a(x.Children.toArray(n.children))},[n.children]),h.jsx("div",{ref:e,children:h.jsx(o9,{disabled:n.disabled,placement:"bottom",interactive:!0,render:()=>h.jsx(b5t,{theme:{hoverColor:r.$2},className:`border box rounded-md shadow-lg focus:outline-none whitespace-normal ${n.className}`,style:{backgroundColor:r.$1,borderColor:r.$19,minWidth:n.minWidth??"12rem",maxWidth:n.maxWidth??"14.7rem"},"data-cy":n.cypressRef,children:o==null?void 0:o.map((c,u)=>c&&(c.type==$n||c.type=="div")?x.cloneElement(c,l(c.type,u)):c)}),visible:t,children:n.customLabel?h.jsx("div",{onClick:c=>{c.stopPropagation(),c.preventDefault(),i(!t)},children:n.customLabel}):h.jsxs(v5t,{theme:{backgroundColor:r.$18,color:r.$1,borderColor:n.labelButtonBorderColor||r.$24},type:"button",disabled:n.disabled,onClick:()=>i(!t),className:$t(`border inline-flex items-center space-x-2 px-4 justify-center rounded-md 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&&s,color:n.cardActions?"white":""},"data-cy":"chevronDownButton",children:[!n.cardActions&&h.jsx("span",{children:n.label}),h.jsx(kZ,{size:n.cardActions?18:14})]})})})}function er(n){const[e]=xe(),{padding:t="regular",height:i}=n,[r,s]=x.useState(n.collapsed),o=xt();return h.jsx("div",{ref:n.innerRef,className:$t(`border rounded-md overflow-visible ${n.className}`,{"overflow-y-auto":n.withScrollableBody,"h-full":i==="full"}),style:{backgroundColor:o.$1,color:o.$3,borderColor:o.$4,...n.style},children:h.jsxs("form",{onSubmit:n.onFormSubmit,className:$t({"h-full":i==="full"}),children:[n.title&&h.jsx("div",{className:$t({"bg-white sticky top-0":n.withScrollableBody,"px-4 sm:px-6 py-3":t=="small"&&!n.withoutHeaderPadding,"px-4 sm:px-6 py-5":t=="regular"&&!n.withoutHeaderPadding,"border-b":!n.withoutHeaderBorder},n.headerClassName),onClick:()=>typeof n.collapsed<"u"&&s(!r),style:{borderColor:o.$4,...n.headerStyle},children:h.jsxs("div",{className:$t("flex items-center justify-between",{"cursor-pointer select-none":typeof n.collapsed<"u"}),children:[h.jsxs("div",{children:[h.jsx("h3",{className:$t("leading-6 font-medium",{"text-lg":t=="regular","text-md":t=="small"}),children:n.title}),n.description&&h.jsx("p",{className:"mt-1 max-w-2xl text-sm",children:n.description})]}),n.topRight,typeof n.collapsed<"u"&&r&&h.jsx(kZ,{}),typeof n.collapsed<"u"&&!r&&h.jsx(ECe,{})]})}),h.jsxs("div",{className:$t(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&&h.jsx(ne,{leftSide:h.jsx(yo,{})}),n.withContainer?h.jsx(l1,{children:n.children}):n.children]}),(n.withSaveButton||n.additionalAction)&&h.jsx("div",{className:"border-t px-4 py-5 sm:p-0",style:{borderColor:o.$20},children:h.jsx("dl",{className:"sm:divide-y sm:divide-gray-200",children:h.jsxs("div",{className:"sm:py-5 sm:px-6 flex justify-end space-x-4",children:[n.additionalAction,n.withSaveButton&&!n.additionalSaveOptions&&h.jsx(dn,{onClick:n.onSaveClick,disabled:n.disableSubmitButton,disableWithoutIcon:n.disableWithoutIcon,children:n.saveButtonLabel??e("save")}),n.withSaveButton&&n.additionalSaveOptions&&h.jsxs("div",{className:"flex",children:[h.jsx(dn,{className:"rounded-br-none rounded-tr-none px-3",onClick:n.onSaveClick,disabled:n.disableSubmitButton,disableWithoutIcon:n.disableWithoutIcon,children:n.saveButtonLabel??e("save")}),h.jsx(Z_,{className:"rounded-bl-none rounded-tl-none h-full px-1 border-l-1 border-y-0 border-r-0",disabled:n.disableSubmitButton,cardActions:!0,labelButtonBorderColor:o.$1,children:n.additionalSaveOptions.map((a,l)=>h.jsx($n,{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 l1(n){return h.jsx("div",{className:"px-4 sm:px-6 py-4 space-y-6",children:n.children})}const y5t=As.button` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; }: `,C5t=As.a` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; }: `,w5t=As(r1)` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; }: `;function zm(n){const e=xt(),t=`block w-full text-left px-4 sm:px-6 block py-4 space-x-3 text-sm ${n.className}`;return n.to?h.jsx(w5t,{theme:{hoverColor:e.$4,color:e.$3},to:n.to,style:{pointerEvents:n.disableNavigation?"none":"all"},className:t,children:n.children}):n.href?h.jsx(C5t,{theme:{hoverColor:e.$4,color:e.$3},target:"_blank",href:n.href,className:t,rel:"noreferrer",children:n.children}):h.jsx(y5t,{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 Ore,_Re;function x5t(){return _Re||(_Re=1,Ore=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}),Ore}var S5t=x5t();const E5t=Cl(S5t),k5t=As.svg` & path[data-color='color-2'] { fill: ${n=>n.theme.borderColor}; } & path:not([data-color='color-2']) { fill: ${n=>n.theme.color}; } &:hover path[data-color='color-2'] { fill: ${n=>n.theme.hoverBorderColor||n.theme.borderColor}; } &:hover path:not([data-color='color-2']) { fill: ${n=>n.theme.hoverColor||n.theme.color}; } `;function c1({size:n="18px",color:e="black",borderColor:t="#000",hoverColor:i,hoverBorderColor:r}){return h.jsxs(k5t,{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",theme:{color:e,borderColor:t,hoverColor:i,hoverBorderColor:r},children:[h.jsx("path",{opacity:"0.4",d:"M9.00009 17C13.4184 17 17.0001 13.4183 17.0001 9C17.0001 4.58172 13.4184 1 9.00009 1C4.58181 1 1.00009 4.58172 1.00009 9C1.00009 13.4183 4.58181 17 9.00009 17Z","data-color":"color-2"}),h.jsx("path",{d:"M10.0606 8.99999L12.2803 6.7803C12.5733 6.4873 12.5733 6.01268 12.2803 5.71978C11.9873 5.42688 11.5127 5.42678 11.2198 5.71978L9.0001 7.93951L6.7804 5.71978C6.4874 5.42678 6.0128 5.42678 5.7199 5.71978C5.427 6.01278 5.4269 6.4874 5.7199 6.7803L7.93961 8.99999L5.7199 11.2197C5.4269 11.5127 5.4269 11.9873 5.7199 12.2802C5.8664 12.4267 6.0583 12.4999 6.2502 12.4999C6.4421 12.4999 6.634 12.4267 6.7805 12.2802L9.0002 10.0605L11.2199 12.2802C11.3664 12.4267 11.5583 12.4999 11.7502 12.4999C11.9421 12.4999 12.134 12.4267 12.2805 12.2802C12.5735 11.9872 12.5735 11.5126 12.2805 11.2197L10.0606 8.99999Z"})]})}const T5t=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2f7dc3","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#ff9800","#ff5722","#795548","#9e9e9e","#607d8b","#616161","#000000","#57a6e4","#324da1","#4c9a1c","#cd8900","#b93700"],Cz=["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"],Zhe={light:{palette:["#93C5FD26","#1D4ED826","#22C55E26","#EAB30826","#EF444426"]},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 I5t(){return(n,e)=>n&&E5t().test(n)?n:e}function Um(){var t,i,r;const n=Qo(),e={$1:"",$2:"",$3:"",$4:"",$5:""};return(r=(i=Zhe[(t=n==null?void 0:n.color_theme)==null?void 0:t.status_color_theme])==null?void 0:i.palette)==null||r.forEach((s,o)=>{e[`$${o+1}`]=s}),e}function KKe(){const n=Qo(),e={$1:"",$2:"",$3:"",$4:"",$5:"",$6:"",$7:""};return Cz.forEach((t,i)=>{var r;e[`$${i+1}`]=((r=n==null?void 0:n.color_theme)==null?void 0:r[t])||""}),e}function L5t(){var o;const[n]=xe(),e=Qo(),t=Fr(),i=l4(),r=()=>{let a="";Cz.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(()=>pe.success("copied_to_clipboard",{value:""}))},s=()=>{const a=pn.cloneDeep(e==null?void 0:e.color_theme);a&&(a.status_color_theme="light",Cz.forEach(l=>{a[l]=""}),t(uA({property:"company_user.react_settings.color_theme",value:a})))};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("status_color_theme"),children:h.jsx(Dn,{value:((o=e==null?void 0:e.color_theme)==null?void 0:o.status_color_theme)||"light",onValueChange:a=>i("company_user.react_settings.color_theme.status_color_theme",a),customSelector:!0,children:Object.keys(Zhe).map((a,l)=>{var c,u;return h.jsx("option",{value:a,children:h.jsxs("div",{className:"flex w-full space-x-2",children:[h.jsx("span",{className:"flex w-1/4 capitalize truncate",children:n(a)}),h.jsx("div",{className:"flex",children:(u=(c=Zhe[a])==null?void 0:c.palette)==null?void 0:u.map(d=>h.jsx("div",{style:{backgroundColor:d.slice(0,7),width:50,height:20}},d))})]})},l)})})}),Cz.map(a=>h.jsx(ne,{leftSide:n(a),children:h.jsx(A5t,{fieldKey:a})},a)),h.jsxs("div",{className:"flex justify-end px-6 mt-10 space-x-4",children:[h.jsx(dn,{behavior:"button",type:"secondary",onClick:s,children:n("clear_all")}),h.jsx(dn,{behavior:"button",onClick:r,children:n("export_colors")})]})]})}function A5t(n){var r;const{fieldKey:e}=n,t=Qo(),i=l4();return h.jsxs("div",{className:"flex space-x-20",children:[h.jsx(lt,{value:((r=t==null?void 0:t.color_theme)==null?void 0:r[e])||"",onValueChange:s=>i(`company_user.react_settings.color_theme.${e}`,s)}),h.jsx(N5t,{fieldKey:e})]})}function N5t(n){var d;const[e]=xe(),{fieldKey:t}=n,i=xt(),r=Qo(),s=I5t(),o=l4(),[a,l]=x.useState(!1),[c,u]=x.useState("");return x.useEffect(()=>{var f;a&&u(((f=r==null?void 0:r.color_theme)==null?void 0:f[t])||"")},[a]),h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:"cursor-pointer hover:opacity-75",onClick:()=>l(!0),style:{width:100,height:38,backgroundColor:s((d=r==null?void 0:r.color_theme)==null?void 0:d[t],"#9e9e9e")}}),h.jsx("div",{className:"cursor-pointer",onClick:()=>o(`company_user.react_settings.color_theme.${t}`,""),children:h.jsx(c1,{color:i.$16,hoverColor:i.$3,borderColor:i.$5,hoverBorderColor:i.$17,size:"1.6rem"})})]}),h.jsx(pr,{title:e(t),visible:a,size:"small",onClose:()=>l(!1),children:h.jsxs("div",{className:"flex flex-col space-y-6",children:[h.jsx("div",{className:"grid grid-cols-6 gap-x-2 gap-y-2",children:T5t.map(f=>h.jsx("div",{className:"relative cursor-pointer w-full hover:opacity-75",onClick:()=>u(f),style:{height:32,backgroundColor:f},children:c===f&&h.jsx(an,{className:"absolute",element:ewe,color:"white",size:25,style:{top:"0.3rem",left:"1.45rem"}})},f))}),h.jsx(dn,{className:"self-end",behavior:"button",onClick:()=>{o(`company_user.react_settings.color_theme.${t}`,c),l(!1)},children:e("done")})]})})]})}const D5t=As.div` background-color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `,vRe=As(Ji)` &:hover { background-color: ${({theme:n})=>n.hoverColor}; } `;function Jhe(n){var o;const{item:e}=n,t=xt(),i=hv(),r=KKe(),s=!!((o=i==null?void 0:i.company_user)!=null&&o.react_settings.show_mini_sidebar);return e.visible?h.jsxs(D5t,{theme:{color:e.current?r.$1||t.$8:r.$3||"transparent",hoverColor:r.$1||t.$8},className:$t("flex items-center justify-between group px-1.5 text-sm font-medium rounded-md",{"text-white border-l-4 border-transparent":e.current,"text-gray-300 border-l-4 border-transparent":!e.current}),children:[h.jsx(vRe,{to:e.href,className:"w-full",withoutDefaultStyling:!0,children:h.jsxs("div",{className:"flex justify-start items-center my-2 space-x-3",style:{color:e.current?r.$2:r.$4},children:[h.jsx(e.icon,{size:"1.275rem",color:e.current?r.$2||"white":r.$4||"#74747C"}),!s&&h.jsx("span",{children:e.name})]})}),e.rightButton&&!s&&e.rightButton.visible&&h.jsx(vRe,{theme:{hoverColor:t.$6},to:e.rightButton.to,className:"rounded-sm p-[0.1rem]",withoutDefaultStyling:!0,children:h.jsx(e.rightButton.icon,{size:"1.1rem",color:e.current?r.$2||"white":r.$4||"#d1d5db"})})]},e.name):h.jsx(h.Fragment,{})}function Ah(n){const e=xt(),{width:t,placement:i,withoutArrow:r,tooltipElement:s,message:o,disabled:a,withoutWrapping:l}=n,c=x.useRef(null),[u,d]=x.useState(0),[f,p]=x.useState(!1);return x.useEffect(()=>{var _,v;const g=(_=c==null?void 0:c.current)==null?void 0:_.offsetWidth,m=(v=c==null?void 0:c.current)==null?void 0:v.children[0];m&&g&&(m.offsetWidth>g?(d(g+10),p(!0)):d(m.offsetWidth+10))},[c,n.message]),h.jsx("div",{className:$t(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:h.jsx(o9,{placement:i||"top-start",interactive:!0,render:()=>h.jsxs("div",{className:"flex flex-col items-center",onClick:g=>g.stopPropagation(),children:[h.jsxs("div",{className:$t("relative p-2 text-xs text-center text-white rounded-md",{"leading-1":f,"leading-none":!f,"whitespace-normal break-all":!!o&&!l,"whitespace-nowrap":l}),style:{width:t||u,backgroundColor:e.$3,color:e.$1},children:[o,s]}),!r&&h.jsx(an,{className:"rotate-90",element:Jkt,size:24,style:{color:e.$3,marginTop:"-0.51rem"}})]}),disabled:a,children:h.jsx("div",{ref:c,className:$t("cursor-pointer",{"truncate w-full":n.truncate,"flex items-center":n.centerVertically}),children:n.children})})})}function R5t(n){var r;const e=hv(),t=!!((r=e==null?void 0:e.company_user)!=null&&r.react_settings.show_mini_sidebar),i=xt();return h.jsx("div",{className:$t("hidden md:flex z-10 md:flex-col md:fixed md:inset-y-0",{"md:w-16":t,"md:w-64":!t}),children:h.jsxs("div",{className:"flex flex-col flex-grow overflow-y-auto border-r px-3",style:{backgroundColor:i.$14,borderColor:i.$4},children:[h.jsx("div",{className:$t("flex items-center flex-shrink-0 h-16 border-b",{"py-3":!t,"justify-center":t}),style:{borderColor:"white",color:i.$3},children:h.jsx(Yqe,{})}),h.jsxs("div",{className:"flex-grow flex flex-col mt-3",children:[h.jsx("nav",{className:"flex-1 pb-4 space-y-1","data-cy":"navigationBar",children:n.navigation.map((s,o)=>t?h.jsx(Ah,{message:s.name,width:"auto",placement:"right",withoutArrow:!0,withoutWrapping:!0,children:h.jsx(Jhe,{item:s},o)},o):h.jsx(Jhe,{item:s},o))}),h.jsx(FKe,{docsLink:n.docsLink})]})]})})}function P5t(n){var r;const e=xt(),t=hv(),i=!!((r=t==null?void 0:t.company_user)!=null&&r.react_settings.show_mini_sidebar);return h.jsx(fb.Root,{show:n.sidebarOpen,as:x.Fragment,children:h.jsxs(iI,{as:"div",className:"fixed inset-0 flex z-40 md:hidden",onClose:n.setSidebarOpen,style:{width:i?"4rem":"19.4rem"},children:[h.jsx(fb.Child,{as:x.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:h.jsx(iI.Overlay,{className:"fixed inset-0 bg-gray-600 bg-opacity-75"})}),h.jsx(fb.Child,{as:x.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:h.jsxs("div",{className:"relative flex-1 flex flex-col max-w-xs w-full px-3",style:{backgroundColor:e.$14},children:[h.jsx(fb.Child,{as:x.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:h.jsx("div",{className:"absolute top-0 right-0 -mr-12 pt-2",children:h.jsxs("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:[h.jsx("span",{className:"sr-only",children:"Close sidebar"}),h.jsx(JM,{className:"text-white"})]})})}),h.jsx("div",{className:"flex-shrink-0 flex items-center px-0 md:px-4 py-3 border-b h-16 justify-center border-gray-600",style:{backgroundColor:e.$14,color:e.$3},children:h.jsx(Yqe,{})}),h.jsxs("div",{className:"flex flex-col flex-1 h-0 overflow-y-auto mt-4",children:[h.jsx("nav",{className:"flex-1 space-y-1",children:n.navigation.map((s,o)=>h.jsx(Jhe,{item:s},o))}),h.jsx(FKe,{mobileNavbar:!0})]})]})}),h.jsx("div",{className:"flex-shrink-0 w-14","aria-hidden":"true"})]})})}var nr=(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))(nr||{});const O5t=[{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 M5t(){const[n]=xe(),e=Nr(),t=Fr(),i=(r,s)=>t(Uo({object:"company",property:"enabled_modules",value:(e==null?void 0:e.enabled_modules)^s}));return h.jsx(h.Fragment,{children:O5t.map((r,s)=>h.jsx(ne,{leftSide:n(r.label),children:h.jsx(jt,{checked:!!((e==null?void 0:e.enabled_modules)&r.bitmask),onChange:o=>i(o,r.bitmask)},r.label)},s))})}function Ki(n){const e=xt();return h.jsx("div",{style:{borderColor:n.borderColor||e.$21},className:$t("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 Vy(){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 $u(){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 vS({color:n="#000",size:e="1.2rem",strokeWidth:t="2"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 20 20",children:[h.jsx("line",{x1:"3",y1:"10",x2:"17",y2:"10",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,"data-color":"color-2"}),h.jsx("polyline",{points:"12 15 17 10 12 5",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth: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 j5t({color:n="#000",size:e="18px"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("circle",{cx:"9",cy:"9",r:"7.25",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"}),h.jsx("circle",{cx:"9",cy:"8.25",r:"2",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"}),h.jsx("line",{x1:"9",y1:"10.25",x2:"9",y2:"12.5",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-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 */function F5t({color:n="#000",size:e="12px",strokeWidth:t="1.5"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 12 12",children:[h.jsx("line",{x1:"5.25",y1:"8.25",x2:"11",y2:"8.25",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":t,"data-color":"color-2"}),h.jsx("polyline",{points:"8.75 5.75 11.25 8.25 8.75 10.75",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":t,"data-color":"color-2"}),h.jsx("line",{x1:"6.75",y1:"3.75",x2:"1",y2:"3.75",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":t}),h.jsx("polyline",{points:"3.25 1.25 .75 3.75 3.25 6.25",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":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 B5t({color:n="#000",size:e="18px"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M9,16.25c0-1.105,.895-2,2-2h4.25c.552,0,1-.448,1-1V3.75c0-.552-.448-1-1-1h-4.25c-1.105,0-2,.895-2,2",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"}),h.jsx("path",{d:"M9,16.25V4.75c0-1.105-.895-2-2-2H2.75c-.552,0-1,.448-1,1V13.25c0,.552,.448,1,1,1H7c1.105,0,2,.895,2,2Z",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function $5t({color:n="#000",size:e="18px"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("line",{x1:"4.664",y1:"7.586",x2:"7.586",y2:"4.664",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"}),h.jsx("line",{x1:"10.414",y1:"4.664",x2:"13.336",y2:"7.586",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"}),h.jsx("line",{x1:"13.336",y1:"10.414",x2:"10.414",y2:"13.336",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"}),h.jsx("line",{x1:"7.586",y1:"13.336",x2:"4.664",y2:"10.414",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"}),h.jsx("circle",{cx:"9",cy:"3.25",r:"2",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"}),h.jsx("circle",{cx:"3.25",cy:"9",r:"2",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"}),h.jsx("circle",{cx:"9",cy:"14.75",r:"2",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"}),h.jsx("circle",{cx:"14.75",cy:"9",r:"2",fill:"none",stroke:n,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.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(n){const{size:e="1rem",color:t="#000",strokeWidth:i="1.5"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 12 12",children:[h.jsx("polyline",{points:"1.25 7.75 4.75 4.25 7.25 6.75 10.5 3.5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:i,"data-color":"color-2"}),h.jsx("path",{d:"m1.25,1.25v7.5c0,1.105.895,2,2,2h7.5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:i})]})}const L5=As.div` background-color: ${({theme:n})=>n.backgroundColor}; &:hover { background-color: ${({theme:n})=>n.hoverBackgroundColor}; } `;function H5t(){const[n]=xe(),e=Yi(),t=xt(),{isAdmin:i}=go();return h.jsxs("div",{className:"flex flex-col space-y-4 px-4 sm:px-6 pt-2 pb-4",children:[i&&h.jsxs(L5,{className:"flex justify-between items-center p-4 border shadow-sm w-full rounded-md cursor-pointer",theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},onClick:()=>e("/settings/integrations/api_tokens"),style:{borderColor:t.$24},children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(j5t,{color:t.$3,size:"1.4rem"}),h.jsx("span",{className:"text-sm",style:{color:t.$3},children:n("api_tokens")})]}),h.jsx("div",{children:h.jsx(vS,{color:t.$3,size:"1.4rem",strokeWidth:"1.5"})})]}),h.jsxs(L5,{className:"flex justify-between items-center p-4 border shadow-sm w-full rounded-md cursor-pointer",theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},onClick:()=>e("/settings/integrations/api_webhooks"),style:{borderColor:t.$24},children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(F5t,{color:t.$3,size:"1.4rem",strokeWidth:"1"}),h.jsx("span",{className:"text-sm",style:{color:t.$3},children:n("api_webhooks")})]}),h.jsx("div",{children:h.jsx(vS,{color:t.$3,size:"1.4rem",strokeWidth:"1.5"})})]}),h.jsxs(L5,{className:"flex justify-between items-center p-4 border shadow-sm w-full rounded-md cursor-pointer",theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},onClick:()=>window.open("https://invoiceninja.github.io","_blank"),style:{borderColor:t.$24},children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(B5t,{color:t.$3,size:"1.4rem"}),h.jsx("span",{className:"text-sm",style:{color:t.$3},children:n("api_docs")})]}),h.jsx("div",{children:h.jsx(vS,{color:t.$3,size:"1.4rem",strokeWidth:"1.5"})})]}),h.jsx("div",{className:"py-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,style:{borderColor:t.$20}})}),h.jsxs(L5,{className:"flex justify-between items-center p-4 border shadow-sm w-full rounded-md cursor-pointer",theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},onClick:()=>window.open("https://zapier.com/apps/invoice-ninja/integrations","_blank"),style:{borderColor:t.$24},children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx($5t,{color:t.$3,size:"1.4rem"}),h.jsx("span",{className:"text-sm",style:{color:t.$3},children:"Zapier"})]}),h.jsx("div",{children:h.jsx(vS,{color:t.$3,size:"1.4rem",strokeWidth:"1.5"})})]}),h.jsxs(L5,{className:"flex justify-between items-center p-4 border shadow-sm w-full rounded-md cursor-pointer",theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},onClick:()=>e("/settings/integrations/analytics"),style:{borderColor:t.$24},children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(GKe,{color:t.$3,size:"1.4rem",strokeWidth:"1"}),h.jsx("span",{className:"text-sm",style:{color:t.$3},children:n("analytics")})]}),h.jsx("div",{children:h.jsx(vS,{color:t.$3,size:"1.4rem",strokeWidth:"1.5"})})]})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function YKe(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("line",{x1:"1.75",y1:"7.25",x2:"16.25",y2:"7.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("rect",{x:"1.75",y:"3.75",width:"14.5",height:"10.5",rx:"2",ry:"2",transform:"translate(18 18) rotate(180)",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"4.25",y1:"11.25",x2:"7.25",y2:"11.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"12.75",y1:"11.25",x2:"13.75",y2:"11.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function V5t({color:n="#000",size:e="24px",fillColor:t="none"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{color:n,width:e,height:e},viewBox:"0 0 24 24",children:[h.jsx("path",{d:"m16,8v-3c0-2.209-1.791-4-4-4h0c-2.209,0-4,1.791-4,4v3",fill:"none",stroke:n,"stroke-miterlimit":"10","stroke-width":"2","data-color":"color-2","data-cap":"butt"}),h.jsx("circle",{cx:"12",cy:"15",r:"8",fill:"none",stroke:n,"stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"2"}),h.jsx("line",{x1:"12",y1:"14",x2:"12",y2:"17",fill:t,stroke:n,"stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"2","data-color":"color-2"}),h.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"#000",stroke:"#000","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"2","data-color":"color-2"})]})}const bRe=As.div` background-color: ${({theme:n})=>n.backgroundColor}; &:hover { background-color: ${({theme:n})=>n.hoverBackgroundColor}; } `;function W5t(){const[n]=xe(),e=xt(),t="https://invoiceninja.invoicing.co/client/subscriptions/O5xe7Rwd7r/purchase",[i,r]=x.useState(!1),s=fd({initialValues:{license:""},onSubmit:o=>{pe.processing(),Je("POST",ze("/api/v1/claim_license?license_key=:key",{key:o.license})).then(()=>{pe.success("bought_white_label"),r(!1)}).finally(()=>s.setSubmitting(!1))}});return h.jsxs(h.Fragment,{children:[h.jsx(pr,{title:n("apply_license"),visible:i,onClose:r,children:h.jsxs("form",{onSubmit:s.handleSubmit,className:"space-y-4",children:[h.jsx(lt,{onChange:s.handleChange,label:n("license"),id:"license",required:!0}),h.jsx(dn,{disabled:s.isSubmitting,variant:"block",children:n("submit")})]})}),h.jsx("div",{className:"px-4 sm:px-6 pb-6",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,style:{borderColor:e.$20}})}),h.jsxs("div",{className:"flex flex-col w-full space-y-4 px-4 sm:px-6",children:[h.jsxs(bRe,{className:"flex justify-between items-center p-4 border shadow-sm w-full rounded-md cursor-pointer",onClick:()=>window.open(t,"_blank"),theme:{backgroundColor:e.$1,hoverBackgroundColor:e.$4},style:{borderColor:e.$24},children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(YKe,{color:e.$3,size:"1.4rem"}),h.jsx("span",{className:"text-sm",style:{color:e.$3},children:n("purchase_license")})]}),h.jsx("div",{children:h.jsx(vS,{color:e.$3,size:"1.4rem",strokeWidth:"1.5"})})]}),h.jsxs(bRe,{className:"flex space-x-2 items-center p-4 border shadow-sm w-full rounded-md cursor-pointer",onClick:()=>r(!0),theme:{backgroundColor:e.$1,hoverBackgroundColor:e.$4},style:{borderColor:e.$24},children:[h.jsx("div",{children:h.jsx(V5t,{color:e.$3,size:"1.4rem"})}),h.jsx("span",{className:"text-sm",style:{color:e.$3},children:n("apply_license")})]})]})]})}var z5t=Symbol.for("react.element"),U5t=Symbol.for("react.transitional.element"),q5t=Symbol.for("react.fragment");function QKe(n){return n&&Mr(n)==="object"&&(n.$$typeof===z5t||n.$$typeof===U5t)&&n.type===q5t}function Iq(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return we.Children.forEach(n,function(i){i==null&&!e.keepEmpty||(Array.isArray(i)?t=t.concat(Iq(i)):QKe(i)&&i.props?t=t.concat(Iq(i.props.children,e)):t.push(i))}),t}var efe={},K5t=function(e){};function G5t(n,e){}function Y5t(n,e){}function Q5t(){efe={}}function XKe(n,e,t){!e&&!efe[t]&&(n(!1,t),efe[t]=!0)}function lg(n,e){XKe(G5t,n,e)}function X5t(n,e){XKe(Y5t,n,e)}lg.preMessage=K5t;lg.resetWarned=Q5t;lg.noteOnce=X5t;function b8(n){return n instanceof HTMLElement||n instanceof SVGElement}function Z5t(n){return n&&Mr(n)==="object"&&b8(n.nativeElement)?n.nativeElement:b8(n)?n:null}function wz(n){var e=Z5t(n);if(e)return e;if(n instanceof we.Component){var t;return(t=J6.findDOMNode)===null||t===void 0?void 0:t.call(J6,n)}return null}var Mre={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 yRe;function J5t(){if(yRe)return Ha;yRe=1;var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g;g=Symbol.for("react.module.reference");function m(_){if(typeof _=="object"&&_!==null){var v=_.$$typeof;switch(v){case n:switch(_=_.type,_){case t:case r:case i:case c:case u:return _;default:switch(_=_&&_.$$typeof,_){case a:case o:case l:case f:case d:case s:return _;default:return v}}case e:return v}}}return Ha.ContextConsumer=o,Ha.ContextProvider=s,Ha.Element=n,Ha.ForwardRef=l,Ha.Fragment=t,Ha.Lazy=f,Ha.Memo=d,Ha.Portal=e,Ha.Profiler=r,Ha.StrictMode=i,Ha.Suspense=c,Ha.SuspenseList=u,Ha.isAsyncMode=function(){return!1},Ha.isConcurrentMode=function(){return!1},Ha.isContextConsumer=function(_){return m(_)===o},Ha.isContextProvider=function(_){return m(_)===s},Ha.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===n},Ha.isForwardRef=function(_){return m(_)===l},Ha.isFragment=function(_){return m(_)===t},Ha.isLazy=function(_){return m(_)===f},Ha.isMemo=function(_){return m(_)===d},Ha.isPortal=function(_){return m(_)===e},Ha.isProfiler=function(_){return m(_)===r},Ha.isStrictMode=function(_){return m(_)===i},Ha.isSuspense=function(_){return m(_)===c},Ha.isSuspenseList=function(_){return m(_)===u},Ha.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===t||_===r||_===i||_===c||_===u||_===p||typeof _=="object"&&_!==null&&(_.$$typeof===f||_.$$typeof===d||_.$$typeof===s||_.$$typeof===o||_.$$typeof===l||_.$$typeof===g||_.getModuleId!==void 0)},Ha.typeOf=m,Ha}var CRe;function ejt(){return CRe||(CRe=1,Mre.exports=J5t()),Mre.exports}var jre=ejt();function Wwe(n,e,t){var i=x.useRef({});return(!("value"in i.current)||t(i.current.condition,e))&&(i.current.value=n(),i.current.condition=e),i.current.value}var tjt=Number(x.version.split(".")[0]),zwe=function(e,t){typeof e=="function"?e(t):Mr(e)==="object"&&e&&"current"in e&&(e.current=t)},mJ=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var r=t.filter(Boolean);return r.length<=1?r[0]:function(s){t.forEach(function(o){zwe(o,s)})}},_J=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Wwe(function(){return mJ.apply(void 0,t)},t,function(r,s){return r.length!==s.length||r.every(function(o,a){return o!==s[a]})})},a9=function(e){var t,i;if(!e)return!1;if(ZKe(e)&&tjt>=19)return!0;var r=jre.isMemo(e)?e.type.type:e.type;return!(typeof r=="function"&&!((t=r.prototype)!==null&&t!==void 0&&t.render)&&r.$$typeof!==jre.ForwardRef||typeof e=="function"&&!((i=e.prototype)!==null&&i!==void 0&&i.render)&&e.$$typeof!==jre.ForwardRef)};function ZKe(n){return x.isValidElement(n)&&!QKe(n)}var vJ=function(e){if(e&&ZKe(e)){var t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null},tfe=x.createContext(null);function njt(n){var e=n.children,t=n.onBatchResize,i=x.useRef(0),r=x.useRef([]),s=x.useContext(tfe),o=x.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=[])}),s==null||s(a,l,c)},[t,s]);return x.createElement(tfe.Provider,{value:o},e)}var JKe=function(){if(typeof Map<"u")return Map;function n(e,t){var i=-1;return e.some(function(r,s){return r[0]===t?(i=s,!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,s=this.__entries__;r<s.length;r++){var o=s[r];t.call(i,o[1],o[0])}},e}()}(),nfe=typeof window<"u"&&typeof document<"u"&&window.document===document,Lq=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")()}(),ijt=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Lq):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),rjt=2;function sjt(n,e){var t=!1,i=!1,r=0;function s(){t&&(t=!1,n()),i&&a()}function o(){ijt(s)}function a(){var l=Date.now();if(t){if(l-r<rjt)return;i=!0}else t=!0,i=!1,setTimeout(o,e);r=l}return a}var ojt=20,ajt=["top","right","bottom","left","width","height","size","weight"],ljt=typeof MutationObserver<"u",cjt=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=sjt(this.refresh.bind(this),ojt)}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(){!nfe||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ljt?(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(){!nfe||!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=ajt.some(function(s){return!!~i.indexOf(s)});r&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),eGe=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},IO=function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||Lq},tGe=bJ(0,0,0,0);function Aq(n){return parseFloat(n)||0}function wRe(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(i,r){var s=n["border-"+r+"-width"];return i+Aq(s)},0)}function ujt(n){for(var e=["top","right","bottom","left"],t={},i=0,r=e;i<r.length;i++){var s=r[i],o=n["padding-"+s];t[s]=Aq(o)}return t}function djt(n){var e=n.getBBox();return bJ(0,0,e.width,e.height)}function hjt(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return tGe;var i=IO(n).getComputedStyle(n),r=ujt(i),s=r.left+r.right,o=r.top+r.bottom,a=Aq(i.width),l=Aq(i.height);if(i.boxSizing==="border-box"&&(Math.round(a+s)!==e&&(a-=wRe(i,"left","right")+s),Math.round(l+o)!==t&&(l-=wRe(i,"top","bottom")+o)),!pjt(n)){var c=Math.round(a+s)-e,u=Math.round(l+o)-t;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return bJ(r.left,r.top,a,l)}var fjt=function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof IO(n).SVGGraphicsElement}:function(n){return n instanceof IO(n).SVGElement&&typeof n.getBBox=="function"}}();function pjt(n){return n===IO(n).document.documentElement}function gjt(n){return nfe?fjt(n)?djt(n):hjt(n):tGe}function mjt(n){var e=n.x,t=n.y,i=n.width,r=n.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(s.prototype);return eGe(o,{x:e,y:t,width:i,height:r,top:t,right:e+i,bottom:r+t,left:e}),o}function bJ(n,e,t,i){return{x:n,y:e,width:t,height:i}}var _jt=function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=bJ(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=gjt(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}(),vjt=function(){function n(e,t){var i=mjt(t);eGe(this,{target:e,contentRect:i})}return n}(),bjt=function(){function n(e,t,i){if(this.activeObservations_=[],this.observations_=new JKe,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 IO(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new _jt(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 IO(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 vjt(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}(),nGe=typeof WeakMap<"u"?new WeakMap:new JKe,iGe=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=cjt.getInstance(),i=new bjt(e,t,this);nGe.set(this,i)}return n}();["observe","unobserve","disconnect"].forEach(function(n){iGe.prototype[n]=function(){var e;return(e=nGe.get(this))[n].apply(e,arguments)}});var yjt=function(){return typeof Lq.ResizeObserver<"u"?Lq.ResizeObserver:iGe}(),DS=new Map;function Cjt(n){n.forEach(function(e){var t,i=e.target;(t=DS.get(i))===null||t===void 0||t.forEach(function(r){return r(i)})})}var rGe=new yjt(Cjt);function wjt(n,e){DS.has(n)||(DS.set(n,new Set),rGe.observe(n)),DS.get(n).add(e)}function xjt(n,e){DS.has(n)&&(DS.get(n).delete(e),DS.get(n).size||(rGe.unobserve(n),DS.delete(n)))}var Sjt=function(n){$m(t,n);var e=Hw(t);function t(){return Ra(this,t),e.apply(this,arguments)}return Pa(t,[{key:"render",value:function(){return this.props.children}}]),t}(x.Component);function Ejt(n,e){var t=n.children,i=n.disabled,r=x.useRef(null),s=x.useRef(null),o=x.useContext(tfe),a=typeof t=="function",l=a?t(r):t,c=x.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!a&&x.isValidElement(l)&&a9(l),d=u?vJ(l):null,f=_J(d,r),p=function(){var v;return wz(r.current)||(r.current&&Mr(r.current)==="object"?wz((v=r.current)===null||v===void 0?void 0:v.nativeElement):null)||wz(s.current)};x.useImperativeHandle(e,function(){return p()});var g=x.useRef(n);g.current=n;var m=x.useCallback(function(_){var v=g.current,b=v.onResize,y=v.data,C=_.getBoundingClientRect(),S=C.width,k=C.height,I=_.offsetWidth,L=_.offsetHeight,N=Math.floor(S),P=Math.floor(k);if(c.current.width!==N||c.current.height!==P||c.current.offsetWidth!==I||c.current.offsetHeight!==L){var O={width:N,height:P,offsetWidth:I,offsetHeight:L};c.current=O;var F=I===Math.round(S)?S:I,V=L===Math.round(k)?k:L,M=ut(ut({},O),{},{offsetWidth:F,offsetHeight:V});o==null||o(M,_,y),b&&Promise.resolve().then(function(){b(M,_)})}},[]);return x.useEffect(function(){var _=p();return _&&!i&&wjt(_,m),function(){return xjt(_,m)}},[r.current,i]),x.createElement(Sjt,{ref:s},u?x.cloneElement(l,{ref:f}):l)}var kjt=x.forwardRef(Ejt),Tjt="rc-observer-key";function Ijt(n,e){var t=n.children,i=typeof t=="function"?[t]:Iq(t);return i.map(function(r,s){var o=(r==null?void 0:r.key)||"".concat(Tjt,"-").concat(s);return x.createElement(kjt,hn({},n,{key:o,ref:s===0?e:void 0}),r)})}var bA=x.forwardRef(Ijt);bA.Collection=njt;var sGe=function(e){return+setTimeout(e,16)},oGe=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(sGe=function(e){return window.requestAnimationFrame(e)},oGe=function(e){return window.cancelAnimationFrame(e)});var xRe=0,Uwe=new Map;function aGe(n){Uwe.delete(n)}var Eh=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;xRe+=1;var i=xRe;function r(s){if(s===0)aGe(i),e();else{var o=sGe(function(){r(s-1)});Uwe.set(i,o)}}return r(t),i};Eh.cancel=function(n){var e=Uwe.get(n);return aGe(n),oGe(e)};function y8(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 Nm(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Ljt(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 SRe="data-rc-order",ERe="data-rc-priority",Ajt="rc-util-key",ife=new Map;function lGe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=n.mark;return e?e.startsWith("data-")?e:"data-".concat(e):Ajt}function yJ(n){if(n.attachTo)return n.attachTo;var e=document.querySelector("head");return e||document.body}function Njt(n){return n==="queue"?"prependQueue":n?"prepend":"append"}function qwe(n){return Array.from((ife.get(n)||n).children).filter(function(e){return e.tagName==="STYLE"})}function cGe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Nm())return null;var t=e.csp,i=e.prepend,r=e.priority,s=r===void 0?0:r,o=Njt(i),a=o==="prependQueue",l=document.createElement("style");l.setAttribute(SRe,o),a&&s&&l.setAttribute(ERe,"".concat(s)),t!=null&&t.nonce&&(l.nonce=t==null?void 0:t.nonce),l.innerHTML=n;var c=yJ(e),u=c.firstChild;if(i){if(a){var d=(e.styles||qwe(c)).filter(function(f){if(!["prepend","prependQueue"].includes(f.getAttribute(SRe)))return!1;var p=Number(f.getAttribute(ERe)||0);return s>=p});if(d.length)return c.insertBefore(l,d[d.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function uGe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=yJ(e);return(e.styles||qwe(t)).find(function(i){return i.getAttribute(lGe(e))===n})}function C8(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=uGe(n,e);if(t){var i=yJ(e);i.removeChild(t)}}function Djt(n,e){var t=ife.get(n);if(!t||!Ljt(document,t)){var i=cGe("",e),r=i.parentNode;ife.set(n,r),n.removeChild(i)}}function ow(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=yJ(t),r=qwe(i),s=ut(ut({},t),{},{styles:r});Djt(i,s);var o=uGe(e,s);if(o){var a,l;if((a=s.csp)!==null&&a!==void 0&&a.nonce&&o.nonce!==((l=s.csp)===null||l===void 0?void 0:l.nonce)){var c;o.nonce=(c=s.csp)===null||c===void 0?void 0:c.nonce}return o.innerHTML!==n&&(o.innerHTML=n),o}var u=cGe(n,s);return u.setAttribute(lGe(s),e),u}function rfe(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=new Set;function r(s,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=i.has(s);if(lg(!l,"Warning: There may be circular references"),l)return!1;if(s===o)return!0;if(t&&a>1)return!1;i.add(s);var c=a+1;if(Array.isArray(s)){if(!Array.isArray(o)||s.length!==o.length)return!1;for(var u=0;u<s.length;u++)if(!r(s[u],o[u],c))return!1;return!0}if(s&&o&&Mr(s)==="object"&&Mr(o)==="object"){var d=Object.keys(s);return d.length!==Object.keys(o).length?!1:d.every(function(f){return r(s[f],o[f],c)})}return!1}return r(n,e)}var Rjt="%";function sfe(n){return n.join(Rjt)}var Pjt=function(){function n(e){Ra(this,n),wt(this,"instanceId",void 0),wt(this,"cache",new Map),this.instanceId=e}return Pa(n,[{key:"get",value:function(t){return this.opGet(sfe(t))}},{key:"opGet",value:function(t){return this.cache.get(t)||null}},{key:"update",value:function(t,i){return this.opUpdate(sfe(t),i)}},{key:"opUpdate",value:function(t,i){var r=this.cache.get(t),s=i(r);s===null?this.cache.delete(t):this.cache.set(t,s)}}]),n}(),LO="data-token-hash",wb="data-css-hash",RS="__cssinjs_instance__";function Ojt(){var n=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var e=document.body.querySelectorAll("style[".concat(wb,"]"))||[],t=document.head.firstChild;Array.from(e).forEach(function(r){r[RS]=r[RS]||n,r[RS]===n&&document.head.insertBefore(r,t)});var i={};Array.from(document.querySelectorAll("style[".concat(wb,"]"))).forEach(function(r){var s=r.getAttribute(wb);if(i[s]){if(r[RS]===n){var o;(o=r.parentNode)===null||o===void 0||o.removeChild(r)}}else i[s]=!0})}return new Pjt(n)}var l9=x.createContext({hashPriority:"low",cache:Ojt(),defaultCache:!0});function Mjt(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 Kwe=function(){function n(){Ra(this,n),wt(this,"cache",void 0),wt(this,"keys",void 0),wt(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Pa(n,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(t){var i,r,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o={map:this.cache};return t.forEach(function(a){if(!o)o=void 0;else{var l;o=(l=o)===null||l===void 0||(l=l.map)===null||l===void 0?void 0:l.get(a)}}),(i=o)!==null&&i!==void 0&&i.value&&s&&(o.value[1]=this.cacheCallTimes++),(r=o)===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 s=this.keys.reduce(function(c,u){var d=Mt(c,2),f=d[1];return r.internalGet(u)[1]<f?[u,r.internalGet(u)[1]]:c},[this.keys[0],this.cacheCallTimes]),o=Mt(s,1),a=o[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 s;return r.map?t.set(i[0],{map:r.map}):t.delete(i[0]),(s=r.value)===null||s===void 0?void 0:s[0]}var o=this.deleteByPath(r.map,i.slice(1));return(!r.map||r.map.size===0)&&!r.value&&t.delete(i[0]),o}},{key:"delete",value:function(t){if(this.has(t))return this.keys=this.keys.filter(function(i){return!Mjt(i,t)}),this.deleteByPath(this.cache,t)}}]),n}();wt(Kwe,"MAX_CACHE_SIZE",20);wt(Kwe,"MAX_CACHE_OFFSET",5);var kRe=0,dGe=function(){function n(e){Ra(this,n),wt(this,"derivatives",void 0),wt(this,"id",void 0),this.derivatives=Array.isArray(e)?e:[e],this.id=kRe,e.length===0&&(e.length>0,void 0),kRe+=1}return Pa(n,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(i,r){return r(t,i)},void 0)}}]),n}(),Fre=new Kwe;function ofe(n){var e=Array.isArray(n)?n:[n];return Fre.has(e)||Fre.set(e,new dGe(e)),Fre.get(e)}var jjt=new WeakMap,Bre={};function Fjt(n,e){for(var t=jjt,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(Bre)||t.set(Bre,n()),t.get(Bre)}var TRe=new WeakMap;function kF(n){var e=TRe.get(n)||"";return e||(Object.keys(n).forEach(function(t){var i=n[t];e+=t,i instanceof dGe?e+=i.id:i&&Mr(i)==="object"?e+=kF(i):e+=i}),e=y8(e),TRe.set(n,e)),e}function IRe(n,e){return y8("".concat(e,"_").concat(kF(n)))}var afe=Nm();function Fi(n){return typeof n=="number"?"".concat(n,"px"):n}function Nq(n,e,t){var i,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(s)return n;var o=ut(ut({},r),{},(i={},wt(i,LO,e),wt(i,wb,t),i)),a=Object.keys(o).map(function(l){var c=o[l];return c?"".concat(l,'="').concat(c,'"'):null}).filter(function(l){return l}).join(" ");return"<style ".concat(a,">").concat(n,"</style>")}var xz=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(t?"".concat(t,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},Bjt=function(e,t,i){return Object.keys(e).length?".".concat(t).concat(i!=null&&i.scope?".".concat(i.scope):"","{").concat(Object.entries(e).map(function(r){var s=Mt(r,2),o=s[0],a=s[1];return"".concat(o,":").concat(a,";")}).join(""),"}"):""},hGe=function(e,t,i){var r={},s={};return Object.entries(e).forEach(function(o){var a,l,c=Mt(o,2),u=c[0],d=c[1];if(i!=null&&(a=i.preserve)!==null&&a!==void 0&&a[u])s[u]=d;else if((typeof d=="string"||typeof d=="number")&&!(i!=null&&(l=i.ignore)!==null&&l!==void 0&&l[u])){var f,p=xz(u,i==null?void 0:i.prefix);r[p]=typeof d=="number"&&!(i!=null&&(f=i.unitless)!==null&&f!==void 0&&f[u])?"".concat(d,"px"):String(d),s[u]="var(".concat(p,")")}}),[s,Bjt(r,t,{scope:i==null?void 0:i.scope})]},LRe=Nm()?x.useLayoutEffect:x.useEffect,uc=function(e,t){var i=x.useRef(!0);LRe(function(){return e(i.current)},t),LRe(function(){return i.current=!1,function(){i.current=!0}},[])},lfe=function(e,t){uc(function(i){if(!i)return e()},t)},$jt=ut({},q_),ARe=$jt.useInsertionEffect,Hjt=function(e,t,i){x.useMemo(e,i),uc(function(){return t(!0)},i)},Vjt=ARe?function(n,e,t){return ARe(function(){return n(),e()},t)}:Hjt,Wjt=ut({},q_),zjt=Wjt.useInsertionEffect,Ujt=function(e){var t=[],i=!1;function r(s){i||t.push(s)}return x.useEffect(function(){return i=!1,function(){i=!0,t.length&&t.forEach(function(s){return s()})}},e),r},qjt=function(){return function(e){e()}},Kjt=typeof zjt<"u"?Ujt:qjt;function Gwe(n,e,t,i,r){var s=x.useContext(l9),o=s.cache,a=[n].concat(_r(e)),l=sfe(a),c=Kjt([l]),u=function(g){o.opUpdate(l,function(m){var _=m||[void 0,void 0],v=Mt(_,2),b=v[0],y=b===void 0?0:b,C=v[1],S=C,k=S||t(),I=[y,k];return g?g(I):I})};x.useMemo(function(){u()},[l]);var d=o.opGet(l),f=d[1];return Vjt(function(){r==null||r(f)},function(p){return u(function(g){var m=Mt(g,2),_=m[0],v=m[1];return p&&_===0&&(r==null||r(f)),[_+1,v]}),function(){o.opUpdate(l,function(g){var m=g||[],_=Mt(m,2),v=_[0],b=v===void 0?0:v,y=_[1],C=b-1;return C===0?(c(function(){(p||!o.opGet(l))&&(i==null||i(y,!1))}),null):[b-1,y]})}},[l]),f}var Gjt={},Yjt="css",f2=new Map;function Qjt(n){f2.set(n,(f2.get(n)||0)+1)}function Xjt(n,e){if(typeof document<"u"){var t=document.querySelectorAll("style[".concat(LO,'="').concat(n,'"]'));t.forEach(function(i){if(i[RS]===e){var r;(r=i.parentNode)===null||r===void 0||r.removeChild(i)}})}}var Zjt=0;function Jjt(n,e){f2.set(n,(f2.get(n)||0)-1);var t=Array.from(f2.keys()),i=t.filter(function(r){var s=f2.get(r)||0;return s<=0});t.length-i.length>Zjt&&i.forEach(function(r){Xjt(r,e),f2.delete(r)})}var eFt=function(e,t,i,r){var s=i.getDerivativeToken(e),o=ut(ut({},s),t);return r&&(o=r(o)),o},fGe="token";function tFt(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=x.useContext(l9),r=i.cache.instanceId,s=i.container,o=t.salt,a=o===void 0?"":o,l=t.override,c=l===void 0?Gjt:l,u=t.formatToken,d=t.getComputedToken,f=t.cssVar,p=Fjt(function(){return Object.assign.apply(Object,[{}].concat(_r(e)))},e),g=kF(p),m=kF(c),_=f?kF(f):"",v=Gwe(fGe,[a,n.id,g,m,_],function(){var b,y=d?d(p,c,n):eFt(p,c,n,u),C=ut({},y),S="";if(f){var k=hGe(y,f.key,{prefix:f.prefix,ignore:f.ignore,unitless:f.unitless,preserve:f.preserve}),I=Mt(k,2);y=I[0],S=I[1]}var L=IRe(y,a);y._tokenKey=L,C._tokenKey=IRe(C,a);var N=(b=f==null?void 0:f.key)!==null&&b!==void 0?b:L;y._themeKey=N,Qjt(N);var P="".concat(Yjt,"-").concat(y8(L));return y._hashId=P,[y,P,C,S,(f==null?void 0:f.key)||""]},function(b){Jjt(b[0]._themeKey,r)},function(b){var y=Mt(b,4),C=y[0],S=y[3];if(f&&S){var k=ow(S,y8("css-variables-".concat(C._themeKey)),{mark:wb,prepend:"queue",attachTo:s,priority:-999});k[RS]=r,k.setAttribute(LO,C._themeKey)}});return v}var nFt=function(e,t,i){var r=Mt(e,5),s=r[2],o=r[3],a=r[4],l=i||{},c=l.plain;if(!o)return null;var u=s._tokenKey,d=-999,f={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},p=Nq(o,a,u,f,c);return[d,u,p]},iFt={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},pGe="comm",gGe="rule",mGe="decl",rFt="@import",sFt="@namespace",oFt="@keyframes",aFt="@layer",_Ge=Math.abs,Ywe=String.fromCharCode;function vGe(n){return n.trim()}function Sz(n,e,t){return n.replace(e,t)}function lFt(n,e,t){return n.indexOf(e,t)}function bP(n,e){return n.charCodeAt(e)|0}function AO(n,e,t){return n.slice(e,t)}function X0(n){return n.length}function cFt(n){return n.length}function qH(n,e){return e.push(n),n}var CJ=1,NO=1,bGe=0,J_=0,ju=0,c4="";function Qwe(n,e,t,i,r,s,o,a){return{value:n,root:e,parent:t,type:i,props:r,children:s,line:CJ,column:NO,length:o,return:"",siblings:a}}function uFt(){return ju}function dFt(){return ju=J_>0?bP(c4,--J_):0,NO--,ju===10&&(NO=1,CJ--),ju}function xb(){return ju=J_<bGe?bP(c4,J_++):0,NO++,ju===10&&(NO=1,CJ++),ju}function PS(){return bP(c4,J_)}function Ez(){return J_}function wJ(n,e){return AO(c4,n,e)}function w8(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 hFt(n){return CJ=NO=1,bGe=X0(c4=n),J_=0,[]}function fFt(n){return c4="",n}function $re(n){return vGe(wJ(J_-1,cfe(n===91?n+2:n===40?n+1:n)))}function pFt(n){for(;(ju=PS())&&ju<33;)xb();return w8(n)>2||w8(ju)>3?"":" "}function gFt(n,e){for(;--e&&xb()&&!(ju<48||ju>102||ju>57&&ju<65||ju>70&&ju<97););return wJ(n,Ez()+(e<6&&PS()==32&&xb()==32))}function cfe(n){for(;xb();)switch(ju){case n:return J_;case 34:case 39:n!==34&&n!==39&&cfe(ju);break;case 40:n===41&&cfe(n);break;case 92:xb();break}return J_}function mFt(n,e){for(;xb()&&n+ju!==57;)if(n+ju===84&&PS()===47)break;return"/*"+wJ(e,J_-1)+"*"+Ywe(n===47?n:xb())}function _Ft(n){for(;!w8(PS());)xb();return wJ(n,J_)}function vFt(n){return fFt(kz("",null,null,null,[""],n=hFt(n),0,[0],n))}function kz(n,e,t,i,r,s,o,a,l){for(var c=0,u=0,d=o,f=0,p=0,g=0,m=1,_=1,v=1,b=0,y="",C=r,S=s,k=i,I=y;_;)switch(g=b,b=xb()){case 40:if(g!=108&&bP(I,d-1)==58){lFt(I+=Sz($re(b),"&","&\f"),"&\f",_Ge(c?a[c-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:I+=$re(b);break;case 9:case 10:case 13:case 32:I+=pFt(g);break;case 92:I+=gFt(Ez()-1,7);continue;case 47:switch(PS()){case 42:case 47:qH(bFt(mFt(xb(),Ez()),e,t,l),l),(w8(g||1)==5||w8(PS()||1)==5)&&X0(I)&&AO(I,-1,void 0)!==" "&&(I+=" ");break;default:I+="/"}break;case 123*m:a[c++]=X0(I)*v;case 125*m:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:v==-1&&(I=Sz(I,/\f/g,"")),p>0&&(X0(I)-d||m===0&&g===47)&&qH(p>32?DRe(I+";",i,t,d-1,l):DRe(Sz(I," ","")+";",i,t,d-2,l),l);break;case 59:I+=";";default:if(qH(k=NRe(I,e,t,c,u,r,a,y,C=[],S=[],d,s),s),b===123)if(u===0)kz(I,e,k,k,C,s,d,a,S);else{switch(f){case 99:if(bP(I,3)===110)break;case 108:if(bP(I,2)===97)break;default:u=0;case 100:case 109:case 115:}u?kz(n,k,k,i&&qH(NRe(n,k,k,0,0,r,a,y,r,C=[],d,S),S),r,S,d,a,i?C:S):kz(I,k,k,k,[""],S,0,a,S)}}c=u=p=0,m=v=1,y=I="",d=o;break;case 58:d=1+X0(I),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&dFt()==125)continue}switch(I+=Ywe(b),b*m){case 38:v=u>0?1:(I+="\f",-1);break;case 44:a[c++]=(X0(I)-1)*v,v=1;break;case 64:PS()===45&&(I+=$re(xb())),f=PS(),u=d=X0(y=I+=_Ft(Ez())),b++;break;case 45:g===45&&X0(I)==2&&(m=0)}}return s}function NRe(n,e,t,i,r,s,o,a,l,c,u,d){for(var f=r-1,p=r===0?s:[""],g=cFt(p),m=0,_=0,v=0;m<i;++m)for(var b=0,y=AO(n,f+1,f=_Ge(_=o[m])),C=n;b<g;++b)(C=vGe(_>0?p[b]+" "+y:Sz(y,/&\f/g,p[b])))&&(l[v++]=C);return Qwe(n,e,t,r===0?gGe:a,l,c,u,d)}function bFt(n,e,t,i){return Qwe(n,e,t,pGe,Ywe(uFt()),AO(n,2,-2),0,i)}function DRe(n,e,t,i,r){return Qwe(n,e,t,mGe,AO(n,0,i),AO(n,i+1,-1),i,r)}function ufe(n,e){for(var t="",i=0;i<n.length;i++)t+=e(n[i],i,n,e)||"";return t}function yFt(n,e,t,i){switch(n.type){case aFt:if(n.children.length)break;case rFt:case sFt:case mGe:return n.return=n.return||n.value;case pGe:return"";case oFt:return n.return=n.value+"{"+ufe(n.children,i)+"}";case gGe:if(!X0(n.value=n.props.join(",")))return""}return X0(t=ufe(n.children,i))?n.return=n.value+"{"+t+"}":""}var RRe="data-ant-cssinjs-cache-path",yGe="_FILE_STYLE__",sI,CGe=!0;function CFt(){if(!sI&&(sI={},Nm())){var n=document.createElement("div");n.className=RRe,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 s=r.split(":"),o=Mt(s,2),a=o[0],l=o[1];sI[a]=l});var t=document.querySelector("style[".concat(RRe,"]"));if(t){var i;CGe=!1,(i=t.parentNode)===null||i===void 0||i.removeChild(t)}document.body.removeChild(n)}}function wFt(n){return CFt(),!!sI[n]}function xFt(n){var e=sI[n],t=null;if(e&&Nm())if(CGe)t=yGe;else{var i=document.querySelector("style[".concat(wb,'="').concat(sI[n],'"]'));i?t=i.innerHTML:delete sI[n]}return[t,e]}var SFt="_skip_check_",wGe="_multi_value_";function Tz(n){var e=ufe(vFt(n),yFt);return e.replace(/\{%%%\:[^;];}/g,";")}function EFt(n){return Mr(n)==="object"&&n&&(SFt in n||wGe in n)}function PRe(n,e,t){if(!e)return n;var i=".".concat(e),r=t==="low"?":where(".concat(i,")"):i,s=n.split(",").map(function(o){var a,l=o.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(_r(l.slice(1))).join(" ")});return s.join(",")}var kFt=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,s=i.injectHash,o=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 f="",p={};function g(v){var b=v.getName(a);if(!p[b]){var y=n(v.style,t,{root:!1,parentSelectors:o}),C=Mt(y,1),S=C[0];p[b]="@keyframes ".concat(v.getName(a)).concat(S)}}function m(v){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return v.forEach(function(y){Array.isArray(y)?m(y,b):y&&b.push(y)}),b}var _=m(Array.isArray(e)?e:[e]);return _.forEach(function(v){var b=typeof v=="string"&&!r?{}:v;if(typeof b=="string")f+="".concat(b,` `);else if(b._keyframe)g(b);else{var y=d.reduce(function(C,S){var k;return(S==null||(k=S.visit)===null||k===void 0?void 0:k.call(S,C))||C},b);Object.keys(y).forEach(function(C){var S=y[C];if(Mr(S)==="object"&&S&&(C!=="animationName"||!S._keyframe)&&!EFt(S)){var k=!1,I=C.trim(),L=!1;(r||s)&&a?I.startsWith("@")?k=!0:I==="&"?I=PRe("",a,c):I=PRe(C,a,c):r&&!a&&(I==="&"||I==="")&&(I="",L=!0);var N=n(S,t,{root:L,injectHash:k,parentSelectors:[].concat(_r(o),[I])}),P=Mt(N,2),O=P[0],F=P[1];p=ut(ut({},p),F),f+="".concat(I).concat(O)}else{let B=function(W,q){var U=W.replace(/[A-Z]/g,function(H){return"-".concat(H.toLowerCase())}),G=q;!iFt[W]&&typeof G=="number"&&G!==0&&(G="".concat(G,"px")),W==="animationName"&&q!==null&&q!==void 0&&q._keyframe&&(g(q),G=q.getName(a)),f+="".concat(U,":").concat(G,";")};var V,M=(V=S==null?void 0:S.value)!==null&&V!==void 0?V:S;Mr(S)==="object"&&S!==null&&S!==void 0&&S[wGe]&&Array.isArray(M)?M.forEach(function(W){B(C,W)}):B(C,M)}})}}),r?l&&(f&&(f="@layer ".concat(l.name," {").concat(f,"}")),l.dependencies&&(p["@layer ".concat(l.name)]=l.dependencies.map(function(v){return"@layer ".concat(v,", ").concat(l.name,";")}).join(` `))):f="{".concat(f,"}"),[f,p]};function xGe(n,e){return y8("".concat(n.join("%")).concat(e))}function TFt(){return null}var SGe="style";function dfe(n,e){var t=n.token,i=n.path,r=n.hashId,s=n.layer,o=n.nonce,a=n.clientOnly,l=n.order,c=l===void 0?0:l,u=x.useContext(l9),d=u.autoClear;u.mock;var f=u.defaultCache,p=u.hashPriority,g=u.container,m=u.ssrInline,_=u.transformers,v=u.linters,b=u.cache,y=u.layer,C=t._tokenKey,S=[C];y&&S.push("layer"),S.push.apply(S,_r(i));var k=afe,I=Gwe(SGe,S,function(){var F=S.join("|");if(wFt(F)){var V=xFt(F),M=Mt(V,2),B=M[0],W=M[1];if(B)return[B,C,W,{},a,c]}var q=e(),U=kFt(q,{hashId:r,hashPriority:p,layer:y?s:void 0,path:i.join("-"),transformers:_,linters:v}),G=Mt(U,2),H=G[0],z=G[1],Z=Tz(H),X=xGe(S,Z);return[Z,C,X,z,a,c]},function(F,V){var M=Mt(F,3),B=M[2];(V||d)&&afe&&C8(B,{mark:wb})},function(F){var V=Mt(F,4),M=V[0];V[1];var B=V[2],W=V[3];if(k&&M!==yGe){var q={mark:wb,prepend:y?!1:"queue",attachTo:g,priority:c},U=typeof o=="function"?o():o;U&&(q.csp={nonce:U});var G=[],H=[];Object.keys(W).forEach(function(Z){Z.startsWith("@layer")?G.push(Z):H.push(Z)}),G.forEach(function(Z){ow(Tz(W[Z]),"_layer-".concat(Z),ut(ut({},q),{},{prepend:!0}))});var z=ow(M,B,q);z[RS]=b.instanceId,z.setAttribute(LO,C),H.forEach(function(Z){ow(Tz(W[Z]),"_effect-".concat(Z),q)})}}),L=Mt(I,3),N=L[0],P=L[1],O=L[2];return function(F){var V;if(!m||k||!f)V=x.createElement(TFt,null);else{var M;V=x.createElement("style",hn({},(M={},wt(M,LO,P),wt(M,wb,O),M),{dangerouslySetInnerHTML:{__html:N}}))}return x.createElement(x.Fragment,null,V,F)}}var IFt=function(e,t,i){var r=Mt(e,6),s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],d=i||{},f=d.plain;if(c)return null;var p=s,g={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return p=Nq(s,o,a,g,f),l&&Object.keys(l).forEach(function(m){if(!t[m]){t[m]=!0;var _=Tz(l[m]),v=Nq(_,o,"_effect-".concat(m),g,f);m.startsWith("@layer")?p=v+p:p+=v}}),[u,a,p]},EGe="cssVar",LFt=function(e,t){var i=e.key,r=e.prefix,s=e.unitless,o=e.ignore,a=e.token,l=e.scope,c=l===void 0?"":l,u=x.useContext(l9),d=u.cache.instanceId,f=u.container,p=a._tokenKey,g=[].concat(_r(e.path),[i,c,p]),m=Gwe(EGe,g,function(){var _=t(),v=hGe(_,i,{prefix:r,unitless:s,ignore:o,scope:c}),b=Mt(v,2),y=b[0],C=b[1],S=xGe(g,C);return[y,C,S,i]},function(_){var v=Mt(_,3),b=v[2];afe&&C8(b,{mark:wb})},function(_){var v=Mt(_,3),b=v[1],y=v[2];if(b){var C=ow(b,y,{mark:wb,prepend:"queue",attachTo:f,priority:-999});C[RS]=d,C.setAttribute(LO,i)}});return m},AFt=function(e,t,i){var r=Mt(e,4),s=r[1],o=r[2],a=r[3],l=i||{},c=l.plain;if(!s)return null;var u=-999,d={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},f=Nq(s,a,o,d,c);return[u,o,f]},A5;A5={},wt(A5,SGe,IFt),wt(A5,fGe,nFt),wt(A5,EGe,AFt);var mf=function(){function n(e,t){Ra(this,n),wt(this,"name",void 0),wt(this,"style",void 0),wt(this,"_keyframe",!0),this.name=e,this.style=t}return Pa(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 _D(n){return n.notSplit=!0,n}_D(["borderTop","borderBottom"]),_D(["borderTop"]),_D(["borderBottom"]),_D(["borderLeft","borderRight"]),_D(["borderLeft"]),_D(["borderRight"]);var Xwe=x.createContext({});function xy(n,e){for(var t=n,i=0;i<e.length;i+=1){if(t==null)return;t=t[e[i]]}return t}function kGe(n,e,t,i){if(!e.length)return t;var r=NVe(e),s=r[0],o=r.slice(1),a;return!n&&typeof s=="number"?a=[]:Array.isArray(n)?a=_r(n):a=ut({},n),i&&t===void 0&&o.length===1?delete a[s][o[0]]:a[s]=kGe(a[s],o,t,i),a}function Zv(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&i&&t===void 0&&!xy(n,e.slice(0,-1))?n:kGe(n,e,t,i)}function NFt(n){return Mr(n)==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype}function ORe(n){return Array.isArray(n)?[]:{}}var DFt=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function fR(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var i=ORe(e[0]);return e.forEach(function(r){function s(o,a){var l=new Set(a),c=xy(r,o),u=Array.isArray(c);if(u||NFt(c)){if(!l.has(c)){l.add(c);var d=xy(i,o);u?i=Zv(i,o,[]):(!d||Mr(d)!=="object")&&(i=Zv(i,o,ORe(c))),DFt(c).forEach(function(f){s([].concat(_r(o),[f]),l)})}}else i=Zv(i,o,c)}s([])}),i}const RFt=x.createContext({}),PFt=x.createContext(void 0);var OFt={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"},MFt={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},jFt=ut(ut({},MFt),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",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",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",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 TGe={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},Dq={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"]},jFt),timePickerLocale:Object.assign({},TGe)},zg="${label} is not a valid ${type}",DO={locale:"en",Pagination:OFt,DatePicker:Dq,TimePicker:TGe,Calendar:Dq,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",deselectAll:"Deselect 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",collapse:"Collapse"},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:zg,method:zg,array:zg,object:zg,number:zg,date:zg,boolean:zg,integer:zg,float:zg,regexp:zg,email:zg,url:zg,hex:zg},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",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};Object.assign({},DO.Modal);let Iz=[];const MRe=()=>Iz.reduce((n,e)=>Object.assign(Object.assign({},n),e),DO.Modal);function FFt(n){if(n){const e=Object.assign({},n);return Iz.push(e),MRe(),()=>{Iz=Iz.filter(t=>t!==e),MRe()}}Object.assign({},DO.Modal)}const Zwe=x.createContext(void 0),IGe=(n,e)=>{const t=x.useContext(Zwe),i=x.useMemo(()=>{var s;const o=e||DO[n],a=(s=t==null?void 0:t[n])!==null&&s!==void 0?s:{};return Object.assign(Object.assign({},typeof o=="function"?o():o),a||{})},[n,e,t]),r=x.useMemo(()=>{const s=t==null?void 0:t.locale;return t!=null&&t.exist&&!s?DO.locale:s},[t]);return[i,r]},BFt="internalMark",$Ft=n=>{const{locale:e={},children:t,_ANT_MARK__:i}=n;x.useEffect(()=>FFt(e==null?void 0:e.Modal),[e]);const r=x.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return x.createElement(Zwe.Provider,{value:r},t)},LGe={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"},x8=Object.assign(Object.assign({},LGe),{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}),Id=Math.round;function Hre(n,e){const t=n.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],i=t.map(r=>parseFloat(r));for(let r=0;r<3;r+=1)i[r]=e(i[r]||0,t[r]||"",r);return t[3]?i[3]=t[3].includes("%")?i[3]/100:i[3]:i[3]=1,i}const jRe=(n,e,t)=>t===0?n:n/100;function N5(n,e){const t=e||255;return n>t?t:n<0?0:n}class Ol{constructor(e){wt(this,"isValid",!0),wt(this,"r",0),wt(this,"g",0),wt(this,"b",0),wt(this,"a",1),wt(this,"_h",void 0),wt(this,"_s",void 0),wt(this,"_l",void 0),wt(this,"_v",void 0),wt(this,"_max",void 0),wt(this,"_min",void 0),wt(this,"_brightness",void 0);function t(i){return i[0]in e&&i[1]in e&&i[2]in e}if(e)if(typeof e=="string"){let r=function(s){return i.startsWith(s)};const i=e.trim();/^#?[A-F\d]{3,8}$/i.test(i)?this.fromHexString(i):r("rgb")?this.fromRgbString(i):r("hsl")?this.fromHslString(i):(r("hsv")||r("hsb"))&&this.fromHsvString(i)}else if(e instanceof Ol)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=N5(e.r),this.g=N5(e.g),this.b=N5(e.b),this.a=typeof e.a=="number"?N5(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else if(t("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(s){const o=s/255;return o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)}const t=e(this.r),i=e(this.g),r=e(this.b);return .2126*t+.7152*i+.0722*r}getHue(){if(typeof this._h>"u"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=Id(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const t=this.getHue(),i=this.getSaturation();let r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:i,l:r,a:this.a})}lighten(e=10){const t=this.getHue(),i=this.getSaturation();let r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:i,l:r,a:this.a})}mix(e,t=50){const i=this._c(e),r=t/100,s=a=>(i[a]-this[a])*r+this[a],o={r:Id(s("r")),g:Id(s("g")),b:Id(s("b")),a:Id(s("a")*100)/100};return this._c(o)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const t=this._c(e),i=this.a+t.a*(1-this.a),r=s=>Id((this[s]*this.a+t[s]*t.a*(1-this.a))/i);return this._c({r:r("r"),g:r("g"),b:r("b"),a:i})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const t=(this.r||0).toString(16);e+=t.length===2?t:"0"+t;const i=(this.g||0).toString(16);e+=i.length===2?i:"0"+i;const r=(this.b||0).toString(16);if(e+=r.length===2?r:"0"+r,typeof this.a=="number"&&this.a>=0&&this.a<1){const s=Id(this.a*255).toString(16);e+=s.length===2?s:"0"+s}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),t=Id(this.getSaturation()*100),i=Id(this.getLightness()*100);return this.a!==1?`hsla(${e},${t}%,${i}%,${this.a})`:`hsl(${e},${t}%,${i}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,i){const r=this.clone();return r[e]=N5(t,i),r}_c(e){return new this.constructor(e)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const t=e.replace("#","");function i(r,s){return parseInt(t[r]+t[s||r],16)}t.length<6?(this.r=i(0),this.g=i(1),this.b=i(2),this.a=t[3]?i(3)/255:1):(this.r=i(0,1),this.g=i(2,3),this.b=i(4,5),this.a=t[6]?i(6,7)/255:1)}fromHsl({h:e,s:t,l:i,a:r}){if(this._h=e%360,this._s=t,this._l=i,this.a=typeof r=="number"?r:1,t<=0){const f=Id(i*255);this.r=f,this.g=f,this.b=f}let s=0,o=0,a=0;const l=e/60,c=(1-Math.abs(2*i-1))*t,u=c*(1-Math.abs(l%2-1));l>=0&&l<1?(s=c,o=u):l>=1&&l<2?(s=u,o=c):l>=2&&l<3?(o=c,a=u):l>=3&&l<4?(o=u,a=c):l>=4&&l<5?(s=u,a=c):l>=5&&l<6&&(s=c,a=u);const d=i-c/2;this.r=Id((s+d)*255),this.g=Id((o+d)*255),this.b=Id((a+d)*255)}fromHsv({h:e,s:t,v:i,a:r}){this._h=e%360,this._s=t,this._v=i,this.a=typeof r=="number"?r:1;const s=Id(i*255);if(this.r=s,this.g=s,this.b=s,t<=0)return;const o=e/60,a=Math.floor(o),l=o-a,c=Id(i*(1-t)*255),u=Id(i*(1-t*l)*255),d=Id(i*(1-t*(1-l))*255);switch(a){case 0:this.g=d,this.b=c;break;case 1:this.r=u,this.b=c;break;case 2:this.r=c,this.b=d;break;case 3:this.r=c,this.g=u;break;case 4:this.r=d,this.g=c;break;case 5:default:this.g=c,this.b=u;break}}fromHsvString(e){const t=Hre(e,jRe);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){const t=Hre(e,jRe);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){const t=Hre(e,(i,r)=>r.includes("%")?Id(i/100*255):i);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}var KH=2,FRe=.16,HFt=.05,VFt=.05,WFt=.15,AGe=5,NGe=4,zFt=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function BRe(n,e,t){var i;return Math.round(n.h)>=60&&Math.round(n.h)<=240?i=t?Math.round(n.h)-KH*e:Math.round(n.h)+KH*e:i=t?Math.round(n.h)+KH*e:Math.round(n.h)-KH*e,i<0?i+=360:i>=360&&(i-=360),i}function $Re(n,e,t){if(n.h===0&&n.s===0)return n.s;var i;return t?i=n.s-FRe*e:e===NGe?i=n.s+FRe:i=n.s+HFt*e,i>1&&(i=1),t&&e===AGe&&i>.1&&(i=.1),i<.06&&(i=.06),Math.round(i*100)/100}function HRe(n,e,t){var i;return t?i=n.v+VFt*e:i=n.v-WFt*e,i=Math.max(0,Math.min(1,i)),Math.round(i*100)/100}function S8(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],i=new Ol(n),r=i.toHsv(),s=AGe;s>0;s-=1){var o=new Ol({h:BRe(r,s,!0),s:$Re(r,s,!0),v:HRe(r,s,!0)});t.push(o)}t.push(i);for(var a=1;a<=NGe;a+=1){var l=new Ol({h:BRe(r,a),s:$Re(r,a),v:HRe(r,a)});t.push(l)}return e.theme==="dark"?zFt.map(function(c){var u=c.index,d=c.amount;return new Ol(e.backgroundColor||"#141414").mix(t[u],d).toHexString()}):t.map(function(c){return c.toHexString()})}var Vre={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"},hfe=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];hfe.primary=hfe[5];var ffe=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];ffe.primary=ffe[5];var pfe=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];pfe.primary=pfe[5];var gfe=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];gfe.primary=gfe[5];var mfe=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];mfe.primary=mfe[5];var _fe=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];_fe.primary=_fe[5];var vfe=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];vfe.primary=vfe[5];var bfe=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];bfe.primary=bfe[5];var Rq=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Rq.primary=Rq[5];var yfe=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];yfe.primary=yfe[5];var Cfe=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];Cfe.primary=Cfe[5];var wfe=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];wfe.primary=wfe[5];var xfe=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];xfe.primary=xfe[5];var Wre={red:hfe,volcano:ffe,orange:pfe,gold:gfe,yellow:mfe,lime:_fe,green:vfe,cyan:bfe,blue:Rq,geekblue:yfe,purple:Cfe,magenta:wfe,grey:xfe};function UFt(n,e){let{generateColorPalettes:t,generateNeutralColorPalettes:i}=e;const{colorSuccess:r,colorWarning:s,colorError:o,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=n,d=t(l),f=t(r),p=t(s),g=t(o),m=t(a),_=i(c,u),v=n.colorLink||n.colorInfo,b=t(v),y=new Ol(g[1]).mix(new Ol(g[3]),50).toHexString();return Object.assign(Object.assign({},_),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:f[1],colorSuccessBgHover:f[2],colorSuccessBorder:f[3],colorSuccessBorderHover:f[4],colorSuccessHover:f[4],colorSuccess:f[6],colorSuccessActive:f[7],colorSuccessTextHover:f[8],colorSuccessText:f[9],colorSuccessTextActive:f[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBgFilledHover:y,colorErrorBgActive:g[3],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:p[1],colorWarningBgHover:p[2],colorWarningBorder:p[3],colorWarningBorderHover:p[4],colorWarningHover:p[4],colorWarning:p[6],colorWarningActive:p[7],colorWarningTextHover:p[8],colorWarningText:p[9],colorWarningTextActive:p[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 Ol("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const qFt=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}};function KFt(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},qFt(i))}const GFt=n=>{const{controlHeight:e}=n;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};function Lz(n){return(n+8)/n}function YFt(n){const e=Array.from({length:10}).map((t,i)=>{const r=i-1,s=n*Math.pow(Math.E,r/5),o=i>1?Math.floor(s):Math.ceil(s);return Math.floor(o/2)*2});return e[1]=n,e.map(t=>({size:t,lineHeight:Lz(t)}))}const QFt=n=>{const e=YFt(n),t=e.map(u=>u.size),i=e.map(u=>u.lineHeight),r=t[1],s=t[0],o=t[2],a=i[1],l=i[0],c=i[2];return{fontSizeSM:s,fontSize:r,fontSizeLG:o,fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:a,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(a*r),fontHeightLG:Math.round(c*o),fontHeightSM:Math.round(l*s),lineHeightHeading1:i[6],lineHeightHeading2:i[5],lineHeightHeading3:i[4],lineHeightHeading4:i[3],lineHeightHeading5:i[2]}};function XFt(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 m_=(n,e)=>new Ol(n).setA(e).toRgbString(),D5=(n,e)=>new Ol(n).darken(e).toHexString(),ZFt=n=>{const e=S8(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]}},JFt=(n,e)=>{const t=n||"#fff",i=e||"#000";return{colorBgBase:t,colorTextBase:i,colorText:m_(i,.88),colorTextSecondary:m_(i,.65),colorTextTertiary:m_(i,.45),colorTextQuaternary:m_(i,.25),colorFill:m_(i,.15),colorFillSecondary:m_(i,.06),colorFillTertiary:m_(i,.04),colorFillQuaternary:m_(i,.02),colorBgSolid:m_(i,1),colorBgSolidHover:m_(i,.75),colorBgSolidActive:m_(i,.95),colorBgLayout:D5(t,4),colorBgContainer:D5(t,0),colorBgElevated:D5(t,0),colorBgSpotlight:m_(i,.85),colorBgBlur:"transparent",colorBorder:D5(t,15),colorBorderSecondary:D5(t,6)}};function e6t(n){Vre.pink=Vre.magenta,Wre.pink=Wre.magenta;const e=Object.keys(LGe).map(t=>{const i=n[t]===Vre[t]?Wre[t]:S8(n[t]);return Array.from({length:10},()=>1).reduce((r,s,o)=>(r[`${t}-${o+1}`]=i[o],r[`${t}${o+1}`]=i[o],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),UFt(n,{generateColorPalettes:ZFt,generateNeutralColorPalettes:JFt})),QFt(n.fontSize)),XFt(n)),GFt(n)),KFt(n))}const DGe=ofe(e6t),Sfe={token:x8,override:{override:x8},hashed:!0},RGe=we.createContext(Sfe),Pq="ant",Jwe="anticon",t6t=["outlined","borderless","filled","underlined"],n6t=(n,e)=>e||(n?`${Pq}-${n}`:Pq),pg=x.createContext({getPrefixCls:n6t,iconPrefixCls:Jwe}),{Consumer:U3r}=pg,VRe={};function PGe(n){const e=x.useContext(pg),{getPrefixCls:t,direction:i,getPopupContainer:r}=e,s=e[n];return Object.assign(Object.assign({classNames:VRe,styles:VRe},s),{getPrefixCls:t,direction:i,getPopupContainer:r})}const i6t=`-ant-${Date.now()}-${Math.random()}`;function r6t(n,e){const t={},i=(o,a)=>{let l=o.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},r=(o,a)=>{const l=new Ol(o),c=S8(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().setA(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const o=new Ol(e.primaryColor),a=S8(o.toRgbString());a.forEach((c,u)=>{t[`primary-${u+1}`]=c}),t["primary-color-deprecated-l-35"]=i(o,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=i(o,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=i(o,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=i(o,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=i(o,c=>c.setA(c.a*.12));const l=new Ol(a[0]);t["primary-color-active-deprecated-f-30"]=i(l,c=>c.setA(c.a*.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(o=>`--${n}-${o}: ${t[o]};`).join(` `)} } `.trim()}function s6t(n,e){const t=r6t(n,e);Nm()&&ow(t,`${i6t}-dynamic-theme`)}const RO=x.createContext(!1),o6t=n=>{let{children:e,disabled:t}=n;const i=x.useContext(RO);return x.createElement(RO.Provider,{value:t??i},e)},PO=x.createContext(void 0),a6t=n=>{let{children:e,size:t}=n;const i=x.useContext(PO);return x.createElement(PO.Provider,{value:t||i},e)};function l6t(){const n=x.useContext(RO),e=x.useContext(PO);return{componentDisabled:n,componentSize:e}}var OGe=Pa(function n(){Ra(this,n)}),MGe="CALC_UNIT",c6t=new RegExp(MGe,"g");function zre(n){return typeof n=="number"?"".concat(n).concat(MGe):n}var u6t=function(n){$m(t,n);var e=Hw(t);function t(i,r){var s;Ra(this,t),s=e.call(this),wt(Bs(s),"result",""),wt(Bs(s),"unitlessCssVar",void 0),wt(Bs(s),"lowPriority",void 0);var o=Mr(i);return s.unitlessCssVar=r,i instanceof t?s.result="(".concat(i.result,")"):o==="number"?s.result=zre(i):o==="string"&&(s.result=i),s}return Pa(t,[{key:"add",value:function(r){return r instanceof t?this.result="".concat(this.result," + ").concat(r.getResult()):(typeof r=="number"||typeof r=="string")&&(this.result="".concat(this.result," + ").concat(zre(r))),this.lowPriority=!0,this}},{key:"sub",value:function(r){return r instanceof t?this.result="".concat(this.result," - ").concat(r.getResult()):(typeof r=="number"||typeof r=="string")&&(this.result="".concat(this.result," - ").concat(zre(r))),this.lowPriority=!0,this}},{key:"mul",value:function(r){return this.lowPriority&&(this.result="(".concat(this.result,")")),r instanceof t?this.result="".concat(this.result," * ").concat(r.getResult(!0)):(typeof r=="number"||typeof r=="string")&&(this.result="".concat(this.result," * ").concat(r)),this.lowPriority=!1,this}},{key:"div",value:function(r){return this.lowPriority&&(this.result="(".concat(this.result,")")),r instanceof t?this.result="".concat(this.result," / ").concat(r.getResult(!0)):(typeof r=="number"||typeof r=="string")&&(this.result="".concat(this.result," / ").concat(r)),this.lowPriority=!1,this}},{key:"getResult",value:function(r){return this.lowPriority||r?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(r){var s=this,o=r||{},a=o.unit,l=!0;return typeof a=="boolean"?l=a:Array.from(this.unitlessCssVar).some(function(c){return s.result.includes(c)})&&(l=!1),this.result=this.result.replace(c6t,l?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),t}(OGe),d6t=function(n){$m(t,n);var e=Hw(t);function t(i){var r;return Ra(this,t),r=e.call(this),wt(Bs(r),"result",0),i instanceof t?r.result=i.result:typeof i=="number"&&(r.result=i),r}return Pa(t,[{key:"add",value:function(r){return r instanceof t?this.result+=r.result:typeof r=="number"&&(this.result+=r),this}},{key:"sub",value:function(r){return r instanceof t?this.result-=r.result:typeof r=="number"&&(this.result-=r),this}},{key:"mul",value:function(r){return r instanceof t?this.result*=r.result:typeof r=="number"&&(this.result*=r),this}},{key:"div",value:function(r){return r instanceof t?this.result/=r.result:typeof r=="number"&&(this.result/=r),this}},{key:"equal",value:function(){return this.result}}]),t}(OGe),h6t=function(e,t){var i=e==="css"?u6t:d6t;return function(r){return new i(r,t)}},WRe=function(e,t){return"".concat([t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function Ta(n){var e=x.useRef();e.current=n;var t=x.useCallback(function(){for(var i,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return(i=e.current)===null||i===void 0?void 0:i.call.apply(i,[e].concat(s))},[]);return t}function E8(n){var e=x.useRef(!1),t=x.useState(n),i=Mt(t,2),r=i[0],s=i[1];x.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function o(a,l){l&&e.current||s(a)}return[r,o]}function Ure(n){return n!==void 0}function Dy(n,e){var t=e||{},i=t.defaultValue,r=t.value,s=t.onChange,o=t.postState,a=E8(function(){return Ure(r)?r:Ure(i)?typeof i=="function"?i():i:typeof n=="function"?n():n}),l=Mt(a,2),c=l[0],u=l[1],d=r!==void 0?r:c,f=o?o(d):d,p=Ta(s),g=E8([d]),m=Mt(g,2),_=m[0],v=m[1];lfe(function(){var y=_[0];c!==y&&p(c,y)},[_]),lfe(function(){Ure(r)||u(r)},[r]);var b=Ta(function(y,C){u(y,C),v([d],C)});return[f,b]}function zRe(n,e,t,i){var r=ut({},e[n]);if(i!=null&&i.deprecatedTokens){var s=i.deprecatedTokens;s.forEach(function(a){var l=Mt(a,2),c=l[0],u=l[1];if(r!=null&&r[c]||r!=null&&r[u]){var d;(d=r[u])!==null&&d!==void 0||(r[u]=r==null?void 0:r[c])}})}var o=ut(ut({},t),r);return Object.keys(o).forEach(function(a){o[a]===e[a]&&delete o[a]}),o}var jGe=typeof CSSINJS_STATISTIC<"u",Efe=!0;function gg(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];if(!jGe)return Object.assign.apply(Object,[{}].concat(e));Efe=!1;var i={};return e.forEach(function(r){if(Mr(r)==="object"){var s=Object.keys(r);s.forEach(function(o){Object.defineProperty(i,o,{configurable:!0,enumerable:!0,get:function(){return r[o]}})})}}),Efe=!0,i}var URe={};function f6t(){}var p6t=function(e){var t,i=e,r=f6t;return jGe&&typeof Proxy<"u"&&(t=new Set,i=new Proxy(e,{get:function(o,a){if(Efe){var l;(l=t)===null||l===void 0||l.add(a)}return o[a]}}),r=function(o,a){var l;URe[o]={global:Array.from(t),component:ut(ut({},(l=URe[o])===null||l===void 0?void 0:l.component),a)}}),{token:i,keys:t,flush:r}};function qRe(n,e,t){if(typeof t=="function"){var i;return t(gg(e,(i=e[n])!==null&&i!==void 0?i:{}))}return t??{}}function g6t(n){return n==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return"max(".concat(i.map(function(s){return Fi(s)}).join(","),")")},min:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return"min(".concat(i.map(function(s){return Fi(s)}).join(","),")")}}}var m6t=1e3*60*10,_6t=function(){function n(){Ra(this,n),wt(this,"map",new Map),wt(this,"objectIDMap",new WeakMap),wt(this,"nextID",0),wt(this,"lastAccessBeat",new Map),wt(this,"accessBeat",0)}return Pa(n,[{key:"set",value:function(t,i){this.clear();var r=this.getCompositeKey(t);this.map.set(r,i),this.lastAccessBeat.set(r,Date.now())}},{key:"get",value:function(t){var i=this.getCompositeKey(t),r=this.map.get(i);return this.lastAccessBeat.set(i,Date.now()),this.accessBeat+=1,r}},{key:"getCompositeKey",value:function(t){var i=this,r=t.map(function(s){return s&&Mr(s)==="object"?"obj_".concat(i.getObjectID(s)):"".concat(Mr(s),"_").concat(s)});return r.join("|")}},{key:"getObjectID",value:function(t){if(this.objectIDMap.has(t))return this.objectIDMap.get(t);var i=this.nextID;return this.objectIDMap.set(t,i),this.nextID+=1,i}},{key:"clear",value:function(){var t=this;if(this.accessBeat>1e4){var i=Date.now();this.lastAccessBeat.forEach(function(r,s){i-r>m6t&&(t.map.delete(s),t.lastAccessBeat.delete(s))}),this.accessBeat=0}}}]),n}(),KRe=new _6t;function v6t(n,e){return we.useMemo(function(){var t=KRe.get(e);if(t)return t;var i=n();return KRe.set(e,i),i},e)}var b6t=function(){return{}};function y6t(n){var e=n.useCSP,t=e===void 0?b6t:e,i=n.useToken,r=n.usePrefix,s=n.getResetStyles,o=n.getCommonStyle,a=n.getCompUnitless;function l(f,p,g,m){var _=Array.isArray(f)?f[0]:f;function v(L){return"".concat(String(_)).concat(L.slice(0,1).toUpperCase()).concat(L.slice(1))}var b=(m==null?void 0:m.unitless)||{},y=typeof a=="function"?a(f):{},C=ut(ut({},y),{},wt({},v("zIndexPopup"),!0));Object.keys(b).forEach(function(L){C[v(L)]=b[L]});var S=ut(ut({},m),{},{unitless:C,prefixToken:v}),k=u(f,p,g,S),I=c(_,g,S);return function(L){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L,P=k(L,N),O=Mt(P,2),F=O[1],V=I(N),M=Mt(V,2),B=M[0],W=M[1];return[B,F,W]}}function c(f,p,g){var m=g.unitless,_=g.injectStyle,v=_===void 0?!0:_,b=g.prefixToken,y=g.ignore,C=function(I){var L=I.rootCls,N=I.cssVar,P=N===void 0?{}:N,O=i(),F=O.realToken;return LFt({path:[f],prefix:P.prefix,key:P.key,unitless:m,ignore:y,token:F,scope:L},function(){var V=qRe(f,F,p),M=zRe(f,F,V,{deprecatedTokens:g==null?void 0:g.deprecatedTokens});return Object.keys(V).forEach(function(B){M[b(B)]=M[B],delete M[B]}),M}),null},S=function(I){var L=i(),N=L.cssVar;return[function(P){return v&&N?we.createElement(we.Fragment,null,we.createElement(C,{rootCls:I,cssVar:N,component:f}),P):P},N==null?void 0:N.key]};return S}function u(f,p,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},_=Array.isArray(f)?f:[f,f],v=Mt(_,1),b=v[0],y=_.join("-"),C=n.layer||{name:"antd"};return function(S){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S,I=i(),L=I.theme,N=I.realToken,P=I.hashId,O=I.token,F=I.cssVar,V=r(),M=V.rootPrefixCls,B=V.iconPrefixCls,W=t(),q=F?"css":"js",U=v6t(function(){var oe=new Set;return F&&Object.keys(m.unitless||{}).forEach(function(fe){oe.add(xz(fe,F.prefix)),oe.add(xz(fe,WRe(b,F.prefix)))}),h6t(q,oe)},[q,b,F==null?void 0:F.prefix]),G=g6t(q),H=G.max,z=G.min,Z={theme:L,token:O,hashId:P,nonce:function(){return W.nonce},clientOnly:m.clientOnly,layer:C,order:m.order||-999};typeof s=="function"&&dfe(ut(ut({},Z),{},{clientOnly:!1,path:["Shared",M]}),function(){return s(O,{prefix:{rootPrefixCls:M,iconPrefixCls:B},csp:W})});var X=dfe(ut(ut({},Z),{},{path:[y,S,B]}),function(){if(m.injectStyle===!1)return[];var oe=p6t(O),fe=oe.token,Se=oe.flush,Me=qRe(b,N,g),Ie=".".concat(S),ge=zRe(b,N,Me,{deprecatedTokens:m.deprecatedTokens});F&&Me&&Mr(Me)==="object"&&Object.keys(Me).forEach(function($e){Me[$e]="var(".concat(xz($e,WRe(b,F.prefix)),")")});var ye=gg(fe,{componentCls:Ie,prefixCls:S,iconCls:".".concat(B),antCls:".".concat(M),calc:U,max:H,min:z},F?Me:ge),Pe=p(ye,{hashId:P,prefixCls:S,rootPrefixCls:M,iconPrefixCls:B});Se(b,ge);var Be=typeof o=="function"?o(ye,S,k,m.resetFont):null;return[m.resetStyle===!1?null:Be,Pe]});return[X,P]}}function d(f,p,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},_=u(f,p,g,ut({resetStyle:!1,order:-998},m)),v=function(y){var C=y.prefixCls,S=y.rootCls,k=S===void 0?C:S;return _(C,k),null};return v}return{genStyleHooks:l,genSubStyleComponent:d,genComponentStyleHook:u}}const exe=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],C6t="5.24.3";function qre(n){return n>=0&&n<=255}function Fj(n,e){const{r:t,g:i,b:r,a:s}=new Ol(n).toRgb();if(s<1)return n;const{r:o,g:a,b:l}=new Ol(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((t-o*(1-c))/c),d=Math.round((i-a*(1-c))/c),f=Math.round((r-l*(1-c))/c);if(qre(u)&&qre(d)&&qre(f))return new Ol({r:u,g:d,b:f,a:Math.round(c*100)/100}).toRgbString()}return new Ol({r:t,g:i,b:r,a:1}).toRgbString()}var w6t=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 FGe(n){const{override:e}=n,t=w6t(n,["override"]),i=Object.assign({},e);Object.keys(x8).forEach(f=>{delete i[f]});const r=Object.assign(Object.assign({},t),i),s=480,o=576,a=768,l=992,c=1200,u=1600;if(r.motion===!1){const f="0s";r.motionDurationFast=f,r.motionDurationMid=f,r.motionDurationSlow=f}return Object.assign(Object.assign(Object.assign({},r),{colorFillContent:r.colorFillSecondary,colorFillContentHover:r.colorFill,colorFillAlter:r.colorFillQuaternary,colorBgContainerDisabled:r.colorFillTertiary,colorBorderBg:r.colorBgContainer,colorSplit:Fj(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:Fj(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:Fj(r.colorWarningBg,r.colorBgContainer),fontSizeIcon:r.fontSizeSM,lineWidthFocus:r.lineWidth*3,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:Fj(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:s,screenXSMin:s,screenXSMax:o-1,screenSM:o,screenSMMin:o,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 Ol("rgba(0, 0, 0, 0.16)").toRgbString()}, 0 3px 6px 0 ${new Ol("rgba(0, 0, 0, 0.12)").toRgbString()}, 0 5px 12px 4px ${new Ol("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 GRe=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 BGe={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},x6t={size:!0,sizeSM:!0,sizeLG:!0,sizeMD:!0,sizeXS:!0,sizeXXS:!0,sizeMS:!0,sizeXL:!0,sizeXXL:!0,sizeUnit:!0,sizeStep:!0,motionBase:!0,motionUnit:!0},S6t={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},$Ge=(n,e,t)=>{const i=t.getDerivativeToken(n),{override:r}=e,s=GRe(e,["override"]);let o=Object.assign(Object.assign({},i),{override:r});return o=FGe(o),s&&Object.entries(s).forEach(a=>{let[l,c]=a;const{theme:u}=c,d=GRe(c,["theme"]);let f=d;u&&(f=$Ge(Object.assign(Object.assign({},o),d),{override:d},u)),o[l]=f}),o};function yA(){const{token:n,hashed:e,theme:t,override:i,cssVar:r}=we.useContext(RGe),s=`${C6t}-${e||""}`,o=t||DGe,[a,l,c]=tFt(o,[x8,n],{salt:s,override:i,getComputedToken:$Ge,formatToken:FGe,cssVar:r&&{prefix:r.prefix,key:r.key,unitless:BGe,ignore:x6t,preserve:S6t}});return[o,c,e?l:"",a,r]}const E6t={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},k8=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}},txe=()=>({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"}}),k6t=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),T6t=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, &:hover":{textDecoration:n.linkHoverDecoration,outline:0},"&:focus":{textDecoration:n.linkFocusDecoration,outline:0},"&[disabled]":{color:n.colorTextDisabled,cursor:"not-allowed"}}}),I6t=(n,e,t,i)=>{const r=`[class^="${e}"], [class*=" ${e}"]`,s=t?`.${t}`:r,o={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let a={};return i!==!1&&(a={fontFamily:n.fontFamily,fontSize:n.fontSize}),{[s]:Object.assign(Object.assign(Object.assign({},a),o),{[r]:o})}},L6t=(n,e)=>({outline:`${Fi(n.lineWidthFocus)} solid ${n.colorPrimaryBorder}`,outlineOffset:e??1,transition:"outline-offset 0s, outline 0s"}),A6t=(n,e)=>({"&:focus-visible":Object.assign({},L6t(n,e))}),HGe=n=>({[`.${n}`]:Object.assign(Object.assign({},txe()),{[`.${n} .${n}-icon`]:{display:"block"}})}),{genStyleHooks:c9,genComponentStyleHook:N6t,genSubStyleComponent:D6t}=y6t({usePrefix:()=>{const{getPrefixCls:n,iconPrefixCls:e}=x.useContext(pg);return{rootPrefixCls:n(),iconPrefixCls:e}},useToken:()=>{const[n,e,t,i,r]=yA();return{theme:n,realToken:e,hashId:t,token:i,cssVar:r}},useCSP:()=>{const{csp:n}=x.useContext(pg);return n??{}},getResetStyles:(n,e)=>{var t;const i=T6t(n);return[i,{"&":i},HGe((t=e==null?void 0:e.prefix.iconPrefixCls)!==null&&t!==void 0?t:Jwe)]},getCommonStyle:I6t,getCompUnitless:()=>BGe}),R6t=(n,e)=>{const[t,i]=yA();return dfe({token:i,hashId:"",path:["ant-design-icons",n],nonce:()=>e==null?void 0:e.nonce,layer:{name:"antd"}},()=>[HGe(n)])},P6t=Object.assign({},q_),{useId:YRe}=P6t,O6t=()=>"",M6t=typeof YRe>"u"?O6t:YRe;function j6t(n,e,t){var i;const r=n||{},s=r.inherit===!1||!e?Object.assign(Object.assign({},Sfe),{hashed:(i=e==null?void 0:e.hashed)!==null&&i!==void 0?i:Sfe.hashed,cssVar:e==null?void 0:e.cssVar}):e,o=M6t();return Wwe(()=>{var a,l;if(!n)return e;const c=Object.assign({},s.components);Object.keys(n.components||{}).forEach(f=>{c[f]=Object.assign(Object.assign({},c[f]),n.components[f])});const u=`css-var-${o.replace(/:/g,"")}`,d=((a=r.cssVar)!==null&&a!==void 0?a:s.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:t==null?void 0:t.prefixCls},typeof s.cssVar=="object"?s.cssVar:{}),typeof r.cssVar=="object"?r.cssVar:{}),{key:typeof r.cssVar=="object"&&((l=r.cssVar)===null||l===void 0?void 0:l.key)||u});return Object.assign(Object.assign(Object.assign({},s),r),{token:Object.assign(Object.assign({},s.token),r.token),components:c,cssVar:d})},[r,s],(a,l)=>a.some((c,u)=>{const d=l[u];return!rfe(c,d,!0)}))}var F6t=["children"],VGe=x.createContext({});function B6t(n){var e=n.children,t=Na(n,F6t);return x.createElement(VGe.Provider,{value:t},e)}var $6t=function(n){$m(t,n);var e=Hw(t);function t(){return Ra(this,t),e.apply(this,arguments)}return Pa(t,[{key:"render",value:function(){return this.props.children}}]),t}(x.Component);function H6t(n){var e=x.useReducer(function(a){return a+1},0),t=Mt(e,2),i=t[1],r=x.useRef(n),s=Ta(function(){return r.current}),o=Ta(function(a){r.current=typeof a=="function"?a(r.current):a,i()});return[s,o]}var Zx="none",GH="appear",YH="enter",QH="leave",QRe="none",Jv="prepare",pR="start",gR="active",nxe="end",WGe="prepared";function XRe(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 V6t(n,e){var t={animationend:XRe("Animation","AnimationEnd"),transitionend:XRe("Transition","TransitionEnd")};return n&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var W6t=V6t(Nm(),typeof window<"u"?window:{}),zGe={};if(Nm()){var z6t=document.createElement("div");zGe=z6t.style}var XH={};function UGe(n){if(XH[n])return XH[n];var e=W6t[n];if(e)for(var t=Object.keys(e),i=t.length,r=0;r<i;r+=1){var s=t[r];if(Object.prototype.hasOwnProperty.call(e,s)&&s in zGe)return XH[n]=e[s],XH[n]}return""}var qGe=UGe("animationend"),KGe=UGe("transitionend"),GGe=!!(qGe&&KGe),ZRe=qGe||"animationend",JRe=KGe||"transitionend";function ePe(n,e){if(!n)return null;if(Mr(n)==="object"){var t=e.replace(/-\w/g,function(i){return i[1].toUpperCase()});return n[t]}return"".concat(n,"-").concat(e)}const U6t=function(n){var e=x.useRef();function t(r){r&&(r.removeEventListener(JRe,n),r.removeEventListener(ZRe,n))}function i(r){e.current&&e.current!==r&&t(e.current),r&&r!==e.current&&(r.addEventListener(JRe,n),r.addEventListener(ZRe,n),e.current=r)}return x.useEffect(function(){return function(){t(e.current)}},[]),[i,t]};var YGe=Nm()?x.useLayoutEffect:x.useEffect;const q6t=function(){var n=x.useRef(null);function e(){Eh.cancel(n.current)}function t(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;e();var s=Eh(function(){r<=1?i({isCanceled:function(){return s!==n.current}}):t(i,r-1)});n.current=s}return x.useEffect(function(){return function(){e()}},[]),[t,e]};var K6t=[Jv,pR,gR,nxe],G6t=[Jv,WGe],QGe=!1,Y6t=!0;function XGe(n){return n===gR||n===nxe}const Q6t=function(n,e,t){var i=E8(QRe),r=Mt(i,2),s=r[0],o=r[1],a=q6t(),l=Mt(a,2),c=l[0],u=l[1];function d(){o(Jv,!0)}var f=e?G6t:K6t;return YGe(function(){if(s!==QRe&&s!==nxe){var p=f.indexOf(s),g=f[p+1],m=t(s);m===QGe?o(g,!0):g&&c(function(_){function v(){_.isCanceled()||o(g,!0)}m===!0?v():Promise.resolve(m).then(v)})}},[n,s]),x.useEffect(function(){return function(){u()}},[]),[d,s]};function X6t(n,e,t,i){var r=i.motionEnter,s=r===void 0?!0:r,o=i.motionAppear,a=o===void 0?!0:o,l=i.motionLeave,c=l===void 0?!0:l,u=i.motionDeadline,d=i.motionLeaveImmediately,f=i.onAppearPrepare,p=i.onEnterPrepare,g=i.onLeavePrepare,m=i.onAppearStart,_=i.onEnterStart,v=i.onLeaveStart,b=i.onAppearActive,y=i.onEnterActive,C=i.onLeaveActive,S=i.onAppearEnd,k=i.onEnterEnd,I=i.onLeaveEnd,L=i.onVisibleChanged,N=E8(),P=Mt(N,2),O=P[0],F=P[1],V=H6t(Zx),M=Mt(V,2),B=M[0],W=M[1],q=E8(null),U=Mt(q,2),G=U[0],H=U[1],z=B(),Z=x.useRef(!1),X=x.useRef(null);function oe(){return t()}var fe=x.useRef(!1);function Se(){W(Zx),H(null,!0)}var Me=Ta(function(en){var Ke=B();if(Ke!==Zx){var dt=oe();if(!(en&&!en.deadline&&en.target!==dt)){var nt=fe.current,at;Ke===GH&&nt?at=S==null?void 0:S(dt,en):Ke===YH&&nt?at=k==null?void 0:k(dt,en):Ke===QH&&nt&&(at=I==null?void 0:I(dt,en)),nt&&at!==!1&&Se()}}}),Ie=U6t(Me),ge=Mt(Ie,1),ye=ge[0],Pe=function(Ke){switch(Ke){case GH:return wt(wt(wt({},Jv,f),pR,m),gR,b);case YH:return wt(wt(wt({},Jv,p),pR,_),gR,y);case QH:return wt(wt(wt({},Jv,g),pR,v),gR,C);default:return{}}},Be=x.useMemo(function(){return Pe(z)},[z]),$e=Q6t(z,!n,function(en){if(en===Jv){var Ke=Be[Jv];return Ke?Ke(oe()):QGe}if(vt in Be){var dt;H(((dt=Be[vt])===null||dt===void 0?void 0:dt.call(Be,oe(),null))||null)}return vt===gR&&z!==Zx&&(ye(oe()),u>0&&(clearTimeout(X.current),X.current=setTimeout(function(){Me({deadline:!0})},u))),vt===WGe&&Se(),Y6t}),qe=Mt($e,2),mt=qe[0],vt=qe[1],ft=XGe(vt);fe.current=ft;var tt=x.useRef(null);YGe(function(){if(!(Z.current&&tt.current===e)){F(e);var en=Z.current;Z.current=!0;var Ke;!en&&e&&a&&(Ke=GH),en&&e&&s&&(Ke=YH),(en&&!e&&c||!en&&d&&!e&&c)&&(Ke=QH);var dt=Pe(Ke);Ke&&(n||dt[Jv])?(W(Ke),mt()):W(Zx),tt.current=e}},[e]),x.useEffect(function(){(z===GH&&!a||z===YH&&!s||z===QH&&!c)&&W(Zx)},[a,s,c]),x.useEffect(function(){return function(){Z.current=!1,clearTimeout(X.current)}},[]);var St=x.useRef(!1);x.useEffect(function(){O&&(St.current=!0),O!==void 0&&z===Zx&&((St.current||O)&&(L==null||L(O)),St.current=!0)},[O,z]);var Ft=G;return Be[Jv]&&vt===pR&&(Ft=ut({transition:"none"},Ft)),[z,vt,Ft,O??e]}function Z6t(n){var e=n;Mr(n)==="object"&&(e=n.transitionSupport);function t(r,s){return!!(r.motionName&&e&&s!==!1)}var i=x.forwardRef(function(r,s){var o=r.visible,a=o===void 0?!0:o,l=r.removeOnLeave,c=l===void 0?!0:l,u=r.forceRender,d=r.children,f=r.motionName,p=r.leavedClassName,g=r.eventProps,m=x.useContext(VGe),_=m.motion,v=t(r,_),b=x.useRef(),y=x.useRef();function C(){try{return b.current instanceof HTMLElement?b.current:wz(y.current)}catch{return null}}var S=X6t(v,a,C,r),k=Mt(S,4),I=k[0],L=k[1],N=k[2],P=k[3],O=x.useRef(P);P&&(O.current=!0);var F=x.useCallback(function(U){b.current=U,zwe(s,U)},[s]),V,M=ut(ut({},g),{},{visible:a});if(!d)V=null;else if(I===Zx)P?V=d(ut({},M),F):!c&&O.current&&p?V=d(ut(ut({},M),{},{className:p}),F):u||!c&&!p?V=d(ut(ut({},M),{},{style:{display:"none"}}),F):V=null;else{var B;L===Jv?B="prepare":XGe(L)?B="active":L===pR&&(B="start");var W=ePe(f,"".concat(I,"-").concat(B));V=d(ut(ut({},M),{},{className:$t(ePe(f,I),wt(wt({},W,W&&B),f,typeof f=="string")),style:N}),F)}if(x.isValidElement(V)&&a9(V)){var q=vJ(V);q||(V=x.cloneElement(V,{ref:F}))}return x.createElement($6t,{ref:y},V)});return i.displayName="CSSMotion",i}const u9=Z6t(GGe);var kfe="add",Tfe="keep",Ife="remove",Kre="removed";function J6t(n){var e;return n&&Mr(n)==="object"&&"key"in n?e=n:e={key:n},ut(ut({},e),{},{key:String(e.key)})}function Lfe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return n.map(J6t)}function e8t(){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,s=Lfe(n),o=Lfe(e);s.forEach(function(c){for(var u=!1,d=i;d<r;d+=1){var f=o[d];if(f.key===c.key){i<d&&(t=t.concat(o.slice(i,d).map(function(p){return ut(ut({},p),{},{status:kfe})})),i=d),t.push(ut(ut({},f),{},{status:Tfe})),i+=1,u=!0;break}}u||t.push(ut(ut({},c),{},{status:Ife}))}),i<r&&(t=t.concat(o.slice(i).map(function(c){return ut(ut({},c),{},{status:kfe})})));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,f=u.status;return d!==c||f!==Ife}),t.forEach(function(u){u.key===c&&(u.status=Tfe)})}),t}var t8t=["component","children","onVisibleChanged","onAllRemoved"],n8t=["status"],i8t=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function r8t(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u9,t=function(i){$m(s,i);var r=Hw(s);function s(){var o;Ra(this,s);for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return o=r.call.apply(r,[this].concat(l)),wt(Bs(o),"state",{keyEntities:[]}),wt(Bs(o),"removeKey",function(u){o.setState(function(d){var f=d.keyEntities.map(function(p){return p.key!==u?p:ut(ut({},p),{},{status:Kre})});return{keyEntities:f}},function(){var d=o.state.keyEntities,f=d.filter(function(p){var g=p.status;return g!==Kre}).length;f===0&&o.props.onAllRemoved&&o.props.onAllRemoved()})}),o}return Pa(s,[{key:"render",value:function(){var a=this,l=this.state.keyEntities,c=this.props,u=c.component,d=c.children,f=c.onVisibleChanged;c.onAllRemoved;var p=Na(c,t8t),g=u||x.Fragment,m={};return i8t.forEach(function(_){m[_]=p[_],delete p[_]}),delete p.keys,x.createElement(g,p,l.map(function(_,v){var b=_.status,y=Na(_,n8t),C=b===kfe||b===Tfe;return x.createElement(e,hn({},m,{key:y.key,visible:C,eventProps:y,onVisibleChanged:function(k){f==null||f(k,{key:y.key}),k||a.removeKey(y.key)}}),function(S,k){return d(ut(ut({},S),{},{index:v}),k)})}))}}],[{key:"getDerivedStateFromProps",value:function(a,l){var c=a.keys,u=l.keyEntities,d=Lfe(c),f=e8t(u,d);return{keyEntities:f.filter(function(p){var g=u.find(function(m){var _=m.key;return p.key===_});return!(g&&g.status===Kre&&p.status===Ife)})}}}]),s}(x.Component);return wt(t,"defaultProps",{component:"div"}),t}r8t(GGe);function s8t(n){const{children:e}=n,[,t]=yA(),{motion:i}=t,r=x.useRef(!1);return r.current=r.current||i===!1,r.current?x.createElement(B6t,{motion:i},e):e}const o8t=()=>null;var a8t=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 l8t=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let ZGe;function c8t(){return ZGe||Pq}function u8t(n){return Object.keys(n).some(e=>e.endsWith("Color"))}const d8t=n=>{const{prefixCls:e,iconPrefixCls:t,theme:i,holderRender:r}=n;e!==void 0&&(ZGe=e),i&&u8t(i)&&s6t(c8t(),i)},h8t=n=>{const{children:e,csp:t,autoInsertSpaceInButton:i,alert:r,anchor:s,form:o,locale:a,componentSize:l,direction:c,space:u,splitter:d,virtual:f,dropdownMatchSelectWidth:p,popupMatchSelectWidth:g,popupOverflow:m,legacyLocale:_,parentContext:v,iconPrefixCls:b,theme:y,componentDisabled:C,segmented:S,statistic:k,spin:I,calendar:L,carousel:N,cascader:P,collapse:O,typography:F,checkbox:V,descriptions:M,divider:B,drawer:W,skeleton:q,steps:U,image:G,layout:H,list:z,mentions:Z,modal:X,progress:oe,result:fe,slider:Se,breadcrumb:Me,menu:Ie,pagination:ge,input:ye,textArea:Pe,empty:Be,badge:$e,radio:qe,rate:mt,switch:vt,transfer:ft,avatar:tt,message:St,tag:Ft,table:en,card:Ke,tabs:dt,timeline:nt,timePicker:at,upload:Oe,notification:ce,tree:Ne,colorPicker:Xe,datePicker:it,rangePicker:Tt,flex:Ct,wave:Rt,dropdown:se,warning:ke,tour:Ae,tooltip:je,popover:Ve,popconfirm:Qt,floatButtonGroup:rt,variant:Cn,inputNumber:Rn,treeSelect:li}=n,Mi=x.useCallback((Ln,bi)=>{const{prefixCls:et}=n;if(bi)return bi;const Lt=et||v.getPrefixCls("");return Ln?`${Lt}-${Ln}`:Lt},[v.getPrefixCls,n.prefixCls]),si=b||v.iconPrefixCls||Jwe,oi=t||v.csp;R6t(si,oi);const _n=j6t(y,v.theme,{prefixCls:Mi("")}),de={csp:oi,autoInsertSpaceInButton:i,alert:r,anchor:s,locale:a||_,direction:c,space:u,splitter:d,virtual:f,popupMatchSelectWidth:g??p,popupOverflow:m,getPrefixCls:Mi,iconPrefixCls:si,theme:_n,segmented:S,statistic:k,spin:I,calendar:L,carousel:N,cascader:P,collapse:O,typography:F,checkbox:V,descriptions:M,divider:B,drawer:W,skeleton:q,steps:U,image:G,input:ye,textArea:Pe,layout:H,list:z,mentions:Z,modal:X,progress:oe,result:fe,slider:Se,breadcrumb:Me,menu:Ie,pagination:ge,empty:Be,badge:$e,radio:qe,rate:mt,switch:vt,transfer:ft,avatar:tt,message:St,tag:Ft,table:en,card:Ke,tabs:dt,timeline:nt,timePicker:at,upload:Oe,notification:ce,tree:Ne,colorPicker:Xe,datePicker:it,rangePicker:Tt,flex:Ct,wave:Rt,dropdown:se,warning:ke,tour:Ae,tooltip:je,popover:Ve,popconfirm:Qt,floatButtonGroup:rt,variant:Cn,inputNumber:Rn,treeSelect:li},_e=Object.assign({},v);Object.keys(de).forEach(Ln=>{de[Ln]!==void 0&&(_e[Ln]=de[Ln])}),l8t.forEach(Ln=>{const bi=n[Ln];bi&&(_e[Ln]=bi)}),typeof i<"u"&&(_e.button=Object.assign({autoInsertSpace:i},_e.button));const Le=Wwe(()=>_e,_e,(Ln,bi)=>{const et=Object.keys(Ln),Lt=Object.keys(bi);return et.length!==Lt.length||et.some(qt=>Ln[qt]!==bi[qt])}),{layer:Ge}=x.useContext(l9),gt=x.useMemo(()=>({prefixCls:si,csp:oi,layer:Ge?"antd":void 0}),[si,oi,Ge]);let pt=x.createElement(x.Fragment,null,x.createElement(o8t,{dropdownMatchSelectWidth:p}),e);const Vt=x.useMemo(()=>{var Ln,bi,et,Lt;return fR(((Ln=DO.Form)===null||Ln===void 0?void 0:Ln.defaultValidateMessages)||{},((et=(bi=Le.locale)===null||bi===void 0?void 0:bi.Form)===null||et===void 0?void 0:et.defaultValidateMessages)||{},((Lt=Le.form)===null||Lt===void 0?void 0:Lt.validateMessages)||{},(o==null?void 0:o.validateMessages)||{})},[Le,o==null?void 0:o.validateMessages]);Object.keys(Vt).length>0&&(pt=x.createElement(PFt.Provider,{value:Vt},pt)),a&&(pt=x.createElement($Ft,{locale:a,_ANT_MARK__:BFt},pt)),pt=x.createElement(Xwe.Provider,{value:gt},pt),l&&(pt=x.createElement(a6t,{size:l},pt)),pt=x.createElement(s8t,null,pt);const Pn=x.useMemo(()=>{const Ln=_n||{},{algorithm:bi,token:et,components:Lt,cssVar:qt}=Ln,sn=a8t(Ln,["algorithm","token","components","cssVar"]),ln=bi&&(!Array.isArray(bi)||bi.length>0)?ofe(bi):DGe,ti={};Object.entries(Lt||{}).forEach(Dt=>{let[le,Qe]=Dt;const ht=Object.assign({},Qe);"algorithm"in ht&&(ht.algorithm===!0?ht.theme=ln:(Array.isArray(ht.algorithm)||typeof ht.algorithm=="function")&&(ht.theme=ofe(ht.algorithm)),delete ht.algorithm),ti[le]=ht});const di=Object.assign(Object.assign({},x8),et);return Object.assign(Object.assign({},sn),{theme:ln,token:di,components:ti,override:Object.assign({override:di},ti),cssVar:qt})},[_n]);return y&&(pt=x.createElement(RGe.Provider,{value:Pn},pt)),Le.warning&&(pt=x.createElement(RFt.Provider,{value:Le.warning},pt)),C!==void 0&&(pt=x.createElement(o6t,{disabled:C},pt)),x.createElement(pg.Provider,{value:Le},pt)},bk=n=>{const e=x.useContext(pg),t=x.useContext(Zwe);return x.createElement(h8t,Object.assign({parentContext:e,legacyLocale:t},n))};bk.ConfigContext=pg;bk.SizeContext=PO;bk.config=d8t;bk.useConfig=l6t;Object.defineProperty(bk,"SizeContext",{get:()=>PO});function JGe(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}function f8t(n){return JGe(n)instanceof ShadowRoot}function Oq(n){return f8t(n)?JGe(n):null}function p8t(n){return n.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function g8t(n,e){lg(n,"[@ant-design/icons] ".concat(e))}function tPe(n){return Mr(n)==="object"&&typeof n.name=="string"&&typeof n.theme=="string"&&(Mr(n.icon)==="object"||typeof n.icon=="function")}function nPe(){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[p8t(t)]=i}return e},{})}function Afe(n,e,t){return t?we.createElement(n.tag,ut(ut({key:e},nPe(n.attrs)),t),(n.children||[]).map(function(i,r){return Afe(i,"".concat(e,"-").concat(n.tag,"-").concat(r))})):we.createElement(n.tag,ut({key:e},nPe(n.attrs)),(n.children||[]).map(function(i,r){return Afe(i,"".concat(e,"-").concat(n.tag,"-").concat(r))}))}function eYe(n){return S8(n)[0]}function tYe(n){return n?Array.isArray(n)?n:[n]:[]}var m8t=` .anticon { display: inline-flex; align-items: center; 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); } } `,_8t=function(e){var t=x.useContext(Xwe),i=t.csp,r=t.prefixCls,s=t.layer,o=m8t;r&&(o=o.replace(/anticon/g,r)),s&&(o="@layer ".concat(s,` { `).concat(o,` }`)),x.useEffect(function(){var a=e.current,l=Oq(a);ow(o,"@ant-design-icons",{prepend:!s,csp:i,attachTo:l})},[])},v8t=["icon","className","onClick","style","primaryColor","secondaryColor"],TF={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function b8t(n){var e=n.primaryColor,t=n.secondaryColor;TF.primaryColor=e,TF.secondaryColor=t||eYe(e),TF.calculated=!!t}function y8t(){return ut({},TF)}var u4=function(e){var t=e.icon,i=e.className,r=e.onClick,s=e.style,o=e.primaryColor,a=e.secondaryColor,l=Na(e,v8t),c=x.useRef(),u=TF;if(o&&(u={primaryColor:o,secondaryColor:a||eYe(o)}),_8t(c),g8t(tPe(t),"icon should be icon definiton, but got ".concat(t)),!tPe(t))return null;var d=t;return d&&typeof d.icon=="function"&&(d=ut(ut({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),Afe(d.icon,"svg-".concat(d.name),ut(ut({className:i,onClick:r,style:s,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};u4.displayName="IconReact";u4.getTwoToneColors=y8t;u4.setTwoToneColors=b8t;function nYe(n){var e=tYe(n),t=Mt(e,2),i=t[0],r=t[1];return u4.setTwoToneColors({primaryColor:i,secondaryColor:r})}function C8t(){var n=u4.getTwoToneColors();return n.calculated?[n.primaryColor,n.secondaryColor]:n.primaryColor}var w8t=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];nYe(Rq.primary);var fv=x.forwardRef(function(n,e){var t=n.className,i=n.icon,r=n.spin,s=n.rotate,o=n.tabIndex,a=n.onClick,l=n.twoToneColor,c=Na(n,w8t),u=x.useContext(Xwe),d=u.prefixCls,f=d===void 0?"anticon":d,p=u.rootClassName,g=$t(p,f,wt(wt({},"".concat(f,"-").concat(i.name),!!i.name),"".concat(f,"-spin"),!!r||i.name==="loading"),t),m=o;m===void 0&&a&&(m=-1);var _=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,v=tYe(l),b=Mt(v,2),y=b[0],C=b[1];return x.createElement("span",hn({role:"img","aria-label":i.name},c,{ref:e,tabIndex:m,onClick:a,className:g}),x.createElement(u4,{icon:i,primaryColor:y,secondaryColor:C,style:_}))});fv.displayName="AntdIcon";fv.getTwoToneColor=C8t;fv.setTwoToneColor=nYe;var x8t={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"},S8t=function(e,t){return x.createElement(fv,hn({},e,{ref:t,icon:x8t}))},E8t=x.forwardRef(S8t),k8t={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},T8t=function(e,t){return x.createElement(fv,hn({},e,{ref:t,icon:k8t}))},I8t=x.forwardRef(T8t),L8t=`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`,A8t=`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`,N8t="".concat(L8t," ").concat(A8t).split(/[\s\n]+/),D8t="aria-",R8t="data-";function iPe(n,e){return n.indexOf(e)===0}function ixe(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=ut({},e);var i={};return Object.keys(n).forEach(function(r){(t.aria&&(r==="role"||iPe(r,D8t))||t.data&&iPe(r,R8t)||t.attr&&N8t.includes(r))&&(i[r]=n[r])}),i}function P8t(n){return n&&we.isValidElement(n)&&n.type===we.Fragment}const O8t=(n,e,t)=>we.isValidElement(n)?we.cloneElement(n,typeof t=="function"?t(n.props||{}):t):e;function iYe(n,e){return O8t(n,n,e)}const rYe=n=>{const[,,,,e]=yA();return e?`${n}-css-var`:""};var M8t={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"},j8t=function(e,t){return x.createElement(fv,hn({},e,{ref:t,icon:M8t}))},sYe=x.forwardRef(j8t);const F8t=we.createContext(void 0),PT=100,oYe={Modal:PT,Drawer:PT,Popover:PT,Popconfirm:PT,Tooltip:PT,Tour:PT,FloatButton:PT},B8t={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function $8t(n){return n in oYe}const aYe=(n,e)=>{const[,t]=yA(),i=we.useContext(F8t),r=$8t(n);let s;if(e!==void 0)s=[e,e];else{let o=i??0;r?o+=(i?0:t.zIndexPopupBase)+oYe[n]:o+=B8t[n],s=[i===void 0?e:o,o]}return s};function ip(){ip=function(){return e};var n,e={},t=Object.prototype,i=t.hasOwnProperty,r=Object.defineProperty||function(W,q,U){W[q]=U.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function c(W,q,U){return Object.defineProperty(W,q,{value:U,enumerable:!0,configurable:!0,writable:!0}),W[q]}try{c({},"")}catch{c=function(U,G,H){return U[G]=H}}function u(W,q,U,G){var H=q&&q.prototype instanceof v?q:v,z=Object.create(H.prototype),Z=new M(G||[]);return r(z,"_invoke",{value:P(W,U,Z)}),z}function d(W,q,U){try{return{type:"normal",arg:W.call(q,U)}}catch(G){return{type:"throw",arg:G}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",_={};function v(){}function b(){}function y(){}var C={};c(C,o,function(){return this});var S=Object.getPrototypeOf,k=S&&S(S(B([])));k&&k!==t&&i.call(k,o)&&(C=k);var I=y.prototype=v.prototype=Object.create(C);function L(W){["next","throw","return"].forEach(function(q){c(W,q,function(U){return this._invoke(q,U)})})}function N(W,q){function U(H,z,Z,X){var oe=d(W[H],W,z);if(oe.type!=="throw"){var fe=oe.arg,Se=fe.value;return Se&&Mr(Se)=="object"&&i.call(Se,"__await")?q.resolve(Se.__await).then(function(Me){U("next",Me,Z,X)},function(Me){U("throw",Me,Z,X)}):q.resolve(Se).then(function(Me){fe.value=Me,Z(fe)},function(Me){return U("throw",Me,Z,X)})}X(oe.arg)}var G;r(this,"_invoke",{value:function(z,Z){function X(){return new q(function(oe,fe){U(z,Z,oe,fe)})}return G=G?G.then(X,X):X()}})}function P(W,q,U){var G=f;return function(H,z){if(G===g)throw Error("Generator is already running");if(G===m){if(H==="throw")throw z;return{value:n,done:!0}}for(U.method=H,U.arg=z;;){var Z=U.delegate;if(Z){var X=O(Z,U);if(X){if(X===_)continue;return X}}if(U.method==="next")U.sent=U._sent=U.arg;else if(U.method==="throw"){if(G===f)throw G=m,U.arg;U.dispatchException(U.arg)}else U.method==="return"&&U.abrupt("return",U.arg);G=g;var oe=d(W,q,U);if(oe.type==="normal"){if(G=U.done?m:p,oe.arg===_)continue;return{value:oe.arg,done:U.done}}oe.type==="throw"&&(G=m,U.method="throw",U.arg=oe.arg)}}}function O(W,q){var U=q.method,G=W.iterator[U];if(G===n)return q.delegate=null,U==="throw"&&W.iterator.return&&(q.method="return",q.arg=n,O(W,q),q.method==="throw")||U!=="return"&&(q.method="throw",q.arg=new TypeError("The iterator does not provide a '"+U+"' method")),_;var H=d(G,W.iterator,q.arg);if(H.type==="throw")return q.method="throw",q.arg=H.arg,q.delegate=null,_;var z=H.arg;return z?z.done?(q[W.resultName]=z.value,q.next=W.nextLoc,q.method!=="return"&&(q.method="next",q.arg=n),q.delegate=null,_):z:(q.method="throw",q.arg=new TypeError("iterator result is not an object"),q.delegate=null,_)}function F(W){var q={tryLoc:W[0]};1 in W&&(q.catchLoc=W[1]),2 in W&&(q.finallyLoc=W[2],q.afterLoc=W[3]),this.tryEntries.push(q)}function V(W){var q=W.completion||{};q.type="normal",delete q.arg,W.completion=q}function M(W){this.tryEntries=[{tryLoc:"root"}],W.forEach(F,this),this.reset(!0)}function B(W){if(W||W===""){var q=W[o];if(q)return q.call(W);if(typeof W.next=="function")return W;if(!isNaN(W.length)){var U=-1,G=function H(){for(;++U<W.length;)if(i.call(W,U))return H.value=W[U],H.done=!1,H;return H.value=n,H.done=!0,H};return G.next=G}}throw new TypeError(Mr(W)+" is not iterable")}return b.prototype=y,r(I,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:b,configurable:!0}),b.displayName=c(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(W){var q=typeof W=="function"&&W.constructor;return!!q&&(q===b||(q.displayName||q.name)==="GeneratorFunction")},e.mark=function(W){return Object.setPrototypeOf?Object.setPrototypeOf(W,y):(W.__proto__=y,c(W,l,"GeneratorFunction")),W.prototype=Object.create(I),W},e.awrap=function(W){return{__await:W}},L(N.prototype),c(N.prototype,a,function(){return this}),e.AsyncIterator=N,e.async=function(W,q,U,G,H){H===void 0&&(H=Promise);var z=new N(u(W,q,U,G),H);return e.isGeneratorFunction(q)?z:z.next().then(function(Z){return Z.done?Z.value:z.next()})},L(I),c(I,l,"Generator"),c(I,o,function(){return this}),c(I,"toString",function(){return"[object Generator]"}),e.keys=function(W){var q=Object(W),U=[];for(var G in q)U.push(G);return U.reverse(),function H(){for(;U.length;){var z=U.pop();if(z in q)return H.value=z,H.done=!1,H}return H.done=!0,H}},e.values=B,M.prototype={constructor:M,reset:function(q){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(V),!q)for(var U in this)U.charAt(0)==="t"&&i.call(this,U)&&!isNaN(+U.slice(1))&&(this[U]=n)},stop:function(){this.done=!0;var q=this.tryEntries[0].completion;if(q.type==="throw")throw q.arg;return this.rval},dispatchException:function(q){if(this.done)throw q;var U=this;function G(fe,Se){return Z.type="throw",Z.arg=q,U.next=fe,Se&&(U.method="next",U.arg=n),!!Se}for(var H=this.tryEntries.length-1;H>=0;--H){var z=this.tryEntries[H],Z=z.completion;if(z.tryLoc==="root")return G("end");if(z.tryLoc<=this.prev){var X=i.call(z,"catchLoc"),oe=i.call(z,"finallyLoc");if(X&&oe){if(this.prev<z.catchLoc)return G(z.catchLoc,!0);if(this.prev<z.finallyLoc)return G(z.finallyLoc)}else if(X){if(this.prev<z.catchLoc)return G(z.catchLoc,!0)}else{if(!oe)throw Error("try statement without catch or finally");if(this.prev<z.finallyLoc)return G(z.finallyLoc)}}}},abrupt:function(q,U){for(var G=this.tryEntries.length-1;G>=0;--G){var H=this.tryEntries[G];if(H.tryLoc<=this.prev&&i.call(H,"finallyLoc")&&this.prev<H.finallyLoc){var z=H;break}}z&&(q==="break"||q==="continue")&&z.tryLoc<=U&&U<=z.finallyLoc&&(z=null);var Z=z?z.completion:{};return Z.type=q,Z.arg=U,z?(this.method="next",this.next=z.finallyLoc,_):this.complete(Z)},complete:function(q,U){if(q.type==="throw")throw q.arg;return q.type==="break"||q.type==="continue"?this.next=q.arg:q.type==="return"?(this.rval=this.arg=q.arg,this.method="return",this.next="end"):q.type==="normal"&&U&&(this.next=U),_},finish:function(q){for(var U=this.tryEntries.length-1;U>=0;--U){var G=this.tryEntries[U];if(G.finallyLoc===q)return this.complete(G.completion,G.afterLoc),V(G),_}},catch:function(q){for(var U=this.tryEntries.length-1;U>=0;--U){var G=this.tryEntries[U];if(G.tryLoc===q){var H=G.completion;if(H.type==="throw"){var z=H.arg;V(G)}return z}}throw Error("illegal catch attempt")},delegateYield:function(q,U,G){return this.delegate={iterator:B(q),resultName:U,nextLoc:G},this.method==="next"&&(this.arg=n),_}},e}function rPe(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function CA(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){rPe(s,i,r,o,a,"next",l)}function a(l){rPe(s,i,r,o,a,"throw",l)}o(void 0)})}}var d9=ut({},ovt),H8t=d9.version,Gre=d9.render,V8t=d9.unmountComponentAtNode,xJ;try{var W8t=Number((H8t||"").split(".")[0]);W8t>=18&&(xJ=d9.createRoot)}catch{}function sPe(n){var e=d9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&Mr(e)==="object"&&(e.usingClientEntryPoint=n)}var Mq="__rc_react_root__";function z8t(n,e){sPe(!0);var t=e[Mq]||xJ(e);sPe(!1),t.render(n),e[Mq]=t}function U8t(n,e){Gre==null||Gre(n,e)}function q8t(n,e){if(xJ){z8t(n,e);return}U8t(n,e)}function K8t(n){return Nfe.apply(this,arguments)}function Nfe(){return Nfe=CA(ip().mark(function n(e){return ip().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Promise.resolve().then(function(){var r;(r=e[Mq])===null||r===void 0||r.unmount(),delete e[Mq]}));case 1:case"end":return i.stop()}},n)})),Nfe.apply(this,arguments)}function G8t(n){V8t(n)}function Y8t(n){return Dfe.apply(this,arguments)}function Dfe(){return Dfe=CA(ip().mark(function n(e){return ip().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(xJ===void 0){i.next=2;break}return i.abrupt("return",K8t(e));case 2:G8t(e);case 3:case"end":return i.stop()}},n)})),Dfe.apply(this,arguments)}const Q8t=(n,e)=>(q8t(n,e),()=>Y8t(e));let X8t=Q8t;function Z8t(){return X8t}function rxe(n,e){var t=Object.assign({},n);return Array.isArray(e)&&e.forEach(function(i){delete t[i]}),t}const sxe=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(),s=r.width,o=r.height;if(s||o)return!0}}return!1},J8t=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 ${n.motionDurationSlow} ${n.motionEaseInOut}`,`opacity ${n.motionDurationSlow} ${n.motionEaseInOut}`].join(",")}}}}},e7t=N6t("Wave",n=>[J8t(n)]),lYe=`${Pq}-wave-target`;function Yre(n){return n&&n!=="#fff"&&n!=="#ffffff"&&n!=="rgb(255, 255, 255)"&&n!=="rgba(255, 255, 255, 1)"&&!/rgba\((?:\d*, ){3}0\)/.test(n)&&n!=="transparent"}function t7t(n){const{borderTopColor:e,borderColor:t,backgroundColor:i}=getComputedStyle(n);return Yre(e)?e:Yre(t)?t:Yre(i)?i:null}function Qre(n){return Number.isNaN(n)?0:n}const n7t=n=>{const{className:e,target:t,component:i,registerUnmount:r}=n,s=x.useRef(null),o=x.useRef(null);x.useEffect(()=>{o.current=r()},[]);const[a,l]=x.useState(null),[c,u]=x.useState([]),[d,f]=x.useState(0),[p,g]=x.useState(0),[m,_]=x.useState(0),[v,b]=x.useState(0),[y,C]=x.useState(!1),S={left:d,top:p,width:m,height:v,borderRadius:c.map(L=>`${L}px`).join(" ")};a&&(S["--wave-color"]=a);function k(){const L=getComputedStyle(t);l(t7t(t));const N=L.position==="static",{borderLeftWidth:P,borderTopWidth:O}=L;f(N?t.offsetLeft:Qre(-parseFloat(P))),g(N?t.offsetTop:Qre(-parseFloat(O))),_(t.offsetWidth),b(t.offsetHeight);const{borderTopLeftRadius:F,borderTopRightRadius:V,borderBottomLeftRadius:M,borderBottomRightRadius:B}=L;u([F,V,B,M].map(W=>Qre(parseFloat(W))))}if(x.useEffect(()=>{if(t){const L=Eh(()=>{k(),C(!0)});let N;return typeof ResizeObserver<"u"&&(N=new ResizeObserver(k),N.observe(t)),()=>{Eh.cancel(L),N==null||N.disconnect()}}},[]),!y)return null;const I=(i==="Checkbox"||i==="Radio")&&(t==null?void 0:t.classList.contains(lYe));return x.createElement(u9,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(L,N)=>{var P,O;if(N.deadline||N.propertyName==="opacity"){const F=(P=s.current)===null||P===void 0?void 0:P.parentElement;(O=o.current)===null||O===void 0||O.call(o).then(()=>{F==null||F.remove()})}return!1}},(L,N)=>{let{className:P}=L;return x.createElement("div",{ref:mJ(s,N),className:$t(e,P,{"wave-quick":I}),style:S})})},i7t=(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);const s=Z8t();let o=null;function a(){return o}o=s(x.createElement(n7t,Object.assign({},e,{target:n,registerUnmount:a})),r)},r7t=(n,e,t)=>{const{wave:i}=x.useContext(pg),[,r,s]=yA(),o=Ta(c=>{const u=n.current;if(i!=null&&i.disabled||!u)return;const d=u.querySelector(`.${lYe}`)||u,{showEffect:f}=i||{};(f||i7t)(d,{className:e,token:r,component:t,event:c,hashId:s})}),a=x.useRef(null);return c=>{Eh.cancel(a.current),a.current=Eh(()=>{o(c)})}},s7t=n=>{const{children:e,disabled:t,component:i}=n,{getPrefixCls:r}=x.useContext(pg),s=x.useRef(null),o=r("wave"),[,a]=e7t(o),l=r7t(s,$t(o,a),i);if(we.useEffect(()=>{const u=s.current;if(!u||u.nodeType!==1||t)return;const d=f=>{!sxe(f.target)||!u.getAttribute||u.getAttribute("disabled")||u.disabled||u.className.includes("disabled")||u.className.includes("-leave")||l(f)};return u.addEventListener("click",d,!0),()=>{u.removeEventListener("click",d,!0)}},[t]),!we.isValidElement(e))return e??null;const c=a9(e)?mJ(vJ(e),s):s;return iYe(e,{ref:c})},oxe=n=>{const e=we.useContext(PO);return we.useMemo(()=>n?typeof n=="string"?n??e:n instanceof Function?n(e):e:e,[n,e])},cYe=x.createContext(null),axe=(n,e)=>{const t=x.useContext(cYe),i=x.useMemo(()=>{if(!t)return"";const{compactDirection:r,isFirstItem:s,isLastItem:o}=t,a=r==="vertical"?"-vertical-":"-";return $t(`${n}-compact${a}item`,{[`${n}-compact${a}first-item`]:s,[`${n}-compact${a}last-item`]:o,[`${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}},o7t=n=>{const{children:e}=n;return x.createElement(cYe.Provider,{value:null},e)};var a7t=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 uYe=x.createContext(void 0),l7t=n=>{const{getPrefixCls:e,direction:t}=x.useContext(pg),{prefixCls:i,size:r,className:s}=n,o=a7t(n,["prefixCls","size","className"]),a=e("btn-group",i),[,,l]=yA(),c=x.useMemo(()=>{switch(r){case"large":return"lg";case"small":return"sm";default:return""}},[r]),u=$t(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},s,l);return x.createElement(uYe.Provider,{value:r},x.createElement("div",Object.assign({},o,{className:u})))},oPe=/^[\u4E00-\u9FA5]{2}$/,Rfe=oPe.test.bind(oPe);function aPe(n){return typeof n=="string"}function Xre(n){return n==="text"||n==="link"}function c7t(n,e){if(n==null)return;const t=e?" ":"";return typeof n!="string"&&typeof n!="number"&&aPe(n.type)&&Rfe(n.props.children)?iYe(n,{children:n.props.children.split("").join(t)}):aPe(n)?Rfe(n)?we.createElement("span",null,n.split("").join(t)):we.createElement("span",null,n):P8t(n)?we.createElement("span",null,n):n}function u7t(n,e){let t=!1;const i=[];return we.Children.forEach(n,r=>{const s=typeof r,o=s==="string"||s==="number";if(t&&o){const a=i.length-1,l=i[a];i[a]=`${l}${r}`}else i.push(r);t=o}),we.Children.map(i,r=>c7t(r,e))}["default","primary","danger"].concat(_r(exe));const Pfe=x.forwardRef((n,e)=>{const{className:t,style:i,children:r,prefixCls:s}=n,o=$t(`${s}-icon`,t);return we.createElement("span",{ref:e,className:o,style:i},r)}),lPe=x.forwardRef((n,e)=>{const{prefixCls:t,className:i,style:r,iconClassName:s}=n,o=$t(`${t}-loading-icon`,i);return we.createElement(Pfe,{prefixCls:t,className:o,style:r,ref:e},we.createElement(sYe,{className:s}))}),Zre=()=>({width:0,opacity:0,transform:"scale(0)"}),Jre=n=>({width:n.scrollWidth,opacity:1,transform:"scale(1)"}),d7t=n=>{const{prefixCls:e,loading:t,existIcon:i,className:r,style:s,mount:o}=n,a=!!t;return i?we.createElement(lPe,{prefixCls:e,className:r,style:s}):we.createElement(u9,{visible:a,motionName:`${e}-loading-icon-motion`,motionAppear:!o,motionEnter:!o,motionLeave:!o,removeOnLeave:!0,onAppearStart:Zre,onAppearActive:Jre,onEnterStart:Zre,onEnterActive:Jre,onLeaveStart:Jre,onLeaveActive:Zre},(l,c)=>{let{className:u,style:d}=l;const f=Object.assign(Object.assign({},s),d);return we.createElement(lPe,{prefixCls:e,className:$t(r,u),style:f,ref:c})})},cPe=(n,e)=>({[`> span, > ${n}`]:{"&:not(:last-child)":{[`&, & > ${n}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${n}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),h7t=n=>{const{componentCls:e,fontSize:t,lineWidth:i,groupBorderColor:r,colorErrorHover:s}=n;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:n.calc(i).mul(-1).equal(),[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},cPe(`${e}-primary`,r),cPe(`${e}-danger`,s)]}};var f7t=["b"],p7t=["v"],ese=function(e){return Math.round(Number(e||0))},g7t=function(e){if(e instanceof Ol)return e;if(e&&Mr(e)==="object"&&"h"in e&&"b"in e){var t=e,i=t.b,r=Na(t,f7t);return ut(ut({},r),{},{v:i})}return typeof e=="string"&&/hsb/.test(e)?e.replace(/hsb/,"hsv"):e},T8=function(n){$m(t,n);var e=Hw(t);function t(i){return Ra(this,t),e.call(this,g7t(i))}return Pa(t,[{key:"toHsbString",value:function(){var r=this.toHsb(),s=ese(r.s*100),o=ese(r.b*100),a=ese(r.h),l=r.a,c="hsb(".concat(a,", ").concat(s,"%, ").concat(o,"%)"),u="hsba(".concat(a,", ").concat(s,"%, ").concat(o,"%, ").concat(l.toFixed(l===0?0:2),")");return l===1?c:u}},{key:"toHsb",value:function(){var r=this.toHsv(),s=r.v,o=Na(r,p7t);return ut(ut({},o),{},{b:s,a:this.a})}}]),t}(Ol),m7t=function(e){return e instanceof T8?e:new T8(e)};m7t("#1677ff");const _7t=(n,e)=>(n==null?void 0:n.replace(/[^\w/]/g,"").slice(0,e?8:6))||"",v7t=(n,e)=>n?_7t(n,e):"";let b7t=function(){function n(e){Ra(this,n);var t;if(this.cleared=!1,e instanceof n){this.metaColor=e.metaColor.clone(),this.colors=(t=e.colors)===null||t===void 0?void 0:t.map(r=>({color:new n(r.color),percent:r.percent})),this.cleared=e.cleared;return}const i=Array.isArray(e);i&&e.length?(this.colors=e.map(r=>{let{color:s,percent:o}=r;return{color:new n(s),percent:o}}),this.metaColor=new T8(this.colors[0].color.metaColor)):this.metaColor=new T8(i?"":e),(!e||i&&!this.colors)&&(this.metaColor=this.metaColor.setA(0),this.cleared=!0)}return Pa(n,[{key:"toHsb",value:function(){return this.metaColor.toHsb()}},{key:"toHsbString",value:function(){return this.metaColor.toHsbString()}},{key:"toHex",value:function(){return v7t(this.toHexString(),this.metaColor.a<1)}},{key:"toHexString",value:function(){return this.metaColor.toHexString()}},{key:"toRgb",value:function(){return this.metaColor.toRgb()}},{key:"toRgbString",value:function(){return this.metaColor.toRgbString()}},{key:"isGradient",value:function(){return!!this.colors&&!this.cleared}},{key:"getColors",value:function(){return this.colors||[{color:this,percent:0}]}},{key:"toCssString",value:function(){const{colors:t}=this;return t?`linear-gradient(90deg, ${t.map(r=>`${r.color.toRgbString()} ${r.percent}%`).join(", ")})`:this.metaColor.toRgbString()}},{key:"equals",value:function(t){return!t||this.isGradient()!==t.isGradient()?!1:this.isGradient()?this.colors.length===t.colors.length&&this.colors.every((i,r)=>{const s=t.colors[r];return i.percent===s.percent&&i.color.equals(s.color)}):this.toHexString()===t.toHexString()}}])}();const y7t=n=>({animationDuration:n,animationFillMode:"both"}),C7t=n=>({animationDuration:n,animationFillMode:"both"}),dYe=function(n,e,t,i){const s=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` ${s}${n}-enter, ${s}${n}-appear `]:Object.assign(Object.assign({},y7t(i)),{animationPlayState:"paused"}),[`${s}${n}-leave`]:Object.assign(Object.assign({},C7t(i)),{animationPlayState:"paused"}),[` ${s}${n}-enter${n}-enter-active, ${s}${n}-appear${n}-appear-active `]:{animationName:e,animationPlayState:"running"},[`${s}${n}-leave${n}-leave-active`]:{animationName:t,animationPlayState:"running",pointerEvents:"none"}}},w7t=new mf("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),x7t=new mf("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),S7t=new mf("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),E7t=new mf("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),k7t=new mf("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),T7t=new mf("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),I7t=new mf("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),L7t=new mf("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),A7t={"move-up":{inKeyframes:I7t,outKeyframes:L7t},"move-down":{inKeyframes:w7t,outKeyframes:x7t},"move-left":{inKeyframes:S7t,outKeyframes:E7t},"move-right":{inKeyframes:k7t,outKeyframes:T7t}},uPe=(n,e)=>{const{antCls:t}=n,i=`${t}-${e}`,{inKeyframes:r,outKeyframes:s}=A7t[e];return[dYe(i,r,s,n.motionDurationMid),{[` ${i}-enter, ${i}-appear `]:{opacity:0,animationTimingFunction:n.motionEaseOutCirc},[`${i}-leave`]:{animationTimingFunction:n.motionEaseInOutCirc}}]},hYe=new mf("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),fYe=new mf("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),pYe=new mf("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),gYe=new mf("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),N7t=new mf("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),D7t=new mf("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),R7t=new mf("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),P7t=new mf("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),O7t={"slide-up":{inKeyframes:hYe,outKeyframes:fYe},"slide-down":{inKeyframes:pYe,outKeyframes:gYe},"slide-left":{inKeyframes:N7t,outKeyframes:D7t},"slide-right":{inKeyframes:R7t,outKeyframes:P7t}},dPe=(n,e)=>{const{antCls:t}=n,i=`${t}-${e}`,{inKeyframes:r,outKeyframes:s}=O7t[e];return[dYe(i,r,s,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}}]},M7t=(n,e)=>{const{r:t,g:i,b:r,a:s}=n.toRgb(),o=new T8(n.toRgbString()).onBackground(e).toHsv();return s<=.5?o.v>.5:t*.299+i*.587+r*.114>192},mYe=n=>{const{paddingInline:e,onlyIconSize:t}=n;return gg(n,{buttonPaddingHorizontal:e,buttonPaddingVertical:0,buttonIconOnlyFontSize:t})},_Ye=n=>{var e,t,i,r,s,o;const a=(e=n.contentFontSize)!==null&&e!==void 0?e:n.fontSize,l=(t=n.contentFontSizeSM)!==null&&t!==void 0?t:n.fontSize,c=(i=n.contentFontSizeLG)!==null&&i!==void 0?i:n.fontSizeLG,u=(r=n.contentLineHeight)!==null&&r!==void 0?r:Lz(a),d=(s=n.contentLineHeightSM)!==null&&s!==void 0?s:Lz(l),f=(o=n.contentLineHeightLG)!==null&&o!==void 0?o:Lz(c),p=M7t(new b7t(n.colorBgSolid),"#fff")?"#000":"#fff",g=exe.reduce((m,_)=>Object.assign(Object.assign({},m),{[`${_}ShadowColor`]:`0 ${Fi(n.controlOutlineWidth)} 0 ${Fj(n[`${_}1`],n.colorBgContainer)}`}),{});return Object.assign(Object.assign({},g),{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:"inherit",onlyIconSizeSM:"inherit",onlyIconSizeLG:"inherit",groupBorderColor:n.colorPrimaryHover,linkHoverBg:"transparent",textTextColor:n.colorText,textTextHoverColor:n.colorText,textTextActiveColor:n.colorText,textHoverBg:n.colorFillTertiary,defaultColor:n.colorText,defaultBg:n.colorBgContainer,defaultBorderColor:n.colorBorder,defaultBorderColorDisabled:n.colorBorder,defaultHoverBg:n.colorBgContainer,defaultHoverColor:n.colorPrimaryHover,defaultHoverBorderColor:n.colorPrimaryHover,defaultActiveBg:n.colorBgContainer,defaultActiveColor:n.colorPrimaryActive,defaultActiveBorderColor:n.colorPrimaryActive,solidTextColor:p,contentFontSize:a,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:f,paddingBlock:Math.max((n.controlHeight-a*u)/2-n.lineWidth,0),paddingBlockSM:Math.max((n.controlHeightSM-l*d)/2-n.lineWidth,0),paddingBlockLG:Math.max((n.controlHeightLG-c*f)/2-n.lineWidth,0)})},j7t=n=>{const{componentCls:e,iconCls:t,fontWeight:i,opacityLoading:r,motionDurationSlow:s,motionEaseInOut:o,marginXS:a,calc:l}=n;return{[e]:{outline:"none",position:"relative",display:"inline-flex",gap:n.marginXS,alignItems:"center",justifyContent:"center",fontWeight:i,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${Fi(n.lineWidth)} ${n.lineType} transparent`,cursor:"pointer",transition:`all ${n.motionDurationMid} ${n.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:n.colorText,"&:disabled > *":{pointerEvents:"none"},[`${e}-icon > svg`]:txe(),"> a":{color:"currentColor"},"&:not(:disabled)":A6t(n),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${t})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&${e}-icon-only`]:{paddingInline:0,[`&${e}-compact-item`]:{flex:"none"},[`&${e}-round`]:{width:"auto"}},[`&${e}-loading`]:{opacity:r,cursor:"default"},[`${e}-loading-icon`]:{transition:["width","opacity","margin"].map(c=>`${c} ${s} ${o}`).join(",")},[`&:not(${e}-icon-end)`]:{[`${e}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineEnd:l(a).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:l(a).mul(-1).equal()}}},"&-icon-end":{flexDirection:"row-reverse",[`${e}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineStart:l(a).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:l(a).mul(-1).equal()}}}}}},vYe=(n,e,t)=>({[`&:not(:disabled):not(${n}-disabled)`]:{"&:hover":e,"&:active":t}}),F7t=n=>({minWidth:n.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),B7t=n=>({borderRadius:n.controlHeight,paddingInlineStart:n.calc(n.controlHeight).div(2).equal(),paddingInlineEnd:n.calc(n.controlHeight).div(2).equal()}),$7t=n=>({cursor:"not-allowed",borderColor:n.borderColorDisabled,color:n.colorTextDisabled,background:n.colorBgContainerDisabled,boxShadow:"none"}),SJ=(n,e,t,i,r,s,o,a)=>({[`&${n}-background-ghost`]:Object.assign(Object.assign({color:t||void 0,background:e,borderColor:i||void 0,boxShadow:"none"},vYe(n,Object.assign({background:e},o),Object.assign({background:e},a))),{"&:disabled":{cursor:"not-allowed",color:r||void 0,borderColor:s||void 0}})}),H7t=n=>({[`&:disabled, &${n.componentCls}-disabled`]:Object.assign({},$7t(n))}),V7t=n=>({[`&:disabled, &${n.componentCls}-disabled`]:{cursor:"not-allowed",color:n.colorTextDisabled}}),EJ=(n,e,t,i)=>{const s=i&&["link","text"].includes(i)?V7t:H7t;return Object.assign(Object.assign({},s(n)),vYe(n.componentCls,e,t))},kJ=(n,e,t,i,r)=>({[`&${n.componentCls}-variant-solid`]:Object.assign({color:e,background:t},EJ(n,i,r))}),TJ=(n,e,t,i,r)=>({[`&${n.componentCls}-variant-outlined, &${n.componentCls}-variant-dashed`]:Object.assign({borderColor:e,background:t},EJ(n,i,r))}),IJ=n=>({[`&${n.componentCls}-variant-dashed`]:{borderStyle:"dashed"}}),LJ=(n,e,t,i)=>({[`&${n.componentCls}-variant-filled`]:Object.assign({boxShadow:"none",background:e},EJ(n,t,i))}),Wy=(n,e,t,i,r)=>({[`&${n.componentCls}-variant-${t}`]:Object.assign({color:e,boxShadow:"none"},EJ(n,i,r,t))}),W7t=n=>{const{componentCls:e}=n;return exe.reduce((t,i)=>{const r=n[`${i}6`],s=n[`${i}1`],o=n[`${i}5`],a=n[`${i}2`],l=n[`${i}3`],c=n[`${i}7`];return Object.assign(Object.assign({},t),{[`&${e}-color-${i}`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:r,boxShadow:n[`${i}ShadowColor`]},kJ(n,n.colorTextLightSolid,r,{background:o},{background:c})),TJ(n,r,n.colorBgContainer,{color:o,borderColor:o,background:n.colorBgContainer},{color:c,borderColor:c,background:n.colorBgContainer})),IJ(n)),LJ(n,s,{background:a},{background:l})),Wy(n,r,"link",{color:o},{color:c})),Wy(n,r,"text",{color:o,background:s},{color:c,background:l}))})},{})},z7t=n=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:n.defaultColor,boxShadow:n.defaultShadow},kJ(n,n.solidTextColor,n.colorBgSolid,{color:n.solidTextColor,background:n.colorBgSolidHover},{color:n.solidTextColor,background:n.colorBgSolidActive})),IJ(n)),LJ(n,n.colorFillTertiary,{background:n.colorFillSecondary},{background:n.colorFill})),SJ(n.componentCls,n.ghostBg,n.defaultGhostColor,n.defaultGhostBorderColor,n.colorTextDisabled,n.colorBorder)),Wy(n,n.textTextColor,"link",{color:n.colorLinkHover,background:n.linkHoverBg},{color:n.colorLinkActive})),U7t=n=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:n.colorPrimary,boxShadow:n.primaryShadow},TJ(n,n.colorPrimary,n.colorBgContainer,{color:n.colorPrimaryTextHover,borderColor:n.colorPrimaryHover,background:n.colorBgContainer},{color:n.colorPrimaryTextActive,borderColor:n.colorPrimaryActive,background:n.colorBgContainer})),IJ(n)),LJ(n,n.colorPrimaryBg,{background:n.colorPrimaryBgHover},{background:n.colorPrimaryBorder})),Wy(n,n.colorPrimaryText,"text",{color:n.colorPrimaryTextHover,background:n.colorPrimaryBg},{color:n.colorPrimaryTextActive,background:n.colorPrimaryBorder})),Wy(n,n.colorPrimaryText,"link",{color:n.colorPrimaryTextHover,background:n.linkHoverBg},{color:n.colorPrimaryTextActive})),SJ(n.componentCls,n.ghostBg,n.colorPrimary,n.colorPrimary,n.colorTextDisabled,n.colorBorder,{color:n.colorPrimaryHover,borderColor:n.colorPrimaryHover},{color:n.colorPrimaryActive,borderColor:n.colorPrimaryActive})),q7t=n=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:n.colorError,boxShadow:n.dangerShadow},kJ(n,n.dangerColor,n.colorError,{background:n.colorErrorHover},{background:n.colorErrorActive})),TJ(n,n.colorError,n.colorBgContainer,{color:n.colorErrorHover,borderColor:n.colorErrorBorderHover},{color:n.colorErrorActive,borderColor:n.colorErrorActive})),IJ(n)),LJ(n,n.colorErrorBg,{background:n.colorErrorBgFilledHover},{background:n.colorErrorBgActive})),Wy(n,n.colorError,"text",{color:n.colorErrorHover,background:n.colorErrorBg},{color:n.colorErrorHover,background:n.colorErrorBgActive})),Wy(n,n.colorError,"link",{color:n.colorErrorHover},{color:n.colorErrorActive})),SJ(n.componentCls,n.ghostBg,n.colorError,n.colorError,n.colorTextDisabled,n.colorBorder,{color:n.colorErrorHover,borderColor:n.colorErrorHover},{color:n.colorErrorActive,borderColor:n.colorErrorActive})),K7t=n=>Object.assign(Object.assign({},Wy(n,n.colorLink,"link",{color:n.colorLinkHover},{color:n.colorLinkActive})),SJ(n.componentCls,n.ghostBg,n.colorInfo,n.colorInfo,n.colorTextDisabled,n.colorBorder,{color:n.colorInfoHover,borderColor:n.colorInfoHover},{color:n.colorInfoActive,borderColor:n.colorInfoActive})),G7t=n=>{const{componentCls:e}=n;return Object.assign({[`${e}-color-default`]:z7t(n),[`${e}-color-primary`]:U7t(n),[`${e}-color-dangerous`]:q7t(n),[`${e}-color-link`]:K7t(n)},W7t(n))},Y7t=n=>Object.assign(Object.assign(Object.assign(Object.assign({},TJ(n,n.defaultBorderColor,n.defaultBg,{color:n.defaultHoverColor,borderColor:n.defaultHoverBorderColor,background:n.defaultHoverBg},{color:n.defaultActiveColor,borderColor:n.defaultActiveBorderColor,background:n.defaultActiveBg})),Wy(n,n.textTextColor,"text",{color:n.textTextHoverColor,background:n.textHoverBg},{color:n.textTextActiveColor,background:n.colorBgTextActive})),kJ(n,n.primaryColor,n.colorPrimary,{background:n.colorPrimaryHover,color:n.primaryColor},{background:n.colorPrimaryActive,color:n.primaryColor})),Wy(n,n.colorLink,"link",{color:n.colorLinkHover,background:n.linkHoverBg},{color:n.colorLinkActive})),lxe=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,controlHeight:i,fontSize:r,borderRadius:s,buttonPaddingHorizontal:o,iconCls:a,buttonPaddingVertical:l,buttonIconOnlyFontSize:c}=n;return[{[e]:{fontSize:r,height:i,padding:`${Fi(l)} ${Fi(o)}`,borderRadius:s,[`&${t}-icon-only`]:{width:i,[a]:{fontSize:c}}}},{[`${t}${t}-circle${e}`]:F7t(n)},{[`${t}${t}-round${e}`]:B7t(n)}]},Q7t=n=>{const e=gg(n,{fontSize:n.contentFontSize});return lxe(e,n.componentCls)},X7t=n=>{const e=gg(n,{controlHeight:n.controlHeightSM,fontSize:n.contentFontSizeSM,padding:n.paddingXS,buttonPaddingHorizontal:n.paddingInlineSM,buttonPaddingVertical:0,borderRadius:n.borderRadiusSM,buttonIconOnlyFontSize:n.onlyIconSizeSM});return lxe(e,`${n.componentCls}-sm`)},Z7t=n=>{const e=gg(n,{controlHeight:n.controlHeightLG,fontSize:n.contentFontSizeLG,buttonPaddingHorizontal:n.paddingInlineLG,buttonPaddingVertical:0,borderRadius:n.borderRadiusLG,buttonIconOnlyFontSize:n.onlyIconSizeLG});return lxe(e,`${n.componentCls}-lg`)},J7t=n=>{const{componentCls:e}=n;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},eBt=c9("Button",n=>{const e=mYe(n);return[j7t(e),Q7t(e),X7t(e),Z7t(e),J7t(e),G7t(e),Y7t(e),h7t(e)]},_Ye,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function tBt(n,e,t){const{focusElCls:i,focus:r,borderElCls:s}=t,o=s?"> *":"",a=["hover",r?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${o}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:n.calc(n.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},i?{[`&${i}`]:{zIndex:2}}:{}),{[`&[disabled] ${o}`]:{zIndex:0}})}}function nBt(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 cxe(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({},tBt(n,i,e)),nBt(t,i,e))}}function iBt(n,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:n.calc(n.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function rBt(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 sBt(n){const e=`${n.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},iBt(n,e)),rBt(n.componentCls,e))}}const oBt=n=>{const{componentCls:e,colorPrimaryHover:t,lineWidth:i,calc:r}=n,s=r(i).mul(-1).equal(),o=a=>{const l=`${e}-compact${a?"-vertical":""}-item${e}-primary:not([disabled])`;return{[`${l} + ${l}::before`]:{position:"absolute",top:a?s:0,insetInlineStart:a?0:s,backgroundColor:t,content:'""',width:a?"100%":i,height:a?i:"100%"}}};return Object.assign(Object.assign({},o()),o(!0))},aBt=D6t(["Button","compact"],n=>{const e=mYe(n);return[cxe(e),sBt(e),oBt(e)]},_Ye);var lBt=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 cBt(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 uBt={default:["default","outlined"],primary:["primary","solid"],dashed:["default","dashed"],link:["link","link"],text:["default","text"]},dBt=we.forwardRef((n,e)=>{var t,i;const{loading:r=!1,prefixCls:s,color:o,variant:a,type:l,danger:c=!1,shape:u="default",size:d,styles:f,disabled:p,className:g,rootClassName:m,children:_,icon:v,iconPosition:b="start",ghost:y=!1,block:C=!1,htmlType:S="button",classNames:k,style:I={},autoInsertSpace:L,autoFocus:N}=n,P=lBt(n,["loading","prefixCls","color","variant","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace","autoFocus"]),O=l||"default",[F,V]=x.useMemo(()=>{if(o&&a)return[o,a];const ke=uBt[O]||[];return c?["danger",ke[1]]:ke},[l,o,a,c]),B=F==="danger"?"dangerous":F,{getPrefixCls:W,direction:q,autoInsertSpace:U,className:G,style:H,classNames:z,styles:Z}=PGe("button"),X=(t=L??U)!==null&&t!==void 0?t:!0,oe=W("btn",s),[fe,Se,Me]=eBt(oe),Ie=x.useContext(RO),ge=p??Ie,ye=x.useContext(uYe),Pe=x.useMemo(()=>cBt(r),[r]),[Be,$e]=x.useState(Pe.loading),[qe,mt]=x.useState(!1),vt=x.useRef(null),ft=_J(e,vt),tt=x.Children.count(_)===1&&!v&&!Xre(V),St=x.useRef(!0);we.useEffect(()=>(St.current=!1,()=>{St.current=!0}),[]),x.useEffect(()=>{let ke=null;Pe.delay>0?ke=setTimeout(()=>{ke=null,$e(!0)},Pe.delay):$e(Pe.loading);function Ae(){ke&&(clearTimeout(ke),ke=null)}return Ae},[Pe]),x.useEffect(()=>{if(!vt.current||!X)return;const ke=vt.current.textContent||"";tt&&Rfe(ke)?qe||mt(!0):qe&&mt(!1)}),x.useEffect(()=>{N&&vt.current&&vt.current.focus()},[]);const Ft=we.useCallback(ke=>{var Ae;if(Be||ge){ke.preventDefault();return}(Ae=n.onClick)===null||Ae===void 0||Ae.call(n,("href"in n,ke))},[n.onClick,Be,ge]),{compactSize:en,compactItemClassnames:Ke}=axe(oe,q),dt={large:"lg",small:"sm",middle:void 0},nt=oxe(ke=>{var Ae,je;return(je=(Ae=d??en)!==null&&Ae!==void 0?Ae:ye)!==null&&je!==void 0?je:ke}),at=nt&&(i=dt[nt])!==null&&i!==void 0?i:"",Oe=Be?"loading":v,ce=rxe(P,["navigate"]),Ne=$t(oe,Se,Me,{[`${oe}-${u}`]:u!=="default"&&u,[`${oe}-${O}`]:O,[`${oe}-dangerous`]:c,[`${oe}-color-${B}`]:B,[`${oe}-variant-${V}`]:V,[`${oe}-${at}`]:at,[`${oe}-icon-only`]:!_&&_!==0&&!!Oe,[`${oe}-background-ghost`]:y&&!Xre(V),[`${oe}-loading`]:Be,[`${oe}-two-chinese-chars`]:qe&&X&&!Be,[`${oe}-block`]:C,[`${oe}-rtl`]:q==="rtl",[`${oe}-icon-end`]:b==="end"},Ke,g,m,G),Xe=Object.assign(Object.assign({},H),I),it=$t(k==null?void 0:k.icon,z.icon),Tt=Object.assign(Object.assign({},(f==null?void 0:f.icon)||{}),Z.icon||{}),Ct=v&&!Be?we.createElement(Pfe,{prefixCls:oe,className:it,style:Tt},v):r&&typeof r=="object"&&r.icon?we.createElement(Pfe,{prefixCls:oe,className:it,style:Tt},r.icon):we.createElement(d7t,{existIcon:!!v,prefixCls:oe,loading:Be,mount:St.current}),Rt=_||_===0?u7t(_,tt&&X):null;if(ce.href!==void 0)return fe(we.createElement("a",Object.assign({},ce,{className:$t(Ne,{[`${oe}-disabled`]:ge}),href:ge?void 0:ce.href,style:Xe,onClick:Ft,ref:ft,tabIndex:ge?-1:0}),Ct,Rt));let se=we.createElement("button",Object.assign({},P,{type:S,className:Ne,style:Xe,onClick:Ft,disabled:ge,ref:ft}),Ct,Rt,Ke&&we.createElement(aBt,{prefixCls:oe}));return Xre(V)||(se=we.createElement(s7t,{component:"Button",disabled:Be},se)),fe(se)}),uxe=dBt;uxe.Group=l7t;uxe.__ANT_BUTTON=!0;var bYe=x.createContext(null),hPe=[];function hBt(n,e){var t=x.useState(function(){if(!Nm())return null;var g=document.createElement("div");return g}),i=Mt(t,1),r=i[0],s=x.useRef(!1),o=x.useContext(bYe),a=x.useState(hPe),l=Mt(a,2),c=l[0],u=l[1],d=o||(s.current?void 0:function(g){u(function(m){var _=[g].concat(_r(m));return _})});function f(){r.parentElement||document.body.appendChild(r),s.current=!0}function p(){var g;(g=r.parentElement)===null||g===void 0||g.removeChild(r),s.current=!1}return uc(function(){return n?o?o(f):f():p(),p},[n]),uc(function(){c.length&&(c.forEach(function(g){return g()}),u(hPe))},[c]),[r,d]}function fBt(n){var e="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),t=document.createElement("div");t.id=e;var i=t.style;i.position="absolute",i.left="0",i.top="0",i.width="100px",i.height="100px",i.overflow="scroll";var r,s;if(n){var o=getComputedStyle(n);i.scrollbarColor=o.scrollbarColor,i.scrollbarWidth=o.scrollbarWidth;var a=getComputedStyle(n,"::-webkit-scrollbar"),l=parseInt(a.width,10),c=parseInt(a.height,10);try{var u=l?"width: ".concat(a.width,";"):"",d=c?"height: ".concat(a.height,";"):"";ow(` #`.concat(e,`::-webkit-scrollbar { `).concat(u,` `).concat(d,` }`),e)}catch(g){console.error(g),r=l,s=c}}document.body.appendChild(t);var f=n&&r&&!isNaN(r)?r:t.offsetWidth-t.clientWidth,p=n&&s&&!isNaN(s)?s:t.offsetHeight-t.clientHeight;return document.body.removeChild(t),C8(e),{width:f,height:p}}function pBt(n){return typeof document>"u"||!n||!(n instanceof Element)?{width:0,height:0}:fBt(n)}function gBt(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var mBt="rc-util-locker-".concat(Date.now()),fPe=0;function _Bt(n){var e=!!n,t=x.useState(function(){return fPe+=1,"".concat(mBt,"_").concat(fPe)}),i=Mt(t,1),r=i[0];uc(function(){if(e){var s=pBt(document.body).width,o=gBt();ow(` html body { overflow-y: hidden; `.concat(o?"width: calc(100% - ".concat(s,"px);"):"",` }`),r)}else C8(r);return function(){C8(r)}},[e,r])}var vBt=!1;function bBt(n){return vBt}var pPe=function(e){return e===!1?!1:!Nm()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},yYe=x.forwardRef(function(n,e){var t=n.open,i=n.autoLock,r=n.getContainer;n.debug;var s=n.autoDestroy,o=s===void 0?!0:s,a=n.children,l=x.useState(t),c=Mt(l,2),u=c[0],d=c[1],f=u||t;x.useEffect(function(){(o||t)&&d(t)},[t,o]);var p=x.useState(function(){return pPe(r)}),g=Mt(p,2),m=g[0],_=g[1];x.useEffect(function(){var O=pPe(r);_(O??null)});var v=hBt(f&&!m),b=Mt(v,2),y=b[0],C=b[1],S=m??y;_Bt(i&&t&&Nm()&&(S===y||S===document.body));var k=null;if(a&&a9(a)&&e){var I=a;k=I.ref}var L=_J(k,e);if(!f||!Nm()||m===void 0)return null;var N=S===!1||bBt(),P=a;return e&&(P=x.cloneElement(a,{ref:L})),x.createElement(bYe.Provider,{value:C},N?P:Bm.createPortal(P,S))});function yBt(){var n=ut({},q_);return n.useId}var gPe=0,mPe=yBt();const CBt=mPe?function(e){var t=mPe();return e||t}:function(e){var t=x.useState("ssr-id"),i=Mt(t,2),r=i[0],s=i[1];return x.useEffect(function(){var o=gPe;gPe+=1,s("rc_unique_".concat(o))},[]),e||r};var V2="RC_FORM_INTERNAL_HOOKS",fl=function(){lg(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},OO=x.createContext({getFieldValue:fl,getFieldsValue:fl,getFieldError:fl,getFieldWarning:fl,getFieldsError:fl,isFieldsTouched:fl,isFieldTouched:fl,isFieldValidating:fl,isFieldsValidating:fl,resetFields:fl,setFields:fl,setFieldValue:fl,setFieldsValue:fl,validateFields:fl,submit:fl,getInternalHooks:function(){return fl(),{dispatch:fl,initEntityValue:fl,registerField:fl,useSubscribe:fl,setInitialValues:fl,destroyForm:fl,setCallbacks:fl,registerWatch:fl,getFields:fl,setValidateMessages:fl,setPreserve:fl,getInitialValue:fl}}}),jq=x.createContext(null);function Ofe(n){return n==null?[]:Array.isArray(n)?n:[n]}function wBt(n){return n&&!!n._init}function Mfe(){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 jfe=Mfe();function xBt(n){try{return Function.toString.call(n).indexOf("[native code]")!==-1}catch{return typeof n=="function"}}function SBt(n,e,t){if(UCe())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var r=new(n.bind.apply(n,i));return t&&fO(r,t.prototype),r}function Ffe(n){var e=typeof Map=="function"?new Map:void 0;return Ffe=function(i){if(i===null||!xBt(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(i))return e.get(i);e.set(i,r)}function r(){return SBt(i,arguments,Tm(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),fO(r,i)},Ffe(n)}var EBt=/%[sdj%]/g,kBt=function(){};function Bfe(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 hm(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,s=t.length;if(typeof n=="function")return n.apply(null,t);if(typeof n=="string"){var o=n.replace(EBt,function(a){if(a==="%%")return"%";if(r>=s)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 o}return n}function TBt(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function cd(n,e){return!!(n==null||e==="array"&&Array.isArray(n)&&!n.length||TBt(e)&&typeof n=="string"&&!n)}function IBt(n,e,t){var i=[],r=0,s=n.length;function o(a){i.push.apply(i,_r(a||[])),r++,r===s&&t(i)}n.forEach(function(a){e(a,o)})}function _Pe(n,e,t){var i=0,r=n.length;function s(o){if(o&&o.length){t(o);return}var a=i;i=i+1,a<r?e(n[a],s):t([])}s([])}function LBt(n){var e=[];return Object.keys(n).forEach(function(t){e.push.apply(e,_r(n[t]||[]))}),e}var vPe=function(n){$m(t,n);var e=Hw(t);function t(i,r){var s;return Ra(this,t),s=e.call(this,"Async Validation Error"),wt(Bs(s),"errors",void 0),wt(Bs(s),"fields",void 0),s.errors=i,s.fields=r,s}return Pa(t)}(Ffe(Error));function ABt(n,e,t,i,r){if(e.first){var s=new Promise(function(f,p){var g=function(v){return i(v),v.length?p(new vPe(v,Bfe(v))):f(r)},m=LBt(n);_Pe(m,t,g)});return s.catch(function(f){return f}),s}var o=e.firstFields===!0?Object.keys(n):e.firstFields||[],a=Object.keys(n),l=a.length,c=0,u=[],d=new Promise(function(f,p){var g=function(_){if(u.push.apply(u,_),c++,c===l)return i(u),u.length?p(new vPe(u,Bfe(u))):f(r)};a.length||(i(u),f(r)),a.forEach(function(m){var _=n[m];o.indexOf(m)!==-1?_Pe(_,t,g):IBt(_,t,g)})});return d.catch(function(f){return f}),d}function NBt(n){return!!(n&&n.message!==void 0)}function DBt(n,e){for(var t=n,i=0;i<e.length;i++){if(t==null)return t;t=t[e[i]]}return t}function bPe(n,e){return function(t){var i;return n.fullFields?i=DBt(e,n.fullFields):i=e[t.field||n.fullField],NBt(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 yPe(n,e){if(e){for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];Mr(i)==="object"&&Mr(n[t])==="object"?n[t]=ut(ut({},n[t]),i):n[t]=i}}return n}var vD="enum",RBt=function(e,t,i,r,s){e[vD]=Array.isArray(e[vD])?e[vD]:[],e[vD].indexOf(t)===-1&&r.push(hm(s.messages[vD],e.fullField,e[vD].join(", ")))},PBt=function(e,t,i,r,s){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(hm(s.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var o=new RegExp(e.pattern);o.test(t)||r.push(hm(s.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},OBt=function(e,t,i,r,s){var o=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,f=typeof t=="number",p=typeof t=="string",g=Array.isArray(t);if(f?d="number":p?d="string":g&&(d="array"),!d)return!1;g&&(u=t.length),p&&(u=t.replace(c,"_").length),o?u!==e.len&&r.push(hm(s.messages[d].len,e.fullField,e.len)):a&&!l&&u<e.min?r.push(hm(s.messages[d].min,e.fullField,e.min)):l&&!a&&u>e.max?r.push(hm(s.messages[d].max,e.fullField,e.max)):a&&l&&(u<e.min||u>e.max)&&r.push(hm(s.messages[d].range,e.fullField,e.min,e.max))},CYe=function(e,t,i,r,s,o){e.required&&(!i.hasOwnProperty(e.field)||cd(t,o||e.type))&&r.push(hm(s.messages.required,e.fullField))},ZH;const MBt=function(){if(ZH)return ZH;var n="[a-fA-F\\d:]",e=function(k){return k&&k.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(n,")|(?<=").concat(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=["(?:".concat(i,":){7}(?:").concat(i,"|:)"),"(?:".concat(i,":){6}(?:").concat(t,"|:").concat(i,"|:)"),"(?:".concat(i,":){5}(?::").concat(t,"|(?::").concat(i,"){1,2}|:)"),"(?:".concat(i,":){4}(?:(?::").concat(i,"){0,1}:").concat(t,"|(?::").concat(i,"){1,3}|:)"),"(?:".concat(i,":){3}(?:(?::").concat(i,"){0,2}:").concat(t,"|(?::").concat(i,"){1,4}|:)"),"(?:".concat(i,":){2}(?:(?::").concat(i,"){0,3}:").concat(t,"|(?::").concat(i,"){1,5}|:)"),"(?:".concat(i,":){1}(?:(?::").concat(i,"){0,4}:").concat(t,"|(?::").concat(i,"){1,6}|:)"),"(?::(?:(?::".concat(i,"){0,5}:").concat(t,"|(?::").concat(i,"){1,7}|:))")],s="(?:%[0-9a-zA-Z]{1,})?",o="(?:".concat(r.join("|"),")").concat(s),a=new RegExp("(?:^".concat(t,"$)|(?:^").concat(o,"$)")),l=new RegExp("^".concat(t,"$")),c=new RegExp("^".concat(o,"$")),u=function(k){return k&&k.exact?a:new RegExp("(?:".concat(e(k)).concat(t).concat(e(k),")|(?:").concat(e(k)).concat(o).concat(e(k),")"),"g")};u.v4=function(S){return S&&S.exact?l:new RegExp("".concat(e(S)).concat(t).concat(e(S)),"g")},u.v6=function(S){return S&&S.exact?c:new RegExp("".concat(e(S)).concat(o).concat(e(S)),"g")};var d="(?:(?:[a-z]+:)?//)",f="(?:\\S+(?::\\S*)?@)?",p=u.v4().source,g=u.v6().source,m="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",_="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",v="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",b="(?::\\d{2,5})?",y='(?:[/?#][^\\s"]*)?',C="(?:".concat(d,"|www\\.)").concat(f,"(?:localhost|").concat(p,"|").concat(g,"|").concat(m).concat(_).concat(v,")").concat(b).concat(y);return ZH=new RegExp("(?:^".concat(C,"$)"),"i"),ZH};var CPe={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},Bj={integer:function(e){return Bj.number(e)&&parseInt(e,10)===e},float:function(e){return Bj.number(e)&&!Bj.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 Mr(e)==="object"&&!Bj.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(CPe.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(MBt())},hex:function(e){return typeof e=="string"&&!!e.match(CPe.hex)}},jBt=function(e,t,i,r,s){if(e.required&&t===void 0){CYe(e,t,i,r,s);return}var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;o.indexOf(a)>-1?Bj[a](t)||r.push(hm(s.messages.types[a],e.fullField,e.type)):a&&Mr(t)!==e.type&&r.push(hm(s.messages.types[a],e.fullField,e.type))},FBt=function(e,t,i,r,s){(/^\s+$/.test(t)||t==="")&&r.push(hm(s.messages.whitespace,e.fullField))};const Mo={required:CYe,whitespace:FBt,type:jBt,range:OBt,enum:RBt,pattern:PBt};var BBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t)&&!e.required)return i();Mo.required(e,t,r,o,s)}i(o)},$Bt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return i();Mo.required(e,t,r,o,s,"array"),t!=null&&(Mo.type(e,t,r,o,s),Mo.range(e,t,r,o,s))}i(o)},HBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t)&&!e.required)return i();Mo.required(e,t,r,o,s),t!==void 0&&Mo.type(e,t,r,o,s)}i(o)},VBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t,"date")&&!e.required)return i();if(Mo.required(e,t,r,o,s),!cd(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),Mo.type(e,l,r,o,s),l&&Mo.range(e,l.getTime(),r,o,s)}}i(o)},WBt="enum",zBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t)&&!e.required)return i();Mo.required(e,t,r,o,s),t!==void 0&&Mo[WBt](e,t,r,o,s)}i(o)},UBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t)&&!e.required)return i();Mo.required(e,t,r,o,s),t!==void 0&&(Mo.type(e,t,r,o,s),Mo.range(e,t,r,o,s))}i(o)},qBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t)&&!e.required)return i();Mo.required(e,t,r,o,s),t!==void 0&&(Mo.type(e,t,r,o,s),Mo.range(e,t,r,o,s))}i(o)},KBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t)&&!e.required)return i();Mo.required(e,t,r,o,s),t!==void 0&&Mo.type(e,t,r,o,s)}i(o)},GBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),cd(t)&&!e.required)return i();Mo.required(e,t,r,o,s),t!==void 0&&(Mo.type(e,t,r,o,s),Mo.range(e,t,r,o,s))}i(o)},YBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t)&&!e.required)return i();Mo.required(e,t,r,o,s),t!==void 0&&Mo.type(e,t,r,o,s)}i(o)},QBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t,"string")&&!e.required)return i();Mo.required(e,t,r,o,s),cd(t,"string")||Mo.pattern(e,t,r,o,s)}i(o)},XBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t)&&!e.required)return i();Mo.required(e,t,r,o,s),cd(t)||Mo.type(e,t,r,o,s)}i(o)},ZBt=function(e,t,i,r,s){var o=[],a=Array.isArray(t)?"array":Mr(t);Mo.required(e,t,r,o,s,a),i(o)},JBt=function(e,t,i,r,s){var o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(cd(t,"string")&&!e.required)return i();Mo.required(e,t,r,o,s,"string"),cd(t,"string")||(Mo.type(e,t,r,o,s),Mo.range(e,t,r,o,s),Mo.pattern(e,t,r,o,s),e.whitespace===!0&&Mo.whitespace(e,t,r,o,s))}i(o)},tse=function(e,t,i,r,s){var o=e.type,a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(cd(t,o)&&!e.required)return i();Mo.required(e,t,r,a,s,o),cd(t,o)||Mo.type(e,t,r,a,s)}i(a)};const IF={string:JBt,method:KBt,number:GBt,boolean:HBt,regexp:XBt,integer:qBt,float:UBt,array:$Bt,object:YBt,enum:zBt,pattern:QBt,date:VBt,url:tse,hex:tse,email:tse,required:ZBt,any:BBt};var h9=function(){function n(e){Ra(this,n),wt(this,"rules",null),wt(this,"_messages",jfe),this.define(e)}return Pa(n,[{key:"define",value:function(t){var i=this;if(!t)throw new Error("Cannot configure a schema with no rules");if(Mr(t)!=="object"||Array.isArray(t))throw new Error("Rules must be an object");this.rules={},Object.keys(t).forEach(function(r){var s=t[r];i.rules[r]=Array.isArray(s)?s:[s]})}},{key:"messages",value:function(t){return t&&(this._messages=yPe(Mfe(),t)),this._messages}},{key:"validate",value:function(t){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},o=t,a=r,l=s;if(typeof a=="function"&&(l=a,a={}),!this.rules||Object.keys(this.rules).length===0)return l&&l(null,o),Promise.resolve(o);function c(g){var m=[],_={};function v(y){if(Array.isArray(y)){var C;m=(C=m).concat.apply(C,_r(y))}else m.push(y)}for(var b=0;b<g.length;b++)v(g[b]);m.length?(_=Bfe(m),l(m,_)):l(null,o)}if(a.messages){var u=this.messages();u===jfe&&(u=Mfe()),yPe(u,a.messages),a.messages=u}else a.messages=this.messages();var d={},f=a.keys||Object.keys(this.rules);f.forEach(function(g){var m=i.rules[g],_=o[g];m.forEach(function(v){var b=v;typeof b.transform=="function"&&(o===t&&(o=ut({},o)),_=o[g]=b.transform(_),_!=null&&(b.type=b.type||(Array.isArray(_)?"array":Mr(_)))),typeof b=="function"?b={validator:b}:b=ut({},b),b.validator=i.getValidationMethod(b),b.validator&&(b.field=g,b.fullField=b.fullField||g,b.type=i.getType(b),d[g]=d[g]||[],d[g].push({rule:b,value:_,source:o,field:g}))})});var p={};return ABt(d,a,function(g,m){var _=g.rule,v=(_.type==="object"||_.type==="array")&&(Mr(_.fields)==="object"||Mr(_.defaultField)==="object");v=v&&(_.required||!_.required&&g.value),_.field=g.field;function b(I,L){return ut(ut({},L),{},{fullField:"".concat(_.fullField,".").concat(I),fullFields:_.fullFields?[].concat(_r(_.fullFields),[I]):[I]})}function y(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],L=Array.isArray(I)?I:[I];!a.suppressWarning&&L.length&&n.warning("async-validator:",L),L.length&&_.message!==void 0&&(L=[].concat(_.message));var N=L.map(bPe(_,o));if(a.first&&N.length)return p[_.field]=1,m(N);if(!v)m(N);else{if(_.required&&!g.value)return _.message!==void 0?N=[].concat(_.message).map(bPe(_,o)):a.error&&(N=[a.error(_,hm(a.messages.required,_.field))]),m(N);var P={};_.defaultField&&Object.keys(g.value).map(function(V){P[V]=_.defaultField}),P=ut(ut({},P),g.rule.fields);var O={};Object.keys(P).forEach(function(V){var M=P[V],B=Array.isArray(M)?M:[M];O[V]=B.map(b.bind(null,V))});var F=new n(O);F.messages(a.messages),g.rule.options&&(g.rule.options.messages=a.messages,g.rule.options.error=a.error),F.validate(g.value,g.rule.options||a,function(V){var M=[];N&&N.length&&M.push.apply(M,_r(N)),V&&V.length&&M.push.apply(M,_r(V)),m(M.length?M:null)})}}var C;if(_.asyncValidator)C=_.asyncValidator(_,g.value,y,g.source,a);else if(_.validator){try{C=_.validator(_,g.value,y,g.source,a)}catch(I){var S,k;(S=(k=console).error)===null||S===void 0||S.call(k,I),a.suppressValidatorError||setTimeout(function(){throw I},0),y(I.message)}C===!0?y():C===!1?y(typeof _.message=="function"?_.message(_.fullField||_.field):_.message||"".concat(_.fullField||_.field," fails")):C instanceof Array?y(C):C instanceof Error&&y(C.message)}C&&C.then&&C.then(function(){return y()},function(I){return y(I)})},function(g){c(g)},o)}},{key:"getType",value:function(t){if(t.type===void 0&&t.pattern instanceof RegExp&&(t.type="pattern"),typeof t.validator!="function"&&t.type&&!IF.hasOwnProperty(t.type))throw new Error(hm("Unknown rule type %s",t.type));return t.type||"string"}},{key:"getValidationMethod",value:function(t){if(typeof t.validator=="function")return t.validator;var i=Object.keys(t),r=i.indexOf("message");return r!==-1&&i.splice(r,1),i.length===1&&i[0]==="required"?IF.required:IF[this.getType(t)]||void 0}}]),n}();wt(h9,"register",function(e,t){if(typeof t!="function")throw new Error("Cannot register a validator by type, validator is not a function");IF[e]=t});wt(h9,"warning",kBt);wt(h9,"messages",jfe);wt(h9,"validators",IF);var Ug="'${name}' is not a valid ${type}",wYe={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:Ug,method:Ug,array:Ug,object:Ug,number:Ug,date:Ug,boolean:Ug,integer:Ug,float:Ug,regexp:Ug,email:Ug,url:Ug,hex:Ug},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}"}},wPe=h9;function e9t(n,e){return n.replace(/\\?\$\{\w+\}/g,function(t){if(t.startsWith("\\"))return t.slice(1);var i=t.slice(2,-1);return e[i]})}var xPe="CODE_LOGIC_ERROR";function $fe(n,e,t,i,r){return Hfe.apply(this,arguments)}function Hfe(){return Hfe=CA(ip().mark(function n(e,t,i,r,s){var o,a,l,c,u,d,f,p,g;return ip().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return o=ut({},i),delete o.ruleIndex,wPe.warning=function(){},o.validator&&(a=o.validator,o.validator=function(){try{return a.apply(void 0,arguments)}catch(v){return console.error(v),Promise.reject(xPe)}}),l=null,o&&o.type==="array"&&o.defaultField&&(l=o.defaultField,delete o.defaultField),c=new wPe(wt({},e,[o])),u=fR(wYe,r.validateMessages),c.messages(u),d=[],_.prev=10,_.next=13,Promise.resolve(c.validate(wt({},e,t),ut({},r)));case 13:_.next=18;break;case 15:_.prev=15,_.t0=_.catch(10),_.t0.errors&&(d=_.t0.errors.map(function(v,b){var y=v.message,C=y===xPe?u.default:y;return x.isValidElement(C)?x.cloneElement(C,{key:"error_".concat(b)}):C}));case 18:if(!(!d.length&&l)){_.next=23;break}return _.next=21,Promise.all(t.map(function(v,b){return $fe("".concat(e,".").concat(b),v,l,r,s)}));case 21:return f=_.sent,_.abrupt("return",f.reduce(function(v,b){return[].concat(_r(v),_r(b))},[]));case 23:return p=ut(ut({},i),{},{name:e,enum:(i.enum||[]).join(", ")},s),g=d.map(function(v){return typeof v=="string"?e9t(v,p):v}),_.abrupt("return",g);case 26:case"end":return _.stop()}},n,null,[[10,15]])})),Hfe.apply(this,arguments)}function t9t(n,e,t,i,r,s){var o=n.join("."),a=t.map(function(u,d){var f=u.validator,p=ut(ut({},u),{},{ruleIndex:d});return f&&(p.validator=function(g,m,_){var v=!1,b=function(){for(var S=arguments.length,k=new Array(S),I=0;I<S;I++)k[I]=arguments[I];Promise.resolve().then(function(){lg(!v,"Your validator function has already return a promise. `callback` will be ignored."),v||_.apply(void 0,k)})},y=f(g,m,b);v=y&&typeof y.then=="function"&&typeof y.catch=="function",lg(v,"`callback` is deprecated. Please return a promise instead."),v&&y.then(function(){_()}).catch(function(C){_(C||" ")})}),p}).sort(function(u,d){var f=u.warningOnly,p=u.ruleIndex,g=d.warningOnly,m=d.ruleIndex;return!!f==!!g?p-m:f?1:-1}),l;if(r===!0)l=new Promise(function(){var u=CA(ip().mark(function d(f,p){var g,m,_;return ip().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,$fe(o,e,m,i,s);case 5:if(_=b.sent,!_.length){b.next=9;break}return p([{errors:_,rule:m}]),b.abrupt("return");case 9:g+=1,b.next=1;break;case 12:f([]);case 13:case"end":return b.stop()}},d)}));return function(d,f){return u.apply(this,arguments)}}());else{var c=a.map(function(u){return $fe(o,e,u,i,s).then(function(d){return{errors:d,rule:u}})});l=(r?i9t(c):n9t(c)).then(function(u){return Promise.reject(u)})}return l.catch(function(u){return u}),l}function n9t(n){return Vfe.apply(this,arguments)}function Vfe(){return Vfe=CA(ip().mark(function n(e){return ip().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Promise.all(e).then(function(r){var s,o=(s=[]).concat.apply(s,_r(r));return o}));case 1:case"end":return i.stop()}},n)})),Vfe.apply(this,arguments)}function i9t(n){return Wfe.apply(this,arguments)}function Wfe(){return Wfe=CA(ip().mark(function n(e){var t;return ip().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=0,r.abrupt("return",new Promise(function(s){e.forEach(function(o){o.then(function(a){a.errors.length&&s([a]),t+=1,t===e.length&&s([])})})}));case 2:case"end":return r.stop()}},n)})),Wfe.apply(this,arguments)}function au(n){return Ofe(n)}function SPe(n,e){var t={};return e.forEach(function(i){var r=xy(n,i);t=Zv(t,i,r)}),t}function yP(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return n&&n.some(function(i){return xYe(e,i,t)})}function xYe(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 r9t(n,e){if(n===e)return!0;if(!n&&e||n&&!e||!n||!e||Mr(n)!=="object"||Mr(e)!=="object")return!1;var t=Object.keys(n),i=Object.keys(e),r=new Set([].concat(t,i));return _r(r).every(function(s){var o=n[s],a=e[s];return typeof o=="function"&&typeof a=="function"?!0:o===a})}function s9t(n){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&Mr(e.target)==="object"&&n in e.target?e.target[n]:e}function EPe(n,e,t){var i=n.length;if(e<0||e>=i||t<0||t>=i)return n;var r=n[e],s=e-t;return s>0?[].concat(_r(n.slice(0,t)),[r],_r(n.slice(t,e)),_r(n.slice(e+1,i))):s<0?[].concat(_r(n.slice(0,e)),_r(n.slice(e+1,t+1)),[r],_r(n.slice(t+1,i))):n}var o9t=["name"],__=[];function nse(n,e,t,i,r,s){return typeof n=="function"?n(e,t,"source"in s?{source:s.source}:{}):i!==r}var dxe=function(n){$m(t,n);var e=Hw(t);function t(i){var r;if(Ra(this,t),r=e.call(this,i),wt(Bs(r),"state",{resetCount:0}),wt(Bs(r),"cancelRegisterFunc",null),wt(Bs(r),"mounted",!1),wt(Bs(r),"touched",!1),wt(Bs(r),"dirty",!1),wt(Bs(r),"validatePromise",void 0),wt(Bs(r),"prevValidating",void 0),wt(Bs(r),"errors",__),wt(Bs(r),"warnings",__),wt(Bs(r),"cancelRegister",function(){var l=r.props,c=l.preserve,u=l.isListField,d=l.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(u,c,au(d)),r.cancelRegisterFunc=null}),wt(Bs(r),"getNamePath",function(){var l=r.props,c=l.name,u=l.fieldContext,d=u.prefixName,f=d===void 0?[]:d;return c!==void 0?[].concat(_r(f),_r(c)):[]}),wt(Bs(r),"getRules",function(){var l=r.props,c=l.rules,u=c===void 0?[]:c,d=l.fieldContext;return u.map(function(f){return typeof f=="function"?f(d):f})}),wt(Bs(r),"refresh",function(){r.mounted&&r.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),wt(Bs(r),"metaCache",null),wt(Bs(r),"triggerMetaEvent",function(l){var c=r.props.onMetaChange;if(c){var u=ut(ut({},r.getMeta()),{},{destroy:l});rfe(r.metaCache,u)||c(u),r.metaCache=u}else r.metaCache=null}),wt(Bs(r),"onStoreChange",function(l,c,u){var d=r.props,f=d.shouldUpdate,p=d.dependencies,g=p===void 0?[]:p,m=d.onReset,_=u.store,v=r.getNamePath(),b=r.getValue(l),y=r.getValue(_),C=c&&yP(c,v);switch(u.type==="valueUpdate"&&u.source==="external"&&!rfe(b,y)&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=__,r.warnings=__,r.triggerMetaEvent()),u.type){case"reset":if(!c||C){r.touched=!1,r.dirty=!1,r.validatePromise=void 0,r.errors=__,r.warnings=__,r.triggerMetaEvent(),m==null||m(),r.refresh();return}break;case"remove":{if(f&&nse(f,l,_,b,y,u)){r.reRender();return}break}case"setField":{var S=u.data;if(C){"touched"in S&&(r.touched=S.touched),"validating"in S&&!("originRCField"in S)&&(r.validatePromise=S.validating?Promise.resolve([]):null),"errors"in S&&(r.errors=S.errors||__),"warnings"in S&&(r.warnings=S.warnings||__),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}else if("value"in S&&yP(c,v,!0)){r.reRender();return}if(f&&!v.length&&nse(f,l,_,b,y,u)){r.reRender();return}break}case"dependenciesUpdate":{var k=g.map(au);if(k.some(function(I){return yP(u.relatedFields,I)})){r.reRender();return}break}default:if(C||(!g.length||v.length||f)&&nse(f,l,_,b,y,u)){r.reRender();return}break}f===!0&&r.reRender()}),wt(Bs(r),"validateRules",function(l){var c=r.getNamePath(),u=r.getValue(),d=l||{},f=d.triggerName,p=d.validateOnly,g=p===void 0?!1:p,m=Promise.resolve().then(CA(ip().mark(function _(){var v,b,y,C,S,k,I;return ip().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(r.mounted){N.next=2;break}return N.abrupt("return",[]);case 2:if(v=r.props,b=v.validateFirst,y=b===void 0?!1:b,C=v.messageVariables,S=v.validateDebounce,k=r.getRules(),f&&(k=k.filter(function(P){return P}).filter(function(P){var O=P.validateTrigger;if(!O)return!0;var F=Ofe(O);return F.includes(f)})),!(S&&f)){N.next=10;break}return N.next=8,new Promise(function(P){setTimeout(P,S)});case 8:if(r.validatePromise===m){N.next=10;break}return N.abrupt("return",[]);case 10:return I=t9t(c,u,k,l,y,C),I.catch(function(P){return P}).then(function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:__;if(r.validatePromise===m){var O;r.validatePromise=null;var F=[],V=[];(O=P.forEach)===null||O===void 0||O.call(P,function(M){var B=M.rule.warningOnly,W=M.errors,q=W===void 0?__:W;B?V.push.apply(V,_r(q)):F.push.apply(F,_r(q))}),r.errors=F,r.warnings=V,r.triggerMetaEvent(),r.reRender()}}),N.abrupt("return",I);case 13:case"end":return N.stop()}},_)})));return g||(r.validatePromise=m,r.dirty=!0,r.errors=__,r.warnings=__,r.triggerMetaEvent(),r.reRender()),m}),wt(Bs(r),"isFieldValidating",function(){return!!r.validatePromise}),wt(Bs(r),"isFieldTouched",function(){return r.touched}),wt(Bs(r),"isFieldDirty",function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var l=r.props.fieldContext,c=l.getInternalHooks(V2),u=c.getInitialValue;return u(r.getNamePath())!==void 0}),wt(Bs(r),"getErrors",function(){return r.errors}),wt(Bs(r),"getWarnings",function(){return r.warnings}),wt(Bs(r),"isListField",function(){return r.props.isListField}),wt(Bs(r),"isList",function(){return r.props.isList}),wt(Bs(r),"isPreserve",function(){return r.props.preserve}),wt(Bs(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}),wt(Bs(r),"getOnlyChild",function(l){if(typeof l=="function"){var c=r.getMeta();return ut(ut({},r.getOnlyChild(l(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=Iq(l);return u.length!==1||!x.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),wt(Bs(r),"getValue",function(l){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return xy(l||c(!0),u)}),wt(Bs(r),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=r.props,u=c.name,d=c.trigger,f=c.validateTrigger,p=c.getValueFromEvent,g=c.normalize,m=c.valuePropName,_=c.getValueProps,v=c.fieldContext,b=f!==void 0?f:v.validateTrigger,y=r.getNamePath(),C=v.getInternalHooks,S=v.getFieldsValue,k=C(V2),I=k.dispatch,L=r.getValue(),N=_||function(M){return wt({},m,M)},P=l[d],O=u!==void 0?N(L):{},F=ut(ut({},l),O);F[d]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var M,B=arguments.length,W=new Array(B),q=0;q<B;q++)W[q]=arguments[q];p?M=p.apply(void 0,W):M=s9t.apply(void 0,[m].concat(W)),g&&(M=g(M,L,S(!0))),M!==L&&I({type:"updateValue",namePath:y,value:M}),P&&P.apply(void 0,W)};var V=Ofe(b||[]);return V.forEach(function(M){var B=F[M];F[M]=function(){B&&B.apply(void 0,arguments);var W=r.props.rules;W&&W.length&&I({type:"validateField",namePath:y,triggerName:M})}}),F}),i.fieldContext){var s=i.fieldContext.getInternalHooks,o=s(V2),a=o.initEntityValue;a(Bs(r))}return r}return Pa(t,[{key:"componentDidMount",value:function(){var r=this.props,s=r.shouldUpdate,o=r.fieldContext;if(this.mounted=!0,o){var a=o.getInternalHooks,l=a(V2),c=l.registerField;this.cancelRegisterFunc=c(this)}s===!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,s=this.props.children,o=this.getOnlyChild(s),a=o.child,l=o.isFunction,c;return l?c=a:x.isValidElement(a)?c=x.cloneElement(a,this.getControlled(a.props)):(lg(!a,"`children` of Field is not validate ReactElement."),c=a),x.createElement(x.Fragment,{key:r},c)}}]),t}(x.Component);wt(dxe,"contextType",OO);wt(dxe,"defaultProps",{trigger:"onChange",valuePropName:"value"});function SYe(n){var e,t=n.name,i=Na(n,o9t),r=x.useContext(OO),s=x.useContext(jq),o=t!==void 0?au(t):void 0,a=(e=i.isListField)!==null&&e!==void 0?e:!!s,l="keep";return a||(l="_".concat((o||[]).join("_"))),x.createElement(dxe,hn({key:l,name:o,isListField:a},i,{fieldContext:r}))}function a9t(n){var e=n.name,t=n.initialValue,i=n.children,r=n.rules,s=n.validateTrigger,o=n.isListField,a=x.useContext(OO),l=x.useContext(jq),c=x.useRef({keys:[],id:0}),u=c.current,d=x.useMemo(function(){var m=au(a.prefixName)||[];return[].concat(_r(m),_r(au(e)))},[a.prefixName,e]),f=x.useMemo(function(){return ut(ut({},a),{},{prefixName:d})},[a,d]),p=x.useMemo(function(){return{getKey:function(_){var v=d.length,b=_[v];return[u.keys[b],_.slice(v+1)]}}},[d]);if(typeof i!="function")return lg(!1,"Form.List only accepts function as children."),null;var g=function(_,v,b){var y=b.source;return y==="internal"?!1:_!==v};return x.createElement(jq.Provider,{value:p},x.createElement(OO.Provider,{value:f},x.createElement(SYe,{name:[],shouldUpdate:g,rules:r,validateTrigger:s,initialValue:t,isList:!0,isListField:o??!!l},function(m,_){var v=m.value,b=v===void 0?[]:v,y=m.onChange,C=a.getFieldValue,S=function(){var N=C(d||[]);return N||[]},k={add:function(N,P){var O=S();P>=0&&P<=O.length?(u.keys=[].concat(_r(u.keys.slice(0,P)),[u.id],_r(u.keys.slice(P))),y([].concat(_r(O.slice(0,P)),[N],_r(O.slice(P))))):(u.keys=[].concat(_r(u.keys),[u.id]),y([].concat(_r(O),[N]))),u.id+=1},remove:function(N){var P=S(),O=new Set(Array.isArray(N)?N:[N]);O.size<=0||(u.keys=u.keys.filter(function(F,V){return!O.has(V)}),y(P.filter(function(F,V){return!O.has(V)})))},move:function(N,P){if(N!==P){var O=S();N<0||N>=O.length||P<0||P>=O.length||(u.keys=EPe(u.keys,N,P),y(EPe(O,N,P)))}}},I=b||[];return Array.isArray(I)||(I=[]),i(I.map(function(L,N){var P=u.keys[N];return P===void 0&&(u.keys[N]=u.id,P=u.keys[N],u.id+=1),{name:N,key:P,isListField:!0}}),k,_)})))}function l9t(n){var e=!1,t=n.length,i=[];return n.length?new Promise(function(r,s){n.forEach(function(o,a){o.catch(function(l){return e=!0,l}).then(function(l){t-=1,i[a]=l,!(t>0)&&(e&&s(i),r(i))})})}):Promise.resolve([])}var EYe="__@field_split__";function ise(n){return n.map(function(e){return"".concat(Mr(e),":").concat(e)}).join(EYe)}var bD=function(){function n(){Ra(this,n),wt(this,"kvs",new Map)}return Pa(n,[{key:"set",value:function(t,i){this.kvs.set(ise(t),i)}},{key:"get",value:function(t){return this.kvs.get(ise(t))}},{key:"update",value:function(t,i){var r=this.get(t),s=i(r);s?this.set(t,s):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(ise(t))}},{key:"map",value:function(t){return _r(this.kvs.entries()).map(function(i){var r=Mt(i,2),s=r[0],o=r[1],a=s.split(EYe);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=Mt(c,3),d=u[1],f=u[2];return d==="number"?Number(f):f}),value:o})})}},{key:"toJSON",value:function(){var t={};return this.map(function(i){var r=i.key,s=i.value;return t[r.join(".")]=s,null}),t}}]),n}(),c9t=["name"],u9t=Pa(function n(e){var t=this;Ra(this,n),wt(this,"formHooked",!1),wt(this,"forceRootUpdate",void 0),wt(this,"subscribable",!0),wt(this,"store",{}),wt(this,"fieldEntities",[]),wt(this,"initialValues",{}),wt(this,"callbacks",{}),wt(this,"validateMessages",null),wt(this,"preserve",null),wt(this,"lastValidatePromise",null),wt(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}}),wt(this,"getInternalHooks",function(i){return i===V2?(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}):(lg(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),wt(this,"useSubscribe",function(i){t.subscribable=i}),wt(this,"prevWithoutPreserves",null),wt(this,"setInitialValues",function(i,r){if(t.initialValues=i||{},r){var s,o=fR(i,t.store);(s=t.prevWithoutPreserves)===null||s===void 0||s.map(function(a){var l=a.key;o=Zv(o,l,xy(i,l))}),t.prevWithoutPreserves=null,t.updateStore(o)}}),wt(this,"destroyForm",function(i){if(i)t.updateStore({});else{var r=new bD;t.getFieldEntities(!0).forEach(function(s){t.isMergedPreserve(s.isPreserve())||r.set(s.getNamePath(),!0)}),t.prevWithoutPreserves=r}}),wt(this,"getInitialValue",function(i){var r=xy(t.initialValues,i);return i.length?fR(r):r}),wt(this,"setCallbacks",function(i){t.callbacks=i}),wt(this,"setValidateMessages",function(i){t.validateMessages=i}),wt(this,"setPreserve",function(i){t.preserve=i}),wt(this,"watchList",[]),wt(this,"registerWatch",function(i){return t.watchList.push(i),function(){t.watchList=t.watchList.filter(function(r){return r!==i})}}),wt(this,"notifyWatch",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var r=t.getFieldsValue(),s=t.getFieldsValue(!0);t.watchList.forEach(function(o){o(r,s,i)})}}),wt(this,"timeoutId",null),wt(this,"warningUnhooked",function(){}),wt(this,"updateStore",function(i){t.store=i}),wt(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}),wt(this,"getFieldsMap",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new bD;return t.getFieldEntities(i).forEach(function(s){var o=s.getNamePath();r.set(o,s)}),r}),wt(this,"getFieldEntitiesForNamePathList",function(i){if(!i)return t.getFieldEntities(!0);var r=t.getFieldsMap(!0);return i.map(function(s){var o=au(s);return r.get(o)||{INVALIDATE_NAME_PATH:au(s)}})}),wt(this,"getFieldsValue",function(i,r){t.warningUnhooked();var s,o,a;if(i===!0||Array.isArray(i)?(s=i,o=r):i&&Mr(i)==="object"&&(a=i.strict,o=i.filter),s===!0&&!o)return t.store;var l=t.getFieldEntitiesForNamePathList(Array.isArray(s)?s:null),c=[];return l.forEach(function(u){var d,f,p="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(!s&&(d=(f=u).isListField)!==null&&d!==void 0&&d.call(f))return;if(!o)c.push(p);else{var _="getMeta"in u?u.getMeta():null;o(_)&&c.push(p)}}),SPe(t.store,c.map(au))}),wt(this,"getFieldValue",function(i){t.warningUnhooked();var r=au(i);return xy(t.store,r)}),wt(this,"getFieldsError",function(i){t.warningUnhooked();var r=t.getFieldEntitiesForNamePathList(i);return r.map(function(s,o){return s&&!("INVALIDATE_NAME_PATH"in s)?{name:s.getNamePath(),errors:s.getErrors(),warnings:s.getWarnings()}:{name:au(i[o]),errors:[],warnings:[]}})}),wt(this,"getFieldError",function(i){t.warningUnhooked();var r=au(i),s=t.getFieldsError([r])[0];return s.errors}),wt(this,"getFieldWarning",function(i){t.warningUnhooked();var r=au(i),s=t.getFieldsError([r])[0];return s.warnings}),wt(this,"isFieldsTouched",function(){t.warningUnhooked();for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];var o=r[0],a=r[1],l,c=!1;r.length===0?l=null:r.length===1?Array.isArray(o)?(l=o.map(au),c=!1):(l=null,c=o):(l=o.map(au),c=a);var u=t.getFieldEntities(!0),d=function(_){return _.isFieldTouched()};if(!l)return c?u.every(function(m){return d(m)||m.isList()}):u.some(d);var f=new bD;l.forEach(function(m){f.set(m,[])}),u.forEach(function(m){var _=m.getNamePath();l.forEach(function(v){v.every(function(b,y){return _[y]===b})&&f.update(v,function(b){return[].concat(_r(b),[m])})})});var p=function(_){return _.some(d)},g=f.map(function(m){var _=m.value;return _});return c?g.every(p):g.some(p)}),wt(this,"isFieldTouched",function(i){return t.warningUnhooked(),t.isFieldsTouched([i])}),wt(this,"isFieldsValidating",function(i){t.warningUnhooked();var r=t.getFieldEntities();if(!i)return r.some(function(o){return o.isFieldValidating()});var s=i.map(au);return r.some(function(o){var a=o.getNamePath();return yP(s,a)&&o.isFieldValidating()})}),wt(this,"isFieldValidating",function(i){return t.warningUnhooked(),t.isFieldsValidating([i])}),wt(this,"resetWithFieldInitialValue",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=new bD,s=t.getFieldEntities(!0);s.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 o=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var f=u.getNamePath(),p=t.getInitialValue(f);if(p!==void 0)lg(!1,"Form already set 'initialValues' with path '".concat(f.join("."),"'. Field can not overwrite it."));else{var g=r.get(f);if(g&&g.size>1)lg(!1,"Multiple Field with path '".concat(f.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var m=t.getFieldValue(f),_=u.isListField();!_&&(!i.skipExist||m===void 0)&&t.updateStore(Zv(t.store,f,_r(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,_r(_r(c).map(function(d){return d.entity})))}})):a=s,o(a)}),wt(this,"resetFields",function(i){t.warningUnhooked();var r=t.store;if(!i){t.updateStore(fR(t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(r,null,{type:"reset"}),t.notifyWatch();return}var s=i.map(au);s.forEach(function(o){var a=t.getInitialValue(o);t.updateStore(Zv(t.store,o,a))}),t.resetWithFieldInitialValue({namePathList:s}),t.notifyObservers(r,s,{type:"reset"}),t.notifyWatch(s)}),wt(this,"setFields",function(i){t.warningUnhooked();var r=t.store,s=[];i.forEach(function(o){var a=o.name,l=Na(o,c9t),c=au(a);s.push(c),"value"in l&&t.updateStore(Zv(t.store,c,l.value)),t.notifyObservers(r,[c],{type:"setField",data:o})}),t.notifyWatch(s)}),wt(this,"getFields",function(){var i=t.getFieldEntities(!0),r=i.map(function(s){var o=s.getNamePath(),a=s.getMeta(),l=ut(ut({},a),{},{name:o,value:t.getFieldValue(o)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return r}),wt(this,"initEntityValue",function(i){var r=i.props.initialValue;if(r!==void 0){var s=i.getNamePath(),o=xy(t.store,s);o===void 0&&t.updateStore(Zv(t.store,s,r))}}),wt(this,"isMergedPreserve",function(i){var r=i!==void 0?i:t.preserve;return r??!0}),wt(this,"registerField",function(i){t.fieldEntities.push(i);var r=i.getNamePath();if(t.notifyWatch([r]),i.props.initialValue!==void 0){var s=t.store;t.resetWithFieldInitialValue({entities:[i],skipExist:!0}),t.notifyObservers(s,[i.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(o,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)&&(!o||l.length>1)){var c=o?void 0:t.getInitialValue(r);if(r.length&&t.getFieldValue(r)!==c&&t.fieldEntities.every(function(d){return!xYe(d.getNamePath(),r)})){var u=t.store;t.updateStore(Zv(u,r,c,!0)),t.notifyObservers(u,[r],{type:"remove"}),t.triggerDependenciesUpdate(u,r)}}t.notifyWatch([r])}}),wt(this,"dispatch",function(i){switch(i.type){case"updateValue":{var r=i.namePath,s=i.value;t.updateValue(r,s);break}case"validateField":{var o=i.namePath,a=i.triggerName;t.validateFields([o],{triggerName:a});break}}}),wt(this,"notifyObservers",function(i,r,s){if(t.subscribable){var o=ut(ut({},s),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(i,r,o)})}else t.forceRootUpdate()}),wt(this,"triggerDependenciesUpdate",function(i,r){var s=t.getDependencyChildrenFields(r);return s.length&&t.validateFields(s),t.notifyObservers(i,s,{type:"dependenciesUpdate",relatedFields:[r].concat(_r(s))}),s}),wt(this,"updateValue",function(i,r){var s=au(i),o=t.store;t.updateStore(Zv(t.store,s,r)),t.notifyObservers(o,[s],{type:"valueUpdate",source:"internal"}),t.notifyWatch([s]);var a=t.triggerDependenciesUpdate(o,s),l=t.callbacks.onValuesChange;if(l){var c=SPe(t.store,[s]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([s].concat(_r(a)))}),wt(this,"setFieldsValue",function(i){t.warningUnhooked();var r=t.store;if(i){var s=fR(t.store,i);t.updateStore(s)}t.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()}),wt(this,"setFieldValue",function(i,r){t.setFields([{name:i,value:r,errors:[],warnings:[]}])}),wt(this,"getDependencyChildrenFields",function(i){var r=new Set,s=[],o=new bD;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=au(u);o.update(d,function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return f.add(l),f})})});var a=function l(c){var u=o.get(c)||new Set;u.forEach(function(d){if(!r.has(d)){r.add(d);var f=d.getNamePath();d.isFieldDirty()&&f.length&&(s.push(f),l(f))}})};return a(i),s}),wt(this,"triggerOnFieldsChange",function(i,r){var s=t.callbacks.onFieldsChange;if(s){var o=t.getFields();if(r){var a=new bD;r.forEach(function(c){var u=c.name,d=c.errors;a.set(u,d)}),o.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=o.filter(function(c){var u=c.name;return yP(i,u)});l.length&&s(l,o)}}),wt(this,"validateFields",function(i,r){t.warningUnhooked();var s,o;Array.isArray(i)||typeof i=="string"||typeof r=="string"?(s=i,o=r):o=i;var a=!!s,l=a?s.map(au):[],c=[],u=String(Date.now()),d=new Set,f=o||{},p=f.recursive,g=f.dirty;t.getFieldEntities(!0).forEach(function(b){if(a||l.push(b.getNamePath()),!(!b.props.rules||!b.props.rules.length)&&!(g&&!b.isFieldDirty())){var y=b.getNamePath();if(d.add(y.join(u)),!a||yP(l,y,p)){var C=b.validateRules(ut({validateMessages:ut(ut({},wYe),t.validateMessages)},o));c.push(C.then(function(){return{name:y,errors:[],warnings:[]}}).catch(function(S){var k,I=[],L=[];return(k=S.forEach)===null||k===void 0||k.call(S,function(N){var P=N.rule.warningOnly,O=N.errors;P?L.push.apply(L,_r(O)):I.push.apply(I,_r(O))}),I.length?Promise.reject({name:y,errors:I,warnings:L}):{name:y,errors:I,warnings:L}}))}}});var m=l9t(c);t.lastValidatePromise=m,m.catch(function(b){return b}).then(function(b){var y=b.map(function(C){var S=C.name;return S});t.notifyObservers(t.store,y,{type:"validateFinish"}),t.triggerOnFieldsChange(y,b)});var _=m.then(function(){return t.lastValidatePromise===m?Promise.resolve(t.getFieldsValue(l)):Promise.reject([])}).catch(function(b){var y=b.filter(function(C){return C&&C.errors.length});return Promise.reject({values:t.getFieldsValue(l),errorFields:y,outOfDate:t.lastValidatePromise!==m})});_.catch(function(b){return b});var v=l.filter(function(b){return d.has(b.join(u))});return t.triggerOnFieldsChange(v),_}),wt(this,"submit",function(){t.warningUnhooked(),t.validateFields().then(function(i){var r=t.callbacks.onFinish;if(r)try{r(i)}catch(s){console.error(s)}}).catch(function(i){var r=t.callbacks.onFinishFailed;r&&r(i)})}),this.forceRootUpdate=e});function kYe(n){var e=x.useRef(),t=x.useState({}),i=Mt(t,2),r=i[1];if(!e.current)if(n)e.current=n;else{var s=function(){r({})},o=new u9t(s);e.current=o.getForm()}return[e.current]}var zfe=x.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),d9t=function(e){var t=e.validateMessages,i=e.onFormChange,r=e.onFormFinish,s=e.children,o=x.useContext(zfe),a=x.useRef({});return x.createElement(zfe.Provider,{value:ut(ut({},o),{},{validateMessages:ut(ut({},o.validateMessages),t),triggerFormChange:function(c,u){i&&i(c,{changedFields:u,forms:a.current}),o.triggerFormChange(c,u)},triggerFormFinish:function(c,u){r&&r(c,{values:u,forms:a.current}),o.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=ut(ut({},a.current),{},wt({},c,u))),o.registerForm(c,u)},unregisterForm:function(c){var u=ut({},a.current);delete u[c],a.current=u,o.unregisterForm(c)}})},s)},h9t=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],f9t=function(e,t){var i=e.name,r=e.initialValues,s=e.fields,o=e.form,a=e.preserve,l=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,f=e.validateTrigger,p=f===void 0?"onChange":f,g=e.onValuesChange,m=e.onFieldsChange,_=e.onFinish,v=e.onFinishFailed,b=e.clearOnDestroy,y=Na(e,h9t),C=x.useRef(null),S=x.useContext(zfe),k=kYe(o),I=Mt(k,1),L=I[0],N=L.getInternalHooks(V2),P=N.useSubscribe,O=N.setInitialValues,F=N.setCallbacks,V=N.setValidateMessages,M=N.setPreserve,B=N.destroyForm;x.useImperativeHandle(t,function(){return ut(ut({},L),{},{nativeElement:C.current})}),x.useEffect(function(){return S.registerForm(i,L),function(){S.unregisterForm(i)}},[S,L,i]),V(ut(ut({},S.validateMessages),d)),F({onValuesChange:g,onFieldsChange:function(oe){if(S.triggerFormChange(i,oe),m){for(var fe=arguments.length,Se=new Array(fe>1?fe-1:0),Me=1;Me<fe;Me++)Se[Me-1]=arguments[Me];m.apply(void 0,[oe].concat(Se))}},onFinish:function(oe){S.triggerFormFinish(i,oe),_&&_(oe)},onFinishFailed:v}),M(a);var W=x.useRef(null);O(r,!W.current),W.current||(W.current=!0),x.useEffect(function(){return function(){return B(b)}},[]);var q,U=typeof l=="function";if(U){var G=L.getFieldsValue(!0);q=l(G,L)}else q=l;P(!U);var H=x.useRef();x.useEffect(function(){r9t(H.current||[],s||[])||L.setFields(s||[]),H.current=s},[s,L]);var z=x.useMemo(function(){return ut(ut({},L),{},{validateTrigger:p})},[L,p]),Z=x.createElement(jq.Provider,{value:null},x.createElement(OO.Provider,{value:z},q));return u===!1?Z:x.createElement(u,hn({},y,{ref:C,onSubmit:function(oe){oe.preventDefault(),oe.stopPropagation(),L.submit()},onReset:function(oe){var fe;oe.preventDefault(),L.resetFields(),(fe=y.onReset)===null||fe===void 0||fe.call(y,oe)}}),Z)};function kPe(n){try{return JSON.stringify(n)}catch{return Math.random()}}function p9t(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var i=e[0],r=e[1],s=r===void 0?{}:r,o=wBt(s)?{form:s}:s,a=o.form,l=x.useState(),c=Mt(l,2),u=c[0],d=c[1],f=x.useMemo(function(){return kPe(u)},[u]),p=x.useRef(f);p.current=f;var g=x.useContext(OO),m=a||g,_=m&&m._init,v=au(i),b=x.useRef(v);return b.current=v,x.useEffect(function(){if(_){var y=m.getFieldsValue,C=m.getInternalHooks,S=C(V2),k=S.registerWatch,I=function(O,F){var V=o.preserve?F:O;return typeof i=="function"?i(V):xy(V,b.current)},L=k(function(P,O){var F=I(P,O),V=kPe(F);p.current!==V&&(p.current=V,d(F))}),N=I(y(),y(!0));return u!==N&&d(N),L}},[_]),u}var g9t=x.forwardRef(f9t),f9=g9t;f9.FormProvider=d9t;f9.Field=SYe;f9.List=a9t;f9.useForm=kYe;f9.useWatch=p9t;const Fq=x.createContext({}),m9t=n=>{let{children:e,status:t,override:i}=n;const r=x.useContext(Fq),s=x.useMemo(()=>{const o=Object.assign({},r);return i&&delete o.isFormItemInput,t&&(delete o.status,delete o.hasFeedback,delete o.feedbackIcon),o},[t,i,r]);return x.createElement(Fq.Provider,{value:s},e)},_9t=x.createContext(void 0),TYe=n=>{const{space:e,form:t,children:i}=n;if(i==null)return null;let r=i;return t&&(r=we.createElement(m9t,{override:!0,status:!0},r)),e&&(r=we.createElement(o7t,null,r)),r};function v9t(n){return e=>x.createElement(bk,{theme:{token:{motion:!1,zIndexPopupBase:0}}},x.createElement(n,Object.assign({},e)))}const IYe=(n,e,t,i,r)=>v9t(o=>{const{prefixCls:a,style:l}=o,c=x.useRef(null),[u,d]=x.useState(0),[f,p]=x.useState(0),[g,m]=Dy(!1,{value:o.open}),{getPrefixCls:_}=x.useContext(pg),v=_(i,a);x.useEffect(()=>{if(m(!0),typeof ResizeObserver<"u"){const C=new ResizeObserver(k=>{const I=k[0].target;d(I.offsetHeight+8),p(I.offsetWidth)}),S=setInterval(()=>{var k;const I=`.${v}-dropdown`,L=(k=c.current)===null||k===void 0?void 0:k.querySelector(I);L&&(clearInterval(S),C.observe(L))},10);return()=>{clearInterval(S),C.disconnect()}}},[]);let b=Object.assign(Object.assign({},o),{style:Object.assign(Object.assign({},l),{margin:0}),open:g,visible:g,getPopupContainer:()=>c.current});Object.assign(b,{[e]:{overflow:{adjustX:!1,adjustY:!1}}});const y={paddingBottom:u,position:"relative",minWidth:f};return x.createElement("div",{ref:c,style:y},x.createElement(n,Object.assign({},b)))}),b9t=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))};var y9t=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],yD=void 0;function C9t(n,e){var t=n.prefixCls,i=n.invalidate,r=n.item,s=n.renderItem,o=n.responsive,a=n.responsiveDisabled,l=n.registerSize,c=n.itemKey,u=n.className,d=n.style,f=n.children,p=n.display,g=n.order,m=n.component,_=m===void 0?"div":m,v=Na(n,y9t),b=o&&!p;function y(L){l(c,L)}x.useEffect(function(){return function(){y(null)}},[]);var C=s&&r!==yD?s(r,{index:g}):f,S;i||(S={opacity:b?0:1,height:b?0:yD,overflowY:b?"hidden":yD,order:o?g:yD,pointerEvents:b?"none":yD,position:b?"absolute":yD});var k={};b&&(k["aria-hidden"]=!0);var I=x.createElement(_,hn({className:$t(!i&&t,u),style:ut(ut({},S),d)},k,v,{ref:e}),C);return o&&(I=x.createElement(bA,{onResize:function(N){var P=N.offsetWidth;y(P)},disabled:a},I)),I}var LF=x.forwardRef(C9t);LF.displayName="Item";function w9t(n){if(typeof MessageChannel>"u")Eh(n);else{var e=new MessageChannel;e.port1.onmessage=function(){return n()},e.port2.postMessage(void 0)}}function x9t(){var n=x.useRef(null),e=function(i){n.current||(n.current=[],w9t(function(){Bm.unstable_batchedUpdates(function(){n.current.forEach(function(r){r()}),n.current=null})})),n.current.push(i)};return e}function R5(n,e){var t=x.useState(e),i=Mt(t,2),r=i[0],s=i[1],o=Ta(function(a){n(function(){s(a)})});return[r,o]}var Bq=we.createContext(null),S9t=["component"],E9t=["className"],k9t=["className"],T9t=function(e,t){var i=x.useContext(Bq);if(!i){var r=e.component,s=r===void 0?"div":r,o=Na(e,S9t);return x.createElement(s,hn({},o,{ref:t}))}var a=i.className,l=Na(i,E9t),c=e.className,u=Na(e,k9t);return x.createElement(Bq.Provider,{value:null},x.createElement(LF,hn({ref:t,className:$t(a,c)},l,u)))},LYe=x.forwardRef(T9t);LYe.displayName="RawItem";var I9t=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],AYe="responsive",NYe="invalidate";function L9t(n){return"+ ".concat(n.length," ...")}function A9t(n,e){var t=n.prefixCls,i=t===void 0?"rc-overflow":t,r=n.data,s=r===void 0?[]:r,o=n.renderItem,a=n.renderRawItem,l=n.itemKey,c=n.itemWidth,u=c===void 0?10:c,d=n.ssr,f=n.style,p=n.className,g=n.maxCount,m=n.renderRest,_=n.renderRawRest,v=n.suffix,b=n.component,y=b===void 0?"div":b,C=n.itemComponent,S=n.onVisibleChange,k=Na(n,I9t),I=d==="full",L=x9t(),N=R5(L,null),P=Mt(N,2),O=P[0],F=P[1],V=O||0,M=R5(L,new Map),B=Mt(M,2),W=B[0],q=B[1],U=R5(L,0),G=Mt(U,2),H=G[0],z=G[1],Z=R5(L,0),X=Mt(Z,2),oe=X[0],fe=X[1],Se=R5(L,0),Me=Mt(Se,2),Ie=Me[0],ge=Me[1],ye=x.useState(null),Pe=Mt(ye,2),Be=Pe[0],$e=Pe[1],qe=x.useState(null),mt=Mt(qe,2),vt=mt[0],ft=mt[1],tt=x.useMemo(function(){return vt===null&&I?Number.MAX_SAFE_INTEGER:vt||0},[vt,O]),St=x.useState(!1),Ft=Mt(St,2),en=Ft[0],Ke=Ft[1],dt="".concat(i,"-item"),nt=Math.max(H,oe),at=g===AYe,Oe=s.length&&at,ce=g===NYe,Ne=Oe||typeof g=="number"&&s.length>g,Xe=x.useMemo(function(){var _n=s;return Oe?O===null&&I?_n=s:_n=s.slice(0,Math.min(s.length,V/u)):typeof g=="number"&&(_n=s.slice(0,g)),_n},[s,u,O,g,Oe]),it=x.useMemo(function(){return Oe?s.slice(tt+1):s.slice(Xe.length)},[s,Xe,Oe,tt]),Tt=x.useCallback(function(_n,de){var _e;return typeof l=="function"?l(_n):(_e=l&&(_n==null?void 0:_n[l]))!==null&&_e!==void 0?_e:de},[l]),Ct=x.useCallback(o||function(_n){return _n},[o]);function Rt(_n,de,_e){vt===_n&&(de===void 0||de===Be)||(ft(_n),_e||(Ke(_n<s.length-1),S==null||S(_n)),de!==void 0&&$e(de))}function se(_n,de){F(de.clientWidth)}function ke(_n,de){q(function(_e){var Le=new Map(_e);return de===null?Le.delete(_n):Le.set(_n,de),Le})}function Ae(_n,de){fe(de),z(oe)}function je(_n,de){ge(de)}function Ve(_n){return W.get(Tt(Xe[_n],_n))}uc(function(){if(V&&typeof nt=="number"&&Xe){var _n=Ie,de=Xe.length,_e=de-1;if(!de){Rt(0,null);return}for(var Le=0;Le<de;Le+=1){var Ge=Ve(Le);if(I&&(Ge=Ge||0),Ge===void 0){Rt(Le-1,void 0,!0);break}if(_n+=Ge,_e===0&&_n<=V||Le===_e-1&&_n+Ve(_e)<=V){Rt(_e,null);break}else if(_n+nt>V){Rt(Le-1,_n-Ge-Ie+oe);break}}v&&Ve(0)+Ie>V&&$e(null)}},[V,W,oe,Ie,Tt,Xe]);var Qt=en&&!!it.length,rt={};Be!==null&&Oe&&(rt={position:"absolute",left:Be,top:0});var Cn={prefixCls:dt,responsive:Oe,component:C,invalidate:ce},Rn=a?function(_n,de){var _e=Tt(_n,de);return x.createElement(Bq.Provider,{key:_e,value:ut(ut({},Cn),{},{order:de,item:_n,itemKey:_e,registerSize:ke,display:de<=tt})},a(_n,de))}:function(_n,de){var _e=Tt(_n,de);return x.createElement(LF,hn({},Cn,{order:de,key:_e,item:_n,renderItem:Ct,itemKey:_e,registerSize:ke,display:de<=tt}))},li={order:Qt?tt:Number.MAX_SAFE_INTEGER,className:"".concat(dt,"-rest"),registerSize:Ae,display:Qt},Mi=m||L9t,si=_?x.createElement(Bq.Provider,{value:ut(ut({},Cn),li)},_(it)):x.createElement(LF,hn({},Cn,li),typeof Mi=="function"?Mi(it):Mi),oi=x.createElement(y,hn({className:$t(!ce&&i,p),style:f,ref:e},k),Xe.map(Rn),Ne?si:null,v&&x.createElement(LF,hn({},Cn,{responsive:at,responsiveDisabled:!Oe,order:tt,className:"".concat(dt,"-suffix"),registerSize:je,display:!0,style:rt}),v));return at?x.createElement(bA,{onResize:se,disabled:!Oe},oi):oi}var p9=x.forwardRef(A9t);p9.displayName="Overflow";p9.Item=LYe;p9.RESPONSIVE=AYe;p9.INVALIDATE=NYe;function N9t(n){var e=n.prefixCls,t=n.align,i=n.arrow,r=n.arrowPos,s=i||{},o=s.className,a=s.content,l=r.x,c=l===void 0?0:l,u=r.y,d=u===void 0?0:u,f=x.useRef();if(!t||!t.points)return null;var p={position:"absolute"};if(t.autoArrow!==!1){var g=t.points[0],m=t.points[1],_=g[0],v=g[1],b=m[0],y=m[1];_===b||!["t","b"].includes(_)?p.top=d:_==="t"?p.top=0:p.bottom=0,v===y||!["l","r"].includes(v)?p.left=c:v==="l"?p.left=0:p.right=0}return x.createElement("div",{ref:f,className:$t("".concat(e,"-arrow"),o),style:p},a)}function D9t(n){var e=n.prefixCls,t=n.open,i=n.zIndex,r=n.mask,s=n.motion;return r?x.createElement(u9,hn({},s,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(o){var a=o.className;return x.createElement("div",{style:{zIndex:i},className:$t("".concat(e,"-mask"),a)})}):null}var R9t=x.memo(function(n){var e=n.children;return e},function(n,e){return e.cache}),P9t=x.forwardRef(function(n,e){var t=n.popup,i=n.className,r=n.prefixCls,s=n.style,o=n.target,a=n.onVisibleChanged,l=n.open,c=n.keepDom,u=n.fresh,d=n.onClick,f=n.mask,p=n.arrow,g=n.arrowPos,m=n.align,_=n.motion,v=n.maskMotion,b=n.forceRender,y=n.getPopupContainer,C=n.autoDestroy,S=n.portal,k=n.zIndex,I=n.onMouseEnter,L=n.onMouseLeave,N=n.onPointerEnter,P=n.onPointerDownCapture,O=n.ready,F=n.offsetX,V=n.offsetY,M=n.offsetR,B=n.offsetB,W=n.onAlign,q=n.onPrepare,U=n.stretch,G=n.targetWidth,H=n.targetHeight,z=typeof t=="function"?t():t,Z=l||c,X=(y==null?void 0:y.length)>0,oe=x.useState(!y||!X),fe=Mt(oe,2),Se=fe[0],Me=fe[1];if(uc(function(){!Se&&X&&o&&Me(!0)},[Se,X,o]),!Se)return null;var Ie="auto",ge={left:"-1000vw",top:"-1000vh",right:Ie,bottom:Ie};if(O||!l){var ye,Pe=m.points,Be=m.dynamicInset||((ye=m._experimental)===null||ye===void 0?void 0:ye.dynamicInset),$e=Be&&Pe[0][1]==="r",qe=Be&&Pe[0][0]==="b";$e?(ge.right=M,ge.left=Ie):(ge.left=F,ge.right=Ie),qe?(ge.bottom=B,ge.top=Ie):(ge.top=V,ge.bottom=Ie)}var mt={};return U&&(U.includes("height")&&H?mt.height=H:U.includes("minHeight")&&H&&(mt.minHeight=H),U.includes("width")&&G?mt.width=G:U.includes("minWidth")&&G&&(mt.minWidth=G)),l||(mt.pointerEvents="none"),x.createElement(S,{open:b||Z,getContainer:y&&function(){return y(o)},autoDestroy:C},x.createElement(D9t,{prefixCls:r,open:l,zIndex:k,mask:f,motion:v}),x.createElement(bA,{onResize:W,disabled:!l},function(vt){return x.createElement(u9,hn({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:b,leavedClassName:"".concat(r,"-hidden")},_,{onAppearPrepare:q,onEnterPrepare:q,visible:l,onVisibleChanged:function(tt){var St;_==null||(St=_.onVisibleChanged)===null||St===void 0||St.call(_,tt),a(tt)}}),function(ft,tt){var St=ft.className,Ft=ft.style,en=$t(r,St,i);return x.createElement("div",{ref:mJ(vt,e,tt),className:en,style:ut(ut(ut(ut({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},ge),mt),Ft),{},{boxSizing:"border-box",zIndex:k},s),onMouseEnter:I,onMouseLeave:L,onPointerEnter:N,onClick:d,onPointerDownCapture:P},p&&x.createElement(N9t,{prefixCls:r,arrow:p,arrowPos:g,align:m}),x.createElement(R9t,{cache:!l&&!u},z))})}))}),O9t=x.forwardRef(function(n,e){var t=n.children,i=n.getTriggerDOMNode,r=a9(t),s=x.useCallback(function(a){zwe(e,i?i(a):a)},[i]),o=_J(s,vJ(t));return r?x.cloneElement(t,{ref:o}):t}),TPe=x.createContext(null);function IPe(n){return n?Array.isArray(n)?n:[n]:[]}function M9t(n,e,t,i){return x.useMemo(function(){var r=IPe(t??e),s=IPe(i??e),o=new Set(r),a=new Set(s);return n&&(o.has("hover")&&(o.delete("hover"),o.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[o,a]},[n,e,t,i])}function j9t(){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 F9t(n,e,t,i){for(var r=t.points,s=Object.keys(n),o=0;o<s.length;o+=1){var a,l=s[o];if(j9t((a=n[l])===null||a===void 0?void 0:a.points,r,i))return"".concat(e,"-placement-").concat(l)}return""}function LPe(n,e,t,i){return e||(t?{motionName:"".concat(n,"-").concat(t)}:i?{motionName:i}:null)}function g9(n){return n.ownerDocument.defaultView}function Ufe(n){for(var e=[],t=n==null?void 0:n.parentElement,i=["hidden","scroll","clip","auto"];t;){var r=g9(t).getComputedStyle(t),s=r.overflowX,o=r.overflowY,a=r.overflow;[s,o,a].some(function(l){return i.includes(l)})&&e.push(t),t=t.parentElement}return e}function I8(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(n)?e:n}function P5(n){return I8(parseFloat(n),0)}function APe(n,e){var t=ut({},n);return(e||[]).forEach(function(i){if(!(i instanceof HTMLBodyElement||i instanceof HTMLHtmlElement)){var r=g9(i).getComputedStyle(i),s=r.overflow,o=r.overflowClipMargin,a=r.borderTopWidth,l=r.borderBottomWidth,c=r.borderLeftWidth,u=r.borderRightWidth,d=i.getBoundingClientRect(),f=i.offsetHeight,p=i.clientHeight,g=i.offsetWidth,m=i.clientWidth,_=P5(a),v=P5(l),b=P5(c),y=P5(u),C=I8(Math.round(d.width/g*1e3)/1e3),S=I8(Math.round(d.height/f*1e3)/1e3),k=(g-m-b-y)*C,I=(f-p-_-v)*S,L=_*S,N=v*S,P=b*C,O=y*C,F=0,V=0;if(s==="clip"){var M=P5(o);F=M*C,V=M*S}var B=d.x+P-F,W=d.y+L-V,q=B+d.width+2*F-P-O-k,U=W+d.height+2*V-L-N-I;t.left=Math.max(t.left,B),t.top=Math.max(t.top,W),t.right=Math.min(t.right,q),t.bottom=Math.min(t.bottom,U)}}),t}function NPe(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 DPe(n,e){var t=e||[],i=Mt(t,2),r=i[0],s=i[1];return[NPe(n.width,r),NPe(n.height,s)]}function RPe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[n[0],n[1]]}function CD(n,e){var t=e[0],i=e[1],r,s;return t==="t"?s=n.y:t==="b"?s=n.y+n.height:s=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:s}}function $x(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 B9t(n,e,t,i,r,s,o){var a=x.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:r[i]||{}}),l=Mt(a,2),c=l[0],u=l[1],d=x.useRef(0),f=x.useMemo(function(){return e?Ufe(e):[]},[e]),p=x.useRef({}),g=function(){p.current={}};n||g();var m=Ta(function(){if(e&&t&&n){let Mn=function(Wi,or){var qn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt,Wn=oe.x+Wi,Ei=oe.y+or,Kn=Wn+$e,Hn=Ei+Be,ki=Math.max(Wn,qn.left),Sn=Math.max(Ei,qn.top),On=Math.min(Kn,qn.right),wi=Math.min(Hn,qn.bottom);return Math.max(0,(On-ki)*(wi-Sn))},fi=function(){ln=oe.y+_e,ti=ln+Be,di=oe.x+de,Dt=di+$e};var b,y,C,S,k=e,I=k.ownerDocument,L=g9(k),N=L.getComputedStyle(k),P=N.width,O=N.height,F=N.position,V=k.style.left,M=k.style.top,B=k.style.right,W=k.style.bottom,q=k.style.overflow,U=ut(ut({},r[i]),s),G=I.createElement("div");(b=k.parentElement)===null||b===void 0||b.appendChild(G),G.style.left="".concat(k.offsetLeft,"px"),G.style.top="".concat(k.offsetTop,"px"),G.style.position=F,G.style.height="".concat(k.offsetHeight,"px"),G.style.width="".concat(k.offsetWidth,"px"),k.style.left="0",k.style.top="0",k.style.right="auto",k.style.bottom="auto",k.style.overflow="hidden";var H;if(Array.isArray(t))H={x:t[0],y:t[1],width:0,height:0};else{var z,Z,X=t.getBoundingClientRect();X.x=(z=X.x)!==null&&z!==void 0?z:X.left,X.y=(Z=X.y)!==null&&Z!==void 0?Z:X.top,H={x:X.x,y:X.y,width:X.width,height:X.height}}var oe=k.getBoundingClientRect();oe.x=(y=oe.x)!==null&&y!==void 0?y:oe.left,oe.y=(C=oe.y)!==null&&C!==void 0?C:oe.top;var fe=I.documentElement,Se=fe.clientWidth,Me=fe.clientHeight,Ie=fe.scrollWidth,ge=fe.scrollHeight,ye=fe.scrollTop,Pe=fe.scrollLeft,Be=oe.height,$e=oe.width,qe=H.height,mt=H.width,vt={left:0,top:0,right:Se,bottom:Me},ft={left:-Pe,top:-ye,right:Ie-Pe,bottom:ge-ye},tt=U.htmlRegion,St="visible",Ft="visibleFirst";tt!=="scroll"&&tt!==Ft&&(tt=St);var en=tt===Ft,Ke=APe(ft,f),dt=APe(vt,f),nt=tt===St?dt:Ke,at=en?dt:nt;k.style.left="auto",k.style.top="auto",k.style.right="0",k.style.bottom="0";var Oe=k.getBoundingClientRect();k.style.left=V,k.style.top=M,k.style.right=B,k.style.bottom=W,k.style.overflow=q,(S=k.parentElement)===null||S===void 0||S.removeChild(G);var ce=I8(Math.round($e/parseFloat(P)*1e3)/1e3),Ne=I8(Math.round(Be/parseFloat(O)*1e3)/1e3);if(ce===0||Ne===0||b8(t)&&!sxe(t))return;var Xe=U.offset,it=U.targetOffset,Tt=DPe(oe,Xe),Ct=Mt(Tt,2),Rt=Ct[0],se=Ct[1],ke=DPe(H,it),Ae=Mt(ke,2),je=Ae[0],Ve=Ae[1];H.x-=je,H.y-=Ve;var Qt=U.points||[],rt=Mt(Qt,2),Cn=rt[0],Rn=rt[1],li=RPe(Rn),Mi=RPe(Cn),si=CD(H,li),oi=CD(oe,Mi),_n=ut({},U),de=si.x-oi.x+Rt,_e=si.y-oi.y+se,Le=Mn(de,_e),Ge=Mn(de,_e,dt),gt=CD(H,["t","l"]),pt=CD(oe,["t","l"]),Vt=CD(H,["b","r"]),Pn=CD(oe,["b","r"]),Ln=U.overflow||{},bi=Ln.adjustX,et=Ln.adjustY,Lt=Ln.shiftX,qt=Ln.shiftY,sn=function(or){return typeof or=="boolean"?or:or>=0},ln,ti,di,Dt;fi();var le=sn(et),Qe=Mi[0]===li[0];if(le&&Mi[0]==="t"&&(ti>at.bottom||p.current.bt)){var ht=_e;Qe?ht-=Be-qe:ht=gt.y-Pn.y-se;var Bt=Mn(de,ht),An=Mn(de,ht,dt);Bt>Le||Bt===Le&&(!en||An>=Ge)?(p.current.bt=!0,_e=ht,se=-se,_n.points=[$x(Mi,0),$x(li,0)]):p.current.bt=!1}if(le&&Mi[0]==="b"&&(ln<at.top||p.current.tb)){var mn=_e;Qe?mn+=Be-qe:mn=Vt.y-pt.y-se;var hi=Mn(de,mn),Di=Mn(de,mn,dt);hi>Le||hi===Le&&(!en||Di>=Ge)?(p.current.tb=!0,_e=mn,se=-se,_n.points=[$x(Mi,0),$x(li,0)]):p.current.tb=!1}var cr=sn(bi),Li=Mi[1]===li[1];if(cr&&Mi[1]==="l"&&(Dt>at.right||p.current.rl)){var Sr=de;Li?Sr-=$e-mt:Sr=gt.x-Pn.x-Rt;var rr=Mn(Sr,_e),ws=Mn(Sr,_e,dt);rr>Le||rr===Le&&(!en||ws>=Ge)?(p.current.rl=!0,de=Sr,Rt=-Rt,_n.points=[$x(Mi,1),$x(li,1)]):p.current.rl=!1}if(cr&&Mi[1]==="r"&&(di<at.left||p.current.lr)){var Er=de;Li?Er+=$e-mt:Er=Vt.x-pt.x-Rt;var xa=Mn(Er,_e),No=Mn(Er,_e,dt);xa>Le||xa===Le&&(!en||No>=Ge)?(p.current.lr=!0,de=Er,Rt=-Rt,_n.points=[$x(Mi,1),$x(li,1)]):p.current.lr=!1}fi();var Do=Lt===!0?0:Lt;typeof Do=="number"&&(di<dt.left&&(de-=di-dt.left-Rt,H.x+mt<dt.left+Do&&(de+=H.x-dt.left+mt-Do)),Dt>dt.right&&(de-=Dt-dt.right-Rt,H.x>dt.right-Do&&(de+=H.x-dt.right+Do)));var Zs=qt===!0?0:qt;typeof Zs=="number"&&(ln<dt.top&&(_e-=ln-dt.top-se,H.y+qe<dt.top+Zs&&(_e+=H.y-dt.top+qe-Zs)),ti>dt.bottom&&(_e-=ti-dt.bottom-se,H.y>dt.bottom-Zs&&(_e+=H.y-dt.bottom+Zs)));var ua=oe.x+de,Os=ua+$e,Co=oe.y+_e,ul=Co+Be,Qi=H.x,Ms=Qi+mt,js=H.y,Ro=js+qe,Bi=Math.max(ua,Qi),Vi=Math.min(Os,Ms),Br=(Bi+Vi)/2,Gr=Br-ua,xs=Math.max(Co,js),sr=Math.min(ul,Ro),Ns=(xs+sr)/2,uo=Ns-Co;o==null||o(e,_n);var yi=Oe.right-oe.x-(de+oe.width),vn=Oe.bottom-oe.y-(_e+oe.height);ce===1&&(de=Math.round(de),yi=Math.round(yi)),Ne===1&&(_e=Math.round(_e),vn=Math.round(vn));var Un={ready:!0,offsetX:de/ce,offsetY:_e/Ne,offsetR:yi/ce,offsetB:vn/Ne,arrowX:Gr/ce,arrowY:uo/Ne,scaleX:ce,scaleY:Ne,align:_n};u(Un)}}),_=function(){d.current+=1;var y=d.current;Promise.resolve().then(function(){d.current===y&&m()})},v=function(){u(function(y){return ut(ut({},y),{},{ready:!1})})};return uc(v,[i]),uc(function(){n||v()},[n]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,_]}function $9t(n,e,t,i,r){uc(function(){if(n&&e&&t){let d=function(){i(),r()};var s=e,o=t,a=Ufe(s),l=Ufe(o),c=g9(o),u=new Set([c].concat(_r(a),_r(l)));return u.forEach(function(f){f.addEventListener("scroll",d,{passive:!0})}),c.addEventListener("resize",d,{passive:!0}),i(),function(){u.forEach(function(f){f.removeEventListener("scroll",d),c.removeEventListener("resize",d)})}}},[n,e,t])}function H9t(n,e,t,i,r,s,o,a){var l=x.useRef(n);l.current=n;var c=x.useRef(!1);x.useEffect(function(){if(e&&i&&(!r||s)){var d=function(){c.current=!1},f=function(_){var v;l.current&&!o(((v=_.composedPath)===null||v===void 0||(v=v.call(_))===null||v===void 0?void 0:v[0])||_.target)&&!c.current&&a(!1)},p=g9(i);p.addEventListener("pointerdown",d,!0),p.addEventListener("mousedown",f,!0),p.addEventListener("contextmenu",f,!0);var g=Oq(t);return g&&(g.addEventListener("mousedown",f,!0),g.addEventListener("contextmenu",f,!0)),function(){p.removeEventListener("pointerdown",d,!0),p.removeEventListener("mousedown",f,!0),p.removeEventListener("contextmenu",f,!0),g&&(g.removeEventListener("mousedown",f,!0),g.removeEventListener("contextmenu",f,!0))}}},[e,t,i,r,s]);function u(){c.current=!0}return u}var V9t=["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 W9t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yYe,e=x.forwardRef(function(t,i){var r=t.prefixCls,s=r===void 0?"rc-trigger-popup":r,o=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,u=t.hideAction,d=t.popupVisible,f=t.defaultPopupVisible,p=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,m=t.mouseEnterDelay,_=t.mouseLeaveDelay,v=_===void 0?.1:_,b=t.focusDelay,y=t.blurDelay,C=t.mask,S=t.maskClosable,k=S===void 0?!0:S,I=t.getPopupContainer,L=t.forceRender,N=t.autoDestroy,P=t.destroyPopupOnHide,O=t.popup,F=t.popupClassName,V=t.popupStyle,M=t.popupPlacement,B=t.builtinPlacements,W=B===void 0?{}:B,q=t.popupAlign,U=t.zIndex,G=t.stretch,H=t.getPopupClassNameFromAlign,z=t.fresh,Z=t.alignPoint,X=t.onPopupClick,oe=t.onPopupAlign,fe=t.arrow,Se=t.popupMotion,Me=t.maskMotion,Ie=t.popupTransitionName,ge=t.popupAnimation,ye=t.maskTransitionName,Pe=t.maskAnimation,Be=t.className,$e=t.getTriggerDOMNode,qe=Na(t,V9t),mt=N||P||!1,vt=x.useState(!1),ft=Mt(vt,2),tt=ft[0],St=ft[1];uc(function(){St(b9t())},[]);var Ft=x.useRef({}),en=x.useContext(TPe),Ke=x.useMemo(function(){return{registerSubPopup:function(On,wi){Ft.current[On]=wi,en==null||en.registerSubPopup(On,wi)}}},[en]),dt=CBt(),nt=x.useState(null),at=Mt(nt,2),Oe=at[0],ce=at[1],Ne=x.useRef(null),Xe=Ta(function(Sn){Ne.current=Sn,b8(Sn)&&Oe!==Sn&&ce(Sn),en==null||en.registerSubPopup(dt,Sn)}),it=x.useState(null),Tt=Mt(it,2),Ct=Tt[0],Rt=Tt[1],se=x.useRef(null),ke=Ta(function(Sn){b8(Sn)&&Ct!==Sn&&(Rt(Sn),se.current=Sn)}),Ae=x.Children.only(o),je=(Ae==null?void 0:Ae.props)||{},Ve={},Qt=Ta(function(Sn){var On,wi,Cr=Ct;return(Cr==null?void 0:Cr.contains(Sn))||((On=Oq(Cr))===null||On===void 0?void 0:On.host)===Sn||Sn===Cr||(Oe==null?void 0:Oe.contains(Sn))||((wi=Oq(Oe))===null||wi===void 0?void 0:wi.host)===Sn||Sn===Oe||Object.values(Ft.current).some(function(br){return(br==null?void 0:br.contains(Sn))||Sn===br})}),rt=LPe(s,Se,ge,Ie),Cn=LPe(s,Me,Pe,ye),Rn=x.useState(f||!1),li=Mt(Rn,2),Mi=li[0],si=li[1],oi=d??Mi,_n=Ta(function(Sn){d===void 0&&si(Sn)});uc(function(){si(d||!1)},[d]);var de=x.useRef(oi);de.current=oi;var _e=x.useRef([]);_e.current=[];var Le=Ta(function(Sn){var On;_n(Sn),((On=_e.current[_e.current.length-1])!==null&&On!==void 0?On:oi)!==Sn&&(_e.current.push(Sn),p==null||p(Sn))}),Ge=x.useRef(),gt=function(){clearTimeout(Ge.current)},pt=function(On){var wi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;gt(),wi===0?Le(On):Ge.current=setTimeout(function(){Le(On)},wi*1e3)};x.useEffect(function(){return gt},[]);var Vt=x.useState(!1),Pn=Mt(Vt,2),Ln=Pn[0],bi=Pn[1];uc(function(Sn){(!Sn||oi)&&bi(!0)},[oi]);var et=x.useState(null),Lt=Mt(et,2),qt=Lt[0],sn=Lt[1],ln=x.useState(null),ti=Mt(ln,2),di=ti[0],Dt=ti[1],le=function(On){Dt([On.clientX,On.clientY])},Qe=B9t(oi,Oe,Z&&di!==null?di:Ct,M,W,q,oe),ht=Mt(Qe,11),Bt=ht[0],An=ht[1],mn=ht[2],hi=ht[3],Di=ht[4],cr=ht[5],Li=ht[6],Sr=ht[7],rr=ht[8],ws=ht[9],Er=ht[10],xa=M9t(tt,l,c,u),No=Mt(xa,2),Do=No[0],Zs=No[1],ua=Do.has("click"),Os=Zs.has("click")||Zs.has("contextMenu"),Co=Ta(function(){Ln||Er()}),ul=function(){de.current&&Z&&Os&&pt(!1)};$9t(oi,Ct,Oe,Co,ul),uc(function(){Co()},[di,M]),uc(function(){oi&&!(W!=null&&W[M])&&Co()},[JSON.stringify(q)]);var Qi=x.useMemo(function(){var Sn=F9t(W,s,ws,Z);return $t(Sn,H==null?void 0:H(ws))},[ws,H,W,s,Z]);x.useImperativeHandle(i,function(){return{nativeElement:se.current,popupElement:Ne.current,forceAlign:Co}});var Ms=x.useState(0),js=Mt(Ms,2),Ro=js[0],Bi=js[1],Vi=x.useState(0),Br=Mt(Vi,2),Gr=Br[0],xs=Br[1],sr=function(){if(G&&Ct){var On=Ct.getBoundingClientRect();Bi(On.width),xs(On.height)}},Ns=function(){sr(),Co()},uo=function(On){bi(!1),Er(),g==null||g(On)},yi=function(){return new Promise(function(On){sr(),sn(function(){return On})})};uc(function(){qt&&(Er(),qt(),sn(null))},[qt]);function vn(Sn,On,wi,Cr){Ve[Sn]=function(br){var zs;Cr==null||Cr(br),pt(On,wi);for(var Oa=arguments.length,$r=new Array(Oa>1?Oa-1:0),Qn=1;Qn<Oa;Qn++)$r[Qn-1]=arguments[Qn];(zs=je[Sn])===null||zs===void 0||zs.call.apply(zs,[je,br].concat($r))}}(ua||Os)&&(Ve.onClick=function(Sn){var On;de.current&&Os?pt(!1):!de.current&&ua&&(le(Sn),pt(!0));for(var wi=arguments.length,Cr=new Array(wi>1?wi-1:0),br=1;br<wi;br++)Cr[br-1]=arguments[br];(On=je.onClick)===null||On===void 0||On.call.apply(On,[je,Sn].concat(Cr))});var Un=H9t(oi,Os,Ct,Oe,C,k,Qt,pt),Mn=Do.has("hover"),fi=Zs.has("hover"),Wi,or;Mn&&(vn("onMouseEnter",!0,m,function(Sn){le(Sn)}),vn("onPointerEnter",!0,m,function(Sn){le(Sn)}),Wi=function(On){(oi||Ln)&&Oe!==null&&Oe!==void 0&&Oe.contains(On.target)&&pt(!0,m)},Z&&(Ve.onMouseMove=function(Sn){var On;(On=je.onMouseMove)===null||On===void 0||On.call(je,Sn)})),fi&&(vn("onMouseLeave",!1,v),vn("onPointerLeave",!1,v),or=function(){pt(!1,v)}),Do.has("focus")&&vn("onFocus",!0,b),Zs.has("focus")&&vn("onBlur",!1,y),Do.has("contextMenu")&&(Ve.onContextMenu=function(Sn){var On;de.current&&Zs.has("contextMenu")?pt(!1):(le(Sn),pt(!0)),Sn.preventDefault();for(var wi=arguments.length,Cr=new Array(wi>1?wi-1:0),br=1;br<wi;br++)Cr[br-1]=arguments[br];(On=je.onContextMenu)===null||On===void 0||On.call.apply(On,[je,Sn].concat(Cr))}),Be&&(Ve.className=$t(je.className,Be));var qn=ut(ut({},je),Ve),Wn={},Ei=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Ei.forEach(function(Sn){qe[Sn]&&(Wn[Sn]=function(){for(var On,wi=arguments.length,Cr=new Array(wi),br=0;br<wi;br++)Cr[br]=arguments[br];(On=qn[Sn])===null||On===void 0||On.call.apply(On,[qn].concat(Cr)),qe[Sn].apply(qe,Cr)})});var Kn=x.cloneElement(Ae,ut(ut({},qn),Wn)),Hn={x:cr,y:Li},ki=fe?ut({},fe!==!0?fe:{}):null;return x.createElement(x.Fragment,null,x.createElement(bA,{disabled:!oi,ref:ke,onResize:Ns},x.createElement(O9t,{getTriggerDOMNode:$e},Kn)),x.createElement(TPe.Provider,{value:Ke},x.createElement(P9t,{portal:n,ref:Xe,prefixCls:s,popup:O,className:$t(F,Qi),style:V,target:Ct,onMouseEnter:Wi,onMouseLeave:or,onPointerEnter:Wi,zIndex:U,open:oi,keepDom:Ln,fresh:z,onClick:X,onPointerDownCapture:Un,mask:C,motion:rt,maskMotion:Cn,onVisibleChanged:uo,onPrepare:yi,forceRender:L,autoDestroy:mt,getPopupContainer:I,align:ws,arrow:ki,arrowPos:Hn,ready:Bt,offsetX:An,offsetY:mn,offsetR:hi,offsetB:Di,onAlign:Co,stretch:G,targetWidth:Ro/Sr,targetHeight:Gr/rr})))});return e}const z9t=W9t(yYe);function DYe(n,e,t){return $t({[`${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 RYe=(n,e)=>e||n,PYe=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;var i,r;const{variant:s,[n]:o}=x.useContext(pg),a=x.useContext(_9t),l=o==null?void 0:o.variant;let c;typeof e<"u"?c=e:t===!1?c="borderless":c=(r=(i=a??l)!==null&&i!==void 0?i:s)!==null&&r!==void 0?r:"outlined";const u=t6t.includes(c);return[c,u]},U9t=n=>{const{multipleSelectItemHeight:e,paddingXXS:t,lineWidth:i,INTERNAL_FIXED_ITEM_MARGIN:r}=n,s=n.max(n.calc(t).sub(i).equal(),0),o=n.max(n.calc(s).sub(r).equal(),0);return{basePadding:s,containerPadding:o,itemHeight:Fi(e),itemLineHeight:Fi(n.calc(e).sub(n.calc(n.lineWidth).mul(2)).equal())}},q9t=n=>{const{componentCls:e,iconCls:t,borderRadiusSM:i,motionDurationSlow:r,paddingXS:s,multipleItemColorDisabled:o,multipleItemBorderColorDisabled:a,colorIcon:l,colorIconHover:c,INTERNAL_FIXED_ITEM_MARGIN:u}=n;return{[`${e}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"},[`${e}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:u,borderRadius:i,cursor:"default",transition:`font-size ${r}, line-height ${r}, height ${r}`,marginInlineEnd:n.calc(u).mul(2).equal(),paddingInlineStart:s,paddingInlineEnd:n.calc(s).div(2).equal(),[`${e}-disabled&`]:{color:o,borderColor:a,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:n.calc(s).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},txe()),{display:"inline-flex",alignItems:"center",color:l,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${t}`]:{verticalAlign:"-0.2em"},"&:hover":{color:c}})}}}};var K9t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},G9t=function(e,t){return x.createElement(fv,hn({},e,{ref:t,icon:K9t}))},Y9t=x.forwardRef(G9t),Q9t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},X9t=function(e,t){return x.createElement(fv,hn({},e,{ref:t,icon:Q9t}))},Z9t=x.forwardRef(X9t),J9t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},e$t=function(e,t){return x.createElement(fv,hn({},e,{ref:t,icon:J9t}))},t$t=x.forwardRef(e$t);function n$t(n){let{suffixIcon:e,clearIcon:t,menuItemSelectedIcon:i,removeIcon:r,loading:s,multiple:o,hasFeedback:a,prefixCls:l,showSuffixIcon:c,feedbackIcon:u,showArrow:d,componentName:f}=n;const p=t??x.createElement(E8t,null),g=b=>e===null&&!a&&!d?null:x.createElement(x.Fragment,null,c!==!1&&b,a&&u);let m=null;if(e!==void 0)m=g(e);else if(s)m=g(x.createElement(sYe,{spin:!0}));else{const b=`${l}-suffix`;m=y=>{let{open:C,showSearch:S}=y;return g(C&&S?x.createElement(t$t,{className:b}):x.createElement(Z9t,{className:b}))}}let _=null;i!==void 0?_=i:o?_=x.createElement(Y9t,null):_=null;let v=null;return r!==void 0?v=r:v=x.createElement(I8t,null),{clearIcon:p,suffixIcon:m,itemIcon:_,removeIcon:v}}function i$t(n){const{sizePopupArrow:e,borderRadiusXS:t,borderRadiusOuter:i}=n,r=e/2,s=0,o=r,a=i*1/Math.sqrt(2),l=r-i*(1-1/Math.sqrt(2)),c=r-t*(1/Math.sqrt(2)),u=i*(Math.sqrt(2)-1)+t*(1/Math.sqrt(2)),d=2*r-c,f=u,p=2*r-a,g=l,m=2*r-s,_=o,v=r*Math.sqrt(2)+i*(Math.sqrt(2)-2),b=i*(Math.sqrt(2)-1),y=`polygon(${b}px 100%, 50% ${b}px, ${2*r-b}px 100%, ${b}px 100%)`,C=`path('M ${s} ${o} A ${i} ${i} 0 0 0 ${a} ${l} L ${c} ${u} A ${t} ${t} 0 0 1 ${d} ${f} L ${p} ${g} A ${i} ${i} 0 0 0 ${m} ${_} Z')`;return{arrowShadowWidth:v,arrowPath:C,arrowPolygon:y}}const r$t=(n,e,t)=>{const{sizePopupArrow:i,arrowPolygon:r,arrowPath:s,arrowShadowWidth:o,borderRadiusXS:a,calc:l}=n;return{pointerEvents:"none",width:i,height:i,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:i,height:l(i).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[r,s]},content:'""'},"&::after":{content:'""',position:"absolute",width:o,height:o,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Fi(a)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:t,zIndex:0,background:"transparent"}}};var Az={exports:{}},s$t=Az.exports,PPe;function o$t(){return PPe||(PPe=1,function(n,e){(function(t,i){n.exports=i()})(s$t,function(){return function(t,i){i.prototype.weekday=function(r){var s=this.$locale().weekStart||0,o=this.$W,a=(o<s?o+7:o)-s;return this.$utils().u(r)?a:this.subtract(a,"day").add(r,"day")}}})}(Az)),Az.exports}var a$t=o$t();const l$t=Cl(a$t);var Nz={exports:{}},c$t=Nz.exports,OPe;function u$t(){return OPe||(OPe=1,function(n,e){(function(t,i){n.exports=i()})(c$t,function(){return function(t,i,r){var s=i.prototype,o=function(d){return d&&(d.indexOf?d:d.s)},a=function(d,f,p,g,m){var _=d.name?d:d.$locale(),v=o(_[f]),b=o(_[p]),y=v||b.map(function(S){return S.slice(0,g)});if(!m)return y;var C=_.weekStart;return y.map(function(S,k){return y[(k+(C||0))%7]})},l=function(){return r.Ls[r.locale()]},c=function(d,f){return d.formats[f]||function(p){return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(g,m,_){return m||_.slice(1)})}(d.formats[f.toUpperCase()])},u=function(){var d=this;return{months:function(f){return f?f.format("MMMM"):a(d,"months")},monthsShort:function(f){return f?f.format("MMM"):a(d,"monthsShort","months",3)},firstDayOfWeek:function(){return d.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):a(d,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):a(d,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):a(d,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return c(d.$locale(),f)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};s.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(f){return c(d,f)},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)}}})}(Nz)),Nz.exports}var d$t=u$t();const h$t=Cl(d$t);var Dz={exports:{}},f$t=Dz.exports,MPe;function p$t(){return MPe||(MPe=1,function(n,e){(function(t,i){n.exports=i()})(f$t,function(){var t="week",i="year";return function(r,s,o){var a=s.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=o(this).startOf(i).add(1,i).date(c),d=o(this).endOf(t);if(u.isBefore(d))return 1}var f=o(this).startOf(i).date(c).startOf(t).subtract(1,"millisecond"),p=this.diff(f,t,!0);return p<0?o(this).startOf("week").week():Math.ceil(p)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(Dz)),Dz.exports}var g$t=p$t();const m$t=Cl(g$t);var Rz={exports:{}},_$t=Rz.exports,jPe;function v$t(){return jPe||(jPe=1,function(n,e){(function(t,i){n.exports=i()})(_$t,function(){return function(t,i){i.prototype.weekYear=function(){var r=this.month(),s=this.week(),o=this.year();return s===1&&r===11?o+1:r===0&&s>=52?o-1:o}}})}(Rz)),Rz.exports}var b$t=v$t();const y$t=Cl(b$t);var Pz={exports:{}},C$t=Pz.exports,FPe;function w$t(){return FPe||(FPe=1,function(n,e){(function(t,i){n.exports=i()})(C$t,function(){return function(t,i){var r=i.prototype,s=r.format;r.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return s.bind(this)(o);var c=this.$utils(),u=(o||"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 s.bind(this)(u)}}})}(Pz)),Pz.exports}var x$t=w$t();const S$t=Cl(x$t);var Oz={exports:{}},E$t=Oz.exports,BPe;function k$t(){return BPe||(BPe=1,function(n,e){(function(t,i){n.exports=i()})(E$t,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|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,s=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(_){return(_=+_)+(_>68?1900:2e3)},u=function(_){return function(v){this[_]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(_){(this.zone||(this.zone={})).offset=function(v){if(!v||v==="Z")return 0;var b=v.match(/([+-]|\d\d)/g),y=60*b[1]+(+b[2]||0);return y===0?0:b[0]==="+"?-y:y}(_)}],f=function(_){var v=l[_];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(_,v){var b,y=l.meridiem;if(y){for(var C=1;C<=24;C+=1)if(_.indexOf(y(C,0,v))>-1){b=C>12;break}}else b=_===(v?"pm":"PM");return b},g={A:[a,function(_){this.afternoon=p(_,!1)}],a:[a,function(_){this.afternoon=p(_,!0)}],Q:[r,function(_){this.month=3*(_-1)+1}],S:[r,function(_){this.milliseconds=100*+_}],SS:[s,function(_){this.milliseconds=10*+_}],SSS:[/\d{3}/,function(_){this.milliseconds=+_}],s:[o,u("seconds")],ss:[o,u("seconds")],m:[o,u("minutes")],mm:[o,u("minutes")],H:[o,u("hours")],h:[o,u("hours")],HH:[o,u("hours")],hh:[o,u("hours")],D:[o,u("day")],DD:[s,u("day")],Do:[a,function(_){var v=l.ordinal,b=_.match(/\d+/);if(this.day=b[0],v)for(var y=1;y<=31;y+=1)v(y).replace(/\[|\]/g,"")===_&&(this.day=y)}],w:[o,u("week")],ww:[s,u("week")],M:[o,u("month")],MM:[s,u("month")],MMM:[a,function(_){var v=f("months"),b=(f("monthsShort")||v.map(function(y){return y.slice(0,3)})).indexOf(_)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[a,function(_){var v=f("months").indexOf(_)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,u("year")],YY:[s,function(_){this.year=c(_)}],YYYY:[/\d{4}/,u("year")],Z:d,ZZ:d};function m(_){var v,b;v=_,b=l&&l.formats;for(var y=(_=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(P,O,F){var V=F&&F.toUpperCase();return O||b[F]||t[F]||b[V].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(M,B,W){return B||W.slice(1)})})).match(i),C=y.length,S=0;S<C;S+=1){var k=y[S],I=g[k],L=I&&I[0],N=I&&I[1];y[S]=N?{regex:L,parser:N}:k.replace(/^\[|\]$/g,"")}return function(P){for(var O={},F=0,V=0;F<C;F+=1){var M=y[F];if(typeof M=="string")V+=M.length;else{var B=M.regex,W=M.parser,q=P.slice(V),U=B.exec(q)[0];W.call(O,U),P=P.replace(U,"")}}return function(G){var H=G.afternoon;if(H!==void 0){var z=G.hours;H?z<12&&(G.hours+=12):z===12&&(G.hours=0),delete G.afternoon}}(O),O}}return function(_,v,b){b.p.customParseFormat=!0,_&&_.parseTwoDigitYear&&(c=_.parseTwoDigitYear);var y=v.prototype,C=y.parse;y.parse=function(S){var k=S.date,I=S.utc,L=S.args;this.$u=I;var N=L[1];if(typeof N=="string"){var P=L[2]===!0,O=L[3]===!0,F=P||O,V=L[2];O&&(V=L[2]),l=this.$locale(),!P&&V&&(l=b.Ls[V]),this.$d=function(q,U,G,H){try{if(["x","X"].indexOf(U)>-1)return new Date((U==="X"?1e3:1)*q);var z=m(U)(q),Z=z.year,X=z.month,oe=z.day,fe=z.hours,Se=z.minutes,Me=z.seconds,Ie=z.milliseconds,ge=z.zone,ye=z.week,Pe=new Date,Be=oe||(Z||X?1:Pe.getDate()),$e=Z||Pe.getFullYear(),qe=0;Z&&!X||(qe=X>0?X-1:Pe.getMonth());var mt,vt=fe||0,ft=Se||0,tt=Me||0,St=Ie||0;return ge?new Date(Date.UTC($e,qe,Be,vt,ft,tt,St+60*ge.offset*1e3)):G?new Date(Date.UTC($e,qe,Be,vt,ft,tt,St)):(mt=new Date($e,qe,Be,vt,ft,tt,St),ye&&(mt=H(mt).week(ye).toDate()),mt)}catch{return new Date("")}}(k,N,I,b),this.init(),V&&V!==!0&&(this.$L=this.locale(V).$L),F&&k!=this.format(N)&&(this.$d=new Date("")),l={}}else if(N instanceof Array)for(var M=N.length,B=1;B<=M;B+=1){L[1]=N[B-1];var W=b.apply(this,L);if(W.isValid()){this.$d=W.$d,this.$L=W.$L,this.init();break}B===M&&(this.$d=new Date(""))}else C.call(this,S)}}})}(Oz)),Oz.exports}var T$t=k$t();const hxe=Cl(T$t);Jn.extend(hxe);Jn.extend(S$t);Jn.extend(l$t);Jn.extend(h$t);Jn.extend(m$t);Jn.extend(y$t);Jn.extend(function(n,e){var t=e.prototype,i=t.format;t.format=function(s){var o=(s||"").replace("Wo","wo");return i.bind(this)(o)}});var I$t={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"},OT=function(e){var t=I$t[e];return t||e.split("_")[0]},L$t={getNow:function(){var e=Jn();return typeof e.tz=="function"?e.tz():e},getFixedDate:function(e){return Jn(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()},getMillisecond:function(e){return e.millisecond()},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)},setMillisecond:function(e,t){return e.millisecond(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return Jn().locale(OT(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(OT(e)).weekday(0)},getWeek:function(e,t){return t.locale(OT(e)).week()},getShortWeekDays:function(e){return Jn().locale(OT(e)).localeData().weekdaysMin()},getShortMonths:function(e){return Jn().locale(OT(e)).localeData().monthsShort()},format:function(e,t,i){return t.locale(OT(e)).format(i)},parse:function(e,t,i){for(var r=OT(e),s=0;s<i.length;s+=1){var o=i[s],a=t;if(o.includes("wo")||o.includes("Wo")){for(var l=a.split("-")[0],c=a.split("-")[1],u=Jn(l,"YYYY").startOf("year").locale(r),d=0;d<=52;d+=1){var f=u.add(d,"week");if(f.format("Wo")===c)return f}return null}var p=Jn(a,o,!0).locale(r);if(p.isValid())return p}return null}}};function A$t(n,e){return n!==void 0?n:e?"bottomRight":"bottomLeft"}var Kb=x.createContext(null),N$t={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 OYe(n){var e=n.popupElement,t=n.popupStyle,i=n.popupClassName,r=n.popupAlign,s=n.transitionName,o=n.getPopupContainer,a=n.children,l=n.range,c=n.placement,u=n.builtinPlacements,d=u===void 0?N$t:u,f=n.direction,p=n.visible,g=n.onClose,m=x.useContext(Kb),_=m.prefixCls,v="".concat(_,"-dropdown"),b=A$t(c,f==="rtl");return x.createElement(z9t,{showAction:[],hideAction:["click"],popupPlacement:b,builtinPlacements:d,prefixCls:v,popupTransitionName:s,popup:e,popupAlign:r,popupVisible:p,popupClassName:$t(i,wt(wt({},"".concat(v,"-range"),l),"".concat(v,"-rtl"),f==="rtl")),popupStyle:t,stretch:"minWidth",getPopupContainer:o,onPopupVisibleChange:function(C){C||g()}},a)}function fxe(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(i);return i}function wA(n){return n==null?[]:Array.isArray(n)?n:[n]}function AF(n,e,t){var i=_r(n);return i[e]=t,i}function AJ(n,e){var t={},i=e||Object.keys(n);return i.forEach(function(r){n[r]!==void 0&&(t[r]=n[r])}),t}function MYe(n,e,t){if(t)return t;switch(n){case"time":return e.fieldTimeFormat;case"datetime":return e.fieldDateTimeFormat;case"month":return e.fieldMonthFormat;case"year":return e.fieldYearFormat;case"quarter":return e.fieldQuarterFormat;case"week":return e.fieldWeekFormat;default:return e.fieldDateFormat}}function jYe(n,e,t){var i=t!==void 0?t:e[e.length-1],r=e.find(function(s){return n[s]});return i!==r?n[r]:void 0}function FYe(n){return AJ(n,["placement","builtinPlacements","popupAlign","getPopupContainer","transitionName","direction"])}function pxe(n,e,t,i){var r=x.useMemo(function(){return n||function(o,a){var l=o;return e&&a.type==="date"?e(l,a.today):t&&a.type==="month"?t(l,a.locale):a.originNode}},[n,t,e]),s=x.useCallback(function(o,a){return r(o,ut(ut({},a),{},{range:i}))},[r,i]);return s}function BYe(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],i=x.useState([!1,!1]),r=Mt(i,2),s=r[0],o=r[1],a=function(u,d){o(function(f){return AF(f,d,u)})},l=x.useMemo(function(){return s.map(function(c,u){if(c)return!0;var d=n[u];return d?!!(!t[u]&&!d||d&&e(d,{activeIndex:u})):!1})},[n,s,e,t]);return[l,a]}function $Ye(n,e,t,i,r){var s="",o=[];return n&&o.push(r?"hh":"HH"),e&&o.push("mm"),t&&o.push("ss"),s=o.join(":"),i&&(s+=".SSS"),r&&(s+=" A"),s}function D$t(n,e,t,i,r,s){var o=n.fieldDateTimeFormat,a=n.fieldDateFormat,l=n.fieldTimeFormat,c=n.fieldMonthFormat,u=n.fieldYearFormat,d=n.fieldWeekFormat,f=n.fieldQuarterFormat,p=n.yearFormat,g=n.cellYearFormat,m=n.cellQuarterFormat,_=n.dayFormat,v=n.cellDateFormat,b=$Ye(e,t,i,r,s);return ut(ut({},n),{},{fieldDateTimeFormat:o||"YYYY-MM-DD ".concat(b),fieldDateFormat:a||"YYYY-MM-DD",fieldTimeFormat:l||b,fieldMonthFormat:c||"YYYY-MM",fieldYearFormat:u||"YYYY",fieldWeekFormat:d||"gggg-wo",fieldQuarterFormat:f||"YYYY-[Q]Q",yearFormat:p||"YYYY",cellYearFormat:g||"YYYY",cellQuarterFormat:m||"[Q]Q",cellDateFormat:v||_||"D"})}function HYe(n,e){var t=e.showHour,i=e.showMinute,r=e.showSecond,s=e.showMillisecond,o=e.use12Hours;return we.useMemo(function(){return D$t(n,t,i,r,s,o)},[n,t,i,r,s,o])}function O5(n,e,t){return t??e.some(function(i){return n.includes(i)})}var R$t=["showNow","showHour","showMinute","showSecond","showMillisecond","use12Hours","hourStep","minuteStep","secondStep","millisecondStep","hideDisabledOptions","defaultValue","disabledHours","disabledMinutes","disabledSeconds","disabledMilliseconds","disabledTime","changeOnScroll","defaultOpenValue"];function P$t(n){var e=AJ(n,R$t),t=n.format,i=n.picker,r=null;return t&&(r=t,Array.isArray(r)&&(r=r[0]),r=Mr(r)==="object"?r.format:r),i==="time"&&(e.format=r),[e,r]}function O$t(n){return n&&typeof n=="string"}function VYe(n,e,t,i){return[n,e,t,i].some(function(r){return r!==void 0})}function WYe(n,e,t,i,r){var s=e,o=t,a=i;if(!n&&!s&&!o&&!a&&!r)s=!0,o=!0,a=!0;else if(n){var l,c,u,d=[s,o,a].some(function(g){return g===!1}),f=[s,o,a].some(function(g){return g===!0}),p=d?!0:!f;s=(l=s)!==null&&l!==void 0?l:p,o=(c=o)!==null&&c!==void 0?c:p,a=(u=a)!==null&&u!==void 0?u:p}return[s,o,a,r]}function zYe(n){var e=n.showTime,t=P$t(n),i=Mt(t,2),r=i[0],s=i[1],o=e&&Mr(e)==="object"?e:{},a=ut(ut({defaultOpenValue:o.defaultOpenValue||o.defaultValue},r),o),l=a.showMillisecond,c=a.showHour,u=a.showMinute,d=a.showSecond,f=VYe(c,u,d,l),p=WYe(f,c,u,d,l),g=Mt(p,3);return c=g[0],u=g[1],d=g[2],[a,ut(ut({},a),{},{showHour:c,showMinute:u,showSecond:d,showMillisecond:l}),a.format,s]}function UYe(n,e,t,i,r){var s=n==="time";if(n==="datetime"||s){for(var o=i,a=MYe(n,r,null),l=a,c=[e,t],u=0;u<c.length;u+=1){var d=wA(c[u])[0];if(O$t(d)){l=d;break}}var f=o.showHour,p=o.showMinute,g=o.showSecond,m=o.showMillisecond,_=o.use12Hours,v=O5(l,["a","A","LT","LLL","LTS"],_),b=VYe(f,p,g,m);b||(f=O5(l,["H","h","k","LT","LLL"]),p=O5(l,["m","LT","LLL"]),g=O5(l,["s","LTS"]),m=O5(l,["SSS"]));var y=WYe(b,f,p,g,m),C=Mt(y,3);f=C[0],p=C[1],g=C[2];var S=e||$Ye(f,p,g,m,v);return ut(ut({},o),{},{format:S,showHour:f,showMinute:p,showSecond:g,showMillisecond:m,use12Hours:v})}return null}function M$t(n,e,t){if(e===!1)return null;var i=e&&Mr(e)==="object"?e:{};return i.clearIcon||t||x.createElement("span",{className:"".concat(n,"-clear-btn")})}var rse=7;function yk(n,e,t){return!n&&!e||n===e?!0:!n||!e?!1:t()}function qfe(n,e,t){return yk(e,t,function(){var i=Math.floor(n.getYear(e)/10),r=Math.floor(n.getYear(t)/10);return i===r})}function SL(n,e,t){return yk(e,t,function(){return n.getYear(e)===n.getYear(t)})}function $Pe(n,e){var t=Math.floor(n.getMonth(e)/3);return t+1}function j$t(n,e,t){return yk(e,t,function(){return SL(n,e,t)&&$Pe(n,e)===$Pe(n,t)})}function gxe(n,e,t){return yk(e,t,function(){return SL(n,e,t)&&n.getMonth(e)===n.getMonth(t)})}function mxe(n,e,t){return yk(e,t,function(){return SL(n,e,t)&&gxe(n,e,t)&&n.getDate(e)===n.getDate(t)})}function qYe(n,e,t){return yk(e,t,function(){return n.getHour(e)===n.getHour(t)&&n.getMinute(e)===n.getMinute(t)&&n.getSecond(e)===n.getSecond(t)})}function KYe(n,e,t){return yk(e,t,function(){return mxe(n,e,t)&&qYe(n,e,t)&&n.getMillisecond(e)===n.getMillisecond(t)})}function $j(n,e,t,i){return yk(t,i,function(){var r=n.locale.getWeekFirstDate(e,t),s=n.locale.getWeekFirstDate(e,i);return SL(n,r,s)&&n.locale.getWeek(e,t)===n.locale.getWeek(e,i)})}function af(n,e,t,i,r){switch(r){case"date":return mxe(n,t,i);case"week":return $j(n,e.locale,t,i);case"month":return gxe(n,t,i);case"quarter":return j$t(n,t,i);case"year":return SL(n,t,i);case"decade":return qfe(n,t,i);case"time":return qYe(n,t,i);default:return KYe(n,t,i)}}function NJ(n,e,t,i){return!e||!t||!i?!1:n.isAfter(i,e)&&n.isAfter(t,i)}function JH(n,e,t,i,r){return af(n,e,t,i,r)?!0:n.isAfter(t,i)}function F$t(n,e,t){var i=e.locale.getWeekFirstDay(n),r=e.setDate(t,1),s=e.getWeekDay(r),o=e.addDate(r,i-s);return e.getMonth(o)===e.getMonth(t)&&e.getDate(o)>1&&(o=e.addDate(o,-7)),o}function od(n,e){var t=e.generateConfig,i=e.locale,r=e.format;return n?typeof r=="function"?r(n):t.locale.format(i.locale,n,r):""}function $q(n,e,t){var i=e,r=["getHour","getMinute","getSecond","getMillisecond"],s=["setHour","setMinute","setSecond","setMillisecond"];return s.forEach(function(o,a){t?i=n[o](i,n[r[a]](t)):i=n[o](i,0)}),i}function B$t(n,e,t,i,r){var s=Ta(function(o,a){return!!(t&&t(o,a)||i&&n.isAfter(i,o)&&!af(n,e,i,o,a.type)||r&&n.isAfter(o,r)&&!af(n,e,r,o,a.type))});return s}function $$t(n,e,t){return x.useMemo(function(){var i=MYe(n,e,t),r=wA(i),s=r[0],o=Mr(s)==="object"&&s.type==="mask"?s.format:null;return[r.map(function(a){return typeof a=="string"||typeof a=="function"?a:a.format}),o]},[n,e,t])}function H$t(n,e,t){return typeof n[0]=="function"||t?!0:e}function V$t(n,e,t,i){var r=Ta(function(s,o){var a=ut({type:e},o);if(delete a.activeIndex,!n.isValidate(s)||t&&t(s,a))return!0;if((e==="date"||e==="time")&&i){var l,c=o&&o.activeIndex===1?"end":"start",u=((l=i.disabledTime)===null||l===void 0?void 0:l.call(i,s,c,{from:a.from}))||{},d=u.disabledHours,f=u.disabledMinutes,p=u.disabledSeconds,g=u.disabledMilliseconds,m=i.disabledHours,_=i.disabledMinutes,v=i.disabledSeconds,b=d||m,y=f||_,C=p||v,S=n.getHour(s),k=n.getMinute(s),I=n.getSecond(s),L=n.getMillisecond(s);if(b&&b().includes(S)||y&&y(S).includes(k)||C&&C(S,k).includes(I)||g&&g(S,k,I).includes(L))return!0}return!1});return r}function eV(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=x.useMemo(function(){var i=n&&wA(n);return e&&i&&(i[1]=i[1]||i[0]),i},[n,e]);return t}function GYe(n,e){var t=n.generateConfig,i=n.locale,r=n.picker,s=r===void 0?"date":r,o=n.prefixCls,a=o===void 0?"rc-picker":o,l=n.styles,c=l===void 0?{}:l,u=n.classNames,d=u===void 0?{}:u,f=n.order,p=f===void 0?!0:f,g=n.components,m=g===void 0?{}:g,_=n.inputRender,v=n.allowClear,b=n.clearIcon,y=n.needConfirm,C=n.multiple,S=n.format,k=n.inputReadOnly,I=n.disabledDate,L=n.minDate,N=n.maxDate,P=n.showTime,O=n.value,F=n.defaultValue,V=n.pickerValue,M=n.defaultPickerValue,B=eV(O),W=eV(F),q=eV(V),U=eV(M),G=s==="date"&&P?"datetime":s,H=G==="time"||G==="datetime",z=H||C,Z=y??H,X=zYe(n),oe=Mt(X,4),fe=oe[0],Se=oe[1],Me=oe[2],Ie=oe[3],ge=HYe(i,Se),ye=x.useMemo(function(){return UYe(G,Me,Ie,fe,ge)},[G,Me,Ie,fe,ge]),Pe=x.useMemo(function(){return ut(ut({},n),{},{prefixCls:a,locale:ge,picker:s,styles:c,classNames:d,order:p,components:ut({input:_},m),clearIcon:M$t(a,v,b),showTime:ye,value:B,defaultValue:W,pickerValue:q,defaultPickerValue:U},e==null?void 0:e())},[n]),Be=$$t(G,ge,S),$e=Mt(Be,2),qe=$e[0],mt=$e[1],vt=H$t(qe,k,C),ft=B$t(t,i,I,L,N),tt=V$t(t,s,ft,ye),St=x.useMemo(function(){return ut(ut({},Pe),{},{needConfirm:Z,inputReadOnly:vt,disabledDate:ft})},[Pe,Z,vt,ft]);return[St,G,z,qe,mt,tt]}function W$t(n,e,t){var i=Dy(e,{value:n}),r=Mt(i,2),s=r[0],o=r[1],a=we.useRef(n),l=we.useRef(),c=function(){Eh.cancel(l.current)},u=Ta(function(){o(a.current),t&&s!==a.current&&t(a.current)}),d=Ta(function(f,p){c(),a.current=f,f||p?u():l.current=Eh(u)});return we.useEffect(function(){return c},[]),[s,d]}function YYe(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],i=arguments.length>3?arguments[3]:void 0,r=t.every(function(u){return u})?!1:n,s=W$t(r,e||!1,i),o=Mt(s,2),a=o[0],l=o[1];function c(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!d.inherit||a)&&l(u,d.force)}return[a,c]}function QYe(n){var e=x.useRef();return x.useImperativeHandle(n,function(){var t;return{nativeElement:(t=e.current)===null||t===void 0?void 0:t.nativeElement,focus:function(r){var s;(s=e.current)===null||s===void 0||s.focus(r)},blur:function(){var r;(r=e.current)===null||r===void 0||r.blur()}}}),e}function XYe(n,e){return x.useMemo(function(){return n||(e?(lg(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.entries(e).map(function(t){var i=Mt(t,2),r=i[0],s=i[1];return{label:r,value:s}})):[])},[n,e])}function _xe(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=x.useRef(e);i.current=e,lfe(function(){if(n)i.current(n);else{var r=Eh(function(){i.current(n)},t);return function(){Eh.cancel(r)}}},[n])}function ZYe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=x.useState(0),r=Mt(i,2),s=r[0],o=r[1],a=x.useState(!1),l=Mt(a,2),c=l[0],u=l[1],d=x.useRef([]),f=x.useRef(null),p=x.useRef(null),g=function(C){f.current=C},m=function(C){return f.current===C},_=function(C){u(C)},v=function(C){return C&&(p.current=C),p.current},b=function(C){var S=d.current,k=new Set(S.filter(function(L){return C[L]||e[L]})),I=S[S.length-1]===0?1:0;return k.size>=2||n[I]?null:I};return _xe(c||t,function(){c||(d.current=[],g(null))}),x.useEffect(function(){c&&d.current.push(s)},[c,s]),[c,_,v,s,o,b,d.current,g,m]}function z$t(n,e,t,i,r,s){var o=t[t.length-1],a=function(c,u){var d=Mt(n,2),f=d[0],p=d[1],g=ut(ut({},u),{},{from:jYe(n,t)});return o===1&&e[0]&&f&&!af(i,r,f,c,g.type)&&i.isAfter(f,c)||o===0&&e[1]&&p&&!af(i,r,p,c,g.type)&&i.isAfter(c,p)?!0:s==null?void 0:s(c,g)};return a}function Hj(n,e,t,i){switch(e){case"date":case"week":return n.addMonth(t,i);case"month":case"quarter":return n.addYear(t,i);case"year":return n.addYear(t,i*10);case"decade":return n.addYear(t,i*100);default:return t}}var sse=[];function JYe(n,e,t,i,r,s,o,a){var l=arguments.length>8&&arguments[8]!==void 0?arguments[8]:sse,c=arguments.length>9&&arguments[9]!==void 0?arguments[9]:sse,u=arguments.length>10&&arguments[10]!==void 0?arguments[10]:sse,d=arguments.length>11?arguments[11]:void 0,f=arguments.length>12?arguments[12]:void 0,p=arguments.length>13?arguments[13]:void 0,g=o==="time",m=s||0,_=function(q){var U=n.getNow();return g&&(U=$q(n,U)),l[q]||t[q]||U},v=Mt(c,2),b=v[0],y=v[1],C=Dy(function(){return _(0)},{value:b}),S=Mt(C,2),k=S[0],I=S[1],L=Dy(function(){return _(1)},{value:y}),N=Mt(L,2),P=N[0],O=N[1],F=x.useMemo(function(){var W=[k,P][m];return g?W:$q(n,W,u[m])},[g,k,P,m,n,u]),V=function(q){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"panel",G=[I,O][m];G(q);var H=[k,P];H[m]=q,d&&(!af(n,e,k,H[0],o)||!af(n,e,P,H[1],o))&&d(H,{source:U,range:m===1?"end":"start",mode:i})},M=function(q,U){if(a){var G={date:"month",week:"month",month:"year",quarter:"year"},H=G[o];if(H&&!af(n,e,q,U,H))return Hj(n,o,U,-1);if(o==="year"&&q){var z=Math.floor(n.getYear(q)/10),Z=Math.floor(n.getYear(U)/10);if(z!==Z)return Hj(n,o,U,-1)}}return U},B=x.useRef(null);return uc(function(){if(r&&!l[m]){var W=g?null:n.getNow();if(B.current!==null&&B.current!==m?W=[k,P][m^1]:t[m]?W=m===0?t[0]:M(t[0],t[1]):t[m^1]&&(W=t[m^1]),W){f&&n.isAfter(f,W)&&(W=f);var q=a?Hj(n,o,W,1):W;p&&n.isAfter(q,p)&&(W=a?Hj(n,o,p,-1):p),V(W,"reset")}}},[r,m,t[m]]),x.useEffect(function(){r?B.current=m:B.current=null},[r,m]),uc(function(){r&&l&&l[m]&&V(l[m],"reset")},[r,m]),[F,V]}function eQe(n,e){var t=x.useRef(n),i=x.useState({}),r=Mt(i,2),s=r[1],o=function(c){return c&&e!==void 0?e:t.current},a=function(c){t.current=c,s({})};return[o,a,o(!0)]}var U$t=[];function tQe(n,e,t){var i=function(o){return o.map(function(a){return od(a,{generateConfig:n,locale:e,format:t[0]})})},r=function(o,a){for(var l=Math.max(o.length,a.length),c=-1,u=0;u<l;u+=1){var d=o[u]||null,f=a[u]||null;if(d!==f&&!KYe(n,d,f)){c=u;break}}return[c<0,c!==0]};return[i,r]}function nQe(n,e){return _r(n).sort(function(t,i){return e.isAfter(t,i)?1:-1})}function q$t(n){var e=eQe(n),t=Mt(e,2),i=t[0],r=t[1],s=Ta(function(){r(n)});return x.useEffect(function(){s()},[n]),[i,r]}function iQe(n,e,t,i,r,s,o,a,l){var c=Dy(s,{value:o}),u=Mt(c,2),d=u[0],f=u[1],p=d||U$t,g=q$t(p),m=Mt(g,2),_=m[0],v=m[1],b=tQe(n,e,t),y=Mt(b,2),C=y[0],S=y[1],k=Ta(function(L){var N=_r(L);if(i)for(var P=0;P<2;P+=1)N[P]=N[P]||null;else r&&(N=nQe(N.filter(function(W){return W}),n));var O=S(_(),N),F=Mt(O,2),V=F[0],M=F[1];if(!V&&(v(N),a)){var B=C(N);a(N,B,{range:M?"end":"start"})}}),I=function(){l&&l(_())};return[p,f,_,k,I]}function rQe(n,e,t,i,r,s,o,a,l,c){var u=n.generateConfig,d=n.locale,f=n.picker,p=n.onChange,g=n.allowEmpty,m=n.order,_=s.some(function(V){return V})?!1:m,v=tQe(u,d,o),b=Mt(v,2),y=b[0],C=b[1],S=eQe(e),k=Mt(S,2),I=k[0],L=k[1],N=Ta(function(){L(e)});x.useEffect(function(){N()},[e]);var P=Ta(function(V){var M=V===null,B=_r(V||I());if(M)for(var W=Math.max(s.length,B.length),q=0;q<W;q+=1)s[q]||(B[q]=null);_&&B[0]&&B[1]&&(B=nQe(B,u)),r(B);var U=B,G=Mt(U,2),H=G[0],z=G[1],Z=!H,X=!z,oe=g?(!Z||g[0])&&(!X||g[1]):!0,fe=!m||Z||X||af(u,d,H,z,f)||u.isAfter(z,H),Se=(s[0]||!H||!c(H,{activeIndex:0}))&&(s[1]||!z||!c(z,{from:H,activeIndex:1})),Me=M||oe&&fe&&Se;if(Me){t(B);var Ie=C(B,e),ge=Mt(Ie,1),ye=ge[0];p&&!ye&&p(M&&B.every(function(Pe){return!Pe})?null:B,y(B))}return Me}),O=Ta(function(V,M){var B=AF(I(),V,i()[V]);L(B),M&&P()}),F=!a&&!l;return _xe(!F,function(){F&&(P(),r(e),N())},2),[O,P]}function sQe(n,e,t,i,r){return e!=="date"&&e!=="time"?!1:t!==void 0?t:i!==void 0?i:!r&&(n==="date"||n==="time")}function K$t(n,e,t,i,r,s){var o=n;function a(d,f,p){var g=s[d](o),m=p.find(function(y){return y.value===g});if(!m||m.disabled){var _=p.filter(function(y){return!y.disabled}),v=_r(_).reverse(),b=v.find(function(y){return y.value<=g})||_[0];b&&(g=b.value,o=s[f](o,g))}return g}var l=a("getHour","setHour",e()),c=a("getMinute","setMinute",t(l)),u=a("getSecond","setSecond",i(l,c));return a("getMillisecond","setMillisecond",r(l,c,u)),o}function tV(){return[]}function nV(n,e){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:2,o=[],a=t>=1?t|0:1,l=n;l<=e;l+=a){var c=r.includes(l);(!c||!i)&&o.push({label:fxe(l,s),value:l,disabled:c})}return o}function vxe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0,i=e||{},r=i.use12Hours,s=i.hourStep,o=s===void 0?1:s,a=i.minuteStep,l=a===void 0?1:a,c=i.secondStep,u=c===void 0?1:c,d=i.millisecondStep,f=d===void 0?100:d,p=i.hideDisabledOptions,g=i.disabledTime,m=i.disabledHours,_=i.disabledMinutes,v=i.disabledSeconds,b=x.useMemo(function(){return t||n.getNow()},[t,n]),y=x.useCallback(function(U){var G=(g==null?void 0:g(U))||{};return[G.disabledHours||m||tV,G.disabledMinutes||_||tV,G.disabledSeconds||v||tV,G.disabledMilliseconds||tV]},[g,m,_,v]),C=x.useMemo(function(){return y(b)},[b,y]),S=Mt(C,4),k=S[0],I=S[1],L=S[2],N=S[3],P=x.useCallback(function(U,G,H,z){var Z=nV(0,23,o,p,U()),X=r?Z.map(function(Me){return ut(ut({},Me),{},{label:fxe(Me.value%12||12,2)})}):Z,oe=function(Ie){return nV(0,59,l,p,G(Ie))},fe=function(Ie,ge){return nV(0,59,u,p,H(Ie,ge))},Se=function(Ie,ge,ye){return nV(0,999,f,p,z(Ie,ge,ye),3)};return[X,oe,fe,Se]},[p,o,r,f,l,u]),O=x.useMemo(function(){return P(k,I,L,N)},[P,k,I,L,N]),F=Mt(O,4),V=F[0],M=F[1],B=F[2],W=F[3],q=function(G,H){var z=function(){return V},Z=M,X=B,oe=W;if(H){var fe=y(H),Se=Mt(fe,4),Me=Se[0],Ie=Se[1],ge=Se[2],ye=Se[3],Pe=P(Me,Ie,ge,ye),Be=Mt(Pe,4),$e=Be[0],qe=Be[1],mt=Be[2],vt=Be[3];z=function(){return $e},Z=qe,X=mt,oe=vt}var ft=K$t(G,z,Z,X,oe,n);return ft};return[q,V,M,B,W]}function G$t(n){var e=n.mode,t=n.internalMode,i=n.renderExtraFooter,r=n.showNow,s=n.showTime,o=n.onSubmit,a=n.onNow,l=n.invalid,c=n.needConfirm,u=n.generateConfig,d=n.disabledDate,f=x.useContext(Kb),p=f.prefixCls,g=f.locale,m=f.button,_=m===void 0?"button":m,v=u.getNow(),b=vxe(u,s,v),y=Mt(b,1),C=y[0],S=i==null?void 0:i(e),k=d(v,{type:e}),I=function(){if(!k){var M=C(v);a(M)}},L="".concat(p,"-now"),N="".concat(L,"-btn"),P=r&&x.createElement("li",{className:L},x.createElement("a",{className:$t(N,k&&"".concat(N,"-disabled")),"aria-disabled":k,onClick:I},t==="date"?g.today:g.now)),O=c&&x.createElement("li",{className:"".concat(p,"-ok")},x.createElement(_,{disabled:l,onClick:o},g.ok)),F=(P||O)&&x.createElement("ul",{className:"".concat(p,"-ranges")},P,O);return!S&&!F?null:x.createElement("div",{className:"".concat(p,"-footer")},S&&x.createElement("div",{className:"".concat(p,"-footer-extra")},S),F)}function oQe(n,e,t){function i(r,s){var o=r.findIndex(function(l){return af(n,e,l,s,t)});if(o===-1)return[].concat(_r(r),[s]);var a=_r(r);return a.splice(o,1),a}return i}var xA=x.createContext(null);function DJ(){return x.useContext(xA)}function d4(n,e){var t=n.prefixCls,i=n.generateConfig,r=n.locale,s=n.disabledDate,o=n.minDate,a=n.maxDate,l=n.cellRender,c=n.hoverValue,u=n.hoverRangeValue,d=n.onHover,f=n.values,p=n.pickerValue,g=n.onSelect,m=n.prevIcon,_=n.nextIcon,v=n.superPrevIcon,b=n.superNextIcon,y=i.getNow(),C={now:y,values:f,pickerValue:p,prefixCls:t,disabledDate:s,minDate:o,maxDate:a,cellRender:l,hoverValue:c,hoverRangeValue:u,onHover:d,locale:r,generateConfig:i,onSelect:g,panelType:e,prevIcon:m,nextIcon:_,superPrevIcon:v,superNextIcon:b};return[C,y]}var JS=x.createContext({});function m9(n){for(var e=n.rowNum,t=n.colNum,i=n.baseDate,r=n.getCellDate,s=n.prefixColumn,o=n.rowClassName,a=n.titleFormat,l=n.getCellText,c=n.getCellClassName,u=n.headerCells,d=n.cellSelection,f=d===void 0?!0:d,p=n.disabledDate,g=DJ(),m=g.prefixCls,_=g.panelType,v=g.now,b=g.disabledDate,y=g.cellRender,C=g.onHover,S=g.hoverValue,k=g.hoverRangeValue,I=g.generateConfig,L=g.values,N=g.locale,P=g.onSelect,O=p||b,F="".concat(m,"-cell"),V=x.useContext(JS),M=V.onCellDblClick,B=function(X){return L.some(function(oe){return oe&&af(I,N,X,oe,_)})},W=[],q=0;q<e;q+=1){for(var U=[],G=void 0,H=function(){var X=q*t+z,oe=r(i,X),fe=O==null?void 0:O(oe,{type:_});z===0&&(G=oe,s&&U.push(s(G)));var Se=!1,Me=!1,Ie=!1;if(f&&k){var ge=Mt(k,2),ye=ge[0],Pe=ge[1];Se=NJ(I,ye,Pe,oe),Me=af(I,N,oe,ye,_),Ie=af(I,N,oe,Pe,_)}var Be=a?od(oe,{locale:N,format:a,generateConfig:I}):void 0,$e=x.createElement("div",{className:"".concat(F,"-inner")},l(oe));U.push(x.createElement("td",{key:z,title:Be,className:$t(F,ut(wt(wt(wt(wt(wt(wt({},"".concat(F,"-disabled"),fe),"".concat(F,"-hover"),(S||[]).some(function(qe){return af(I,N,oe,qe,_)})),"".concat(F,"-in-range"),Se&&!Me&&!Ie),"".concat(F,"-range-start"),Me),"".concat(F,"-range-end"),Ie),"".concat(m,"-cell-selected"),!k&&_!=="week"&&B(oe)),c(oe))),onClick:function(){fe||P(oe)},onDoubleClick:function(){!fe&&M&&M()},onMouseEnter:function(){fe||C==null||C(oe)},onMouseLeave:function(){fe||C==null||C(null)}},y?y(oe,{prefixCls:m,originNode:$e,today:v,type:_,locale:N}):$e))},z=0;z<t;z+=1)H();W.push(x.createElement("tr",{key:q,className:o==null?void 0:o(G)},U))}return x.createElement("div",{className:"".concat(m,"-body")},x.createElement("table",{className:"".concat(m,"-content")},u&&x.createElement("thead",null,x.createElement("tr",null,u)),x.createElement("tbody",null,W)))}var iV={visibility:"hidden"};function h4(n){var e=n.offset,t=n.superOffset,i=n.onChange,r=n.getStart,s=n.getEnd,o=n.children,a=DJ(),l=a.prefixCls,c=a.prevIcon,u=c===void 0?"‹":c,d=a.nextIcon,f=d===void 0?"›":d,p=a.superPrevIcon,g=p===void 0?"«":p,m=a.superNextIcon,_=m===void 0?"»":m,v=a.minDate,b=a.maxDate,y=a.generateConfig,C=a.locale,S=a.pickerValue,k=a.panelType,I="".concat(l,"-header"),L=x.useContext(JS),N=L.hidePrev,P=L.hideNext,O=L.hideHeader,F=x.useMemo(function(){if(!v||!e||!s)return!1;var Z=s(e(-1,S));return!JH(y,C,Z,v,k)},[v,e,S,s,y,C,k]),V=x.useMemo(function(){if(!v||!t||!s)return!1;var Z=s(t(-1,S));return!JH(y,C,Z,v,k)},[v,t,S,s,y,C,k]),M=x.useMemo(function(){if(!b||!e||!r)return!1;var Z=r(e(1,S));return!JH(y,C,b,Z,k)},[b,e,S,r,y,C,k]),B=x.useMemo(function(){if(!b||!t||!r)return!1;var Z=r(t(1,S));return!JH(y,C,b,Z,k)},[b,t,S,r,y,C,k]),W=function(X){e&&i(e(X,S))},q=function(X){t&&i(t(X,S))};if(O)return null;var U="".concat(I,"-prev-btn"),G="".concat(I,"-next-btn"),H="".concat(I,"-super-prev-btn"),z="".concat(I,"-super-next-btn");return x.createElement("div",{className:I},t&&x.createElement("button",{type:"button","aria-label":C.previousYear,onClick:function(){return q(-1)},tabIndex:-1,className:$t(H,V&&"".concat(H,"-disabled")),disabled:V,style:N?iV:{}},g),e&&x.createElement("button",{type:"button","aria-label":C.previousMonth,onClick:function(){return W(-1)},tabIndex:-1,className:$t(U,F&&"".concat(U,"-disabled")),disabled:F,style:N?iV:{}},u),x.createElement("div",{className:"".concat(I,"-view")},o),e&&x.createElement("button",{type:"button","aria-label":C.nextMonth,onClick:function(){return W(1)},tabIndex:-1,className:$t(G,M&&"".concat(G,"-disabled")),disabled:M,style:P?iV:{}},f),t&&x.createElement("button",{type:"button","aria-label":C.nextYear,onClick:function(){return q(1)},tabIndex:-1,className:$t(z,B&&"".concat(z,"-disabled")),disabled:B,style:P?iV:{}},_))}function RJ(n){var e=n.prefixCls,t=n.panelName,i=t===void 0?"date":t,r=n.locale,s=n.generateConfig,o=n.pickerValue,a=n.onPickerValueChange,l=n.onModeChange,c=n.mode,u=c===void 0?"date":c,d=n.disabledDate,f=n.onSelect,p=n.onHover,g=n.showWeek,m="".concat(e,"-").concat(i,"-panel"),_="".concat(e,"-cell"),v=u==="week",b=d4(n,u),y=Mt(b,2),C=y[0],S=y[1],k=s.locale.getWeekFirstDay(r.locale),I=s.setDate(o,1),L=F$t(r.locale,s,I),N=s.getMonth(o),P=g===void 0?v:g,O=P?function(Z){var X=d==null?void 0:d(Z,{type:"week"});return x.createElement("td",{key:"week",className:$t(_,"".concat(_,"-week"),wt({},"".concat(_,"-disabled"),X)),onClick:function(){X||f(Z)},onMouseEnter:function(){X||p==null||p(Z)},onMouseLeave:function(){X||p==null||p(null)}},x.createElement("div",{className:"".concat(_,"-inner")},s.locale.getWeek(r.locale,Z)))}:null,F=[],V=r.shortWeekDays||(s.locale.getShortWeekDays?s.locale.getShortWeekDays(r.locale):[]);O&&F.push(x.createElement("th",{key:"empty"},x.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},r.week)));for(var M=0;M<rse;M+=1)F.push(x.createElement("th",{key:M},V[(M+k)%rse]));var B=function(X,oe){return s.addDate(X,oe)},W=function(X){return od(X,{locale:r,format:r.cellDateFormat,generateConfig:s})},q=function(X){var oe=wt(wt({},"".concat(e,"-cell-in-view"),gxe(s,X,o)),"".concat(e,"-cell-today"),mxe(s,X,S));return oe},U=r.shortMonths||(s.locale.getShortMonths?s.locale.getShortMonths(r.locale):[]),G=x.createElement("button",{type:"button","aria-label":r.yearSelect,key:"year",onClick:function(){l("year",o)},tabIndex:-1,className:"".concat(e,"-year-btn")},od(o,{locale:r,format:r.yearFormat,generateConfig:s})),H=x.createElement("button",{type:"button","aria-label":r.monthSelect,key:"month",onClick:function(){l("month",o)},tabIndex:-1,className:"".concat(e,"-month-btn")},r.monthFormat?od(o,{locale:r,format:r.monthFormat,generateConfig:s}):U[N]),z=r.monthBeforeYear?[H,G]:[G,H];return x.createElement(xA.Provider,{value:C},x.createElement("div",{className:$t(m,g&&"".concat(m,"-show-week"))},x.createElement(h4,{offset:function(X){return s.addMonth(o,X)},superOffset:function(X){return s.addYear(o,X)},onChange:a,getStart:function(X){return s.setDate(X,1)},getEnd:function(X){var oe=s.setDate(X,1);return oe=s.addMonth(oe,1),s.addDate(oe,-1)}},z),x.createElement(m9,hn({titleFormat:r.fieldDateFormat},n,{colNum:rse,rowNum:6,baseDate:L,headerCells:F,getCellDate:B,getCellText:W,getCellClassName:q,prefixColumn:O,cellSelection:!v}))))}var Y$t=1/3;function Q$t(n,e){var t=x.useRef(!1),i=x.useRef(null),r=x.useRef(null),s=function(){return t.current},o=function(){Eh.cancel(i.current),t.current=!1},a=x.useRef(),l=function(){var d=n.current;if(r.current=null,a.current=0,d){var f=d.querySelector('[data-value="'.concat(e,'"]')),p=d.querySelector("li"),g=function m(){o(),t.current=!0,a.current+=1;var _=d.scrollTop,v=p.offsetTop,b=f.offsetTop,y=b-v;if(b===0&&f!==p||!sxe(d)){a.current<=5&&(i.current=Eh(m));return}var C=_+(y-_)*Y$t,S=Math.abs(y-C);if(r.current!==null&&r.current<S){o();return}if(r.current=S,S<=1){d.scrollTop=y,o();return}d.scrollTop=C,i.current=Eh(m)};f&&p&&g()}},c=Ta(l);return[c,o,s]}var X$t=300;function Z$t(n){return n.map(function(e){var t=e.value,i=e.label,r=e.disabled;return[t,i,r].join(",")}).join(";")}function M5(n){var e=n.units,t=n.value,i=n.optionalValue,r=n.type,s=n.onChange,o=n.onHover,a=n.onDblClick,l=n.changeOnScroll,c=DJ(),u=c.prefixCls,d=c.cellRender,f=c.now,p=c.locale,g="".concat(u,"-time-panel"),m="".concat(u,"-time-panel-cell"),_=x.useRef(null),v=x.useRef(),b=function(){clearTimeout(v.current)},y=Q$t(_,t??i),C=Mt(y,3),S=C[0],k=C[1],I=C[2];uc(function(){return S(),b(),function(){k(),b()}},[t,i,Z$t(e)]);var L=function(O){b();var F=O.target;!I()&&l&&(v.current=setTimeout(function(){var V=_.current,M=V.querySelector("li").offsetTop,B=Array.from(V.querySelectorAll("li")),W=B.map(function(z){return z.offsetTop-M}),q=W.map(function(z,Z){return e[Z].disabled?Number.MAX_SAFE_INTEGER:Math.abs(z-F.scrollTop)}),U=Math.min.apply(Math,_r(q)),G=q.findIndex(function(z){return z===U}),H=e[G];H&&!H.disabled&&s(H.value)},X$t))},N="".concat(g,"-column");return x.createElement("ul",{className:N,ref:_,"data-type":r,onScroll:L},e.map(function(P){var O=P.label,F=P.value,V=P.disabled,M=x.createElement("div",{className:"".concat(m,"-inner")},O);return x.createElement("li",{key:F,className:$t(m,wt(wt({},"".concat(m,"-selected"),t===F),"".concat(m,"-disabled"),V)),onClick:function(){V||s(F)},onDoubleClick:function(){!V&&a&&a()},onMouseEnter:function(){o(F)},onMouseLeave:function(){o(null)},"data-value":F},d?d(F,{prefixCls:u,originNode:M,today:f,type:"time",subType:r,locale:p}):M)}))}function Hx(n){return n<12}function J$t(n){var e=n.showHour,t=n.showMinute,i=n.showSecond,r=n.showMillisecond,s=n.use12Hours,o=n.changeOnScroll,a=DJ(),l=a.prefixCls,c=a.values,u=a.generateConfig,d=a.locale,f=a.onSelect,p=a.onHover,g=p===void 0?function(){}:p,m=a.pickerValue,_=(c==null?void 0:c[0])||null,v=x.useContext(JS),b=v.onCellDblClick,y=vxe(u,n,_),C=Mt(y,5),S=C[0],k=C[1],I=C[2],L=C[3],N=C[4],P=function(Ve){var Qt=_&&u[Ve](_),rt=m&&u[Ve](m);return[Qt,rt]},O=P("getHour"),F=Mt(O,2),V=F[0],M=F[1],B=P("getMinute"),W=Mt(B,2),q=W[0],U=W[1],G=P("getSecond"),H=Mt(G,2),z=H[0],Z=H[1],X=P("getMillisecond"),oe=Mt(X,2),fe=oe[0],Se=oe[1],Me=V===null?null:Hx(V)?"am":"pm",Ie=x.useMemo(function(){return s?Hx(V)?k.filter(function(je){return Hx(je.value)}):k.filter(function(je){return!Hx(je.value)}):k},[V,k,s]),ge=function(Ve,Qt){var rt,Cn=Ve.filter(function(Rn){return!Rn.disabled});return Qt??(Cn==null||(rt=Cn[0])===null||rt===void 0?void 0:rt.value)},ye=ge(k,V),Pe=x.useMemo(function(){return I(ye)},[I,ye]),Be=ge(Pe,q),$e=x.useMemo(function(){return L(ye,Be)},[L,ye,Be]),qe=ge($e,z),mt=x.useMemo(function(){return N(ye,Be,qe)},[N,ye,Be,qe]),vt=ge(mt,fe),ft=x.useMemo(function(){if(!s)return[];var je=u.getNow(),Ve=u.setHour(je,6),Qt=u.setHour(je,18),rt=function(Rn,li){var Mi=d.cellMeridiemFormat;return Mi?od(Rn,{generateConfig:u,locale:d,format:Mi}):li};return[{label:rt(Ve,"AM"),value:"am",disabled:k.every(function(Cn){return Cn.disabled||!Hx(Cn.value)})},{label:rt(Qt,"PM"),value:"pm",disabled:k.every(function(Cn){return Cn.disabled||Hx(Cn.value)})}]},[k,s,u,d]),tt=function(Ve){var Qt=S(Ve);f(Qt)},St=x.useMemo(function(){var je=_||m||u.getNow(),Ve=function(rt){return rt!=null};return Ve(V)?(je=u.setHour(je,V),je=u.setMinute(je,q),je=u.setSecond(je,z),je=u.setMillisecond(je,fe)):Ve(M)?(je=u.setHour(je,M),je=u.setMinute(je,U),je=u.setSecond(je,Z),je=u.setMillisecond(je,Se)):Ve(ye)&&(je=u.setHour(je,ye),je=u.setMinute(je,Be),je=u.setSecond(je,qe),je=u.setMillisecond(je,vt)),je},[_,m,V,q,z,fe,ye,Be,qe,vt,M,U,Z,Se,u]),Ft=function(Ve,Qt){return Ve===null?null:u[Qt](St,Ve)},en=function(Ve){return Ft(Ve,"setHour")},Ke=function(Ve){return Ft(Ve,"setMinute")},dt=function(Ve){return Ft(Ve,"setSecond")},nt=function(Ve){return Ft(Ve,"setMillisecond")},at=function(Ve){return Ve===null?null:Ve==="am"&&!Hx(V)?u.setHour(St,V-12):Ve==="pm"&&Hx(V)?u.setHour(St,V+12):St},Oe=function(Ve){tt(en(Ve))},ce=function(Ve){tt(Ke(Ve))},Ne=function(Ve){tt(dt(Ve))},Xe=function(Ve){tt(nt(Ve))},it=function(Ve){tt(at(Ve))},Tt=function(Ve){g(en(Ve))},Ct=function(Ve){g(Ke(Ve))},Rt=function(Ve){g(dt(Ve))},se=function(Ve){g(nt(Ve))},ke=function(Ve){g(at(Ve))},Ae={onDblClick:b,changeOnScroll:o};return x.createElement("div",{className:"".concat(l,"-content")},e&&x.createElement(M5,hn({units:Ie,value:V,optionalValue:M,type:"hour",onChange:Oe,onHover:Tt},Ae)),t&&x.createElement(M5,hn({units:Pe,value:q,optionalValue:U,type:"minute",onChange:ce,onHover:Ct},Ae)),i&&x.createElement(M5,hn({units:$e,value:z,optionalValue:Z,type:"second",onChange:Ne,onHover:Rt},Ae)),r&&x.createElement(M5,hn({units:mt,value:fe,optionalValue:Se,type:"millisecond",onChange:Xe,onHover:se},Ae)),s&&x.createElement(M5,hn({units:ft,value:Me,type:"meridiem",onChange:it,onHover:ke},Ae)))}function aQe(n){var e=n.prefixCls,t=n.value,i=n.locale,r=n.generateConfig,s=n.showTime,o=s||{},a=o.format,l="".concat(e,"-time-panel"),c=d4(n,"time"),u=Mt(c,1),d=u[0];return x.createElement(xA.Provider,{value:d},x.createElement("div",{className:$t(l)},x.createElement(h4,null,t?od(t,{locale:i,format:a,generateConfig:r}):" "),x.createElement(J$t,s)))}function eHt(n){var e=n.prefixCls,t=n.generateConfig,i=n.showTime,r=n.onSelect,s=n.value,o=n.pickerValue,a=n.onHover,l="".concat(e,"-datetime-panel"),c=vxe(t,i),u=Mt(c,1),d=u[0],f=function(_){return s?$q(t,_,s):$q(t,_,o)},p=function(_){a==null||a(_&&f(_))},g=function(_){var v=f(_);r(d(v,v))};return x.createElement("div",{className:l},x.createElement(RJ,hn({},n,{onSelect:g,onHover:p})),x.createElement(aQe,n))}function tHt(n){var e=n.prefixCls,t=n.locale,i=n.generateConfig,r=n.pickerValue,s=n.disabledDate,o=n.onPickerValueChange,a="".concat(e,"-decade-panel"),l=d4(n,"decade"),c=Mt(l,1),u=c[0],d=function(k){var I=Math.floor(i.getYear(k)/100)*100;return i.setYear(k,I)},f=function(k){var I=d(k);return i.addYear(I,99)},p=d(r),g=f(r),m=i.addYear(p,-10),_=function(k,I){return i.addYear(k,I*10)},v=function(k){var I=t.cellYearFormat,L=od(k,{locale:t,format:I,generateConfig:i}),N=od(i.addYear(k,9),{locale:t,format:I,generateConfig:i});return"".concat(L,"-").concat(N)},b=function(k){return wt({},"".concat(e,"-cell-in-view"),qfe(i,k,p)||qfe(i,k,g)||NJ(i,p,g,k))},y=s?function(S,k){var I=i.setDate(S,1),L=i.setMonth(I,0),N=i.setYear(L,Math.floor(i.getYear(L)/10)*10),P=i.addYear(N,10),O=i.addDate(P,-1);return s(N,k)&&s(O,k)}:null,C="".concat(od(p,{locale:t,format:t.yearFormat,generateConfig:i}),"-").concat(od(g,{locale:t,format:t.yearFormat,generateConfig:i}));return x.createElement(xA.Provider,{value:u},x.createElement("div",{className:a},x.createElement(h4,{superOffset:function(k){return i.addYear(r,k*100)},onChange:o,getStart:d,getEnd:f},C),x.createElement(m9,hn({},n,{disabledDate:y,colNum:3,rowNum:4,baseDate:m,getCellDate:_,getCellText:v,getCellClassName:b}))))}function nHt(n){var e=n.prefixCls,t=n.locale,i=n.generateConfig,r=n.pickerValue,s=n.disabledDate,o=n.onPickerValueChange,a=n.onModeChange,l="".concat(e,"-month-panel"),c=d4(n,"month"),u=Mt(c,1),d=u[0],f=i.setMonth(r,0),p=t.shortMonths||(i.locale.getShortMonths?i.locale.getShortMonths(t.locale):[]),g=function(C,S){return i.addMonth(C,S)},m=function(C){var S=i.getMonth(C);return t.monthFormat?od(C,{locale:t,format:t.monthFormat,generateConfig:i}):p[S]},_=function(){return wt({},"".concat(e,"-cell-in-view"),!0)},v=s?function(y,C){var S=i.setDate(y,1),k=i.setMonth(S,i.getMonth(S)+1),I=i.addDate(k,-1);return s(S,C)&&s(I,C)}:null,b=x.createElement("button",{type:"button",key:"year","aria-label":t.yearSelect,onClick:function(){a("year")},tabIndex:-1,className:"".concat(e,"-year-btn")},od(r,{locale:t,format:t.yearFormat,generateConfig:i}));return x.createElement(xA.Provider,{value:d},x.createElement("div",{className:l},x.createElement(h4,{superOffset:function(C){return i.addYear(r,C)},onChange:o,getStart:function(C){return i.setMonth(C,0)},getEnd:function(C){return i.setMonth(C,11)}},b),x.createElement(m9,hn({},n,{disabledDate:v,titleFormat:t.fieldMonthFormat,colNum:3,rowNum:4,baseDate:f,getCellDate:g,getCellText:m,getCellClassName:_}))))}function iHt(n){var e=n.prefixCls,t=n.locale,i=n.generateConfig,r=n.pickerValue,s=n.onPickerValueChange,o=n.onModeChange,a="".concat(e,"-quarter-panel"),l=d4(n,"quarter"),c=Mt(l,1),u=c[0],d=i.setMonth(r,0),f=function(v,b){return i.addMonth(v,b*3)},p=function(v){return od(v,{locale:t,format:t.cellQuarterFormat,generateConfig:i})},g=function(){return wt({},"".concat(e,"-cell-in-view"),!0)},m=x.createElement("button",{type:"button",key:"year","aria-label":t.yearSelect,onClick:function(){o("year")},tabIndex:-1,className:"".concat(e,"-year-btn")},od(r,{locale:t,format:t.yearFormat,generateConfig:i}));return x.createElement(xA.Provider,{value:u},x.createElement("div",{className:a},x.createElement(h4,{superOffset:function(v){return i.addYear(r,v)},onChange:s,getStart:function(v){return i.setMonth(v,0)},getEnd:function(v){return i.setMonth(v,11)}},m),x.createElement(m9,hn({},n,{titleFormat:t.fieldQuarterFormat,colNum:4,rowNum:1,baseDate:d,getCellDate:f,getCellText:p,getCellClassName:g}))))}function rHt(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.value,s=n.hoverValue,o=n.hoverRangeValue,a=i.locale,l="".concat(e,"-week-panel-row"),c=function(d){var f={};if(o){var p=Mt(o,2),g=p[0],m=p[1],_=$j(t,a,g,d),v=$j(t,a,m,d);f["".concat(l,"-range-start")]=_,f["".concat(l,"-range-end")]=v,f["".concat(l,"-range-hover")]=!_&&!v&&NJ(t,g,m,d)}return s&&(f["".concat(l,"-hover")]=s.some(function(b){return $j(t,a,d,b)})),$t(l,wt({},"".concat(l,"-selected"),!o&&$j(t,a,r,d)),f)};return x.createElement(RJ,hn({},n,{mode:"week",panelName:"week",rowClassName:c}))}function sHt(n){var e=n.prefixCls,t=n.locale,i=n.generateConfig,r=n.pickerValue,s=n.disabledDate,o=n.onPickerValueChange,a=n.onModeChange,l="".concat(e,"-year-panel"),c=d4(n,"year"),u=Mt(c,1),d=u[0],f=function(I){var L=Math.floor(i.getYear(I)/10)*10;return i.setYear(I,L)},p=function(I){var L=f(I);return i.addYear(L,9)},g=f(r),m=p(r),_=i.addYear(g,-1),v=function(I,L){return i.addYear(I,L)},b=function(I){return od(I,{locale:t,format:t.cellYearFormat,generateConfig:i})},y=function(I){return wt({},"".concat(e,"-cell-in-view"),SL(i,I,g)||SL(i,I,m)||NJ(i,g,m,I))},C=s?function(k,I){var L=i.setMonth(k,0),N=i.setDate(L,1),P=i.addYear(N,1),O=i.addDate(P,-1);return s(N,I)&&s(O,I)}:null,S=x.createElement("button",{type:"button",key:"decade","aria-label":t.decadeSelect,onClick:function(){a("decade")},tabIndex:-1,className:"".concat(e,"-decade-btn")},od(g,{locale:t,format:t.yearFormat,generateConfig:i}),"-",od(m,{locale:t,format:t.yearFormat,generateConfig:i}));return x.createElement(xA.Provider,{value:d},x.createElement("div",{className:l},x.createElement(h4,{superOffset:function(I){return i.addYear(r,I*10)},onChange:o,getStart:f,getEnd:p},S),x.createElement(m9,hn({},n,{disabledDate:C,titleFormat:t.fieldYearFormat,colNum:3,rowNum:4,baseDate:_,getCellDate:v,getCellText:b,getCellClassName:y}))))}var oHt={date:RJ,datetime:eHt,week:rHt,month:nHt,quarter:iHt,year:sHt,decade:tHt,time:aQe};function aHt(n,e){var t,i=n.locale,r=n.generateConfig,s=n.direction,o=n.prefixCls,a=n.tabIndex,l=a===void 0?0:a,c=n.multiple,u=n.defaultValue,d=n.value,f=n.onChange,p=n.onSelect,g=n.defaultPickerValue,m=n.pickerValue,_=n.onPickerValueChange,v=n.mode,b=n.onPanelChange,y=n.picker,C=y===void 0?"date":y,S=n.showTime,k=n.hoverValue,I=n.hoverRangeValue,L=n.cellRender,N=n.dateRender,P=n.monthCellRender,O=n.components,F=O===void 0?{}:O,V=n.hideHeader,M=((t=x.useContext(Kb))===null||t===void 0?void 0:t.prefixCls)||o||"rc-picker",B=x.useRef();x.useImperativeHandle(e,function(){return{nativeElement:B.current}});var W=zYe(n),q=Mt(W,4),U=q[0],G=q[1],H=q[2],z=q[3],Z=HYe(i,G),X=C==="date"&&S?"datetime":C,oe=x.useMemo(function(){return UYe(X,H,z,U,Z)},[X,H,z,U,Z]),fe=r.getNow(),Se=Dy(C,{value:v,postState:function(ke){return ke||"date"}}),Me=Mt(Se,2),Ie=Me[0],ge=Me[1],ye=Ie==="date"&&oe?"datetime":Ie,Pe=oQe(r,i,X),Be=Dy(u,{value:d}),$e=Mt(Be,2),qe=$e[0],mt=$e[1],vt=x.useMemo(function(){var se=wA(qe).filter(function(ke){return ke});return c?se:se.slice(0,1)},[qe,c]),ft=Ta(function(se){mt(se),f&&(se===null||vt.length!==se.length||vt.some(function(ke,Ae){return!af(r,i,ke,se[Ae],X)}))&&(f==null||f(c?se:se[0]))}),tt=Ta(function(se){if(p==null||p(se),Ie===C){var ke=c?Pe(vt,se):[se];ft(ke)}}),St=Dy(g||vt[0]||fe,{value:m}),Ft=Mt(St,2),en=Ft[0],Ke=Ft[1];x.useEffect(function(){vt[0]&&!m&&Ke(vt[0])},[vt[0]]);var dt=function(ke,Ae){b==null||b(ke||m,Ae||Ie)},nt=function(ke){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Ke(ke),_==null||_(ke),Ae&&dt(ke)},at=function(ke,Ae){ge(ke),Ae&&nt(Ae),dt(Ae,ke)},Oe=function(ke){if(tt(ke),nt(ke),Ie!==C){var Ae=["decade","year"],je=[].concat(Ae,["month"]),Ve={quarter:[].concat(Ae,["quarter"]),week:[].concat(_r(je),["week"]),date:[].concat(_r(je),["date"])},Qt=Ve[C]||je,rt=Qt.indexOf(Ie),Cn=Qt[rt+1];Cn&&at(Cn,ke)}},ce=x.useMemo(function(){var se,ke;if(Array.isArray(I)){var Ae=Mt(I,2);se=Ae[0],ke=Ae[1]}else se=I;return!se&&!ke?null:(se=se||ke,ke=ke||se,r.isAfter(se,ke)?[ke,se]:[se,ke])},[I,r]),Ne=pxe(L,N,P),Xe=F[ye]||oHt[ye]||RJ,it=x.useContext(JS),Tt=x.useMemo(function(){return ut(ut({},it),{},{hideHeader:V})},[it,V]),Ct="".concat(M,"-panel"),Rt=AJ(n,["showWeek","prevIcon","nextIcon","superPrevIcon","superNextIcon","disabledDate","minDate","maxDate","onHover"]);return x.createElement(JS.Provider,{value:Tt},x.createElement("div",{ref:B,tabIndex:l,className:$t(Ct,wt({},"".concat(Ct,"-rtl"),s==="rtl"))},x.createElement(Xe,hn({},Rt,{showTime:oe,prefixCls:M,locale:Z,generateConfig:r,onModeChange:at,pickerValue:en,onPickerValueChange:function(ke){nt(ke,!0)},value:vt[0],onSelect:Oe,values:vt,cellRender:Ne,hoverRangeValue:ce,hoverValue:k}))))}var ose=x.memo(x.forwardRef(aHt));function lHt(n){var e=n.picker,t=n.multiplePanel,i=n.pickerValue,r=n.onPickerValueChange,s=n.needConfirm,o=n.onSubmit,a=n.range,l=n.hoverValue,c=x.useContext(Kb),u=c.prefixCls,d=c.generateConfig,f=x.useCallback(function(b,y){return Hj(d,e,b,y)},[d,e]),p=x.useMemo(function(){return f(i,1)},[i,f]),g=function(y){r(f(y,-1))},m={onCellDblClick:function(){s&&o()}},_=e==="time",v=ut(ut({},n),{},{hoverValue:null,hoverRangeValue:null,hideHeader:_});return a?v.hoverRangeValue=l:v.hoverValue=l,t?x.createElement("div",{className:"".concat(u,"-panels")},x.createElement(JS.Provider,{value:ut(ut({},m),{},{hideNext:!0})},x.createElement(ose,v)),x.createElement(JS.Provider,{value:ut(ut({},m),{},{hidePrev:!0})},x.createElement(ose,hn({},v,{pickerValue:p,onPickerValueChange:g})))):x.createElement(JS.Provider,{value:ut({},m)},x.createElement(ose,v))}function HPe(n){return typeof n=="function"?n():n}function cHt(n){var e=n.prefixCls,t=n.presets,i=n.onClick,r=n.onHover;return t.length?x.createElement("div",{className:"".concat(e,"-presets")},x.createElement("ul",null,t.map(function(s,o){var a=s.label,l=s.value;return x.createElement("li",{key:o,onClick:function(){i(HPe(l))},onMouseEnter:function(){r(HPe(l))},onMouseLeave:function(){r(null)}},a)}))):null}function lQe(n){var e=n.panelRender,t=n.internalMode,i=n.picker,r=n.showNow,s=n.range,o=n.multiple,a=n.activeInfo,l=a===void 0?[0,0,0]:a,c=n.presets,u=n.onPresetHover,d=n.onPresetSubmit,f=n.onFocus,p=n.onBlur,g=n.onPanelMouseDown,m=n.direction,_=n.value,v=n.onSelect,b=n.isInvalid,y=n.defaultOpenValue,C=n.onOk,S=n.onSubmit,k=x.useContext(Kb),I=k.prefixCls,L="".concat(I,"-panel"),N=m==="rtl",P=x.useRef(null),O=x.useRef(null),F=x.useState(0),V=Mt(F,2),M=V[0],B=V[1],W=x.useState(0),q=Mt(W,2),U=q[0],G=q[1],H=x.useState(0),z=Mt(H,2),Z=z[0],X=z[1],oe=function(Oe){Oe.width&&B(Oe.width)},fe=Mt(l,3),Se=fe[0],Me=fe[1],Ie=fe[2],ge=x.useState(0),ye=Mt(ge,2),Pe=ye[0],Be=ye[1];x.useEffect(function(){Be(10)},[Se]),x.useEffect(function(){if(s&&O.current){var at,Oe=((at=P.current)===null||at===void 0?void 0:at.offsetWidth)||0,ce=O.current.getBoundingClientRect();if(!ce.height||ce.right<0){Be(function(Tt){return Math.max(0,Tt-1)});return}var Ne=(N?Me-Oe:Se)-ce.left;if(X(Ne),M&&M<Ie){var Xe=N?ce.right-(Me-Oe+M):Se+Oe-ce.left-M,it=Math.max(0,Xe);G(it)}else G(0)}},[Pe,N,M,Se,Me,Ie,s]);function $e(at){return at.filter(function(Oe){return Oe})}var qe=x.useMemo(function(){return $e(wA(_))},[_]),mt=i==="time"&&!qe.length,vt=x.useMemo(function(){return mt?$e([y]):qe},[mt,qe,y]),ft=mt?y:qe,tt=x.useMemo(function(){return vt.length?vt.some(function(at){return b(at)}):!0},[vt,b]),St=function(){mt&&v(y),C(),S()},Ft=x.createElement("div",{className:"".concat(I,"-panel-layout")},x.createElement(cHt,{prefixCls:I,presets:c,onClick:d,onHover:u}),x.createElement("div",null,x.createElement(lHt,hn({},n,{value:ft})),x.createElement(G$t,hn({},n,{showNow:o?!1:r,invalid:tt,onSubmit:St}))));e&&(Ft=e(Ft));var en="".concat(L,"-container"),Ke="marginLeft",dt="marginRight",nt=x.createElement("div",{onMouseDown:g,tabIndex:-1,className:$t(en,"".concat(I,"-").concat(t,"-panel-container")),style:wt(wt({},N?dt:Ke,U),N?Ke:dt,"auto"),onFocus:f,onBlur:p},Ft);return s&&(nt=x.createElement("div",{onMouseDown:g,ref:O,className:$t("".concat(I,"-range-wrapper"),"".concat(I,"-").concat(i,"-range-wrapper"))},x.createElement("div",{ref:P,className:"".concat(I,"-range-arrow"),style:{left:Z}}),x.createElement(bA,{onResize:oe},nt))),nt}function cQe(n,e){var t=n.format,i=n.maskFormat,r=n.generateConfig,s=n.locale,o=n.preserveInvalidOnBlur,a=n.inputReadOnly,l=n.required,c=n["aria-required"],u=n.onSubmit,d=n.onFocus,f=n.onBlur,p=n.onInputChange,g=n.onInvalid,m=n.open,_=n.onOpenChange,v=n.onKeyDown,b=n.onChange,y=n.activeHelp,C=n.name,S=n.autoComplete,k=n.id,I=n.value,L=n.invalid,N=n.placeholder,P=n.disabled,O=n.activeIndex,F=n.allHelp,V=n.picker,M=function(Z,X){var oe=r.locale.parse(s.locale,Z,[X]);return oe&&r.isValidate(oe)?oe:null},B=t[0],W=x.useCallback(function(z){return od(z,{locale:s,format:B,generateConfig:r})},[s,r,B]),q=x.useMemo(function(){return I.map(W)},[I,W]),U=x.useMemo(function(){var z=V==="time"?8:10,Z=typeof B=="function"?B(r.getNow()).length:B.length;return Math.max(z,Z)+2},[B,V,r]),G=function(Z){for(var X=0;X<t.length;X+=1){var oe=t[X];if(typeof oe=="string"){var fe=M(Z,oe);if(fe)return fe}}return!1},H=function(Z){function X(Se){return Z!==void 0?Se[Z]:Se}var oe=ixe(n,{aria:!0,data:!0}),fe=ut(ut({},oe),{},{format:i,validateFormat:function(Me){return!!G(Me)},preserveInvalidOnBlur:o,readOnly:a,required:l,"aria-required":c,name:C,autoComplete:S,size:U,id:X(k),value:X(q)||"",invalid:X(L),placeholder:X(N),active:O===Z,helped:F||y&&O===Z,disabled:X(P),onFocus:function(Me){d(Me,Z)},onBlur:function(Me){f(Me,Z)},onSubmit:u,onChange:function(Me){p();var Ie=G(Me);if(Ie){g(!1,Z),b(Ie,Z);return}g(!!Me,Z)},onHelp:function(){_(!0,{index:Z})},onKeyDown:function(Me){var Ie=!1;if(v==null||v(Me,function(){Ie=!0}),!Me.defaultPrevented&&!Ie)switch(Me.key){case"Escape":_(!1,{index:Z});break;case"Enter":m||_(!0);break}}},e==null?void 0:e({valueTexts:q}));return Object.keys(fe).forEach(function(Se){fe[Se]===void 0&&delete fe[Se]}),fe};return[H,W]}var uHt=["onMouseEnter","onMouseLeave"];function uQe(n){return x.useMemo(function(){return AJ(n,uHt)},[n])}var dHt=["icon","type"],hHt=["onClear"];function PJ(n){var e=n.icon,t=n.type,i=Na(n,dHt),r=x.useContext(Kb),s=r.prefixCls;return e?x.createElement("span",hn({className:"".concat(s,"-").concat(t)},i),e):null}function Kfe(n){var e=n.onClear,t=Na(n,hHt);return x.createElement(PJ,hn({},t,{type:"clear",role:"button",onMouseDown:function(r){r.preventDefault()},onClick:function(r){r.stopPropagation(),e()}}))}var ase=["YYYY","MM","DD","HH","mm","ss","SSS"],VPe="顧",fHt=function(){function n(e){Ra(this,n),wt(this,"format",void 0),wt(this,"maskFormat",void 0),wt(this,"cells",void 0),wt(this,"maskCells",void 0),this.format=e;var t=ase.map(function(a){return"(".concat(a,")")}).join("|"),i=new RegExp(t,"g");this.maskFormat=e.replace(i,function(a){return VPe.repeat(a.length)});var r=new RegExp("(".concat(ase.join("|"),")")),s=(e.split(r)||[]).filter(function(a){return a}),o=0;this.cells=s.map(function(a){var l=ase.includes(a),c=o,u=o+a.length;return o=u,{text:a,mask:l,start:c,end:u}}),this.maskCells=this.cells.filter(function(a){return a.mask})}return Pa(n,[{key:"getSelection",value:function(t){var i=this.maskCells[t]||{},r=i.start,s=i.end;return[r||0,s||0]}},{key:"match",value:function(t){for(var i=0;i<this.maskFormat.length;i+=1){var r=this.maskFormat[i],s=t[i];if(!s||r!==VPe&&r!==s)return!1}return!0}},{key:"size",value:function(){return this.maskCells.length}},{key:"getMaskCellIndex",value:function(t){for(var i=Number.MAX_SAFE_INTEGER,r=0,s=0;s<this.maskCells.length;s+=1){var o=this.maskCells[s],a=o.start,l=o.end;if(t>=a&&t<=l)return s;var c=Math.min(Math.abs(t-a),Math.abs(t-l));c<i&&(i=c,r=s)}return r}}]),n}();function pHt(n){var e={YYYY:[0,9999,new Date().getFullYear()],MM:[1,12],DD:[1,31],HH:[0,23],mm:[0,59],ss:[0,59],SSS:[0,999]};return e[n]}var gHt=["active","showActiveCls","suffixIcon","format","validateFormat","onChange","onInput","helped","onHelp","onSubmit","onKeyDown","preserveInvalidOnBlur","invalid","clearIcon"],Gfe=x.forwardRef(function(n,e){var t=n.active,i=n.showActiveCls,r=i===void 0?!0:i,s=n.suffixIcon,o=n.format,a=n.validateFormat,l=n.onChange;n.onInput;var c=n.helped,u=n.onHelp,d=n.onSubmit,f=n.onKeyDown,p=n.preserveInvalidOnBlur,g=p===void 0?!1:p,m=n.invalid,_=n.clearIcon,v=Na(n,gHt),b=n.value,y=n.onFocus,C=n.onBlur,S=n.onMouseUp,k=x.useContext(Kb),I=k.prefixCls,L=k.input,N=L===void 0?"input":L,P="".concat(I,"-input"),O=x.useState(!1),F=Mt(O,2),V=F[0],M=F[1],B=x.useState(b),W=Mt(B,2),q=W[0],U=W[1],G=x.useState(""),H=Mt(G,2),z=H[0],Z=H[1],X=x.useState(null),oe=Mt(X,2),fe=oe[0],Se=oe[1],Me=x.useState(null),Ie=Mt(Me,2),ge=Ie[0],ye=Ie[1],Pe=q||"";x.useEffect(function(){U(b)},[b]);var Be=x.useRef(),$e=x.useRef();x.useImperativeHandle(e,function(){return{nativeElement:Be.current,inputElement:$e.current,focus:function(se){$e.current.focus(se)},blur:function(){$e.current.blur()}}});var qe=x.useMemo(function(){return new fHt(o||"")},[o]),mt=x.useMemo(function(){return c?[0,0]:qe.getSelection(fe)},[qe,fe,c]),vt=Mt(mt,2),ft=vt[0],tt=vt[1],St=function(se){se&&se!==o&&se!==b&&u()},Ft=Ta(function(Rt){a(Rt)&&l(Rt),U(Rt),St(Rt)}),en=function(se){if(!o){var ke=se.target.value;St(ke),U(ke),l(ke)}},Ke=function(se){var ke=se.clipboardData.getData("text");a(ke)&&Ft(ke)},dt=x.useRef(!1),nt=function(){dt.current=!0},at=function(se){var ke=se.target,Ae=ke.selectionStart,je=qe.getMaskCellIndex(Ae);Se(je),ye({}),S==null||S(se),dt.current=!1},Oe=function(se){M(!0),Se(0),Z(""),y(se)},ce=function(se){C(se)},Ne=function(se){M(!1),ce(se)};_xe(t,function(){!t&&!g&&U(b)});var Xe=function(se){se.key==="Enter"&&a(Pe)&&d(),f==null||f(se)},it=function(se){Xe(se);var ke=se.key,Ae=null,je=null,Ve=tt-ft,Qt=o.slice(ft,tt),rt=function(Mi){Se(function(si){var oi=si+Mi;return oi=Math.max(oi,0),oi=Math.min(oi,qe.size()-1),oi})},Cn=function(Mi){var si=pHt(Qt),oi=Mt(si,3),_n=oi[0],de=oi[1],_e=oi[2],Le=Pe.slice(ft,tt),Ge=Number(Le);if(isNaN(Ge))return String(_e||(Mi>0?_n:de));var gt=Ge+Mi,pt=de-_n+1;return String(_n+(pt+gt-_n)%pt)};switch(ke){case"Backspace":case"Delete":Ae="",je=Qt;break;case"ArrowLeft":Ae="",rt(-1);break;case"ArrowRight":Ae="",rt(1);break;case"ArrowUp":Ae="",je=Cn(1);break;case"ArrowDown":Ae="",je=Cn(-1);break;default:isNaN(Number(ke))||(Ae=z+ke,je=Ae);break}if(Ae!==null&&(Z(Ae),Ae.length>=Ve&&(rt(1),Z(""))),je!==null){var Rn=Pe.slice(0,ft)+fxe(je,Ve)+Pe.slice(tt);Ft(Rn.slice(0,o.length))}ye({})},Tt=x.useRef();uc(function(){if(!(!V||!o||dt.current)){if(!qe.match(Pe)){Ft(o);return}return $e.current.setSelectionRange(ft,tt),Tt.current=Eh(function(){$e.current.setSelectionRange(ft,tt)}),function(){Eh.cancel(Tt.current)}}},[qe,o,V,Pe,fe,ft,tt,ge,Ft]);var Ct=o?{onFocus:Oe,onBlur:Ne,onKeyDown:it,onMouseDown:nt,onMouseUp:at,onPaste:Ke}:{};return x.createElement("div",{ref:Be,className:$t(P,wt(wt({},"".concat(P,"-active"),t&&r),"".concat(P,"-placeholder"),c))},x.createElement(N,hn({ref:$e,"aria-invalid":m,autoComplete:"off"},v,{onKeyDown:Xe,onBlur:ce},Ct,{value:Pe,onChange:en})),x.createElement(PJ,{type:"suffix",icon:s}),_)}),mHt=["id","prefix","clearIcon","suffixIcon","separator","activeIndex","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","value","onChange","onSubmit","onInputChange","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onActiveInfo","placement","onMouseDown","required","aria-required","autoFocus","tabIndex"],_Ht=["index"];function vHt(n,e){var t=n.id,i=n.prefix,r=n.clearIcon,s=n.suffixIcon,o=n.separator,a=o===void 0?"~":o,l=n.activeIndex;n.activeHelp,n.allHelp;var c=n.focused;n.onFocus,n.onBlur,n.onKeyDown,n.locale,n.generateConfig;var u=n.placeholder,d=n.className,f=n.style,p=n.onClick,g=n.onClear,m=n.value;n.onChange,n.onSubmit,n.onInputChange,n.format,n.maskFormat,n.preserveInvalidOnBlur,n.onInvalid;var _=n.disabled,v=n.invalid;n.inputReadOnly;var b=n.direction;n.onOpenChange;var y=n.onActiveInfo;n.placement;var C=n.onMouseDown;n.required,n["aria-required"];var S=n.autoFocus,k=n.tabIndex,I=Na(n,mHt),L=b==="rtl",N=x.useContext(Kb),P=N.prefixCls,O=x.useMemo(function(){if(typeof t=="string")return[t];var ge=t||{};return[ge.start,ge.end]},[t]),F=x.useRef(),V=x.useRef(),M=x.useRef(),B=function(ye){var Pe;return(Pe=[V,M][ye])===null||Pe===void 0?void 0:Pe.current};x.useImperativeHandle(e,function(){return{nativeElement:F.current,focus:function(ye){if(Mr(ye)==="object"){var Pe,Be=ye||{},$e=Be.index,qe=$e===void 0?0:$e,mt=Na(Be,_Ht);(Pe=B(qe))===null||Pe===void 0||Pe.focus(mt)}else{var vt;(vt=B(ye??0))===null||vt===void 0||vt.focus()}},blur:function(){var ye,Pe;(ye=B(0))===null||ye===void 0||ye.blur(),(Pe=B(1))===null||Pe===void 0||Pe.blur()}}});var W=uQe(I),q=x.useMemo(function(){return Array.isArray(u)?u:[u,u]},[u]),U=cQe(ut(ut({},n),{},{id:O,placeholder:q})),G=Mt(U,1),H=G[0],z=x.useState({position:"absolute",width:0}),Z=Mt(z,2),X=Z[0],oe=Z[1],fe=Ta(function(){var ge=B(l);if(ge){var ye=ge.nativeElement.getBoundingClientRect(),Pe=F.current.getBoundingClientRect(),Be=ye.left-Pe.left;oe(function($e){return ut(ut({},$e),{},{width:ye.width,left:Be})}),y([ye.left,ye.right,Pe.width])}});x.useEffect(function(){fe()},[l]);var Se=r&&(m[0]&&!_[0]||m[1]&&!_[1]),Me=S&&!_[0],Ie=S&&!Me&&!_[1];return x.createElement(bA,{onResize:fe},x.createElement("div",hn({},W,{className:$t(P,"".concat(P,"-range"),wt(wt(wt(wt({},"".concat(P,"-focused"),c),"".concat(P,"-disabled"),_.every(function(ge){return ge})),"".concat(P,"-invalid"),v.some(function(ge){return ge})),"".concat(P,"-rtl"),L),d),style:f,ref:F,onClick:p,onMouseDown:function(ye){var Pe=ye.target;Pe!==V.current.inputElement&&Pe!==M.current.inputElement&&ye.preventDefault(),C==null||C(ye)}}),i&&x.createElement("div",{className:"".concat(P,"-prefix")},i),x.createElement(Gfe,hn({ref:V},H(0),{autoFocus:Me,tabIndex:k,"date-range":"start"})),x.createElement("div",{className:"".concat(P,"-range-separator")},a),x.createElement(Gfe,hn({ref:M},H(1),{autoFocus:Ie,tabIndex:k,"date-range":"end"})),x.createElement("div",{className:"".concat(P,"-active-bar"),style:X}),x.createElement(PJ,{type:"suffix",icon:s}),Se&&x.createElement(Kfe,{icon:r,onClear:g})))}var bHt=x.forwardRef(vHt);function WPe(n,e){var t=n??e;return Array.isArray(t)?t:[t,t]}function rV(n){return n===1?"end":"start"}function yHt(n,e){var t=GYe(n,function(){var yi=n.disabled,vn=n.allowEmpty,Un=WPe(yi,!1),Mn=WPe(vn,!1);return{disabled:Un,allowEmpty:Mn}}),i=Mt(t,6),r=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],u=r.prefixCls,d=r.styles,f=r.classNames,p=r.defaultValue,g=r.value,m=r.needConfirm,_=r.onKeyDown,v=r.disabled,b=r.allowEmpty,y=r.disabledDate,C=r.minDate,S=r.maxDate,k=r.defaultOpen,I=r.open,L=r.onOpenChange,N=r.locale,P=r.generateConfig,O=r.picker,F=r.showNow,V=r.showToday,M=r.showTime,B=r.mode,W=r.onPanelChange,q=r.onCalendarChange,U=r.onOk,G=r.defaultPickerValue,H=r.pickerValue,z=r.onPickerValueChange,Z=r.inputReadOnly,X=r.suffixIcon,oe=r.onFocus,fe=r.onBlur,Se=r.presets,Me=r.ranges,Ie=r.components,ge=r.cellRender,ye=r.dateRender,Pe=r.monthCellRender,Be=r.onClick,$e=QYe(e),qe=YYe(I,k,v,L),mt=Mt(qe,2),vt=mt[0],ft=mt[1],tt=function(vn,Un){(v.some(function(Mn){return!Mn})||!vn)&&ft(vn,Un)},St=iQe(P,N,a,!0,!1,p,g,q,U),Ft=Mt(St,5),en=Ft[0],Ke=Ft[1],dt=Ft[2],nt=Ft[3],at=Ft[4],Oe=dt(),ce=ZYe(v,b,vt),Ne=Mt(ce,9),Xe=Ne[0],it=Ne[1],Tt=Ne[2],Ct=Ne[3],Rt=Ne[4],se=Ne[5],ke=Ne[6],Ae=Ne[7],je=Ne[8],Ve=function(vn,Un){it(!0),oe==null||oe(vn,{range:rV(Un??Ct)})},Qt=function(vn,Un){it(!1),fe==null||fe(vn,{range:rV(Un??Ct)})},rt=x.useMemo(function(){if(!M)return null;var yi=M.disabledTime,vn=yi?function(Un){var Mn=rV(Ct),fi=jYe(Oe,ke,Ct);return yi(Un,Mn,{from:fi})}:void 0;return ut(ut({},M),{},{disabledTime:vn})},[M,Ct,Oe,ke]),Cn=Dy([O,O],{value:B}),Rn=Mt(Cn,2),li=Rn[0],Mi=Rn[1],si=li[Ct]||O,oi=si==="date"&&rt?"datetime":si,_n=oi===O&&oi!=="time",de=sQe(O,si,F,V,!0),_e=rQe(r,en,Ke,dt,nt,v,a,Xe,vt,c),Le=Mt(_e,2),Ge=Le[0],gt=Le[1],pt=z$t(Oe,v,ke,P,N,y),Vt=BYe(Oe,c,b),Pn=Mt(Vt,2),Ln=Pn[0],bi=Pn[1],et=JYe(P,N,Oe,li,vt,Ct,s,_n,G,H,rt==null?void 0:rt.defaultOpenValue,z,C,S),Lt=Mt(et,2),qt=Lt[0],sn=Lt[1],ln=Ta(function(yi,vn,Un){var Mn=AF(li,Ct,vn);if((Mn[0]!==li[0]||Mn[1]!==li[1])&&Mi(Mn),W&&Un!==!1){var fi=_r(Oe);yi&&(fi[Ct]=yi),W(fi,Mn)}}),ti=function(vn,Un){return AF(Oe,Un,vn)},di=function(vn,Un){var Mn=Oe;vn&&(Mn=ti(vn,Ct)),Ae(Ct);var fi=se(Mn);nt(Mn),Ge(Ct,fi===null),fi===null?tt(!1,{force:!0}):Un||$e.current.focus({index:fi})},Dt=function(vn){var Un,Mn=vn.target.getRootNode();if(!$e.current.nativeElement.contains((Un=Mn.activeElement)!==null&&Un!==void 0?Un:document.activeElement)){var fi=v.findIndex(function(Wi){return!Wi});fi>=0&&$e.current.focus({index:fi})}tt(!0),Be==null||Be(vn)},le=function(){gt(null),tt(!1,{force:!0})},Qe=x.useState(null),ht=Mt(Qe,2),Bt=ht[0],An=ht[1],mn=x.useState(null),hi=Mt(mn,2),Di=hi[0],cr=hi[1],Li=x.useMemo(function(){return Di||Oe},[Oe,Di]);x.useEffect(function(){vt||cr(null)},[vt]);var Sr=x.useState([0,0,0]),rr=Mt(Sr,2),ws=rr[0],Er=rr[1],xa=XYe(Se,Me),No=function(vn){cr(vn),An("preset")},Do=function(vn){var Un=gt(vn);Un&&tt(!1,{force:!0})},Zs=function(vn){di(vn)},ua=function(vn){cr(vn?ti(vn,Ct):null),An("cell")},Os=function(vn){tt(!0),Ve(vn)},Co=function(){Tt("panel")},ul=function(vn){var Un=AF(Oe,Ct,vn);nt(Un),!m&&!o&&s===oi&&di(vn)},Qi=function(){tt(!1)},Ms=pxe(ge,ye,Pe,rV(Ct)),js=Oe[Ct]||null,Ro=Ta(function(yi){return c(yi,{activeIndex:Ct})}),Bi=x.useMemo(function(){var yi=ixe(r,!1),vn=rxe(r,[].concat(_r(Object.keys(yi)),["onChange","onCalendarChange","style","className","onPanelChange","disabledTime"]));return vn},[r]),Vi=x.createElement(lQe,hn({},Bi,{showNow:de,showTime:rt,range:!0,multiplePanel:_n,activeInfo:ws,disabledDate:pt,onFocus:Os,onBlur:Qt,onPanelMouseDown:Co,picker:O,mode:si,internalMode:oi,onPanelChange:ln,format:l,value:js,isInvalid:Ro,onChange:null,onSelect:ul,pickerValue:qt,defaultOpenValue:wA(M==null?void 0:M.defaultOpenValue)[Ct],onPickerValueChange:sn,hoverValue:Li,onHover:ua,needConfirm:m,onSubmit:di,onOk:at,presets:xa,onPresetHover:No,onPresetSubmit:Do,onNow:Zs,cellRender:Ms})),Br=function(vn,Un){var Mn=ti(vn,Un);nt(Mn)},Gr=function(){Tt("input")},xs=function(vn,Un){var Mn=ke.length,fi=ke[Mn-1];if(Mn&&fi!==Un&&m&&!b[fi]&&!je(fi)&&Oe[fi]){$e.current.focus({index:fi});return}Tt("input"),tt(!0,{inherit:!0}),Ct!==Un&&vt&&!m&&o&&di(null,!0),Rt(Un),Ve(vn,Un)},sr=function(vn,Un){if(tt(!1),!m&&Tt()==="input"){var Mn=se(Oe);Ge(Ct,Mn===null)}Qt(vn,Un)},Ns=function(vn,Un){vn.key==="Tab"&&di(null,!0),_==null||_(vn,Un)},uo=x.useMemo(function(){return{prefixCls:u,locale:N,generateConfig:P,button:Ie.button,input:Ie.input}},[u,N,P,Ie.button,Ie.input]);return uc(function(){vt&&Ct!==void 0&&ln(null,O,!1)},[vt,Ct,O]),uc(function(){var yi=Tt();!vt&&yi==="input"&&(tt(!1),di(null,!0)),!vt&&o&&!m&&yi==="panel"&&(tt(!0),di())},[vt]),x.createElement(Kb.Provider,{value:uo},x.createElement(OYe,hn({},FYe(r),{popupElement:Vi,popupStyle:d.popup,popupClassName:f.popup,visible:vt,onClose:Qi,range:!0}),x.createElement(bHt,hn({},r,{ref:$e,suffixIcon:X,activeIndex:Xe||vt?Ct:null,activeHelp:!!Di,allHelp:!!Di&&Bt==="preset",focused:Xe,onFocus:xs,onBlur:sr,onKeyDown:Ns,onSubmit:di,value:Li,maskFormat:l,onChange:Br,onInputChange:Gr,format:a,inputReadOnly:Z,disabled:v,open:vt,onOpenChange:tt,onClick:Dt,onClear:le,invalid:Ln,onInvalid:bi,onActiveInfo:Er}))))}var CHt=x.forwardRef(yHt);function wHt(n){var e=n.prefixCls,t=n.value,i=n.onRemove,r=n.removeIcon,s=r===void 0?"×":r,o=n.formatDate,a=n.disabled,l=n.maxTagCount,c=n.placeholder,u="".concat(e,"-selector"),d="".concat(e,"-selection"),f="".concat(d,"-overflow");function p(_,v){return x.createElement("span",{className:$t("".concat(d,"-item")),title:typeof _=="string"?_:null},x.createElement("span",{className:"".concat(d,"-item-content")},_),!a&&v&&x.createElement("span",{onMouseDown:function(y){y.preventDefault()},onClick:v,className:"".concat(d,"-item-remove")},s))}function g(_){var v=o(_),b=function(C){C&&C.stopPropagation(),i(_)};return p(v,b)}function m(_){var v="+ ".concat(_.length," ...");return p(v)}return x.createElement("div",{className:u},x.createElement(p9,{prefixCls:f,data:t,renderItem:g,renderRest:m,itemKey:function(v){return o(v)},maxCount:l}),!t.length&&x.createElement("span",{className:"".concat(e,"-selection-placeholder")},c))}var xHt=["id","open","prefix","clearIcon","suffixIcon","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","internalPicker","value","onChange","onSubmit","onInputChange","multiple","maxTagCount","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onMouseDown","required","aria-required","autoFocus","tabIndex","removeIcon"];function SHt(n,e){n.id;var t=n.open,i=n.prefix,r=n.clearIcon,s=n.suffixIcon;n.activeHelp,n.allHelp;var o=n.focused;n.onFocus,n.onBlur,n.onKeyDown;var a=n.locale,l=n.generateConfig,c=n.placeholder,u=n.className,d=n.style,f=n.onClick,p=n.onClear,g=n.internalPicker,m=n.value,_=n.onChange,v=n.onSubmit;n.onInputChange;var b=n.multiple,y=n.maxTagCount;n.format,n.maskFormat,n.preserveInvalidOnBlur,n.onInvalid;var C=n.disabled,S=n.invalid;n.inputReadOnly;var k=n.direction;n.onOpenChange;var I=n.onMouseDown;n.required,n["aria-required"];var L=n.autoFocus,N=n.tabIndex,P=n.removeIcon,O=Na(n,xHt),F=k==="rtl",V=x.useContext(Kb),M=V.prefixCls,B=x.useRef(),W=x.useRef();x.useImperativeHandle(e,function(){return{nativeElement:B.current,focus:function(Me){var Ie;(Ie=W.current)===null||Ie===void 0||Ie.focus(Me)},blur:function(){var Me;(Me=W.current)===null||Me===void 0||Me.blur()}}});var q=uQe(O),U=function(Me){_([Me])},G=function(Me){var Ie=m.filter(function(ge){return ge&&!af(l,a,ge,Me,g)});_(Ie),t||v()},H=cQe(ut(ut({},n),{},{onChange:U}),function(Se){var Me=Se.valueTexts;return{value:Me[0]||"",active:o}}),z=Mt(H,2),Z=z[0],X=z[1],oe=!!(r&&m.length&&!C),fe=b?x.createElement(x.Fragment,null,x.createElement(wHt,{prefixCls:M,value:m,onRemove:G,formatDate:X,maxTagCount:y,disabled:C,removeIcon:P,placeholder:c}),x.createElement("input",{className:"".concat(M,"-multiple-input"),value:m.map(X).join(","),ref:W,readOnly:!0,autoFocus:L,tabIndex:N}),x.createElement(PJ,{type:"suffix",icon:s}),oe&&x.createElement(Kfe,{icon:r,onClear:p})):x.createElement(Gfe,hn({ref:W},Z(),{autoFocus:L,tabIndex:N,suffixIcon:s,clearIcon:oe&&x.createElement(Kfe,{icon:r,onClear:p}),showActiveCls:!1}));return x.createElement("div",hn({},q,{className:$t(M,wt(wt(wt(wt(wt({},"".concat(M,"-multiple"),b),"".concat(M,"-focused"),o),"".concat(M,"-disabled"),C),"".concat(M,"-invalid"),S),"".concat(M,"-rtl"),F),u),style:d,ref:B,onClick:f,onMouseDown:function(Me){var Ie,ge=Me.target;ge!==((Ie=W.current)===null||Ie===void 0?void 0:Ie.inputElement)&&Me.preventDefault(),I==null||I(Me)}}),i&&x.createElement("div",{className:"".concat(M,"-prefix")},i),fe)}var EHt=x.forwardRef(SHt);function kHt(n,e){var t=GYe(n),i=Mt(t,6),r=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],u=r,d=u.prefixCls,f=u.styles,p=u.classNames,g=u.order,m=u.defaultValue,_=u.value,v=u.needConfirm,b=u.onChange,y=u.onKeyDown,C=u.disabled,S=u.disabledDate,k=u.minDate,I=u.maxDate,L=u.defaultOpen,N=u.open,P=u.onOpenChange,O=u.locale,F=u.generateConfig,V=u.picker,M=u.showNow,B=u.showToday,W=u.showTime,q=u.mode,U=u.onPanelChange,G=u.onCalendarChange,H=u.onOk,z=u.multiple,Z=u.defaultPickerValue,X=u.pickerValue,oe=u.onPickerValueChange,fe=u.inputReadOnly,Se=u.suffixIcon,Me=u.removeIcon,Ie=u.onFocus,ge=u.onBlur,ye=u.presets,Pe=u.components,Be=u.cellRender,$e=u.dateRender,qe=u.monthCellRender,mt=u.onClick,vt=QYe(e);function ft(Bi){return Bi===null?null:z?Bi:Bi[0]}var tt=oQe(F,O,s),St=YYe(N,L,[C],P),Ft=Mt(St,2),en=Ft[0],Ke=Ft[1],dt=function(Vi,Br,Gr){if(G){var xs=ut({},Gr);delete xs.range,G(ft(Vi),ft(Br),xs)}},nt=function(Vi){H==null||H(ft(Vi))},at=iQe(F,O,a,!1,g,m,_,dt,nt),Oe=Mt(at,5),ce=Oe[0],Ne=Oe[1],Xe=Oe[2],it=Oe[3],Tt=Oe[4],Ct=Xe(),Rt=ZYe([C]),se=Mt(Rt,4),ke=se[0],Ae=se[1],je=se[2],Ve=se[3],Qt=function(Vi){Ae(!0),Ie==null||Ie(Vi,{})},rt=function(Vi){Ae(!1),ge==null||ge(Vi,{})},Cn=Dy(V,{value:q}),Rn=Mt(Cn,2),li=Rn[0],Mi=Rn[1],si=li==="date"&&W?"datetime":li,oi=sQe(V,li,M,B),_n=b&&function(Bi,Vi){b(ft(Bi),ft(Vi))},de=rQe(ut(ut({},r),{},{onChange:_n}),ce,Ne,Xe,it,[],a,ke,en,c),_e=Mt(de,2),Le=_e[1],Ge=BYe(Ct,c),gt=Mt(Ge,2),pt=gt[0],Vt=gt[1],Pn=x.useMemo(function(){return pt.some(function(Bi){return Bi})},[pt]),Ln=function(Vi,Br){if(oe){var Gr=ut(ut({},Br),{},{mode:Br.mode[0]});delete Gr.range,oe(Vi[0],Gr)}},bi=JYe(F,O,Ct,[li],en,Ve,s,!1,Z,X,wA(W==null?void 0:W.defaultOpenValue),Ln,k,I),et=Mt(bi,2),Lt=et[0],qt=et[1],sn=Ta(function(Bi,Vi,Br){if(Mi(Vi),U&&Br!==!1){var Gr=Bi||Ct[Ct.length-1];U(Gr,Vi)}}),ln=function(){Le(Xe()),Ke(!1,{force:!0})},ti=function(Vi){!C&&!vt.current.nativeElement.contains(document.activeElement)&&vt.current.focus(),Ke(!0),mt==null||mt(Vi)},di=function(){Le(null),Ke(!1,{force:!0})},Dt=x.useState(null),le=Mt(Dt,2),Qe=le[0],ht=le[1],Bt=x.useState(null),An=Mt(Bt,2),mn=An[0],hi=An[1],Di=x.useMemo(function(){var Bi=[mn].concat(_r(Ct)).filter(function(Vi){return Vi});return z?Bi:Bi.slice(0,1)},[Ct,mn,z]),cr=x.useMemo(function(){return!z&&mn?[mn]:Ct.filter(function(Bi){return Bi})},[Ct,mn,z]);x.useEffect(function(){en||hi(null)},[en]);var Li=XYe(ye),Sr=function(Vi){hi(Vi),ht("preset")},rr=function(Vi){var Br=z?tt(Xe(),Vi):[Vi],Gr=Le(Br);Gr&&!z&&Ke(!1,{force:!0})},ws=function(Vi){rr(Vi)},Er=function(Vi){hi(Vi),ht("cell")},xa=function(Vi){Ke(!0),Qt(Vi)},No=function(Vi){if(je("panel"),!(z&&si!==V)){var Br=z?tt(Xe(),Vi):[Vi];it(Br),!v&&!o&&s===si&&ln()}},Do=function(){Ke(!1)},Zs=pxe(Be,$e,qe),ua=x.useMemo(function(){var Bi=ixe(r,!1),Vi=rxe(r,[].concat(_r(Object.keys(Bi)),["onChange","onCalendarChange","style","className","onPanelChange"]));return ut(ut({},Vi),{},{multiple:r.multiple})},[r]),Os=x.createElement(lQe,hn({},ua,{showNow:oi,showTime:W,disabledDate:S,onFocus:xa,onBlur:rt,picker:V,mode:li,internalMode:si,onPanelChange:sn,format:l,value:Ct,isInvalid:c,onChange:null,onSelect:No,pickerValue:Lt,defaultOpenValue:W==null?void 0:W.defaultOpenValue,onPickerValueChange:qt,hoverValue:Di,onHover:Er,needConfirm:v,onSubmit:ln,onOk:Tt,presets:Li,onPresetHover:Sr,onPresetSubmit:rr,onNow:ws,cellRender:Zs})),Co=function(Vi){it(Vi)},ul=function(){je("input")},Qi=function(Vi){je("input"),Ke(!0,{inherit:!0}),Qt(Vi)},Ms=function(Vi){Ke(!1),rt(Vi)},js=function(Vi,Br){Vi.key==="Tab"&&ln(),y==null||y(Vi,Br)},Ro=x.useMemo(function(){return{prefixCls:d,locale:O,generateConfig:F,button:Pe.button,input:Pe.input}},[d,O,F,Pe.button,Pe.input]);return uc(function(){en&&Ve!==void 0&&sn(null,V,!1)},[en,Ve,V]),uc(function(){var Bi=je();!en&&Bi==="input"&&(Ke(!1),ln()),!en&&o&&!v&&Bi==="panel"&&ln()},[en]),x.createElement(Kb.Provider,{value:Ro},x.createElement(OYe,hn({},FYe(r),{popupElement:Os,popupStyle:f.popup,popupClassName:p.popup,visible:en,onClose:Do}),x.createElement(EHt,hn({},r,{ref:vt,suffixIcon:Se,removeIcon:Me,activeHelp:!!mn,allHelp:!!mn&&Qe==="preset",focused:ke,onFocus:Qi,onBlur:Ms,onKeyDown:js,onSubmit:ln,value:cr,maskFormat:l,onChange:Co,onInputChange:ul,internalPicker:s,format:a,inputReadOnly:fe,disabled:C,open:en,onOpenChange:Ke,onClick:ti,onClear:di,invalid:Pn,onInvalid:function(Vi){Vt(Vi,0)}}))))}var THt=x.forwardRef(kHt);function bxe(n){return gg(n,{inputAffixPadding:n.paddingXXS})}const yxe=n=>{const{controlHeight:e,fontSize:t,lineHeight:i,lineWidth:r,controlHeightSM:s,controlHeightLG:o,fontSizeLG:a,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:g,controlOutlineWidth:m,controlOutline:_,colorErrorOutline:v,colorWarningOutline:b,colorBgContainer:y,inputFontSize:C,inputFontSizeLG:S,inputFontSizeSM:k}=n,I=C||t,L=k||I,N=S||a,P=Math.round((e-I*i)/2*10)/10-r,O=Math.round((s-L*i)/2*10)/10-r,F=Math.ceil((o-N*l)/2*10)/10-r;return{paddingBlock:Math.max(P,0),paddingBlockSM:Math.max(O,0),paddingBlockLG:Math.max(F,0),paddingInline:c-r,paddingInlineSM:u-r,paddingInlineLG:d-r,addonBg:f,activeBorderColor:g,hoverBorderColor:p,activeShadow:`0 0 0 ${m}px ${_}`,errorActiveShadow:`0 0 0 ${m}px ${v}`,warningActiveShadow:`0 0 0 ${m}px ${b}`,hoverBg:y,activeBg:y,inputFontSize:I,inputFontSizeLG:N,inputFontSizeSM:L}},IHt=n=>({borderColor:n.hoverBorderColor,backgroundColor:n.hoverBg}),Cxe=n=>({color:n.colorTextDisabled,backgroundColor:n.colorBgContainerDisabled,borderColor:n.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},IHt(gg(n,{hoverBorderColor:n.colorBorder,hoverBg:n.colorBgContainerDisabled})))}),dQe=(n,e)=>({background:n.colorBgContainer,borderWidth:n.lineWidth,borderStyle:n.lineType,borderColor:e.borderColor,"&:hover":{borderColor:e.hoverBorderColor,backgroundColor:n.hoverBg},"&:focus, &:focus-within":{borderColor:e.activeBorderColor,boxShadow:e.activeShadow,outline:0,backgroundColor:n.activeBg}}),zPe=(n,e)=>({[`&${n.componentCls}-status-${e.status}:not(${n.componentCls}-disabled)`]:Object.assign(Object.assign({},dQe(n,e)),{[`${n.componentCls}-prefix, ${n.componentCls}-suffix`]:{color:e.affixColor}}),[`&${n.componentCls}-status-${e.status}${n.componentCls}-disabled`]:{borderColor:e.borderColor}}),hQe=(n,e)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dQe(n,{borderColor:n.colorBorder,hoverBorderColor:n.hoverBorderColor,activeBorderColor:n.activeBorderColor,activeShadow:n.activeShadow})),{[`&${n.componentCls}-disabled, &[disabled]`]:Object.assign({},Cxe(n))}),zPe(n,{status:"error",borderColor:n.colorError,hoverBorderColor:n.colorErrorBorderHover,activeBorderColor:n.colorError,activeShadow:n.errorActiveShadow,affixColor:n.colorError})),zPe(n,{status:"warning",borderColor:n.colorWarning,hoverBorderColor:n.colorWarningBorderHover,activeBorderColor:n.colorWarning,activeShadow:n.warningActiveShadow,affixColor:n.colorWarning})),e)}),UPe=(n,e)=>({[`&${n.componentCls}-group-wrapper-status-${e.status}`]:{[`${n.componentCls}-group-addon`]:{borderColor:e.addonBorderColor,color:e.addonColor}}}),LHt=n=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${n.componentCls}-group`]:{"&-addon":{background:n.addonBg,border:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},UPe(n,{status:"error",addonBorderColor:n.colorError,addonColor:n.colorErrorText})),UPe(n,{status:"warning",addonBorderColor:n.colorWarning,addonColor:n.colorWarningText})),{[`&${n.componentCls}-group-wrapper-disabled`]:{[`${n.componentCls}-group-addon`]:Object.assign({},Cxe(n))}})}),fQe=(n,e)=>{const{componentCls:t}=n;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${t}-disabled, &[disabled]`]:{color:n.colorTextDisabled,cursor:"not-allowed"},[`&${t}-status-error`]:{"&, & input, & textarea":{color:n.colorError}},[`&${t}-status-warning`]:{"&, & input, & textarea":{color:n.colorWarning}}},e)}},pQe=(n,e)=>({background:e.bg,borderWidth:n.lineWidth,borderStyle:n.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:e==null?void 0:e.inputColor},"&:hover":{background:e.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:e.activeBorderColor,backgroundColor:n.activeBg}}),qPe=(n,e)=>({[`&${n.componentCls}-status-${e.status}:not(${n.componentCls}-disabled)`]:Object.assign(Object.assign({},pQe(n,e)),{[`${n.componentCls}-prefix, ${n.componentCls}-suffix`]:{color:e.affixColor}})}),gQe=(n,e)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},pQe(n,{bg:n.colorFillTertiary,hoverBg:n.colorFillSecondary,activeBorderColor:n.activeBorderColor})),{[`&${n.componentCls}-disabled, &[disabled]`]:Object.assign({},Cxe(n))}),qPe(n,{status:"error",bg:n.colorErrorBg,hoverBg:n.colorErrorBgHover,activeBorderColor:n.colorError,inputColor:n.colorErrorText,affixColor:n.colorError})),qPe(n,{status:"warning",bg:n.colorWarningBg,hoverBg:n.colorWarningBgHover,activeBorderColor:n.colorWarning,inputColor:n.colorWarningText,affixColor:n.colorWarning})),e)}),KPe=(n,e)=>({[`&${n.componentCls}-group-wrapper-status-${e.status}`]:{[`${n.componentCls}-group-addon`]:{background:e.addonBg,color:e.addonColor}}}),AHt=n=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${n.componentCls}-group`]:{"&-addon":{background:n.colorFillTertiary},[`${n.componentCls}-filled:not(:focus):not(:focus-within)`]:{"&:not(:first-child)":{borderInlineStart:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorSplit}`},"&:not(:last-child)":{borderInlineEnd:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorSplit}`}}}},KPe(n,{status:"error",addonBg:n.colorErrorBg,addonColor:n.colorErrorText})),KPe(n,{status:"warning",addonBg:n.colorWarningBg,addonColor:n.colorWarningText})),{[`&${n.componentCls}-group-wrapper-disabled`]:{[`${n.componentCls}-group`]:{"&-addon":{background:n.colorFillTertiary,color:n.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorBorder}`,borderTop:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorBorder}`,borderBottom:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorBorder}`,borderTop:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorBorder}`,borderBottom:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorBorder}`}}}})}),mQe=(n,e)=>({background:n.colorBgContainer,borderWidth:`${Fi(n.lineWidth)} 0`,borderStyle:`${n.lineType} none`,borderColor:`transparent transparent ${e.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${e.borderColor} transparent`,backgroundColor:n.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${e.borderColor} transparent`,outline:0,backgroundColor:n.activeBg}}),GPe=(n,e)=>({[`&${n.componentCls}-status-${e.status}:not(${n.componentCls}-disabled)`]:Object.assign(Object.assign({},mQe(n,e)),{[`${n.componentCls}-prefix, ${n.componentCls}-suffix`]:{color:e.affixColor}}),[`&${n.componentCls}-status-${e.status}${n.componentCls}-disabled`]:{borderColor:`transparent transparent ${e.borderColor} transparent`}}),_Qe=(n,e)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},mQe(n,{borderColor:n.colorBorder,hoverBorderColor:n.hoverBorderColor,activeBorderColor:n.activeBorderColor,activeShadow:n.activeShadow})),{[`&${n.componentCls}-disabled, &[disabled]`]:{color:n.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${n.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),GPe(n,{status:"error",borderColor:n.colorError,hoverBorderColor:n.colorErrorBorderHover,activeBorderColor:n.colorError,activeShadow:n.errorActiveShadow,affixColor:n.colorError})),GPe(n,{status:"warning",borderColor:n.colorWarning,hoverBorderColor:n.colorWarningBorderHover,activeBorderColor:n.colorWarning,activeShadow:n.warningActiveShadow,affixColor:n.colorWarning})),e)}),vQe=n=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:n,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),bQe=n=>{const{paddingBlockLG:e,lineHeightLG:t,borderRadiusLG:i,paddingInlineLG:r}=n;return{padding:`${Fi(e)} ${Fi(r)}`,fontSize:n.inputFontSizeLG,lineHeight:t,borderRadius:i}},yQe=n=>({padding:`${Fi(n.paddingBlockSM)} ${Fi(n.paddingInlineSM)}`,fontSize:n.inputFontSizeSM,borderRadius:n.borderRadiusSM}),CQe=n=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Fi(n.paddingBlock)} ${Fi(n.paddingInline)}`,color:n.colorText,fontSize:n.inputFontSize,lineHeight:n.lineHeight,borderRadius:n.borderRadius,transition:`all ${n.motionDurationMid}`},vQe(n.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:n.controlHeight,lineHeight:n.lineHeight,verticalAlign:"bottom",transition:`all ${n.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},bQe(n)),"&-sm":Object.assign({},yQe(n)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),NHt=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({},bQe(n)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},yQe(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 ${Fi(n.paddingInline)}`,color:n.colorText,fontWeight:"normal",fontSize:n.inputFontSize,textAlign:"center",borderRadius:n.borderRadius,transition:`all ${n.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`${Fi(n.calc(n.paddingBlock).add(1).mul(-1).equal())} ${Fi(n.calc(n.paddingInline).mul(-1).equal())}`,[`&${t}-select-single:not(${t}-select-customize-input):not(${t}-pagination-size-changer)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${Fi(n.lineWidth)} ${n.lineType} transparent`,boxShadow:"none"}}},[`${t}-cascader-picker`]:{margin:`-9px ${Fi(n.calc(n.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[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"},k6t()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:n.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[` & > ${e}-affix-wrapper, & > ${e}-number-affix-wrapper, & > ${t}-picker-range `]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:n.calc(n.lineWidth).mul(-1).equal(),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, &: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.calc(n.lineWidth).mul(-1).equal(),[`${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}}}})}},DHt=n=>{const{componentCls:e,controlHeightSM:t,lineWidth:i,calc:r}=n,o=r(t).sub(r(i).mul(2)).sub(16).div(2).equal();return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},k8(n)),CQe(n)),hQe(n)),gQe(n)),fQe(n)),_Qe(n)),{'&[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"}})}},RHt=n=>{const{componentCls:e}=n;return{[`${e}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:n.colorTextQuaternary,fontSize:n.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${n.motionDurationSlow}`,border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:n.colorTextTertiary},"&:active":{color:n.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Fi(n.inputAffixPadding)}`}}}},PHt=n=>{const{componentCls:e,inputAffixPadding:t,colorTextDescription:i,motionDurationSlow:r,colorIcon:s,colorIconHover:o,iconCls:a}=n,l=`${e}-affix-wrapper`,c=`${e}-affix-wrapper-disabled`;return{[l]:Object.assign(Object.assign(Object.assign(Object.assign({},CQe(n)),{display:"inline-flex",[`&:not(${e}-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${e}`]:{padding:0},[`> input${e}, > textarea${e}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-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}}}),RHt(n)),{[`${a}${e}-password-icon`]:{color:s,cursor:"pointer",transition:`all ${r}`,"&:hover":{color:o}}}),[`${e}-underlined`]:{borderRadius:0},[c]:{[`${a}${e}-password-icon`]:{color:s,cursor:"not-allowed","&:hover":{color:s}}}}},OHt=n=>{const{componentCls:e,borderRadiusLG:t,borderRadiusSM:i}=n;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},k8(n)),NHt(n)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:t,fontSize:n.inputFontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:i}}},LHt(n)),AHt(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}},[`&:not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-item`]:{[`${e}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},MHt=n=>{const{componentCls:e,antCls:t}=n,i=`${e}-search`;return{[i]:{[e]:{"&:hover, &:focus":{[`+ ${e}-group-addon ${i}-button:not(${t}-btn-primary)`]:{borderInlineStartColor:n.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{height:n.controlHeight,borderRadius:0},[`${e}-lg`]:{lineHeight:n.calc(n.lineHeightLG).sub(2e-4).equal()},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${i}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,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":{[`${e}-affix-wrapper, ${i}-button`]:{height:n.controlHeightLG}},"&-small":{[`${e}-affix-wrapper, ${i}-button`]:{height:n.controlHeightSM}},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:n.calc(n.lineWidth).mul(-1).equal(),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}}}}},jHt=n=>{const{componentCls:e}=n;return{[`${e}-out-of-range`]:{[`&, & input, & textarea, ${e}-show-count-suffix, ${e}-data-count`]:{color:n.colorError}}}};c9(["Input","Shared"],n=>{const e=gg(n,bxe(n));return[DHt(e),PHt(e)]},yxe,{resetFont:!1});c9(["Input","Component"],n=>{const e=gg(n,bxe(n));return[OHt(e),MHt(e),jHt(e),cxe(e)]},yxe,{resetFont:!1});const lse=(n,e)=>{const{componentCls:t,controlHeight:i}=n,r=e?`${t}-${e}`:"",s=U9t(n);return[{[`${t}-multiple${r}`]:{paddingBlock:s.containerPadding,paddingInlineStart:s.basePadding,minHeight:i,[`${t}-selection-item`]:{height:s.itemHeight,lineHeight:Fi(s.itemLineHeight)}}}]},FHt=n=>{const{componentCls:e,calc:t,lineWidth:i}=n,r=gg(n,{fontHeight:n.fontSize,selectHeight:n.controlHeightSM,multipleSelectItemHeight:n.multipleItemHeightSM,borderRadius:n.borderRadiusSM,borderRadiusSM:n.borderRadiusXS,controlHeight:n.controlHeightSM}),s=gg(n,{fontHeight:t(n.multipleItemHeightLG).sub(t(i).mul(2).equal()).equal(),fontSize:n.fontSizeLG,selectHeight:n.controlHeightLG,multipleSelectItemHeight:n.multipleItemHeightLG,borderRadius:n.borderRadiusLG,borderRadiusSM:n.borderRadius,controlHeight:n.controlHeightLG});return[lse(r,"small"),lse(n),lse(s,"large"),{[`${e}${e}-multiple`]:Object.assign(Object.assign({width:"100%",cursor:"text",[`${e}-selector`]:{flex:"auto",padding:0,position:"relative","&:after":{margin:0},[`${e}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:n.inputPaddingHorizontalBase,insetInlineEnd:0,transform:"translateY(-50%)",transition:`all ${n.motionDurationSlow}`,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,color:n.colorTextPlaceholder,pointerEvents:"none"}}},q9t(n)),{[`${e}-multiple-input`]:{width:0,height:0,border:0,visibility:"hidden",position:"absolute",zIndex:-1}})}]},BHt=n=>{const{pickerCellCls:e,pickerCellInnerCls:t,cellHeight:i,borderRadiusSM:r,motionDurationMid:s,cellHoverBg:o,lineWidth:a,lineType:l,colorPrimary:c,cellActiveWithRangeBg:u,colorTextLightSolid:d,colorTextDisabled:f,cellBgDisabled:p,colorFillSecondary:g}=n;return{"&::before":{position:"absolute",top:"50%",insetInlineStart:0,insetInlineEnd:0,zIndex:1,height:i,transform:"translateY(-50%)",content:'""',pointerEvents:"none"},[t]:{position:"relative",zIndex:2,display:"inline-block",minWidth:i,height:i,lineHeight:Fi(i),borderRadius:r,transition:`background ${s}`},[`&:hover:not(${e}-in-view):not(${e}-disabled), &:hover:not(${e}-selected):not(${e}-range-start):not(${e}-range-end):not(${e}-disabled)`]:{[t]:{background:o}},[`&-in-view${e}-today ${t}`]:{"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:1,border:`${Fi(a)} ${l} ${c}`,borderRadius:r,content:'""'}},[`&-in-view${e}-in-range, &-in-view${e}-range-start, &-in-view${e}-range-end`]:{position:"relative",[`&:not(${e}-disabled):before`]:{background:u}},[`&-in-view${e}-selected, &-in-view${e}-range-start, &-in-view${e}-range-end`]:{[`&:not(${e}-disabled) ${t}`]:{color:d,background:c},[`&${e}-disabled ${t}`]:{background:g}},[`&-in-view${e}-range-start:not(${e}-disabled):before`]:{insetInlineStart:"50%"},[`&-in-view${e}-range-end:not(${e}-disabled):before`]:{insetInlineEnd:"50%"},[`&-in-view${e}-range-start:not(${e}-range-end) ${t}`]:{borderStartStartRadius:r,borderEndStartRadius:r,borderStartEndRadius:0,borderEndEndRadius:0},[`&-in-view${e}-range-end:not(${e}-range-start) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:r,borderEndEndRadius:r},"&-disabled":{color:f,cursor:"not-allowed",[t]:{background:"transparent"},"&::before":{background:p}},[`&-disabled${e}-today ${t}::before`]:{borderColor:f}}},$Ht=n=>{const{componentCls:e,pickerCellCls:t,pickerCellInnerCls:i,pickerYearMonthCellWidth:r,pickerControlIconSize:s,cellWidth:o,paddingSM:a,paddingXS:l,paddingXXS:c,colorBgContainer:u,lineWidth:d,lineType:f,borderRadiusLG:p,colorPrimary:g,colorTextHeading:m,colorSplit:_,pickerControlIconBorderWidth:v,colorIcon:b,textHeight:y,motionDurationMid:C,colorIconHover:S,fontWeightStrong:k,cellHeight:I,pickerCellPaddingVertical:L,colorTextDisabled:N,colorText:P,fontSize:O,motionDurationSlow:F,withoutTimeCellHeight:V,pickerQuarterPanelContentHeight:M,borderRadiusSM:B,colorTextLightSolid:W,cellHoverBg:q,timeColumnHeight:U,timeColumnWidth:G,timeCellHeight:H,controlItemBgActive:z,marginXXS:Z,pickerDatePanelPaddingHorizontal:X,pickerControlIconMargin:oe}=n,fe=n.calc(o).mul(7).add(n.calc(X).mul(2)).equal();return{[e]:{"&-panel":{display:"inline-flex",flexDirection:"column",textAlign:"center",background:u,borderRadius:p,outline:"none","&-focused":{borderColor:g},"&-rtl":{[`${e}-prev-icon, ${e}-super-prev-icon`]:{transform:"rotate(45deg)"},[`${e}-next-icon, ${e}-super-next-icon`]:{transform:"rotate(-135deg)"},[`${e}-time-panel`]:{[`${e}-content`]:{direction:"ltr","> *":{direction:"rtl"}}}}},"&-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:fe},"&-header":{display:"flex",padding:`0 ${Fi(l)}`,color:m,borderBottom:`${Fi(d)} ${f} ${_}`,"> *":{flex:"none"},button:{padding:0,color:b,lineHeight:Fi(y),background:"transparent",border:0,cursor:"pointer",transition:`color ${C}`,fontSize:"inherit",display:"inline-flex",alignItems:"center",justifyContent:"center","&:empty":{display:"none"}},"> button":{minWidth:"1.6em",fontSize:O,"&:hover":{color:S},"&:disabled":{opacity:.25,pointerEvents:"none"}},"&-view":{flex:"auto",fontWeight:k,lineHeight:Fi(y),"> 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",width:s,height:s,"&::before":{position:"absolute",top:0,insetInlineStart:0,width:s,height:s,border:"0 solid currentcolor",borderBlockWidth:`${Fi(v)} 0`,borderInlineWidth:`${Fi(v)} 0`,content:'""'}},"&-super-prev-icon,\n &-super-next-icon":{"&::after":{position:"absolute",top:oe,insetInlineStart:oe,display:"inline-block",width:s,height:s,border:"0 solid currentcolor",borderBlockWidth:`${Fi(v)} 0`,borderInlineWidth:`${Fi(v)} 0`,content:'""'}},"&-prev-icon, &-super-prev-icon":{transform:"rotate(-45deg)"},"&-next-icon, &-super-next-icon":{transform:"rotate(135deg)"},"&-content":{width:"100%",tableLayout:"fixed",borderCollapse:"collapse","th, td":{position:"relative",minWidth:I,fontWeight:"normal"},th:{height:n.calc(I).add(n.calc(L).mul(2)).equal(),color:P,verticalAlign:"middle"}},"&-cell":Object.assign({padding:`${Fi(L)} 0`,color:N,cursor:"pointer","&-in-view":{color:P}},BHt(n)),"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${e}-content`]:{height:n.calc(V).mul(4).equal()},[i]:{padding:`0 ${Fi(l)}`}},"&-quarter-panel":{[`${e}-content`]:{height:M}},"&-decade-panel":{[i]:{padding:`0 ${Fi(n.calc(l).div(2).equal())}`},[`${e}-cell::before`]:{display:"none"}},"&-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${e}-body`]:{padding:`0 ${Fi(l)}`},[i]:{width:r}},"&-date-panel":{[`${e}-body`]:{padding:`${Fi(l)} ${Fi(X)}`},[`${e}-content th`]:{boxSizing:"border-box",padding:0}},"&-week-panel":{[`${e}-cell`]:{[`&:hover ${i}, &-selected ${i}, ${i}`]:{background:"transparent !important"}},"&-row":{td:{"&:before":{transition:`background ${C}`},"&:first-child:before":{borderStartStartRadius:B,borderEndStartRadius:B},"&:last-child:before":{borderStartEndRadius:B,borderEndEndRadius:B}},"&:hover td:before":{background:q},"&-range-start td, &-range-end td, &-selected td, &-hover td":{[`&${t}`]:{"&:before":{background:g},[`&${e}-cell-week`]:{color:new Ol(W).setA(.5).toHexString()},[i]:{color:W}}},"&-range-hover td:before":{background:z}}},"&-week-panel, &-date-panel-show-week":{[`${e}-body`]:{padding:`${Fi(l)} ${Fi(a)}`},[`${e}-content th`]:{width:"auto"}},"&-datetime-panel":{display:"flex",[`${e}-time-panel`]:{borderInlineStart:`${Fi(d)} ${f} ${_}`},[`${e}-date-panel, ${e}-time-panel`]:{transition:`opacity ${F}`},"&-active":{[`${e}-date-panel, ${e}-time-panel`]:{opacity:.3,"&-active":{opacity:1}}}},"&-time-panel":{width:"auto",minWidth:"auto",[`${e}-content`]:{display:"flex",flex:"auto",height:U},"&-column":{flex:"1 0 auto",width:G,margin:`${Fi(c)} 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:n.borderRadiusSM},"&":{scrollbarWidth:"thin",scrollbarColor:`${n.colorTextTertiary} transparent`},"&::after":{display:"block",height:`calc(100% - ${Fi(H)})`,content:'""'},"&:not(:first-child)":{borderInlineStart:`${Fi(d)} ${f} ${_}`},"&-active":{background:new Ol(z).setA(.2).toHexString()},"&:hover":{overflowY:"auto"},"> li":{margin:0,padding:0,[`&${e}-time-panel-cell`]:{marginInline:Z,[`${e}-time-panel-cell-inner`]:{display:"block",width:n.calc(G).sub(n.calc(Z).mul(2)).equal(),height:H,margin:0,paddingBlock:0,paddingInlineEnd:0,paddingInlineStart:n.calc(G).sub(H).div(2).equal(),color:P,lineHeight:Fi(H),borderRadius:B,cursor:"pointer",transition:`background ${C}`,"&:hover":{background:q}},"&-selected":{[`${e}-time-panel-cell-inner`]:{background:z}},"&-disabled":{[`${e}-time-panel-cell-inner`]:{color:N,background:"transparent",cursor:"not-allowed"}}}}}}}}},HHt=n=>{const{componentCls:e,textHeight:t,lineWidth:i,paddingSM:r,antCls:s,colorPrimary:o,cellActiveWithRangeBg:a,colorPrimaryBorder:l,lineType:c,colorSplit:u}=n;return{[`${e}-dropdown`]:{[`${e}-footer`]:{borderTop:`${Fi(i)} ${c} ${u}`,"&-extra":{padding:`0 ${Fi(r)}`,lineHeight:Fi(n.calc(t).sub(n.calc(i).mul(2)).equal()),textAlign:"start","&:not(:last-child)":{borderBottom:`${Fi(i)} ${c} ${u}`}}},[`${e}-panels + ${e}-footer ${e}-ranges`]:{justifyContent:"space-between"},[`${e}-ranges`]:{marginBlock:0,paddingInline:Fi(r),overflow:"hidden",textAlign:"start",listStyle:"none",display:"flex",justifyContent:"center",alignItems:"center","> li":{lineHeight:Fi(n.calc(t).sub(n.calc(i).mul(2)).equal()),display:"inline-block"},[`${e}-now-btn-disabled`]:{pointerEvents:"none",color:n.colorTextDisabled},[`${e}-preset > ${s}-tag-blue`]:{color:o,background:a,borderColor:l,cursor:"pointer"},[`${e}-ok`]:{paddingBlock:n.calc(i).mul(2).equal(),marginInlineStart:"auto"}}}}},VHt=n=>{const{componentCls:e,controlHeightLG:t,paddingXXS:i,padding:r}=n;return{pickerCellCls:`${e}-cell`,pickerCellInnerCls:`${e}-cell-inner`,pickerYearMonthCellWidth:n.calc(t).mul(1.5).equal(),pickerQuarterPanelContentHeight:n.calc(t).mul(1.4).equal(),pickerCellPaddingVertical:n.calc(i).add(n.calc(i).div(2)).equal(),pickerCellBorderGap:2,pickerControlIconSize:7,pickerControlIconMargin:4,pickerControlIconBorderWidth:1.5,pickerDatePanelPaddingHorizontal:n.calc(r).add(n.calc(i).div(2)).equal()}},WHt=n=>{const{colorBgContainerDisabled:e,controlHeight:t,controlHeightSM:i,controlHeightLG:r,paddingXXS:s,lineWidth:o}=n,a=s*2,l=o*2,c=Math.min(t-a,t-l),u=Math.min(i-a,i-l),d=Math.min(r-a,r-l);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(s/2),cellHoverBg:n.controlItemBgHover,cellActiveWithRangeBg:n.controlItemBgActive,cellHoverWithRangeBg:new Ol(n.colorPrimary).lighten(35).toHexString(),cellRangeBorderColor:new Ol(n.colorPrimary).lighten(20).toHexString(),cellBgDisabled:e,timeColumnWidth:r*1.4,timeColumnHeight:28*8,timeCellHeight:28,cellWidth:i*1.5,cellHeight:i,textHeight:r,withoutTimeCellHeight:r*1.65,multipleItemBg:n.colorFillSecondary,multipleItemBorderColor:"transparent",multipleItemHeight:c,multipleItemHeightSM:u,multipleItemHeightLG:d,multipleSelectorBgDisabled:e,multipleItemColorDisabled:n.colorTextDisabled,multipleItemBorderColorDisabled:"transparent"}},zHt=n=>Object.assign(Object.assign(Object.assign(Object.assign({},yxe(n)),WHt(n)),i$t(n)),{presetsWidth:120,presetsMaxWidth:200,zIndexPopup:n.zIndexPopupBase+50}),UHt=n=>{const{componentCls:e}=n;return{[e]:[Object.assign(Object.assign(Object.assign(Object.assign({},hQe(n)),_Qe(n)),gQe(n)),fQe(n)),{"&-outlined":{[`&${e}-multiple ${e}-selection-item`]:{background:n.multipleItemBg,border:`${Fi(n.lineWidth)} ${n.lineType} ${n.multipleItemBorderColor}`}},"&-filled":{[`&${e}-multiple ${e}-selection-item`]:{background:n.colorBgContainer,border:`${Fi(n.lineWidth)} ${n.lineType} ${n.colorSplit}`}},"&-borderless":{[`&${e}-multiple ${e}-selection-item`]:{background:n.multipleItemBg,border:`${Fi(n.lineWidth)} ${n.lineType} ${n.multipleItemBorderColor}`}},"&-underlined":{[`&${e}-multiple ${e}-selection-item`]:{background:n.multipleItemBg,border:`${Fi(n.lineWidth)} ${n.lineType} ${n.multipleItemBorderColor}`}}}]}},cse=(n,e,t,i)=>{const r=n.calc(t).add(2).equal(),s=n.max(n.calc(e).sub(r).div(2).equal(),0),o=n.max(n.calc(e).sub(r).sub(s).equal(),0);return{padding:`${Fi(s)} ${Fi(i)} ${Fi(o)}`}},qHt=n=>{const{componentCls:e,colorError:t,colorWarning:i}=n;return{[`${e}:not(${e}-disabled):not([disabled])`]:{[`&${e}-status-error`]:{[`${e}-active-bar`]:{background:t}},[`&${e}-status-warning`]:{[`${e}-active-bar`]:{background:i}}}}},KHt=n=>{const{componentCls:e,antCls:t,controlHeight:i,paddingInline:r,lineWidth:s,lineType:o,colorBorder:a,borderRadius:l,motionDurationMid:c,colorTextDisabled:u,colorTextPlaceholder:d,controlHeightLG:f,fontSizeLG:p,controlHeightSM:g,paddingInlineSM:m,paddingXS:_,marginXS:v,colorTextDescription:b,lineWidthBold:y,colorPrimary:C,motionDurationSlow:S,zIndexPopup:k,paddingXXS:I,sizePopupArrow:L,colorBgElevated:N,borderRadiusLG:P,boxShadowSecondary:O,borderRadiusSM:F,colorSplit:V,cellHoverBg:M,presetsWidth:B,presetsMaxWidth:W,boxShadowPopoverArrow:q,fontHeight:U,fontHeightLG:G,lineHeightLG:H}=n;return[{[e]:Object.assign(Object.assign(Object.assign({},k8(n)),cse(n,i,U,r)),{position:"relative",display:"inline-flex",alignItems:"center",lineHeight:1,borderRadius:l,transition:`border ${c}, box-shadow ${c}, background ${c}`,[`${e}-prefix`]:{flex:"0 0 auto",marginInlineEnd:n.inputAffixPadding},[`${e}-input`]:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%","> input":Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",color:"inherit",fontSize:n.fontSize,lineHeight:n.lineHeight,transition:`all ${c}`},vQe(d)),{flex:"auto",minWidth:1,height:"auto",padding:0,background:"transparent",border:0,fontFamily:"inherit","&:focus":{boxShadow:"none",outline:0},"&[disabled]":{background:"transparent",color:u,cursor:"not-allowed"}}),"&-placeholder":{"> input":{color:d}}},"&-large":Object.assign(Object.assign({},cse(n,f,G,r)),{[`${e}-input > input`]:{fontSize:p,lineHeight:H}}),"&-small":Object.assign({},cse(n,g,U,m)),[`${e}-suffix`]:{display:"flex",flex:"none",alignSelf:"center",marginInlineStart:n.calc(_).div(2).equal(),color:u,lineHeight:1,pointerEvents:"none",transition:`opacity ${c}, color ${c}`,"> *":{verticalAlign:"top","&:not(:last-child)":{marginInlineEnd:v}}},[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineEnd:0,color:u,lineHeight:1,transform:"translateY(-50%)",cursor:"pointer",opacity:0,transition:`opacity ${c}, color ${c}`,"> *":{verticalAlign:"top"},"&:hover":{color:b}},"&:hover":{[`${e}-clear`]:{opacity:1},[`${e}-suffix:not(:last-child)`]:{opacity:0}},[`${e}-separator`]:{position:"relative",display:"inline-block",width:"1em",height:p,color:u,fontSize:p,verticalAlign:"top",cursor:"default",[`${e}-focused &`]:{color:b},[`${e}-range-separator &`]:{[`${e}-disabled &`]:{cursor:"not-allowed"}}},"&-range":{position:"relative",display:"inline-flex",[`${e}-active-bar`]:{bottom:n.calc(s).mul(-1).equal(),height:y,background:C,opacity:0,transition:`all ${S} ease-out`,pointerEvents:"none"},[`&${e}-focused`]:{[`${e}-active-bar`]:{opacity:1}},[`${e}-range-separator`]:{alignItems:"center",padding:`0 ${Fi(_)}`,lineHeight:1}},"&-range, &-multiple":{[`${e}-clear`]:{insetInlineEnd:r},[`&${e}-small`]:{[`${e}-clear`]:{insetInlineEnd:m}}},"&-dropdown":Object.assign(Object.assign(Object.assign({},k8(n)),$Ht(n)),{pointerEvents:"none",position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:k,[`&${e}-dropdown-hidden`]:{display:"none"},"&-rtl":{direction:"rtl"},[`&${e}-dropdown-placement-bottomLeft, &${e}-dropdown-placement-bottomRight`]:{[`${e}-range-arrow`]:{top:0,display:"block",transform:"translateY(-100%)"}},[`&${e}-dropdown-placement-topLeft, &${e}-dropdown-placement-topRight`]:{[`${e}-range-arrow`]:{bottom:0,display:"block",transform:"translateY(100%) rotate(180deg)"}},[`&${t}-slide-up-appear, &${t}-slide-up-enter`]:{[`${e}-range-arrow${e}-range-arrow`]:{transition:"none"}},[`&${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:pYe},[`&${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:hYe},[`&${t}-slide-up-leave ${e}-panel-container`]:{pointerEvents:"none"},[`&${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:gYe},[`&${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:fYe},[`${e}-panel > ${e}-time-panel`]:{paddingTop:I},[`${e}-range-wrapper`]:{display:"flex",position:"relative"},[`${e}-range-arrow`]:Object.assign(Object.assign({position:"absolute",zIndex:1,display:"none",paddingInline:n.calc(r).mul(1.5).equal(),boxSizing:"content-box",transition:`all ${S} ease-out`},r$t(n,N,q)),{"&:before":{insetInlineStart:n.calc(r).mul(1.5).equal()}}),[`${e}-panel-container`]:{overflow:"hidden",verticalAlign:"top",background:N,borderRadius:P,boxShadow:O,transition:`margin ${S}`,display:"inline-block",pointerEvents:"auto",[`${e}-panel-layout`]:{display:"flex",flexWrap:"nowrap",alignItems:"stretch"},[`${e}-presets`]:{display:"flex",flexDirection:"column",minWidth:B,maxWidth:W,ul:{height:0,flex:"auto",listStyle:"none",overflow:"auto",margin:0,padding:_,borderInlineEnd:`${Fi(s)} ${o} ${V}`,li:Object.assign(Object.assign({},E6t),{borderRadius:F,paddingInline:_,paddingBlock:n.calc(g).sub(U).div(2).equal(),cursor:"pointer",transition:`all ${S}`,"+ li":{marginTop:v},"&:hover":{background:M}})}},[`${e}-panels`]:{display:"inline-flex",flexWrap:"nowrap","&:last-child":{[`${e}-panel`]:{borderWidth:0}}},[`${e}-panel`]:{verticalAlign:"top",background:"transparent",borderRadius:0,borderWidth:0,[`${e}-content, table`]:{textAlign:"center"},"&-focused":{borderColor:a}}}}),"&-dropdown-range":{padding:`${Fi(n.calc(L).mul(2).div(3).equal())} 0`,"&-hidden":{display:"none"}},"&-rtl":{direction:"rtl",[`${e}-separator`]:{transform:"scale(-1, 1)"},[`${e}-footer`]:{"&-extra":{direction:"rtl"}}}})},dPe(n,"slide-up"),dPe(n,"slide-down"),uPe(n,"move-up"),uPe(n,"move-down")]},wQe=c9("DatePicker",n=>{const e=gg(bxe(n),VHt(n),{inputPaddingHorizontalBase:n.calc(n.paddingSM).sub(1).equal(),multipleSelectItemHeight:n.multipleItemHeight,selectHeight:n.controlHeight});return[HHt(e),KHt(e),UHt(e),qHt(e),FHt(e),cxe(n,{focusElCls:`${n.componentCls}-focused`})]},zHt),GHt=n=>{const{componentCls:e,sizePaddingEdgeHorizontal:t,colorSplit:i,lineWidth:r,textPaddingInline:s,orientationMargin:o,verticalMarginInline:a}=n;return{[e]:Object.assign(Object.assign({},k8(n)),{borderBlockStart:`${Fi(r)} solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:a,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${Fi(r)} solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${Fi(n.dividerHorizontalGutterMargin)} 0`},[`&-horizontal${e}-with-text`]:{display:"flex",alignItems:"center",margin:`${Fi(n.dividerHorizontalWithTextGutterMargin)} 0`,color:n.colorTextHeading,fontWeight:500,fontSize:n.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${Fi(r)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${e}-with-text-start`]:{"&::before":{width:`calc(${o} * 100%)`},"&::after":{width:`calc(100% - ${o} * 100%)`}},[`&-horizontal${e}-with-text-end`]:{"&::before":{width:`calc(100% - ${o} * 100%)`},"&::after":{width:`calc(${o} * 100%)`}},[`${e}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:s},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${Fi(r)} 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},"&-dotted":{background:"none",borderColor:i,borderStyle:"dotted",borderWidth:`${Fi(r)} 0 0`},[`&-horizontal${e}-with-text${e}-dotted`]:{"&::before, &::after":{borderStyle:"dotted none none"}},[`&-vertical${e}-dotted`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${e}-with-text`]:{color:n.colorText,fontWeight:"normal",fontSize:n.fontSize},[`&-horizontal${e}-with-text-start${e}-no-default-orientation-margin-start`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${e}-inner-text`]:{paddingInlineStart:t}},[`&-horizontal${e}-with-text-end${e}-no-default-orientation-margin-end`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${e}-inner-text`]:{paddingInlineEnd:t}}})}},YHt=n=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:n.marginXS}),QHt=c9("Divider",n=>{const e=gg(n,{dividerHorizontalWithTextGutterMargin:n.margin,dividerHorizontalGutterMargin:n.marginLG,sizePaddingEdgeHorizontal:0});return[GHt(e)]},YHt,{unitless:{orientationMargin:!0}});var XHt=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 ZHt=n=>{const{getPrefixCls:e,direction:t,className:i,style:r}=PGe("divider"),{prefixCls:s,type:o="horizontal",orientation:a="center",orientationMargin:l,className:c,rootClassName:u,children:d,dashed:f,variant:p="solid",plain:g,style:m}=n,_=XHt(n,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style"]),v=e("divider",s),[b,y,C]=QHt(v),S=!!d,k=x.useMemo(()=>a==="left"?t==="rtl"?"end":"start":a==="right"?t==="rtl"?"start":"end":a,[t,a]),I=k==="start"&&l!=null,L=k==="end"&&l!=null,N=$t(v,i,y,C,`${v}-${o}`,{[`${v}-with-text`]:S,[`${v}-with-text-${k}`]:S,[`${v}-dashed`]:!!f,[`${v}-${p}`]:p!=="solid",[`${v}-plain`]:!!g,[`${v}-rtl`]:t==="rtl",[`${v}-no-default-orientation-margin-start`]:I,[`${v}-no-default-orientation-margin-end`]:L},c,u),P=x.useMemo(()=>typeof l=="number"?l:/^\d+$/.test(l)?Number(l):l,[l]),O={marginInlineStart:I?P:void 0,marginInlineEnd:L?P:void 0};return b(x.createElement("div",Object.assign({className:N,style:Object.assign(Object.assign({},r),m)},_,{role:"separator"}),d&&o!=="vertical"&&x.createElement("span",{className:`${v}-inner-text`,style:O},d)))};var JHt={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"},eVt=function(e,t){return x.createElement(fv,hn({},e,{ref:t,icon:JHt}))},xQe=x.forwardRef(eVt),tVt={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"},nVt=function(e,t){return x.createElement(fv,hn({},e,{ref:t,icon:tVt}))},SQe=x.forwardRef(nVt),iVt={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"},rVt=function(e,t){return x.createElement(fv,hn({},e,{ref:t,icon:iVt}))},sVt=x.forwardRef(rVt);function oVt(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 aVt(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 EQe(n,e){const{allowClear:t=!0}=n,{clearIcon:i,removeIcon:r}=n$t(Object.assign(Object.assign({},n),{prefixCls:e,componentName:"DatePicker"}));return[x.useMemo(()=>t===!1?!1:Object.assign({clearIcon:i},t===!0?{}:t),[t,i]),r]}const[lVt,cVt]=["week","WeekPicker"],[uVt,dVt]=["month","MonthPicker"],[hVt,fVt]=["year","YearPicker"],[pVt,gVt]=["quarter","QuarterPicker"],[kQe,YPe]=["time","TimePicker"],mVt=n=>x.createElement(uxe,Object.assign({size:"small",type:"primary"},n));function TQe(n){return x.useMemo(()=>Object.assign({button:mVt},n),[n])}var _Vt=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 vVt=n=>x.forwardRef((t,i)=>{var r;const{prefixCls:s,getPopupContainer:o,components:a,className:l,style:c,placement:u,size:d,disabled:f,bordered:p=!0,placeholder:g,popupClassName:m,dropdownClassName:_,status:v,rootClassName:b,variant:y,picker:C}=t,S=_Vt(t,["prefixCls","getPopupContainer","components","className","style","placement","size","disabled","bordered","placeholder","popupClassName","dropdownClassName","status","rootClassName","variant","picker"]),k=x.useRef(null),{getPrefixCls:I,direction:L,getPopupContainer:N,rangePicker:P}=x.useContext(pg),O=I("picker",s),{compactSize:F,compactItemClassnames:V}=axe(O,L),M=I(),[B,W]=PYe("rangePicker",y,p),q=rYe(O),[U,G,H]=wQe(O,q),[z]=EQe(t,O),Z=TQe(a),X=oxe(qe=>{var mt;return(mt=d??F)!==null&&mt!==void 0?mt:qe}),oe=x.useContext(RO),fe=f??oe,Se=x.useContext(Fq),{hasFeedback:Me,status:Ie,feedbackIcon:ge}=Se,ye=x.createElement(x.Fragment,null,C===kQe?x.createElement(SQe,null):x.createElement(xQe,null),Me&&ge);x.useImperativeHandle(i,()=>k.current);const[Pe]=IGe("Calendar",Dq),Be=Object.assign(Object.assign({},Pe),t.locale),[$e]=aYe("DatePicker",(r=t.popupStyle)===null||r===void 0?void 0:r.zIndex);return U(x.createElement(TYe,{space:!0},x.createElement(CHt,Object.assign({separator:x.createElement("span",{"aria-label":"to",className:`${O}-separator`},x.createElement(sVt,null)),disabled:fe,ref:k,placement:u,placeholder:aVt(Be,C,g),suffixIcon:ye,prevIcon:x.createElement("span",{className:`${O}-prev-icon`}),nextIcon:x.createElement("span",{className:`${O}-next-icon`}),superPrevIcon:x.createElement("span",{className:`${O}-super-prev-icon`}),superNextIcon:x.createElement("span",{className:`${O}-super-next-icon`}),transitionName:`${M}-slide-up`,picker:C},S,{className:$t({[`${O}-${X}`]:X,[`${O}-${B}`]:W},DYe(O,RYe(Ie,v),Me),G,V,l,P==null?void 0:P.className,H,q,b),style:Object.assign(Object.assign({},P==null?void 0:P.style),c),locale:Be.lang,prefixCls:O,getPopupContainer:o||N,generateConfig:n,components:Z,direction:L,classNames:{popup:$t(G,m||_,H,q,b)},styles:{popup:Object.assign(Object.assign({},t.popupStyle),{zIndex:$e})},allowClear:z}))))});var bVt=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 yVt=n=>{const e=(l,c)=>{const u=c===YPe?"timePicker":"datePicker";return x.forwardRef((f,p)=>{var g;const{prefixCls:m,getPopupContainer:_,components:v,style:b,className:y,rootClassName:C,size:S,bordered:k,placement:I,placeholder:L,popupClassName:N,dropdownClassName:P,disabled:O,status:F,variant:V,onCalendarChange:M}=f,B=bVt(f,["prefixCls","getPopupContainer","components","style","className","rootClassName","size","bordered","placement","placeholder","popupClassName","dropdownClassName","disabled","status","variant","onCalendarChange"]),{getPrefixCls:W,direction:q,getPopupContainer:U,[u]:G}=x.useContext(pg),H=W("picker",m),{compactSize:z,compactItemClassnames:Z}=axe(H,q),X=x.useRef(null),[oe,fe]=PYe("datePicker",V,k),Se=rYe(H),[Me,Ie,ge]=wQe(H,Se);x.useImperativeHandle(p,()=>X.current);const ye={showToday:!0},Pe=l||f.picker,Be=W(),{onSelect:$e,multiple:qe}=B,mt=$e&&l==="time"&&!qe,vt=(Tt,Ct,Rt)=>{M==null||M(Tt,Ct,Rt),mt&&$e(Tt)},[ft,tt]=EQe(f,H),St=TQe(v),Ft=oxe(Tt=>{var Ct;return(Ct=S??z)!==null&&Ct!==void 0?Ct:Tt}),en=x.useContext(RO),Ke=O??en,dt=x.useContext(Fq),{hasFeedback:nt,status:at,feedbackIcon:Oe}=dt,ce=x.createElement(x.Fragment,null,Pe==="time"?x.createElement(SQe,null):x.createElement(xQe,null),nt&&Oe),[Ne]=IGe("DatePicker",Dq),Xe=Object.assign(Object.assign({},Ne),f.locale),[it]=aYe("DatePicker",(g=f.popupStyle)===null||g===void 0?void 0:g.zIndex);return Me(x.createElement(TYe,{space:!0},x.createElement(THt,Object.assign({ref:X,placeholder:oVt(Xe,Pe,L),suffixIcon:ce,placement:I,prevIcon:x.createElement("span",{className:`${H}-prev-icon`}),nextIcon:x.createElement("span",{className:`${H}-next-icon`}),superPrevIcon:x.createElement("span",{className:`${H}-super-prev-icon`}),superNextIcon:x.createElement("span",{className:`${H}-super-next-icon`}),transitionName:`${Be}-slide-up`,picker:l,onCalendarChange:vt},ye,B,{locale:Xe.lang,className:$t({[`${H}-${Ft}`]:Ft,[`${H}-${oe}`]:fe},DYe(H,RYe(at,F),nt),Ie,Z,G==null?void 0:G.className,y,ge,Se,C),style:Object.assign(Object.assign({},G==null?void 0:G.style),b),prefixCls:H,getPopupContainer:_||U,generateConfig:n,components:St,direction:q,disabled:Ke,classNames:{popup:$t(Ie,ge,Se,C,N||P)},styles:{popup:Object.assign(Object.assign({},f.popupStyle),{zIndex:it})},allowClear:ft,removeIcon:tt}))))})},t=e(),i=e(lVt,cVt),r=e(uVt,dVt),s=e(hVt,fVt),o=e(pVt,gVt),a=e(kQe,YPe);return{DatePicker:t,WeekPicker:i,MonthPicker:r,YearPicker:s,TimePicker:a,QuarterPicker:o}},IQe=n=>{const{DatePicker:e,WeekPicker:t,MonthPicker:i,YearPicker:r,TimePicker:s,QuarterPicker:o}=yVt(n),a=vVt(n),l=e;return l.WeekPicker=t,l.MonthPicker=i,l.YearPicker=r,l.RangePicker=a,l.TimePicker=s,l.QuarterPicker=o,l},SA=IQe(L$t),CVt=IYe(SA,"popupAlign",void 0,"picker");SA._InternalPanelDoNotUseOrYouWillBeFired=CVt;const wVt=IYe(SA.RangePicker,"popupAlign",void 0,"picker");SA._InternalRangePanelDoNotUseOrYouWillBeFired=wVt;SA.generatePicker=IQe;function xVt(){const[n]=xe(),e=Fr(),t=Nr(),i=Vm(),[r,s]=x.useState(!0),o=(l,c)=>e(Uo({object:"company",property:l,value:c})),a=()=>{pe.processing(),Je("POST",ze(`/api/v1/companies/${t.id}/default`),{}).then(l=>{pe.success(l.data.message),s(!1)})};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("activate_company"),leftSideHelp:n("activate_company_help"),children:h.jsx(jt,{checked:!(t!=null&&t.is_disabled),onChange:l=>o("is_disabled",!l)})}),h.jsx(ne,{leftSide:n("enable_markdown"),leftSideHelp:n("enable_markdown_help"),children:h.jsx(jt,{checked:t==null?void 0:t.markdown_enabled,onChange:l=>o("markdown_enabled",l)})}),h.jsx(ne,{leftSide:n("include_drafts"),leftSideHelp:n("include_drafts_help"),children:h.jsx(jt,{checked:t==null?void 0:t.report_include_drafts,onChange:l=>o("report_include_drafts",l)})}),i.default_company_id!==(t==null?void 0:t.id)&&r&&h.jsxs(h.Fragment,{children:[h.jsx(ZHt,{}),h.jsx(ne,{leftSide:n("set_default_company"),children:h.jsx(dn,{type:"minimal",behavior:"button",onClick:a,children:t==null?void 0:t.settings.name})})]})]})}function SVt(){const[n]=xe();Ml();const e=Vm(),{dateFormat:t}=Zc();return h.jsxs("div",{className:"flex flex-col pb-4",children:[h.jsx(ne,{className:"mb-3",leftSide:n("plan"),children:h.jsx("span",{children:n((e==null?void 0:e.plan_expires)!==""&&!Jn(e.plan_expires).isBefore(Jn())?"licensed":"plan_free_self_hosted")})}),(e==null?void 0:e.plan_expires)!==""&&h.jsx(ne,{leftSide:n("expires_on"),children:Jn(e.plan_expires).year()>2e3?so(e.plan_expires,t):n("forever_free")}),To(),!bw()&&h.jsx(W5t,{})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 ya=Ls(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 Xs(){const n=Fr();return(e,t)=>{n(Uo({object:"company",property:e,value:t}))}}function EVt(){const[n]=xe(),e=Nr(),t=ji(ya),i=Yi(),r=Xs(),[s,o]=x.useState(!1),a=[{value:18e5,label:Ut(n("count_minutes"),{count:"30"})},{value:72e5,label:Ut(n("count_hours"),{count:"2"})},{value:288e5,label:Ut(n("count_hours"),{count:"8"})},{value:864e5,label:Ut(n("count_day"),{count:"1"})},{value:6048e5,label:Ut(n("count_days"),{count:"7"})},{value:2592e6,label:Ut(n("count_days"),{count:"30"})},{value:0,label:n("never")}],l=()=>{s||(o(!0),Je("POST",ze("/api/v1/logout")).then(()=>{pe.success("success"),i("/logout")}).finally(()=>o(!1)))};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("web_session_timeout"),children:h.jsx(Dn,{value:e==null?void 0:e.session_timeout,onValueChange:c=>r("session_timeout",c),errorMessage:t==null?void 0:t.errors.session_timeout,customSelector:!0,dismissable:!1,children:a.map(c=>h.jsx("option",{value:c.value,children:c.label},c.value))})}),h.jsx(ne,{leftSide:n("end_all_sessions"),leftSideHelp:n("end_all_sessions_help"),children:h.jsx(dn,{behavior:"button",type:"secondary",onClick:l,disabled:s,disableWithoutIcon:!0,children:n("logout")})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function MO({size:n="1.2rem",color:e="#FFF"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:n,height:n,viewBox:"0 0 18 18",children:[h.jsx("path",{d:"m13.474,7.25l-.374,7.105c-.056,1.062-.934,1.895-1.997,1.895h-4.205c-1.064,0-1.941-.833-1.997-1.895l-.374-7.105",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"2.75",y1:"4.75",x2:"15.25",y2:"4.75",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"m6.75,4.75v-2c0-.552.448-1,1-1h2.5c.552,0,1,.448,1,1v2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function kVt({size:n="1.2rem",color:e="#FFF"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"m13.474,7.25l-.374,7.105c-.056,1.062-.934,1.895-1.997,1.895h-4.205c-1.064,0-1.941-.833-1.997-1.895l-.374-7.105",fill:"none",stroke:e,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"}),h.jsx("line",{x1:"2.75",y1:"4.75",x2:"15.25",y2:"4.75",fill:"none",stroke:e,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"}),h.jsx("path",{d:"m6.75,4.75v-2c0-.552.448-1,1-1h2.5c.552,0,1,.448,1,1v2",fill:"none",stroke:e,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"}),h.jsx("line",{x1:"7.232",y1:"8.732",x2:"10.768",y2:"12.268",fill:"none",stroke:e,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"}),h.jsx("line",{x1:"10.768",y1:"8.732",x2:"7.232",y2:"12.268",fill:"none",stroke:e,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5","data-color":"color-2"})]})}const QPe=As.div` background-color: ${({theme:n})=>n.backgroundColor}; &:hover { background-color: ${({theme:n})=>n.hoverBackgroundColor}; } `;function TVt(){const[n]=xe(),e=xt(),t=zi(),i=Cu(_=>_.companyUsers),[r,s]=x.useState(""),[o,a]=x.useState(""),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[f,p]=x.useState(""),g=()=>{pe.processing(),Je("POST",ze("/api/v1/companies/purge_save_settings/:id",{id:t.id}),{cancellation_message:o},{headers:{"X-Api-Password":r}}).then(()=>pe.success("purge_successful")).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===412&&pe.error("password_error_incorrect")}).finally(()=>c(!1))},m=()=>{pe.processing(),Je("DELETE",ze("/api/v1/companies/:id",{id:t.id}),{},{headers:{"X-Api-Password":r}}).then(()=>window.location.reload()).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===412&&pe.error("password_error_incorrect")})};return h.jsxs(h.Fragment,{children:[h.jsxs(pr,{title:n("purge_data"),text:n("purge_data_message"),visible:l,onClose:c,children:[h.jsx(lt,{label:Ut(n("please_type_to_confirm"),{value:"purge"}),id:"purge_data",onChange:_=>p(_.target.value),required:!0}),h.jsx(lt,{type:"password",label:n("password"),id:"password",onChange:_=>s(_.target.value),required:!0}),h.jsx(dn,{behavior:"button",onClick:g,disabled:f!=="purge"||!r,disableWithoutIcon:!0,children:n("continue")})]}),h.jsxs(pr,{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")} (${t==null?void 0:t.settings.name})`:n("cancel_account_message"),visible:u,onClose:d,children:[h.jsx(lt,{label:Ut(n("please_type_to_confirm"),{value:"delete"}),id:"cancel_account",onChange:_=>p(_.target.value),required:!0}),h.jsx(lt,{type:"text",label:n("reason_for_canceling"),id:"feedback",onChange:_=>a(_.target.value)}),h.jsx(lt,{type:"password",label:n("password"),id:"password",onChange:_=>s(_.target.value),required:!0}),h.jsx(dn,{behavior:"button",onClick:m,disabled:f!=="delete"||!r,disableWithoutIcon:!0,children:n("continue")})]}),h.jsxs("div",{className:"flex flex-col space-y-4 px-4 sm:px-6 pt-2 pb-4",children:[h.jsxs(QPe,{className:"flex space-x-2 items-center p-4 border shadow-sm w-full rounded-md cursor-pointer text-red-500 hover:text-red-600",theme:{backgroundColor:e.$1,hoverBackgroundColor:e.$4},onClick:()=>c(!0),style:{borderColor:e.$24},children:[h.jsx("div",{children:h.jsx(kVt,{color:"#ef4444",size:"1.4rem"})}),h.jsx("span",{className:"text-sm",children:n("purge_data")})]}),h.jsxs(QPe,{className:"flex space-x-2 items-center p-4 border shadow-sm w-full rounded-md cursor-pointer text-red-500 hover:text-red-600",theme:{backgroundColor:e.$1,hoverBackgroundColor:e.$4},onClick:()=>d(!0),style:{borderColor:e.$24},children:[h.jsx("div",{children:h.jsx(MO,{color:"#ef4444",size:"1.4rem"})}),h.jsx("span",{className:"text-sm",children:(i==null?void 0:i.api.length)>1?n("delete_company"):n("cancel_account")})]})]})]})}function Tc(n){const e=n.text||"",[t,i]=x.useState(!1),r=s=>{s.stopPropagation(),navigator.clipboard.writeText(e),pe.success("copied_to_clipboard",{value:""})};return h.jsxs("div",{className:`inline-flex items-center space-x-2 ${n.className}`,children:[h.jsx("span",{children:n.secure&&!t?n.text.split("").map(()=>"*"):e}),e.length>0&&navigator.clipboard&&window.isSecureContext?h.jsx("button",{type:"button",onClick:r,children:h.jsx(uTt,{size:18})}):h.jsx(h.Fragment,{children:!!n.secure&&h.jsx("div",{className:"inline-flex items-center cursor-pointer",onClick:s=>{s.stopPropagation(),i(o=>!o)},children:t?h.jsx(an,{element:oqe}):h.jsx(an,{element:sqe})})})]})}function IVt(){var t,i,r;const[n]=xe(),e=Ml();return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("referral_code"),children:h.jsx(Tc,{text:`https://app.invoicing.co/#/register?rc=${e==null?void 0:e.referral_code}`})}),h.jsx(ne,{leftSide:n("free"),children:((t=e==null?void 0:e.referral_meta)==null?void 0:t.free)||0}),h.jsx(ne,{leftSide:n("pro"),children:((i=e==null?void 0:e.referral_meta)==null?void 0:i.pro)||0}),h.jsx(ne,{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 u1(){const n=Fr();return async()=>Je("POST",ze("/api/v1/refresh?updated_at=:updatedAt",{updatedAt:Jn().unix()})).then(e=>{n(s1(e.data.data)),n(zu("company"))})}const LVt=As.div` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function LQe(n){const{padding:e="regular",className:t,style:i}=n,r=xt();return h.jsx(LVt,{style:{...i},theme:{hoverColor:r.$2,color:r.$3},className:$t(`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})}var use={exports:{}},dse,XPe;function AVt(){return XPe||(XPe=1,dse=function(){var e=this,t=-1;return{next:function(){return t+=1,{value:e.items[t],done:t>=e.items.length}}}}),dse}var hse,ZPe;function NVt(){return ZPe||(ZPe=1,hse=function(){return this.items}),hse}var fse,JPe;function Rc(){if(JPe)return fse;JPe=1;function n(e){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}return fse={isArray:function(t){return Array.isArray(t)},isObject:function(t){return n(t)==="object"&&Array.isArray(t)===!1&&t!==null},isFunction:function(t){return typeof t=="function"}},fse}var pse,eOe;function AQe(){if(eOe)return pse;eOe=1;var n=Rc(),e=n.isFunction;return pse=function(i){return i===void 0?this.sum()/this.items.length:e(i)?new this.constructor(this.items).sum(i)/this.items.length:new this.constructor(this.items).pluck(i).sum()/this.items.length},pse}var gse,tOe;function DVt(){if(tOe)return gse;tOe=1;var n=AQe();return gse=n,gse}var mse,nOe;function RVt(){if(nOe)return mse;nOe=1;function n(e){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}return mse=function(t){var i=this,r=[],s=0;if(Array.isArray(this.items))do{var o=this.items.slice(s,s+t),a=new this.constructor(o);r.push(a),s+=t}while(s<this.items.length);else if(n(this.items)==="object"){var l=Object.keys(this.items),c=function(){var d=l.slice(s,s+t),f=new i.constructor({});d.forEach(function(p){return f.put(p,i.items[p])}),r.push(f),s+=t};do c();while(s<l.length)}else r.push(new this.constructor([this.items]));return new this.constructor(r)},mse}var _se,iOe;function PVt(){if(iOe)return _se;iOe=1;function n(o){return r(o)||i(o)||t(o)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return s(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return s(o,a)}}function i(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function r(o){if(Array.isArray(o))return s(o)}function s(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}return _se=function(){var a;return new this.constructor((a=[]).concat.apply(a,n(this.items)))},_se}var vse,rOe;function OVt(){if(rOe)return vse;rOe=1;function n(a,l){return s(a)||r(a,l)||t(a,l)||e()}function e(){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 t(a,l){if(a){if(typeof a=="string")return i(a,l);var c=Object.prototype.toString.call(a).slice(8,-1);if(c==="Object"&&a.constructor&&(c=a.constructor.name),c==="Map"||c==="Set")return Array.from(a);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return i(a,l)}}function i(a,l){(l==null||l>a.length)&&(l=a.length);for(var c=0,u=new Array(l);c<l;c++)u[c]=a[c];return u}function r(a,l){var c=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(c!=null){var u=[],d=!0,f=!1,p,g;try{for(c=c.call(a);!(d=(p=c.next()).done)&&(u.push(p.value),!(l&&u.length===l));d=!0);}catch(m){f=!0,g=m}finally{try{!d&&c.return!=null&&c.return()}finally{if(f)throw g}}return u}}function s(a){if(Array.isArray(a))return a}function o(a){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},o(a)}return vse=function(l){var c=this,u=l;u instanceof this.constructor&&(u=l.all());var d={};if(Array.isArray(this.items)&&Array.isArray(u))this.items.forEach(function(g,m){d[g]=u[m]});else if(o(this.items)==="object"&&o(u)==="object")Object.keys(this.items).forEach(function(g,m){d[c.items[g]]=u[Object.keys(u)[m]]});else if(Array.isArray(this.items))d[this.items[0]]=u;else if(typeof this.items=="string"&&Array.isArray(u)){var f=u,p=n(f,1);d[this.items]=p[0]}else typeof this.items=="string"&&(d[this.items]=u);return new this.constructor(d)},vse}var bse,sOe;function NQe(){if(sOe)return bse;sOe=1;function n(o){return r(o)||i(o)||t(o)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return s(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return s(o,a)}}function i(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function r(o){if(Array.isArray(o))return s(o)}function s(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}return bse=function(a){var l;if(Array.isArray(a)){var c;l=[],(c=l).push.apply(c,n(a))}else l={},Object.keys(a).forEach(function(u){l[u]=a[u]});return l},bse}var yse,oOe;function MVt(){if(oOe)return yse;oOe=1;function n(t){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n(t)}var e=NQe();return yse=function(i){var r=i;i instanceof this.constructor?r=i.all():n(i)==="object"&&(r=[],Object.keys(i).forEach(function(o){r.push(i[o])}));var s=e(this.items);return r.forEach(function(o){n(o)==="object"?Object.keys(o).forEach(function(a){return s.push(o[a])}):s.push(o)}),new this.constructor(s)},yse}var Cse,aOe;function d1(){if(aOe)return Cse;aOe=1;function n(o){return r(o)||i(o)||t(o)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return s(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return s(o,a)}}function i(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function r(o){if(Array.isArray(o))return s(o)}function s(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}return Cse=function(a){var l=[];return Array.isArray(a)?l.push.apply(l,n(a)):a.constructor.name==="Collection"?l.push.apply(l,n(a.all())):Object.keys(a).forEach(function(c){return l.push(a[c])}),l},Cse}var wse,lOe;function DQe(){if(lOe)return wse;lOe=1;function n(c){return r(c)||i(c)||t(c)||e()}function e(){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 t(c,u){if(c){if(typeof c=="string")return s(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);if(d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set")return Array.from(c);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return s(c,u)}}function i(c){if(typeof Symbol<"u"&&c[Symbol.iterator]!=null||c["@@iterator"]!=null)return Array.from(c)}function r(c){if(Array.isArray(c))return s(c)}function s(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,f=new Array(u);d<u;d++)f[d]=c[d];return f}var o=d1(),a=Rc(),l=a.isFunction;return wse=function(u,d){if(d!==void 0)return Array.isArray(this.items)?this.items.filter(function(p){return p[u]!==void 0&&p[u]===d}).length>0:this.items[u]!==void 0&&this.items[u]===d;if(l(u))return this.items.filter(function(p,g){return u(p,g)}).length>0;if(Array.isArray(this.items))return this.items.indexOf(u)!==-1;var f=o(this.items);return f.push.apply(f,n(Object.keys(this.items))),f.indexOf(u)!==-1},wse}var xse,cOe;function jVt(){return cOe||(cOe=1,xse=function(){return this.count()===1}),xse}var Sse,uOe;function FVt(){return uOe||(uOe=1,Sse=function(){var e=0;return Array.isArray(this.items)&&(e=this.items.length),Math.max(Object.keys(this.items).length,e)}),Sse}var Ese,dOe;function BVt(){return dOe||(dOe=1,Ese=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()})}),Ese}var kse,hOe;function $Vt(){return hOe||(hOe=1,kse=function(){function e(s,o,a){var l=a[0];l instanceof o&&(l=l.all());for(var c=a.slice(1),u=!c.length,d=[],f=0;f<l.length;f+=1){var p=s.slice();p.push(l[f]),u?d.push(p):d=d.concat(e(p,o,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)))}),kse}var Tse,fOe;function HVt(){return fOe||(fOe=1,Tse=function(){this.dump(),typeof process<"u"&&process.exit(1)}),Tse}var Ise,pOe;function VVt(){return pOe||(pOe=1,Ise=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)}),Ise}var Lse,gOe;function WVt(){return gOe||(gOe=1,Lse=function(e){var t=this,i=e;e instanceof this.constructor&&(i=e.all());var r={};return Object.keys(this.items).forEach(function(s){(i[s]===void 0||i[s]!==t.items[s])&&(r[s]=t.items[s])}),new this.constructor(r)}),Lse}var Ase,mOe;function zVt(){return mOe||(mOe=1,Ase=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(s){return i.indexOf(s)===-1});return new this.constructor(this.items).only(r)}),Ase}var Nse,_Oe;function UVt(){return _Oe||(_Oe=1,Nse=function(e,t){var i=this.items.filter(function(r){return!(e&&e.some(function(s){return t(r,s)===0}))});return new this.constructor(i)}),Nse}var Dse,vOe;function qVt(){return vOe||(vOe=1,Dse=function(e,t){return!this.contains(e,t)}),Dse}var Rse,bOe;function KVt(){return bOe||(bOe=1,Rse=function(){return console.log(this),this}),Rse}var Pse,yOe;function GVt(){if(yOe)return Pse;yOe=1;function n(e){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}return Pse=function(){var t=this,i=[],r={},s=function(a){return Array.isArray(a)||n(a)==="object"?JSON.stringify(a):a};return Array.isArray(this.items)?this.items.forEach(function(o,a){var l=s(o);i.indexOf(l)===-1?i.push(l):r[a]=o}):n(this.items)==="object"&&Object.keys(this.items).forEach(function(o){var a=s(t.items[o]);i.indexOf(a)===-1?i.push(a):r[o]=t.items[o]}),new this.constructor(r)},Pse}var Ose,COe;function YVt(){return COe||(COe=1,Ose=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 s=Object.keys(this.items),o=s.length,a=0;a<o&&!t;a+=1){var l=s[a];t=e(this.items[l],l,this.items)===!1}return this}),Ose}var Mse,wOe;function QVt(){if(wOe)return Mse;wOe=1;function n(o){return r(o)||i(o)||t(o)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return s(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return s(o,a)}}function i(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function r(o){if(Array.isArray(o))return s(o)}function s(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}return Mse=function(a){return this.each(function(l,c){a.apply(void 0,n(l).concat([c]))}),this},Mse}var jse,xOe;function XVt(){if(xOe)return jse;xOe=1;var n=d1();return jse=function(t){var i=n(this.items);return i.every(t)},jse}var Fse,SOe;function OJ(){return SOe||(SOe=1,Fse=function(e){return Array.isArray(e[0])?e[0]:e}),Fse}var Bse,EOe;function ZVt(){if(EOe)return Bse;EOe=1;var n=OJ();return Bse=function(){for(var t=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];var o=n(r);if(Array.isArray(this.items)){var a=this.items.filter(function(c){return o.indexOf(c)===-1});return new this.constructor(a)}var l={};return Object.keys(this.items).forEach(function(c){o.indexOf(c)===-1&&(l[c]=t.items[c])}),new this.constructor(l)},Bse}var $se,kOe;function JVt(){if(kOe)return $se;kOe=1;function n(r){"@babel/helpers - typeof";return n=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},n(r)}function e(r){if(Array.isArray(r)){if(r.length)return!1}else if(r!=null&&n(r)==="object"){if(Object.keys(r).length)return!1}else if(r)return!1;return!0}function t(r,s){var o={};return Object.keys(s).forEach(function(a){r?r(s[a],a)&&(o[a]=s[a]):e(s[a])||(o[a]=s[a])}),o}function i(r,s){if(r)return s.filter(r);for(var o=[],a=0;a<s.length;a+=1){var l=s[a];e(l)||o.push(l)}return o}return $se=function(s){var o=s||!1,a=null;return Array.isArray(this.items)?a=i(o,this.items):a=t(o,this.items),new this.constructor(a)},$se}var Hse,TOe;function eWt(){if(TOe)return Hse;TOe=1;var n=Rc(),e=n.isFunction;return Hse=function(i,r){if(e(i)){for(var s=Object.keys(this.items),o=0;o<s.length;o+=1){var a=s[o],l=this.items[a];if(i(l,a))return l}return e(r)?r():r}if(Array.isArray(this.items)&&this.items.length||Object.keys(this.items).length){if(Array.isArray(this.items))return this.items[0];var c=Object.keys(this.items)[0];return this.items[c]}return e(r)?r():r},Hse}var Vse,IOe;function tWt(){if(IOe)return Vse;IOe=1;var n=Rc(),e=n.isFunction;return Vse=function(i,r,s){if(e(i))return this.first(i,function(){throw new Error("Item not found.")});var o=this.where(i,r,s);if(o.isEmpty())throw new Error("Item not found.");return o.first()},Vse}var Wse,LOe;function nWt(){return LOe||(LOe=1,Wse=function(e,t,i){return this.where(e,t,i).first()||null}),Wse}var zse,AOe;function iWt(){return AOe||(AOe=1,zse=function(e){return this.map(e).collapse()}),zse}var Use,NOe;function rWt(){if(NOe)return Use;NOe=1;var n=Rc(),e=n.isArray,t=n.isObject;return Use=function(r){var s=r||1/0,o=!1,a=[],l=function(u){a=[],e(u)?u.forEach(function(d){e(d)?a=a.concat(d):t(d)?Object.keys(d).forEach(function(f){a=a.concat(d[f])}):a.push(d)}):Object.keys(u).forEach(function(d){e(u[d])?a=a.concat(u[d]):t(u[d])?Object.keys(u[d]).forEach(function(f){a=a.concat(u[d][f])}):a.push(u[d])}),o=a.filter(function(d){return t(d)}),o=o.length===0,s-=1};for(l(this.items);!o&&s>0;)l(a);return new this.constructor(a)},Use}var qse,DOe;function sWt(){return DOe||(DOe=1,qse=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)}),qse}var Kse,ROe;function oWt(){return ROe||(ROe=1,Kse=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(s){r[s]=i.items[s]}),new this.constructor(r)}),Kse}var Gse,POe;function aWt(){return POe||(POe=1,Gse=function(e){return Array.isArray(this.items)?this.items.splice(e,1):delete this.items[e],this}),Gse}var Yse,OOe;function lWt(){if(OOe)return Yse;OOe=1;var n=Rc(),e=n.isFunction;return Yse=function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.items[i]!==void 0?this.items[i]:e(r)?r():r!==null?r:null},Yse}var Qse,MOe;function Ck(){return MOe||(MOe=1,Qse=function(e,t){try{return t.split(".").reduce(function(i,r){return i[r]},e)}catch{return e}}),Qse}var Xse,jOe;function cWt(){if(jOe)return Xse;jOe=1;var n=Ck(),e=Rc(),t=e.isFunction;return Xse=function(r){var s=this,o={};return this.items.forEach(function(a,l){var c;t(r)?c=r(a,l):n(a,r)||n(a,r)===0?c=n(a,r):c="",o[c]===void 0&&(o[c]=new s.constructor([])),o[c].push(a)}),new this.constructor(o)},Xse}var Zse,FOe;function uWt(){if(FOe)return Zse;FOe=1;var n=OJ();return Zse=function(){for(var t=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];var o=n(r);return o.filter(function(a){return Object.hasOwnProperty.call(t.items,a)}).length===o.length},Zse}var Jse,BOe;function dWt(){return BOe||(BOe=1,Jse=function(e,t){return t===void 0?this.items.join(e):new this.constructor(this.items).pluck(e).all().join(t)}),Jse}var eoe,$Oe;function hWt(){return $Oe||($Oe=1,eoe=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)}),eoe}var toe,HOe;function fWt(){return HOe||(HOe=1,toe=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(s){i.indexOf(s)!==-1&&(r[s]=t.items[s])}),new this.constructor(r)}),toe}var noe,VOe;function pWt(){return VOe||(VOe=1,noe=function(){return Array.isArray(this.items)?!this.items.length:!Object.keys(this.items).length}),noe}var ioe,WOe;function gWt(){return WOe||(WOe=1,ioe=function(){return!this.isEmpty()}),ioe}var roe,zOe;function mWt(){return zOe||(zOe=1,roe=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 s=i.pop();return i.implode(e)+t+s}),roe}var soe,UOe;function _Wt(){if(UOe)return soe;UOe=1;var n=Ck(),e=Rc(),t=e.isFunction;return soe=function(r){var s={};return t(r)?this.items.forEach(function(o){s[r(o)]=o}):this.items.forEach(function(o){var a=n(o,r);s[a||""]=o}),new this.constructor(s)},soe}var ooe,qOe;function vWt(){return qOe||(qOe=1,ooe=function(){var e=Object.keys(this.items);return Array.isArray(this.items)&&(e=e.map(Number)),new this.constructor(e)}),ooe}var aoe,KOe;function bWt(){if(KOe)return aoe;KOe=1;var n=Rc(),e=n.isFunction;return aoe=function(i,r){var s=this.items;if(e(i)&&(s=this.filter(i).all()),Array.isArray(s)&&!s.length||!Object.keys(s).length)return e(r)?r():r;if(Array.isArray(s))return s[s.length-1];var o=Object.keys(s);return s[o[o.length-1]]},aoe}var loe,GOe;function yWt(){return GOe||(GOe=1,loe=function(e,t){this.constructor.prototype[e]=t}),loe}var coe,YOe;function CWt(){return YOe||(YOe=1,coe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return new this.constructor(e)}),coe}var uoe,QOe;function wWt(){return QOe||(QOe=1,uoe=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)}),uoe}var doe,XOe;function xWt(){if(XOe)return doe;XOe=1;function n(o){return r(o)||i(o)||t(o)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return s(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return s(o,a)}}function i(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function r(o){if(Array.isArray(o))return s(o)}function s(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}return doe=function(a){return this.map(function(l,c){return a.apply(void 0,n(l).concat([c]))})},doe}var hoe,ZOe;function SWt(){if(ZOe)return hoe;ZOe=1;function n(o,a){return s(o)||r(o,a)||t(o,a)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return i(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return i(o,a)}}function i(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}function r(o,a){var l=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(l!=null){var c=[],u=!0,d=!1,f,p;try{for(l=l.call(o);!(u=(f=l.next()).done)&&(c.push(f.value),!(a&&c.length===a));u=!0);}catch(g){d=!0,p=g}finally{try{!u&&l.return!=null&&l.return()}finally{if(d)throw p}}return c}}function s(o){if(Array.isArray(o))return o}return hoe=function(a){var l={};return this.items.forEach(function(c,u){var d=a(c,u),f=n(d,2),p=f[0],g=f[1];l[p]===void 0?l[p]=[g]:l[p].push(g)}),new this.constructor(l)},hoe}var foe,JOe;function EWt(){return JOe||(JOe=1,foe=function(e){return this.map(function(t,i){return new e(t,i)})}),foe}var poe,eMe;function kWt(){if(eMe)return poe;eMe=1;function n(o,a){return s(o)||r(o,a)||t(o,a)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return i(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return i(o,a)}}function i(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}function r(o,a){var l=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(l!=null){var c=[],u=!0,d=!1,f,p;try{for(l=l.call(o);!(u=(f=l.next()).done)&&(c.push(f.value),!(a&&c.length===a));u=!0);}catch(g){d=!0,p=g}finally{try{!u&&l.return!=null&&l.return()}finally{if(d)throw p}}return c}}function s(o){if(Array.isArray(o))return o}return poe=function(a){var l={};return this.items.forEach(function(c,u){var d=a(c,u),f=n(d,2),p=f[0],g=f[1];l[p]===void 0?l[p]=[g]:l[p].push(g)}),new this.constructor(l)},poe}var goe,tMe;function TWt(){if(tMe)return goe;tMe=1;function n(o,a){return s(o)||r(o,a)||t(o,a)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return i(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return i(o,a)}}function i(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}function r(o,a){var l=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(l!=null){var c=[],u=!0,d=!1,f,p;try{for(l=l.call(o);!(u=(f=l.next()).done)&&(c.push(f.value),!(a&&c.length===a));u=!0);}catch(g){d=!0,p=g}finally{try{!u&&l.return!=null&&l.return()}finally{if(d)throw p}}return c}}function s(o){if(Array.isArray(o))return o}return goe=function(a){var l=this,c={};return Array.isArray(this.items)?this.items.forEach(function(u,d){var f=a(u,d),p=n(f,2),g=p[0],m=p[1];c[g]=m}):Object.keys(this.items).forEach(function(u){var d=a(l.items[u],u),f=n(d,2),p=f[0],g=f[1];c[p]=g}),new this.constructor(c)},goe}var moe,nMe;function IWt(){if(nMe)return moe;nMe=1;function n(o){return r(o)||i(o)||t(o)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return s(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return s(o,a)}}function i(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function r(o){if(Array.isArray(o))return s(o)}function s(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}return moe=function(a){if(typeof a=="string"){var l=this.items.filter(function(c){return c[a]!==void 0});return Math.max.apply(Math,n(l.map(function(c){return c[a]})))}return Math.max.apply(Math,n(this.items))},moe}var _oe,iMe;function LWt(){return iMe||(iMe=1,_oe=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]}),_oe}var voe,rMe;function AWt(){return rMe||(rMe=1,voe=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)}),voe}var boe,sMe;function NWt(){if(sMe)return boe;sMe=1;function n(r){"@babel/helpers - typeof";return n=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},n(r)}function e(r,s){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);s&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),o.push.apply(o,a)}return o}function t(r){for(var s=1;s<arguments.length;s++){var o=arguments[s]!=null?arguments[s]:{};s%2?e(Object(o),!0).forEach(function(a){i(r,a,o[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(o,a))})}return r}function i(r,s,o){return s in r?Object.defineProperty(r,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[s]=o,r}return boe=function(s){var o=function a(l,c){var u={},d=Object.keys(t(t({},l),c));return d.forEach(function(f){l[f]===void 0&&c[f]!==void 0?u[f]=c[f]:l[f]!==void 0&&c[f]===void 0?u[f]=l[f]:l[f]!==void 0&&c[f]!==void 0&&(l[f]===c[f]?u[f]=l[f]:!Array.isArray(l[f])&&n(l[f])==="object"&&!Array.isArray(c[f])&&n(c[f])==="object"?u[f]=a(l[f],c[f]):u[f]=[].concat(l[f],c[f]))}),u};return s?s.constructor.name==="Collection"?new this.constructor(o(this.items,s.all())):new this.constructor(o(this.items,s)):this},boe}var yoe,oMe;function DWt(){if(oMe)return yoe;oMe=1;function n(o){return r(o)||i(o)||t(o)||e()}function e(){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 t(o,a){if(o){if(typeof o=="string")return s(o,a);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return s(o,a)}}function i(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function r(o){if(Array.isArray(o))return s(o)}function s(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}return yoe=function(a){if(a!==void 0){var l=this.items.filter(function(c){return c[a]!==void 0});return Math.min.apply(Math,n(l.map(function(c){return c[a]})))}return Math.min.apply(Math,n(this.items))},yoe}var Coe,aMe;function RWt(){return aMe||(aMe=1,Coe=function(e){var t=[],i=1;return this.items.length?(this.items.forEach(function(r){var s=t.filter(function(a){return e!==void 0?a.key===r[e]:a.key===r});if(!s.length)e!==void 0?t.push({key:r[e],count:1}):t.push({key:r,count:1});else{s[0].count+=1;var o=s[0].count;o>i&&(i=o)}}),t.filter(function(r){return r.count===i}).map(function(r){return r.key})):null}),Coe}var woe,lMe;function PWt(){if(lMe)return woe;lMe=1;var n=d1();return woe=function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=n(this.items),s=r.slice(i).filter(function(o,a){return a%t===0});return new this.constructor(s)},woe}var xoe,cMe;function OWt(){if(cMe)return xoe;cMe=1;var n=OJ();return xoe=function(){for(var t=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];var o=n(r);if(Array.isArray(this.items)){var a=this.items.filter(function(c){return o.indexOf(c)!==-1});return new this.constructor(a)}var l={};return Object.keys(this.items).forEach(function(c){o.indexOf(c)!==-1&&(l[c]=t.items[c])}),new this.constructor(l)},xoe}var Soe,uMe;function MWt(){if(uMe)return Soe;uMe=1;var n=NQe();return Soe=function(t,i){var r=Math.abs(t),s=this.count();if(r<=s)return this;for(var o=r-s,a=n(this.items),l=Array.isArray(this.items),c=t<0,u=0;u<o;)l?c?a.unshift(i):a.push(i):a[u]!==void 0?o+=1:a[u]=i,u+=1;return new this.constructor(a)},Soe}var Eoe,dMe;function jWt(){return dMe||(dMe=1,Eoe=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 s=t.items[r];e(s)===!0?i[0].put(r,s):i[1].put(r,s)})),new this.constructor(i)}),Eoe}var koe,hMe;function FWt(){return hMe||(hMe=1,koe=function(e){return e(this)}),koe}var Toe,fMe;function BWt(){if(fMe)return Toe;fMe=1;var n=Rc(),e=n.isArray,t=n.isObject,i=Ck(),r=function(o){var a={};return o.forEach(function(l,c){function u(d,f){t(d)?Object.keys(d).forEach(function(p){u(d[p],"".concat(f,".").concat(p))}):e(d)&&d.forEach(function(p,g){u(p,"".concat(f,".").concat(g))}),a[f]=d}u(l,c)}),a};return Toe=function(o,a){if(o.indexOf("*")!==-1){var l=r(this.items),c=[];if(a!==void 0){var u=new RegExp("0.".concat(a),"g"),d="0.".concat(a).split(".").length;Object.keys(l).forEach(function(v){var b=v.match(u);if(b){var y=b[0];y.split(".").length===d&&c.push(l[y])}})}var f=[],p=new RegExp("0.".concat(o),"g"),g="0.".concat(o).split(".").length;if(Object.keys(l).forEach(function(v){var b=v.match(p);if(b){var y=b[0];y.split(".").length===g&&f.push(l[y])}}),a!==void 0){var m={};return this.items.forEach(function(v,b){m[c[b]||""]=f}),new this.constructor(m)}return new this.constructor([f])}if(a!==void 0){var _={};return this.items.forEach(function(v){i(v,o)!==void 0?_[v[a]||""]=i(v,o):_[v[a]||""]=null}),new this.constructor(_)}return this.map(function(v){return i(v,o)!==void 0?i(v,o):null})},Toe}var Ioe,pMe;function RQe(){if(pMe)return Ioe;pMe=1;var n=OJ();return Ioe=function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];n(r).forEach(function(o){delete t[o]})},Ioe}var Loe,gMe;function $Wt(){if(gMe)return Loe;gMe=1;var n=Rc(),e=n.isArray,t=n.isObject,i=RQe();return Loe=function(){var s=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(e(this.items))return o===1?this.items.pop():new this.constructor(this.items.splice(-o));if(t(this.items)){var a=Object.keys(this.items);if(o===1){var l=a[a.length-1],c=this.items[l];return i(this.items,l),c}var u=a.slice(-o),d=u.reduce(function(f,p){return f[p]=s.items[p],f},{});return i(this.items,u),new this.constructor(d)}return null},Loe}var Aoe,mMe;function HWt(){return mMe||(mMe=1,Aoe=function(e,t){return t!==void 0?this.put(t,e):(this.items.unshift(e),this)}),Aoe}var Noe,_Me;function VWt(){if(_Me)return Noe;_Me=1;var n=Rc(),e=n.isFunction;return Noe=function(i,r){var s=this.items[i]||null;return!s&&r!==void 0&&(e(r)?s=r():s=r),delete this.items[i],s},Noe}var Doe,vMe;function WWt(){return vMe||(vMe=1,Doe=function(){var e;return(e=this.items).push.apply(e,arguments),this}),Doe}var Roe,bMe;function zWt(){return bMe||(bMe=1,Roe=function(e,t){return this.items[e]=t,this}),Roe}var Poe,yMe;function UWt(){if(yMe)return Poe;yMe=1;var n=d1();return Poe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,i=n(this.items),r=new this.constructor(i).shuffle();return t!==parseInt(t,10)?r.first():r.take(t)},Poe}var Ooe,CMe;function qWt(){return CMe||(CMe=1,Ooe=function(e,t){var i=this,r=null;return t!==void 0&&(r=t),Array.isArray(this.items)?this.items.forEach(function(s){r=e(r,s)}):Object.keys(this.items).forEach(function(s){r=e(r,i.items[s],s)}),r}),Ooe}var Moe,wMe;function KWt(){return wMe||(wMe=1,Moe=function(e){return new this.constructor(this.items).filter(function(t){return!e(t)})}),Moe}var joe,xMe;function GWt(){if(xMe)return joe;xMe=1;function n(i,r){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(i,a).enumerable})),s.push.apply(s,o)}return s}function e(i){for(var r=1;r<arguments.length;r++){var s=arguments[r]!=null?arguments[r]:{};r%2?n(Object(s),!0).forEach(function(o){t(i,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach(function(o){Object.defineProperty(i,o,Object.getOwnPropertyDescriptor(s,o))})}return i}function t(i,r,s){return r in i?Object.defineProperty(i,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[r]=s,i}return joe=function(r){if(!r)return this;if(Array.isArray(r)){var s=this.items.map(function(l,c){return r[c]||l});return new this.constructor(s)}if(r.constructor.name==="Collection"){var o=e(e({},this.items),r.all());return new this.constructor(o)}var a=e(e({},this.items),r);return new this.constructor(a)},joe}var Foe,SMe;function YWt(){if(SMe)return Foe;SMe=1;function n(r){"@babel/helpers - typeof";return n=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},n(r)}function e(r,s){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);s&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),o.push.apply(o,a)}return o}function t(r){for(var s=1;s<arguments.length;s++){var o=arguments[s]!=null?arguments[s]:{};s%2?e(Object(o),!0).forEach(function(a){i(r,a,o[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(o,a))})}return r}function i(r,s,o){return s in r?Object.defineProperty(r,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[s]=o,r}return Foe=function(s){var o=function a(l,c){var u=t({},l),d=Object.keys(t(t({},l),c));return d.forEach(function(f){!Array.isArray(c[f])&&n(c[f])==="object"?u[f]=a(l[f],c[f]):l[f]===void 0&&c[f]!==void 0?n(l[f])==="object"?u[f]=t({},c[f]):u[f]=c[f]:l[f]!==void 0&&c[f]===void 0?n(l[f])==="object"?u[f]=t({},l[f]):u[f]=l[f]:l[f]!==void 0&&c[f]!==void 0&&(n(c[f])==="object"?u[f]=t({},c[f]):u[f]=c[f])}),u};return s?!Array.isArray(s)&&n(s)!=="object"?new this.constructor(o(this.items,[s])):s.constructor.name==="Collection"?new this.constructor(o(this.items,s.all())):new this.constructor(o(this.items,s)):this},Foe}var Boe,EMe;function QWt(){return EMe||(EMe=1,Boe=function(){var e=[].concat(this.items).reverse();return new this.constructor(e)}),Boe}var $oe,kMe;function XWt(){if(kMe)return $oe;kMe=1;var n=Rc(),e=n.isArray,t=n.isObject,i=n.isFunction;return $oe=function(s,o){var a=this,l,c=function(d,f){return i(s)?s(a.items[f],f):o?a.items[f]===s:a.items[f]==s};return e(this.items)?l=this.items.findIndex(c):t(this.items)&&(l=Object.keys(this.items).find(function(u){return c(a.items[u],u)})),l===void 0||l<0?!1:l},$oe}var Hoe,TMe;function ZWt(){if(TMe)return Hoe;TMe=1;var n=Rc(),e=n.isArray,t=n.isObject,i=RQe();return Hoe=function(){var s=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(e(this.items))return o===1?this.items.shift():new this.constructor(this.items.splice(0,o));if(t(this.items)){if(o===1){var a=Object.keys(this.items)[0],l=this.items[a];return delete this.items[a],l}var c=Object.keys(this.items),u=c.slice(0,o),d=u.reduce(function(f,p){return f[p]=s.items[p],f},{});return i(this.items,u),new this.constructor(d)}return null},Hoe}var Voe,IMe;function JWt(){if(IMe)return Voe;IMe=1;var n=d1();return Voe=function(){var t=n(this.items),i,r,s;for(s=t.length;s;s-=1)i=Math.floor(Math.random()*s),r=t[s-1],t[s-1]=t[i],t[i]=r;return this.items=t,this},Voe}var Woe,LMe;function ezt(){if(LMe)return Woe;LMe=1;var n=Rc(),e=n.isObject;return Woe=function(i){var r=this;return e(this.items)?new this.constructor(Object.keys(this.items).reduce(function(s,o,a){return a+1>i&&(s[o]=r.items[o]),s},{})):new this.constructor(this.items.slice(i))},Woe}var zoe,AMe;function tzt(){if(AMe)return zoe;AMe=1;var n=Rc(),e=n.isArray,t=n.isObject,i=n.isFunction;return zoe=function(s){var o=this,a=null,l,c=function(d){return d===s};return i(s)&&(c=s),e(this.items)&&(l=this.items.filter(function(u){return a!==!0&&(a=c(u)),a})),t(this.items)&&(l=Object.keys(this.items).reduce(function(u,d){return a!==!0&&(a=c(o.items[d])),a!==!1&&(u[d]=o.items[d]),u},{})),new this.constructor(l)},zoe}var Uoe,NMe;function nzt(){if(NMe)return Uoe;NMe=1;var n=Rc(),e=n.isArray,t=n.isObject,i=n.isFunction;return Uoe=function(s){var o=this,a=null,l,c=function(d){return d===s};return i(s)&&(c=s),e(this.items)&&(l=this.items.filter(function(u){return a!==!0&&(a=!c(u)),a})),t(this.items)&&(l=Object.keys(this.items).reduce(function(u,d){return a!==!0&&(a=!c(o.items[d])),a!==!1&&(u[d]=o.items[d]),u},{})),new this.constructor(l)},Uoe}var qoe,DMe;function izt(){return DMe||(DMe=1,qoe=function(e,t){var i=this.items.slice(e);return t!==void 0&&(i=i.slice(0,t)),new this.constructor(i)}),qoe}var Koe,RMe;function rzt(){if(RMe)return Koe;RMe=1;var n=Rc(),e=n.isFunction;return Koe=function(i,r,s){var o;if(e(i)?o=this.filter(i):o=this.where(i,r,s),o.isEmpty())throw new Error("Item not found.");if(o.count()>1)throw new Error("Multiple items found.");return o.first()},Koe}var Goe,PMe;function szt(){if(PMe)return Goe;PMe=1;var n=DQe();return Goe=n,Goe}var Yoe,OMe;function ozt(){return OMe||(OMe=1,Yoe=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)}),Yoe}var Qoe,MMe;function azt(){return MMe||(MMe=1,Qoe=function(){return this.sort().reverse()}),Qoe}var Xoe,jMe;function lzt(){if(jMe)return Xoe;jMe=1;var n=Ck(),e=Rc(),t=e.isFunction;return Xoe=function(r){var s=[].concat(this.items),o=function(l){return t(r)?r(l):n(l,r)};return s.sort(function(a,l){var c=o(a),u=o(l);return c==null?1:u==null||c<u?-1:c>u?1:0}),new this.constructor(s)},Xoe}var Zoe,FMe;function czt(){return FMe||(FMe=1,Zoe=function(e){return this.sortBy(e).reverse()}),Zoe}var Joe,BMe;function uzt(){return BMe||(BMe=1,Joe=function(){var e=this,t={};return Object.keys(this.items).sort().forEach(function(i){t[i]=e.items[i]}),new this.constructor(t)}),Joe}var eae,$Me;function dzt(){return $Me||($Me=1,eae=function(){var e=this,t={};return Object.keys(this.items).sort().reverse().forEach(function(i){t[i]=e.items[i]}),new this.constructor(t)}),eae}var tae,HMe;function hzt(){return HMe||(HMe=1,tae=function(e,t,i){var r=this.slice(e,t);if(this.items=this.diff(r.all()).all(),Array.isArray(i))for(var s=0,o=i.length;s<o;s+=1)this.items.splice(e+s,0,i[s]);return r}),tae}var nae,VMe;function fzt(){return VMe||(VMe=1,nae=function(e){for(var t=Math.round(this.items.length/e),i=JSON.parse(JSON.stringify(this.items)),r=[],s=0;s<e;s+=1)r.push(new this.constructor(i.splice(0,t)));return new this.constructor(r)}),nae}var iae,WMe;function pzt(){if(WMe)return iae;WMe=1;var n=d1(),e=Rc(),t=e.isFunction;return iae=function(r){var s=n(this.items),o=0;if(r===void 0)for(var a=0,l=s.length;a<l;a+=1)o+=parseFloat(s[a]);else if(t(r))for(var c=0,u=s.length;c<u;c+=1)o+=parseFloat(r(s[c]));else for(var d=0,f=s.length;d<f;d+=1)o+=parseFloat(s[d][r]);return parseFloat(o.toPrecision(12))},iae}var rae,zMe;function gzt(){if(zMe)return rae;zMe=1;function n(e){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}return rae=function(t){var i=this;if(!Array.isArray(this.items)&&n(this.items)==="object"){var r=Object.keys(this.items),s;t<0?s=r.slice(t):s=r.slice(0,t);var o={};return r.forEach(function(a){s.indexOf(a)!==-1&&(o[a]=i.items[a])}),new this.constructor(o)}return t<0?new this.constructor(this.items.slice(t)):new this.constructor(this.items.slice(0,t))},rae}var sae,UMe;function mzt(){if(UMe)return sae;UMe=1;var n=Rc(),e=n.isArray,t=n.isObject,i=n.isFunction;return sae=function(s){var o=this,a=null,l,c=function(d){return d===s};return i(s)&&(c=s),e(this.items)&&(l=this.items.filter(function(u){return a!==!1&&(a=!c(u)),a})),t(this.items)&&(l=Object.keys(this.items).reduce(function(u,d){return a!==!1&&(a=!c(o.items[d])),a!==!1&&(u[d]=o.items[d]),u},{})),new this.constructor(l)},sae}var oae,qMe;function _zt(){if(qMe)return oae;qMe=1;var n=Rc(),e=n.isArray,t=n.isObject,i=n.isFunction;return oae=function(s){var o=this,a=null,l,c=function(d){return d===s};return i(s)&&(c=s),e(this.items)&&(l=this.items.filter(function(u){return a!==!1&&(a=c(u)),a})),t(this.items)&&(l=Object.keys(this.items).reduce(function(u,d){return a!==!1&&(a=c(o.items[d])),a!==!1&&(u[d]=o.items[d]),u},{})),new this.constructor(l)},oae}var aae,KMe;function vzt(){return KMe||(KMe=1,aae=function(e){return e(this),this}),aae}var lae,GMe;function bzt(){return GMe||(GMe=1,lae=function(e,t){for(var i=1;i<=e;i+=1)this.items.push(t(i));return this}),lae}var cae,YMe;function yzt(){return YMe||(YMe=1,cae=function(){var e=this.constructor;function t(r,s){var o=[];r instanceof e?(r.items.forEach(function(a){return t(a,o)}),s.push(o)):Array.isArray(r)?(r.forEach(function(a){return t(a,o)}),s.push(o)):s.push(r)}if(Array.isArray(this.items)){var i=[];return this.items.forEach(function(r){t(r,i)}),i}return this.values().all()}),cae}var uae,QMe;function Czt(){if(QMe)return uae;QMe=1;function n(e){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}return uae=function(){return n(this.items)==="object"&&!Array.isArray(this.items)?JSON.stringify(this.all()):JSON.stringify(this.toArray())},uae}var dae,XMe;function wzt(){return XMe||(XMe=1,dae=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}),dae}var hae,ZMe;function xzt(){if(ZMe)return hae;ZMe=1;function n(i,r){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(i,a).enumerable})),s.push.apply(s,o)}return s}function e(i){for(var r=1;r<arguments.length;r++){var s=arguments[r]!=null?arguments[r]:{};r%2?n(Object(s),!0).forEach(function(o){t(i,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach(function(o){Object.defineProperty(i,o,Object.getOwnPropertyDescriptor(s,o))})}return i}function t(i,r,s){return r in i?Object.defineProperty(i,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[r]=s,i}return hae=function(){var r=this;if(Array.isArray(this.items))return this;var s={};return Object.keys(this.items).forEach(function(o){if(o.indexOf(".")!==-1){var a=s;o.split(".").reduce(function(l,c,u,d){return l[c]||(l[c]={}),u===d.length-1&&(l[c]=r.items[o]),l[c]},a),s=e(e({},s),a)}else s[o]=r.items[o]}),new this.constructor(s)},hae}var fae,JMe;function Szt(){return JMe||(JMe=1,fae=function(e,t,i){e?i(this):t(this)}),fae}var pae,e4e;function t4e(){return e4e||(e4e=1,pae=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}),pae}var gae,n4e;function i4e(){return n4e||(n4e=1,gae=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}),gae}var mae,r4e;function Ezt(){return r4e||(r4e=1,mae=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)}),mae}var _ae,s4e;function kzt(){if(s4e)return _ae;s4e=1;var n=Rc(),e=n.isFunction;return _ae=function(i){var r;if(i===void 0)r=this.items.filter(function(c,u,d){return d.indexOf(c)===u});else{r=[];for(var s=[],o=0,a=this.items.length;o<a;o+=1){var l=void 0;e(i)?l=i(this.items[o]):l=this.items[o][i],s.indexOf(l)===-1&&(r.push(this.items[o]),s.push(l))}}return new this.constructor(r)},_ae}var vae,o4e;function Tzt(){return o4e||(o4e=1,vae=function(e){return e instanceof this.constructor?e.all():e}),vae}var bae,a4e;function Izt(){if(a4e)return bae;a4e=1;var n=d1();return bae=function(){return new this.constructor(n(this.items))},bae}var yae,l4e;function Lzt(){return l4e||(l4e=1,yae=function(e,t,i){return e?t(this,e):i?i(this,e):this}),yae}var Cae,c4e;function Azt(){if(c4e)return Cae;c4e=1;var n=d1(),e=Ck();return Cae=function(i,r,s){var o=r,a=s,l=n(this.items);if(r===void 0||r===!0)return new this.constructor(l.filter(function(u){return e(u,i)}));if(r===!1)return new this.constructor(l.filter(function(u){return!e(u,i)}));s===void 0&&(a=r,o="===");var c=l.filter(function(u){switch(o){case"==":return e(u,i)===Number(a)||e(u,i)===a.toString();default:case"===":return e(u,i)===a;case"!=":case"<>":return e(u,i)!==Number(a)&&e(u,i)!==a.toString();case"!==":return e(u,i)!==a;case"<":return e(u,i)<a;case"<=":return e(u,i)<=a;case">":return e(u,i)>a;case">=":return e(u,i)>=a}});return new this.constructor(c)},Cae}var wae,u4e;function Nzt(){return u4e||(u4e=1,wae=function(e,t){return this.where(e,">=",t[0]).where(e,"<=",t[t.length-1])}),wae}var xae,d4e;function Dzt(){if(d4e)return xae;d4e=1;var n=d1(),e=Ck();return xae=function(i,r){var s=n(r),o=this.items.filter(function(a){return s.indexOf(e(a,i))!==-1});return new this.constructor(o)},xae}var Sae,h4e;function Rzt(){return h4e||(h4e=1,Sae=function(e){return this.filter(function(t){return t instanceof e})}),Sae}var Eae,f4e;function Pzt(){if(f4e)return Eae;f4e=1;var n=Ck();return Eae=function(t,i){return this.filter(function(r){return n(r,t)<i[0]||n(r,t)>i[i.length-1]})},Eae}var kae,p4e;function Ozt(){if(p4e)return kae;p4e=1;var n=d1(),e=Ck();return kae=function(i,r){var s=n(r),o=this.items.filter(function(a){return s.indexOf(e(a,i))===-1});return new this.constructor(o)},kae}var Tae,g4e;function Mzt(){return g4e||(g4e=1,Tae=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(e,"===",null)}),Tae}var Iae,m4e;function jzt(){return m4e||(m4e=1,Iae=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(e,"!==",null)}),Iae}var Lae,_4e;function Fzt(){if(_4e)return Lae;_4e=1;function n(e){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}return Lae=function(t){return t instanceof this.constructor?t:n(t)==="object"?new this.constructor(t):new this.constructor([t])},Lae}var Aae,v4e;function Bzt(){return v4e||(v4e=1,Aae=function(e){var t=this,i=e;i instanceof this.constructor&&(i=i.all());var r=this.items.map(function(s,o){return new t.constructor([s,i[o]])});return new this.constructor(r)}),Aae}var b4e;function $zt(){return b4e||(b4e=1,function(n){function e(s){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e(s)}function t(s){s!==void 0&&!Array.isArray(s)&&e(s)!=="object"?this.items=[s]:s instanceof this.constructor?this.items=s.all():this.items=s||[]}var i=AVt();typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=i),t.prototype.toJSON=function(){return this.items},t.prototype.all=NVt(),t.prototype.average=AQe(),t.prototype.avg=DVt(),t.prototype.chunk=RVt(),t.prototype.collapse=PVt(),t.prototype.combine=OVt(),t.prototype.concat=MVt(),t.prototype.contains=DQe(),t.prototype.containsOneItem=jVt(),t.prototype.count=FVt(),t.prototype.countBy=BVt(),t.prototype.crossJoin=$Vt(),t.prototype.dd=HVt(),t.prototype.diff=VVt(),t.prototype.diffAssoc=WVt(),t.prototype.diffKeys=zVt(),t.prototype.diffUsing=UVt(),t.prototype.doesntContain=qVt(),t.prototype.dump=KVt(),t.prototype.duplicates=GVt(),t.prototype.each=YVt(),t.prototype.eachSpread=QVt(),t.prototype.every=XVt(),t.prototype.except=ZVt(),t.prototype.filter=JVt(),t.prototype.first=eWt(),t.prototype.firstOrFail=tWt(),t.prototype.firstWhere=nWt(),t.prototype.flatMap=iWt(),t.prototype.flatten=rWt(),t.prototype.flip=sWt(),t.prototype.forPage=oWt(),t.prototype.forget=aWt(),t.prototype.get=lWt(),t.prototype.groupBy=cWt(),t.prototype.has=uWt(),t.prototype.implode=dWt(),t.prototype.intersect=hWt(),t.prototype.intersectByKeys=fWt(),t.prototype.isEmpty=pWt(),t.prototype.isNotEmpty=gWt(),t.prototype.join=mWt(),t.prototype.keyBy=_Wt(),t.prototype.keys=vWt(),t.prototype.last=bWt(),t.prototype.macro=yWt(),t.prototype.make=CWt(),t.prototype.map=wWt(),t.prototype.mapSpread=xWt(),t.prototype.mapToDictionary=SWt(),t.prototype.mapInto=EWt(),t.prototype.mapToGroups=kWt(),t.prototype.mapWithKeys=TWt(),t.prototype.max=IWt(),t.prototype.median=LWt(),t.prototype.merge=AWt(),t.prototype.mergeRecursive=NWt(),t.prototype.min=DWt(),t.prototype.mode=RWt(),t.prototype.nth=PWt(),t.prototype.only=OWt(),t.prototype.pad=MWt(),t.prototype.partition=jWt(),t.prototype.pipe=FWt(),t.prototype.pluck=BWt(),t.prototype.pop=$Wt(),t.prototype.prepend=HWt(),t.prototype.pull=VWt(),t.prototype.push=WWt(),t.prototype.put=zWt(),t.prototype.random=UWt(),t.prototype.reduce=qWt(),t.prototype.reject=KWt(),t.prototype.replace=GWt(),t.prototype.replaceRecursive=YWt(),t.prototype.reverse=QWt(),t.prototype.search=XWt(),t.prototype.shift=ZWt(),t.prototype.shuffle=JWt(),t.prototype.skip=ezt(),t.prototype.skipUntil=tzt(),t.prototype.skipWhile=nzt(),t.prototype.slice=izt(),t.prototype.sole=rzt(),t.prototype.some=szt(),t.prototype.sort=ozt(),t.prototype.sortDesc=azt(),t.prototype.sortBy=lzt(),t.prototype.sortByDesc=czt(),t.prototype.sortKeys=uzt(),t.prototype.sortKeysDesc=dzt(),t.prototype.splice=hzt(),t.prototype.split=fzt(),t.prototype.sum=pzt(),t.prototype.take=gzt(),t.prototype.takeUntil=mzt(),t.prototype.takeWhile=_zt(),t.prototype.tap=vzt(),t.prototype.times=bzt(),t.prototype.toArray=yzt(),t.prototype.toJson=Czt(),t.prototype.transform=wzt(),t.prototype.undot=xzt(),t.prototype.unless=Szt(),t.prototype.unlessEmpty=t4e(),t.prototype.unlessNotEmpty=i4e(),t.prototype.union=Ezt(),t.prototype.unique=kzt(),t.prototype.unwrap=Tzt(),t.prototype.values=Izt(),t.prototype.when=Lzt(),t.prototype.whenEmpty=i4e(),t.prototype.whenNotEmpty=t4e(),t.prototype.where=Azt(),t.prototype.whereBetween=Nzt(),t.prototype.whereIn=Dzt(),t.prototype.whereInstanceOf=Rzt(),t.prototype.whereNotBetween=Pzt(),t.prototype.whereNotIn=Ozt(),t.prototype.whereNull=Mzt(),t.prototype.whereNotNull=jzt(),t.prototype.wrap=Fzt(),t.prototype.zip=Bzt();var r=function(o){return new t(o)};n.exports=r,n.exports.collect=r,n.exports.default=r,n.exports.Collection=t}(use)),use.exports}var Hzt=$zt();const ql=Cl(Hzt);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 f4=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}`}},p4=(n,e,t)=>n+e+t>384;function g4(){return(n,e)=>"#"+n.replace(/^#/,"").replace(/../g,r=>{const s="0"+Math.min(255,Math.max(0,parseInt(r,16)+e)).toString(16),o=s.length;return s.substring(o-2,o)})}const Vzt={variant:"generic"};function as(n){n={...Vzt,...n};const e=Lo(),t=g4(),i={...n.style};n.variant==="primary"&&(i.backgroundColor=i.backgroundColor||e,i.color="white");const r=s=>{if(s.length===7){const{red:o,green:a,blue:l,hex:c}=f4(s),u=p4(o,a,l)?-220:220;return t(c,u)}};return h.jsx("span",{style:{...i,color:i.backgroundColor?r(i.backgroundColor):void 0},className:$t("text-xs px-2 py-1 rounded font-medium",{"bg-transparent":n.variant==="transparent","bg-[#A1A1AA] bg-opacity-15 text-[#A1A1AA]":n.variant==="generic","bg-white border bg-opacity-15 text-gray-500":n.variant==="white","bg-yellow-500 bg-opacity-15 text-yellow-500":n.variant==="yellow","bg-red-500 bg-opacity-15 text-red-500":n.variant==="red","bg-blue-300 bg-opacity-15 text-blue-300":n.variant==="light-blue","bg-blue-400 bg-opacity-15 text-blue-400":n.variant==="blue","bg-blue-700 bg-opacity-15 text-blue-700":n.variant==="dark-blue","bg-orange-500 bg-opacity-15 text-orange-500":n.variant==="orange","bg-green-500 bg-opacity-15 text-green-500":n.variant==="green","bg-black bg-opacity-15 text-black":n.variant==="black","bg-purple-500 bg-opacity-15 text-purple-500":n.variant==="purple"},n.className),children:n.children})}function Wzt(n){return Ui({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 PQe(n){return Ui({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 zzt(n){return Ui({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 q3r(n){return Ui({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 mb(n){return Ui({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 y4e(n){return Ui({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"}}]})(n)}function Uzt(n){return Ui({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(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 qzt({size:n="1rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 20 20",children:[h.jsx("rect",{x:"15",y:"7",width:"2",height:"10",rx:".5",ry:".5",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",fill:e}),h.jsx("rect",{x:"9",y:"11",width:"2",height:"6",rx:".5",ry:".5",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",fill:e}),h.jsx("rect",{x:"3",y:"15",width:"2",height:"2",rx:".5",ry:".5",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",fill:e}),h.jsx("polyline",{points:"6 3 10 3 10 7",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","data-color":"color-2"}),h.jsx("line",{x1:"10",y1:"3",x2:"3",y2:"10",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","data-color":"color-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 */function Kzt({color:n="#000",size:e="1.2rem"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M14.75,6H4.25c-.689,0-1.25-.561-1.25-1.25s.561-1.25,1.25-1.25c.414,0,.75-.336,.75-.75s-.336-.75-.75-.75c-1.517,0-2.75,1.233-2.75,2.75V13.25c0,1.517,1.233,2.75,2.75,2.75H14.75c.965,0,1.75-.785,1.75-1.75V7.75c0-.965-.785-1.75-1.75-1.75Zm-2,6.25c-.689,0-1.25-.561-1.25-1.25s.561-1.25,1.25-1.25,1.25,.561,1.25,1.25-.561,1.25-1.25,1.25Z",fill:n}),h.jsx("path",{d:"M6.03,5.005c-.111,0-.223-.024-.329-.076-.372-.182-.526-.631-.344-1.003l1.207-2.466c.203-.418,.559-.734,1-.888,.444-.153,.917-.125,1.337,.079l6.014,2.917c.373,.181,.528,.629,.348,1.002-.181,.373-.629,.528-1.002,.348l-6.015-2.917c-.081-.04-.153-.024-.191-.011-.037,.013-.104,.046-.143,.127l-1.208,2.468c-.13,.266-.397,.42-.674,.42Z",fill:n,"data-color":"color-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 */function Gzt({size:n="1.2rem",color:e="#000"}){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 20 20",children:h.jsx("path",{d:"m17.447,8.605l-1.278-.639c-.101-.307-.227-.602-.371-.887l.453-1.359c.12-.359.026-.756-.241-1.023l-.707-.707c-.267-.268-.664-.362-1.023-.242l-1.36.453c-.285-.144-.58-.269-.887-.371l-.639-1.278c-.17-.339-.516-.553-.895-.553h-1c-.379,0-.725.214-.895.553l-.639,1.278c-.307.101-.602.227-.887.371l-1.36-.453c-.359-.12-.756-.026-1.023.242l-.707.707c-.268.268-.361.664-.241,1.023l.453,1.359c-.144.285-.269.58-.371.887l-1.278.639c-.339.169-.553.516-.553.895v1c0,.379.214.725.553.895l1.278.639c.101.307.227.602.371.887l-.453,1.359c-.12.359-.026.756.241,1.023l.707.707c.19.191.446.293.707.293.105,0,.213-.017.316-.051l1.36-.453c.285.144.58.269.887.371l.639,1.278c.17.339.516.553.895.553h1c.379,0,.725-.214.895-.553l.639-1.278c.307-.101.602-.227.887-.371l1.36.453c.104.035.211.051.316.051.261,0,.517-.103.707-.293l.707-.707c.268-.268.361-.664.241-1.023l-.453-1.359c.144-.285.269-.58.371-.887l1.278-.639c.339-.169.553-.516.553-.895v-1c0-.379-.214-.725-.553-.895Zm-7.447,4.395c-1.657,0-3-1.343-3-3s1.343-3,3-3,3,1.343,3,3-1.343,3-3,3Z",strokeWidth:"0",fill: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 Yzt(){return[{name:"income",icon:qzt,visible:!0,iconColor:"#22C55E"},{name:"expense",icon:Kzt,visible:!0,iconColor:"#EF4444"},{name:"settings",icon:Gzt,visible:To(),iconColor:"#A1A1AA"}]}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 wu=Ls(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 wxe(n){const{isAdmin:e}=go(),{status:t}=n||{};return lr(["/api/v1/company_gateways",n],()=>Je("GET",ze("/api/v1/company_gateways?sort=id|desc&status=:status&per_page=:perPage",{status:t||"active",perPage:(n==null?void 0:n.perPage)??"100"})),{staleTime:1/0,enabled:e})}function Qzt(n){const{isAdmin:e}=go();return lr(["/api/v1/company_gateways",n.id,n.queryParams],()=>Je("GET",ze(`/api/v1/company_gateways/:id?${n.queryParams||""}`,{id:n.id})),{staleTime:1/0,enabled:(n.enabled??!0)&&e})}function Xzt(){const{isAdmin:n}=go();return lr(["/api/v1/company_gateways/create"],()=>Je("GET",ze("/api/v1/company_gateways/create")),{staleTime:1/0,enabled:n})}function OQe(){const n=Vs(),e=ji(wu);return async(t,i)=>(pe.processing(),Je("POST",ze("/api/v1/company_gateways/bulk"),{action:i,ids:t}).then(()=>{pe.success(`${i}d_company_gateway`),ii(["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 MQe(n){const{isAdmin:e,isOwner:t}=go();return lr(["/api/v1/bank_integrations",n.id],()=>Je("GET",ze("/api/v1/bank_integrations/:id",{id:n.id})).then(i=>i.data.data),{enabled:(n.enabled??!0)&&(e||t),staleTime:1/0})}function Zzt(n){const{perPage:e}=n||{};return lr(["/api/v1/bank_integrations"],()=>Je("GET",ze("/api/v1/bank_integrations?per_page=:perPage&status=active",{perPage:e??20})).then(t=>t.data.data),{staleTime:1/0})}function jQe(){const{isAdmin:n,isOwner:e}=go();return lr(["/api/v1/bank_integrations","create"],()=>Je("GET",ze("/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 xxe(n){return lr(["/api/v1/tax_rates",n],()=>Je("GET",ze("/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 Jzt(n){return lr(["/api/v1/tax_rates",n.id],()=>Je("GET",ze("/api/v1/tax_rates/:id",{id:n.id})),{staleTime:1/0})}function eUt(){const{isAdmin:n}=go();return lr(["/api/v1/tax_rates","create"],()=>Je("GET",ze("/api/v1/tax_rates/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function tUt(){return(n,e)=>{pe.processing(),Je("POST",ze("/api/v1/tax_rates/bulk"),{action:e,ids:[n]}).then(()=>{pe.success(`${e}d_tax_rate`),ii(["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 fs(n){return()=>{var t,i,r;const e=!!(((r=(i=(t=kO.getState().companyUsers.api)==null?void 0:t[kO.getState().companyUsers.currentIndex])==null?void 0:i.company)==null?void 0:r.enabled_modules)&n);return new Promise(s=>s(e))}}function FQe(){const n=zi();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 nUt(){const n=zi(),e=jo(),t=FQe(),{isAdmin:i,isOwner:r}=go(),{data:s}=wxe(),{data:o}=Zzt(),{data:a}=xxe({}),[l,c]=x.useState(),[u,d]=x.useState(),[f,p]=x.useState();return x.useEffect(()=>{s&&c(s.data.data),o&&d(o),a&&p(a.data.data)},[s,o,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(nr.Invoices)},{key:"recurring_invoice",url:"/recurring_invoices/create",section:"income",visible:e("create_recurring_invoice")&&t(nr.RecurringInvoices)},{key:"quote",url:"/quotes/create",section:"income",visible:e("create_quote")&&t(nr.Quotes)},{key:"credit",url:"/credits/create",section:"income",visible:e("create_credit")&&t(nr.Credits)},{key:"payment",url:"/payments/create",section:"income",visible:e("create_payment")},{key:"subscription",url:"/settings/subscriptions/create",section:"income",visible:(Vy()||$u())&&(i||r)},{key:"expense",url:"/expenses/create",section:"expense",visible:e("create_expense")&&t(nr.Expenses)},{key:"purchase_order",url:"/purchase_orders/create",section:"expense",visible:e("create_purchase_order")&&t(nr.PurchaseOrders)},{key:"vendor",url:"/vendors/create",section:"expense",visible:e("create_vendor")&&t(nr.Vendors)},{key:"transaction",url:"/transactions/create",section:"expense",visible:e("create_bank_transaction")&&t(nr.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:$u()&&!(u!=null&&u.length)&&(i||r)},{key:"tax_settings",url:"/settings/tax_rates/create",section:"settings",visible:!(f!=null&&f.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:(Vy()||$u())&&(i||r)}]}const iUt=As.div` &:hover { background-color: ${n=>n.theme.hoverColor}; font-weight: 500; } `,rUt=As(CL.Button)` background-color: ${n=>n.theme.backgroundColor}; &:hover { background-color: ${n=>n.theme.hoverBackgroundColor}; } &:focus { background-color: ${n=>n.theme.hoverBackgroundColor}; } `;function sUt(){var a;const[n]=xe(),e=Vw(),t=xt(),i=nUt(),r=Yzt(),s=hv(),o=!!((a=s==null?void 0:s.company_user)!=null&&a.react_settings.show_mini_sidebar);return h.jsx(CL,{className:"relative",children:()=>h.jsxs(h.Fragment,{children:[h.jsx(rUt,{"data-cy":"quickPopoverButton",className:"flex items-center justify-center h-10 w-10 rounded-lg border shadow-sm focus:outline-none",style:{height:"2.3rem",borderColor:t.$5},theme:{hoverBackgroundColor:t.$4,backgroundColor:t.$1},children:h.jsx(an,{element:y4e,size:23,style:{color:t.$3}})}),h.jsx(fb,{as:x.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:h.jsx(CL.Panel,{className:$t("absolute z-10 mt-1.5 w-screen max-w-md -translate-x-1/2 transform px-2",{"left-14 md:left-0 md:max-w-2xl lg:max-w-3xl lg:left-full":To(),"left-14 md:left-56 md:max-w-2xl lg:max-w-3xl":To(),"left-14 md:left-8 lg:max-w-xl lg:left-full":!o,"left-14 md:left-8 lg:max-w-xl lg:left-28":o}),children:h.jsx("div",{className:"overflow-hidden rounded-lg shadow-2xl ring-1 ring-black ring-opacity-5",children:h.jsx("div",{style:{backgroundColor:t.$1},className:$t("relative grid gap-y-4 gap-x-2 md:gap-y-0 px-3 py-5 grid-cols-2",{"md:grid-cols-3":To()}),children:r.map(l=>l.visible&&h.jsxs("div",{className:"flex flex-col items-start rounded-lg transition duration-150 ease-in-out",children:[h.jsxs("div",{className:"flex items-center px-2",children:[h.jsx(l.icon,{color:l.iconColor,size:"1.3rem"}),h.jsx("p",{style:{color:t.$3},className:"text-sm tracking-wide font-medium ml-1 md:ml-2",children:n(l.name)})]}),h.jsx("div",{className:"flex flex-col w-full mt-2 space-y-2",children:i.map(c=>c.section===l.name&&c.visible&&h.jsxs(iUt,{theme:{hoverColor:t.$4,textColor:t.$3,hoverTextColor:t.$3},className:"flex items-center space-x-2 py-2 pl-2 cursor-pointer rounded",onClick:()=>e({url:c.url,externalLink:c.externalLink}),children:[h.jsx(y4e,{className:"hover:font-medium",size:21,style:{color:t.$3}}),h.jsx("span",{className:"text-sm",style:{color:t.$3},children:n(c.key)})]},c.key))})]},l.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 oUt(){const n=Vm();return go(),new Date(n==null?void 0:n.plan_expires)<new Date,To()}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function aUt(){const n=Vm(),{isAdmin:e,isOwner:t}=go(),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 NF=(n=>(n.Company="company",n.Group="group",n.Client="client",n))(NF||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Sxe(){const n=Cu(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 el(){const n=Sxe(),e=NF.Company===n.level,t=NF.Group===n.level,i=NF.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 lUt(){const[n]=xe(),e=gc(),{isCompanySettingsActive:t}=el(),{isOwner:i,isAdmin:r}=go(),s=[{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}],o=[{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_invoicing"),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:s,advanced:o}}const BQe=Ls(null);function K3r(n,e=[]){const[t,i]=oo(BQe),{displayButton:r=!0}=n||{};return x.useEffect(()=>(n&&r&&i(n),n&&!r&&i(null),()=>{i(null)}),e),t}const cUt=Ls(null);function uUt(n,e=[]){const[t,i]=oo(cUt);return x.useEffect(()=>(n&&i(n),()=>{i(null)}),e),t}function dUt(){const[n]=xe();return Ml(),null}function hUt(){const[n]=xe(),e=zi(),t=Ml();return!e||!(t!=null&&t.email_verified_at)||e&&!e.is_disabled?null:h.jsx(CL,{className:"relative",children:h.jsx("div",{className:"max-w-max rounded-lg bg-[#FCD34D] px-6 py-4 shadow-lg",children:h.jsxs("div",{className:"flex items-center justify-center space-x-1",children:[h.jsxs("span",{className:"text-sm",children:[n("company_disabled_warning"),"."]}),h.jsx(r1,{className:"cursor-pointer text-sm font-semibold underline hover:no-underline",to:"/settings/account_management/overview",children:n("activate_company")})]})})})}var Nae={};/*! For license information please see index.js.LICENSE.txt */var C4e;function fUt(){return C4e||(C4e=1,function(n){(()=>{var e={184:(a,l)=>{var c;(function(){var u={}.hasOwnProperty;function d(){for(var f=[],p=0;p<arguments.length;p++){var g=arguments[p];if(g){var m=typeof g;if(m==="string"||m==="number")f.push(g);else if(Array.isArray(g)){if(g.length){var _=d.apply(null,g);_&&f.push(_)}}else if(m==="object"){if(g.toString!==Object.prototype.toString&&!g.toString.toString().includes("[native code]")){f.push(g.toString());continue}for(var v in g)u.call(g,v)&&g[v]&&f.push(v)}}}return f.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),f=c(645),p=c.n(f)()(d());p.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=p},645:a=>{a.exports=function(l){var c=[];return c.toString=function(){return this.map(function(u){var d="",f=u[5]!==void 0;return u[4]&&(d+="@supports (".concat(u[4],") {")),u[2]&&(d+="@media ".concat(u[2]," {")),f&&(d+="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {")),d+=l(u),f&&(d+="}"),u[2]&&(d+="}"),u[4]&&(d+="}"),d}).join("")},c.i=function(u,d,f,p,g){typeof u=="string"&&(u=[[null,u,void 0]]);var m={};if(f)for(var _=0;_<this.length;_++){var v=this[_][0];v!=null&&(m[v]=!0)}for(var b=0;b<u.length;b++){var y=[].concat(u[b]);f&&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),p&&(y[4]?(y[1]="@supports (".concat(y[4],") {").concat(y[1],"}"),y[4]=p):y[4]="".concat(p)),c.push(y))}},c}},81:a=>{a.exports=function(l){return l[1]}},703:(a,l,c)=>{var u=c(414);function d(){}function f(){}f.resetWarningCache=d,a.exports=function(){function p(_,v,b,y,C,S){if(S!==u){var k=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw k.name="Invariant Violation",k}}function g(){return p}p.isRequired=p;var m={array:p,bigint:p,bool:p,func:p,number:p,object:p,string:p,symbol:p,any:p,arrayOf:g,element:p,elementType:p,instanceOf:g,node:p,objectOf:g,oneOf:g,oneOfType:g,shape:g,exact:g,checkPropTypes:f,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=dv();var l=i.n(a),c=i(184),u=i.n(c),d=i(697),f=i.n(d),p=i(28);function g(N){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},g(N)}var m=["className","type"],_=["className"];function v(N,P,O){return(P=function(F){var V=function(M,B){if(g(M)!=="object"||M===null)return M;var W=M[Symbol.toPrimitive];if(W!==void 0){var q=W.call(M,"string");if(g(q)!=="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(M)}(F);return g(V)==="symbol"?V:String(V)}(P))in N?Object.defineProperty(N,P,{value:O,enumerable:!0,configurable:!0,writable:!0}):N[P]=O,N}function b(){return b=Object.assign?Object.assign.bind():function(N){for(var P=1;P<arguments.length;P++){var O=arguments[P];for(var F in O)Object.prototype.hasOwnProperty.call(O,F)&&(N[F]=O[F])}return N},b.apply(this,arguments)}function y(N,P){if(N==null)return{};var O,F,V=function(B,W){if(B==null)return{};var q,U,G={},H=Object.keys(B);for(U=0;U<H.length;U++)q=H[U],W.indexOf(q)>=0||(G[q]=B[q]);return G}(N,P);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(N);for(F=0;F<M.length;F++)O=M[F],P.indexOf(O)>=0||Object.prototype.propertyIsEnumerable.call(N,O)&&(V[O]=N[O])}return V}function C(N,P){return function(O){if(Array.isArray(O))return O}(N)||function(O,F){var V=O==null?null:typeof Symbol<"u"&&O[Symbol.iterator]||O["@@iterator"];if(V!=null){var M,B,W,q,U=[],G=!0,H=!1;try{if(W=(V=V.call(O)).next,F!==0)for(;!(G=(M=W.call(V)).done)&&(U.push(M.value),U.length!==F);G=!0);}catch(z){H=!0,B=z}finally{try{if(!G&&V.return!=null&&(q=V.return(),Object(q)!==q))return}finally{if(H)throw B}}return U}}(N,P)||S(N,P)||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 S(N,P){if(N){if(typeof N=="string")return k(N,P);var O=Object.prototype.toString.call(N).slice(8,-1);return O==="Object"&&N.constructor&&(O=N.constructor.name),O==="Map"||O==="Set"?Array.from(N):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?k(N,P):void 0}}function k(N,P){(P==null||P>N.length)&&(P=N.length);for(var O=0,F=new Array(P);O<P;O++)F[O]=N[O];return F}var I=(0,a.forwardRef)(function(N,P){var O=N.value,F=N.length,V=N.validChars,M=N.placeholder,B=N.autoFocus,W=N.passwordMode,q=N.inputProps,U=N.containerProps,G=N.classNames,H=N.onChange,z=N.onFocus,Z=N.onBlur,X=N.onComplete,oe=C((0,a.useState)(""),2),fe=oe[0],Se=oe[1],Me=C((0,a.useState)(!1),2),Ie=Me[0],ge=Me[1],ye=(0,a.useRef)(null);(0,a.useEffect)(function(){B&&ye.current.focus()},[B]);var Pe,Be=function(){ye.current.focus()},$e=function(){return O??fe},qe=q.className,mt=q.type,vt=y(q,m),ft=U.className,tt=y(U,_);return l().createElement("div",{className:"vi__wrapper"},l().createElement("input",b({"aria-label":"verification input",spellCheck:!1,value:$e(),onChange:function(St){var Ft=St.target.value.replace(/\s/g,"");RegExp("^[".concat(V,"]{0,").concat(F,"}$")).test(Ft)&&(H&&(H==null||H(Ft)),Se(Ft),Ft.length===F&&(X==null||X(Ft)))},ref:function(St){ye.current=St,typeof P=="function"?P(St):P&&(P.current=St)},className:u()("vi",qe),onKeyDown:function(St){["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(St.key)&&St.preventDefault()},onFocus:function(){ge(!0),z==null||z()},onBlur:function(){ge(!1),Z==null||Z()},onSelect:function(St){var Ft=St.target.value;St.target.setSelectionRange(Ft.length,Ft.length)},type:W?"password":mt},vt)),l().createElement("div",b({"data-testid":"container",className:u()("vi__container",G.container,ft),onClick:function(){return ye.current.focus()}},tt),(Pe=Array(F),function(St){if(Array.isArray(St))return k(St)}(Pe)||function(St){if(typeof Symbol<"u"&&St[Symbol.iterator]!=null||St["@@iterator"]!=null)return Array.from(St)}(Pe)||S(Pe)||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(St,Ft){var en;return l().createElement("div",{className:u()("vi__character",G.character,(en={"vi__character--selected":($e().length===Ft||$e().length===Ft+1&&F===Ft+1)&&Ie},v(en,G.characterSelected,($e().length===Ft||$e().length===Ft+1&&F===Ft+1)&&Ie),v(en,"vi__character--inactive",$e().length<Ft),v(en,G.characterInactive,$e().length<Ft),en)),onClick:Be,id:"field-".concat(Ft),"data-testid":"character-".concat(Ft),key:Ft},W&&$e()[Ft]?"*":$e()[Ft]||M)})),l().createElement("style",{dangerouslySetInnerHTML:{__html:p.Z}}))});I.displayName="VerificationInput",I.propTypes={value:f().string,length:f().number,validChars:f().string,placeholder:f().string,autoFocus:f().bool,passwordMode:f().bool,inputProps:f().object,containerProps:f().object,classNames:f().shape({container:f().string,character:f().string,characterInactive:f().string,characterSelected:f().string}),onChange:f().func,onFocus:f().func,onBlur:f().func,onComplete:f().func},I.defaultProps={length:6,validChars:"A-Za-z0-9",placeholder:"·",autoFocus:!1,inputProps:{},containerProps:{},classNames:{}};const L=I})();var s=n;for(var o in r)s[o]=r[o];r.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})()}(Nae)),Nae}var pUt=fUt();const $Qe=Cl(pUt);function gUt(){const[n]=xe(),[e,t]=x.useState(!1);Ml();const i=Vm();return zi(),null}const ah=[];for(let n=0;n<256;++n)ah.push((n+256).toString(16).slice(1));function mUt(n,e=0){return(ah[n[e+0]]+ah[n[e+1]]+ah[n[e+2]]+ah[n[e+3]]+"-"+ah[n[e+4]]+ah[n[e+5]]+"-"+ah[n[e+6]]+ah[n[e+7]]+"-"+ah[n[e+8]]+ah[n[e+9]]+"-"+ah[n[e+10]]+ah[n[e+11]]+ah[n[e+12]]+ah[n[e+13]]+ah[n[e+14]]+ah[n[e+15]]).toLowerCase()}let Dae;const _Ut=new Uint8Array(16);function vUt(){if(!Dae){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Dae=crypto.getRandomValues.bind(crypto)}return Dae(_Ut)}const bUt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),w4e={randomUUID:bUt};function MJ(n,e,t){var r;if(w4e.randomUUID&&!n)return w4e.randomUUID();n=n||{};const i=n.random??((r=n.rng)==null?void 0:r.call(n))??vUt();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,mUt(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 x4e({color:n="#000",size:e="1.3rem"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M15.25,16c-.192,0-.384-.073-.53-.22l-3.965-3.965c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l3.965,3.965c.293,.293,.293,.768,0,1.061-.146,.146-.338,.22-.53,.22Z",fill:n,"data-color":"color-2"}),h.jsx("path",{d:"M7.75,13.5c-3.17,0-5.75-2.58-5.75-5.75S4.58,2,7.75,2s5.75,2.58,5.75,5.75-2.58,5.75-5.75,5.75Zm0-10c-2.343,0-4.25,1.907-4.25,4.25s1.907,4.25,4.25,4.25,4.25-1.907,4.25-4.25-1.907-4.25-4.25-4.25Z",fill: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 yUt({color:n="#000",size:e="1.5rem"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 20 20",children:[h.jsx("polyline",{points:"16.5 13.5 13 17 9.5 13.5",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","data-color":"color-2"}),h.jsx("line",{x1:"13",y1:"17",x2:"13",y2:"9",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","data-color":"color-2"}),h.jsx("polyline",{points:"3.5 6.5 7 3 10.5 6.5",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),h.jsx("line",{x1:"7",y1:"3",x2:"7",y2:"11",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"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 */function CUt({color:n="#000",size:e="1.3rem"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:e,height:e,viewBox:"0 0 12 12",children:[h.jsx("path",{d:"m9.75,7.5H1.25c-.4141,0-.75-.3359-.75-.75s.3359-.75.75-.75h8.5c.1377,0,.25-.1123.25-.25v-2.5c0-.1377-.1123-.25-.25-.25h-1.75c-.4141,0-.75-.3359-.75-.75s.3359-.75.75-.75h1.75c.9648,0,1.75.7852,1.75,1.75v2.5c0,.9648-.7852,1.75-1.75,1.75Z",fill:n,strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m3.75,10.25c-.1919,0-.3838-.0732-.5303-.2197L.4697,7.2803c-.293-.293-.293-.7676,0-1.0605l2.75-2.75c.293-.293.7676-.293,1.0605,0s.293.7676,0,1.0605l-2.2197,2.2197,2.2197,2.2197c.293.293.293.7676,0,1.0605-.1465.1465-.3384.2197-.5303.2197Z",strokeWidth:"0",fill:n})]})}function Np({title:n,hasResults:e}){const[t]=xe();return e?h.jsx("div",{className:"px-4 mt-4 mb-2 first:mt-0",children:h.jsx("span",{className:"text-xs font-medium text-gray-400",children:t(n)})}):null}const wUt=As.div` color: ${n=>n.theme.color}; background-color: ${n=>n.theme.backgroundColor}; `;function Dp({entry:n,index:e,selectedIndex:t,setSelectedIndex:i,isContainerScrolling:r,setIsModalOpen:s}){var c;const o=xt(),a=Yi(),l=Vw();return h.jsx(wUt,{theme:{backgroundColor:e===t?o.$5:"transparent",color:o.$3},className:"cursor-pointer py-2.5 font-medium active:font-semibold search-option text-sm px-4",onClick:()=>{n.resource&&l({fn:()=>{n.resource&&(a(n.resource.path),s(!1))}})},onMouseMove:()=>{!r&&t!==e&&setTimeout(()=>i(e),20)},style:{borderRadius:"0.25rem"},children:h.jsxs("div",{children:[h.jsx("p",{className:"text-xs font-semibold",children:(c=n.resource)==null?void 0:c.heading}),h.jsx("p",{children:n.label})]})},n.id)}function xUt({groups:n,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r}){let s=0;return h.jsxs(h.Fragment,{children:[h.jsx(Np,{title:"clients",hasResults:n.clients.length>0}),n.clients.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"invoices",hasResults:n.invoices.length>0}),n.invoices.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"recurring_invoices",hasResults:n.recurring_invoices.length>0}),n.recurring_invoices.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"payments",hasResults:n.payments.length>0}),n.payments.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"quotes",hasResults:n.quotes.length>0}),n.quotes.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"credits",hasResults:n.credits.length>0}),n.credits.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"projects",hasResults:n.projects.length>0}),n.projects.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"tasks",hasResults:n.tasks.length>0}),n.tasks.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"vendors",hasResults:n.vendors.length>0}),n.vendors.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"vendor_contacts",hasResults:n.vendor_contacts.length>0}),n.vendor_contacts.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"purchase_orders",hasResults:n.purchase_orders.length>0}),n.purchase_orders.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"expenses",hasResults:n.expenses.length>0}),n.expenses.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"settings",hasResults:n.settings.length>0}),n.settings.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)}),h.jsx(Np,{title:"other",hasResults:n.other.length>0}),n.other.map(o=>{const a=s++;return h.jsx(Dp,{entry:o,index:a,selectedIndex:e,setSelectedIndex:t,isContainerScrolling:i,setIsModalOpen:r},o.id)})]})}function SUt(){const[n]=xe(),e=Yi(),t=Vw(),i=xt(),r=x.useRef(null),s=x.useRef(null),o=x.useRef(void 0),[a,l]=x.useState(""),[c,u]=x.useState(!1),[d,f]=x.useState(-1),[p,g]=x.useState(!1),m=ji(GZ),{data:_,refetch:v,isFetching:b}=lr(["/api/v1/search"],()=>{const N=a.length===0?"/api/v1/search":`/api/v1/search?search=${a}`;return Je("POST",ze(N)).then(P=>{const O=[];return Object.entries(P.data).forEach(([F,V])=>{V.forEach(M=>{O.push({id:MJ(),label:M.name,value:M.id,resource:M,searchable:`${n(F)}: ${M.name}`,eventType:"external"})})}),O})},{staleTime:1/0}),y=ql(_).filter(N=>N.searchable.toLowerCase().includes(a.toLowerCase())||N.label.toLowerCase().includes(a.toLowerCase())||N.value.toString().toLowerCase().includes(a.toLowerCase())).take(100),C=y.count()===0?ql(_):y,S=pn.debounce(N=>l(N),500),k=N=>{var O,F,V;const P=(C==null?void 0:C.count())||0;switch(N.key){case"ArrowDown":N.preventDefault(),document.activeElement===r.current?(f(0),(O=r.current)==null||O.blur()):f(M=>M>=P-1?0:M+1);break;case"ArrowUp":N.preventDefault(),document.activeElement===r.current?(f(0),(F=r.current)==null||F.blur()):d===0?((V=r.current)==null||V.focus(),f(-1)):f(M=>M<=0?P-1:M-1);break;case"Enter":if(N.preventDefault(),d>=0&&C){const M=C.get(d);t({fn:()=>{M!=null&&M.resource&&(e(M.resource.path),u(!1))}})}break}},I=N=>{N.ctrlKey&&N.key==="k"&&(N.preventDefault(),u(P=>!P))};x.useEffect(()=>(window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)),[]),x.useEffect(()=>{var P;const N=O=>{k(O)};if(c){if(window.addEventListener("keydown",N),d!==-1&&s.current){const O=s.current,V=Array.from(O.getElementsByClassName("search-option"))[d];if(V)if(d===0)O.scrollTo({top:0,behavior:"smooth"});else{const M=O.getBoundingClientRect(),B=V.getBoundingClientRect();B.top>=M.top&&B.bottom<=M.bottom||V.scrollIntoView({behavior:"smooth",block:"nearest"})}}d!==-1&&((P=r.current)==null||P.blur())}return()=>window.removeEventListener("keydown",N)},[d,c]),x.useEffect(()=>{c||l("")},[c]),x.useEffect(()=>{a&&y.count()===0&&v(),f(-1)},[a]);const L=N=>{const P={clients:[],invoices:[],recurring_invoices:[],payments:[],quotes:[],credits:[],projects:[],tasks:[],purchase_orders:[],settings:[],products:[],expenses:[],vendors:[],vendor_contacts:[],other:[]};return N.forEach(O=>{var V,M;switch((V=O.resource)!=null&&V.path.startsWith("/settings")?"/settings":(M=O.resource)==null?void 0:M.type){case"/client":P.clients.push(O);break;case"/invoice":P.invoices.push(O);break;case"/recurring_invoice":P.recurring_invoices.push(O);break;case"/payment":P.payments.push(O);break;case"/quote":P.quotes.push(O);break;case"/credit":P.credits.push(O);break;case"/expense":P.expenses.push(O);break;case"/vendor":P.vendors.push(O);break;case"/vendor_contact":P.vendor_contacts.push(O);break;case"/project":P.projects.push(O);break;case"/task":P.tasks.push(O);break;case"/purchase_order":P.purchase_orders.push(O);break;case"/settings":P.settings.push(O);break;default:P.other.push(O)}}),P};return h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>u(!0),className:"lg:hidden flex justify-end items-end",children:h.jsx(an,{element:Uzt,size:22,style:{color:i.$3}})}),h.jsxs("div",{className:"hidden lg:flex items-center border rounded-md p-1.5 space-x-5",onClick:()=>u(!0),style:{height:"2.3rem",borderColor:i.$5},children:[h.jsxs("div",{className:"flex items-center space-x-1.5 pl-1",children:[h.jsx(x4e,{color:i.$17}),h.jsx("p",{className:"text-sm",style:{color:i.$17},children:n("search_placeholder")})]}),h.jsx("div",{className:"flex items-center border px-1.5 py-0.5",style:{borderColor:i.$5,borderRadius:"0.25rem"},children:h.jsx("p",{className:"text-sm",style:{color:i.$17},children:"Ctrl+K"})})]}),h.jsx(pr,{visible:c,onClose:()=>u(!1),disableClosing:!0,enableCloseOnClickAway:!m,withoutPadding:!0,size:"regular",children:h.jsxs("div",{className:"flex flex-col",style:{backgroundColor:i.$1},children:[h.jsxs("div",{className:"flex flex-col pb-3",children:[h.jsx("div",{className:"flex items-center space-x-3",children:h.jsxs("div",{className:"flex items-center space-x-1.5 py-2 px-4 flex-1 border-b",children:[b?h.jsx(yo,{}):h.jsx(x4e,{color:i.$5,size:"1.6rem"}),h.jsx("div",{className:"flex-1",children:h.jsx(lt,{className:"border-transparent focus:border-transparent focus:ring-0 border-0 w-full px-0",innerRef:r,value:a,onValueChange:N=>S(N),onClick:()=>f(-1),placeholder:n("search_placeholder"),changeOverride:!0,style:{backgroundColor:i.$1,color:i.$3}})})]})}),h.jsx("div",{ref:s,className:"flex flex-col overflow-y-auto h-96 px-1 pt-3",onMouseLeave:()=>d!==-1&&f(-1),onScroll:()=>{g(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{g(!1)},50)},children:h.jsx(xUt,{groups:L(C.toArray()||[]),selectedIndex:d,setSelectedIndex:f,isContainerScrolling:p,setIsModalOpen:u})})]}),h.jsxs("div",{className:"flex items-center justify-between",style:{backgroundColor:i.$5,paddingLeft:"1.125rem",paddingRight:"1.125rem"},children:[h.jsxs("div",{className:"flex items-center py-2 space-x-3",children:[h.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[h.jsx("div",{children:h.jsx(yUt,{color:i.$3,size:"1.3rem"})}),h.jsx("span",{className:"mb-0.5",style:{color:i.$3},children:n("navigate")})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-sm px-3",children:[h.jsx("div",{children:h.jsx(CUt,{color:i.$3,size:"1.1rem"})}),h.jsx("span",{className:"mb-0.5",style:{color:i.$3},children:n("select")})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-sm px-3",children:[h.jsx("span",{className:"font-semibold",style:{color:i.$3},children:"ESC"}),h.jsx("span",{style:{color:i.$3},children:n("close")})]})]}),h.jsxs("div",{className:"flex cursor-pointer items-center space-x-2 text-sm px-3",onClick:()=>{window.open("https://invoiceninja.github.io","_blank")},children:[h.jsx("span",{className:"mb-0.5",style:{color:i.$3},children:n("docs")}),h.jsx("div",{children:h.jsx(cqe,{color:i.$3,size:"1.15rem"})})]})]})]})})]})}const EUt=x.memo(SUt);function L8({children:n,className:e}){return h.jsx("div",{className:$t("inline-flex items-center space-x-2",e),children:n})}function kUt(n){const e=xt(),{withoutHeaderBorder:t}=n;return h.jsx(fb.Root,{show:n.visible,as:x.Fragment,children:h.jsx(iI,{as:"div",className:"relative z-10",onClose:n.onClose,children:h.jsx("div",{className:"pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16",children:h.jsx(fb.Child,{as:x.Fragment,enter:"transform transition ease-in-out duration-300",enterFrom:"translate-x-full",enterTo:"translate-x-0",leave:"transform transition ease-in-out duration-200",leaveFrom:"translate-x-0",leaveTo:"translate-x-full",children:h.jsx(iI.Panel,{className:$t("pointer-events-auto","w-screen",{"max-w-xl":n.size==="large","max-w-sm":n.size==="small","max-w-md":n.size==="regular","max-w-xs":n.size==="extraSmall","max-w-4xl":n.size==="extraLarge"}),children:h.jsxs("form",{onSubmit:i=>i.preventDefault(),className:"border flex h-full flex-col shadow-xl",style:{backgroundColor:e.$1,borderColor:e.$20},children:[h.jsxs("div",{className:"flex flex-col flex-1 h-0 overflow-y-auto",children:[h.jsx("div",{className:$t("py-4 px-4 sm:px-6",{"border-b":!t}),style:{borderColor:e.$4},children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("span",{className:"text-lg font-medium max-w-sm truncate",style:{color:e.$3},children:n.title}),h.jsxs(L8,{children:[n.topRight,h.jsx(SO,{fontSize:20,className:"cursor-pointer",onClick:()=>n.onClose(),color:e.$3})]})]})}),h.jsx("div",{className:"flex flex-1 flex-col justify-between items-center",children:h.jsx("div",{className:$t("flex flex-col flex-1 w-full",{"p-4":n.withContainer,"divide-y":!n.withoutDivider}),style:{borderColor:e.$20},children:n.children})})]}),n.actionChildren&&h.jsx("div",{className:$t("flex justify-center border-t",{"p-4":!n.withoutActionContainer}),style:{borderColor:e.$20},children:n.actionChildren})]})})})})})})}const Exe={},TUt=Symbol((Exe?"production":void 0)!=="production"?"RESET":""),IUt=n=>typeof(n==null?void 0:n.then)=="function";function HQe(n=()=>{try{return window.localStorage}catch(t){(Exe?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(t);return}},e){var t;let i,r;const s={getItem:(l,c)=>{var u,d;const f=g=>{if(g=g||"",i!==g){try{r=JSON.parse(g,e==null?void 0:e.reviver)}catch{return c}i=g}return r},p=(d=(u=n())==null?void 0:u.getItem(l))!=null?d:null;return IUt(p)?p.then(f):f(p)},setItem:(l,c)=>{var u;return(u=n())==null?void 0:u.setItem(l,JSON.stringify(c,void 0))},removeItem:l=>{var c;return(c=n())==null?void 0:c.removeItem(l)}},o=l=>(c,u,d)=>l(c,f=>{let p;try{p=JSON.parse(f||"")}catch{p=d}u(p)});let a;try{a=(t=n())==null?void 0:t.subscribe}catch{}return!a&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(a=(l,c)=>{if(!(n()instanceof window.Storage))return()=>{};const u=d=>{d.storageArea===n()&&d.key===l&&c(d.newValue)};return window.addEventListener("storage",u),()=>{window.removeEventListener("storage",u)}}),a&&(s.subscribe=o(a)),s}const LUt=HQe();function jJ(n,e,t=LUt,i){const r=Ls(e);return(Exe?"production":void 0)!=="production"&&(r.debugPrivate=!0),r.onMount=o=>{o(t.getItem(n,e));let a;return t.subscribe&&(a=t.subscribe(n,o,e)),a},Ls(o=>o(r),(o,a,l)=>{const c=typeof l=="function"?l(o(r)):l;return c===TUt?(a(r,e),t.removeItem(n)):c instanceof Promise?c.then(u=>(a(r,u),t.setItem(n,u))):(a(r,c),t.setItem(n,c))})}var Rae,S4e;function AUt(){if(S4e)return Rae;S4e=1;var n=function(s){return s instanceof RegExp},e=function(o){var a=/[\\^$.*+?()[\]{}|]/g,l=RegExp(a.source);return o&&l.test(o)?o.replace(a,"\\$&"):o},t=function(s){return typeof s=="string"},i=function(s){var o=[];return s.forEach(function(a){Array.isArray(a)?o=o.concat(a):o.push(a)}),o};function r(s,o,a){var l=0,c=0;if(s==="")return s;if(!s||!t(s))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var u=o;n(u)||(u=new RegExp("("+e(u)+")","gi"));for(var d=s.split(u),f=1,p=d.length;f<p;f+=2){if(d[f]===void 0||d[f-1]===void 0){console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");continue}c=d[f].length,l+=d[f-1].length,d[f]=a(d[f],f,l),l+=c}return d}return Rae=function(o,a,l){return Array.isArray(o)||(o=[o]),i(o.map(function(c){return t(c)?r(c,a,l):c}))},Rae}var NUt=AUt();const _9=Cl(NUt);function DUt(){const n=t=>!!(t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||x.isValidElement(t)),e=t=>n(t)?t:"";return(t,i)=>{try{if(typeof t!="string")return"";let r=t;for(const[s,o]of Object.entries(i)){const a=e(o);r=_9(r,`:${s}`,(l,c)=>h.jsx(x.Fragment,{children:a},`${s}-${c}`))}return Array.isArray(r)?h.jsx(x.Fragment,{children:r}):r}catch{return 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 RUt({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("line",{x1:"1.75",y1:"7.25",x2:"16.25",y2:"7.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"4.25",y1:"11.25",x2:"7.25",y2:"11.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M16.25,9.471v-3.721c0-1.104-.895-2-2-2H3.75c-1.105,0-2,.896-2,2v6.5c0,1.104,.895,2,2,2h6.052",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("polyline",{points:"12.244 14.75 13.853 16.25 17.25 11.75",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"})]})}function PUt(n){return Ui({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z"}}]})(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 OUt({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("line",{x1:"1.75",y1:"7.25",x2:"16.25",y2:"7.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"4.25",y1:"11.25",x2:"7.25",y2:"11.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M16.25,8.274v-2.524c0-1.104-.895-2-2-2H3.75c-1.105,0-2,.896-2,2v6.5c0,1.104,.895,2,2,2h5.392",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M13.207,16.401c.143-.049,.273-.131,.38-.238l3.303-3.303c.483-.483,.478-1.261-.005-1.745h0c-.483-.483-1.261-.489-1.745-.005l-3.303,3.303c-.107,.107-.189,.237-.238,.38l-.849,2.457,2.457-.849Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function MUt({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("line",{x1:"5.75",y1:"6.75",x2:"7.75",y2:"6.75",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"5.75",y1:"9.75",x2:"10.25",y2:"9.75",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M15.16,6.25h-3.41c-.552,0-1-.448-1-1V1.852",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("circle",{cx:"14",cy:"14",r:"2.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M15.25,9.438v-2.774c0-.265-.105-.52-.293-.707l-3.914-3.914c-.188-.188-.442-.293-.707-.293H4.75c-1.105,0-2,.896-2,2V14.25c0,1.104,.895,2,2,2h5.093",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"15.59",y1:"15.59",x2:"17.25",y2:"17.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function jUt({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 12 12",children:[h.jsx("path",{d:"m6.75,4.25h3.5c0-.321-.127-.627-.353-.853l-2.295-2.295c-.226-.226-.532-.353-.851-.353v3.5Z",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("polyline",{points:"6.75 .75 6.75 4.25 10.25 4.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"2.75",y1:"7.25",x2:"2.75",y2:"11.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"m6.231,11.25h2.019c1.105,0,2-.895,2-2v-5.001c0-.32-.127-.626-.353-.852l-2.294-2.294c-.226-.226-.532-.353-.852-.353h-3.001c-1.105,0-2,.895-2,2v2.218",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"4.75",y1:"9.25",x2:".75",y2:"9.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function FUt({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M20 8.4124V4C20 2.89543 19.1046 2 18 2H11.0784C10.548 2 10.0393 2.21071 9.66421 2.58579L4.58579 7.66421C4.21071 8.03929 4 8.54799 4 9.07843L4 20C4 21.1046 4.89543 22 6 22H9",stroke:e,strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"square",fill:"none"}),h.jsx("path",{d:"M4 9H11V2",stroke:e,strokeWidth:"2",strokeMiterlimit:"10","data-cap":"butt",fill:"none"}),h.jsx("path",{d:"M16 22L22 16C22.8284 15.1716 22.8284 13.8284 22 13C21.1716 12.1716 19.8284 12.1716 19 13L13 19V22H16Z",stroke:e,strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"square","data-color":"color-2",fill:"none"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function m4(){const n=zi();let e=12,t="hh:mm:ss A";return n&&n.settings.military_time&&(e=24,t="HH:mm:ss"),{timeFormatId:e,timeFormat:t}}const BUt=jJ("notifications",[]);function $Ut(){const[n]=xe(),e=DUt(),[t,i]=x.useState(!1),[r,s]=oo(BUt),o=lCe(),a=xt(),l=Qo(),c=i9(),{timeFormat:u}=m4(),{dateFormat:d}=Zc(),f=m=>m.notificationType==="invoiceWasPaid"?e(n("notification_invoice_paid_subject"),{invoice:h.jsx(Ji,{to:Ut("/invoices/:id/edit",{id:m.invoiceId}),children:`#${m.invoiceNumber}`}),client:h.jsx(Ji,{to:Ut("/clients/:id",{id:m.clientId}),children:m.clientName})}):m.notificationType==="invoiceWasViewed"?e(n("notification_invoice_viewed_subject"),{invoice:h.jsx(Ji,{to:Ut("/invoices/:id/edit",{id:m.invoiceId}),children:`#${m.invoiceNumber}`}),client:h.jsx(Ji,{to:Ut("/clients/:id",{id:m.clientId}),children:m.clientName})}):m.notificationType==="creditWasCreated"?e(n("notification_credit_created_subject"),{invoice:h.jsx(Ji,{to:Ut("/credits/:id/edit",{id:m.creditId}),children:`#${m.creditNumber}`}),client:h.jsx(Ji,{to:Ut("/clients/:id",{id:m.clientId}),children:m.clientName})}):m.notificationType==="creditWasUpdated"?h.jsxs("div",{className:"flex items-center space-x-1",children:[h.jsxs("span",{children:[n("credit_updated"),":"]}),h.jsx(Ji,{to:Ut("/credits/:id/edit",{id:m.creditId}),children:`#${m.creditNumber}`})]}):m.notificationType==="paymentWasUpdated"?h.jsxs("div",{className:"flex items-center space-x-1",children:[h.jsxs("span",{children:[n("payment_updated"),":"]}),h.jsx(Ji,{to:Ut("/payments/:id/edit",{id:m.paymentId}),children:`#${m.paymentNumber}`})]}):m.message,p=m=>m==="invoiceWasPaid"?h.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:a.$15},children:h.jsx(RUt,{size:"1.3rem",color:a.$16})}):m==="invoiceWasViewed"?h.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:a.$15},children:h.jsx(MUt,{size:"1.3rem",color:a.$16})}):m==="creditWasCreated"?h.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:a.$15},children:h.jsx(jUt,{size:"1.3rem",color:a.$16})}):m==="creditWasUpdated"?h.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:a.$15},children:h.jsx(FUt,{size:"1.3rem",color:a.$16})}):m==="paymentWasUpdated"?h.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:a.$15},children:h.jsx(OUt,{size:"1.3rem",color:a.$16})}):null,g=m=>{const _=Jn(),v=Jn.unix(m),b=_.diff(v,"day");return _.diff(v,"minute")<=1?n("just_now"):b===1?n("yesterday"):so(m,`${d} ${u}`)};return cCe({on:["App\\Events\\Invoice\\InvoiceWasPaid","App\\Events\\Invoice\\InvoiceWasViewed","App\\Events\\Credit\\CreditWasCreated","App\\Events\\Credit\\CreditWasUpdated","App\\Events\\Payment\\PaymentWasUpdated"],callback:({event:m,data:_})=>{var v,b,y,C,S;if(m==="App\\Events\\Invoice\\InvoiceWasPaid"){const k=_,I={label:`${k.number}: ${n("invoice_paid")}`,displayLabel:{notificationType:"invoiceWasPaid",invoiceNumber:k.number,clientName:(v=k.client)==null?void 0:v.display_name,invoiceId:k.id,clientId:k.client_id},date:Jn().unix(),link:Ut("/invoices/:id/edit",{id:k.id}),readAt:null};if(r.some(L=>L.label===I.label)||r.some(L=>L.link===I.link))return;s(L=>[...L,I])}if(m==="App\\Events\\Invoice\\InvoiceWasViewed"){if(!(c!=null&&c.notifications.email.includes("invoice_viewed"))||!(c!=null&&c.notifications.email.includes("invoice_viewed_user")))return;const k=_,I={label:Ua("notification_invoice_viewed_subject",{invoice:k.number,client:(b=k.client)==null?void 0:b.display_name}),displayLabel:{notificationType:"invoiceWasViewed",invoiceNumber:k.number,clientName:(y=k.client)==null?void 0:y.display_name,invoiceId:k.id,clientId:k.client_id},date:Jn().unix(),link:Ut("/invoices/:id/edit",{id:k.id}),readAt:null};if(r.some(L=>L.label===I.label)||r.some(L=>L.link===I.link))return;s(L=>[...L,I])}if(m==="App\\Events\\Credit\\CreditWasCreated"){const k=_,I={label:Ua("notification_credit_created_subject",{invoice:k.number,client:(C=k.client)==null?void 0:C.display_name}),displayLabel:{notificationType:"creditWasCreated",creditNumber:k.number,clientName:(S=k.client)==null?void 0:S.display_name,creditId:k.id,clientId:k.client_id},date:Jn().unix(),link:Ut("/credits/:id/edit",{id:k.id}),readAt:null};if(r.some(L=>L.label===I.label)||r.some(L=>L.link===I.link))return;s(L=>[...L,I])}if(m==="App\\Events\\Credit\\CreditWasUpdated"){const k=_,I={label:`${n("credit_updated")}: ${k.number}`,displayLabel:{notificationType:"creditWasUpdated",creditNumber:k.number,creditId:k.id},date:Jn().unix(),link:Ut("/credits/:id/edit",{id:k.id}),readAt:null};if(r.some(L=>L.label===I.label)||r.some(L=>L.link===I.link))return;s(L=>[...L,I])}if(m==="App\\Events\\Payment\\PaymentWasUpdated"){const k=_,I={label:`${n("payment_updated")}: ${k.number}`,displayLabel:{notificationType:"paymentWasUpdated",paymentNumber:k.number,paymentId:k.id},date:Jn().unix(),link:Ut("/payments/:id/edit",{id:k.id}),readAt:null};if(r.some(L=>L.label===I.label)||r.some(L=>L.link===I.link))return;s(L=>[...L,I])}}}),x.useEffect(()=>{if(l.preferences.enable_public_notifications&&o){const _=o.subscribe("general_selfhosted");return _.bind("App\\Events\\General\\GenericMessage",v=>{const b={label:v.message,displayLabel:{notificationType:"genericMessage",message:v.message},date:Jn().unix(),link:v.link,readAt:null};s(y=>[...y,b])}),()=>{_.unbind("App\\Events\\General\\GenericMessage")}}},[o,l.preferences.enable_public_notifications]),l.preferences.enable_public_notifications?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"relative mt-2 mr-1",children:h.jsxs("button",{onClick:()=>i(!t),className:$t({"animate-jiggle":r.length>0}),children:[h.jsx(an,{className:"w-5 h-5",element:wCe,color:a.$3}),r.length>0?h.jsx("span",{className:"absolute top-0 right-0 h-2 w-2 rounded-full border-white border-2 bg-blue-500"}):null]})}),h.jsx(kUt,{visible:t,onClose:()=>i(!1),size:"regular",title:n("notifications"),topRight:h.jsx(dn,{type:"minimal",behavior:"button",className:"rounded-md",onClick:()=>s([]),children:n("clear")}),withoutDivider:!0,children:r.length>0?h.jsx("div",{className:"flex flex-col space-y-2 pt-2",children:r.map((m,_)=>!!m.displayLabel&&h.jsxs("div",{className:"flex items-center justify-between px-6 py-2 space-x-2",children:[h.jsxs("div",{className:"flex items-center space-x-2.5",children:[p(m.displayLabel.notificationType),h.jsxs("div",{className:"flex flex-col space-y-0.5",children:[h.jsx("div",{className:"text-sm",style:{color:a.$3},children:f(m.displayLabel)}),h.jsx("p",{className:"text-xs text-gray-500",children:g(m.date)})]})]}),!m.readAt&&h.jsx("div",{children:h.jsx(an,{element:PUt,size:14,color:"#2176FF"})})]},_))}):h.jsx(LQe,{children:n("no_unread_notifications")})})]}):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 HUt(){const n=Vm();return Jn(n==null?void 0:n.plan_expires).endOf("day").isAfter(Jn())&&($u()||Vy()),UB()}function VUt(){const n=Vm();return(n==null?void 0:n.plan_expires)!==""&&!Jn(n.plan_expires).isBefore(Jn())}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function kxe(){const{data:n}=Zd(),[e,t]=x.useState([]);return x.useEffect(()=>{n!=null&&n.countries&&t(n.countries)},[n]),e}function _4(n){const e=kxe();return h.jsx(Dn,{onValueChange:n.onChange,value:n.value,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,disabled:n.disabled,customSelector:!0,children:e.map((t,i)=>h.jsxs("option",{value:t.id,children:[t.name," (",t.iso_3166_3,")"]},i))})}const WUt={plan_check:"plan",token:"token",vat_check:"vat",buy_credits:"credits",form:"form",completed:"completed"},zUt=["plan_check","token","vat_check","buy_credits","form","completed"];function UUt(){const n=Lo(),{t:e}=xe(),[t,i]=x.useState(!1),[r,s]=x.useState("plan_check"),[o,a]=x.useState(zUt),[l,c]=x.useState();x.useEffect(()=>{r==="completed"&&(i(!1),pe.success(e("peppol_successfully_configured")))},[r]),x.useEffect(()=>{},[o]);const u=()=>{const d=o[o.indexOf(r)+1];d&&s(d)};return x.useEffect(()=>{t||s("plan_check")},[t]),h.jsxs(h.Fragment,{children:[h.jsx(ne,{children:h.jsxs("div",{className:"space-x-1",children:[h.jsx("span",{children:e("peppol_onboarding")}),h.jsx("button",{style:{color:n},type:"button",onClick:()=>{s("plan_check"),i(!0)},children:e("get_started")})]})}),h.jsx(pr,{visible:t,onClose:()=>i(!1),title:e("configure_peppol"),size:"regular",children:h.jsx("div",{className:"",children:h.jsxs("div",{className:"max-w-xl mx-auto space-y-10",children:[h.jsx("ol",{className:"lg:flex items-center w-full space-y-4 lg:space-x-8 lg:space-y-0",children:o.filter(d=>!["token","completed"].includes(d)).map((d,f)=>h.jsx("li",{className:"flex-1",children:h.jsxs("a",{className:"border-l-2 flex flex-col border-t-0 pl-4 pt-0 border-solid font-medium lg:pt-4 lg:border-t-2 lg:border-l-0 lg:pl-0",style:{borderColor:r===d?n:""},children:[h.jsxs("span",{className:"text-sm",style:{color:r===d?n:""},children:[e("step")," ",f+1]}),h.jsx("h4",{className:"text-base lg:text-lg text-gray-900",children:e(WUt[d])})]})},f))}),r==="plan_check"?h.jsx(qUt,{step:r,onContinue:u}):null,r==="token"?h.jsx(KUt,{step:r,onContinue:u}):null,r==="vat_check"?h.jsx(QUt,{businessType:l,setBusinessType:c,onContinue:u,step:r}):null,r==="buy_credits"?h.jsx(GUt,{step:r,onContinue:u}):null,r==="form"?h.jsx(YUt,{step:r,onContinue:u,businessType:l}):null]})})})]})}function qUt({onContinue:n}){const e=Vm(),t=VUt(),i=Lo(),[r,s]=x.useState(!1),{t:o}=xe();x.useEffect(()=>{},[e==null?void 0:e.plan,t]);const a=fd({initialValues:{},onSubmit(c,{setSubmitting:u}){Je("POST",ze("/api/v1/check_license")).then(()=>{s(!0),n()}).catch(d=>{var f;if(((f=d.response)==null?void 0:f.status)===422){pe.error(d.response.data.message);return}console.error(d),pe.error(o("invalid_white_label_license"))}).finally(()=>u(!1))}});return h.jsxs("div",{className:"space-y-5",children:[h.jsx("p",{className:"text-lg",children:o("license")}),h.jsxs("div",{children:[o("peppol_whitelabel_warning")," ",h.jsx("br",{})," ",h.jsx("br",{}),o("add_license_to_env")," ",h.jsx("a",{href:"https://invoiceninja.github.io/en/env-variables/",target:"_blank",rel:"noreferrer",style:{color:i},children:o("learn_more")}),h.jsx("form",{className:"mt-4",id:"checkLicenseForm",onSubmit:a.handleSubmit}),t?null:h.jsx("div",{className:"mt-2",children:h.jsx(Ji,{to:"https://invoiceninja.invoicing.co/client/subscriptions/O5xe7Rwd7r/purchase",external:!0,children:o("purchase_license")})})]}),null,h.jsx("div",{className:"flex justify-end",children:r?h.jsx(dn,{behavior:"button",type:"primary",onClick:()=>n(),children:o("continue")}):h.jsx(dn,{form:"checkLicenseForm",type:"primary",onClick:a.submitForm,disabled:a.isSubmitting,children:o("verify")})})]})}function KUt({onContinue:n}){const e=()=>{Je("POST",ze("/api/v1/einvoice/token/update")).then(()=>{n()}).catch(()=>pe.error())};return x.useEffect(()=>{e()},[]),h.jsx(yo,{})}function GUt({onContinue:n}){const{t:e}=xe(),t=xt();return h.jsxs("div",{children:[h.jsx("p",{className:"text-lg",children:e("credits")}),h.jsx("p",{children:e("peppol_credits_info")}),h.jsxs("div",{className:"my-3 space-y-2",children:[h.jsxs("a",{href:"https://invoiceninja.invoicing.co/client/subscriptions/WJxboqNegw/purchase",target:"_blank",rel:"noreferrer",className:"rounded w-full p-3 text-left border flex justify-between items-center hover:underline",style:{backgroundColor:t.$1},children:[e("buy")," (PEPPOL 500)"]}),h.jsxs("a",{href:"https://invoiceninja.invoicing.co/client/subscriptions/k8mep0reMy/purchase",target:"_blank",rel:"noreferrer",className:"rounded w-full p-3 text-left border flex justify-between items-center hover:underline",style:{backgroundColor:t.$1},children:[e("buy")," (PEPPOL 1000)"]})]}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{behavior:"button",type:"primary",onClick:()=>n(),children:e("continue")})})]})}function YUt({onContinue:n,businessType:e}){var c,u,d,f,p,g,m,_;const{t}=xe(),i=zi(),r=u1(),s=Vm(),[o,a]=x.useState(null),l=fd({initialValues:{party_name:((c=i==null?void 0:i.settings)==null?void 0:c.name)||"",line1:((u=i==null?void 0:i.settings)==null?void 0:u.address1)||"",line2:((d=i==null?void 0:i.settings)==null?void 0:d.address2)||"",city:((f=i==null?void 0:i.settings)==null?void 0:f.city)||"",county:((p=i==null?void 0:i.settings)==null?void 0:p.state)||"",zip:((g=i==null?void 0:i.settings)==null?void 0:g.postal_code)||"",country:((m=i==null?void 0:i.settings)==null?void 0:m.country_id)||"",acts_as_sender:!0,acts_as_receiver:!0,vat_number:((_=i==null?void 0:i.settings)==null?void 0:_.vat_number)||"",id_number:(i==null?void 0:i.settings.id_number)||""},onSubmit:(v,{setSubmitting:b})=>{pe.processing(),a(null),Je("POST",ze("/api/v1/einvoice/peppol/setup"),{...v,tenant_id:i==null?void 0:i.company_key,e_invoicing_token:s==null?void 0:s.e_invoicing_token,classification:e}).then(()=>{pe.success("peppol_successfully_configured"),n(),r()}).catch(y=>{var C;if(console.error(y),((C=y.response)==null?void 0:C.status)===422){a(y.response.data),pe.dismiss();return}pe.error()}).finally(()=>b(!1))}});return h.jsxs("div",{children:[h.jsx("p",{className:"text-lg",children:t("details")}),h.jsx("p",{children:t("details_update_info")}),h.jsx("div",{className:"my-4",children:o?h.jsx(Kl,{children:o.message??pn.get(o,"errors.0.details")}):null}),h.jsxs("form",{onSubmit:l.handleSubmit,className:"space-y-5",children:[h.jsx(lt,{label:t("company_name"),value:l.values.party_name,onChange:l.handleChange,id:"party_name",errorMessage:pn.get(o,"errors.party_name")}),e==="business"?h.jsx(lt,{value:l.values.vat_number,onChange:l.handleChange,label:t("vat_number"),id:"vat_number",errorMessage:pn.get(o,"errors.vat_number")}):null,e==="individual"?h.jsx(lt,{value:l.values.id_number,onChange:l.handleChange,label:t("id_number"),id:"id_number",errorMessage:pn.get(o,"errors.id_number")}):null,h.jsx(_4,{value:l.values.country,label:t("country"),onChange:v=>l.setFieldValue("country",v),errorMessage:pn.get(o,"errors.country")}),h.jsx(lt,{value:l.values.line1,id:"line1",label:t("address1"),onChange:l.handleChange,errorMessage:pn.get(o,"errors.line1")}),h.jsx(lt,{value:l.values.line2,id:"line2",label:t("address2"),onChange:l.handleChange,errorMessage:pn.get(o,"errors.line2")}),h.jsx(lt,{value:l.values.city,id:"city",label:t("city"),onChange:l.handleChange,errorMessage:pn.get(o,"errors.city")}),h.jsx(lt,{value:l.values.county,id:"county",label:t("state"),onChange:l.handleChange,errorMessage:pn.get(o,"errors.county")}),h.jsx(lt,{value:l.values.zip,id:"zip",label:t("postal_code"),onChange:l.handleChange,errorMessage:pn.get(o,"errors.zip")}),h.jsx(jt,{checked:l.values.acts_as_sender,label:t("acts_as_sender"),id:"acts_as_sender",onChange:v=>l.setFieldValue("acts_as_sender",v)}),h.jsx(jt,{checked:l.values.acts_as_receiver,label:t("acts_as_receiver"),id:"acts_as_receiver",onChange:v=>l.setFieldValue("acts_as_receiver",v)}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{type:"primary",disabled:l.isSubmitting,children:t("continue")})})]})]})}function QUt({businessType:n,setBusinessType:e,onContinue:t}){const{t:i}=xe(),r=Lo(),s=xt();return h.jsxs("div",{children:[h.jsx("p",{className:"text-lg",children:"Are you registered for VAT?"}),h.jsxs("div",{className:"my-5 space-y-2",children:[h.jsxs("button",{className:"rounded w-full p-3 text-left border flex justify-between items-center",style:{backgroundColor:s.$1,borderColor:n==="business"?r:s.$5},onClick:()=>e("business"),children:[h.jsx("p",{children:"Yes, I have a VAT number"}),h.jsx(o8,{size:18,color:r,className:$t({hidden:n!=="business"})})]}),h.jsxs("button",{className:"rounded w-full p-3 text-left border flex justify-between items-center",style:{backgroundColor:s.$1,borderColor:n==="individual"?r:s.$5},onClick:()=>e("individual"),children:[h.jsx("p",{children:"No, I am an individual"}),h.jsx(o8,{size:18,color:r,className:$t({hidden:n!=="individual"})})]})]}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{behavior:"button",type:"primary",disabled:!n,disableWithoutIcon:!0,onClick:()=>t(),children:i("Continue")})})]})}function XUt(){const n=Lo(),e=u1(),t=zi(),i=Vm(),{t:r}=xe(),[s,o]=x.useState(!1),a=()=>{pe.processing(),Je("POST",ze("/api/v1/einvoice/peppol/disconnect"),{company_key:t.company_key,legal_entity_id:t.legal_entity_id,tax_data:t.tax_data,e_invoicing_token:i==null?void 0:i.e_invoicing_token}).then(()=>{pe.success("disconnected")}).catch(()=>{pe.error()}).finally(()=>{o(!1),e()})};return h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",style:{color:n},onClick:()=>o(!0),children:r("disconnect")}),h.jsxs(pr,{title:r("peppol_disconnect"),visible:s,onClose:()=>o(!1),children:[r("peppol_disconnect_long"),h.jsx("div",{className:"flex justify-end mt-5",children:h.jsx(dn,{behavior:"button",type:"primary",onClick:a,children:r("continue")})})]})]})}function ZUt(){var d,f,p,g,m,_;const{t:n}=xe(),e=u1(),t=xt(),i=Zd(),r=zi(),s=Vm(),o=Lo(),a=fd({initialValues:{acts_as_sender:(d=r==null?void 0:r.tax_data)==null?void 0:d.acts_as_sender,acts_as_receiver:(f=r==null?void 0:r.tax_data)==null?void 0:f.acts_as_receiver,legal_entity_id:r.legal_entity_id,e_invoicing_token:s==null?void 0:s.e_invoicing_token},onSubmit:v=>{pe.processing(),Je("PUT",ze("/api/v1/einvoice/peppol/update"),v).then(()=>{pe.success(n("updated_settings"))}).catch(b=>{var y;if(((y=b.response)==null?void 0:y.status)===422){pn.get(b.response.data,"errors.acts_as_receiver.0")&&pe.error(pn.get(b.response.data,"errors.acts_as_receiver.0"));return}pe.error()}).finally(()=>e())}}),[l,c]=x.useState(!1),[u]=x.useState(((p=i.data)==null?void 0:p.license_key)!==void 0&&((g=i.data)==null?void 0:g.license_key)!=="");return x.useEffect(()=>{!u&&l&&pe.error(n("white_label_license_not_present"))},[l]),h.jsxs(h.Fragment,{children:[h.jsxs(pr,{title:n("buy_credits"),visible:l,onClose:()=>c(!1),children:[h.jsx("p",{children:n("peppol_credits_info")}),h.jsxs("div",{className:"py-2 flex gap-2 flex-col",children:[null,u?h.jsxs(Ji,{to:`https://invoiceninja.invoicing.co/client/subscriptions/WJxboqNegw/purchase?license_key=${(m=i.data)==null?void 0:m.license_key}`,external:!0,children:[n("buy")," (PEPPOL 500)"]}):null,null,u?h.jsxs(Ji,{to:`https://invoiceninja.invoicing.co/client/subscriptions/k8mep0reMy/purchase?license_key=${(_=i.data)==null?void 0:_.license_key}`,external:!0,children:[n("buy")," (PEPPOL 1000)"]}):null]})]}),h.jsxs(er,{title:`PEPPOL: ${n("preferences")}`,className:"shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:[h.jsx(ne,{leftSide:n("status"),children:h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("p",{children:[n("connected")," (",r.legal_entity_id,")"]}),h.jsx("div",{children:h.jsx(XUt,{})})]})}),h.jsx(ne,{leftSide:n("act_as_sender"),children:h.jsx(jt,{checked:a.values.acts_as_sender,onValueChange:v=>{a.setFieldValue("acts_as_sender",v),a.submitForm()}})}),h.jsx(ne,{leftSide:n("act_as_receiver"),children:h.jsx(jt,{checked:a.values.acts_as_receiver,onValueChange:v=>{a.setFieldValue("acts_as_receiver",v),a.submitForm()}})}),h.jsxs(ne,{leftSide:n("credits"),children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsxs("p",{children:[n("total_credits_amount"),":"]}),h.jsx(JUt,{})]}),h.jsx("button",{type:"button",onClick:()=>c(!0),style:{color:o},children:n("buy_credits")})]})]})]})}function VQe(){const n=zi();return!!n&&(n==null?void 0:n.settings.enable_e_invoice)&&(n==null?void 0:n.settings.e_invoice_type)==="PEPPOL"}function Txe(){Vm();const n=Vs(),e=lr({queryKey:["/api/v1/einvoice/quota"],queryFn:()=>Je("GET",ze("/api/v1/einvoice/quota")).then(i=>i.data).catch(i=>{var r;((r=i.response)==null?void 0:r.status)===422&&pe.error(i.response.data.message)}),enabled:VQe()&&n.getQueryData(["/api/v1/einvoice/health_check"])!==void 0,retry:()=>!1,staleTime:1/0});return(()=>{var i;return e&&typeof((i=e.data)==null?void 0:i.quota)=="number"?parseInt(e.data.quota):null})()}function JUt(){const n=Txe();return h.jsx("div",{children:h.jsx("p",{children:n})})}function eqt(){return lr({queryKey:["/api/v1/einvoice/health_check"],queryFn:()=>Je("GET",ze("/api/v1/einvoice/health_check")).then(()=>!0).catch(()=>!1),enabled:VQe(),staleTime:1/0,retry:()=>!1})}const tqt=15;function nqt(){const[n]=xe(),e=Txe(),t=zi(),{data:i}=eqt(),[r,s]=x.useState(!1);return!t.legal_entity_id||t.settings.e_invoice_type!=="PEPPOL"?null:typeof i=="boolean"&&!i?h.jsx(sqt,{}):e!==null&&e<=0?h.jsxs(h.Fragment,{children:[h.jsx(E4e,{isVisible:r,setVisible:s,text:n("notification_no_credits")}),h.jsx(CL,{className:"relative",children:h.jsx("div",{className:"max-w-max rounded-lg bg-red-300 px-6 py-4 shadow-lg",children:h.jsxs("div",{className:"flex items-center justify-center space-x-1",children:[h.jsx("span",{className:"text-sm",children:n("notification_no_credits")}),h.jsx("span",{className:"cursor-pointer text-sm font-semibold underline hover:no-underline",onClick:()=>s(!0),children:n("learn_more")})]})})})]}):e!==null&&e<tqt?h.jsxs(h.Fragment,{children:[h.jsx(E4e,{isVisible:r,setVisible:s,text:n("notification_credits_low")}),h.jsx(CL,{className:"relative",children:h.jsx("div",{className:"max-w-max rounded-lg bg-[#FCD34D] px-6 py-4 shadow-lg",children:h.jsxs("div",{className:"flex items-center justify-center space-x-1",children:[h.jsx("span",{className:"text-sm",children:n("notification_credits_low")}),h.jsx("span",{className:"cursor-pointer text-sm font-semibold underline hover:no-underline",onClick:()=>s(!0),children:n("learn_more")})]})})})]}):null}function E4e({isVisible:n,setVisible:e,text:t}){const{t:i}=xe(),r=Txe(),s=gc(),o=Lo();return x.useEffect(()=>{e(!1)},[s.pathname]),h.jsxs(pr,{visible:n,onClose:()=>e(!1),title:i("credits"),children:[h.jsx("p",{children:i("peppol_credits_info")}),h.jsx("p",{children:t}),h.jsxs("p",{className:"font-medium",children:[i("total_credits_amount"),": ",r]}),h.jsx(r1,{to:"/settings/e_invoice",style:{color:o},children:i("view_settings")})]})}const iqt=Ls(0),rqt=Ls("pending");function sqt(){const[n]=xe(),e=Vs(),t=u1(),[i,r]=oo(rqt),[s,o]=oo(iqt);return x.useEffect(()=>{const a=setInterval(()=>{if(i==="success"||i==="error"||s>=3){clearInterval(a);return}Je("POST",ze("/api/v1/einvoice/token/update")).then(()=>{e.invalidateQueries({queryKey:["/api/v1/einvoice/quota"]}),e.invalidateQueries({queryKey:["/api/v1/einvoice/health_check"]}),t(),r("success")}).catch(()=>{o(l=>{const c=l+1;return c>=3&&r("error"),c})})},2e3);return()=>clearInterval(a)},[i,s,e,t,r,o]),i==="success"||i==="pending"?null:h.jsx(CL,{className:"relative",children:h.jsx("div",{className:"max-w-max rounded-lg bg-[#FCD34D] px-6 py-4 shadow-lg",children:h.jsx("div",{className:"flex items-center justify-center space-x-1",children:h.jsx("span",{className:"text-sm",children:n("einvoice_token_not_found")})})})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function oqt({size:n="1rem",color:e="#A1A1AA",className:t}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",className:t,children:[h.jsx("polyline",{points:"14.983 5.53 9 9 3.017 5.53",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"9",y1:"15.938",x2:"9",y2:"9",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M7.997,2.332L3.747,4.797c-.617,.358-.997,1.017-.997,1.73v4.946c0,.713,.38,1.372,.997,1.73l4.25,2.465c.621,.36,1.386,.36,2.007,0l4.25-2.465c.617-.358,.997-1.017,.997-1.73V6.527c0-.713-.38-1.372-.997-1.73l-4.25-2.465c-.621-.36-1.386-.36-2.007,0Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function aqt({size:n="1rem",color:e="#A1A1AA",className:t}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",className:t,children:[h.jsx("path",{d:"M14.75,3.75v12.5l-2.75-1.5-3,1.5-3-1.5-2.75,1.5V3.75c0-1.105,.895-2,2-2h7.5c1.105,0,2,.895,2,2Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"5.75",y1:"11.25",x2:"9.25",y2:"11.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"11.75",y1:"11.25",x2:"12.25",y2:"11.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("circle",{cx:"9",cy:"6.5",r:"1.75",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function lqt({size:n="1rem",color:e="#A1A1AA",className:t}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",className:t,children:[h.jsx("path",{d:"M9,1c-2.48,0-4.765,1.155-6.261,3.042l-.116-.84c-.057-.411-.435-.7-.846-.64-.41,.057-.697,.435-.64,.846l.408,2.945c.052,.375,.373,.647,.742,.647,.034,0,.069-.002,.104-.007l2.944-.407c.411-.057,.697-.436,.641-.846-.057-.411-.438-.694-.846-.641l-1.458,.202c1.2-1.727,3.173-2.801,5.329-2.801,3.584,0,6.5,2.916,6.5,6.5,0,.414,.336,.75,.75,.75s.75-.336,.75-.75c0-4.411-3.589-8-8-8Z",fill:e}),h.jsx("path",{d:"M15.609,11.007l-2.944,.407c-.411,.057-.697,.436-.641,.846,.057,.41,.435,.688,.846,.641l1.46-.202c-1.201,1.727-3.181,2.802-5.33,2.802-3.584,0-6.5-2.916-6.5-6.5,0-.414-.336-.75-.75-.75s-.75,.336-.75,.75c0,4.411,3.589,8,8,8,2.474,0,4.763-1.159,6.26-3.046l.117,.844c.052,.375,.373,.647,.742,.647,.034,0,.069-.002,.104-.007,.41-.057,.697-.435,.64-.846l-.408-2.945c-.057-.41-.438-.697-.845-.64Z",fill:e,"data-color":"color-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 */function cqt({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("circle",{cx:"6.5",cy:"4.75",r:"2.25",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M10.54,14.567c.837-.291,1.266-1.257,.866-2.048-.906-1.791-2.761-3.02-4.906-3.02s-4,1.228-4.906,3.02c-.4,.791,.028,1.757,.866,2.048,1.031,.358,2.408,.683,4.04,.683s3.009-.325,4.04-.683Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M13.547,15.078c.758-.128,1.428-.315,1.993-.511,.837-.291,1.266-1.257,.866-2.048-.78-1.542-2.263-2.667-4.03-2.95",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M10.733,6.86c.24,.087,.497,.14,.767,.14,1.243,0,2.25-1.007,2.25-2.25s-1.007-2.25-2.25-2.25c-.27,0-.527,.052-.767,.14",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function uqt(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M5.25,13.25h-1c-1.105,0-2-.895-2-2V3.25c0-1.105,.895-2,2-2h5c1.105,0,2,.895,2,2v1.052",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M5.25,14.25V6.25c0-1.105,.895-2,2-2h4.086c.265,0,.52,.105,.707,.293l2.914,2.914c.188,.188,.293,.442,.293,.707v6.086c0,1.105-.895,2-2,2H7.25c-1.105,0-2-.895-2-2Z",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M15.25,8.25h-3c-.552,0-1-.448-1-1v-3",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function dqt(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M2.25,5.5h0c0-1.733,1.249-3.213,2.957-3.505L11.769,.875c.434-.074,.866,.145,1.063,.539l.053,.106",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M15.75,11.25v2c0,1.105-.895,2-2,2H4.25c-1.105,0-2-.895-2-2V5.75c0-1.105,.895-2,2-2H13.75c1.105,0,2,.895,2,2v2",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M15.75,11.25h-2.75c-.966,0-1.75-.784-1.75-1.75h0c0-.967,.784-1.75,1.75-1.75h2.75c.552,0,1,.448,1,1v1.5c0,.552-.448,1-1,1Z",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function hqt(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M1.75,8.75c1.421,.616,3.966,1.503,7.25,1.503s5.829-.887,7.25-1.503",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"9",y1:"9.25",x2:"9",y2:"11.5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M6.25,4.75V2.25c0-.552,.448-1,1-1h3.5c.552,0,1,.448,1,1v2.5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("rect",{x:"1.75",y:"4.75",width:"14.5",height:"10.5",rx:"2",ry:"2",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function fqt(n){const{size:e="1rem",color:t="#000",strokeWidth:i="1.5"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 12 12",children:[h.jsx("path",{d:"m7.75,1.75h.5c1.105,0,2,.895,2,2v5.5c0,1.105-.895,2-2,2H3.75c-1.105,0-2-.895-2-2V3.75c0-1.105.895-2,2-2h.5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:i}),h.jsx("rect",{x:"4.25",y:".75",width:"3.5",height:"2.5",rx:".5",ry:".5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:i,"data-color":"color-2"}),h.jsx("polyline",{points:"4 7.39 5.334 8.722 8 5.171",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:i,"data-color":"color-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 */function pqt(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M7.75,16.25V7.75c0-.552,.448-1,1-1h5.5c.552,0,1,.448,1,1v8.5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M2.75,16.25V4.412c0-.402,.24-.765,.61-.921L7.86,1.588c.659-.279,1.39,.205,1.39,.921v1.741",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"1.75",y1:"16.25",x2:"16.25",y2:"16.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"10.25",y1:"10.25",x2:"10.25",y2:"9.75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"12.75",y1:"10.25",x2:"12.75",y2:"9.75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"10.25",y1:"13.25",x2:"10.25",y2:"12.75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"12.75",y1:"13.25",x2:"12.75",y2:"12.75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function gqt(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("line",{x1:"5.75",y1:"6.75",x2:"7.75",y2:"6.75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"5.75",y1:"9.75",x2:"10.25",y2:"9.75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M15.16,6.25h-3.41c-.552,0-1-.448-1-1V1.852",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M15.25,8.391v-1.727c0-.265-.105-.52-.293-.707l-3.914-3.914c-.188-.188-.442-.293-.707-.293H4.75c-1.105,0-2,.896-2,2V14.25c0,1.104,.895,2,2,2h3.959",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("circle",{cx:"14",cy:"14",r:"3.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("polyline",{points:"15.156 14.476 14 14 14 12.75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function mqt(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M9.5,4.75l2-3c0-.552-.448-1-1-1h-2.75s-2.75,0-2.75,0c-.552,0-1,.448-1,1l2,3h3.5Z",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"7.75",y1:"4.75",x2:"7.75",y2:"3.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M12.156,7.25c-.722-1.06-1.641-1.956-2.656-2.5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"M6,4.75C3.609,6.031,1.75,9.266,1.75,12c0,3.314,2.686,4.25,6,4.25,.207,0,.412-.004,.613-.011",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("rect",{x:"10.75",y:"7.25",width:"6.5",height:"3",rx:"1",ry:"1",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("rect",{x:"9.75",y:"10.25",width:"6.5",height:"3",rx:"1",ry:"1",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("rect",{x:"10.75",y:"13.25",width:"6.5",height:"3",rx:"1",ry:"1",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function _qt(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"m16.12,14.695l-.408-2.945h-.002c-1.083,2.64-3.68,4.5-6.71,4.5-4.004,0-7.25-3.246-7.25-7.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("path",{d:"m1.88,3.305l.408,2.945h.002C3.373,3.61,5.969,1.75,9,1.75c4.004,0,7.25,3.246,7.25,7.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("ellipse",{cx:"9",cy:"7.75",rx:"3.75",ry:"2",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"m5.25,7.75v2.5c0,1.1045,1.679,2,3.75,2s3.75-.8955,3.75-2v-2.5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function vqt(n){const{size:e="1rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("polyline",{points:"4.25 6.75 1.75 4.25 4.25 1.75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"1.75",y1:"4.25",x2:"7.25",y2:"4.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("polyline",{points:"13.75 16.25 16.25 13.75 13.75 11.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"16.25",y1:"13.75",x2:"10.75",y2:"13.75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("circle",{cx:"9",cy:"9",r:"2.5",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function WQe({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("circle",{cx:"9",cy:"8.999",r:"1.75",fill:e,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"m15.175,7.278l-.929-.328c-.102-.261-.219-.52-.363-.77s-.31-.48-.485-.699l.18-.968c.125-.671-.187-1.349-.778-1.69l-.351-.203c-.592-.342-1.334-.273-1.853.171l-.745.637c-.56-.086-1.133-.086-1.703,0l-.745-.638c-.519-.444-1.262-.513-1.853-.171l-.351.203c-.592.341-.903,1.019-.778,1.69l.18.965c-.36.449-.646.946-.852,1.474l-.924.326c-.644.227-1.075.836-1.075,1.519v.405c0,.683.431,1.292,1.075,1.519l.929.328c.102.261.218.519.363.769s.31.48.485.7l-.181.968c-.125.671.187,1.349.778,1.69l.351.203c.592.342,1.334.273,1.853-.171l.745-.638c.559.086,1.132.086,1.701,0l.746.639c.519.444,1.262.513,1.853.171l.351-.203c.592-.342.903-1.019.778-1.69l-.18-.966c.359-.449.646-.945.851-1.473l.925-.326c.644-.227,1.075-.836,1.075-1.519v-.405c0-.683-.431-1.292-1.075-1.519h.002Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}function v4(n){var v;const[e]=xe(),t=gc(),i=xt(),r=FQe(),s=jo(),o=Vw(),a=hv(),l=zi(),c=i9(),u=!!((v=a==null?void 0:a.company_user)!=null&&v.react_settings.show_mini_sidebar),d=!bw()&&(oUt()||aUt()),[f,p]=x.useState(!1),g=[{name:e("dashboard"),href:"/dashboard",icon:zqe,current:t.pathname.startsWith("/dashboard"),visible:s("view_dashboard")},{name:e("clients"),href:"/clients",icon:cqt,current:t.pathname.startsWith("/clients"),visible:s("view_client")||s("create_client")||s("edit_client"),rightButton:{icon:nc,to:"/clients/create",label:e("new_client"),visible:s("create_client")}},{name:e("products"),href:"/products",icon:oqt,current:t.pathname.startsWith("/products"),visible:s("view_product")||s("create_product")||s("edit_product"),rightButton:{icon:nc,to:"/products/create",label:e("new_product"),visible:s("create_product")}},{name:e("invoices"),href:"/invoices",icon:aqt,current:t.pathname.startsWith("/invoices"),visible:r(nr.Invoices)&&(s("view_invoice")||s("create_invoice")||s("edit_invoice")),rightButton:{icon:nc,to:"/invoices/create",label:e("new_invoice"),visible:s("create_invoice")}},{name:e("recurring_invoices"),href:"/recurring_invoices",icon:lqt,current:t.pathname.startsWith("/recurring_invoices"),visible:r(nr.RecurringInvoices)&&(s("view_recurring_invoice")||s("create_recurring_invoice")||s("edit_recurring_invoice")),rightButton:{icon:nc,to:"/recurring_invoices/create",label:e("new_recurring_invoice"),visible:s("create_recurring_invoice")}},{name:e("payments"),href:"/payments",icon:YKe,current:t.pathname.startsWith("/payments"),visible:s("view_payment")||s("create_payment")||s("edit_payment"),rightButton:{icon:nc,to:"/payments/create",label:e("new_payment"),visible:s("create_payment")}},{name:e("quotes"),href:"/quotes",icon:uqt,current:t.pathname.startsWith("/quotes"),visible:r(nr.Quotes)&&(s("view_quote")||s("create_quote")||s("edit_quote")),rightButton:{icon:nc,to:"/quotes/create",label:e("new_quote"),visible:s("create_quote")}},{name:e("credits"),href:"/credits",icon:dqt,current:t.pathname.startsWith("/credits"),visible:r(nr.Credits)&&(s("view_credit")||s("create_credit")||s("edit_credit")),rightButton:{icon:nc,to:"/credits/create",label:e("new_credit"),visible:s("create_credit")}},{name:e("projects"),href:"/projects",icon:hqt,current:t.pathname.startsWith("/projects"),visible:r(nr.Projects)&&(s("view_project")||s("create_project")||s("edit_project")),rightButton:{icon:nc,to:"/projects/create",label:e("new_project"),visible:s("create_project")}},{name:e("tasks"),href:"/tasks",icon:fqt,current:t.pathname.startsWith("/tasks"),visible:r(nr.Tasks)&&(s("view_task")||s("edit_task")||s("create_task")),rightButton:{icon:nc,to:"/tasks/create",label:e("new_task"),visible:s("create_task")}},{name:e("vendors"),href:"/vendors",icon:pqt,current:t.pathname.startsWith("/vendors"),visible:r(nr.Vendors)&&(s("view_vendor")||s("create_vendor")||s("edit_vendor")),rightButton:{icon:nc,to:"/vendors/create",label:e("new_vendor"),visible:s("create_vendor")}},{name:e("purchase_orders"),href:"/purchase_orders",icon:gqt,current:t.pathname.startsWith("/purchase_orders"),visible:r(nr.PurchaseOrders)&&(s("view_purchase_order")||s("create_purchase_order")||s("edit_purchase_order")),rightButton:{icon:nc,to:"/purchase_orders/create",label:e("new_purchase_order"),visible:s("create_purchase_order")}},{name:e("expenses"),href:"/expenses",icon:mqt,current:t.pathname.startsWith("/expenses"),visible:r(nr.Expenses)&&(s("view_expense")||s("create_expense")||s("edit_expense")),rightButton:{icon:nc,to:"/expenses/create",label:e("new_expense"),visible:s("create_expense")}},{name:e("recurring_expenses"),href:"/recurring_expenses",icon:_qt,current:t.pathname.startsWith("/recurring_expenses"),visible:r(nr.RecurringExpenses)&&(s("view_recurring_expense")||s("create_recurring_expense")||s("edit_recurring_expense")),rightButton:{icon:nc,to:"/recurring_expenses/create",label:e("new_recurring_expense"),visible:s("create_recurring_expense")}},{name:e("transactions"),href:"/transactions",icon:vqt,current:t.pathname.startsWith("/transactions"),visible:r(nr.Transactions)&&(s("view_bank_transaction")||s("create_bank_transaction")||s("edit_bank_transaction")),rightButton:{icon:nc,to:"/transactions/create",label:e("new_transaction"),visible:s("create_bank_transaction")}},{name:e("reports"),href:"/reports",icon:GKe,current:t.pathname.startsWith("/reports"),visible:s("view_reports")},{name:e("settings"),href:c!=null&&c.is_admin||c!=null&&c.is_owner?"/settings/company_details":"/settings/user_details",icon:WQe,current:t.pathname.startsWith("/settings"),visible:!!l}],m=ji(BQe),_=uUt();return cCe({on:["App\\Events\\Invoice\\InvoiceWasViewed"],callback:({data:b})=>{var y;!(c!=null&&c.notifications.email.includes("invoice_viewed"))||!(c!=null&&c.notifications.email.includes("invoice_viewed_user"))||rze(h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(ACe,{size:18}),h.jsxs("span",{children:[Ua("notification_invoice_viewed_subject",{invoice:b.number,client:(y=b.client)==null?void 0:y.display_name}),"."]})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx(Ji,{to:`/invoices/${b.id}/edit`,children:e("view_invoice")})})]}),{duration:8e3,position:"top-center"})}}),Yi(),h.jsxs("div",{children:[h.jsxs("div",{className:"fixed bottom-4 right-4 z-50 flex items-end flex-col-reverse space-y-4 space-y-reverse",children:[h.jsx(hUt,{}),h.jsx(dUt,{}),h.jsx(gUt,{}),h.jsx(nqt,{})]}),h.jsx(P5t,{navigation:g,sidebarOpen:f,setSidebarOpen:p}),h.jsx(R5t,{navigation:g,docsLink:n.docsLink}),h.jsxs("div",{className:$t("flex flex-col flex-1",{"md:pl-16":u,"md:pl-64":!u}),children:[h.jsxs("div",{style:{backgroundColor:i.$1},className:"sticky top-0 z-10 flex-shrink-0 flex h-16 border-b shadow",children:[h.jsxs("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:()=>p(!0),children:[h.jsx("span",{className:"sr-only",children:"Open sidebar"}),h.jsx(RCe,{color:i.$3})]}),h.jsxs("div",{className:"flex-1 px-4 xl:px-8 flex items-center","data-cy":"topNavbar",children:[h.jsxs("div",{className:"flex flex-1 items-center space-x-4",children:[h.jsx("h2",{style:{color:i.$3},className:"text-sm md:text-lg whitespace-nowrap",children:n.title}),h.jsx(sUt,{}),h.jsx(EUt,{})]}),h.jsxs("div",{className:"ml-4 flex items-center md:ml-6 space-x-2 lg:space-x-3",children:[h.jsx($Ut,{}),d&&h.jsxs("button",{type:"button",className:"hidden sm:inline-flex items-center justify-center px-4 rounded-md text-sm font-medium text-white relative overflow-hidden",style:{height:"2.25rem",background:"#2176FF",border:"1px solid #0062ff",boxShadow:"0px 1px 1px 0px #1453B82E, 0px 2px 2px 0px #1453B829, 0px 5px 3px 0px #1453B817, 0px 9px 4px 0px #1453B808, 0px 15px 4px 0px #1453B800, 0px 1px 0px 0px #FFFFFF40 inset, 0px 0px 0px 1px #0062FF"},onClick:()=>{o({url:"https://invoiceninja.invoicing.co/client/subscriptions/O5xe7Rwd7r/purchase",externalLink:!0})},children:[h.jsx("div",{className:"absolute inset-x-0 top-0 h-1/2 bg-gradient-to-b from-white/20 to-transparent pointer-events-none"}),h.jsx("span",{className:"relative z-10 hidden xl:block",children:e("white_label_button")}),h.jsx("span",{className:"relative z-10 xl:hidden",children:e("upgrade")})]}),n.onCancelClick&&h.jsx(dn,{onClick:n.onCancelClick,type:"secondary",children:e("cancel")}),(!!n.onSaveClick||m)&&h.jsxs("div",{children:[!n.additionalSaveOptions&&h.jsx(dn,{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&&h.jsxs("div",{className:"flex",children:[h.jsx(dn,{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")}),h.jsx(Z_,{className:"rounded-bl-none rounded-tl-none h-full px-1 border-l-1 border-y-0 border-r-0",cardActions:!0,disabled:(m==null?void 0:m.disableSaveButton)||n.disableSaveButton,labelButtonBorderColor:i.$1,children:n.additionalSaveOptions.map((b,y)=>h.jsx($n,{icon:b.icon,disabled:n.disableSaveButton,onClick:b.onClick,children:b.label},y))})]})]}),(_||n.navigationTopRight)&&h.jsx("div",{className:"flex space-x-3 items-center",children:(_==null?void 0:_.element)||n.navigationTopRight})]})]})]}),n.aboveMainContainer,h.jsxs("main",{className:"flex-1",children:[(n.breadcrumbs||n.topRight||n.afterBreadcrumbs)&&n.breadcrumbs.length>0&&h.jsxs("div",{className:"pt-4 px-4 md:px-6 md:pt-6 dark:text-gray-100 flex flex-col lg:flex-row lg:justify-between lg:items-center space-y-4 lg:space-y-0",children:[h.jsxs("div",{className:"flex items-center w-full",children:[n.breadcrumbs&&h.jsx(Awe,{pages:n.breadcrumbs}),n.afterBreadcrumbs]}),n.topRight&&h.jsx("div",{children:n.topRight})]}),h.jsx("div",{style:{color:i.$3,backgroundColor:i.$23},className:"p-4 xl:px-6 dark:text-gray-100",children:n.children})]})]})]})}function zQe({children:n,type:e="page"}){return h.jsx(x.Suspense,{fallback:e==="page"||e==="component"?h.jsx(v4,{breadcrumbs:[],children:h.jsx(yo,{})}):h.jsx(yo,{}),children:n})}function UQe(){const n=vCe(),e=Cu(t=>t.user);return n?e.user.id?h.jsx(zQe,{children:h.jsx(Hm,{})}):h.jsx(Sxt,{}):h.jsx(OE,{to:"/login"})}function bqt(){const[n]=xe(),[e,t]=x.useState(!0);return x.useEffect(()=>(setTimeout(()=>{t(!1)},1e3),()=>{t(!0)}),[]),h.jsx(v4,{breadcrumbs:[],children:h.jsx("div",{className:"flex flex-col items-center mt-14 space-y-4",children:e?h.jsx(yo,{}):h.jsxs(h.Fragment,{children:[h.jsx(EZ,{size:128}),h.jsxs("h1",{className:"text-2xl",children:[n("not_allowed"),"."]})]})})})}function yqt(){const[n]=xe(),[e,t]=x.useState(!0);return x.useEffect(()=>(setTimeout(()=>{t(!1)},1e3),()=>{t(!0)}),[]),h.jsx("div",{className:"flex flex-col items-center mt-14 space-y-4",children:e?h.jsx(yo,{}):h.jsxs(h.Fragment,{children:[h.jsx(EZ,{size:128}),h.jsxs("h1",{className:"text-2xl",children:[n("not_allowed"),"."]})]})})}function Cqt(){const n=i9(),e=Vs(),t=Yl(),i=Ml(),r=Sxe();return{companyUser:n,queryClient:e,params:t,user:i,settingsLevel:r.level}}function Si({guards:n,component:e,type:t="page"}){const[i,r]=x.useState("loading"),{companyUser:s,queryClient:o,params:a,user:l,settingsLevel:c}=Cqt();return x.useEffect(()=>{const u=n.map(d=>d({companyUser:s,queryClient:o,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"?h.jsx(v4,{breadcrumbs:[],children:h.jsx(yo,{})}):h.jsx(yo,{}):i==="unauthorized"?t==="page"?h.jsx(bqt,{}):t==="subPage"?h.jsx(yqt,{}):null:h.jsx(zQe,{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 Tn(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 dr(...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 bl(n,e="id"){return({params:t,user:i})=>{const r=t[e],s=Ut(n,{id:r});return Je("GET",ze(s)).then(o=>o.data.data.user_id===(i==null?void 0:i.id)||o.data.data.assigned_user_id===(i==null?void 0:i.id)?Promise.resolve(!0):Promise.resolve(!1)).catch(()=>Promise.resolve(!1))}}const wqt=x.lazy(()=>ue(()=>import("./Invoices-CS_QAVlV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),xqt=x.lazy(()=>ue(()=>import("./Invoice-fo9g6ZUP.js"),__vite__mapDeps([20,1,2,21,22,23,3,4,24,25,26,27]))),Sqt=x.lazy(()=>ue(()=>import("./Import-DbBDQBts.js"),[])),Eqt=x.lazy(()=>ue(()=>import("./Create-BswCht_1.js"),__vite__mapDeps([28,29,24,25]))),kqt=x.lazy(()=>ue(()=>import("./Edit-BbQ5p2pM.js"),__vite__mapDeps([30,31,32,33,34,35,36,24,4,2]))),Tqt=x.lazy(()=>ue(()=>import("./Pdf-BcBfzZPt.js"),__vite__mapDeps([37,35]))),Iqt=x.lazy(()=>ue(()=>import("./Email-DgwYuWBO.js"),__vite__mapDeps([38,39,35]))),Lqt=x.lazy(()=>ue(()=>import("./EInvoice-BK9mHB8V.js"),__vite__mapDeps([40,2]))),k4e=x.lazy(()=>ue(()=>import("./Documents-RR7QjozC.js"),[])),Aqt=x.lazy(()=>ue(()=>import("./Payments-CTFwwaQt.js"),__vite__mapDeps([41,14,15]))),Nqt=x.lazy(()=>ue(()=>import("./PaymentSchedule-Bp7JKjaV.js"),__vite__mapDeps([42,18]))),T4e=x.lazy(()=>ue(()=>import("./Settings-CxIjFxbV.js"),__vite__mapDeps([43,44,45]))),Dqt=x.lazy(()=>ue(()=>import("./Activities-02eZOrQ9.js"),__vite__mapDeps([46,13,1,2,14,15,4,16,17,18]))),Rqt=x.lazy(()=>ue(()=>import("./History-BaYBFn6z.js"),__vite__mapDeps([47,18,48]))),Pqt=x.lazy(()=>ue(()=>import("./EmailHistory-CFfMbD8S.js"),__vite__mapDeps([49,16]))),Oqt=x.lazy(()=>ue(()=>import("./CreatePage-C54Itos9.js"),__vite__mapDeps([50,31,32,33,34,35,36,24]))),Mqt=h.jsxs(Ee,{path:"/invoices",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.Invoices),dr(Tn("view_invoice"),Tn("create_invoice"),Tn("edit_invoice"))],component:h.jsx(wqt,{})})}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[fs(nr.Invoices),dr(Tn("create_invoice"),Tn("edit_invoice"))],component:h.jsx(Sqt,{})})}),h.jsxs(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.Invoices),Tn("create_invoice")],component:h.jsx(Eqt,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(Oqt,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(k4e,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(T4e,{})})]}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.Invoices),dr(Tn("view_invoice"),Tn("edit_invoice"),bl("/api/v1/invoices/:id"))],component:h.jsx(xqt,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx(kqt,{})}),h.jsx(Ee,{path:"e_invoice",element:h.jsx(Lqt,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(k4e,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(T4e,{})}),h.jsx(Ee,{path:"activity",element:h.jsx(Dqt,{})}),h.jsx(Ee,{path:"history",element:h.jsx(Rqt,{})}),h.jsx(Ee,{path:"email_history",element:h.jsx(Pqt,{})}),h.jsx(Ee,{path:"payments",element:h.jsx(Aqt,{})}),h.jsx(Ee,{path:"payment_schedule",element:h.jsx(Nqt,{})})]}),h.jsx(Ee,{path:":id/pdf",element:h.jsx(Si,{guards:[fs(nr.Invoices),dr(Tn("edit_invoice"),bl("/api/v1/invoices/:id"))],component:h.jsx(Tqt,{})})}),h.jsx(Ee,{path:":id/email",element:h.jsx(Si,{guards:[fs(nr.Invoices),dr(Tn("edit_invoice"),bl("/api/v1/invoices/:id"))],component:h.jsx(Iqt,{})})})]});function Md(){return h.jsx("div",{className:"py-4",children:h.jsx(yo,{})})}const jqt=x.lazy(()=>ue(()=>import("./Clients-0aUKK3zh.js"),__vite__mapDeps([51,5,6,7]))),Fqt=x.lazy(()=>ue(()=>import("./Import-DDixjC-Z.js"),[])),Bqt=x.lazy(()=>ue(()=>import("./Create-DwMm49-m.js"),[])),$qt=x.lazy(()=>ue(()=>import("./Edit--vDNEQyO.js"),[])),Hqt=x.lazy(()=>ue(()=>import("./Client-Cf8uVe16.js"),__vite__mapDeps([52,53,27]))),Vqt=x.lazy(()=>ue(()=>import("./Client-CXR1jw51.js"),__vite__mapDeps([54,27]))),Wqt=x.lazy(()=>ue(()=>import("./Quotes-BSCxuM10.js"),__vite__mapDeps([55,56,9,12]))),zqt=x.lazy(()=>ue(()=>import("./Payments-D3eouJXN.js"),__vite__mapDeps([57,58,14,15,59,10]))),Uqt=x.lazy(()=>ue(()=>import("./RecurringInvoices-n_C2kTCO.js"),__vite__mapDeps([60,61,12]))),qqt=x.lazy(()=>ue(()=>import("./Credits-DjUg5VJW.js"),__vite__mapDeps([62,22,23,3,4,2,63,9,10,11]))),Kqt=x.lazy(()=>ue(()=>import("./Projects-DOC3pXm1.js"),__vite__mapDeps([64,65,66]))),Gqt=x.lazy(()=>ue(()=>import("./Tasks-B8IcUJ8H.js"),__vite__mapDeps([67,68]))),Yqt=x.lazy(()=>ue(()=>import("./Expenses-gVxuW-DZ.js"),[])),Qqt=x.lazy(()=>ue(()=>import("./RecurringExpenses-DXFqT4ma.js"),__vite__mapDeps([69,70]))),Xqt=x.lazy(()=>ue(()=>import("./Statement-Bv2pvIx6.js"),[])),Zqt=x.lazy(()=>ue(()=>import("./Invoices-Dm_Rk1Xs.js"),__vite__mapDeps([71,3,4,2,1,8,9,10,11,12]))),Jqt=x.lazy(()=>ue(()=>import("./HistoryAndActivities-CzNRIGqN.js"),__vite__mapDeps([72,16]))),eKt=x.lazy(()=>ue(()=>import("./Documents-abT6JgfA.js"),__vite__mapDeps([73,5]))),I4e=x.lazy(()=>ue(()=>import("./Settings-D945yzNv.js"),[])),L4e=x.lazy(()=>ue(()=>import("./Documents-n5596NtG.js"),[])),A4e=x.lazy(()=>ue(()=>import("./Locations-BEKOnmxb.js"),[])),tKt=x.lazy(()=>ue(()=>import("./CreatePage-DYlkNaPM.js"),[])),nKt=x.lazy(()=>ue(()=>import("./Settings-C4l1lJyu.js"),[])),iKt=h.jsxs(Ee,{path:"clients",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[dr(Tn("view_client"),Tn("create_client"),Tn("edit_client"))],component:h.jsx(jqt,{})})}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[dr(Tn("create_client"),Tn("edit_client"))],component:h.jsx(Fqt,{})})}),h.jsxs(Ee,{path:"create",element:h.jsx(Si,{guards:[Tn("create_client")],component:h.jsx(Bqt,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(tKt,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(I4e,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(L4e,{})}),h.jsx(Ee,{path:"locations",element:h.jsx(A4e,{})})]}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[dr(Tn("edit_client"),bl("/api/v1/clients/:id"))],component:h.jsx(Vqt,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx($qt,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(I4e,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(L4e,{})}),h.jsx(Ee,{path:"locations",element:h.jsx(A4e,{})})]}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[dr(Tn("view_client"),Tn("edit_client"),bl("/api/v1/clients/:id"))],component:h.jsx(Hqt,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(Zqt,{})})}),h.jsx(Ee,{path:"quotes",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(Wqt,{})})}),h.jsx(Ee,{path:"payments",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(zqt,{})})}),h.jsx(Ee,{path:"recurring_invoices",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(Uqt,{})})}),h.jsx(Ee,{path:"credits",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(qqt,{})})}),h.jsx(Ee,{path:"projects",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(Kqt,{})})}),h.jsx(Ee,{path:"tasks",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(Gqt,{})})}),h.jsx(Ee,{path:"expenses",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(Yqt,{})})}),h.jsx(Ee,{path:"recurring_expenses",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(Qqt,{})})}),h.jsx(Ee,{path:"history_and_activities",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(Jqt,{})})}),h.jsx(Ee,{path:"documents_overview",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(eKt,{})})}),h.jsx(Ee,{path:"settings_configuration",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(nKt,{})})})]}),h.jsx(Ee,{path:":id/statement",element:h.jsx(Si,{guards:[dr(Tn("edit_client"),bl("/api/v1/clients/:id"))],component:h.jsx(Xqt,{})})})]});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function mR(){return({companyUser:n})=>Promise.resolve(!!(n!=null&&n.is_admin))}const Pae=x.lazy(()=>ue(()=>import("./Product-BoK2fxfM.js"),__vite__mapDeps([74,27]))),rKt=x.lazy(()=>ue(()=>import("./Import-eEvnuPn-.js"),[])),sKt=x.lazy(()=>ue(()=>import("./Products-CLEqnFtY.js"),__vite__mapDeps([75,5,6,7]))),oKt=x.lazy(()=>ue(()=>import("./Create-Cc9ZeqFe.js"),[])),aKt=x.lazy(()=>ue(()=>import("./Edit-GXEdukcN.js"),[])),lKt=x.lazy(()=>ue(()=>import("./Show-sx0mpMjd.js"),[])),cKt=x.lazy(()=>ue(()=>import("./Documents-D_7A1U9i.js"),[])),uKt=x.lazy(()=>ue(()=>import("./ProductFields-t3KZTo3F.js"),[])),dKt=h.jsxs(Ee,{path:"products",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[dr(Tn("view_product"),Tn("create_product"),Tn("edit_product"))],component:h.jsx(sKt,{})})}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[dr(Tn("create_product"),Tn("edit_product"))],component:h.jsx(rKt,{})})}),h.jsx(Ee,{path:"create",element:h.jsx(Si,{guards:[Tn("create_product")],component:h.jsx(oKt,{})})}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[dr(Tn("view_product"),Tn("edit_product"),bl("/api/v1/products/:id"))],component:h.jsx(Pae,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(lKt,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(cKt,{})})]}),h.jsx(Ee,{path:":id",element:h.jsx(Si,{guards:[mR()],component:h.jsx(Pae,{})}),children:h.jsx(Ee,{path:"product_fields",element:h.jsx(uKt,{})})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(Si,{guards:[dr(Tn("view_product"),Tn("edit_product"),bl("/api/v1/products/:id"))],component:h.jsx(Pae,{})}),children:h.jsx(Ee,{path:"",element:h.jsx(aKt,{})})})]}),hKt=x.lazy(()=>ue(()=>import("./Import-Dw2_hgUR.js"),[])),fKt=x.lazy(()=>ue(()=>import("./RecurringInvoices-BeDCrr3H.js"),__vite__mapDeps([76,6,7,5,77,17,18,61,12,19]))),pKt=x.lazy(()=>ue(()=>import("./RecurringInvoice-igg8pX54.js"),__vite__mapDeps([78,21,1,2,22,23,3,4,27,26]))),gKt=x.lazy(()=>ue(()=>import("./Create-CsyxMk-D.js"),__vite__mapDeps([79,29]))),mKt=x.lazy(()=>ue(()=>import("./CreatePage-BbK_ECsx.js"),__vite__mapDeps([80,31,32,34,35,81,36]))),N4e=x.lazy(()=>ue(()=>import("./Documents-CbBcDxsD.js"),[])),D4e=x.lazy(()=>ue(()=>import("./Settings-C8ZFeEQc.js"),__vite__mapDeps([82,44,45]))),_Kt=x.lazy(()=>ue(()=>import("./Activities-VYLXITv7.js"),__vite__mapDeps([83,77,17,18]))),vKt=x.lazy(()=>ue(()=>import("./History-gPTKz-sT.js"),__vite__mapDeps([84,18,48]))),bKt=x.lazy(()=>ue(()=>import("./Schedule-BA0Hc2uj.js"),[])),yKt=x.lazy(()=>ue(()=>import("./Edit-Bvcn5Zrl.js"),__vite__mapDeps([85,31,32,34,35,81,36]))),CKt=x.lazy(()=>ue(()=>import("./Pdf-Bd25Mael.js"),__vite__mapDeps([86,35]))),wKt=x.lazy(()=>ue(()=>import("./EInvoice-BD25RsFW.js"),[])),xKt=h.jsxs(Ee,{path:"/recurring_invoices",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.RecurringInvoices),dr(Tn("view_recurring_invoice"),Tn("create_recurring_invoice"),Tn("edit_recurring_invoice"))],component:h.jsx(fKt,{})})}),h.jsxs(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.RecurringInvoices),Tn("create_recurring_invoice")],component:h.jsx(gKt,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(mKt,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(N4e,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(D4e,{})})]}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.RecurringInvoices),dr(Tn("view_recurring_invoice"),Tn("edit_recurring_invoice"),bl("/api/v1/recurring_invoices/:id"))],component:h.jsx(pKt,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx(yKt,{})}),h.jsx(Ee,{path:"e_invoice",element:h.jsx(wKt,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(N4e,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(D4e,{})}),h.jsx(Ee,{path:"activity",element:h.jsx(_Kt,{})}),h.jsx(Ee,{path:"history",element:h.jsx(vKt,{})}),h.jsx(Ee,{path:"schedule",element:h.jsx(bKt,{})})]}),h.jsx(Ee,{path:":id/pdf",element:h.jsx(Si,{guards:[fs(nr.RecurringInvoices),dr(Tn("edit_recurring_invoice"),bl("/api/v1/recurring_invoices/:id"))],component:h.jsx(CKt,{})})}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[fs(nr.Invoices),dr(Tn("create_recurring_invoice"),Tn("edit_recurring_invoice"))],component:h.jsx(hKt,{})})})]}),SKt=x.lazy(()=>ue(()=>import("./Activities-KnS3vSlY.js"),__vite__mapDeps([87,88,10]))),Oae=x.lazy(()=>ue(()=>import("./Payment-D_bOZN71.js"),__vite__mapDeps([89,10,59,26,27]))),EKt=x.lazy(()=>ue(()=>import("./Import-C0CQZaWF.js"),[])),kKt=x.lazy(()=>ue(()=>import("./Payments-Go3Iq7p8.js"),__vite__mapDeps([90,58,14,15,5,59,10,4,2,23,88,6,7]))),TKt=x.lazy(()=>ue(()=>import("./Create-DUbET5n7.js"),__vite__mapDeps([91,10,92,11,26]))),IKt=x.lazy(()=>ue(()=>import("./Edit-Cx1RH3iU.js"),__vite__mapDeps([93,92,14,15,53,32]))),LKt=x.lazy(()=>ue(()=>import("./Documents-Jf-3UFZz.js"),__vite__mapDeps([94,10]))),AKt=x.lazy(()=>ue(()=>import("./PaymentFields-Ci8MnCDD.js"),[])),NKt=x.lazy(()=>ue(()=>import("./Apply-SWcSdrbd.js"),__vite__mapDeps([95,10]))),DKt=x.lazy(()=>ue(()=>import("./Refund-omPLkxUg.js"),__vite__mapDeps([96,10]))),RKt=h.jsxs(Ee,{path:"/payments",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[dr(Tn("view_payment"),Tn("create_payment"),Tn("edit_payment"))],component:h.jsx(kKt,{})})}),h.jsx(Ee,{path:"create",element:h.jsx(Si,{guards:[Tn("create_payment")],component:h.jsx(TKt,{})})}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[dr(Tn("edit_payment"),bl("/api/v1/payments/:id"))],component:h.jsx(Oae,{})}),children:[h.jsx(Ee,{path:"apply",element:h.jsx(NKt,{})}),h.jsx(Ee,{path:"refund",element:h.jsx(DKt,{})})]}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[dr(Tn("view_payment"),Tn("edit_payment"),bl("/api/v1/payments/:id"))],component:h.jsx(Oae,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx(IKt,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(LKt,{})}),h.jsx(Ee,{path:"activity",element:h.jsx(SKt,{})})]}),h.jsx(Ee,{path:":id",element:h.jsx(Si,{guards:[mR()],component:h.jsx(Oae,{})}),children:h.jsx(Ee,{path:"payment_fields",element:h.jsx(AKt,{})})}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[dr(Tn("create_payment"),Tn("edit_payment"))],component:h.jsx(EKt,{})})})]});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function il(n){return({companyUser:e})=>new Promise(t=>t(!0))}function PKt(){const n=Yi();return x.useEffect(()=>{n("/settings/company_details")}),h.jsx(h.Fragment,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.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(n){const e=zi(),t=Nr(),i=Fr(),{isCompanySettingsActive:r}=el();return x.useEffect(()=>{t&&(n==null?void 0:n.overwrite)===!1||r&&i(ME({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 vr(n,e=!0){const[t]=xe();zi();const[i,r]=x.useState(e?t(n)||"":n),s=()=>{let o="";return o="Invoice Ninja",`${o}: ${i}`};return x.useEffect(()=>{document.title=s()},[i]),{documentTitle:i,setDocumentTitle:r}}function OKt(n){const[e]=xe(),{entity:t}=n||{};return(i,r)=>i==="id"&&t==="client"?h.jsxs("div",{className:"inline-flex flex-col justify-center",children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsxs("span",{children:[e("clients_limit"),"!"]}),h.jsxs(Ji,{className:"underline",to:"/settings/account_management",children:[e("unlock_unlimited_clients"),"!"]})]}),h.jsx("span",{children:r})]}):r}function MKt(n){const{entity:e,withoutTopMessage:t,withoutListBullets:i}=n,r=OKt({entity:e});return h.jsxs(Kl,{className:"mb-6",children:[!t&&h.jsx("p",{children:n.errors.message}),h.jsx("ul",{children:Object.keys(n.errors.errors).map((s,o)=>h.jsxs("li",{children:[!i&&h.jsx(h.Fragment,{children:"– "}),r(s,n.errors.errors[s])]},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 qQe(){const n=Fr();return()=>{n(zu("company")),n(n9({status:{name:"",level:"company"}}))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function jKt({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 20 20",children:[h.jsx("polygon",{points:"12 3 13.1538 6.8462 17 8 13.1538 9.1538 12 13 10.8462 9.1538 7 8 10.8462 6.8462 12 3",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",fill:e}),h.jsx("path",{d:"m8.5137,13.7692l-1.6807-.6347-.6309-1.6921c-.2188-.5899-1.1855-.5899-1.4043,0l-.6309,1.6921-1.6807.6347c-.292.1106-.4863.3923-.4863.7069s.1943.5963.4863.7069l1.6807.6347.6309,1.6921c.1094.295.3896.4901.7021.4901s.5928-.1952.7021-.4901l.6309-1.6921,1.6807-.6347c.292-.1106.4863-.3923.4863-.7069s-.1943-.5963-.4863-.7069Z",fill:e,strokeWidth:"0","data-color":"color-2"})]})}const R4e=As(r1)` color: ${n=>n.theme.color}; background-color: ${n=>n.theme.backgroundColor}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function Kr(n){const[e]=xe(),[t,i]=oo(ya),r=gc(),s=xt(),{basic:o,advanced:a}=lUt(),l=Sxe(),c=r.pathname.split("/")[2],{isGroupSettingsActive:u,isClientSettingsActive:d}=el(),f=Yi(),p=qQe();return x.useEffect(()=>{i(void 0)},[c]),h.jsxs(v4,{onSaveClick:n.onSaveClick,onCancelClick:n.onCancelClick,title:n.title,docsLink:n.docsLink,navigationTopRight:n.navigationTopRight,disableSaveButton:n.disableSaveButton,breadcrumbs:[],aboveMainContainer:n.aboveMainContainer,children:[n.breadcrumbs&&h.jsx("div",{className:"w-full pl-0 lg:pl-2 pt-3 pb-2",children:h.jsx(Awe,{pages:n.breadcrumbs})}),h.jsxs("div",{className:"grid grid-cols-12 lg:gap-6",children:[h.jsxs("div",{className:"col-span-12 lg:col-span-3",children:[(u||d)&&h.jsxs("div",{className:"flex items-center justify-between border py-3 space-x-3 px-3 rounded-md shadow-sm",style:{backgroundColor:s.$1,borderColor:s.$24},children:[h.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[h.jsx("div",{children:h.jsx(an,{element:u?C3t:bUe,size:20})}),h.jsxs("span",{className:"text-sm truncate",children:[e(u?"group_settings":"client_settings"),": ",l.name]})]}),h.jsx("div",{className:"cursor-pointer hover:opacity-75",onClick:()=>{p(),u&&f("/settings/group_settings"),d&&f("/clients")},children:h.jsx(gA,{color:s.$3,size:"1rem"})})]}),h.jsx("a",{className:"flex items-center mb-3 mt-4 px-0 lg:px-3 text-sm font-medium",children:h.jsx("span",{className:"truncate",style:{color:s.$17},children:e("basic_settings")})}),h.jsx(Dn,{className:"lg:hidden text-sm",value:r.pathname,onValueChange:g=>f(g),withBlank:!0,customSelector:!0,children:o.filter(g=>g.enabled).map(g=>h.jsx("option",{value:g.href,children:g.name},g.name))}),h.jsx("nav",{className:"space-y-1 hidden lg:block","aria-label":"Sidebar",children:o.map(g=>g.enabled&&h.jsx(R4e,{to:g.href,className:Vie("flex items-center px-3 py-2 text-sm font-medium rounded-md"),"aria-current":g.current?"page":void 0,theme:{backgroundColor:g.current?s.$20:"",color:g.current?s.$3:"",hoverColor:s.$20},children:h.jsx("span",{className:"truncate",children:g.name})},g.name))}),a.filter(g=>g.enabled).length>0&&h.jsxs("div",{className:"flex items-center mb-3 mt-8 px-0 lg:px-3 text-sm font-medium truncate space-x-2",children:[h.jsx("span",{style:{color:s.$17},children:e("advanced_settings")}),h.jsxs("div",{className:"flex space-x-0.5 items-center text-xs py-1 px-2 bg-[#2176FF26] rounded",children:[h.jsx("div",{children:h.jsx(jKt,{size:"1rem",color:"#2176FF"})}),h.jsx("span",{className:"font-medium",style:{color:"#2176FF"},children:e("pro")})]})]}),h.jsx(Dn,{className:"lg:hidden text-sm",value:r.pathname,onValueChange:g=>f(g),withBlank:!0,customSelector:!0,children:a.filter(g=>g.enabled).map(g=>h.jsx("option",{value:g.href,children:g.name},g.name))}),h.jsx("nav",{className:"space-y-1 hidden lg:block","aria-label":"Sidebar",children:a.map((g,m)=>h.jsxs("div",{children:[g.enabled&&h.jsx(R4e,{to:g.href,className:Vie("flex items-center px-3 py-2 text-sm font-medium rounded-md"),"aria-current":g.current?"page":void 0,theme:{backgroundColor:g.current?s.$20:"",color:g.current?s.$3:"",hoverColor:s.$20},children:h.jsx("span",{className:"truncate",children:g.name})},g.name),g.children&&g.current&&h.jsx("div",{className:"bg-gray-100 space-y-4 py-3 rounded-b",children:g.children&&g.children.map((_,v)=>h.jsx(r1,{to:_.href,className:Vie(_.current?"text-gray-900 font-semibold":"","ml-4 px-3 text-sm block text-gray-700 hover:text-gray-900 transition duration-200 ease-in-out"),children:_.name},v))})]},m))})]}),h.jsxs("div",{className:"col-span-12 lg:col-start-4 space-y-6 mt-4",children:[t&&h.jsx(MKt,{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 EA=Ls(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 xg(){const n=Fr(),{isCompanySettingsActive:e,isGroupSettingsActive:t,isClientSettingsActive:i}=el(),r=ji(EA);return()=>{e&&n(zu("company")),(t||i)&&r&&n(Uo({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 FJ=Ls(!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 KQe={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 GQe(n){const{id:e}=Yl(),t=Vs(),i=Fr(),r=Nr(),s=ji(EA),o=ji(wu),{isGroupSettingsActive:a}=el(),{groupSettings:l,setErrors:c,setIsFormBusy:u,isFormBusy:d}=n,f=()=>{const p=pn.cloneDeep(r==null?void 0:r.settings);return p&&((!p.email_template_custom1||!p.email_subject_custom1)&&(delete p.email_template_custom1,delete p.email_subject_custom1),(!p.email_template_custom2||!p.email_subject_custom2)&&(delete p.email_template_custom2,delete p.email_subject_custom2),(!p.email_template_custom3||!p.email_subject_custom3)&&(delete p.email_template_custom3,delete p.email_subject_custom3),Object.entries(p).forEach(([g,m])=>{m===null&&(p[g]=KQe[g])})),{...s,settings:p}};return()=>{d||(pe.processing(),c==null||c(void 0),u==null||u(!0),Je("PUT",ze("/api/v1/group_settings/:id",{id:e||(s==null?void 0:s.id)}),l||f()).then(p=>{pe.success("updated_group"),ii(["group_settings"]),a&&(i(Uo({object:"company",property:"settings",value:p.data.data.settings})),i(n9({status:{name:p.data.data.name,level:"group"}}))),o&&t.invalidateQueries([o])}).catch(p=>{var g;((g=p.response)==null?void 0:g.status)===422&&(pe.dismiss(),c==null||c(p.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 FKt(){const n=Fr(),e=Nr(),t=ji(EA),i=ts(ya),r=()=>{const s=pn.cloneDeep(e==null?void 0:e.settings);return s&&((!s.email_template_custom1||!s.email_subject_custom1)&&(delete s.email_template_custom1,delete s.email_subject_custom1),(!s.email_template_custom2||!s.email_subject_custom2)&&(delete s.email_template_custom2,delete s.email_subject_custom2),(!s.email_template_custom3||!s.email_subject_custom3)&&(delete s.email_template_custom3,delete s.email_subject_custom3),delete s.e_invoice,Object.entries(s).forEach(([o,a])=>{a===null&&(s[o]=KQe[o])})),{...t,settings:s,e_invoice:(e==null?void 0:e.e_invoice)||{}}};return()=>{pe.processing(),i(void 0),Je("PUT",ze("/api/v1/clients/:id",{id:t==null?void 0:t.id}),r()).then(s=>{pe.success("updated_settings"),ii(["clients"]),n(Uo({object:"company",property:"settings",value:s.data.data.settings})),n(n9({status:{name:s.data.data.display_name,level:"client"}}))}).catch(s=>{var o;((o=s.response)==null?void 0:o.status)===422&&(pe.dismiss(),i(s.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 */const _f=Ls(!1);function pd(){const n=Fr(),e=xu(),t=Vvt(),i=GQe({}),r=FKt(),{isGroupSettingsActive:s,isCompanySettingsActive:o,isClientSettingsActive:a}=el(),l=ts(ya),[c,u]=oo(_f),[d,f]=oo(FJ);return async p=>{if(c)return;const{excludeToasters:g=!1,syncSendTime:m}=p||{};if(!t()&&o)return;if(s)return i();if(a)return r();const _=typeof g=="boolean"&&g;!_&&pe.processing(),l(void 0),u(!0);let v="/api/v1/companies/:id";return typeof m=="boolean"&&(v+="?sync_send_time="+m),Je("PUT",ze(v,{id:e==null?void 0:e.id}),e).then(b=>{n(gk({object:"company",data:b.data.data})),n(zu("company")),!_&&pe.dismiss(),d&&(ii(["statics"]),f(!1)),!_&&pe.success("updated_settings")}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(l(b.response.data),pe.dismiss())}).finally(()=>u(!1))}}const BKt=As(r1)` border-color: ${({theme:n})=>n.borderColor}; color: ${({theme:n})=>n.textColor}; &:hover { color: ${({theme:n})=>n.hoverTextColor}; } `;function wk(n){var m;const e=Yi(),{visible:t=!0,tabBarClassName:i,withHorizontalPadding:r,horizontalPaddingWidth:s="1.5rem",fullRightPadding:o,paddingTabsHeight:a="2.8rem"}=n,l=Yl(),c=gc(),u=xt(),[d]=qB(),f=x.useRef(null),p=_=>{var v;return c.pathname===_.href||((v=_.matcher)==null?void 0:v.some(b=>b(l)===Ut(c.pathname,l)))},g=_=>{const v=_.currentTarget,b=f.current,y=b.scrollWidth/6,C=v.getBoundingClientRect().width/2;b.scrollTo({left:v.offsetLeft-y-C})};return x.useEffect(()=>{if(n.tabs.length&&!n.disableBackupNavigation){const _=n.tabs.some(({href:v})=>v===c.pathname);if(d.get("redirect")==="false")return;_||e(n.tabs[0].href)}},[]),t?h.jsxs("div",{className:n.className,"data-cy":"tabs",children:[h.jsxs("div",{className:$t("flex flex-col space-y-5 sm:hidden",{"px-4":n.withHorizontalPaddingOnSmallScreen}),children:[h.jsx("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),h.jsx(Dn,{id:"tabs",className:"text-sm sm:text-sm",defaultValue:(m=n.tabs.find(_=>_))==null?void 0:m.name,onValueChange:_=>e(_),customSelector:!0,dismissable:!1,children:n.tabs.map(_=>{var v;return(typeof _.enabled>"u"||_.enabled)&&h.jsx("option",{value:_.href,children:((v=_.formatName)==null?void 0:v.call(_))||_.name},_.name)})}),n.rightSide]}),h.jsx("div",{className:"hidden sm:block",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("nav",{ref:f,className:$t("flex flex-1 relative scroll-smooth overflow-x-auto",i),"aria-label":"Tabs",children:[r&&h.jsx("div",{style:{width:s,height:a,borderBottom:`1px solid ${u.$20}`,flexShrink:0}}),n.tabs.map(_=>{var v;return(typeof _.enabled>"u"||_.enabled)&&h.jsx(BKt,{to:_.href,onClick:b=>g(b),theme:{textColor:p(_)?u.$3:u.$17,hoverTextColor:u.$3},className:"whitespace-nowrap font-medium text-sm px-4 py-3","aria-current":p(_)?"page":void 0,style:{borderBottom:p(_)?`1px solid ${u.$3}`:`1px solid ${u.$20}`},children:h.jsx("div",{children:((v=_.formatName)==null?void 0:v.call(_))||_.name})},_.name)}),h.jsx("div",{className:$t({"flex-1":!r||o}),style:{...r&&!o?{width:s,flexShrink:0}:{minWidth:s},height:a,borderBottom:`1px solid ${u.$20}`}})]}),n.rightSide&&h.jsx("div",{className:"flex items-center border-b pl-4",style:{borderColor:u.$20,height:"2.8rem"},children:n.rightSide})]})})]}):h.jsx(h.Fragment,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function YQe(n){return lr(["/api/v1/documents",n],()=>Je("GET",ze("/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 QQe=()=>(n,e)=>{pe.processing(),Je("POST",ze("/api/v1/documents/bulk?per_page=100"),{action:e,ids:n}).then(()=>pe.success("exported_data"))},XQe=()=>async(n,e)=>(pe.processing(),Je("PUT",ze("/api/v1/documents/:id",{id:n}),{is_public:e}).then(()=>pe.success("success")));function Ixe(n){const[e]=xe(),{numberOfDocuments:t,textCenter:i}=n;return h.jsxs("div",{className:$t("flex space-x-1",{"justify-center":i}),children:[h.jsx("span",{children:e("documents")}),!!t&&h.jsxs("span",{className:"font-bold",children:["(",t,")"]})]})}function $Kt(){const{t:n}=xe(),{data:e}=YQe({companyDocuments:"true"}),{isGroupSettingsActive:t,isClientSettingsActive:i}=el();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 s;return h.jsx(Ixe,{numberOfDocuments:(s=e==null?void 0:e.data)==null?void 0:s.meta.pagination.total})}},{name:n("custom_fields"),href:"/settings/company_details/custom_fields"}];return(t||i)&&(r=r.filter(s=>s.name!==n("custom_fields")&&s.name!==n("documents"))),r}function HKt(){const[n]=xe();xu(),vr("company_details");const e=xt(),t=$Kt(),i=xg(),r=pd(),s=ji(_f),o=[{name:n("settings"),href:"/settings"},{name:n("company_details"),href:"/settings/company_details"}];return h.jsx(Kr,{onSaveClick:r,onCancelClick:i,title:n("company_details"),breadcrumbs:o,docsLink:"en/basic-settings/#company_details",disableSaveButton:s,children:h.jsxs(er,{className:"shadow-sm",title:n("company"),withoutBodyPadding:!0,withoutHeaderBorder:!0,style:{borderColor:e.$24},children:[h.jsx(wk,{tabs:t,withHorizontalPadding:!0,fullRightPadding:!0,withHorizontalPaddingOnSmallScreen:!0}),h.jsx("div",{className:"pt-4 pb-8",children:h.jsx(Hm,{})})]})})}function b4(){return(b4=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 BJ(n,e){if(n==null)return{};var t,i,r={},s=Object.keys(n);for(i=0;i<s.length;i++)e.indexOf(t=s[i])>=0||(r[t]=n[t]);return r}function A8(n){var e=x.useRef(n),t=x.useRef(function(i){e.current&&e.current(i)});return e.current=n,t.current}var N8=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),n>t?t:n<e?e:n},DF=function(n){return"touches"in n},Yfe=function(n){return n&&n.ownerDocument.defaultView||self},P4e=function(n,e,t){var i=n.getBoundingClientRect(),r=DF(e)?function(s,o){for(var a=0;a<s.length;a++)if(s[a].identifier===o)return s[a];return s[0]}(e.touches,t):e;return{left:N8((r.pageX-(i.left+Yfe(n).pageXOffset))/i.width),top:N8((r.pageY-(i.top+Yfe(n).pageYOffset))/i.height)}},O4e=function(n){!DF(n)&&n.preventDefault()},ZQe=we.memo(function(n){var e=n.onMove,t=n.onKey,i=BJ(n,["onMove","onKey"]),r=x.useRef(null),s=A8(e),o=A8(t),a=x.useRef(null),l=x.useRef(!1),c=x.useMemo(function(){var p=function(_){O4e(_),(DF(_)?_.touches.length>0:_.buttons>0)&&r.current?s(P4e(r.current,_,a.current)):m(!1)},g=function(){return m(!1)};function m(_){var v=l.current,b=Yfe(r.current),y=_?b.addEventListener:b.removeEventListener;y(v?"touchmove":"mousemove",p),y(v?"touchend":"mouseup",g)}return[function(_){var v=_.nativeEvent,b=r.current;if(b&&(O4e(v),!function(C,S){return S&&!DF(C)}(v,l.current)&&b)){if(DF(v)){l.current=!0;var y=v.changedTouches||[];y.length&&(a.current=y[0].identifier)}b.focus(),s(P4e(b,v,a.current)),m(!0)}},function(_){var v=_.which||_.keyCode;v<37||v>40||(_.preventDefault(),o({left:v===39?.05:v===37?-.05:0,top:v===40?.05:v===38?-.05:0}))},m]},[o,s]),u=c[0],d=c[1],f=c[2];return x.useEffect(function(){return f},[f]),we.createElement("div",b4({},i,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:r,onKeyDown:d,tabIndex:0,role:"slider"}))}),Lxe=function(n){return n.filter(Boolean).join(" ")},JQe=function(n){var e=n.color,t=n.left,i=n.top,r=i===void 0?.5:i,s=Lxe(["react-colorful__pointer",n.className]);return we.createElement("div",{className:s,style:{top:100*r+"%",left:100*t+"%"}},we.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},vh=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*n)/t},VKt=function(n){return KKt(Qfe(n))},Qfe=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?vh(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?vh(parseInt(n.substring(6,8),16)/255,2):1}},WKt=function(n){return qKt(UKt(n))},zKt=function(n){var e=n.s,t=n.v,i=n.a,r=(200-e)*t/100;return{h:vh(n.h),s:vh(r>0&&r<200?e*t/100/(r<=100?r:200-r)*100:0),l:vh(r/2),a:vh(i,2)}},Xfe=function(n){var e=zKt(n);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},UKt=function(n){var e=n.h,t=n.s,i=n.v,r=n.a;e=e/360*6,t/=100,i/=100;var s=Math.floor(e),o=i*(1-t),a=i*(1-(e-s)*t),l=i*(1-(1-e+s)*t),c=s%6;return{r:vh(255*[i,a,o,o,l,i][c]),g:vh(255*[l,i,i,a,o,o][c]),b:vh(255*[o,o,l,i,i,a][c]),a:vh(r,2)}},sV=function(n){var e=n.toString(16);return e.length<2?"0"+e:e},qKt=function(n){var e=n.r,t=n.g,i=n.b,r=n.a,s=r<1?sV(vh(255*r)):"";return"#"+sV(e)+sV(t)+sV(i)+s},KKt=function(n){var e=n.r,t=n.g,i=n.b,r=n.a,s=Math.max(e,t,i),o=s-Math.min(e,t,i),a=o?s===e?(t-i)/o:s===t?2+(i-e)/o:4+(e-t)/o:0;return{h:vh(60*(a<0?a+6:a)),s:vh(s?o/s*100:0),v:vh(s/255*100),a:r}},GKt=we.memo(function(n){var e=n.hue,t=n.onChange,i=Lxe(["react-colorful__hue",n.className]);return we.createElement("div",{className:i},we.createElement(ZQe,{onMove:function(r){t({h:360*r.left})},onKey:function(r){t({h:N8(e+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":vh(e),"aria-valuemax":"360","aria-valuemin":"0"},we.createElement(JQe,{className:"react-colorful__hue-pointer",left:e/360,color:Xfe({h:e,s:100,v:100,a:1})})))}),YKt=we.memo(function(n){var e=n.hsva,t=n.onChange,i={backgroundColor:Xfe({h:e.h,s:100,v:100,a:1})};return we.createElement("div",{className:"react-colorful__saturation",style:i},we.createElement(ZQe,{onMove:function(r){t({s:100*r.left,v:100-100*r.top})},onKey:function(r){t({s:N8(e.s+100*r.left,0,100),v:N8(e.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+vh(e.s)+"%, Brightness "+vh(e.v)+"%"},we.createElement(JQe,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:Xfe(e)})))}),eXe=function(n,e){if(n===e)return!0;for(var t in n)if(n[t]!==e[t])return!1;return!0},QKt=function(n,e){return n.toLowerCase()===e.toLowerCase()||eXe(Qfe(n),Qfe(e))};function XKt(n,e,t){var i=A8(t),r=x.useState(function(){return n.toHsva(e)}),s=r[0],o=r[1],a=x.useRef({color:e,hsva:s});x.useEffect(function(){if(!n.equal(e,a.current.color)){var c=n.toHsva(e);a.current={hsva:c,color:e},o(c)}},[e,n]),x.useEffect(function(){var c;eXe(s,a.current.hsva)||n.equal(c=n.fromHsva(s),a.current.color)||(a.current={hsva:s,color:c},i(c))},[s,n,i]);var l=x.useCallback(function(c){o(function(u){return Object.assign({},u,c)})},[]);return[s,l]}var ZKt=typeof window<"u"?x.useLayoutEffect:x.useEffect,JKt=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},M4e=new Map,eGt=function(n){ZKt(function(){var e=n.current?n.current.ownerDocument:document;if(e!==void 0&&!M4e.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}`,M4e.set(e,t);var i=JKt();i&&t.setAttribute("nonce",i),e.head.appendChild(t)}},[])},tGt=function(n){var e=n.className,t=n.colorModel,i=n.color,r=i===void 0?t.defaultColor:i,s=n.onChange,o=BJ(n,["className","colorModel","color","onChange"]),a=x.useRef(null);eGt(a);var l=XKt(t,r,s),c=l[0],u=l[1],d=Lxe(["react-colorful",e]);return we.createElement("div",b4({},o,{ref:a,className:d}),we.createElement(YKt,{hsva:c,onChange:u}),we.createElement(GKt,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},nGt={defaultColor:"000",toHsva:VKt,fromHsva:function(n){return WKt({h:n.h,s:n.s,v:n.v,a:1})},equal:QKt},iGt=function(n){return we.createElement(tGt,b4({},n,{colorModel:nGt}))},rGt=/^#?([0-9A-F]{3,8})$/i,sGt=function(n){var e=n.color,t=e===void 0?"":e,i=n.onChange,r=n.onBlur,s=n.escape,o=n.validate,a=n.format,l=n.process,c=BJ(n,["color","onChange","onBlur","escape","validate","format","process"]),u=x.useState(function(){return s(t)}),d=u[0],f=u[1],p=A8(i),g=A8(r),m=x.useCallback(function(v){var b=s(v.target.value);f(b),o(b)&&p(l?l(b):b)},[s,l,o,p]),_=x.useCallback(function(v){o(v.target.value)||f(s(t)),g(v)},[t,s,o,g]);return x.useEffect(function(){f(s(t))},[t,s]),we.createElement("input",b4({},c,{value:a?a(d):d,spellCheck:"false",onChange:m,onBlur:_}))},j4e=function(n){return"#"+n},oGt=function(n){var e=n.prefixed,t=n.alpha,i=BJ(n,["prefixed","alpha"]),r=x.useCallback(function(o){return o.replace(/([^0-9A-F]+)/gi,"").substring(0,t?8:6)},[t]),s=x.useCallback(function(o){return function(a,l){var c=rGt.exec(a),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8}(o,t)},[t]);return we.createElement(sGt,b4({},i,{escape:r,format:e?j4e:void 0,process:j4e,validate:s}))};const aGt=["#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 xw(n){const{t:e}=xe(),{includeDefaultPalette:t,renderLabelBox:i}=n,r=xt(),s=Qo(),[o,a]=x.useState(n.value||"#000000"),[l,c]=x.useState(!1),[u,d]=x.useState(!1);return xL(()=>{var f;return(f=n.onValueChange)==null?void 0:f.call(n,o)},500,[o]),x.useEffect(()=>{n.value&&a(n.value)},[n.value]),h.jsxs("div",{children:[h.jsx(pr,{title:e("color"),visible:l,onClose:c,centerContent:!0,disableClosing:u,size:"micro",children:h.jsxs("div",{className:"flex flex-col space-y-2 w-full",children:[h.jsx(iGt,{color:o,onChange:a,style:{width:"100%"}}),h.jsx(oGt,{color:o,onChange:a,className:$t("border rounded-md my-2 p-2 focus:outline-none focus:ring-0",{"border-[#d1d5db] focus:border-black":!s.dark_mode,"border-[#1f2e41] focus:border-white":s.dark_mode}),style:{backgroundColor:r.$1,width:"100%"}}),h.jsxs("div",{className:"flex w-full justify-between",children:[t&&h.jsx(dn,{behavior:"button",type:"secondary",onClick:()=>d(!0),children:e("default")}),h.jsx(dn,{className:$t({"w-full":!t}),behavior:"button",onClick:()=>c(!1),children:e("done")})]})]})}),h.jsx(pr,{title:e("default"),visible:u,size:"small",onClose:()=>d(!1),children:h.jsxs("div",{className:"flex flex-col space-y-6",children:[h.jsx("div",{className:"grid grid-cols-6 gap-x-2 gap-y-2",children:aGt.map(f=>h.jsx("div",{className:"relative cursor-pointer w-full hover:opacity-75",onClick:()=>a(f),style:{height:32,backgroundColor:f},children:o===f&&h.jsx(an,{className:"absolute",element:ewe,color:"white",size:25,style:{top:"0.3rem",left:"1.45rem"}})},f))}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{behavior:"button",onClick:()=>d(!1),children:e("done")})})]})}),i?h.jsx("div",{onClick:()=>c(!0),children:i(o)}):h.jsx("div",{style:{backgroundColor:o},className:$t("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")&&c(!0)})]})}function lGt(){var i,r;const[n]=xe(),e=Fr(),t=Cu(s=>s.user.changes);return h.jsx(ne,{leftSide:n("accent_color"),children:h.jsx(xw,{value:((r=(i=t==null?void 0:t.company_user)==null?void 0:i.settings)==null?void 0:r.accent_color)||Dze.primary,onValueChange:s=>e(uA({property:"company_user.settings.accent_color",value:s}))})})}function cGt(n={}){const{nonce:e,onScriptLoadSuccess:t,onScriptLoadError:i}=n,[r,s]=x.useState(!1),o=x.useRef(t);o.current=t;const a=x.useRef(i);return a.current=i,x.useEffect(()=>{const l=document.createElement("script");return l.src="https://accounts.google.com/gsi/client",l.async=!0,l.defer=!0,l.nonce=e,l.onload=()=>{var c;s(!0),(c=o.current)===null||c===void 0||c.call(o)},l.onerror=()=>{var c;s(!1),(c=a.current)===null||c===void 0||c.call(a)},document.body.appendChild(l),()=>{document.body.removeChild(l)}},[e]),r}const tXe=x.createContext(null);function uGt({clientId:n,nonce:e,onScriptLoadSuccess:t,onScriptLoadError:i,children:r}){const s=cGt({nonce:e,onScriptLoadSuccess:t,onScriptLoadError:i}),o=x.useMemo(()=>({clientId:n,scriptLoadedSuccessfully:s}),[n,s]);return we.createElement(tXe.Provider,{value:o},r)}function $J(){const n=x.useContext(tXe);if(!n)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return n}function nXe(n){var e;return(e=n==null?void 0:n.clientId)!==null&&e!==void 0?e:n==null?void 0:n.client_id}const dGt={large:40,medium:32,small:20};function iXe({onSuccess:n,onError:e,useOneTap:t,promptMomentNotification:i,type:r="standard",theme:s="outline",size:o="large",text:a,shape:l,logo_alignment:c,width:u,locale:d,click_listener:f,containerProps:p,...g}){const m=x.useRef(null),{clientId:_,scriptLoadedSuccessfully:v}=$J(),b=x.useRef(n);b.current=n;const y=x.useRef(e);y.current=e;const C=x.useRef(i);return C.current=i,x.useEffect(()=>{var S,k,I,L,N,P,O,F,V;if(v)return(I=(k=(S=window==null?void 0:window.google)===null||S===void 0?void 0:S.accounts)===null||k===void 0?void 0:k.id)===null||I===void 0||I.initialize({client_id:_,callback:M=>{var B;if(!(M!=null&&M.credential))return(B=y.current)===null||B===void 0?void 0:B.call(y);const{credential:W,select_by:q}=M;b.current({credential:W,clientId:nXe(M),select_by:q})},...g}),(P=(N=(L=window==null?void 0:window.google)===null||L===void 0?void 0:L.accounts)===null||N===void 0?void 0:N.id)===null||P===void 0||P.renderButton(m.current,{type:r,theme:s,size:o,text:a,shape:l,logo_alignment:c,width:u,locale:d,click_listener:f}),t&&((V=(F=(O=window==null?void 0:window.google)===null||O===void 0?void 0:O.accounts)===null||F===void 0?void 0:F.id)===null||V===void 0||V.prompt(C.current)),()=>{var M,B,W;t&&((W=(B=(M=window==null?void 0:window.google)===null||M===void 0?void 0:M.accounts)===null||B===void 0?void 0:B.id)===null||W===void 0||W.cancel())}},[_,v,t,r,s,o,a,l,c,u,d]),we.createElement("div",{...p,ref:m,style:{height:dGt[o],...p==null?void 0:p.style}})}function hGt(){var n,e,t;(t=(e=(n=window==null?void 0:window.google)===null||n===void 0?void 0:n.accounts)===null||e===void 0?void 0:e.id)===null||t===void 0||t.disableAutoSelect()}function fGt({flow:n="implicit",scope:e="",onSuccess:t,onError:i,onNonOAuthError:r,overrideScope:s,state:o,...a}){const{clientId:l,scriptLoadedSuccessfully:c}=$J(),u=x.useRef(),d=x.useRef(t);d.current=t;const f=x.useRef(i);f.current=i;const p=x.useRef(r);p.current=r,x.useEffect(()=>{var _,v;if(!c)return;const b=n==="implicit"?"initTokenClient":"initCodeClient",y=(v=(_=window==null?void 0:window.google)===null||_===void 0?void 0:_.accounts)===null||v===void 0?void 0:v.oauth2[b]({client_id:l,scope:s?e:`openid profile email ${e}`,callback:C=>{var S,k;if(C.error)return(S=f.current)===null||S===void 0?void 0:S.call(f,C);(k=d.current)===null||k===void 0||k.call(d,C)},error_callback:C=>{var S;(S=p.current)===null||S===void 0||S.call(p,C)},state:o,...a});u.current=y},[l,c,n,e,o]);const g=x.useCallback(_=>{var v;return(v=u.current)===null||v===void 0?void 0:v.requestAccessToken(_)},[]),m=x.useCallback(()=>{var _;return(_=u.current)===null||_===void 0?void 0:_.requestCode()},[]);return n==="implicit"?g:m}function pGt({onSuccess:n,onError:e,promptMomentNotification:t,cancel_on_tap_outside:i,prompt_parent_id:r,state_cookie_domain:s,hosted_domain:o,use_fedcm_for_prompt:a=!1,disabled:l,auto_select:c}){const{clientId:u,scriptLoadedSuccessfully:d}=$J(),f=x.useRef(n);f.current=n;const p=x.useRef(e);p.current=e;const g=x.useRef(t);g.current=t,x.useEffect(()=>{var m,_,v,b,y,C,S,k,I;if(d){if(l){(v=(_=(m=window==null?void 0:window.google)===null||m===void 0?void 0:m.accounts)===null||_===void 0?void 0:_.id)===null||v===void 0||v.cancel();return}return(C=(y=(b=window==null?void 0:window.google)===null||b===void 0?void 0:b.accounts)===null||y===void 0?void 0:y.id)===null||C===void 0||C.initialize({client_id:u,callback:L=>{var N;if(!(L!=null&&L.credential))return(N=p.current)===null||N===void 0?void 0:N.call(p);const{credential:P,select_by:O}=L;f.current({credential:P,clientId:nXe(L),select_by:O})},hosted_domain:o,cancel_on_tap_outside:i,prompt_parent_id:r,state_cookie_domain:s,use_fedcm_for_prompt:a,auto_select:c}),(I=(k=(S=window==null?void 0:window.google)===null||S===void 0?void 0:S.accounts)===null||k===void 0?void 0:k.id)===null||I===void 0||I.prompt(g.current),()=>{var L,N,P;(P=(N=(L=window==null?void 0:window.google)===null||L===void 0?void 0:L.accounts)===null||N===void 0?void 0:N.id)===null||P===void 0||P.cancel()}}},[u,d,i,r,s,o,a,l,c])}function gGt(n,e,...t){var i,r,s;return window!=null&&window.google&&((s=(r=(i=window==null?void 0:window.google)===null||i===void 0?void 0:i.accounts)===null||r===void 0?void 0:r.oauth2)===null||s===void 0?void 0:s.hasGrantedAllScopes(n,e,...t))||!1}function mGt(n,e,...t){var i,r,s;return window!=null&&window.google&&((s=(r=(i=window==null?void 0:window.google)===null||i===void 0?void 0:i.accounts)===null||r===void 0?void 0:r.oauth2)===null||s===void 0?void 0:s.hasGrantedAnyScope(n,e,...t))||!1}const _Gt=Object.freeze(Object.defineProperty({__proto__:null,GoogleLogin:iXe,GoogleOAuthProvider:uGt,googleLogout:hGt,hasGrantedAllScopesGoogle:gGt,hasGrantedAnyScopeGoogle:mGt,useGoogleLogin:fGt,useGoogleOAuth:$J,useGoogleOneTapLogin:pGt},Symbol.toStringTag,{value:"Module"}));/*! @azure/msal-common v14.16.0 2024-11-05 */const wn={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",NOT_AVAILABLE:"Not Available",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",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"},oV={CLIENT_ERROR_RANGE_START:400,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR_RANGE_START:500,SERVER_ERROR_RANGE_END:599},y4=[wn.OPENID_SCOPE,wn.PROFILE_SCOPE,wn.OFFLINE_ACCESS_SCOPE],F4e=[...y4,wn.EMAIL_SCOPE],Hf={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",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"},Ad={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"},eE={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},aV={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},Wd={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},B4e={PLAIN:"plain",S256:"S256"},v9={QUERY:"query",FRAGMENT:"fragment"},vGt={...v9},rXe={AUTHORIZATION_CODE_GRANT:"authorization_code",REFRESH_TOKEN_GRANT:"refresh_token"},lV={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",GENERIC_ACCOUNT_TYPE:"Generic"},tf={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},ks={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Axe="appmetadata",bGt="client_info",RF="1",Hq={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},Qg={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},lh={SCHEMA_VERSION:5,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"},vl={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},PF={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},$4e={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},H4e={username:"username",password:"password"},cV={httpSuccess:200,httpBadRequest:400},wD={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},Mae={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},Jx={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},yGt={Pop:"pop"},CGt=300;/*! @azure/msal-common v14.16.0 2024-11-05 */const Nxe="unexpected_error",wGt="post_request_failed";/*! @azure/msal-common v14.16.0 2024-11-05 */const V4e={[Nxe]:"Unexpected error in authentication.",[wGt]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class dc extends Error{constructor(e,t,i){const r=t?`${e}: ${t}`:e;super(r),Object.setPrototypeOf(this,dc.prototype),this.errorCode=e||wn.EMPTY_STRING,this.errorMessage=t||wn.EMPTY_STRING,this.subError=i||wn.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function sXe(n,e){return new dc(n,e?`${V4e[n]} ${e}`:V4e[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */const Dxe="client_info_decoding_error",oXe="client_info_empty_error",Rxe="token_parsing_error",aXe="null_or_empty_token",fC="endpoints_resolution_error",lXe="network_error",cXe="openid_config_error",uXe="hash_not_deserialized",jO="invalid_state",dXe="state_mismatch",Vq="state_not_found",hXe="nonce_mismatch",Pxe="auth_time_not_found",fXe="max_age_transpired",xGt="multiple_matching_tokens",SGt="multiple_matching_accounts",pXe="multiple_matching_appMetadata",gXe="request_cannot_be_made",mXe="cannot_remove_empty_scope",_Xe="cannot_append_scopeset",Zfe="empty_input_scopeset",EGt="device_code_polling_cancelled",kGt="device_code_expired",TGt="device_code_unknown_error",Oxe="no_account_in_silent_request",vXe="invalid_cache_record",Mxe="invalid_cache_environment",Jfe="no_account_found",epe="no_crypto_object",tpe="unexpected_credential_type",IGt="invalid_assertion",LGt="invalid_client_credential",FC="token_refresh_required",AGt="user_timeout_reached",bXe="token_claims_cnf_required_for_signedjwt",yXe="authorization_code_missing_from_server_response",CXe="binding_key_not_removed",wXe="end_session_endpoint_not_supported",jxe="key_id_missing",NGt="no_network_connectivity",DGt="user_canceled",RGt="missing_tenant_id_error",ho="method_not_implemented",PGt="nested_app_auth_bridge_disabled";/*! @azure/msal-common v14.16.0 2024-11-05 */const W4e={[Dxe]:"The client info could not be parsed/decoded correctly",[oXe]:"The client info was empty",[Rxe]:"Token cannot be parsed",[aXe]:"The token is null or empty",[fC]:"Endpoints cannot be resolved",[lXe]:"Network request failed",[cXe]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[uXe]:"The hash parameters could not be deserialized",[jO]:"State was not the expected format",[dXe]:"State mismatch error",[Vq]:"State not found",[hXe]:"Nonce mismatch error",[Pxe]:"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.",[fXe]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[xGt]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[SGt]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[pXe]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[gXe]:"Token request cannot be made without authorization code or refresh token.",[mXe]:"Cannot remove null or empty scope from ScopeSet",[_Xe]:"Cannot append ScopeSet",[Zfe]:"Empty input ScopeSet cannot be processed",[EGt]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[kGt]:"Device code is expired.",[TGt]:"Device code stopped polling for unknown reasons.",[Oxe]:"Please pass an account object, silent flow is not supported without account information",[vXe]:"Cache record object was null or undefined.",[Mxe]:"Invalid environment when attempting to create cache entry",[Jfe]:"No account found in cache for given key.",[epe]:"No crypto object detected.",[tpe]:"Unexpected credential type.",[IGt]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[LGt]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[FC]:"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.",[AGt]:"User defined timeout for device code polling reached",[bXe]:"Cannot generate a POP jwt if the token_claims are not populated",[yXe]:"Server response does not contain an authorization code to proceed",[CXe]:"Could not remove the credential's binding key from storage.",[wXe]:"The provided authority does not support logout",[jxe]:"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.",[NGt]:"No network connectivity. Check your internet connection.",[DGt]:"User cancelled the flow.",[RGt]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[ho]:"This method has not been implemented",[PGt]:"The nested app auth bridge is disabled"};class HJ extends dc{constructor(e,t){super(e,t?`${W4e[e]}: ${t}`:W4e[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,HJ.prototype)}}function ui(n,e){return new HJ(n,e)}/*! @azure/msal-common v14.16.0 2024-11-05 */const Wq={createNewGuid:()=>{throw ui(ho)},base64Decode:()=>{throw ui(ho)},base64Encode:()=>{throw ui(ho)},base64UrlEncode:()=>{throw ui(ho)},encodeKid:()=>{throw ui(ho)},async getPublicKeyThumbprint(){throw ui(ho)},async removeTokenBindingKey(){throw ui(ho)},async clearKeystore(){throw ui(ho)},async signJwt(){throw ui(ho)},async hashString(){throw ui(ho)}};/*! @azure/msal-common v14.16.0 2024-11-05 */var lc;(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"})(lc||(lc={}));class HE{constructor(e,t,i){this.level=lc.Info;const r=()=>{},s=e||HE.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||r,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:lc.Info,this.correlationId=s.correlationId||wn.EMPTY_STRING,this.packageName=t||wn.EMPTY_STRING,this.packageVersion=i||wn.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:lc.Info}}clone(e,t,i){return new HE({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 s=`${`[${new Date().toUTCString()}] : [${t.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${lc[t.logLevel]} - ${e}`;this.executeCallback(t.logLevel,s,t.containsPii||!1)}executeCallback(e,t,i){this.localCallback&&this.localCallback(e,t,i)}error(e,t){this.logMessage(e,{logLevel:lc.Error,containsPii:!1,correlationId:t||wn.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:lc.Error,containsPii:!0,correlationId:t||wn.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:lc.Warning,containsPii:!1,correlationId:t||wn.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:lc.Warning,containsPii:!0,correlationId:t||wn.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:lc.Info,containsPii:!1,correlationId:t||wn.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:lc.Info,containsPii:!0,correlationId:t||wn.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:lc.Verbose,containsPii:!1,correlationId:t||wn.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:lc.Verbose,containsPii:!0,correlationId:t||wn.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:lc.Trace,containsPii:!1,correlationId:t||wn.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:lc.Trace,containsPii:!0,correlationId:t||wn.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v14.16.0 2024-11-05 */const xXe="@azure/msal-common",Fxe="14.16.0";/*! @azure/msal-common v14.16.0 2024-11-05 */const Bxe={None:"none"};/*! @azure/msal-common v14.16.0 2024-11-05 */function kA(n,e){const t=OGt(n);try{const i=e(t);return JSON.parse(i)}catch{throw ui(Rxe)}}function OGt(n){if(!n)throw ui(aXe);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(n);if(!t||t.length<4)throw ui(Rxe);return t[2]}function SXe(n,e){if(e===0||Date.now()-3e5>n+e)throw ui(fXe)}/*! @azure/msal-common v14.16.0 2024-11-05 */function zy(){return Math.round(new Date().getTime()/1e3)}function npe(n,e){const t=Number(n)||0;return zy()+e>t}function MGt(n){return Number(n)>zy()}/*! @azure/msal-common v14.16.0 2024-11-05 */function _R(n){return[jGt(n),FGt(n),BGt(n),$Gt(n),HGt(n)].join(tf.CACHE_KEY_SEPARATOR).toLowerCase()}function VJ(n,e,t,i,r){return{credentialType:ks.ID_TOKEN,homeAccountId:n,environment:e,clientId:i,secret:t,realm:r}}function WJ(n,e,t,i,r,s,o,a,l,c,u,d,f,p,g){var _,v;const m={homeAccountId:n,credentialType:ks.ACCESS_TOKEN,secret:t,cachedAt:zy().toString(),expiresOn:o.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:i,realm:r,target:s,tokenType:u||vl.BEARER};if(d&&(m.userAssertionHash=d),c&&(m.refreshOn=c.toString()),p&&(m.requestedClaims=p,m.requestedClaimsHash=g),((_=m.tokenType)==null?void 0:_.toLowerCase())!==vl.BEARER.toLowerCase())switch(m.credentialType=ks.ACCESS_TOKEN_WITH_AUTH_SCHEME,m.tokenType){case vl.POP:const b=kA(t,l);if(!((v=b==null?void 0:b.cnf)!=null&&v.kid))throw ui(bXe);m.keyId=b.cnf.kid;break;case vl.SSH:m.keyId=f}return m}function EXe(n,e,t,i,r,s,o){const a={credentialType:ks.REFRESH_TOKEN,homeAccountId:n,environment:e,clientId:i,secret:t};return s&&(a.userAssertionHash=s),r&&(a.familyId=r),o&&(a.expiresOn=o.toString()),a}function $xe(n){return n.hasOwnProperty("homeAccountId")&&n.hasOwnProperty("environment")&&n.hasOwnProperty("credentialType")&&n.hasOwnProperty("clientId")&&n.hasOwnProperty("secret")}function z4e(n){return n?$xe(n)&&n.hasOwnProperty("realm")&&n.hasOwnProperty("target")&&(n.credentialType===ks.ACCESS_TOKEN||n.credentialType===ks.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function U4e(n){return n?$xe(n)&&n.hasOwnProperty("realm")&&n.credentialType===ks.ID_TOKEN:!1}function q4e(n){return n?$xe(n)&&n.credentialType===ks.REFRESH_TOKEN:!1}function jGt(n){return[n.homeAccountId,n.environment].join(tf.CACHE_KEY_SEPARATOR).toLowerCase()}function FGt(n){const e=n.credentialType===ks.REFRESH_TOKEN&&n.familyId||n.clientId;return[n.credentialType,e,n.realm||""].join(tf.CACHE_KEY_SEPARATOR).toLowerCase()}function BGt(n){return(n.target||"").toLowerCase()}function $Gt(n){return(n.requestedClaimsHash||"").toLowerCase()}function HGt(n){return n.tokenType&&n.tokenType.toLowerCase()!==vl.BEARER.toLowerCase()?n.tokenType.toLowerCase():""}function VGt(n,e){const t=n.indexOf(lh.CACHE_KEY)===0;let i=!0;return e&&(i=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),t&&i}function WGt(n,e){let t=!1;n&&(t=n.indexOf(PF.THROTTLING_PREFIX)===0);let i=!0;return e&&(i=e.hasOwnProperty("throttleTime")),t&&i}function zGt({environment:n,clientId:e}){return[Axe,n,e].join(tf.CACHE_KEY_SEPARATOR).toLowerCase()}function UGt(n,e){return e?n.indexOf(Axe)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function qGt(n,e){return e?n.indexOf(Hq.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function K4e(){return zy()+Hq.REFRESH_TIME_SECONDS}function uV(n,e,t){n.authorization_endpoint=e.authorization_endpoint,n.token_endpoint=e.token_endpoint,n.end_session_endpoint=e.end_session_endpoint,n.issuer=e.issuer,n.endpointsFromNetwork=t,n.jwks_uri=e.jwks_uri}function jae(n,e,t){n.aliases=e.aliases,n.preferred_cache=e.preferred_cache,n.preferred_network=e.preferred_network,n.aliasesFromNetwork=t}function G4e(n){return n.expiresAt<=zy()}/*! @azure/msal-common v14.16.0 2024-11-05 */const kXe="redirect_uri_empty",KGt="claims_request_parsing_error",TXe="authority_uri_insecure",Vj="url_parse_error",IXe="empty_url_error",LXe="empty_input_scopes_error",AXe="invalid_prompt_value",Hxe="invalid_claims",NXe="token_request_empty",DXe="logout_request_empty",RXe="invalid_code_challenge_method",Vxe="pkce_params_missing",Wxe="invalid_cloud_discovery_metadata",PXe="invalid_authority_metadata",OXe="untrusted_authority",zJ="missing_ssh_jwk",MXe="missing_ssh_kid",GGt="missing_nonce_authentication_header",YGt="invalid_authentication_header",jXe="cannot_set_OIDCOptions",FXe="cannot_allow_native_broker",BXe="authority_mismatch";/*! @azure/msal-common v14.16.0 2024-11-05 */const QGt={[kXe]:"A redirect URI is required for all calls, and none has been set.",[KGt]:"Could not parse the given claims request object.",[TXe]:"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",[Vj]:"URL could not be parsed into appropriate segments.",[IXe]:"URL was empty or null.",[LXe]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[AXe]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[Hxe]:"Given claims parameter must be a stringified JSON object.",[NXe]:"Token request was empty and not found in cache.",[DXe]:"The logout request was null or undefined.",[RXe]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[Vxe]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[Wxe]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[PXe]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[OXe]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[zJ]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[MXe]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[GGt]:"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.",[YGt]:"Invalid authentication header provided",[jXe]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[FXe]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[BXe]:"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 zxe extends dc{constructor(e){super(e,QGt[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,zxe.prototype)}}function Dl(n){return new zxe(n)}/*! @azure/msal-common v14.16.0 2024-11-05 */class Sb{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=s=>decodeURIComponent(s.replace(/\+/g," "));return i.forEach(s=>{if(s.trim()){const[o,a]=s.split(/=(.+)/g,2);o&&a&&(t[r(o)]=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.16.0 2024-11-05 */class uu{constructor(e){const t=e?Sb.trimArrayEntries([...e]):[],i=t?Sb.removeEmptyStringsFromArray(t):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(r=>this.scopes.add(r))}static fromString(e){const i=(e||wn.EMPTY_STRING).split(" ");return new uu(i)}static createSearchScopes(e){const t=new uu(e);return t.containsOnlyOIDCScopes()?t.removeScope(wn.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}validateInputScopes(e){if(!e||e.length<1)throw Dl(LXe)}containsScope(e){const t=this.printScopesLowerCase().split(" "),i=new uu(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 F4e.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 ui(_Xe)}}removeScope(e){if(!e)throw ui(mXe);this.scopes.delete(e.trim())}removeOIDCScopes(){F4e.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw ui(Zfe);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 ui(Zfe);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(" "):wn.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v14.16.0 2024-11-05 */function zq(n,e){if(!n)throw ui(oXe);try{const t=e(n);return JSON.parse(t)}catch{throw ui(Dxe)}}function vR(n){if(!n)throw ui(Dxe);const e=n.split(tf.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?wn.EMPTY_STRING:e[1]}}/*! @azure/msal-common v14.16.0 2024-11-05 */function Uq(n,e){return!!n&&!!e&&n===e.split(".")[1]}function Uxe(n,e,t,i){if(i){const{oid:r,sub:s,tid:o,name:a,tfp:l,acr:c}=i,u=o||l||c||"";return{tenantId:u,localAccountId:r||s||"",name:a,isHomeTenant:Uq(u,n)}}else return{tenantId:t,localAccountId:e,isHomeTenant:Uq(t,n)}}function qxe(n,e,t,i){let r=n;if(e){const{isHomeTenant:s,...o}=e;r={...n,...o}}if(t){const{isHomeTenant:s,...o}=Uxe(n.homeAccountId,n.localAccountId,n.tenantId,t);return r={...r,...o,idTokenClaims:t,idToken:i},r}return r}/*! @azure/msal-common v14.16.0 2024-11-05 */const eb={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v14.16.0 2024-11-05 */function $Xe(n){return n&&(n.tid||n.tfp||n.acr)||null}/*! @azure/msal-common v14.16.0 2024-11-05 */const aw={AAD:"AAD",OIDC:"OIDC"};/*! @azure/msal-common v14.16.0 2024-11-05 */class ld{generateAccountId(){return[this.homeAccountId,this.environment].join(tf.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return ld.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,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map(e=>[e.tenantId,e]))}}isSingleTenant(){return!this.tenantProfiles}static generateAccountCacheKey(e){const t=e.homeAccountId.split(".")[1];return[e.homeAccountId,e.environment||"",t||e.tenantId||""].join(tf.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t,i){var c,u,d,f,p,g;const r=new ld;t.authorityType===eb.Adfs?r.authorityType=lV.ADFS_ACCOUNT_TYPE:t.protocolMode===aw.AAD?r.authorityType=lV.MSSTS_ACCOUNT_TYPE:r.authorityType=lV.GENERIC_ACCOUNT_TYPE;let s;e.clientInfo&&i&&(s=zq(e.clientInfo,i)),r.clientInfo=e.clientInfo,r.homeAccountId=e.homeAccountId,r.nativeAccountId=e.nativeAccountId;const o=e.environment||t&&t.getPreferredCache();if(!o)throw ui(Mxe);r.environment=o,r.realm=(s==null?void 0:s.utid)||$Xe(e.idTokenClaims)||"",r.localAccountId=(s==null?void 0:s.uid)||((c=e.idTokenClaims)==null?void 0:c.oid)||((u=e.idTokenClaims)==null?void 0:u.sub)||"";const a=((d=e.idTokenClaims)==null?void 0:d.preferred_username)||((f=e.idTokenClaims)==null?void 0:f.upn),l=(p=e.idTokenClaims)!=null&&p.emails?e.idTokenClaims.emails[0]:null;if(r.username=a||l||"",r.name=((g=e.idTokenClaims)==null?void 0:g.name)||"",r.cloudGraphHostName=e.cloudGraphHostName,r.msGraphHost=e.msGraphHost,e.tenantProfiles)r.tenantProfiles=e.tenantProfiles;else{const m=Uxe(e.homeAccountId,r.localAccountId,r.realm,e.idTokenClaims);r.tenantProfiles=[m]}return r}static createFromAccountInfo(e,t,i){var s;const r=new ld;return r.authorityType=e.authorityType||lV.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.tenantProfiles=Array.from(((s=e.tenantProfiles)==null?void 0:s.values())||[]),r}static generateHomeAccountId(e,t,i,r,s){if(!(t===eb.Adfs||t===eb.Dsts)){if(e)try{const o=zq(e,r.base64Decode);if(o.uid&&o.utid)return`${o.uid}.${o.utid}`}catch{}i.warning("No client info in response")}return(s==null?void 0:s.sub)||""}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 s=e.idTokenClaims||{},o=t.idTokenClaims||{};r=s.iat===o.iat&&s.nonce===o.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.16.0 2024-11-05 */function HXe(n){return n.startsWith("#/")?n.substring(2):n.startsWith("#")||n.startsWith("?")?n.substring(1):n}function qq(n){if(!n||n.indexOf("=")<0)return null;try{const e=HXe(n),t=Object.fromEntries(new URLSearchParams(e));if(t.code||t.error||t.error_description||t.state)return t}catch{throw ui(uXe)}return null}/*! @azure/msal-common v14.16.0 2024-11-05 */class sa{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Dl(IXe);e.includes("#")||(this._urlString=sa.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return Sb.endsWith(t,"?")?t=t.slice(0,-1):Sb.endsWith(t,"?/")&&(t=t.slice(0,-2)),Sb.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Dl(Vj)}if(!e.HostNameAndPort||!e.PathSegments)throw Dl(Vj);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Dl(TXe)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return sa.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),i=t.PathSegments;return e&&i.length!==0&&(i[0]===eE.COMMON||i[0]===eE.ORGANIZATIONS)&&(i[0]=e),sa.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw Dl(Vj);const i={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let r=i.AbsolutePath.split("/");return r=r.filter(s=>s&&s.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 Dl(Vj);return i[2]}static getAbsoluteUrl(e,t){if(e[0]===wn.FORWARD_SLASH){const r=new sa(t).getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new sa(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!qq(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const VXe={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{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"]}]}},Y4e=VXe.endpointMetadata,Kxe=VXe.instanceDiscoveryMetadata,WXe=new Set;Kxe.metadata.forEach(n=>{n.aliases.forEach(e=>{WXe.add(e)})});function XGt(n,e){var r;let t;const i=n.canonicalAuthority;if(i){const s=new sa(i).getUrlComponents().HostNameAndPort;t=Q4e(s,(r=n.cloudDiscoveryMetadata)==null?void 0:r.metadata,Qg.CONFIG,e)||Q4e(s,Kxe.metadata,Qg.HARDCODED_VALUES,e)||n.knownAuthorities}return t||[]}function Q4e(n,e,t,i){if(i==null||i.trace(`getAliasesFromMetadata called with source: ${t}`),n&&e){const r=Kq(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 ZGt(n){return Kq(Kxe.metadata,n)}function Kq(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.16.0 2024-11-05 */const zXe="cache_quota_exceeded",Gxe="cache_error_unknown";/*! @azure/msal-common v14.16.0 2024-11-05 */const Fae={[zXe]:"Exceeded cache storage capacity.",[Gxe]:"Unexpected error occurred when using cache storage."};class CP extends Error{constructor(e,t){const i=t||(Fae[e]?Fae[e]:Fae[Gxe]);super(`${e}: ${i}`),Object.setPrototypeOf(this,CP.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=i}}/*! @azure/msal-common v14.16.0 2024-11-05 */class FO{constructor(e,t,i,r){this.clientId=e,this.cryptoImpl=t,this.commonLogger=i.clone(xXe,Fxe),this.staticAuthorityOptions=r}getAllAccounts(e){return this.buildTenantProfiles(this.getAccountsFilteredBy(e||{}),e)}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);return t.length>1?t.sort(r=>r.idTokenClaims?-1:1)[0]:t.length===1?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}buildTenantProfiles(e,t){return e.flatMap(i=>this.getTenantProfilesFromAccountEntity(i,t==null?void 0:t.tenantId,t))}getTenantedAccountInfoByFilter(e,t,i,r){let s=null,o;if(r&&!this.tenantProfileMatchesFilter(i,r))return null;const a=this.getIdToken(e,t,i.tenantId);return a&&(o=kA(a.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(o,r))?null:(s=qxe(e,i,o,a==null?void 0:a.secret),s)}getTenantProfilesFromAccountEntity(e,t,i){const r=e.getAccountInfo();let s=r.tenantProfiles||new Map;const o=this.getTokenKeys();if(t){const l=s.get(t);if(l)s=new Map([[t,l]]);else return[]}const a=[];return s.forEach(l=>{const c=this.getTenantedAccountInfoByFilter(r,o,l,i);c&&a.push(c)}),a}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId)||t.name&&e.name!==t.name||t.isHomeTenant!==void 0&&e.isHomeTenant!==t.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,t){return!(t&&(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId)||t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint)||t.username&&!this.matchUsername(e.preferred_username,t.username)||t.name&&!this.matchName(e,t.name)||t.sid&&!this.matchSid(e,t.sid)))}async saveCacheRecord(e,t,i){var r,s,o,a;if(!e)throw ui(vXe);try{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)}catch(l){throw(r=this.commonLogger)==null||r.error("CacheManager.saveCacheRecord: failed"),l instanceof Error?((s=this.commonLogger)==null||s.errorPii(`CacheManager.saveCacheRecord: ${l.message}`,i),l.name==="QuotaExceededError"||l.name==="NS_ERROR_DOM_QUOTA_REACHED"||l.message.includes("exceeded the quota")?((o=this.commonLogger)==null||o.error("CacheManager.saveCacheRecord: exceeded storage quota",i),new CP(zXe)):new CP(l.name,l.message)):((a=this.commonLogger)==null||a.errorPii(`CacheManager.saveCacheRecord: ${l}`,i),new CP(Gxe))}}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=uu.fromString(e.target),s=[];i.accessToken.forEach(o=>{if(!this.accessTokenKeyMatchesFilter(o,t,!1))return;const a=this.getAccessTokenCredential(o);a&&this.credentialMatchesFilter(a,t)&&uu.fromString(a.target).intersectingScopeSets(r)&&s.push(this.removeAccessToken(o))}),await Promise.all(s),this.setAccessTokenCredential(e)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),i=[];return t.forEach(r=>{var l;if(!this.isAccountKey(r,e.homeAccountId))return;const s=this.getAccount(r,this.commonLogger);if(!s||e.homeAccountId&&!this.matchHomeAccountId(s,e.homeAccountId)||e.username&&!this.matchUsername(s.username,e.username)||e.environment&&!this.matchEnvironment(s,e.environment)||e.realm&&!this.matchRealm(s,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(s,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(s,e.authorityType))return;const o={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name},a=(l=s.tenantProfiles)==null?void 0:l.filter(c=>this.tenantProfileMatchesFilter(c,o));a&&a.length===0||i.push(s)}),i}isAccountKey(e,t,i){return!(e.split(tf.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||i&&!e.toLowerCase().includes(i.toLowerCase()))}isCredentialKey(e){if(e.split(tf.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(t.indexOf(ks.ID_TOKEN.toLowerCase())===-1&&t.indexOf(ks.ACCESS_TOKEN.toLowerCase())===-1&&t.indexOf(ks.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())===-1&&t.indexOf(ks.REFRESH_TOKEN.toLowerCase())===-1)return!1;if(t.indexOf(ks.REFRESH_TOKEN.toLowerCase())>-1){const i=`${ks.REFRESH_TOKEN}${tf.CACHE_KEY_SEPARATOR}${this.clientId}${tf.CACHE_KEY_SEPARATOR}`,r=`${ks.REFRESH_TOKEN}${tf.CACHE_KEY_SEPARATOR}${RF}${tf.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===ks.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(t.tokenType&&!this.matchTokenType(e,t.tokenType)||t.tokenType===vl.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId)))}getAppMetadataFilteredBy(e){const t=this.getKeys(),i={};return t.forEach(r=>{if(!this.isAppMetadata(r))return;const s=this.getAppMetadata(r);s&&(e.environment&&!this.matchEnvironment(s,e.environment)||e.clientId&&!this.matchClientId(s,e.clientId)||(i[r]=s))}),i}getAuthorityMetadataByAlias(e){const t=this.getAuthorityMetadataKeys();let i=null;return t.forEach(r=>{if(!this.isAuthorityMetadata(r)||r.indexOf(this.clientId)===-1)return;const s=this.getAuthorityMetadata(r);s&&s.aliases.indexOf(e)!==-1&&(i=s)}),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,this.commonLogger);t&&(await this.removeAccountContext(t),this.removeItem(e))}async removeAccountContext(e){const t=this.getTokenKeys(),i=e.generateAccountId(),r=[];t.idToken.forEach(s=>{s.indexOf(i)===0&&this.removeIdToken(s)}),t.accessToken.forEach(s=>{s.indexOf(i)===0&&r.push(this.removeAccessToken(s))}),t.refreshToken.forEach(s=>{s.indexOf(i)===0&&this.removeRefreshToken(s)}),await Promise.all(r)}updateOutdatedCachedAccount(e,t,i){var r;if(t&&t.isSingleTenant()){(r=this.commonLogger)==null||r.verbose("updateOutdatedCachedAccount: Found a single-tenant (outdated) account entity in the cache, migrating to multi-tenant account entity");const s=this.getAccountKeys().filter(u=>u.startsWith(t.homeAccountId)),o=[];s.forEach(u=>{const d=this.getCachedAccountEntity(u);d&&o.push(d)});const a=o.find(u=>Uq(u.realm,u.homeAccountId))||o[0];a.tenantProfiles=o.map(u=>({tenantId:u.realm,localAccountId:u.localAccountId,name:u.name,isHomeTenant:Uq(u.realm,u.homeAccountId)}));const l=FO.toObject(new ld,{...a}),c=l.generateAccountKey();return s.forEach(u=>{u!==c&&this.removeOutdatedAccount(e)}),this.setAccount(l),i==null||i.verbose("Updated an outdated account entity in the cache"),l}return t}async removeAccessToken(e){const t=this.getAccessTokenCredential(e);if(t){if(t.credentialType.toLowerCase()===ks.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===vl.POP){const r=t.keyId;if(r)try{await this.cryptoImpl.removeTokenBindingKey(r)}catch{throw ui(CXe)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach(t=>{this.isAppMetadata(t)&&this.removeItem(t)}),!0}readAccountFromCache(e){const t=ld.generateAccountCacheKey(e);return this.getAccount(t,this.commonLogger)}getIdToken(e,t,i,r,s){this.commonLogger.trace("CacheManager - getIdToken called");const o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:ks.ID_TOKEN,clientId:this.clientId,realm:i},a=this.getIdTokensByFilter(o,t),l=a.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(l>1){let c=a;if(!i){const u=new Map;a.forEach((f,p)=>{f.realm===e.tenantId&&u.set(p,f)});const d=u.size;if(d<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),a.values().next().value;if(d===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),u.values().next().value;c=u}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),c.forEach((u,d)=>{this.removeIdToken(d)}),r&&s&&r.addFields({multiMatchedID:a.size},s),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),a.values().next().value}getIdTokensByFilter(e,t){const i=t&&t.idToken||this.getTokenKeys().idToken,r=new Map;return i.forEach(s=>{if(!this.idTokenKeyMatchesFilter(s,{clientId:this.clientId,...e}))return;const o=this.getIdTokenCredential(s);o&&this.credentialMatchesFilter(o,e)&&r.set(s,o)}),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,r,s,o){this.commonLogger.trace("CacheManager - getAccessToken called");const a=uu.createSearchScopes(t.scopes),l=t.authenticationScheme||vl.BEARER,c=l.toLowerCase()!==vl.BEARER.toLowerCase()?ks.ACCESS_TOKEN_WITH_AUTH_SCHEME:ks.ACCESS_TOKEN,u={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:c,clientId:this.clientId,realm:r||e.tenantId,target:a,tokenType:l,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},d=i&&i.accessToken||this.getTokenKeys().accessToken,f=[];d.forEach(g=>{if(this.accessTokenKeyMatchesFilter(g,u,!0)){const m=this.getAccessTokenCredential(g);m&&this.credentialMatchesFilter(m,u)&&f.push(m)}});const p=f.length;return p<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):p>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),f.forEach(g=>{this.removeAccessToken(_R(g))}),s&&o&&s.addFields({multiMatchedAT:f.length},o),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),f[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 s=t.target.asArray();for(let o=0;o<s.length;o++){if(i&&!r.includes(s[o].toLowerCase()))return!1;if(!i&&r.includes(s[o].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 s=this.getAccessTokenCredential(r);s&&this.credentialMatchesFilter(s,e)&&i.push(s)}),i}getRefreshToken(e,t,i,r,s){this.commonLogger.trace("CacheManager - getRefreshToken called");const o=t?RF:void 0,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:ks.REFRESH_TOKEN,clientId:this.clientId,familyId:o},l=i&&i.refreshToken||this.getTokenKeys().refreshToken,c=[];l.forEach(d=>{if(this.refreshTokenKeyMatchesFilter(d,a)){const f=this.getRefreshTokenCredential(d);f&&this.credentialMatchesFilter(f,a)&&c.push(f)}});const u=c.length;return u<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(u>1&&r&&s&&r.addFields({multiMatchedRT:u},s),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),c[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(o=>i[o]),s=r.length;if(s<1)return null;if(s>1)throw ui(pXe);return r[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!!(t&&t.familyId===RF)}matchHomeAccountId(e,t){return typeof e.homeAccountId=="string"&&t===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,t){const i=e.oid||e.sub;return t===i}matchLocalAccountIdFromTenantProfile(e,t){return e.localAccountId===t}matchName(e,t){var i;return t.toLowerCase()===((i=e.name)==null?void 0:i.toLowerCase())}matchUsername(e,t){return!!(e&&typeof e=="string"&&(t==null?void 0:t.toLowerCase())===e.toLowerCase())}matchUserAssertionHash(e,t){return!!(e.userAssertionHash&&t===e.userAssertionHash)}matchEnvironment(e,t){if(this.staticAuthorityOptions){const r=XGt(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){var i;return((i=e.realm)==null?void 0:i.toLowerCase())===t.toLowerCase()}matchNativeAccountId(e,t){return!!(e.nativeAccountId&&t===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,t){return e.login_hint===t||e.preferred_username===t||e.upn===t}matchSid(e,t){return e.sid===t}matchAuthorityType(e,t){return!!(e.authorityType&&t.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,t){return e.credentialType!==ks.ACCESS_TOKEN&&e.credentialType!==ks.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:uu.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(Axe)!==-1}isAuthorityMetadata(e){return e.indexOf(Hq.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${Hq.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,t){for(const i in t)e[i]=t[i];return e}}class JGt extends FO{setAccount(){throw ui(ho)}getAccount(){throw ui(ho)}getCachedAccountEntity(){throw ui(ho)}setIdTokenCredential(){throw ui(ho)}getIdTokenCredential(){throw ui(ho)}setAccessTokenCredential(){throw ui(ho)}getAccessTokenCredential(){throw ui(ho)}setRefreshTokenCredential(){throw ui(ho)}getRefreshTokenCredential(){throw ui(ho)}setAppMetadata(){throw ui(ho)}getAppMetadata(){throw ui(ho)}setServerTelemetry(){throw ui(ho)}getServerTelemetry(){throw ui(ho)}setAuthorityMetadata(){throw ui(ho)}getAuthorityMetadata(){throw ui(ho)}getAuthorityMetadataKeys(){throw ui(ho)}setThrottlingCache(){throw ui(ho)}getThrottlingCache(){throw ui(ho)}removeItem(){throw ui(ho)}getKeys(){throw ui(ho)}getAccountKeys(){throw ui(ho)}getTokenKeys(){throw ui(ho)}updateCredentialCacheKey(){throw ui(ho)}removeOutdatedAccount(){throw ui(ho)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const UXe={tokenRenewalOffsetSeconds:CGt,preventCorsPreflight:!1},eYt={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:lc.Info,correlationId:wn.EMPTY_STRING},tYt={claimsBasedCachingEnabled:!1},nYt={async sendGetRequestAsync(){throw ui(ho)},async sendPostRequestAsync(){throw ui(ho)}},iYt={sku:wn.SKU,version:Fxe,cpu:wn.EMPTY_STRING,os:wn.EMPTY_STRING},rYt={clientSecret:wn.EMPTY_STRING,clientAssertion:void 0},sYt={azureCloudInstance:Bxe.None,tenant:`${wn.DEFAULT_COMMON_TENANT}`},oYt={application:{appName:"",appVersion:""}};function aYt({authOptions:n,systemOptions:e,loggerOptions:t,cacheOptions:i,storageInterface:r,networkInterface:s,cryptoInterface:o,clientCredentials:a,libraryInfo:l,telemetry:c,serverTelemetryManager:u,persistencePlugin:d,serializableCache:f}){const p={...eYt,...t};return{authOptions:lYt(n),systemOptions:{...UXe,...e},loggerOptions:p,cacheOptions:{...tYt,...i},storageInterface:r||new JGt(n.clientId,Wq,new HE(p)),networkInterface:s||nYt,cryptoInterface:o||Wq,clientCredentials:a||rYt,libraryInfo:{...iYt,...l},telemetry:{...oYt,...c},serverTelemetryManager:u||null,persistencePlugin:d||null,serializableCache:f||null}}function lYt(n){return{clientCapabilities:[],azureCloudOptions:sYt,skipAuthorityMetadataCache:!1,instanceAware:!1,...n}}function ipe(n){return n.authOptions.authority.options.protocolMode===aw.OIDC}/*! @azure/msal-common v14.16.0 2024-11-05 */const fm={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v14.16.0 2024-11-05 */const EL="client_id",qXe="redirect_uri",X4e="response_type",cYt="response_mode",uYt="grant_type",dYt="claims",hYt="scope",fYt="refresh_token",pYt="state",gYt="nonce",mYt="prompt",_Yt="code",vYt="code_challenge",bYt="code_challenge_method",yYt="code_verifier",CYt="client-request-id",wYt="x-client-SKU",xYt="x-client-VER",SYt="x-client-OS",EYt="x-client-CPU",kYt="x-client-current-telemetry",TYt="x-client-last-telemetry",IYt="x-ms-lib-capability",LYt="x-app-name",AYt="x-app-ver",NYt="post_logout_redirect_uri",DYt="id_token_hint",RYt="device_code",PYt="client_secret",OYt="client_assertion",MYt="client_assertion_type",Z4e="token_type",J4e="req_cnf",jYt="assertion",FYt="requested_token_use",e3e="return_spa_code",BYt="nativebroker",$Yt="logout_hint",HYt="sid",VYt="login_hint",WYt="domain_hint",zYt="x-client-xtra-sku",Yxe="brk_client_id",rpe="brk_redirect_uri";/*! @azure/msal-common v14.16.0 2024-11-05 */class eR{static validateRedirectUri(e){if(!e)throw Dl(kXe)}static validatePrompt(e){const t=[];for(const i in Wd)t.push(Wd[i]);if(t.indexOf(e)<0)throw Dl(AXe)}static validateClaims(e){try{JSON.parse(e)}catch{throw Dl(Hxe)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw Dl(Vxe);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([B4e.PLAIN,B4e.S256].indexOf(e)<0)throw Dl(RXe)}}/*! @azure/msal-common v14.16.0 2024-11-05 */function UYt(n,e,t){if(!e)return;const i=n.get(EL);i&&n.has(Yxe)&&(t==null||t.addFields({embeddedClientId:i,embeddedRedirectUri:n.get(qXe)},e))}class OF{constructor(e,t){this.parameters=new Map,this.performanceClient=t,this.correlationId=e}addResponseTypeCode(){this.parameters.set(X4e,encodeURIComponent(wn.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set(X4e,encodeURIComponent(`${wn.TOKEN_RESPONSE_TYPE} ${wn.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set(cYt,encodeURIComponent(e||vGt.QUERY))}addNativeBroker(){this.parameters.set(BYt,encodeURIComponent("1"))}addScopes(e,t=!0,i=y4){t&&!i.includes("openid")&&!e.includes("openid")&&i.push("openid");const r=t?[...e||[],...i]:e||[],s=new uu(r);this.parameters.set(hYt,encodeURIComponent(s.printScopes()))}addClientId(e){this.parameters.set(EL,encodeURIComponent(e))}addRedirectUri(e){eR.validateRedirectUri(e),this.parameters.set(qXe,encodeURIComponent(e))}addPostLogoutRedirectUri(e){eR.validateRedirectUri(e),this.parameters.set(NYt,encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set(DYt,encodeURIComponent(e))}addDomainHint(e){this.parameters.set(WYt,encodeURIComponent(e))}addLoginHint(e){this.parameters.set(VYt,encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(Hf.CCS_HEADER,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(Hf.CCS_HEADER,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set(HYt,encodeURIComponent(e))}addClaims(e,t){const i=this.addClientCapabilitiesToClaims(e,t);eR.validateClaims(i),this.parameters.set(dYt,encodeURIComponent(i))}addCorrelationId(e){this.parameters.set(CYt,encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set(wYt,e.sku),this.parameters.set(xYt,e.version),e.os&&this.parameters.set(SYt,e.os),e.cpu&&this.parameters.set(EYt,e.cpu)}addApplicationTelemetry(e){e!=null&&e.appName&&this.parameters.set(LYt,e.appName),e!=null&&e.appVersion&&this.parameters.set(AYt,e.appVersion)}addPrompt(e){eR.validatePrompt(e),this.parameters.set(`${mYt}`,encodeURIComponent(e))}addState(e){e&&this.parameters.set(pYt,encodeURIComponent(e))}addNonce(e){this.parameters.set(gYt,encodeURIComponent(e))}addCodeChallengeParams(e,t){if(eR.validateCodeChallengeParams(e,t),e&&t)this.parameters.set(vYt,encodeURIComponent(e)),this.parameters.set(bYt,encodeURIComponent(t));else throw Dl(Vxe)}addAuthorizationCode(e){this.parameters.set(_Yt,encodeURIComponent(e))}addDeviceCode(e){this.parameters.set(RYt,encodeURIComponent(e))}addRefreshToken(e){this.parameters.set(fYt,encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set(yYt,encodeURIComponent(e))}addClientSecret(e){this.parameters.set(PYt,encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set(OYt,encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set(MYt,encodeURIComponent(e))}addOboAssertion(e){this.parameters.set(jYt,encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set(FYt,encodeURIComponent(e))}addGrantType(e){this.parameters.set(uYt,encodeURIComponent(e))}addClientInfo(){this.parameters.set(bGt,"1")}addExtraQueryParameters(e){Object.entries(e).forEach(([t,i])=>{!this.parameters.has(t)&&i&&this.parameters.set(t,i)})}addClientCapabilitiesToClaims(e,t){let i;if(!e)i={};else try{i=JSON.parse(e)}catch{throw Dl(Hxe)}return t&&t.length>0&&(i.hasOwnProperty(aV.ACCESS_TOKEN)||(i[aV.ACCESS_TOKEN]={}),i[aV.ACCESS_TOKEN][aV.XMS_CC]={values:t}),JSON.stringify(i)}addUsername(e){this.parameters.set(H4e.username,encodeURIComponent(e))}addPassword(e){this.parameters.set(H4e.password,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(Z4e,vl.POP),this.parameters.set(J4e,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(Z4e,vl.SSH),this.parameters.set(J4e,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set(kYt,e.generateCurrentRequestHeaderValue()),this.parameters.set(TYt,e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set(IYt,PF.X_MS_LIB_CAPABILITY_VALUE)}addLogoutHint(e){this.parameters.set($Yt,encodeURIComponent(e))}addBrokerParameters(e){const t={};t[Yxe]=e.brokerClientId,t[rpe]=e.brokerRedirectUri,this.addExtraQueryParameters(t)}createQueryString(){const e=new Array;return this.parameters.forEach((t,i)=>{e.push(`${i}=${t}`)}),UYt(this.parameters,this.correlationId,this.performanceClient),e.join("&")}}/*! @azure/msal-common v14.16.0 2024-11-05 */function qYt(n){return n.hasOwnProperty("authorization_endpoint")&&n.hasOwnProperty("token_endpoint")&&n.hasOwnProperty("issuer")&&n.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v14.16.0 2024-11-05 */function KYt(n){return n.hasOwnProperty("tenant_discovery_endpoint")&&n.hasOwnProperty("metadata")}/*! @azure/msal-common v14.16.0 2024-11-05 */function GYt(n){return n.hasOwnProperty("error")&&n.hasOwnProperty("error_description")}/*! @azure/msal-common v14.16.0 2024-11-05 */const Gt={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",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",HandleCodeResponse:"handleCodeResponse",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",AuthClientCreateQueryString:"authClientCreateQueryString",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",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:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues"},YYt={InProgress:1};/*! @azure/msal-common v14.16.0 2024-11-05 */const TA=(n,e,t,i,r)=>(...s)=>{t.trace(`Executing function ${e}`);const o=i==null?void 0:i.startMeasurement(e,r);if(r){const a=e+"CallCount";i==null||i.incrementFields({[a]:1},r)}try{const a=n(...s);return o==null||o.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 o==null||o.end({success:!1},a),a}},Pi=(n,e,t,i,r)=>(...s)=>{t.trace(`Executing function ${e}`);const o=i==null?void 0:i.startMeasurement(e,r);if(r){const a=e+"CallCount";i==null||i.incrementFields({[a]:1},r)}return i==null||i.setPreQueueTime(e,r),n(...s).then(a=>(t.trace(`Returning result from ${e}`),o==null||o.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 o==null||o.end({success:!1},a),a})};/*! @azure/msal-common v14.16.0 2024-11-05 */class UJ{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(Gt.RegionDiscoveryDetectRegion,this.correlationId);let i=e;if(i)t.region_source=wD.ENVIRONMENT_VARIABLE;else{const s=UJ.IMDS_OPTIONS;try{const o=await Pi(this.getRegionFromIMDS.bind(this),Gt.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(wn.IMDS_VERSION,s);if(o.status===cV.httpSuccess&&(i=o.body,t.region_source=wD.IMDS),o.status===cV.httpBadRequest){const a=await Pi(this.getCurrentVersion.bind(this),Gt.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(s);if(!a)return t.region_source=wD.FAILED_AUTO_DETECTION,null;const l=await Pi(this.getRegionFromIMDS.bind(this),Gt.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(a,s);l.status===cV.httpSuccess&&(i=l.body,t.region_source=wD.IMDS)}}catch{return t.region_source=wD.FAILED_AUTO_DETECTION,null}}return i||(t.region_source=wD.FAILED_AUTO_DETECTION),i||null}async getRegionFromIMDS(e,t){var i;return(i=this.performanceClient)==null||i.addQueueMeasurement(Gt.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${wn.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,wn.IMDS_TIMEOUT)}async getCurrentVersion(e){var t;(t=this.performanceClient)==null||t.addQueueMeasurement(Gt.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const i=await this.networkInterface.sendGetRequestAsync(`${wn.IMDS_ENDPOINT}?format=json`,e);return i.status===cV.httpBadRequest&&i.body&&i.body["newest-versions"]&&i.body["newest-versions"].length>0?i.body["newest-versions"][0]:null}catch{return null}}}UJ.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v14.16.0 2024-11-05 */class Jh{constructor(e,t,i,r,s,o,a,l){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=s,this.performanceClient=a,this.correlationId=o,this.managedIdentity=l||!1,this.regionDiscovery=new UJ(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(wn.CIAM_AUTH_URL))return eb.Ciam;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case wn.ADFS:return eb.Adfs;case wn.DSTS:return eb.Dsts}return eb.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 sa(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 ui(fC)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw ui(fC)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw ui(fC)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw ui(wXe);return this.replacePath(this.metadata.end_session_endpoint)}else throw ui(fC)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw ui(fC)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw ui(fC)}canReplaceTenant(e){return e.PathSegments.length===1&&!Jh.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===eb.Default&&this.protocolMode===aw.AAD}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const r=new sa(this.metadata.canonical_authority).getUrlComponents(),s=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((a,l)=>{let c=s[l];if(l===0&&this.canReplaceTenant(r)){const u=new sa(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===eb.Adfs||this.protocolMode!==aw.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,s;(r=this.performanceClient)==null||r.addQueueMeasurement(Gt.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await Pi(this.updateCloudDiscoveryMetadata.bind(this),Gt.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const i=await Pi(this.updateEndpointMetadata.bind(this),Gt.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:i}),(s=this.performanceClient)==null||s.addFields({cloudDiscoverySource:t,authorityEndpointSource:i},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:K4e(),jwks_uri:""}),e}updateCachedMetadata(e,t,i){t!==Qg.CACHE&&(i==null?void 0:i.source)!==Qg.CACHE&&(e.expiresAt=K4e(),e.canonical_authority=this.canonicalAuthority);const r=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(r,e),this.metadata=e}async updateEndpointMetadata(e){var r,s,o;(r=this.performanceClient)==null||r.addQueueMeasurement(Gt.AuthorityUpdateEndpointMetadata,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===Qg.HARDCODED_VALUES&&(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&t.metadata){const a=await Pi(this.updateMetadataWithRegionalInformation.bind(this),Gt.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(t.metadata);uV(e,a,!1),e.canonical_authority=this.canonicalAuthority}return t.source}let i=await Pi(this.getEndpointMetadataFromNetwork.bind(this),Gt.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return(o=this.authorityOptions.azureRegionConfiguration)!=null&&o.azureRegion&&(i=await Pi(this.updateMetadataWithRegionalInformation.bind(this),Gt.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(i)),uV(e,i,!0),Qg.NETWORK;throw ui(cXe,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"),uV(e,t,!1),{source:Qg.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 uV(e,r,!1),{source:Qg.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=G4e(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("Found endpoint metadata in the cache."),{source:Qg.CACHE}):(i&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new sa(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Dl(PXe)}return null}async getEndpointMetadataFromNetwork(){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(Gt.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 qYt(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.hostnameAndPort in Y4e?Y4e[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var i,r,s;(i=this.performanceClient)==null||i.addQueueMeasurement(Gt.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const t=(r=this.authorityOptions.azureRegionConfiguration)==null?void 0:r.azureRegion;if(t){if(t!==wn.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=Mae.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=t,Jh.replaceWithRegionalInformation(e,t);const o=await Pi(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),Gt.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((s=this.authorityOptions.azureRegionConfiguration)==null?void 0:s.environmentRegion,this.regionDiscoveryMetadata);if(o)return this.regionDiscoveryMetadata.region_outcome=Mae.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=o,Jh.replaceWithRegionalInformation(e,o);this.regionDiscoveryMetadata.region_outcome=Mae.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Gt.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const i=await Pi(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Gt.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return jae(e,i,!0),Qg.NETWORK;throw Dl(OXe)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||wn.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||wn.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||wn.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),jae(e,t,!1),Qg.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=ZGt(this.hostnameAndPort);if(r)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),jae(e,r,!1),Qg.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=G4e(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!i?(this.logger.verbose("Found cloud discovery metadata in the cache."),Qg.CACHE):(i&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===eb.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),Jh.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=Kq(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."),Dl(Wxe)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),Jh.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Gt.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${wn.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let i=null;try{const s=await this.networkInterface.sendGetRequestAsync(e,t);let o,a;if(KYt(s.body))o=s.body,a=o.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${o.tenant_discovery_endpoint}`);else if(GYt(s.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${s.status}`),o=s.body,o.error===wn.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${o.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${o.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=Kq(a,this.hostnameAndPort)}catch(s){if(s instanceof dc)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. Error: ${s.errorCode} Error Description: ${s.errorMessage}`);else{const o=s;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. Error: ${o.name} Error Description: ${o.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=Jh.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),i}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>t&&sa.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let i;if(t&&t.azureCloudInstance!==Bxe.None){const r=t.tenant?t.tenant:wn.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.managedIdentity)return wn.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw ui(fC)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return WXe.has(e)}static isPublicCloudAuthority(e){return wn.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,i){const r=new sa(e);r.validateAsUri();const s=r.getUrlComponents();let o=`${t}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(o=`${t}.${wn.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=sa.constructAuthorityUriFromObject({...r.getUrlComponents(),HostNameAndPort:o}).urlString;return i?`${a}?${i}`:a}static replaceWithRegionalInformation(e,t){const i={...e};return i.authorization_endpoint=Jh.buildRegionalAuthorityString(i.authorization_endpoint,t),i.token_endpoint=Jh.buildRegionalAuthorityString(i.token_endpoint,t),i.end_session_endpoint&&(i.end_session_endpoint=Jh.buildRegionalAuthorityString(i.end_session_endpoint,t)),i}static transformCIAMAuthority(e){let t=e;const r=new sa(e).getUrlComponents();if(r.PathSegments.length===0&&r.HostNameAndPort.endsWith(wn.CIAM_AUTH_URL)){const s=r.HostNameAndPort.split(".")[0];t=`${t}${s}${wn.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}Jh.reservedTenantDomains=new Set(["{tenant}","{tenantid}",eE.COMMON,eE.CONSUMERS,eE.ORGANIZATIONS]);function QYt(n){var r;const i=(r=new sa(n).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:r.toLowerCase();switch(i){case eE.COMMON:case eE.ORGANIZATIONS:case eE.CONSUMERS:return;default:return i}}function KXe(n){return n.endsWith(wn.FORWARD_SLASH)?n:`${n}${wn.FORWARD_SLASH}`}function XYt(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw Dl(Wxe)}return{canonicalAuthority:n.authority?KXe(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v14.16.0 2024-11-05 */async function GXe(n,e,t,i,r,s,o){o==null||o.addQueueMeasurement(Gt.AuthorityFactoryCreateDiscoveredInstance,s);const a=Jh.transformCIAMAuthority(KXe(n)),l=new Jh(a,e,t,i,r,s,o);try{return await Pi(l.resolveEndpointsAsync.bind(l),Gt.AuthorityResolveEndpointsAsync,r,o,s)(),l}catch{throw ui(fC)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class VE extends dc{constructor(e,t,i,r,s){super(e,t,i),this.name="ServerError",this.errorNo=r,this.status=s,Object.setPrototypeOf(this,VE.prototype)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class hy{static generateThrottlingStorageKey(e){return`${PF.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var s;const i=hy.generateThrottlingStorageKey(t),r=e.getThrottlingCache(i);if(r){if(r.throttleTime<Date.now()){e.removeItem(i);return}throw new VE(((s=r.errorCodes)==null?void 0:s.join(" "))||wn.EMPTY_STRING,r.errorMessage,r.subError)}}static postProcess(e,t,i){if(hy.checkResponseStatus(i)||hy.checkResponseForRetryAfter(i)){const r={throttleTime:hy.calculateThrottleTime(parseInt(i.headers[Hf.RETRY_AFTER])),error:i.body.error,errorCodes:i.body.error_codes,errorMessage:i.body.error_description,subError:i.body.suberror};e.setThrottlingCache(hy.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(Hf.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||PF.DEFAULT_THROTTLE_TIME_SECONDS),i+PF.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,i,r){const s={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},o=this.generateThrottlingStorageKey(s);e.removeItem(o)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class qJ extends dc{constructor(e,t,i){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,qJ.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=i}}function t3e(n,e,t){return new qJ(n,e,t)}/*! @azure/msal-common v14.16.0 2024-11-05 */let Qxe=class{constructor(e,t){this.config=aYt(e),this.logger=new HE(this.config.loggerOptions,xXe,Fxe),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[Hf.CONTENT_TYPE]=wn.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case fm.HOME_ACCOUNT_ID:try{const i=vR(e.credential);t[Hf.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case fm.UPN:t[Hf.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,i,r,s,o){var l;o&&((l=this.performanceClient)==null||l.addQueueMeasurement(o,s));const a=await this.sendPostRequest(r,e,{body:t,headers:i},s);return this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async sendPostRequest(e,t,i,r){var o,a,l;hy.preProcess(this.cacheManager,e);let s;try{s=await Pi(this.networkClient.sendPostRequestAsync.bind(this.networkClient),Gt.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,r)(t,i);const c=s.headers||{};(a=this.performanceClient)==null||a.addFields({refreshTokenSize:((o=s.body.refresh_token)==null?void 0:o.length)||0,httpVerToken:c[Hf.X_MS_HTTP_VERSION]||"",requestId:c[Hf.X_MS_REQUEST_ID]||""},r)}catch(c){if(c instanceof qJ){const u=c.responseHeaders;throw u&&((l=this.performanceClient)==null||l.addFields({httpVerToken:u[Hf.X_MS_HTTP_VERSION]||"",requestId:u[Hf.X_MS_REQUEST_ID]||"",contentTypeHeader:u[Hf.CONTENT_TYPE]||void 0,contentLengthHeader:u[Hf.CONTENT_LENGTH]||void 0,httpStatus:c.httpStatus},r)),c.error}throw c instanceof dc?c:ui(lXe)}return hy.postProcess(this.cacheManager,e,s),s}async updateAuthority(e,t){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(Gt.UpdateTokenEndpointAuthority,t);const i=`https://${e}/${this.authority.tenant}/`,r=await GXe(i,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=r}createTokenQueryParameters(e){const t=new OF(e.correlationId,this.performanceClient);return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.addCorrelationId(e.correlationId),t.createQueryString()}};/*! @azure/msal-common v14.16.0 2024-11-05 */const Gq="no_tokens_found",YXe="native_account_unavailable",Xxe="refresh_token_expired",ZYt="interaction_required",JYt="consent_required",eQt="login_required",KJ="bad_token";/*! @azure/msal-common v14.16.0 2024-11-05 */const n3e=[ZYt,JYt,eQt,KJ],tQt=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],nQt={[Gq]:"No refresh token found in the cache. Please sign-in.",[YXe]:"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.",[Xxe]:"Refresh token has expired.",[KJ]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class Ob extends dc{constructor(e,t,i,r,s,o,a,l){super(e,t,i),Object.setPrototypeOf(this,Ob.prototype),this.timestamp=r||wn.EMPTY_STRING,this.traceId=s||wn.EMPTY_STRING,this.correlationId=o||wn.EMPTY_STRING,this.claims=a||wn.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=l}}function i3e(n,e,t){const i=!!n&&n3e.indexOf(n)>-1,r=!!t&&tQt.indexOf(t)>-1,s=!!e&&n3e.some(o=>e.indexOf(o)>-1);return i||s||r}function spe(n){return new Ob(n,nQt[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class Eb{static setRequestState(e,t,i){const r=Eb.generateLibraryState(e,i);return t?`${r}${wn.RESOURCE_DELIM}${t}`:r}static generateLibraryState(e,t){if(!e)throw ui(epe);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 ui(epe);if(!t)throw ui(jO);try{const i=t.split(wn.RESOURCE_DELIM),r=i[0],s=i.length>1?i.slice(1).join(wn.RESOURCE_DELIM):wn.EMPTY_STRING,o=e.base64Decode(r),a=JSON.parse(o);return{userRequestState:s||wn.EMPTY_STRING,libraryState:a}}catch{throw ui(jO)}}}/*! @azure/msal-common v14.16.0 2024-11-05 */const iQt={SW:"sw"};class BO{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(Gt.PopTokenGenerateCnf,e.correlationId);const i=await Pi(this.generateKid.bind(this),Gt.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),r=this.cryptoUtils.base64UrlEncode(JSON.stringify(i));return{kid:i.kid,reqCnfString:r}}async generateKid(e){var i;return(i=this.performanceClient)==null||i.addQueueMeasurement(Gt.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:iQt.SW}}async signPopToken(e,t,i){return this.signPayload(e,t,i)}async signPayload(e,t,i,r){const{resourceRequestMethod:s,resourceRequestUri:o,shrClaims:a,shrNonce:l,shrOptions:c}=i,u=o?new sa(o):void 0,d=u==null?void 0:u.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:zy(),m:s==null?void 0:s.toUpperCase(),u:d==null?void 0:d.HostNameAndPort,nonce:l||this.cryptoUtils.createNewGuid(),p:d==null?void 0:d.AbsolutePath,q:d!=null&&d.QueryString?[[],d.QueryString]:void 0,client_claims:a||void 0,...r},t,c,i.correlationId)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class rQt{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v14.16.0 2024-11-05 */function sQt(n){var i,r;const e="code=",t=(i=n.error_uri)==null?void 0:i.lastIndexOf(e);return t&&t>=0?(r=n.error_uri)==null?void 0:r.substring(t+e.length):void 0}class kL{constructor(e,t,i,r,s,o,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=i,this.logger=r,this.serializableCache=s,this.persistencePlugin=o,this.performanceClient=a}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?ui(Vq,"Cached State"):ui(Vq,"Server State");let i,r;try{i=decodeURIComponent(e.state)}catch{throw ui(jO,e.state)}try{r=decodeURIComponent(t)}catch{throw ui(jO,e.state)}if(i!==r)throw ui(dXe);if(e.error||e.error_description||e.suberror){const s=sQt(e);throw i3e(e.error,e.error_description,e.suberror)?new Ob(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",s):new VE(e.error||"",e.error_description,e.suberror,s)}}validateTokenResponse(e,t){var i;if(e.error||e.error_description||e.suberror){const r=`Error(s): ${e.error_codes||wn.NOT_AVAILABLE} - Timestamp: ${e.timestamp||wn.NOT_AVAILABLE} - Description: ${e.error_description||wn.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||wn.NOT_AVAILABLE} - Trace ID: ${e.trace_id||wn.NOT_AVAILABLE}`,s=(i=e.error_codes)!=null&&i.length?e.error_codes[0]:void 0,o=new VE(e.error,r,e.suberror,s,e.status);if(t&&e.status&&e.status>=oV.SERVER_ERROR_RANGE_START&&e.status<=oV.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. ${o}`);return}else if(t&&e.status&&e.status>=oV.CLIENT_ERROR_RANGE_START&&e.status<=oV.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. ${o}`);return}throw i3e(e.error,e.error_description,e.suberror)?new Ob(e.error,e.error_description,e.suberror,e.timestamp||wn.EMPTY_STRING,e.trace_id||wn.EMPTY_STRING,e.correlation_id||wn.EMPTY_STRING,e.claims||wn.EMPTY_STRING,s):o}}async handleServerTokenResponse(e,t,i,r,s,o,a,l,c){var g;(g=this.performanceClient)==null||g.addQueueMeasurement(Gt.HandleServerTokenResponse,e.correlation_id);let u;if(e.id_token){if(u=kA(e.id_token||wn.EMPTY_STRING,this.cryptoObj.base64Decode),s&&s.nonce&&u.nonce!==s.nonce)throw ui(hXe);if(r.maxAge||r.maxAge===0){const m=u.auth_time;if(!m)throw ui(Pxe);SXe(m,r.maxAge)}}this.homeAccountIdentifier=ld.generateHomeAccountId(e.client_info||wn.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,u);let d;s&&s.state&&(d=Eb.parseRequestState(this.cryptoObj,s.state)),e.key_id=e.key_id||r.sshKid||void 0;const f=this.generateCacheRecord(e,t,i,r,u,o,s);let p;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),p=new rQt(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(p)),a&&!l&&f.account){const m=f.account.generateAccountKey();if(!this.cacheStorage.getAccount(m,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await kL.generateAuthenticationResult(this.cryptoObj,t,f,!1,r,u,d,void 0,c)}await this.cacheStorage.saveCacheRecord(f,r.storeInCache,r.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&p&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(p))}return kL.generateAuthenticationResult(this.cryptoObj,t,f,!1,r,u,d,e,c)}generateCacheRecord(e,t,i,r,s,o,a){const l=t.getPreferredCache();if(!l)throw ui(Mxe);const c=$Xe(s);let u,d;e.id_token&&s&&(u=VJ(this.homeAccountIdentifier,l,e.id_token,this.clientId,c||""),d=Zxe(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,s,e.client_info,l,c,a,void 0,this.logger));let f=null;if(e.access_token){const m=e.scope?uu.fromString(e.scope):new uu(r.scopes||[]),_=(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,b=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,y=i+_,C=y+v,S=b&&b>0?i+b:void 0;f=WJ(this.homeAccountIdentifier,l,e.access_token,this.clientId,c||t.tenant||"",m.printScopes(),y,C,this.cryptoObj.base64Decode,S,e.token_type,o,e.key_id,r.claims,r.requestedClaimsHash)}let p=null;if(e.refresh_token){let m;if(e.refresh_token_expires_in){const _=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;m=i+_}p=EXe(this.homeAccountIdentifier,l,e.refresh_token,this.clientId,e.foci,o,m)}let g=null;return e.foci&&(g={clientId:this.clientId,environment:l,familyId:e.foci}),{account:d,idToken:u,accessToken:f,refreshToken:p,appMetadata:g}}static async generateAuthenticationResult(e,t,i,r,s,o,a,l,c){var y,C,S,k,I;let u=wn.EMPTY_STRING,d=[],f=null,p,g,m=wn.EMPTY_STRING;if(i.accessToken){if(i.accessToken.tokenType===vl.POP&&!s.popKid){const L=new BO(e),{secret:N,keyId:P}=i.accessToken;if(!P)throw ui(jxe);u=await L.signPopToken(N,P,s)}else u=i.accessToken.secret;d=uu.fromString(i.accessToken.target).asArray(),f=new Date(Number(i.accessToken.expiresOn)*1e3),p=new Date(Number(i.accessToken.extendedExpiresOn)*1e3),i.accessToken.refreshOn&&(g=new Date(Number(i.accessToken.refreshOn)*1e3))}i.appMetadata&&(m=i.appMetadata.familyId===RF?RF:"");const _=(o==null?void 0:o.oid)||(o==null?void 0:o.sub)||"",v=(o==null?void 0:o.tid)||"";l!=null&&l.spa_accountid&&i.account&&(i.account.nativeAccountId=l==null?void 0:l.spa_accountid);const b=i.account?qxe(i.account.getAccountInfo(),void 0,o,(y=i.idToken)==null?void 0:y.secret):null;return{authority:t.canonicalAuthority,uniqueId:_,tenantId:v,scopes:d,account:b,idToken:((C=i==null?void 0:i.idToken)==null?void 0:C.secret)||"",idTokenClaims:o||{},accessToken:u,fromCache:r,expiresOn:f,extExpiresOn:p,refreshOn:g,correlationId:s.correlationId,requestId:c||wn.EMPTY_STRING,familyId:m,tokenType:((S=i.accessToken)==null?void 0:S.tokenType)||wn.EMPTY_STRING,state:a?a.userRequestState:wn.EMPTY_STRING,cloudGraphHostName:((k=i.account)==null?void 0:k.cloudGraphHostName)||wn.EMPTY_STRING,msGraphHost:((I=i.account)==null?void 0:I.msGraphHost)||wn.EMPTY_STRING,code:l==null?void 0:l.spa_code,fromNativeBroker:!1}}}function Zxe(n,e,t,i,r,s,o,a,l,c,u){u==null||u.verbose("setCachedAccount called");const f=n.getAccountKeys().find(v=>v.startsWith(t));let p=null;f&&(p=n.getAccount(f,u));const g=p||ld.createAccount({homeAccountId:t,idTokenClaims:r,clientInfo:s,environment:o,cloudGraphHostName:l==null?void 0:l.cloud_graph_host_name,msGraphHost:l==null?void 0:l.msgraph_host,nativeAccountId:c},e,i),m=g.tenantProfiles||[],_=a||g.realm;if(_&&!m.find(v=>v.tenantId===_)){const v=Uxe(t,g.localAccountId,_,r);m.push(v)}return g.tenantProfiles=m,g}/*! @azure/msal-common v14.16.0 2024-11-05 */async function QXe(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.0 2024-11-05 */class XXe extends Qxe{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(Gt.GetAuthCodeUrl,e.correlationId);const t=await Pi(this.createAuthCodeUrlQueryString.bind(this),Gt.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return sa.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var a,l;if((a=this.performanceClient)==null||a.addQueueMeasurement(Gt.AuthClientAcquireToken,e.correlationId),!e.code)throw ui(gXe);const i=zy(),r=await Pi(this.executeTokenRequest.bind(this),Gt.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),s=(l=r.headers)==null?void 0:l[Hf.X_MS_REQUEST_ID],o=new kL(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return o.validateTokenResponse(r.body),Pi(o.handleServerTokenResponse.bind(o),Gt.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,i,e,t,void 0,void 0,void 0,s)}handleFragmentResponse(e,t){if(new kL(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw ui(yXe);return e}getLogoutUri(e){if(!e)throw Dl(DXe);const t=this.createLogoutUrlQueryString(e);return sa.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var c,u;(c=this.performanceClient)==null||c.addQueueMeasurement(Gt.AuthClientExecuteTokenRequest,t.correlationId);const i=this.createTokenQueryParameters(t),r=sa.appendQueryString(e.tokenEndpoint,i),s=await Pi(this.createTokenRequestBody.bind(this),Gt.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let o;if(t.clientInfo)try{const d=zq(t.clientInfo,this.cryptoUtils.base64Decode);o={credential:`${d.uid}${tf.CLIENT_INFO_SEPARATOR}${d.utid}`,type:fm.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const a=this.createTokenRequestHeaders(o||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 Pi(this.executePostToTokenEndpoint.bind(this),Gt.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(r,s,a,l,t.correlationId,Gt.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,s;(r=this.performanceClient)==null||r.addQueueMeasurement(Gt.AuthClientCreateTokenRequestBody,e.correlationId);const t=new OF(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((s=e.tokenBodyParameters)==null?void 0:s[EL])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):eR.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&&!ipe(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 o=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await QXe(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(o.assertionType)}if(t.addGrantType(rXe.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===vl.POP){const o=new BO(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await Pi(o.generateCnf.bind(o),Gt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(a)}else if(e.authenticationScheme===vl.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Dl(zJ);(!Sb.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let i;if(e.clientInfo)try{const o=zq(e.clientInfo,this.cryptoUtils.base64Decode);i={credential:`${o.uid}${tf.CLIENT_INFO_SEPARATOR}${o.utid}`,type:fm.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose("Could not parse client info for CCS Header: "+o)}else i=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&i)switch(i.type){case fm.HOME_ACCOUNT_ID:try{const o=vR(i.credential);t.addCcsOid(o)}catch(o){this.logger.verbose("Could not parse home account ID for CCS Header: "+o)}break;case fm.UPN:t.addCcsUpn(i.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[e3e])&&t.addExtraQueryParameters({[e3e]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var s,o;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(s=this.performanceClient)==null||s.addQueueMeasurement(Gt.AuthClientCreateQueryString,t);const i=new OF(t,this.performanceClient);i.addClientId(e.embeddedClientId||((o=e.extraQueryParameters)==null?void 0:o[EL])||this.config.authOptions.clientId);const r=[...e.scopes||[],...e.extraScopesToConsent||[]];if(i.addScopes(r,!0,this.oidcDefaultScopes),i.addRedirectUri(e.redirectUri),i.addCorrelationId(t),i.addResponseMode(e.responseMode),i.addResponseTypeCode(),i.addLibraryInfo(this.config.libraryInfo),ipe(this.config)||i.addApplicationTelemetry(this.config.telemetry.application),i.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&i.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&i.addPrompt(e.prompt),e.domainHint&&i.addDomainHint(e.domainHint),e.prompt!==Wd.SELECT_ACCOUNT)if(e.sid&&e.prompt===Wd.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),i.addSid(e.sid);else if(e.account){const a=this.extractAccountSid(e.account);let l=this.extractLoginHint(e.account);if(l&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),l=null),l){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),i.addLoginHint(l);try{const c=vR(e.account.homeAccountId);i.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&e.prompt===Wd.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),i.addSid(a);try{const c=vR(e.account.homeAccountId);i.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"),i.addLoginHint(e.loginHint),i.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),i.addLoginHint(e.account.username);try{const c=vR(e.account.homeAccountId);i.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"),i.addLoginHint(e.loginHint),i.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&i.addNonce(e.nonce),e.state&&i.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&i.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,i),e.nativeBroker&&(i.addNativeBroker(),e.authenticationScheme===vl.POP)){const a=new BO(this.cryptoUtils);let l;e.popKid?l=this.cryptoUtils.encodeKid(e.popKid):l=(await Pi(a.generateCnf.bind(a),Gt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,i.addPopToken(l)}return i.createQueryString()}createLogoutUrlQueryString(e){const t=new OF(e.correlationId,this.performanceClient);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),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}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.16.0 2024-11-05 */const oQt=300;class ope extends Qxe{constructor(e,t){super(e,t)}async acquireToken(e){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement(Gt.RefreshTokenClientAcquireToken,e.correlationId);const t=zy(),i=await Pi(this.executeTokenRequest.bind(this),Gt.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),r=(a=i.headers)==null?void 0:a[Hf.X_MS_REQUEST_ID],s=new kL(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(i.body),Pi(s.handleServerTokenResponse.bind(s),Gt.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 Dl(NXe);if((i=this.performanceClient)==null||i.addQueueMeasurement(Gt.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw ui(Oxe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await Pi(this.acquireTokenWithCachedRefreshToken.bind(this),Gt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(r){const s=r instanceof Ob&&r.errorCode===Gq,o=r instanceof VE&&r.errorCode===$4e.INVALID_GRANT_ERROR&&r.subError===$4e.CLIENT_MISMATCH_ERROR;if(s||o)return Pi(this.acquireTokenWithCachedRefreshToken.bind(this),Gt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw r}return Pi(this.acquireTokenWithCachedRefreshToken.bind(this),Gt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(Gt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const i=TA(this.cacheManager.getRefreshToken.bind(this.cacheManager),Gt.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!i)throw spe(Gq);if(i.expiresOn&&npe(i.expiresOn,e.refreshTokenExpirationOffsetSeconds||oQt))throw spe(Xxe);const r={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||vl.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:fm.HOME_ACCOUNT_ID}};try{return await Pi(this.acquireToken.bind(this),Gt.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(r)}catch(o){if(o instanceof Ob&&o.subError===KJ){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const a=_R(i);this.cacheManager.removeRefreshToken(a)}throw o}}async executeTokenRequest(e,t){var l,c;(l=this.performanceClient)==null||l.addQueueMeasurement(Gt.RefreshTokenClientExecuteTokenRequest,e.correlationId);const i=this.createTokenQueryParameters(e),r=sa.appendQueryString(t.tokenEndpoint,i),s=await Pi(this.createTokenRequestBody.bind(this),Gt.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),o=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 Pi(this.executePostToTokenEndpoint.bind(this),Gt.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(r,s,o,a,e.correlationId,Gt.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,s,o;(r=this.performanceClient)==null||r.addQueueMeasurement(Gt.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,i=new OF(t,this.performanceClient);if(i.addClientId(e.embeddedClientId||((s=e.tokenBodyParameters)==null?void 0:s[EL])||this.config.authOptions.clientId),e.redirectUri&&i.addRedirectUri(e.redirectUri),i.addScopes(e.scopes,!0,(o=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:o.defaultScopes),i.addGrantType(rXe.REFRESH_TOKEN_GRANT),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&!ipe(this.config)&&i.addServerTelemetry(this.serverTelemetryManager),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(await QXe(a.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),i.addClientAssertionType(a.assertionType)}if(e.authenticationScheme===vl.POP){const a=new BO(this.cryptoUtils,this.performanceClient);let l;e.popKid?l=this.cryptoUtils.encodeKid(e.popKid):l=(await Pi(a.generateCnf.bind(a),Gt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,i.addPopToken(l)}else if(e.authenticationScheme===vl.SSH)if(e.sshJwk)i.addSshJwk(e.sshJwk);else throw Dl(zJ);if((!Sb.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 fm.HOME_ACCOUNT_ID:try{const a=vR(e.ccsCredential.credential);i.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case fm.UPN:i.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&i.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&i.addExtraQueryParameters(e.tokenBodyParameters),i.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */class aQt extends Qxe{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[i,r]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...y4]});return r===Jx.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 ope(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),i}catch(i){if(i instanceof HJ&&i.errorCode===FC)return new ope(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw i}}async acquireCachedToken(e){var l;(l=this.performanceClient)==null||l.addQueueMeasurement(Gt.SilentFlowClientAcquireCachedToken,e.correlationId);let t=Jx.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Sb.isEmptyObj(e.claims))throw this.setCacheOutcome(Jx.FORCE_REFRESH_OR_CLAIMS,e.correlationId),ui(FC);if(!e.account)throw ui(Oxe);const i=e.account.tenantId||QYt(e.authority),r=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,r,i,this.performanceClient,e.correlationId);if(s){if(MGt(s.cachedAt)||npe(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Jx.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),ui(FC);s.refreshOn&&npe(s.refreshOn,0)&&(t=Jx.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Jx.NO_CACHED_ACCESS_TOKEN,e.correlationId),ui(FC);const o=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.readAccountFromCache(e.account),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,r,i,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(o)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Pi(this.generateResultFromCacheRecord.bind(this),Gt.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),t]}setCacheOutcome(e,t){var i,r;(i=this.serverTelemetryManager)==null||i.setCacheOutcome(e),(r=this.performanceClient)==null||r.addFields({cacheOutcome:e},t),e!==Jx.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Gt.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let i;if(e.idToken&&(i=kA(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const s=i==null?void 0:i.auth_time;if(!s)throw ui(Pxe);SXe(s,t.maxAge)}return kL.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,i)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const lQt={sendGetRequestAsync:()=>Promise.reject(ui(ho)),sendPostRequestAsync:()=>Promise.reject(ui(ho))};/*! @azure/msal-common v14.16.0 2024-11-05 */const r3e=",",ZXe="|";function cQt(n){const{skus:e,libraryName:t,libraryVersion:i,extensionName:r,extensionVersion:s}=n,o=new Map([[0,[t,i]],[2,[r,s]]]);let a=[];if(e!=null&&e.length){if(a=e.split(r3e),a.length<4)return e}else a=Array.from({length:4},()=>ZXe);return o.forEach((l,c)=>{var u,d;l.length===2&&((u=l[0])!=null&&u.length)&&((d=l[1])!=null&&d.length)&&uQt({skuArr:a,index:c,skuName:l[0],skuVersion:l[1]})}),a.join(r3e)}function uQt(n){const{skuArr:e,index:t,skuName:i,skuVersion:r}=n;t>=e.length||(e[t]=[i,r].join(ZXe))}class D8{constructor(e,t){this.cacheOutcome=Jx.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||wn.EMPTY_STRING,this.wrapperVer=e.wrapperVer||wn.EMPTY_STRING,this.telemetryCacheKey=lh.CACHE_KEY+tf.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${lh.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],i=this.getNativeBrokerErrorCode();i!=null&&i.length&&t.push(`broker_error=${i}`);const r=t.join(lh.VALUE_SEPARATOR),s=this.getRegionDiscoveryFields(),o=[e,s].join(lh.VALUE_SEPARATOR);return[lh.SCHEMA_VERSION,o,r].join(lh.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=D8.maxErrorsToSend(e),i=e.failedRequests.slice(0,2*t).join(lh.VALUE_SEPARATOR),r=e.errors.slice(0,t).join(lh.VALUE_SEPARATOR),s=e.errors.length,o=t<s?lh.OVERFLOW_TRUE:lh.OVERFLOW_FALSE,a=[s,o].join(lh.VALUE_SEPARATOR);return[lh.SCHEMA_VERSION,e.cacheHits,i,r,a].join(lh.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=lh.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 dc?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(lh.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={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=D8.maxErrorsToSend(e),i=e.errors.length;if(t===i)this.cacheManager.removeItem(this.telemetryCacheKey);else{const r={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r)}}static maxErrorsToSend(e){let t,i=0,r=0;const s=e.errors.length;for(t=0;t<s;t++){const o=e.failedRequests[2*t]||wn.EMPTY_STRING,a=e.failedRequests[2*t+1]||wn.EMPTY_STRING,l=e.errors[t]||wn.EMPTY_STRING;if(r+=o.toString().length+a.toString().length+l.length+3,r<lh.MAX_LAST_HEADER_BYTES)i+=1;else break}return i}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||wn.EMPTY_STRING),e.push(this.regionSource||wn.EMPTY_STRING),e.push(this.regionOutcome||wn.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}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return cQt(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const JXe="missing_kid_error",eZe="missing_alg_error";/*! @azure/msal-common v14.16.0 2024-11-05 */const dQt={[JXe]:"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.",[eZe]:"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 Jxe extends dc{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,Jxe.prototype)}}function s3e(n){return new Jxe(n,dQt[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class eSe{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw s3e(JXe);if(!e.alg)throw s3e(eZe);const t=new eSe({typ:e.typ||yGt.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class o3e{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class hQt{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:YYt.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new o3e}}startPerformanceMeasurement(){return new o3e}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const tSe="pkce_not_created",ape="crypto_nonexistent",GJ="empty_navigate_uri",tZe="hash_empty_error",nSe="no_state_in_hash",nZe="hash_does_not_contain_known_properties",iZe="unable_to_parse_state",rZe="state_interaction_type_mismatch",sZe="interaction_in_progress",oZe="popup_window_error",aZe="empty_window_error",TL="user_cancelled",fQt="monitor_popup_timeout",lZe="monitor_window_timeout",cZe="redirect_in_iframe",uZe="block_iframe_reload",dZe="block_nested_popups",pQt="iframe_closed_prematurely",YJ="silent_logout_unsupported",hZe="no_account_error",gQt="silent_prompt_value_error",fZe="no_token_request_cache_error",pZe="unable_to_parse_token_request_cache_error",iSe="no_cached_authority_error",mQt="auth_request_not_set_error",_Qt="invalid_cache_type",QJ="non_browser_environment",tR="database_not_open",Yq="no_network_connectivity",gZe="post_request_failed",mZe="get_request_failed",lpe="failed_to_parse_response",_Ze="unable_to_load_token",rSe="crypto_key_not_found",vZe="auth_code_required",bZe="auth_code_or_nativeAccountId_required",yZe="spa_code_and_nativeAccountId_present",sSe="database_unavailable",CZe="unable_to_acquire_token_from_native_platform",wZe="native_handshake_timeout",xZe="native_extension_not_installed",b9="native_connection_not_established",SZe="uninitialized_public_client_application",EZe="native_prompt_not_supported",kZe="invalid_base64_string",TZe="invalid_pop_token_request",IZe="failed_to_build_headers",LZe="failed_to_parse_headers";/*! @azure/msal-browser v3.28.1 2025-01-14 */const nC="For more visit: aka.ms/msaljs/browser-errors",vQt={[tSe]:"The PKCE code challenge and verifier could not be generated.",[ape]:"The crypto object or function is not available.",[GJ]:"Navigation URI is empty. Please check stack trace for more info.",[tZe]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${nC}`,[nSe]:"Hash does not contain state. Please verify that the request originated from msal.",[nZe]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${nC}`,[iZe]:"Unable to parse state. Please verify that the request originated from msal.",[rZe]:"Hash contains state but the interaction type does not match the caller.",[sZe]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${nC}`,[oZe]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[aZe]:"window.open returned null or undefined window object.",[TL]:"User cancelled the flow.",[fQt]:`Token acquisition in popup failed due to timeout. ${nC}`,[lZe]:`Token acquisition in iframe failed due to timeout. ${nC}`,[cZe]:"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.",[uZe]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${nC}`,[dZe]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[pQt]:"The iframe being monitored was closed prematurely.",[YJ]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[hZe]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[gQt]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[fZe]:"No token request found in cache.",[pZe]:"The cached token request could not be parsed.",[iSe]:"No cached authority found.",[mQt]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[_Qt]:"Invalid cache type",[QJ]:"Login and token requests are not supported in non-browser environments.",[tR]:"Database is not open!",[Yq]:"No network connectivity. Check your internet connection.",[gZe]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[mZe]:"Network request failed. Please check the network trace to determine root cause.",[lpe]:"Failed to parse network response. Check network trace.",[_Ze]:"Error loading token to cache.",[rSe]:"Cryptographic Key or Keypair not found in browser storage.",[vZe]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[bZe]:"An authorization code or nativeAccountId must be provided to this flow.",[yZe]:"Request cannot contain both spa code and native account id.",[sSe]:"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.",[CZe]:`Unable to acquire token from native platform. ${nC}`,[wZe]:"Timed out while attempting to establish connection to browser extension",[xZe]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[b9]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${nC}`,[SZe]:`You must call and await the initialize function before attempting to call any other MSAL API. ${nC}`,[EZe]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[kZe]:"Invalid base64 encoded string.",[TZe]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[IZe]:"Failed to build request headers object.",[LZe]:"Failed to parse response headers"};class y9 extends dc{constructor(e,t){super(e,vQt[e],t),Object.setPrototypeOf(this,y9.prototype),this.name="BrowserAuthError"}}function wr(n,e){return new y9(n,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const rm={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"},bR={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},W2={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Kp={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},a3e={GET:"GET",POST:"POST"},rl={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"},Vx={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},dV={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},rc={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var Zr;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(Zr||(Zr={}));const l3e={scopes:y4},AZe="jwk",cpe="msal.db",bQt=1,yQt=`${cpe}.keys`,em={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},CQt=[em.Default,em.Skip,em.RefreshTokenAndNetwork],wQt="msal.browser.log.level",xQt="msal.browser.log.pii";/*! @azure/msal-browser v3.28.1 2025-01-14 */function hV(n){return encodeURIComponent(oSe(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function XJ(n){return NZe(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function oSe(n){return NZe(new TextEncoder().encode(n))}function NZe(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const SQt="RSASSA-PKCS1-v1_5",DZe="SHA-256",EQt=2048,kQt=new Uint8Array([1,0,1]),c3e="0123456789abcdef",u3e=new Uint32Array(1),TQt="crypto_subtle_undefined",aSe={name:SQt,hash:DZe,modulusLength:EQt,publicExponent:kQt};function IQt(n){if(!window)throw wr(QJ);if(!window.crypto)throw wr(ape);if(!n&&!window.crypto.subtle)throw wr(ape,TQt)}async function RZe(n,e,t){e==null||e.addQueueMeasurement(Gt.Sha256Digest,t);const r=new TextEncoder().encode(n);return window.crypto.subtle.digest(DZe,r)}function LQt(n){return window.crypto.getRandomValues(n)}function Bae(){return window.crypto.getRandomValues(u3e),u3e[0]}function Sw(){const n=Date.now(),e=Bae()*1024+(Bae()&1023),t=new Uint8Array(16),i=Math.trunc(e/2**30),r=e&2**30-1,s=Bae();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|i>>>8,t[7]=i,t[8]=128|r>>>24,t[9]=r>>>16,t[10]=r>>>8,t[11]=r,t[12]=s>>>24,t[13]=s>>>16,t[14]=s>>>8,t[15]=s;let o="";for(let a=0;a<t.length;a++)o+=c3e.charAt(t[a]>>>4),o+=c3e.charAt(t[a]&15),(a===3||a===5||a===7||a===9)&&(o+="-");return o}async function AQt(n,e){return window.crypto.subtle.generateKey(aSe,n,e)}async function $ae(n){return window.crypto.subtle.exportKey(AZe,n)}async function NQt(n,e,t){return window.crypto.subtle.importKey(AZe,n,aSe,e,t)}async function DQt(n,e){return window.crypto.subtle.sign(aSe,n,e)}async function PZe(n){const e=await RZe(n),t=new Uint8Array(e);return XJ(t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const lSe="storage_not_supported",RQt="stubbed_public_client_application_called",OZe="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.28.1 2025-01-14 */const PQt={[lSe]:"Given storage configuration option was not supported.",[RQt]:"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",[OZe]:"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 cSe extends dc{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,cSe.prototype)}}function uSe(n){return new cSe(n,PQt[n])}/*! @azure/msal-browser v3.28.1 2025-01-14 */function OQt(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function MQt(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function dSe(){return window.parent!==window}function jQt(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${rm.POPUP_NAME_PREFIX}.`)===0}function BC(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function FQt(){const e=new sa(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function BQt(){if(sa.hashContainsKnownProperties(window.location.hash)&&dSe())throw wr(uZe)}function $Qt(n){if(dSe()&&!n)throw wr(cZe)}function HQt(){if(jQt())throw wr(dZe)}function MZe(){if(typeof window>"u")throw wr(QJ)}function jZe(n){if(!n)throw wr(SZe)}function hSe(n){MZe(),BQt(),HQt(),jZe(n)}function d3e(n,e){if(hSe(n),$Qt(e.system.allowRedirectInIframe),e.cache.cacheLocation===Kp.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw uSe(OZe)}function FZe(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)}function VQt(){return Sw()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Qq{navigateInternal(e,t){return Qq.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Qq.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.28.1 2025-01-14 */class WQt{async sendGetRequestAsync(e,t){let i,r={},s=0;const o=h3e(t);try{i=await fetch(e,{method:a3e.GET,headers:o})}catch{throw wr(window.navigator.onLine?mZe:Yq)}r=f3e(i.headers);try{return s=i.status,{headers:r,body:await i.json(),status:s}}catch{throw t3e(wr(lpe),s,r)}}async sendPostRequestAsync(e,t){const i=t&&t.body||"",r=h3e(t);let s,o=0,a={};try{s=await fetch(e,{method:a3e.POST,headers:r,body:i})}catch{throw wr(window.navigator.onLine?gZe:Yq)}a=f3e(s.headers);try{return o=s.status,{headers:a,body:await s.json(),status:o}}catch{throw t3e(wr(lpe),o,a)}}}function h3e(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([i,r])=>{e.append(i,r)}),e}catch{throw wr(IZe)}}function f3e(n){try{const e={};return n.forEach((t,i)=>{e[i]=t}),e}catch{throw wr(LZe)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const zQt=6e4,upe=1e4,UQt=3e4,qQt=2e3;function KQt({auth:n,cache:e,system:t,telemetry:i},r){const s={clientId:wn.EMPTY_STRING,authority:`${wn.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:wn.EMPTY_STRING,authorityMetadata:wn.EMPTY_STRING,redirectUri:typeof window<"u"?BC():"",postLogoutRedirectUri:wn.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:aw.AAD,OIDCOptions:{serverResponseType:v9.FRAGMENT,defaultScopes:[wn.OPENID_SCOPE,wn.PROFILE_SCOPE,wn.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Bxe.None,tenant:wn.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},o={cacheLocation:Kp.SessionStorage,temporaryCacheLocation:Kp.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Kp.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:lc.Info,piiLoggingEnabled:!1},c={...{...UXe,loggerOptions:a,networkClient:r?new WQt:lQt,navigationClient:new Qq,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||zQt,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||upe,navigateFrameWait:0,redirectNavigationTimeout:UQt,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||qQt,pollIntervalMilliseconds:rm.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||a},u={application:{appName:wn.EMPTY_STRING,appVersion:wn.EMPTY_STRING},client:new hQt};if((n==null?void 0:n.protocolMode)!==aw.OIDC&&(n!=null&&n.OIDCOptions)&&new HE(c.loggerOptions).warning(JSON.stringify(Dl(jXe))),n!=null&&n.protocolMode&&n.protocolMode!==aw.AAD&&(c!=null&&c.allowNativeBroker))throw Dl(FXe);return{auth:{...s,...n,OIDCOptions:{...s.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...o,...e},system:c,telemetry:{...u,...i}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const GQt="@azure/msal-browser",ZJ="3.28.1";/*! @azure/msal-browser v3.28.1 2025-01-14 */class fSe{static loggerCallback(e,t){switch(e){case lc.Error:console.error(t);return;case lc.Info:console.info(t);return;case lc.Verbose:console.debug(t);return;case lc.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var l;this.browserEnvironment=typeof window<"u",this.config=KQt(e,this.browserEnvironment);let t;try{t=window[Kp.SessionStorage]}catch{}const i=t==null?void 0:t.getItem(wQt),r=(l=t==null?void 0:t.getItem(xQt))==null?void 0:l.toLowerCase(),s=r==="true"?!0:r==="false"?!1:void 0,o={...this.config.system.loggerOptions},a=i&&Object.keys(lc).includes(i)?lc[i]:void 0;a&&(o.loggerCallback=fSe.loggerCallback,o.logLevel=a),s!==void 0&&(o.piiLoggingEnabled=s),this.logger=new HE(o,GQt,ZJ),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class IL extends fSe{getModuleName(){return IL.MODULE_NAME}getId(){return IL.ID}async initialize(){return this.available=typeof window<"u",this.available}}IL.MODULE_NAME="";IL.ID="StandardOperatingContext";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Ry(n){return new TextDecoder().decode(YQt(n))}function YQt(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 wr(kZe)}const t=atob(e);return Uint8Array.from(t,i=>i.codePointAt(0)||0)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class QQt{constructor(){this.dbName=cpe,this.version=bQt,this.tableName=yQt,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 s=r;this.db=s.target.result,this.dbOpen=!0,e()}),i.addEventListener("error",()=>t(wr(sSe)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i(wr(tR));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);o.addEventListener("success",a=>{const l=a;this.closeConnection(),t(l.target.result)}),o.addEventListener("error",a=>{this.closeConnection(),i(a)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((i,r)=>{if(!this.db)return r(wr(tR));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(wr(tR));const o=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);o.addEventListener("success",()=>{this.closeConnection(),t()}),o.addEventListener("error",a=>{this.closeConnection(),i(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(wr(tR));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();s.addEventListener("success",o=>{const a=o;this.closeConnection(),e(a.target.result)}),s.addEventListener("error",o=>{this.closeConnection(),t(o)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i(wr(tR));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);o.addEventListener("success",a=>{const l=a;this.closeConnection(),t(l.target.result===1)}),o.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(cpe),r=setTimeout(()=>t(!1),200);i.addEventListener("success",()=>(clearTimeout(r),e(!0))),i.addEventListener("blocked",()=>(clearTimeout(r),e(!0))),i.addEventListener("error",()=>(clearTimeout(r),t(!1)))})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class dpe{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.28.1 2025-01-14 */class XQt{constructor(e){this.inMemoryCache=new dpe,this.indexedDBCache=new QQt,this.logger=e}handleDatabaseAccessError(e){if(e instanceof y9&&e.errorCode===sSe)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.inMemoryCache.clear(),this.logger.verbose("In-memory keystore 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.28.1 2025-01-14 */class $O{constructor(e,t,i){this.logger=e,IQt(i??!1),this.cache=new XQt(this.logger),this.performanceClient=t}createNewGuid(){return Sw()}base64Encode(e){return oSe(e)}base64Decode(e){return Ry(e)}base64UrlEncode(e){return hV(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var u;const t=(u=this.performanceClient)==null?void 0:u.startMeasurement(Gt.CryptoOptsGetPublicKeyThumbprint,e.correlationId),i=await AQt($O.EXTRACTABLE,$O.POP_KEY_USAGES),r=await $ae(i.publicKey),s={e:r.e,kty:r.kty,n:r.n},o=p3e(s),a=await this.hashString(o),l=await $ae(i.privateKey),c=await NQt(l,!1,["sign"]);return await this.cache.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.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.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}}async signJwt(e,t,i,r){var y;const s=(y=this.performanceClient)==null?void 0:y.startMeasurement(Gt.CryptoOptsSignJwt,r),o=await this.cache.getItem(t);if(!o)throw wr(rSe);const a=await $ae(o.publicKey),l=p3e(a),c=hV(JSON.stringify({kid:t})),u=eSe.getShrHeaderString({...i==null?void 0:i.header,alg:a.alg,kid:c}),d=hV(u);e.cnf={jwk:JSON.parse(l)};const f=hV(JSON.stringify(e)),p=`${d}.${f}`,m=new TextEncoder().encode(p),_=await DQt(o.privateKey,m),v=XJ(new Uint8Array(_)),b=`${p}.${v}`;return s&&s.end({success:!0}),b}async hashString(e){return PZe(e)}}$O.POP_KEY_USAGES=["sign","verify"];$O.EXTRACTABLE=!0;function p3e(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.28.1 2025-01-14 */class ZQt{constructor(){if(!window.localStorage)throw uSe(lSe)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class JQt{constructor(){if(!window.sessionStorage)throw uSe(lSe)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function BZe(n,e){if(!e)return null;try{return Eb.parseRequestState(n,e).libraryState.meta}catch{throw ui(jO)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const eXt=24*60*60*1e3;class tXt{getItem(e){const t=`${encodeURIComponent(e)}`,i=document.cookie.split(";");for(let r=0;r<i.length;r++){const s=i[r],[o,...a]=decodeURIComponent(s).trim().split("="),l=a.join("=");if(o===t)return l}return""}setItem(e,t,i,r=!0){let s=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(i){const o=nXt(i);s+=`expires=${o};`}r&&(s+="Secure;"),document.cookie=s}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(i=>{const r=decodeURIComponent(i).trim().split("=");t.push(r[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function nXt(n){const e=new Date;return new Date(e.getTime()+n*eXt).toUTCString()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class hpe extends FO{constructor(e,t,i,r,s,o){super(e,i,r,s),this.cacheConfig=t,this.logger=r,this.internalStorage=new dpe,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new tXt,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=o}setupBrowserStorage(e){try{switch(e){case Kp.LocalStorage:return new ZQt;case Kp.SessionStorage:return new JQt;case Kp.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=Kp.MemoryStorage,new dpe}migrateCacheEntries(){const e=`${wn.CACHE_PREFIX}.${Ad.ID_TOKEN}`,t=`${wn.CACHE_PREFIX}.${Ad.CLIENT_INFO}`,i=`${wn.CACHE_PREFIX}.${Ad.ERROR}`,r=`${wn.CACHE_PREFIX}.${Ad.ERROR_DESC}`,s=this.browserStorage.getItem(e),o=this.browserStorage.getItem(t),a=this.browserStorage.getItem(i),l=this.browserStorage.getItem(r),c=[s,o,a,l];[Ad.ID_TOKEN,Ad.CLIENT_INFO,Ad.ERROR,Ad.ERROR_DESC].forEach((d,f)=>{const p=c[f];p&&this.setTemporaryCache(d,p,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Vx.ACCOUNT_KEYS),t=this.getItem(`${Vx.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 s=this.getItem(r);if(s){const o=this.validateAndParseJson(s);if(o&&o.hasOwnProperty("credentialType"))switch(o.credentialType){case ks.ID_TOKEN:if(U4e(o)){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=o,l=this.updateCredentialCacheKey(r,a);this.addTokenKey(l,ks.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 ks.ACCESS_TOKEN:case ks.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(z4e(o)){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=o,l=this.updateCredentialCacheKey(r,a);this.addTokenKey(l,ks.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 ks.REFRESH_TOKEN:if(q4e(o)){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=o,l=this.updateCredentialCacheKey(r,a);this.addTokenKey(l,ks.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 s=this.getItem(r);if(s){const o=this.validateAndParseJson(s);o&&ld.isAccountEntity(o)&&(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,t){this.logger.trace("BrowserCacheManager.getAccount called");const i=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,i,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const i=this.validateAndParseJson(t);return!i||!ld.isAccountEntity(i)?(this.removeAccountKeyFromMap(e),null):FO.toObject(new ld,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(Vx.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(Vx.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(Vx.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)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,ks.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,ks.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,ks.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Vx.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 ks.ID_TOKEN:i.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),i.idToken.push(e));break;case ks.ACCESS_TOKEN:i.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),i.accessToken.push(e));break;case ks.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}`),ui(tpe)}this.setItem(`${Vx.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const i=this.getTokenKeys();switch(t){case ks.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 ks.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const s=i.accessToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),i.accessToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ks.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const o=i.refreshToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),i.refreshToken.splice(o,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}`),ui(tpe)}this.setItem(`${Vx.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,ks.ID_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!U4e(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ks.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),i)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=_R(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ks.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ks.ACCESS_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!z4e(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ks.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),i)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=_R(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ks.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ks.REFRESH_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!q4e(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ks.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),i)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=_R(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ks.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||!UGt(e,i)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),i)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=zGt(e);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||!VGt(e,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),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&&qGt(e,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),i):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(dV.WRAPPER_SKU,e),this.internalStorage.setItem(dV.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(dV.WRAPPER_SKU)||wn.EMPTY_STRING,t=this.internalStorage.getItem(dV.WRAPPER_VER)||wn.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(Ad.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(Ad.ACTIVE_ACCOUNT),s=this.getItem(r);if(!s)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const o=this.getAccountInfoFilteredBy({localAccountId:s});return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(o),o):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,tenantId:i.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(Ad.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(Ad.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const r={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};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||!WGt(e,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),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 s=this.cookieStorage.getItem(i);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),s}const r=this.temporaryCacheStorage.getItem(i);if(!r){if(this.cacheConfig.cacheLocation===Kp.LocalStorage){const s=this.browserStorage.getItem(i);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),s}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.cookieStorage.setItem(r,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(wn.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(wn.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(Gt.ClearTokensAndKeysWithClaims,t);const i=this.getTokenKeys(),r=[];i.accessToken.forEach(s=>{const o=this.getAccessTokenCredential(s);o!=null&&o.requestedClaimsHash&&s.includes(o.requestedClaimsHash.toLowerCase())&&r.push(this.removeAccessToken(s))}),await Promise.all(r),r.length>0&&this.logger.warning(`${r.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):Sb.startsWith(e,wn.CACHE_PREFIX)||Sb.startsWith(e,Ad.ADAL_ID_TOKEN)?e:`${wn.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=Eb.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${rl.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=Eb.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${rl.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=Eb.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${rl.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,s){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const o=this.generateStateKey(e);this.setTemporaryCache(o,e,!1);const a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);const l=this.generateAuthorityKey(e);if(this.setTemporaryCache(l,i,!1),s){const c={credential:s.homeAccountId,type:fm.HOME_ACCOUNT_ID};this.setTemporaryCache(rl.CCS_CREDENTIAL,JSON.stringify(c),!0)}else if(r){const c={credential:r,type:fm.UPN};this.setTemporaryCache(rl.CCS_CREDENTIAL,JSON.stringify(c),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(rl.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(rl.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(rl.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(rl.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(rl.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(rl.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||wn.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf(rl.REQUEST_STATE)===-1)return;const i=this.temporaryCacheStorage.getItem(t);if(!i)return;const r=BZe(this.cryptoImpl,i);r&&r.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${i}`),this.resetRequestCache(i))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=oSe(JSON.stringify(e));this.setTemporaryCache(rl.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(rl.REQUEST_PARAMS,!0);if(!t)throw wr(fZe);let i;try{i=JSON.parse(Ry(t))}catch(r){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${r}`),wr(pZe)}if(this.removeTemporaryItem(this.generateCacheKey(rl.REQUEST_PARAMS)),!i.authority){const r=this.generateAuthorityKey(e),s=this.getTemporaryCache(r);if(!s)throw wr(iSe);i.authority=s}return i}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(rl.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=`${wn.CACHE_PREFIX}.${rl.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${wn.CACHE_PREFIX}.${rl.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw wr(sZe);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(Ad.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(Ad.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(Ad.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(Ad.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const i=t||e;if(i){const r=kA(i,Ry);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=_R(t);if(e!==i){const r=this.getItem(e);if(r)return this.browserStorage.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}async hydrateCache(e,t){var a,l,c;const i=VJ((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 s=WJ((c=e.account)==null?void 0:c.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,Ry,void 0,e.tokenType,void 0,t.sshKid,t.claims,r),o={idToken:i,accessToken:s};return this.saveCacheRecord(o)}async saveCacheRecord(e,t,i){try{await super.saveCacheRecord(e,t,i)}catch(r){if(r instanceof CP&&this.performanceClient&&i)try{const s=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:s.refreshToken.length,cacheIdCount:s.idToken.length,cacheAtCount:s.accessToken.length},i)}catch{}throw r}}}const iXt=(n,e)=>{const t={cacheLocation:Kp.MemoryStorage,temporaryCacheLocation:Kp.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new hpe(n,t,Wq,e)};/*! @azure/msal-browser v3.28.1 2025-01-14 */function rXt(n,e,t,i){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(i):[]}function sXt(n,e,t){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const i=t.getAccountInfoFilteredBy(n);return i?(e.verbose("getAccount: Account matching provided filter found, returning"),i):(e.verbose("getAccount: No matching account found, returning null"),null)}function oXt(n,e,t){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const i=t.getAccountInfoFilteredBy({username:n});return i?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),i):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function aXt(n,e,t){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const i=t.getAccountInfoFilteredBy({homeAccountId:n});return i?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),i):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function lXt(n,e,t){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const i=t.getAccountInfoFilteredBy({localAccountId:n});return i?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),i):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function cXt(n,e){e.setActiveAccount(n)}function uXt(n){return n.getActiveAccount()}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Es={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",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.28.1 2025-01-14 */class dXt{constructor(e){this.eventCallbacks=new Map,this.logger=e||new HE({})}addEventCallback(e,t,i){if(typeof window<"u"){const r=i||VQt();return this.eventCallbacks.has(r)?(this.logger.error(`Event callback with id: ${r} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(r,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${r}`),r)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,i,r){if(typeof window<"u"){const s={eventType:e,interactionType:t||null,payload:i||null,error:r||null,timestamp:Date.now()};this.eventCallbacks.forEach(([o,a],l)=>{(a.length===0||a.includes(e))&&(this.logger.verbose(`Emitting event to callback ${l}: ${e}`),o.apply(null,[s]))})}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class $Ze{constructor(e,t,i,r,s,o,a,l,c){this.config=e,this.browserStorage=t,this.browserCrypto=i,this.networkClient=this.config.system.networkClient,this.eventHandler=s,this.navigationClient=o,this.nativeMessageHandler=l,this.correlationId=c||Sw(),this.logger=r.clone(rm.MSAL_SKU,ZJ,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){ld.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(ld.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.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return sa.getAbsoluteUrl(t,BC())}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 D8(i,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,i=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(Gt.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const r={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},s=e.requestAuthority||this.config.auth.authority,o=i!=null&&i.length?i==="true":this.config.auth.instanceAware,a=t&&o?this.config.auth.authority.replace(sa.getDomainFromUrl(s),t.environment):s,l=Jh.generateAuthority(a,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),c=await Pi(GXe,Gt.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(l,this.config.system.networkClient,this.browserStorage,r,this.logger,this.correlationId,this.performanceClient);if(t&&!c.isAlias(t.environment))throw Dl(BXe);return c}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const hXt=32;async function fXt(n,e,t){n.addQueueMeasurement(Gt.GeneratePkceCodes,t);const i=TA(pXt,Gt.GenerateCodeVerifier,e,n,t)(n,e,t),r=await Pi(gXt,Gt.GenerateCodeChallengeFromVerifier,e,n,t)(i,n,e,t);return{verifier:i,challenge:r}}function pXt(n,e,t){try{const i=new Uint8Array(hXt);return TA(LQt,Gt.GetRandomValues,e,n,t)(i),XJ(i)}catch{throw wr(tSe)}}async function gXt(n,e,t,i){e.addQueueMeasurement(Gt.GenerateCodeChallengeFromVerifier,i);try{const r=await Pi(RZe,Gt.Sha256Digest,t,e,i)(n,e,i);return XJ(new Uint8Array(r))}catch{throw wr(tSe)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function pSe(n,e,t,i){t.addQueueMeasurement(Gt.InitializeBaseRequest,n.correlationId);const r=n.authority||e.auth.authority,s=[...n&&n.scopes||[]],o={...n,correlationId:n.correlationId,authority:r,scopes:s};if(!o.authenticationScheme)o.authenticationScheme=vl.BEARER,i.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(o.authenticationScheme===vl.SSH){if(!n.sshJwk)throw Dl(zJ);if(!n.sshKid)throw Dl(MXe)}i.verbose(`Authentication Scheme set to "${o.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!Sb.isEmptyObj(n.claims)&&(o.requestedClaimsHash=await PZe(n.claims)),o}async function mXt(n,e,t,i,r){i.addQueueMeasurement(Gt.InitializeSilentRequest,n.correlationId);const s=await Pi(pSe,Gt.InitializeBaseRequest,r,i,n.correlationId)(n,t,i,r);return{...n,...s,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class C4 extends $Ze{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(Gt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await Pi(fXt,Gt.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),i={...e,redirectUri:e.redirectUri,code:wn.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=wn.S256_CODE_CHALLENGE_METHOD,i}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||Sw(),...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=sa.getAbsoluteUrl(e.postLogoutRedirectUri,BC())):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=sa.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,BC())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=sa.getAbsoluteUrl(BC(),BC())):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){this.performanceClient.addQueueMeasurement(Gt.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await Pi(this.getClientConfiguration.bind(this),Gt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new XXe(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:i,requestAzureCloudOptions:r,requestExtraQueryParameters:s,account:o}=e;this.performanceClient.addQueueMeasurement(Gt.StandardInteractionClientGetClientConfiguration,this.correlationId);const a=await Pi(this.getDiscoveredAuthority.bind(this),Gt.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:i,requestAzureCloudOptions:r,requestExtraQueryParameters:s,account:o}),l=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:l.loggerCallback,piiLoggingEnabled:l.piiLoggingEnabled,logLevel:l.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:rm.MSAL_SKU,version:ZJ,cpu:wn.EMPTY_STRING,os:wn.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(Gt.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const i=this.getRedirectUri(e.redirectUri),r={interactionType:t},s=Eb.setRequestState(this.browserCrypto,e&&e.state||wn.EMPTY_STRING,r),a={...await Pi(pSe,Gt.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:i,state:s,nonce:e.nonce||Sw(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return a;const 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.28.1 2025-01-14 */const _Xt="ContentError",HZe="user_switch";/*! @azure/msal-browser v3.28.1 2025-01-14 */const vXt="USER_INTERACTION_REQUIRED",bXt="USER_CANCEL",yXt="NO_NETWORK",CXt="PERSISTENT_ERROR",wXt="DISABLED",xXt="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.28.1 2025-01-14 */const SXt=-2147186943,EXt={[HZe]:"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 fy extends dc{constructor(e,t,i){super(e,t),Object.setPrototypeOf(this,fy.prototype),this.name="NativeAuthError",this.ext=i}}function nR(n){if(n.ext&&n.ext.status&&(n.ext.status===CXt||n.ext.status===wXt)||n.ext&&n.ext.error&&n.ext.error===SXt)return!0;switch(n.errorCode){case _Xt:return!0;default:return!1}}function fpe(n,e,t){if(t&&t.status)switch(t.status){case xXt:return spe(YXe);case vXt:return new Ob(n,e);case bXt:return wr(TL);case yXt:return wr(Yq)}return new fy(n,EXt[n]||e,t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class VZe extends C4{async acquireToken(e){this.performanceClient.addQueueMeasurement(Gt.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(rc.acquireTokenSilent_silentFlow),i=await Pi(this.getClientConfiguration.bind(this),Gt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),r=new aQt(i,this.performanceClient);this.logger.verbose("Silent auth client created");try{const o=(await Pi(r.acquireCachedToken.bind(r),Gt.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),o}catch(s){throw s instanceof y9&&s.errorCode===rSe&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),s}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class wP extends $Ze{constructor(e,t,i,r,s,o,a,l,c,u,d,f){var g;super(e,t,i,r,s,o,l,c,f),this.apiId=a,this.accountId=u,this.nativeMessageHandler=c,this.nativeStorageManager=d,this.silentCacheClient=new VZe(e,this.nativeStorageManager,i,r,s,o,l,c,f),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const p=this.nativeMessageHandler.getExtensionId()===bR.PREFERRED_EXTENSION_ID?"chrome":(g=this.nativeMessageHandler.getExtensionId())!=null&&g.length?"unknown":void 0;this.skus=D8.makeExtraSkuString({libraryName:rm.MSAL_SKU,libraryVersion:ZJ,extensionName:p,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[zYt]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(Gt.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(Gt.NativeInteractionClientAcquireToken,e.correlationId),i=zy();try{const r=await this.initializeNativeRequest(e);try{const c=await this.acquireTokensFromCache(this.accountId,r);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),c}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...s}=r,o={method:W2.GetToken,request:s},a=await this.nativeMessageHandler.sendMessage(o),l=this.validateNativeResponse(a);return await this.handleNativeResponse(l,r,i).then(c=>(t.end({success:!0,isNativeBroker:!0,requestId:c.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),c)).catch(c=>{throw t.end({success:!1,errorCode:c.errorCode,subErrorCode:c.subError,isNativeBroker:!0}),c})}catch(r){throw r instanceof fy&&this.serverTelemetryManager.setNativeBrokerErrorCode(r.errorCode),r}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:uu.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),ui(Jfe);const i=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!i)throw ui(Jfe);try{const r=this.createSilentCacheRequest(t,i),s=await this.silentCacheClient.acquireToken(r),o={...i,idTokenClaims:s==null?void 0:s.idTokenClaims,idToken:s==null?void 0:s.idToken};return{...s,account:o}}catch(r){throw r}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...i}=e;delete i.onRedirectNavigate;const r=await this.initializeNativeRequest(i),s={method:W2.GetToken,request:r};try{const l=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(l)}catch(l){if(l instanceof fy&&(this.serverTelemetryManager.setNativeBrokerErrorCode(l.errorCode),nR(l)))throw l}this.browserStorage.setTemporaryCache(rl.NATIVE_REQUEST,JSON.stringify(r),!0);const o={apiId:rc.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(a,o)}async handleRedirectPromise(e,t){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 i=this.browserStorage.getCachedNativeRequest();if(!i)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:r,...s}=i;r&&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(rl.NATIVE_REQUEST));const o={method:W2.GetToken,request:s},a=zy();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const l=await this.nativeMessageHandler.sendMessage(o);this.validateNativeResponse(l);const c=this.handleNativeResponse(l,s,a);this.browserStorage.setInteractionInProgress(!1);const u=await c;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),u}catch(l){throw this.browserStorage.setInteractionInProgress(!1),l}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,i){var u;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const r=kA(e.id_token,Ry),s=this.createHomeAccountIdentifier(e,r),o=(u=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:u.homeAccountId;if(s!==o&&e.account.id!==t.accountId)throw fpe(HZe);const a=await this.getDiscoveredAuthority({requestAuthority:t.authority}),l=Zxe(this.browserStorage,a,s,Ry,r,e.client_info,void 0,r.tid,void 0,e.account.id,this.logger),c=await this.generateAuthenticationResult(e,t,r,l,a.canonicalAuthority,i);return this.cacheAccount(l),this.cacheNativeTokens(e,t,s,r,e.access_token,c.tenantId,i),c}createHomeAccountIdentifier(e,t){return ld.generateHomeAccountId(e.client_info||wn.EMPTY_STRING,eb.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?uu.fromString(e.scope):uu.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===vl.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const i=new BO(this.browserCrypto),r={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw ui(jxe);return i.signPopToken(e.access_token,t.keyId,r)}else return e.access_token}async generateAuthenticationResult(e,t,i,r,s,o){const a=this.addTelemetryFromNativeResponse(e),l=e.scope?uu.fromString(e.scope):uu.fromString(t.scope),c=e.account.properties||{},u=c.UID||i.oid||i.sub||wn.EMPTY_STRING,d=c.TenantId||i.tid||wn.EMPTY_STRING,f=qxe(r.getAccountInfo(),void 0,i,e.id_token);f.nativeAccountId!==e.account.id&&(f.nativeAccountId=e.account.id);const p=await this.generatePopAccessToken(e,t),g=t.tokenType===vl.POP?vl.POP:vl.BEARER;return{authority:s,uniqueId:u,tenantId:d,scopes:l.asArray(),account:f,idToken:e.id_token,idTokenClaims:i,accessToken:p,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:new Date(Number(o+e.expires_in)*1e3),tokenType:g,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,s,o,a){const l=VJ(i,t.authority,e.id_token||"",t.clientId,r.tid||""),c=t.tokenType===vl.POP?wn.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),f=WJ(i,t.authority,s,t.clientId,r.tid||o,d.printScopes(),u,0,Ry,void 0,t.tokenType,void 0,t.keyId),p={idToken:l,accessToken:f};this.nativeStorageManager.saveCacheRecord(p,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 sXe(Nxe,"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.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const i=new sa(t);i.validateAsUri();const{scopes:r,...s}=e,o=new uu(r||[]);o.appendScopes(y4);const a=()=>{switch(this.apiId){case rc.ssoSilent:case rc.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Wd.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Wd.NONE:case Wd.CONSENT:case Wd.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`),wr(EZe)}},l={...s,accountId:this.accountId,clientId:this.config.auth.clientId,authority:i.urlString,scope:o.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:a(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(l.signPopToken&&e.popKid)throw wr(TZe);if(this.handleExtraBrokerParams(l),l.extraParameters=l.extraParameters||{},l.extraParameters.telemetry=bR.MATS_TELEMETRY,e.authenticationScheme===vl.POP){const c={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new BO(this.browserCrypto);let d;if(l.keyId)d=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:l.keyId})),l.signPopToken=!1;else{const f=await Pi(u.generateCnf.bind(u),Gt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(c,this.logger);d=f.reqCnfString,l.keyId=f.kid,l.signPopToken=!0}l.reqCnf=d}return this.addRequestSKUs(l),l}handleExtraBrokerParams(e){var s;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(Yxe)&&e.extraParameters.hasOwnProperty(rpe)&&e.extraParameters.hasOwnProperty(EL);if(!e.embeddedClientId&&!t)return;let i="";const r=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,i=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[rpe],i=e.extraParameters[EL]),e.extraParameters={child_client_id:i,child_redirect_uri:r},(s=this.performanceClient)==null||s.addFields({embeddedClientId:i,embeddedRedirectUri:r},e.correlationId)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Sy{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(Gt.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:bR.CHANNEL_ID,extensionId:this.extensionId,responseId:Sw(),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 Sy(e,t,i,bR.PREFERRED_EXTENSION_ID);return await r.sendHandshakeRequest(),r}catch{const s=new Sy(e,t,i);return await s.sendHandshakeRequest(),s}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:bR.CHANNEL_ID,extensionId:this.extensionId,responseId:Sw(),body:{method:W2.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(wr(wZe)),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!==bR.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===W2.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(wr(xZe))}}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 s=t.body.method;if(s===W2.Response){if(!i)return;const o=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(o)}`),o.status!=="Success")i.reject(fpe(o.code,o.description,o.ext));else if(o.result)o.result.code&&o.result.description?i.reject(fpe(o.result.code,o.result.description,o.result.ext)):i.resolve(o.result);else throw sXe(Nxe,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(s===W2.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(s){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${s}`),this.logger.errorPii(`Unable to parse ${e}`),i?i.reject(s):r&&r.reject(s)}}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 vl.BEARER:case vl.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.28.1 2025-01-14 */class gSe{constructor(e,t,i,r,s){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=r,this.performanceClient=s}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(Gt.HandleCodeResponse,t.correlationId);let i;try{i=this.authModule.handleFragmentResponse(e,t.state)}catch(r){throw r instanceof VE&&r.subError===TL?wr(TL):r}return Pi(this.handleCodeResponseFromServer.bind(this),Gt.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(i,t)}async handleCodeResponseFromServer(e,t,i=!0){if(this.performanceClient.addQueueMeasurement(Gt.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await Pi(this.authModule.updateAuthority.bind(this.authModule),Gt.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 s=this.createCcsCredentials(t);s&&(this.authCodeRequest.ccsCredential=s)}return await Pi(this.authModule.acquireToken.bind(this.authModule),Gt.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:fm.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:fm.UPN}:null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function WZe(n,e,t){const i=qq(n);if(!i)throw HXe(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),wr(nZe)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),wr(tZe));return i}function kXt(n,e,t){if(!n.state)throw wr(nSe);const i=BZe(e,n.state);if(!i)throw wr(iZe);if(i.interactionType!==t)throw wr(rZe)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class TXt extends C4{constructor(e,t,i,r,s,o,a,l,c,u){super(e,t,i,r,s,o,a,c,u),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=l}acquireToken(e){try{const i={popupName:this.generatePopupName(e.scopes||y4,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,i)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),i.popup=this.openSizedPopup("about:blank",i),this.acquireTokenPopupAsync(e,i))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),i={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},r=e&&e.authority,s=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,i,r,s)):(this.logger.verbose("asyncPopup set to false, opening popup"),i.popup=this.openSizedPopup("about:blank",i),this.logoutPopupAsync(t,i,r,s))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var s;this.logger.verbose("acquireTokenPopupAsync called");const i=this.initializeServerTelemetryManager(rc.acquireTokenPopup),r=await Pi(this.initializeAuthorizationRequest.bind(this),Gt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Zr.Popup);FZe(r.authority);try{const o=await Pi(this.initializeAuthorizationCodeRequest.bind(this),Gt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(r),a=await Pi(this.createAuthCodeClient.bind(this),Gt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),l=Sy.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let c;l&&(c=this.performanceClient.startMeasurement(Gt.FetchAccountIdWithNativeBroker,e.correlationId));const u=await a.getAuthCodeUrl({...r,nativeBroker:l}),d=new gSe(a,this.browserStorage,o,this.logger,this.performanceClient),f=this.initiateAuthRequest(u,t);this.eventHandler.emitEvent(Es.POPUP_OPENED,Zr.Popup,{popupWindow:f},null);const p=await this.monitorPopupForHash(f,t.popupWindowParent),g=TA(WZe,Gt.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(p,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(hy.removeThrottle(this.browserStorage,this.config.auth.clientId,o),g.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),c&&c.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw wr(b9);const _=new wP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rc.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,g.accountId,this.nativeStorage,r.correlationId),{userRequestState:v}=Eb.parseRequestState(this.browserCrypto,r.state);return await _.acquireToken({...r,state:v,prompt:void 0})}return await d.handleCodeResponse(g,r)}catch(o){throw(s=t.popup)==null||s.close(),o instanceof dc&&(o.setCorrelationId(this.correlationId),i.cacheFailedRequest(o)),o}}async logoutPopupAsync(e,t,i,r){var o,a,l,c;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(Es.LOGOUT_START,Zr.Popup,e);const s=this.initializeServerTelemetryManager(rc.logoutPopup);try{await this.clearCacheOnLogout(e.account);const u=await Pi(this.createAuthCodeClient.bind(this),Gt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:s,requestAuthority:i,account:e.account||void 0});try{u.authority.endSessionEndpoint}catch{if((o=e.account)!=null&&o.homeAccountId&&e.postLogoutRedirectUri&&u.authority.protocolMode===aw.OIDC){if(this.browserStorage.removeAccount((a=e.account)==null?void 0:a.homeAccountId),this.eventHandler.emitEvent(Es.LOGOUT_SUCCESS,Zr.Popup,e),r){const p={apiId:rc.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},g=sa.getAbsoluteUrl(r,BC());await this.navigationClient.navigateInternal(g,p)}(l=t.popup)==null||l.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(Es.LOGOUT_SUCCESS,Zr.Popup,e);const f=this.openPopup(d,t);if(this.eventHandler.emitEvent(Es.POPUP_OPENED,Zr.Popup,{popupWindow:f},null),await this.monitorPopupForHash(f,t.popupWindowParent).catch(()=>{}),r){const p={apiId:rc.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},g=sa.getAbsoluteUrl(r,BC());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,p)}else this.logger.verbose("No main window navigation requested")}catch(u){throw(c=t.popup)==null||c.close(),u instanceof dc&&(u.setCorrelationId(this.correlationId),s.cacheFailedRequest(u)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(Es.LOGOUT_FAILURE,Zr.Popup,null,u),this.eventHandler.emitEvent(Es.LOGOUT_END,Zr.Popup),u}this.eventHandler.emitEvent(Es.LOGOUT_END,Zr.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"),wr(GJ)}monitorPopupForHash(e,t){return new Promise((i,r)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const s=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(s),r(wr(TL));return}let o="";try{o=e.location.href}catch{}if(!o||o==="about:blank")return;clearInterval(s);let a="";const l=this.config.auth.OIDCOptions.serverResponseType;e&&(l===v9.QUERY?a=e.location.search:a=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),i(a)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}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)),!i)throw wr(aZe);return i.focus&&i.focus(),this.currentWindow=i,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),i}catch(i){throw this.logger.error("error opening popup "+i.message),this.browserStorage.setInteractionInProgress(!1),wr(oZe)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:i,popupWindowParent:r}){var p,g,m,_;const s=r.screenLeft?r.screenLeft:r.screenX,o=r.screenTop?r.screenTop:r.screenY,a=r.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=r.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let c=(p=i.popupSize)==null?void 0:p.width,u=(g=i.popupSize)==null?void 0:g.height,d=(m=i.popupPosition)==null?void 0:m.top,f=(_=i.popupPosition)==null?void 0:_.left;return(!c||c<0||c>a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),c=rm.POPUP_WIDTH),(!u||u<0||u>l)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),u=rm.POPUP_HEIGHT),(!d||d<0||d>l)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),d=Math.max(0,l/2-rm.POPUP_HEIGHT/2+o)),(!f||f<0||f>a)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),f=Math.max(0,a/2-rm.POPUP_WIDTH/2+s)),r.open(e,t,`width=${c}, height=${u}, top=${d}, left=${f}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(Zr.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${rm.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${rm.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class g3e{constructor(e,t,i,r,s){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=r,this.performanceClient=s}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(rl.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(rl.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const i={apiId:rc.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"),wr(GJ)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const i=this.browserStorage.generateStateKey(t),r=this.browserStorage.getTemporaryCache(i);if(!r)throw ui(Vq,"Cached State");let s;try{s=this.authModule.handleFragmentResponse(e,r)}catch(c){throw c instanceof VE&&c.subError===TL?wr(TL):c}const o=this.browserStorage.generateNonceKey(r),a=this.browserStorage.getTemporaryCache(o);if(this.authCodeRequest.code=s.code,s.cloud_instance_host_name&&await Pi(this.authModule.updateAuthority.bind(this.authModule),Gt.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(s.cloud_instance_host_name,this.authCodeRequest.correlationId),s.nonce=a||void 0,s.state=r,s.client_info)this.authCodeRequest.clientInfo=s.client_info;else{const c=this.checkCcsCredentials();c&&(this.authCodeRequest.ccsCredential=c)}const l=await this.authModule.acquireToken(this.authCodeRequest,s);return this.browserStorage.cleanRequestByState(t),l}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(rl.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.28.1 2025-01-14 */function IXt(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class LXt extends C4{constructor(e,t,i,r,s,o,a,l,c,u){super(e,t,i,r,s,o,a,c,u),this.nativeStorage=l}async acquireToken(e){const t=await Pi(this.initializeAuthorizationRequest.bind(this),Gt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Zr.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const i=this.initializeServerTelemetryManager(rc.acquireTokenRedirect),r=s=>{s.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(Es.RESTORE_FROM_BFCACHE,Zr.Redirect))};try{const s=await Pi(this.initializeAuthorizationCodeRequest.bind(this),Gt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),o=await Pi(this.createAuthCodeClient.bind(this),Gt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),a=new g3e(o,this.browserStorage,s,this.logger,this.performanceClient),l=await o.getAuthCodeUrl({...t,nativeBroker:Sy.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||this.config.auth.onRedirectNavigate})}catch(s){throw s instanceof dc&&(s.setCorrelationId(this.correlationId),i.cacheFailedRequest(s)),window.removeEventListener("pageshow",r),this.browserStorage.cleanRequestByState(t.state),s}}async handleRedirectPromise(e="",t){const i=this.initializeServerTelemetryManager(rc.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[r,s]=this.getRedirectResponse(e||"");if(!r)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(Zr.Redirect),IXt()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const o=this.browserStorage.getTemporaryCache(rl.ORIGIN_URI,!0)||wn.EMPTY_STRING,a=sa.removeHashFromUrl(o),l=sa.removeHashFromUrl(window.location.href);if(a===l&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),o.indexOf("#")>-1&&MQt(o),await this.handleResponse(r,i);if(this.config.auth.navigateToLoginRequestUrl){if(!dSe()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(rl.URL_HASH,s,!0);const c={apiId:rc.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let u=!0;if(!o||o==="null"){const d=FQt();this.browserStorage.setTemporaryCache(rl.ORIGIN_URI,d,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),u=await this.navigationClient.navigateInternal(d,c)}else this.logger.verbose(`Navigating to loginRequestUrl: ${o}`),u=await this.navigationClient.navigateInternal(o,c);if(!u)return await this.handleResponse(r,i)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(r,i);return null}catch(r){throw r instanceof dc&&(r.setCorrelationId(this.correlationId),i.cacheFailedRequest(r)),this.browserStorage.cleanRequestByInteractionType(Zr.Redirect),r}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===v9.QUERY?t=window.location.search:t=window.location.hash);let i=qq(t);if(i){try{kXt(i,this.browserCrypto,Zr.Redirect)}catch(s){return s instanceof dc&&this.logger.error(`Interaction type validation failed due to ${s.errorCode}: ${s.errorMessage}`),[null,""]}return OQt(window),this.logger.verbose("Hash contains known properties, returning response hash"),[i,t]}const r=this.browserStorage.getTemporaryCache(rl.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(rl.URL_HASH)),r&&(i=qq(r),i)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[i,r]):[null,""]}async handleResponse(e,t){const i=e.state;if(!i)throw wr(nSe);const r=this.browserStorage.getCachedRequest(i);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw wr(b9);const l=new wP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rc.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,r.correlationId),{userRequestState:c}=Eb.parseRequestState(this.browserCrypto,i);return l.acquireToken({...r,state:c,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(i)})}const s=this.browserStorage.getCachedAuthority(i);if(!s)throw wr(iSe);const o=await Pi(this.createAuthCodeClient.bind(this),Gt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:s});return hy.removeThrottle(this.browserStorage,this.config.auth.clientId,r),new g3e(o,this.browserStorage,r,this.logger,this.performanceClient).handleCodeResponse(e,i)}async logout(e){var r,s;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),i=this.initializeServerTelemetryManager(rc.logout);try{this.eventHandler.emitEvent(Es.LOGOUT_START,Zr.Redirect,e),await this.clearCacheOnLogout(t.account);const o={apiId:rc.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await Pi(this.createAuthCodeClient.bind(this),Gt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(a.authority.protocolMode===aw.OIDC)try{a.authority.endSessionEndpoint}catch{if((r=t.account)!=null&&r.homeAccountId){this.browserStorage.removeAccount((s=t.account)==null?void 0:s.homeAccountId),this.eventHandler.emitEvent(Es.LOGOUT_SUCCESS,Zr.Redirect,t);return}}const l=a.getLogoutUri(t);if(this.eventHandler.emitEvent(Es.LOGOUT_SUCCESS,Zr.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,o);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,o);return}}catch(o){throw o instanceof dc&&(o.setCorrelationId(this.correlationId),i.cacheFailedRequest(o)),this.eventHandler.emitEvent(Es.LOGOUT_FAILURE,Zr.Redirect,null,o),this.eventHandler.emitEvent(Es.LOGOUT_END,Zr.Redirect),o}this.eventHandler.emitEvent(Es.LOGOUT_END,Zr.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return sa.getAbsoluteUrl(t,BC())}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function AXt(n,e,t,i,r){if(e.addQueueMeasurement(Gt.SilentHandlerInitiateAuthRequest,i),!n)throw t.info("Navigate url is empty"),wr(GJ);return r?Pi(DXt,Gt.SilentHandlerLoadFrame,t,e,i)(n,r,e,i):TA(RXt,Gt.SilentHandlerLoadFrameSync,t,e,i)(n)}async function NXt(n,e,t,i,r,s,o){return i.addQueueMeasurement(Gt.SilentHandlerMonitorIframeForHash,s),new Promise((a,l)=>{e<upe&&r.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${upe}ms). This may result in timeouts.`);const c=window.setTimeout(()=>{window.clearInterval(u),l(wr(lZe))},e),u=window.setInterval(()=>{let d="";const f=n.contentWindow;try{d=f?f.location.href:""}catch{}if(!d||d==="about:blank")return;let p="";f&&(o===v9.QUERY?p=f.location.search:p=f.location.hash),window.clearTimeout(c),window.clearInterval(u),a(p)},t)}).finally(()=>{TA(PXt,Gt.RemoveHiddenIframe,r,i,s)(n)})}function DXt(n,e,t,i){return t.addQueueMeasurement(Gt.SilentHandlerLoadFrame,i),new Promise((r,s)=>{const o=zZe();window.setTimeout(()=>{if(!o){s("Unable to load iframe");return}o.src=n,r(o)},e)})}function RXt(n){const e=zZe();return e.src=n,e}function zZe(){const n=document.createElement("iframe");return n.className="msalSilentIframe",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.body.appendChild(n),n}function PXt(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class OXt extends C4{constructor(e,t,i,r,s,o,a,l,c,u,d){super(e,t,i,r,s,o,l,u,d),this.apiId=a,this.nativeStorage=c}async acquireToken(e){this.performanceClient.addQueueMeasurement(Gt.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.");const t={...e};t.prompt?t.prompt!==Wd.NONE&&t.prompt!==Wd.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${Wd.NONE}`),t.prompt=Wd.NONE):t.prompt=Wd.NONE;const i=await Pi(this.initializeAuthorizationRequest.bind(this),Gt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,Zr.Silent);FZe(i.authority);const r=this.initializeServerTelemetryManager(this.apiId);let s;try{return s=await Pi(this.createAuthCodeClient.bind(this),Gt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:i.authority,requestAzureCloudOptions:i.azureCloudOptions,requestExtraQueryParameters:i.extraQueryParameters,account:i.account}),await Pi(this.silentTokenHelper.bind(this),Gt.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(s,i)}catch(o){if(o instanceof dc&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),!s||!(o instanceof dc)||o.errorCode!==rm.INVALID_GRANT_ERROR)throw o;this.performanceClient.addFields({retryError:o.errorCode},this.correlationId);const a=await Pi(this.initializeAuthorizationRequest.bind(this),Gt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,Zr.Silent);return await Pi(this.silentTokenHelper.bind(this),Gt.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(s,a)}}logout(){return Promise.reject(wr(YJ))}async silentTokenHelper(e,t){const i=t.correlationId;this.performanceClient.addQueueMeasurement(Gt.SilentIframeClientTokenHelper,i);const r=await Pi(this.initializeAuthorizationCodeRequest.bind(this),Gt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,i)(t),s=await Pi(e.getAuthCodeUrl.bind(e),Gt.GetAuthCodeUrl,this.logger,this.performanceClient,i)({...t,nativeBroker:Sy.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),o=new gSe(e,this.browserStorage,r,this.logger,this.performanceClient),a=await Pi(AXt,Gt.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,i)(s,this.performanceClient,this.logger,i,this.config.system.navigateFrameWait),l=this.config.auth.OIDCOptions.serverResponseType,c=await Pi(NXt,Gt.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,i)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,i,l),u=TA(WZe,Gt.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(c,l,this.logger);if(u.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw wr(b9);const d=new wP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,u.accountId,this.browserStorage,i),{userRequestState:f}=Eb.parseRequestState(this.browserCrypto,t.state);return Pi(d.acquireToken.bind(d),Gt.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,i)({...t,state:f,prompt:t.prompt||Wd.NONE})}return Pi(o.handleCodeResponse.bind(o),Gt.HandleCodeResponse,this.logger,this.performanceClient,i)(u,t)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class MXt extends C4{async acquireToken(e){this.performanceClient.addQueueMeasurement(Gt.SilentRefreshClientAcquireToken,e.correlationId);const t=await Pi(pSe,Gt.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),i={...e,...t};e.redirectUri&&(i.redirectUri=this.getRedirectUri(e.redirectUri));const r=this.initializeServerTelemetryManager(rc.acquireTokenSilent_silentFlow),s=await this.createRefreshTokenClient({serverTelemetryManager:r,authorityUrl:i.authority,azureCloudOptions:i.azureCloudOptions,account:i.account});return Pi(s.acquireTokenByRefreshToken.bind(s),Gt.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(i).catch(o=>{throw o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o),o})}logout(){return Promise.reject(wr(YJ))}async createRefreshTokenClient(e){const t=await Pi(this.getClientConfiguration.bind(this),Gt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new ope(t,this.performanceClient)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class jXt{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.isBrowserEnvironment)throw wr(QJ);const r=t.id_token?kA(t.id_token,Ry):void 0,s={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},o=e.authority?new Jh(Jh.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||Sw()):void 0,a=this.loadAccount(e,i.clientInfo||t.client_info||"",r,o),l=this.loadIdToken(t,a.homeAccountId,a.environment,a.realm),c=this.loadAccessToken(e,t,a.homeAccountId,a.environment,a.realm,i),u=this.loadRefreshToken(t,a.homeAccountId,a.environment);return this.generateAuthenticationResult(e,{account:a,idToken:l,accessToken:c,refreshToken:u},r,o)}loadAccount(e,t,i,r){if(this.logger.verbose("TokenCache - loading account"),e.account){const l=ld.createFromAccountInfo(e.account);return this.storage.setAccount(l),l}else if(!r||!t&&!i)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),wr(_Ze);const s=ld.generateHomeAccountId(t,r.authorityType,this.logger,this.cryptoObj,i),o=i==null?void 0:i.tid,a=Zxe(this.storage,r,s,Ry,i,t,r.hostnameAndPort,o,void 0,void 0,this.logger);return this.storage.setAccount(a),a}loadIdToken(e,t,i,r){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=VJ(t,i,e.id_token,this.config.auth.clientId,r);return this.storage.setIdTokenCredential(s),s}loadAccessToken(e,t,i,r,s,o){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const a=t.scope?uu.fromString(t.scope):new uu(e.scopes),l=o.expiresOn||t.expires_in+new Date().getTime()/1e3,c=o.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,u=WJ(i,r,t.access_token,this.config.auth.clientId,s,a.printScopes(),l,c,Ry);return this.storage.setAccessTokenCredential(u),u}loadRefreshToken(e,t,i){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const r=EXe(t,i,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(r),r}generateAuthenticationResult(e,t,i,r){var u,d,f;let s="",o=[],a=null,l;t!=null&&t.accessToken&&(s=t.accessToken.secret,o=uu.fromString(t.accessToken.target).asArray(),a=new Date(Number(t.accessToken.expiresOn)*1e3),l=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const c=t.account;return{authority:r?r.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:o,account:c.getAccountInfo(),idToken:((u=t.idToken)==null?void 0:u.secret)||"",idTokenClaims:i||{},accessToken:s,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:l,familyId:((d=t.refreshToken)==null?void 0:d.familyId)||"",tokenType:((f=t==null?void 0:t.accessToken)==null?void 0:f.tokenType)||"",state:e.state||"",cloudGraphHostName:c.cloudGraphHostName||"",msGraphHost:c.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class FXt extends XXe{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class BXt extends C4{constructor(e,t,i,r,s,o,a,l,c,u){super(e,t,i,r,s,o,l,c,u),this.apiId=a}async acquireToken(e){if(!e.code)throw wr(vZe);const t=await Pi(this.initializeAuthorizationRequest.bind(this),Gt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,Zr.Silent),i=this.initializeServerTelemetryManager(this.apiId);try{const r={...t,code:e.code},s=await Pi(this.getClientConfiguration.bind(this),Gt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:i,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),o=new FXt(s);this.logger.verbose("Auth code client created");const a=new gSe(o,this.browserStorage,r,this.logger,this.performanceClient);return await Pi(a.handleCodeResponseFromServer.bind(a),Gt.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 dc&&(r.setCorrelationId(this.correlationId),i.cacheFailedRequest(r)),r}}logout(){return Promise.reject(wr(YJ))}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function T0(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function fV(n,e){try{hSe(n)}catch(t){throw e.end({success:!1},t),t}}class JJ{constructor(e){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 $O(this.logger,this.performanceClient):Wq,this.eventHandler=new dXt(this.logger),this.browserStorage=this.isBrowserEnvironment?new hpe(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,XYt(this.config.auth),this.performanceClient):iXt(this.config.auth.clientId,this.logger);const t={cacheLocation:Kp.MemoryStorage,temporaryCacheLocation:Kp.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new hpe(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new jXt(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const i=new JJ(e);return await i.initialize(t),i}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(Es.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),i=this.config.system.allowNativeBroker,r=this.performanceClient.startMeasurement(Gt.InitializeClientApplication,t);if(this.eventHandler.emitEvent(Es.INITIALIZE_START),i)try{this.nativeExtensionProvider=await Sy.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(s){this.logger.verbose(s)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await Pi(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),Gt.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(Es.INITIALIZE_END),r.end({allowNativeBroker:i,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),jZe(this.initialized),this.isBrowserEnvironment){const t=e||"";let i=this.redirectResponse.get(t);return typeof i>"u"?(i=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,i),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),i}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),i=this.browserStorage.getCachedNativeRequest(),r=i&&Sy.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,s=r?i==null?void 0:i.correlationId:this.browserStorage.getTemporaryCache(rl.CORRELATION_ID,!0)||"",o=this.performanceClient.startMeasurement(Gt.AcquireTokenRedirect,s);this.eventHandler.emitEvent(Es.HANDLE_REDIRECT_START,Zr.Redirect);let a;if(r&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const l=new wP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rc.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,i.accountId,this.nativeInternalStorage,i.correlationId);a=Pi(l.handleRedirectPromise.bind(l),Gt.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,o.event.correlationId)(this.performanceClient,o.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const l=this.createRedirectClient(s);a=Pi(l.handleRedirectPromise.bind(l),Gt.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,o.event.correlationId)(e,o)}return a.then(l=>(l?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(Es.LOGIN_SUCCESS,Zr.Redirect,l),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_SUCCESS,Zr.Redirect,l),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),o.end({success:!0,accountType:T0(l.account)})):o.event.errorCode?o.end({success:!1}):o.discard(),this.eventHandler.emitEvent(Es.HANDLE_REDIRECT_END,Zr.Redirect),l)).catch(l=>{const c=l;throw t.length>0?this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_FAILURE,Zr.Redirect,null,c):this.eventHandler.emitEvent(Es.LOGIN_FAILURE,Zr.Redirect,null,c),this.eventHandler.emitEvent(Es.HANDLE_REDIRECT_END,Zr.Redirect),o.end({success:!1},c),l})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const i=this.performanceClient.startMeasurement(Gt.AcquireTokenPreRedirect,t);i.add({accountType:T0(e.account),scenarioId:e.scenarioId});const r=e.onRedirectNavigate;if(r)e.onRedirectNavigate=o=>{const a=typeof r=="function"?r(o):void 0;return a!==!1?i.end({success:!0}):i.discard(),a};else{const o=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=a=>{const l=typeof o=="function"?o(a):void 0;return l!==!1?i.end({success:!0}):i.discard(),l}}const s=this.getAllAccounts().length>0;try{d3e(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),s?this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_START,Zr.Redirect,e):this.eventHandler.emitEvent(Es.LOGIN_START,Zr.Redirect,e);let o;return this.nativeExtensionProvider&&this.canUseNative(e)?o=new wP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rc.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,i).catch(l=>{if(l instanceof fy&&nR(l))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(l instanceof Ob)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),l}):o=this.createRedirectClient(t).acquireToken(e),await o}catch(o){throw i.end({success:!1},o),s?this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_FAILURE,Zr.Redirect,null,o):this.eventHandler.emitEvent(Es.LOGIN_FAILURE,Zr.Redirect,null,o),o}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(Gt.AcquireTokenPopup,t);i.add({scenarioId:e.scenarioId,accountType:T0(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),fV(this.initialized,i),this.browserStorage.setInteractionInProgress(!0)}catch(o){return Promise.reject(o)}const r=this.getAllAccounts();r.length>0?this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_START,Zr.Popup,e):this.eventHandler.emitEvent(Es.LOGIN_START,Zr.Popup,e);let s;return this.canUseNative(e)?s=this.acquireTokenNative({...e,correlationId:t},rc.acquireTokenPopup).then(o=>(this.browserStorage.setInteractionInProgress(!1),i.end({success:!0,isNativeBroker:!0,accountType:T0(o.account)}),o)).catch(o=>{if(o instanceof fy&&nR(o))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(o instanceof Ob)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),o}):s=this.createPopupClient(t).acquireToken(e),s.then(o=>(r.length<this.getAllAccounts().length?this.eventHandler.emitEvent(Es.LOGIN_SUCCESS,Zr.Popup,o):this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_SUCCESS,Zr.Popup,o),i.end({success:!0,accessTokenSize:o.accessToken.length,idTokenSize:o.idToken.length,accountType:T0(o.account)}),o)).catch(o=>(r.length>0?this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_FAILURE,Zr.Popup,null,o):this.eventHandler.emitEvent(Es.LOGIN_FAILURE,Zr.Popup,null,o),i.end({success:!1},o),Promise.reject(o)))}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 s,o;const t=this.getRequestCorrelationId(e),i={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(Gt.SsoSilent,t),(s=this.ssoSilentMeasurement)==null||s.add({scenarioId:e.scenarioId,accountType:T0(e.account)}),fV(this.initialized,this.ssoSilentMeasurement),(o=this.ssoSilentMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(Es.SSO_SILENT_START,Zr.Silent,i);let r;return this.canUseNative(i)?r=this.acquireTokenNative(i,rc.ssoSilent).catch(a=>{if(a instanceof fy&&nR(a))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(i.correlationId).acquireToken(i);throw a}):r=this.createSilentIframeClient(i.correlationId).acquireToken(i),r.then(a=>{var l;return this.eventHandler.emitEvent(Es.SSO_SILENT_SUCCESS,Zr.Silent,a),(l=this.ssoSilentMeasurement)==null||l.end({success:!0,isNativeBroker:a.fromNativeBroker,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length,accountType:T0(a.account)}),a}).catch(a=>{var l;throw this.eventHandler.emitEvent(Es.SSO_SILENT_FAILURE,Zr.Silent,null,a),(l=this.ssoSilentMeasurement)==null||l.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const i=this.performanceClient.startMeasurement(Gt.AcquireTokenByCode,t);fV(this.initialized,i),this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_BY_CODE_START,Zr.Silent,e),i.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw wr(yZe);if(e.code){const r=e.code;let s=this.hybridAuthCodeResponses.get(r);return s?(this.logger.verbose("Existing acquireTokenByCode request found",t),i.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),s=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(o=>(this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_BY_CODE_SUCCESS,Zr.Silent,o),this.hybridAuthCodeResponses.delete(r),i.end({success:!0,isNativeBroker:o.fromNativeBroker,accessTokenSize:o.accessToken.length,idTokenSize:o.idToken.length,accountType:T0(o.account)}),o)).catch(o=>{throw this.hybridAuthCodeResponses.delete(r),this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_BY_CODE_FAILURE,Zr.Silent,null,o),i.end({success:!1},o),o}),this.hybridAuthCodeResponses.set(r,s)),await s}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const r=await this.acquireTokenNative({...e,correlationId:t},rc.acquireTokenByCode,e.nativeAccountId).catch(s=>{throw s instanceof fy&&nR(s)&&(this.nativeExtensionProvider=void 0),s});return i.end({accountType:T0(r.account),success:!0}),r}else throw wr(CZe);else throw wr(bZe)}catch(r){throw this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_BY_CODE_FAILURE,Zr.Silent,null,r),i.end({success:!1},r),r}}async acquireTokenByCodeAsync(e){var r;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(Gt.AcquireTokenByCodeAsync,e.correlationId),(r=this.acquireTokenByCodeAsyncMeasurement)==null||r.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(s=>{var o;return(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.end({success:!0,fromCache:s.fromCache,isNativeBroker:s.fromNativeBroker}),s}).catch(s=>{var o;throw(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.end({success:!1},s),s}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(Gt.AcquireTokenFromCache,e.correlationId),t){case em.Default:case em.AccessToken:case em.AccessTokenAndRefreshToken:const i=this.createSilentCacheClient(e.correlationId);return Pi(i.acquireToken.bind(i),Gt.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw ui(FC)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(Gt.AcquireTokenByRefreshToken,e.correlationId),t){case em.Default:case em.AccessTokenAndRefreshToken:case em.RefreshToken:case em.RefreshTokenAndNetwork:const i=this.createSilentRefreshClient(e.correlationId);return Pi(i.acquireToken.bind(i),Gt.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw ui(FC)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(Gt.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return Pi(t.acquireToken.bind(t),Gt.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 d3e(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return hSe(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return rXt(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return sXt(e,this.logger,this.browserStorage)}getAccountByUsername(e){return oXt(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return aXt(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return lXt(e,this.logger,this.browserStorage)}setActiveAccount(e){cXt(e,this.browserStorage)}getActiveAccount(){return uXt(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const i=ld.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)}async acquireTokenNative(e,t,i){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw wr(b9);return new wP(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"),!Sy.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 Wd.NONE:case Wd.CONSENT:case Wd.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.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new TXt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new LXt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new OXt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rc.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new VZe(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new MXt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new BXt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,rc.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return MZe(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}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."))}handleAccountCacheChange(e){var t;try{(t=e.key)!=null&&t.includes(Ad.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(Es.ACTIVE_ACCOUNT_CHANGED);const i=e.newValue||e.oldValue;if(!i)return;const r=JSON.parse(i);if(typeof r!="object"||!ld.isAccountEntity(r))return;const o=FO.toObject(new ld,r).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(Es.ACCOUNT_ADDED,void 0,o)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(Es.ACCOUNT_REMOVED,void 0,o))}catch{return}}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}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?Sw():wn.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||l3e})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||l3e})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(Gt.AcquireTokenSilent,t);i.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),fV(this.initialized,i),this.logger.verbose("acquireTokenSilent called",t);const r=e.account||this.getActiveAccount();if(!r)throw wr(hZe);i.add({accountType:T0(r)});const s={clientId:this.config.auth.clientId,authority:e.authority||wn.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,shrOptions:e.shrOptions},o=JSON.stringify(s),a=this.activeSilentTokenRequests.get(o);if(typeof a>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const l=Pi(this.acquireTokenSilentAsync.bind(this),Gt.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},r).then(c=>(this.activeSilentTokenRequests.delete(o),i.end({success:!0,fromCache:c.fromCache,isNativeBroker:c.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),c)).catch(c=>{throw this.activeSilentTokenRequests.delete(o),i.end({success:!1},c),c});return this.activeSilentTokenRequests.set(o,l),{...await l,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),i.discard(),{...await a,state:e.state}}async acquireTokenSilentAsync(e,t){const i=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(Gt.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_START,Zr.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",i);const r=await Pi(mXt,Gt.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),s=e.cacheLookupPolicy||em.Default;return this.acquireTokenSilentNoIframe(r,s).catch(async a=>{if($Xt(a,s))if(this.activeIframeRequest)if(s!==em.Skip){const[c,u]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${u}`,r.correlationId);const d=this.performanceClient.startMeasurement(Gt.AwaitConcurrentIframe,r.correlationId);d.add({awaitIframeCorrelationId:u});const f=await c;if(d.end({success:f}),f)return this.logger.verbose(`Parallel iframe request with correlationId: ${u} succeeded. Retrying cache and/or RT redemption`,r.correlationId),this.acquireTokenSilentNoIframe(r,s);throw this.logger.info(`Iframe request with correlationId: ${u} failed. Interaction is required.`),a}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",r.correlationId),Pi(this.acquireTokenBySilentIframe.bind(this),Gt.AcquireTokenBySilentIframe,this.logger,this.performanceClient,r.correlationId)(r);else{let c;return this.activeIframeRequest=[new Promise(u=>{c=u}),r.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",r.correlationId),Pi(this.acquireTokenBySilentIframe.bind(this),Gt.AcquireTokenBySilentIframe,this.logger,this.performanceClient,r.correlationId)(r).then(u=>(c(!0),u)).catch(u=>{throw c(!1),u}).finally(()=>{this.activeIframeRequest=void 0})}else throw a}).then(a=>(this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_SUCCESS,Zr.Silent,a),e.correlationId&&this.performanceClient.addFields({fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker},e.correlationId),a)).catch(a=>{throw this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_FAILURE,Zr.Silent,null,a),a}).finally(()=>{document.removeEventListener("visibilitychange",i)})}async acquireTokenSilentNoIframe(e,t){return Sy.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,rc.acquireTokenSilent_silentFlow).catch(async i=>{throw i instanceof fy&&nR(i)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,ui(FC)):i})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),Pi(this.acquireTokenFromCache.bind(this),Gt.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(i=>{if(t===em.AccessToken)throw i;return this.eventHandler.emitEvent(Es.ACQUIRE_TOKEN_NETWORK_START,Zr.Silent,e),Pi(this.acquireTokenByRefreshToken.bind(this),Gt.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function $Xt(n,e){const t=!(n instanceof Ob&&n.subError!==KJ),i=n.errorCode===rm.INVALID_GRANT_ERROR||n.errorCode===FC,r=t&&i||n.errorCode===Gq||n.errorCode===Xxe,s=CQt.includes(e);return r&&s}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function HXt(n,e){const t=new IL(n);return await t.initialize(),JJ.createController(t,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class mSe{static async createPublicClientApplication(e){const t=await HXt(e);return new mSe(e,t)}constructor(e,t){this.controller=t||new JJ(new IL(e))}async initialize(e){return this.controller.initialize(e)}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,t){return this.controller.addEventCallback(e,t)}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)}}var Hae={},j5={},F5={},m3e;function UZe(){if(m3e)return F5;m3e=1,Object.defineProperty(F5,"__esModule",{value:!0}),F5.default=void 0;var n=dv();function e(i){(0,n.useEffect)(function(){if(i){var r=document.querySelectorAll('script[src="'.concat(i,'"]'))[0];r||(r=document.createElement("script"),r.src=i,r.async=!0,document.body.appendChild(r))}},[i])}var t=e;return F5.default=t,F5}var B5={},$5={},_3e;function VXt(){if(_3e)return $5;_3e=1,Object.defineProperty($5,"__esModule",{value:!0}),$5.default=void 0;var n=function t(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{pollFrequency:1e3,retries:100,parent:window},s=r.pollFrequency,o=s===void 0?1e3:s,a=r.retries,l=a===void 0?100:a,c=r.parent,u=c===void 0?window:c;if(u&&u.hasOwnProperty(i))return Promise.resolve(u[i]);if(!l)return Promise.resolve(void 0);var d=l-1;return new Promise(function(f){return setTimeout(f,typeof o=="function"?o({retries:d}):o)}).then(function(){return t(i,{pollFrequency:o,parent:u,retries:d})})},e=n;return $5.default=e,$5}var v3e;function qZe(){if(v3e)return B5;v3e=1,Object.defineProperty(B5,"__esModule",{value:!0}),B5.default=void 0;var n=e(VXt());function e(s){return s&&s.__esModule?s:{default:s}}var t="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",i=function(o){var a=o.authOptions,l=o.onSuccess,c=o.onError;return(0,n.default)("AppleID").then(function(){return window.AppleID||console.error(new Error("Error loading apple script")),window.AppleID.auth.init(a),window.AppleID.auth.signIn().then(function(u){return l&&l(u),u}).catch(function(u){return c?c(u):console.error(u),null})}).catch(function(u){return c?c(u):console.error(u),null})},r={APPLE_SCRIPT_SRC:t,signIn:i};return B5.default=r,B5}var b3e;function WXt(){if(b3e)return j5;b3e=1,Object.defineProperty(j5,"__esModule",{value:!0}),j5.default=void 0;var n=r(dv()),e=r(UZe()),t=r(qZe()),i=["onSuccess","onError","skipScript","authOptions","iconProps","render","uiType","className","noDefaultStyle","buttonExtraChildren"];function r(g){return g&&g.__esModule?g:{default:g}}function s(){return s=Object.assign||function(g){for(var m=1;m<arguments.length;m++){var _=arguments[m];for(var v in _)Object.prototype.hasOwnProperty.call(_,v)&&(g[v]=_[v])}return g},s.apply(this,arguments)}function o(g,m){var _=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);m&&(v=v.filter(function(b){return Object.getOwnPropertyDescriptor(g,b).enumerable})),_.push.apply(_,v)}return _}function a(g){for(var m=1;m<arguments.length;m++){var _=arguments[m]!=null?arguments[m]:{};m%2?o(Object(_),!0).forEach(function(v){l(g,v,_[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(_)):o(Object(_)).forEach(function(v){Object.defineProperty(g,v,Object.getOwnPropertyDescriptor(_,v))})}return g}function l(g,m,_){return m in g?Object.defineProperty(g,m,{value:_,enumerable:!0,configurable:!0,writable:!0}):g[m]=_,g}function c(g,m){if(g==null)return{};var _=u(g,m),v,b;if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(g);for(b=0;b<y.length;b++)v=y[b],!(m.indexOf(v)>=0)&&Object.prototype.propertyIsEnumerable.call(g,v)&&(_[v]=g[v])}return _}function u(g,m){if(g==null)return{};var _={},v=Object.keys(g),b,y;for(y=0;y<v.length;y++)b=v[y],!(m.indexOf(b)>=0)&&(_[b]=g[b]);return _}var d=` .react-apple-signin-auth-btn { background-color: transparent; border: none; padding: 0; cursor: pointer; border-radius: 4px; padding: 0 8px 0 2px; font-size: 14px; font-size: 1em; line-height: 1; border: 1px solid #000; overflow: hidden; display: inline-flex; justify-content: center; align-items: center; } .react-apple-signin-auth-btn-light { background-color: #FFF; color: #000; border-color: #000; } .react-apple-signin-auth-btn-dark { background-color: #000; color: #FFF; border-color: #FFF; }`.replace(/ {2}|\n/g,""),f=function(m){var _=m.onSuccess,v=m.onError,b=m.skipScript,y=b===void 0?!1:b,C=m.authOptions,S=m.iconProps,k=m.render,I=m.uiType,L=I===void 0?"dark":I,N=m.className,P=m.noDefaultStyle,O=P===void 0?!1:P,F=m.buttonExtraChildren,V=F===void 0?"Continue with Apple":F,M=c(m,i);(0,e.default)(y?null:t.default.APPLE_SCRIPT_SRC);var B=function(U){U&&(U.preventDefault(),U.stopPropagation()),t.default.signIn({authOptions:C,onSuccess:_,onError:v})},W=a({children:n.default.createElement(n.default.Fragment,null,n.default.createElement("svg",s({width:"24px",height:"44px",viewBox:"0 0 24 44"},S),n.default.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},n.default.createElement("rect",{fill:L==="light"?"#FFF":"#000",x:"0",y:"0",width:"24",height:"44"}),n.default.createElement("path",{d:"M12.2337427,16.9879688 C12.8896607,16.9879688 13.7118677,16.5445313 14.2014966,15.9532812 C14.6449341,15.4174609 14.968274,14.6691602 14.968274,13.9208594 C14.968274,13.8192383 14.9590357,13.7176172 14.9405591,13.6344727 C14.2107349,13.6621875 13.3330982,14.1241016 12.8065162,14.7430664 C12.3907935,15.2142188 12.012024,15.9532812 12.012024,16.7108203 C12.012024,16.8216797 12.0305005,16.9325391 12.0397388,16.9694922 C12.0859302,16.9787305 12.1598365,16.9879688 12.2337427,16.9879688 Z M9.92417241,28.1662891 C10.8202857,28.1662891 11.2175318,27.5658008 12.3353638,27.5658008 C13.4716724,27.5658008 13.721106,28.1478125 14.7188404,28.1478125 C15.6980982,28.1478125 16.3540162,27.2424609 16.972981,26.3555859 C17.6658521,25.339375 17.9522388,24.3416406 17.9707154,24.2954492 C17.9060474,24.2769727 16.0306763,23.5101953 16.0306763,21.3576758 C16.0306763,19.491543 17.5088013,18.6508594 17.5919459,18.5861914 C16.612688,17.1819727 15.1253248,17.1450195 14.7188404,17.1450195 C13.6194849,17.1450195 12.7233716,17.8101758 12.1598365,17.8101758 C11.5501099,17.8101758 10.7463794,17.1819727 9.79483648,17.1819727 C7.98413335,17.1819727 6.14571538,18.6785742 6.14571538,21.5054883 C6.14571538,23.2607617 6.8293482,25.1176563 7.67003179,26.3186328 C8.39061773,27.3348438 9.01882085,28.1662891 9.92417241,28.1662891 Z",fill:L==="light"?"#000":"#FFF",fillRule:"nonzero"}))),V),onClick:B},M);return k?k(W):n.default.createElement(n.default.Fragment,null,n.default.createElement("button",s({className:"".concat(O?"":"react-apple-signin-auth-btn react-apple-signin-auth-btn-".concat(L)).concat(N?" ".concat(N):""),type:"button","aria-label":"Signin with apple ID"},W)),O?null:n.default.createElement("style",null,d))},p=f;return j5.default=p,j5}var y3e;function zXt(){return y3e||(y3e=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"appleAuthHelpers",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(n,"useScript",{enumerable:!0,get:function(){return i.default}}),n.default=void 0;var e=r(WXt()),t=r(qZe()),i=r(UZe());function r(o){return o&&o.__esModule?o:{default:o}}var s=e.default;n.default=s}(Hae)),Hae}zXt();function UXt(n){return h.jsx("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 qXt(){const n=Fr(),e=s=>{localStorage.removeItem("X-CURRENT-INDEX");let o=0;const a=s.data.data,l=a[0].account.default_company_id;o=a.findIndex(c=>c.company.id===l)||0,n(HB({type:ZM.TOKEN,user:s.data.data[o].user,token:s.data.data[o].token.token})),n(s1(s.data.data)),n(zu("company")),n(SZ(o))},t=s=>{Je("POST",ze("/api/v1/oauth_login?provider=google&id_token=:token&create=true",{token:s})).then(o=>e(o))},i=s=>{Je("POST",ze("/api/v1/oauth_login?provider=microsoft"),{accessToken:s}).then(o=>e(o))},r=KZe();return h.jsx("div",{className:"grid grid-cols-3 text-sm mt-4",children:h.jsxs("div",{className:"col-span-3 flex flex-col items-center space-y-3",children:[h.jsx(iXe,{onSuccess:s=>s.credential&&t(s.credential),onError:()=>pe.error()}),h.jsxs(UXt,{onClick:async()=>{r&&(await r.handleRedirectPromise(),r.loginPopup({scopes:["user.read"]}).then(s=>i(s.accessToken)))},children:[h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 23 23",children:[h.jsx("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),h.jsx("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),h.jsx("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),h.jsx("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),h.jsx("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),h.jsx("p",{children:"Log in with Microsoft"})]}),null]})})}function KZe(){const n=typeof window<"u"?new mSe({auth:{clientId:""}}):null;return n&&n.initialize(),n}function KXt(){const[n]=xe(),e=Fr(),t=hv(),i=zi(),[r,s]=oo(GZe),[o,a]=x.useState(!1),l=()=>{a(!1),s("false")},c=()=>{const u=(t==null?void 0:t.oauth_provider_id)==="google";pe.processing(),Je("PUT",ze("/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(gk({object:"company",data:d.data.data})),e(zu("company")),pe.success("updated_settings"),l()})};return x.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]),h.jsxs(pr,{title:n("email_provider"),visible:o,onClose:l,children:[h.jsx("span",{className:"text-base font-medium",children:Ua("select_email_provider",{provider:(t==null?void 0:t.oauth_provider_id)==="google"?"Gmail":"Outlook"})}),h.jsx(dn,{className:"self-end",behavior:"button",type:"primary",onClick:c,children:n("yes")})]})}const GZe=jJ("connectMailer","false");function GXt(){const[n]=xe(),e=Ml(),t=ts(GZe),i=a=>{pe.processing(),window.location.href=ze("/auth/:mailer?react=true",{mailer:a}),t("true")},r=()=>{pe.processing(),Je("POST",ze("/api/v1/users/:id/disconnect_mailer",{id:e.id}),{}).then(a=>{ii(["users"]),pe.success(a.data.message),window.location.reload()}).finally(()=>t("false"))},s=()=>{pe.processing(),Je("POST",ze("/api/v1/users/:id/disconnect_oauth",{id:e.id})).then(a=>{ii(["users"]),pe.success(a.data.message),window.location.reload()}).finally(()=>t("false"))};return KZe()?h.jsxs(h.Fragment,{children:[h.jsx(KXt,{}),!(e!=null&&e.oauth_provider_id)&&To(),(e==null?void 0:e.oauth_provider_id)==="google"&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:"Google",children:h.jsx(dn,{type:"minimal",behavior:"button",onClick:s,children:n("disconnect_google")})}),!xDe()&&h.jsx(ne,{leftSide:"Gmail",children:e!=null&&e.oauth_user_token?h.jsx(dn,{type:"minimal",behavior:"button",onClick:r,children:n("disconnect_gmail")}):h.jsx(dn,{type:"minimal",behavior:"button",onClick:()=>i("google"),children:n("connect_gmail")})})]}),(e==null?void 0:e.oauth_provider_id)==="microsoft"&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:"Microsoft",children:h.jsx(dn,{type:"minimal",behavior:"button",onClick:s,children:n("disconnect_microsoft")})}),!xDe()&&h.jsx(ne,{leftSide:"Email",children:e!=null&&e.oauth_user_token?h.jsx(dn,{type:"minimal",behavior:"button",onClick:r,children:n("disconnect_email")}):h.jsx(dn,{type:"minimal",behavior:"button",onClick:()=>i("microsoft"),children:n("connect_email")})})]})]}):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 YZe(){const{isAdmin:n}=go();return!((Vy()||$u())&&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 YXt({size:n="1.2rem",color:e="#000",strokeWidth:t="2"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 20 20",children:[h.jsx("line",{x1:"10",y1:"3",x2:"10",y2:"17",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,"data-color":"color-2"}),h.jsx("polyline",{points:"5 12 10 17 15 12",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t})]})}var bS=(n=>(n.SingleLineText="single_line_text",n.MultiLineText="multi_line_text",n.Switch="switch",n.Dropdown="dropdown",n.Date="date",n))(bS||{});function Qf(n){const[e]=xe(),t=xt(),[i,r]=x.useState(""),[s,o]=x.useState(""),a=YZe(),[l,c]=x.useState("single_line_text"),u=["single_line_text","multi_line_text","switch","dropdown","date"],d=x.useRef(),f=x.useRef();x.useEffect(()=>{if(n.initialValue){const g=n.initialValue.split("|");n.initialValue.includes("|")?u.includes(g[1])?c(g[1]):(c("dropdown"),o(g[1])):c("multi_line_text"),r(g[0])}},[]);const p=g=>{var b,y,C;g&&c(g);const m=g||l,_=m==="dropdown"?(b=f.current)==null?void 0:b.value.split(",").map(S=>S.trim()).join(","):m,v=_==="multi_line_text"?`${((y=d.current)==null?void 0:y.value)||""}`:`${((C=d.current)==null?void 0:C.value)||""}|${_}`;n.onChange&&n.onChange(v,n.field,m)};return n.withArrowAsSeparator?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex flex-col sm:flex-row w-full space-y-3 sm:space-y-0 sm:space-x-3 items-center justify-between py-3 text-sm",children:[h.jsx("div",{className:"w-full sm:w-2/6",children:h.jsx(lt,{id:n.field,innerRef:d,placeholder:n.placeholder,onValueChange:()=>p(),value:i,disabled:a})}),h.jsx("div",{className:"hidden sm:inline-block",children:h.jsx(vS,{size:"1.2rem",color:t.$17,strokeWidth:"1.5"})}),h.jsx("div",{className:"inline-block sm:hidden",children:h.jsx(YXt,{size:"1.2rem",color:t.$17,strokeWidth:"1.5"})}),h.jsx("div",{className:"w-full sm:w-4/6",children:h.jsxs(Dn,{value:l,onValueChange:g=>p(g),dismissable:!1,customSelector:!0,children:[h.jsx("option",{value:"single_line_text",children:e("single_line_text")}),h.jsx("option",{value:"multi_line_text",children:e("multi_line_text")}),h.jsx("option",{value:"switch",children:e("switch")}),h.jsx("option",{value:"dropdown",children:e("dropdown")}),h.jsx("option",{value:"date",children:e("date")})]})})]}),l==="dropdown"&&h.jsx(lt,{id:"multi_line_text",innerRef:f,placeholder:e("comma_sparated_list"),value:s,onValueChange:()=>p()})]}):h.jsxs(h.Fragment,{children:[h.jsx(ne,{noExternalPadding:n.noExternalPadding,leftSide:h.jsx(lt,{id:n.field,innerRef:d,placeholder:n.placeholder,onValueChange:()=>p(),value:i,disabled:a}),children:h.jsxs(Dn,{value:l,onValueChange:g=>p(g),dismissable:!1,customSelector:!0,children:[h.jsx("option",{value:"single_line_text",children:e("single_line_text")}),h.jsx("option",{value:"multi_line_text",children:e("multi_line_text")}),h.jsx("option",{value:"switch",children:e("switch")}),h.jsx("option",{value:"dropdown",children:e("dropdown")}),h.jsx("option",{value:"date",children:e("date")})]})}),l==="dropdown"&&h.jsx(l1,{children:h.jsx(lt,{id:"multi_line_text",innerRef:f,placeholder:e("comma_sparated_list"),value:s,onValueChange:()=>p()})})]})}function Vae(n){const[e,t]=x.useState("single_line_text"),i=xt();return x.useEffect(()=>{const[,r]=n.value.includes("|")?n.value.split("|"):[n.value,"multi_line_text"];t(r)},[n.field]),h.jsxs(h.Fragment,{children:[e===bS.SingleLineText&&h.jsx(lt,{style:{color:i.$3,colorScheme:i.$0},type:"text",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),e===bS.MultiLineText&&h.jsx(lt,{style:{color:i.$3,colorScheme:i.$0},element:"textarea",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),e===bS.Switch&&h.jsx(jt,{style:{color:i.$3,colorScheme:i.$0},onChange:r=>{const s=r?"yes":"no";n.onValueChange(s)},checked:typeof n.defaultValue=="string"?n.defaultValue==="true"||n.defaultValue==="1"||n.defaultValue==="yes":n.defaultValue}),e===bS.Date&&h.jsx(lt,{style:{color:i.$3,colorScheme:i.$0},type:"date",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),!Object.values(bS).includes(e)&&h.jsx(Dn,{value:n.defaultValue||"",onValueChange:r=>n.onValueChange(r),customSelector:!0,withBlank:!0,menuPosition:n.selectMenuPosition,children:e.split(",").map((r,s)=>h.jsx("option",{value:r,children:r},s))})]})}function Xq(n){const[e,t]=n.includes("|")?n.split("|"):[n,""];return{label:()=>e,type:()=>t}}function Y3r(){const n=zi();return e=>n&&n.custom_fields[e]?Xq(n.custom_fields[e]):Xq("")}function qo(n){const[e,t]=x.useState("");return x.useEffect(()=>{const[i]=n.value.includes("|")?n.value.split("|"):[n.value,""];t(i||"")},[]),n.fieldOnly?h.jsx(Vae,{...n}):n.labelOnTop?h.jsxs("div",{className:"flex flex-col gap-y-1",children:[e?h.jsx(Lh,{children:e}):null,h.jsx(Vae,{...n})]}):h.jsx(ne,{leftSide:e,noExternalPadding:n.noExternalPadding,children:h.jsx(Vae,{...n})})}function C9(n){const e=wZ();return h.jsx(Dn,{value:n.value,onValueChange:n.onChange,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,customSelector:!0,children:e.map((t,i)=>h.jsx("option",{value:t.id,children:t.name},i))})}var ppe=function(){return ppe=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},ppe.apply(this,arguments)},QZe={onActivate:Vn.func,onAddUndo:Vn.func,onBeforeAddUndo:Vn.func,onBeforeExecCommand:Vn.func,onBeforeGetContent:Vn.func,onBeforeRenderUI:Vn.func,onBeforeSetContent:Vn.func,onBeforePaste:Vn.func,onBlur:Vn.func,onChange:Vn.func,onClearUndos:Vn.func,onClick:Vn.func,onContextMenu:Vn.func,onCommentChange:Vn.func,onCompositionEnd:Vn.func,onCompositionStart:Vn.func,onCompositionUpdate:Vn.func,onCopy:Vn.func,onCut:Vn.func,onDblclick:Vn.func,onDeactivate:Vn.func,onDirty:Vn.func,onDrag:Vn.func,onDragDrop:Vn.func,onDragEnd:Vn.func,onDragGesture:Vn.func,onDragOver:Vn.func,onDrop:Vn.func,onExecCommand:Vn.func,onFocus:Vn.func,onFocusIn:Vn.func,onFocusOut:Vn.func,onGetContent:Vn.func,onHide:Vn.func,onInit:Vn.func,onInput:Vn.func,onKeyDown:Vn.func,onKeyPress:Vn.func,onKeyUp:Vn.func,onLoadContent:Vn.func,onMouseDown:Vn.func,onMouseEnter:Vn.func,onMouseLeave:Vn.func,onMouseMove:Vn.func,onMouseOut:Vn.func,onMouseOver:Vn.func,onMouseUp:Vn.func,onNodeChange:Vn.func,onObjectResizeStart:Vn.func,onObjectResized:Vn.func,onObjectSelected:Vn.func,onPaste:Vn.func,onPostProcess:Vn.func,onPostRender:Vn.func,onPreProcess:Vn.func,onProgressState:Vn.func,onRedo:Vn.func,onRemove:Vn.func,onReset:Vn.func,onSaveContent:Vn.func,onSelectionChange:Vn.func,onSetAttrib:Vn.func,onSetContent:Vn.func,onShow:Vn.func,onSubmit:Vn.func,onUndo:Vn.func,onVisualAid:Vn.func,onSkinLoadError:Vn.func,onThemeLoadError:Vn.func,onModelLoadError:Vn.func,onPluginLoadError:Vn.func,onIconsLoadError:Vn.func,onLanguageLoadError:Vn.func,onScriptsLoad:Vn.func,onScriptsLoadError:Vn.func},QXt=ppe({apiKey:Vn.string,licenseKey:Vn.string,id:Vn.string,inline:Vn.bool,init:Vn.object,initialValue:Vn.string,onEditorChange:Vn.func,value:Vn.string,tagName:Vn.string,tabIndex:Vn.number,cloudChannel:Vn.string,plugins:Vn.oneOfType([Vn.string,Vn.array]),toolbar:Vn.oneOfType([Vn.string,Vn.array]),disabled:Vn.bool,textareaName:Vn.string,tinymceScriptSrc:Vn.oneOfType([Vn.string,Vn.arrayOf(Vn.string),Vn.arrayOf(Vn.shape({src:Vn.string,async:Vn.bool,defer:Vn.bool}))]),rollback:Vn.oneOfType([Vn.number,Vn.oneOf([!1])]),scriptLoading:Vn.shape({async:Vn.bool,defer:Vn.bool,delay:Vn.number})},QZe),Wae=function(n){return typeof n=="function"},C3e=function(n){return n in QZe},w3e=function(n){return n.substr(2)},XXt=function(n,e,t,i,r,s,o){var a=Object.keys(r).filter(C3e),l=Object.keys(s).filter(C3e),c=a.filter(function(d){return s[d]===void 0}),u=l.filter(function(d){return r[d]===void 0});c.forEach(function(d){var f=w3e(d),p=o[f];t(f,p),delete o[f]}),u.forEach(function(d){var f=i(n,d),p=w3e(d);o[p]=f,e(p,f)})},ZXt=function(n,e,t,i,r){return XXt(r,n.on.bind(n),n.off.bind(n),function(s,o){return function(a){var l;return(l=s(o))===null||l===void 0?void 0:l(a,n)}},e,t,i)},x3e=0,XZe=function(n){var e=Date.now(),t=Math.floor(Math.random()*1e9);return x3e++,n+"_"+t+x3e+String(e)},S3e=function(n){return n!==null&&(n.tagName.toLowerCase()==="textarea"||n.tagName.toLowerCase()==="input")},E3e=function(n){return typeof n>"u"||n===""?[]:Array.isArray(n)?n:n.split(" ")},JXt=function(n,e){return E3e(n).concat(E3e(e))},eZt=function(){return window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"},tZt=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},k3e=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))},gpe=function(){return gpe=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},gpe.apply(this,arguments)},nZt=function(n,e,t){var i,r,s=n.createElement("script");s.referrerPolicy="origin",s.type="application/javascript",s.id=e.id,s.src=e.src,s.async=(i=e.async)!==null&&i!==void 0?i:!1,s.defer=(r=e.defer)!==null&&r!==void 0?r:!1;var o=function(){s.removeEventListener("load",o),s.removeEventListener("error",a),t(e.src)},a=function(l){s.removeEventListener("load",o),s.removeEventListener("error",a),t(e.src,l)};s.addEventListener("load",o),s.addEventListener("error",a),n.head&&n.head.appendChild(s)},iZt=function(n){var e={},t=function(o,a){var l=e[o];l.done=!0,l.error=a;for(var c=0,u=l.handlers;c<u.length;c++){var d=u[c];d(o,a)}l.handlers=[]},i=function(o,a,l){var c=function(b){return l!==void 0?l(b):console.error(b)};if(o.length===0){c(new Error("At least one script must be provided"));return}for(var u=0,d=!1,f=function(b,y){d||(y?(d=!0,c(y)):++u===o.length&&a())},p=0,g=o;p<g.length;p++){var m=g[p],_=e[m.src];if(_)_.done?f(m.src,_.error):_.handlers.push(f);else{var v=XZe("tiny-");e[m.src]={id:v,src:m.src,done:!1,error:null,handlers:[f]},nZt(n,gpe({id:v},m),t)}}},r=function(){for(var o,a=0,l=Object.values(e);a<l.length;a++){var c=l[a],u=n.getElementById(c.id);u!=null&&u.tagName==="SCRIPT"&&((o=u.parentNode)===null||o===void 0||o.removeChild(u))}e={}},s=function(){return n};return{loadScripts:i,deleteScripts:r,getDocument:s}},rZt=function(){var n=[],e=function(r){var s=n.find(function(o){return o.getDocument()===r});return s===void 0&&(s=iZt(r),n.push(s)),s},t=function(r,s,o,a,l){var c=function(){return e(r).loadScripts(s,a,l)};o>0?setTimeout(c,o):c()},i=function(){for(var r=n.pop();r!=null;r=n.pop())r.deleteScripts()};return{loadList:t,reinitialize:i}},sZt=rZt(),zae=function(n){var e=n;return e&&e.tinymce?e.tinymce:null},oZt=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},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)}}(),yR=function(){return yR=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},yR.apply(this,arguments)},aZt=function(n){oZt(e,n);function e(t){var i,r,s,o=n.call(this,t)||this;return o.rollbackTimer=void 0,o.valueCursor=void 0,o.rollbackChange=function(){var a=o.editor,l=o.props.value;a&&l&&l!==o.currentContent&&a.undoManager.ignore(function(){if(a.setContent(l),o.valueCursor&&(!o.inline||a.hasFocus()))try{a.selection.moveToBookmark(o.valueCursor)}catch{}}),o.rollbackTimer=void 0},o.handleBeforeInput=function(a){if(o.props.value!==void 0&&o.props.value===o.currentContent&&o.editor&&(!o.inline||o.editor.hasFocus()))try{o.valueCursor=o.editor.selection.getBookmark(3)}catch{}},o.handleBeforeInputSpecial=function(a){(a.key==="Enter"||a.key==="Backspace"||a.key==="Delete")&&o.handleBeforeInput(a)},o.handleEditorChange=function(a){var l=o.editor;if(l&&l.initialized){var c=l.getContent();o.props.value!==void 0&&o.props.value!==c&&o.props.rollback!==!1&&(o.rollbackTimer||(o.rollbackTimer=window.setTimeout(o.rollbackChange,typeof o.props.rollback=="number"?o.props.rollback:200))),c!==o.currentContent&&(o.currentContent=c,Wae(o.props.onEditorChange)&&o.props.onEditorChange(c,l))}},o.handleEditorChangeSpecial=function(a){(a.key==="Backspace"||a.key==="Delete")&&o.handleEditorChange(a)},o.initialise=function(a){var l,c,u;a===void 0&&(a=0);var d=o.elementRef.current;if(d){if(!tZt(d)){if(a===0)setTimeout(function(){return o.initialise(1)},1);else if(a<100)setTimeout(function(){return o.initialise(a+1)},100);else throw new Error("tinymce can only be initialised when in a document");return}var f=zae(o.view);if(!f)throw new Error("tinymce should have been loaded into global scope");var p=yR(yR(yR(yR({},o.props.init),{selector:void 0,target:d,readonly:o.props.disabled,inline:o.inline,plugins:JXt((l=o.props.init)===null||l===void 0?void 0:l.plugins,o.props.plugins),toolbar:(c=o.props.toolbar)!==null&&c!==void 0?c:(u=o.props.init)===null||u===void 0?void 0:u.toolbar}),o.props.licenseKey?{license_key:o.props.licenseKey}:{}),{setup:function(g){o.editor=g,o.bindHandlers({}),o.inline&&!S3e(d)&&g.once("PostRender",function(m){g.setContent(o.getInitialValue(),{no_events:!0})}),o.props.init&&Wae(o.props.init.setup)&&o.props.init.setup(g)},init_instance_callback:function(g){var m,_,v=o.getInitialValue();o.currentContent=(m=o.currentContent)!==null&&m!==void 0?m:g.getContent(),o.currentContent!==v&&(o.currentContent=v,g.setContent(v),g.undoManager.clear(),g.undoManager.add(),g.setDirty(!1));var b=(_=o.props.disabled)!==null&&_!==void 0?_:!1;k3e(o.editor,b?"readonly":"design"),o.props.init&&Wae(o.props.init.init_instance_callback)&&o.props.init.init_instance_callback(g)}});o.inline||(d.style.visibility=""),S3e(d)&&(d.value=o.getInitialValue()),f.init(p)}},o.id=o.props.id||XZe("tiny-react"),o.elementRef=x.createRef(),o.inline=(s=(i=o.props.inline)!==null&&i!==void 0?i:(r=o.props.init)===null||r===void 0?void 0:r.inline)!==null&&s!==void 0?s:!1,o.boundHandlers={},o}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,s;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 o=this.editor;o.undoManager.transact(function(){var l;if(!i.inline||o.hasFocus())try{l=o.selection.getBookmark(3)}catch{}var c=i.valueCursor;if(o.setContent(i.props.value),!i.inline||o.hasFocus())for(var u=0,d=[l,c];u<d.length;u++){var f=d[u];if(f)try{o.selection.moveToBookmark(f),i.valueCursor=f;break}catch{}}})}if(this.props.disabled!==t.disabled){var a=(s=this.props.disabled)!==null&&s!==void 0?s:!1;k3e(this.editor,a?"readonly":"design")}}},e.prototype.componentDidMount=function(){var t=this,i,r,s,o,a;if(zae(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(!((s=this.elementRef.current)===null||s===void 0)&&s.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,f;(f=(d=t.props).onScriptsLoadError)===null||f===void 0||f.call(d,u)};sZt.loadList(this.elementRef.current.ownerDocument,this.getScriptSources(),(a=(o=this.props.scriptLoading)===null||o===void 0?void 0:o.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,s=(r=(i=(t=zae(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 s?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"},e.prototype.beforeInputEvent=function(){return eZt()?"beforeinput SelectionChange":"SelectionChange"},e.prototype.renderInline=function(){var t=this.props.tagName,i=t===void 0?"div":t;return x.createElement(i,{ref:this.elementRef,id:this.id,tabIndex:this.props.tabIndex})},e.prototype.renderIframe=function(){return x.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id,tabIndex:this.props.tabIndex})},e.prototype.getScriptSources=function(){var t,i,r=(t=this.props.scriptLoading)===null||t===void 0?void 0:t.async,s=(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:s}]:this.props.tinymceScriptSrc.map(function(c){return typeof c=="string"?{src:c,async:r,defer:s}:c});var o=this.props.cloudChannel,a=this.props.apiKey?this.props.apiKey:"no-api-key",l="https://cdn.tiny.cloud/1/".concat(a,"/tinymce/").concat(o,"/tinymce.min.js");return[{src:l,async:r,defer:s}]},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){ZXt(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},s=r(t),o=r(this.props);!s&&o?(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)):s&&!o&&(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=QXt,e.defaultProps={cloudChannel:"7"},e}(x.Component);function dh(n){const[e,t]=x.useState(),i=x.useRef(null);Qo(),x.useEffect(()=>{t(n.value)},[n.value]);const r=l=>{n.onChange(l)},s=x.useRef(pn.debounce(l=>r(l),500)).current,o=l=>{t(l||""),s(l||"")},a=xt();return x.useEffect(()=>{var c;const l=a.$0==="dark";if((c=i.current)!=null&&c.editor)try{const u=i.current.editor,d=u.editorManager.baseURL+"/skins/ui/oxide-dark/skin.min.css",f=u.editorManager.baseURL+"/skins/ui/oxide/skin.min.css";u.ui.styleSheetLoader.unload(d),u.ui.styleSheetLoader.unload(f),u.ui.styleSheetLoader.load(l?d:f);const p=u.getDoc();if(p){p.querySelectorAll('link[rel="stylesheet"]').forEach(_=>{var b;const v=_.getAttribute("href");(v!=null&&v.endsWith("/skins/content/dark/content.min.css")||v!=null&&v.endsWith("/tinymce_6.4.2/tinymce/content.css"))&&((b=_.parentNode)==null||b.removeChild(_))});const m=p.createElement("link");m.rel="stylesheet",m.href=l?u.editorManager.baseURL+"/skins/content/dark/content.min.css":"/tinymce_6.4.2/tinymce/content.css",p.head.appendChild(m)}}catch(u){console.error("Error updating content CSS:",u)}},[a.$0]),h.jsxs("div",{className:"space-y-4",style:{zIndex:0},children:[n.label&&h.jsx(Lh,{children:n.label}),h.jsx(aZt,{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","emoticons"],toolbar:["blocks fontfamily fontsize | bold italic underline strikethrough | forecolor backcolor | emoticons link image media","alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | table | searchreplace | removeformat | code | help"],font_family_formats:"Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino;Helvetica=helvetica;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva",font_size_formats:"8pt 10pt 12pt 14pt 16pt 18pt 24pt 36pt 48pt",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:l=>{n.handleChangeOnlyOnUserInput?l!==n.value&&o(l):o(l)},disabled:n.disabled})]})}function lZt(){var l,c,u,d,f,p,g,m,_;const[n]=xe(),e=Sze(),t=Ml(),i=Fr(),r=zi(),[,s]=oo(FJ),o=Cu(v=>v.user.changes),a=(v,b)=>{i(uA({property:v,value:b}))};return h.jsx(h.Fragment,{children:o&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("first_name"),children:h.jsx(lt,{value:(o==null?void 0:o.first_name)||(t==null?void 0:t.first_name)||"",onValueChange:v=>a("first_name",v),errorMessage:(((l=e==null?void 0:e.errors)==null?void 0:l.first_name)??[])[0]})}),h.jsx(ne,{leftSide:n("last_name"),children:h.jsx(lt,{value:(o==null?void 0:o.last_name)||(t==null?void 0:t.last_name)||"",onValueChange:v=>a("last_name",v),errorMessage:(((c=e==null?void 0:e.errors)==null?void 0:c.last_name)??[])[0]})}),h.jsx(ne,{leftSide:n("email"),children:h.jsx(lt,{value:(o==null?void 0:o.email)||(t==null?void 0:t.email)||"",type:"email",onValueChange:v=>a("email",v),errorMessage:(((u=e==null?void 0:e.errors)==null?void 0:u.email)??[])[0]})}),h.jsx(ne,{leftSide:n("language"),children:h.jsx(C9,{value:(o==null?void 0:o.language_id)||"",onChange:v=>{s(!0),a("language_id",v)},errorMessage:(((d=e==null?void 0:e.errors)==null?void 0:d.language_id)??[])[0],dismissable:!0})}),h.jsx(ne,{leftSide:n("phone"),children:h.jsx(lt,{value:(o==null?void 0:o.phone)||(t==null?void 0:t.phone)||"",onValueChange:v=>a("phone",v),errorMessage:(((f=e==null?void 0:e.errors)==null?void 0:f.phone)??[])[0]})}),h.jsx(ne,{leftSide:n("signature"),children:h.jsx(dh,{value:(o==null?void 0:o.signature)||"",onChange:v=>a("signature",v)})}),((p=r==null?void 0:r.custom_fields)==null?void 0:p.user1)&&h.jsx(qo,{field:"user1",defaultValue:o.custom_value1,value:r.custom_fields.user1,onValueChange:v=>a("custom_value1",v)}),((g=r==null?void 0:r.custom_fields)==null?void 0:g.user2)&&h.jsx(qo,{field:"user2",defaultValue:o.custom_value2,value:r.custom_fields.user2,onValueChange:v=>a("custom_value2",v)}),((m=r==null?void 0:r.custom_fields)==null?void 0:m.user3)&&h.jsx(qo,{field:"user3",defaultValue:o.custom_value3,value:r.custom_fields.user3,onValueChange:v=>a("custom_value3",v)}),((_=r==null?void 0:r.custom_fields)==null?void 0:_.user4)&&h.jsx(qo,{field:"user4",defaultValue:o.custom_value4,value:r.custom_fields.user4,onValueChange:v=>a("custom_value4",v)})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function cZt(){const[n]=xe();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 uZt(){var p,g,m,_,v,b;const[n]=xe(),e=Fr(),t=xt(),i=cZt(),r=Cu(y=>y.user.changes),s=l4(),[o,a]=x.useState(""),l=y=>{var I,L,N;a(y);const C=pn.cloneDeep(r);let S=y==="custom"?[]:[y];((N=(L=(I=C==null?void 0:C.company_user)==null?void 0:I.notifications)==null?void 0:L.email)==null?void 0:N.find(P=>P==="task_assigned"))&&(S=[...S,"task_assigned"]),pn.set(C,"company_user.notifications.email",S),e(Mj(C))},c=y=>{var C,S,k;return o==="all_notifications"?`${y}_all`:o==="all_user_notifications"?`${y}_user`:((k=(S=(C=r==null?void 0:r.company_user)==null?void 0:C.notifications)==null?void 0:S.email)==null?void 0:k.find(I=>I.startsWith(y)))||"none"},u=(y,C)=>{var N,P;const S=(P=(N=r==null?void 0:r.company_user)==null?void 0:N.notifications)==null?void 0:P.email,k=S.findIndex(O=>O.startsWith(y));let I=[...S];k>-1?C!=="none"?I=S.map((O,F)=>k===F?C:O):I=S.filter((O,F)=>k!==F):I=[...I,C];const L=pn.cloneDeep(r);pn.set(L,"company_user.notifications.email",I),e(Mj(L))},d=y=>{var I,L;let S=[...(L=(I=r==null?void 0:r.company_user)==null?void 0:I.notifications)==null?void 0:L.email];y?S.find(P=>P==="task_assigned")||(S=[...S,"task_assigned"]):S=S.filter(N=>N!=="task_assigned");const k=pn.cloneDeep(r);pn.set(k,"company_user.notifications.email",S),e(Mj(k))},f=y=>{var I,L;let S=[...(L=(I=r==null?void 0:r.company_user)==null?void 0:I.notifications)==null?void 0:L.email];y?S.find(P=>P==="disable_recurring_payment_notification")||(S=[...S,"disable_recurring_payment_notification"]):S=S.filter(N=>N!=="disable_recurring_payment_notification");const k=pn.cloneDeep(r);pn.set(k,"company_user.notifications.email",S),e(Mj(k))};return x.useEffect(()=>{var C,S;const y=(S=(C=r==null?void 0:r.company_user)==null?void 0:C.notifications)==null?void 0:S.email;y&&!o&&(y.includes("all_notifications")||y.includes("all_user_notifications")?a(y[0]):a("custom"))},[r]),h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("login_notification"),leftSideHelp:n("login_notification_help"),children:h.jsx(jt,{checked:r==null?void 0:r.user_logged_in_notification,onChange:y=>s("user_logged_in_notification",y)})}),h.jsx(ne,{className:"mb-4",leftSide:n("task_assigned_notification"),leftSideHelp:n("task_assigned_notification_help"),children:h.jsx(jt,{checked:!!((m=(g=(p=r==null?void 0:r.company_user)==null?void 0:p.notifications)==null?void 0:g.email)!=null&&m.find(y=>y==="task_assigned")),onChange:y=>d(y)})}),h.jsx(ne,{className:"mb-4",leftSide:n("disable_recurring_payment_notification"),leftSideHelp:n("disable_recurring_payment_notification_help"),children:h.jsx(jt,{checked:(b=(v=(_=r==null?void 0:r.company_user)==null?void 0:_.notifications)==null?void 0:v.email)==null?void 0:b.find(y=>y==="disable_recurring_payment_notification"),onChange:y=>f(y)})}),h.jsx("div",{className:"px-4 sm:px-6",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:t.$20})}),h.jsx(ne,{className:"my-4",leftSide:n("all_events"),children:h.jsxs(Dn,{value:o,onValueChange:y=>l(y),customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"all_notifications",children:n("all_records")}),h.jsx("option",{value:"all_user_notifications",children:n("owned_by_user")}),h.jsx("option",{value:"custom",children:n("custom")})]})}),h.jsx("div",{className:"px-4 sm:px-6",children:h.jsx(Ki,{className:"mb-4 border-dashed",withoutPadding:!0,borderColor:t.$20})}),h.jsx("div",{className:"flex flex-col",children:i.map((y,C)=>h.jsx(ne,{className:"mt-0",leftSide:y.label,children:h.jsxs(Dn,{value:c(y.key),onValueChange:S=>u(y.key,S),disabled:!!o&&o!=="custom",customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:`${y.key}_all`,children:n("all_records")}),h.jsx("option",{value:`${y.key}_user`,children:n("owned_by_user")}),h.jsx("option",{value:"none",children:n("none")})]})},C))})]})}function dZt(){var o;const[n]=xe(),e=Fr(),t=Sze(),i=Cu(a=>a.user.changes),[r,s]=x.useState(!1);return x.useEffect(()=>{r&&window.addEventListener("user.updated",()=>e(I1t()))},[r]),h.jsx(ne,{leftSide:n("new_password"),children:h.jsx(lt,{type:"password",value:i.password||"",onValueChange:a=>{e(uA({property:"password",value:a})),!r&&s(!0)},errorMessage:(o=t==null?void 0:t.errors)==null?void 0:o.password})})}var xD={},Uae,T3e;function ZZe(){return T3e||(T3e=1,Uae={L:1,M:0,Q:3,H:2}),Uae}var qae,I3e;function JZe(){return I3e||(I3e=1,qae={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),qae}var Kae,L3e;function hZt(){if(L3e)return Kae;L3e=1;var n=JZe();function e(t){this.mode=n.MODE_8BIT_BYTE,this.data=t}return e.prototype={getLength:function(t){return this.data.length},write:function(t){for(var i=0;i<this.data.length;i++)t.put(this.data.charCodeAt(i),8)}},Kae=e,Kae}var Gae,A3e;function fZt(){if(A3e)return Gae;A3e=1;var n=ZZe();function e(t,i){this.totalCount=t,this.dataCount=i}return e.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]],e.getRSBlocks=function(t,i){var r=e.getRsBlockTable(t,i);if(r==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+i);for(var s=r.length/3,o=new Array,a=0;a<s;a++)for(var l=r[a*3+0],c=r[a*3+1],u=r[a*3+2],d=0;d<l;d++)o.push(new e(c,u));return o},e.getRsBlockTable=function(t,i){switch(i){case n.L:return e.RS_BLOCK_TABLE[(t-1)*4+0];case n.M:return e.RS_BLOCK_TABLE[(t-1)*4+1];case n.Q:return e.RS_BLOCK_TABLE[(t-1)*4+2];case n.H:return e.RS_BLOCK_TABLE[(t-1)*4+3];default:return}},Gae=e,Gae}var Yae,N3e;function pZt(){if(N3e)return Yae;N3e=1;function n(){this.buffer=new Array,this.length=0}return n.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var i=0;i<t;i++)this.putBit((e>>>t-i-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},Yae=n,Yae}var Qae,D3e;function eJe(){if(D3e)return Qae;D3e=1;for(var n={glog:function(t){if(t<1)throw new Error("glog("+t+")");return n.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return n.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},e=0;e<8;e++)n.EXP_TABLE[e]=1<<e;for(var e=8;e<256;e++)n.EXP_TABLE[e]=n.EXP_TABLE[e-4]^n.EXP_TABLE[e-5]^n.EXP_TABLE[e-6]^n.EXP_TABLE[e-8];for(var e=0;e<255;e++)n.LOG_TABLE[n.EXP_TABLE[e]]=e;return Qae=n,Qae}var Xae,R3e;function tJe(){if(R3e)return Xae;R3e=1;var n=eJe();function e(t,i){if(t.length==null)throw new Error(t.length+"/"+i);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+i);for(var s=0;s<t.length-r;s++)this.num[s]=t[s+r]}return e.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var i=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var s=0;s<t.getLength();s++)i[r+s]^=n.gexp(n.glog(this.get(r))+n.glog(t.get(s)));return new e(i,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var i=n.glog(this.get(0))-n.glog(t.get(0)),r=new Array(this.getLength()),s=0;s<this.getLength();s++)r[s]=this.get(s);for(var s=0;s<t.getLength();s++)r[s]^=n.gexp(n.glog(t.get(s))+i);return new e(r,0).mod(t)}},Xae=e,Xae}var Zae,P3e;function gZt(){if(P3e)return Zae;P3e=1;var n=JZe(),e=tJe(),t=eJe(),i={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},r={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(s){for(var o=s<<10;r.getBCHDigit(o)-r.getBCHDigit(r.G15)>=0;)o^=r.G15<<r.getBCHDigit(o)-r.getBCHDigit(r.G15);return(s<<10|o)^r.G15_MASK},getBCHTypeNumber:function(s){for(var o=s<<12;r.getBCHDigit(o)-r.getBCHDigit(r.G18)>=0;)o^=r.G18<<r.getBCHDigit(o)-r.getBCHDigit(r.G18);return s<<12|o},getBCHDigit:function(s){for(var o=0;s!=0;)o++,s>>>=1;return o},getPatternPosition:function(s){return r.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,o,a){switch(s){case i.PATTERN000:return(o+a)%2==0;case i.PATTERN001:return o%2==0;case i.PATTERN010:return a%3==0;case i.PATTERN011:return(o+a)%3==0;case i.PATTERN100:return(Math.floor(o/2)+Math.floor(a/3))%2==0;case i.PATTERN101:return o*a%2+o*a%3==0;case i.PATTERN110:return(o*a%2+o*a%3)%2==0;case i.PATTERN111:return(o*a%3+(o+a)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){for(var o=new e([1],0),a=0;a<s;a++)o=o.multiply(new e([1,t.gexp(a)],0));return o},getLengthInBits:function(s,o){if(1<=o&&o<10)switch(s){case n.MODE_NUMBER:return 10;case n.MODE_ALPHA_NUM:return 9;case n.MODE_8BIT_BYTE:return 8;case n.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(o<27)switch(s){case n.MODE_NUMBER:return 12;case n.MODE_ALPHA_NUM:return 11;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(o<41)switch(s){case n.MODE_NUMBER:return 14;case n.MODE_ALPHA_NUM:return 13;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+o)},getLostPoint:function(s){for(var o=s.getModuleCount(),a=0,l=0;l<o;l++)for(var c=0;c<o;c++){for(var u=0,d=s.isDark(l,c),f=-1;f<=1;f++)if(!(l+f<0||o<=l+f))for(var p=-1;p<=1;p++)c+p<0||o<=c+p||f==0&&p==0||d==s.isDark(l+f,c+p)&&u++;u>5&&(a+=3+u-5)}for(var l=0;l<o-1;l++)for(var c=0;c<o-1;c++){var g=0;s.isDark(l,c)&&g++,s.isDark(l+1,c)&&g++,s.isDark(l,c+1)&&g++,s.isDark(l+1,c+1)&&g++,(g==0||g==4)&&(a+=3)}for(var l=0;l<o;l++)for(var c=0;c<o-6;c++)s.isDark(l,c)&&!s.isDark(l,c+1)&&s.isDark(l,c+2)&&s.isDark(l,c+3)&&s.isDark(l,c+4)&&!s.isDark(l,c+5)&&s.isDark(l,c+6)&&(a+=40);for(var c=0;c<o;c++)for(var l=0;l<o-6;l++)s.isDark(l,c)&&!s.isDark(l+1,c)&&s.isDark(l+2,c)&&s.isDark(l+3,c)&&s.isDark(l+4,c)&&!s.isDark(l+5,c)&&s.isDark(l+6,c)&&(a+=40);for(var m=0,c=0;c<o;c++)for(var l=0;l<o;l++)s.isDark(l,c)&&m++;var _=Math.abs(100*m/o/o-50)/5;return a+=_*10,a}};return Zae=r,Zae}var Jae,O3e;function mZt(){if(O3e)return Jae;O3e=1;var n=hZt(),e=fZt(),t=pZt(),i=gZt(),r=tJe();function s(a,l){this.typeNumber=a,this.errorCorrectLevel=l,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var o=s.prototype;return o.addData=function(a){var l=new n(a);this.dataList.push(l),this.dataCache=null},o.isDark=function(a,l){if(a<0||this.moduleCount<=a||l<0||this.moduleCount<=l)throw new Error(a+","+l);return this.modules[a][l]},o.getModuleCount=function(){return this.moduleCount},o.make=function(){if(this.typeNumber<1){var a=1;for(a=1;a<40;a++){for(var l=e.getRSBlocks(a,this.errorCorrectLevel),c=new t,u=0,d=0;d<l.length;d++)u+=l[d].dataCount;for(var d=0;d<this.dataList.length;d++){var f=this.dataList[d];c.put(f.mode,4),c.put(f.getLength(),i.getLengthInBits(f.mode,a)),f.write(c)}if(c.getLengthInBits()<=u*8)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},o.makeImpl=function(a,l){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var c=0;c<this.moduleCount;c++){this.modules[c]=new Array(this.moduleCount);for(var u=0;u<this.moduleCount;u++)this.modules[c][u]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,l),this.typeNumber>=7&&this.setupTypeNumber(a),this.dataCache==null&&(this.dataCache=s.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,l)},o.setupPositionProbePattern=function(a,l){for(var c=-1;c<=7;c++)if(!(a+c<=-1||this.moduleCount<=a+c))for(var u=-1;u<=7;u++)l+u<=-1||this.moduleCount<=l+u||(0<=c&&c<=6&&(u==0||u==6)||0<=u&&u<=6&&(c==0||c==6)||2<=c&&c<=4&&2<=u&&u<=4?this.modules[a+c][l+u]=!0:this.modules[a+c][l+u]=!1)},o.getBestMaskPattern=function(){for(var a=0,l=0,c=0;c<8;c++){this.makeImpl(!0,c);var u=i.getLostPoint(this);(c==0||a>u)&&(a=u,l=c)}return l},o.createMovieClip=function(a,l,c){var u=a.createEmptyMovieClip(l,c),d=1;this.make();for(var f=0;f<this.modules.length;f++)for(var p=f*d,g=0;g<this.modules[f].length;g++){var m=g*d,_=this.modules[f][g];_&&(u.beginFill(0,100),u.moveTo(m,p),u.lineTo(m+d,p),u.lineTo(m+d,p+d),u.lineTo(m,p+d),u.endFill())}return u},o.setupTimingPattern=function(){for(var a=8;a<this.moduleCount-8;a++)this.modules[a][6]==null&&(this.modules[a][6]=a%2==0);for(var l=8;l<this.moduleCount-8;l++)this.modules[6][l]==null&&(this.modules[6][l]=l%2==0)},o.setupPositionAdjustPattern=function(){for(var a=i.getPatternPosition(this.typeNumber),l=0;l<a.length;l++)for(var c=0;c<a.length;c++){var u=a[l],d=a[c];if(this.modules[u][d]==null)for(var f=-2;f<=2;f++)for(var p=-2;p<=2;p++)f==-2||f==2||p==-2||p==2||f==0&&p==0?this.modules[u+f][d+p]=!0:this.modules[u+f][d+p]=!1}},o.setupTypeNumber=function(a){for(var l=i.getBCHTypeNumber(this.typeNumber),c=0;c<18;c++){var u=!a&&(l>>c&1)==1;this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=u}for(var c=0;c<18;c++){var u=!a&&(l>>c&1)==1;this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=u}},o.setupTypeInfo=function(a,l){for(var c=this.errorCorrectLevel<<3|l,u=i.getBCHTypeInfo(c),d=0;d<15;d++){var f=!a&&(u>>d&1)==1;d<6?this.modules[d][8]=f:d<8?this.modules[d+1][8]=f:this.modules[this.moduleCount-15+d][8]=f}for(var d=0;d<15;d++){var f=!a&&(u>>d&1)==1;d<8?this.modules[8][this.moduleCount-d-1]=f:d<9?this.modules[8][15-d-1+1]=f:this.modules[8][15-d-1]=f}this.modules[this.moduleCount-8][8]=!a},o.mapData=function(a,l){for(var c=-1,u=this.moduleCount-1,d=7,f=0,p=this.moduleCount-1;p>0;p-=2)for(p==6&&p--;;){for(var g=0;g<2;g++)if(this.modules[u][p-g]==null){var m=!1;f<a.length&&(m=(a[f]>>>d&1)==1);var _=i.getMask(l,u,p-g);_&&(m=!m),this.modules[u][p-g]=m,d--,d==-1&&(f++,d=7)}if(u+=c,u<0||this.moduleCount<=u){u-=c,c=-c;break}}},s.PAD0=236,s.PAD1=17,s.createData=function(a,l,c){for(var u=e.getRSBlocks(a,l),d=new t,f=0;f<c.length;f++){var p=c[f];d.put(p.mode,4),d.put(p.getLength(),i.getLengthInBits(p.mode,a)),p.write(d)}for(var g=0,f=0;f<u.length;f++)g+=u[f].dataCount;if(d.getLengthInBits()>g*8)throw new Error("code length overflow. ("+d.getLengthInBits()+">"+g*8+")");for(d.getLengthInBits()+4<=g*8&&d.put(0,4);d.getLengthInBits()%8!=0;)d.putBit(!1);for(;!(d.getLengthInBits()>=g*8||(d.put(s.PAD0,8),d.getLengthInBits()>=g*8));)d.put(s.PAD1,8);return s.createBytes(d,u)},s.createBytes=function(a,l){for(var c=0,u=0,d=0,f=new Array(l.length),p=new Array(l.length),g=0;g<l.length;g++){var m=l[g].dataCount,_=l[g].totalCount-m;u=Math.max(u,m),d=Math.max(d,_),f[g]=new Array(m);for(var v=0;v<f[g].length;v++)f[g][v]=255&a.buffer[v+c];c+=m;var b=i.getErrorCorrectPolynomial(_),y=new r(f[g],b.getLength()-1),C=y.mod(b);p[g]=new Array(b.getLength()-1);for(var v=0;v<p[g].length;v++){var S=v+C.getLength()-p[g].length;p[g][v]=S>=0?C.get(S):0}}for(var k=0,v=0;v<l.length;v++)k+=l[v].totalCount;for(var I=new Array(k),L=0,v=0;v<u;v++)for(var g=0;g<l.length;g++)v<f[g].length&&(I[L++]=f[g][v]);for(var v=0;v<d;v++)for(var g=0;g<l.length;g++)v<p[g].length&&(I[L++]=p[g][v]);return I},Jae=s,Jae}var pV={},M3e;function _Zt(){if(M3e)return pV;M3e=1,Object.defineProperty(pV,"__esModule",{value:!0});var n=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(c[f]=d[f])}return c},e=bCe(),t=s(e),i=dv(),r=s(i);function s(c){return c&&c.__esModule?c:{default:c}}function o(c,u){var d={};for(var f in c)u.indexOf(f)>=0||Object.prototype.hasOwnProperty.call(c,f)&&(d[f]=c[f]);return d}var a={bgColor:t.default.oneOfType([t.default.object,t.default.string]).isRequired,bgD:t.default.string.isRequired,fgColor:t.default.oneOfType([t.default.object,t.default.string]).isRequired,fgD:t.default.string.isRequired,size:t.default.number.isRequired,title:t.default.string,viewBoxSize:t.default.number.isRequired,xmlns:t.default.string},l=(0,i.forwardRef)(function(c,u){var d=c.bgColor,f=c.bgD,p=c.fgD,g=c.fgColor,m=c.size,_=c.title,v=c.viewBoxSize,b=c.xmlns,y=b===void 0?"http://www.w3.org/2000/svg":b,C=o(c,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return r.default.createElement("svg",n({},C,{height:m,ref:u,viewBox:"0 0 "+v+" "+v,width:m,xmlns:y}),_?r.default.createElement("title",null,_):null,r.default.createElement("path",{d:f,fill:d}),r.default.createElement("path",{d:p,fill:g}))});return l.displayName="QRCodeSvg",l.propTypes=a,pV.default=l,pV}var j3e;function vZt(){if(j3e)return xD;j3e=1,Object.defineProperty(xD,"__esModule",{value:!0}),xD.QRCode=void 0;var n=Object.assign||function(m){for(var _=1;_<arguments.length;_++){var v=arguments[_];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(m[b]=v[b])}return m},e=bCe(),t=d(e),i=ZZe(),r=d(i),s=mZt(),o=d(s),a=dv(),l=d(a),c=_Zt(),u=d(c);function d(m){return m&&m.__esModule?m:{default:m}}function f(m,_){var v={};for(var b in m)_.indexOf(b)>=0||Object.prototype.hasOwnProperty.call(m,b)&&(v[b]=m[b]);return v}var p={bgColor:t.default.oneOfType([t.default.object,t.default.string]),fgColor:t.default.oneOfType([t.default.object,t.default.string]),level:t.default.string,size:t.default.number,value:t.default.string.isRequired},g=(0,a.forwardRef)(function(m,_){var v=m.bgColor,b=v===void 0?"#FFFFFF":v,y=m.fgColor,C=y===void 0?"#000000":y,S=m.level,k=S===void 0?"L":S,I=m.size,L=I===void 0?256:I,N=m.value,P=f(m,["bgColor","fgColor","level","size","value"]),O=new o.default(-1,r.default[k]);O.addData(N),O.make();var F=O.modules;return l.default.createElement(u.default,n({},P,{bgColor:b,bgD:F.map(function(V,M){return V.map(function(B,W){return B?"":"M "+W+" "+M+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:C,fgD:F.map(function(V,M){return V.map(function(B,W){return B?"M "+W+" "+M+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:_,size:L,viewBoxSize:F.length}))});return xD.QRCode=g,g.displayName="QRCode",g.propTypes=p,xD.default=g,xD}var bZt=vZt();const yZt=Cl(bZt);function CZt(n){const[e]=xe(),{resendSmsCode:t,verifyPhoneNumber:i,setVisible:r}=n,[s,o]=x.useState("");return h.jsx(pr,{title:e("sms_code"),visible:n.visible,onClose:()=>{r(!1),o("")},children:h.jsxs("div",{children:[h.jsx("div",{className:"flex justify-end mb-1",children:h.jsx(dn,{behavior:"button",type:"minimal",onClick:()=>o(""),children:e("clear")})}),h.jsx("div",{className:"flex justify-center",children:h.jsx($Qe,{value:s,onChange:o})}),h.jsxs("div",{className:"flex justify-between mt-8",children:[h.jsx(dn,{behavior:"button",type:"minimal",onClick:()=>{t(),o("")},children:e("resend_code")}),h.jsx(dn,{behavior:"button",onClick:()=>i(s),disableWithoutIcon:!0,disabled:s.length!==6,children:e("verify")})]})]})})}function nJe(n){const[e]=xe(),t=Ml(),i=Fr(),{checkVerification:r,setCheckVerification:s,isDisableModalOpen:o,setIsDisableModalOpen:a,checkOnlyPhoneNumberVerification:l}=n,[c,u]=x.useState(!1),[d,f]=x.useState(!1),[p,g]=x.useState(""),[m,_]=x.useState(""),[v,b]=x.useState(""),[y,C]=x.useState(!1),[S,k]=x.useState(),I=()=>{pe.processing(),Je("GET",ze("/api/v1/settings/enable_two_factor")).then(M=>{pe.dismiss(),g(M.data.data.qrCode),_(M.data.data.secret),u(!0)})},L=()=>{pe.processing(),k(void 0),Je("POST",ze("/api/v1/settings/enable_two_factor"),{secret:m,one_time_password:v}).then(M=>{pe.success(M.data.message),i(iw(pn.merge({},t,{google_2fa_secret:!0}))),i(rw()),u(!1)}).catch(M=>{var B;((B=M.response)==null?void 0:B.status)===422&&(k(M.response.data),pe.dismiss())}).finally(()=>C(!1))},N=()=>{pe.processing(),Je("POST",ze("/api/v1/settings/disable_two_factor")).then(()=>{pe.success("disabled_two_factor"),i(iw(pn.merge({},t,{google_2fa_secret:!1}))),i(rw()),a==null||a(!1)})},P=()=>{pe.processing(),Je("POST",ze("/api/v1/sms_reset"),{email:t.email}).then(()=>{pe.success("code_was_sent")})},O=M=>{pe.processing(),Je("POST",ze("/api/v1/sms_reset/confirm?validate_only=true"),{code:M,email:t.email}).then(()=>{pe.success("verified_phone_number"),i(iw(pn.merge({},t,{verified_phone_number:!0}))),i(rw()),f(!1),l||(I(),u(!0))})},F=()=>{I(),u(!0)};x.useEffect(()=>{r&&F()},[r]),x.useEffect(()=>{(!d||!c)&&s(!1)},[d,c]);const V=xt();return h.jsxs(h.Fragment,{children:[h.jsx(CZt,{visible:d,setVisible:f,resendSmsCode:P,verifyPhoneNumber:O}),h.jsxs(pr,{title:e("enable_two_factor"),visible:c,onClose:u,children:[h.jsxs("div",{className:"flex flex-col items-center pb-8 space-y-4",children:[h.jsx(yZt,{size:156,value:p}),h.jsx("p",{className:"font-semibold",style:{backgroundColor:V.$2,color:V.$3,colorScheme:V.$0},children:m})]}),h.jsx(lt,{id:"one_time_password",type:"text",label:e("one_time_password"),onValueChange:M=>b(M),errorMessage:S==null?void 0:S.errors.one_time_password}),h.jsx(dn,{behavior:"button",disabled:y,onClick:L,children:e("continue")}),h.jsx(Ji,{external:!0,to:"https://github.com/antonioribeiro/google2fa#google-authenticator-apps",children:e("learn_more")})]}),a&&typeof o=="boolean"&&h.jsx(pr,{title:e("disable_two_factor"),visible:o,onClose:a,children:h.jsx(dn,{behavior:"button",disabled:y,onClick:N,children:e("confirm")})})]})}function wZt(){const[n]=xe(),e=Ml(),[t,i]=x.useState(!1),[r,s]=x.useState(!1);return h.jsxs(h.Fragment,{children:[h.jsx(nJe,{checkVerification:r,setCheckVerification:s,isDisableModalOpen:t,setIsDisableModalOpen:i}),h.jsx(h.Fragment,{children:h.jsxs(ne,{leftSide:"2FA",children:[!(e!=null&&e.google_2fa_secret)&&h.jsx(dn,{behavior:"button",type:"minimal",onClick:()=>s(!0),children:n("enable")}),(e==null?void 0:e.google_2fa_secret)&&h.jsx(dn,{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 pv(){const n=xu({overwrite:!1}),e=Fr();return(t,i)=>{const[r]=i.split("|");if(r===""){const s=pn.cloneDeep(n);return s&&delete s.custom_fields[t],e(ME({object:"company",data:s}))}e(Uo({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 _Se(){return!Vy()&&!$u()&&To()}function Gb(n){const[e]=xe();return Ml(),h.jsx(h.Fragment,{})}function xZt(){const[n]=xe(),e=zi(),t=pv();return h.jsxs(h.Fragment,{children:[h.jsx(Gb,{}),h.jsx("div",{className:"px-4 sm:px-6",children:e&&["user1","user2","user3","user4"].map(i=>h.jsx(Qf,{initialValue:e.custom_fields[i],field:i,placeholder:n("user_field"),onChange:r=>t(i,r),withArrowAsSeparator:!0},i))})]})}function qw(){const n=Ml(),e=hv({overwrite:!1}),[t]=xe(),i=xt(),[r,s]=x.useState(!1),[o,a]=x.useState(null),l=Fr(),c=(g,m)=>l(uA({property:`company_user.react_settings.${g}`,value:m})),{getState:u}=kVe(),d=async({silent:g})=>{var m;pn.isEqual((m=n==null?void 0:n.company_user)==null?void 0:m.react_settings,u().user.changes.company_user.react_settings)||(!g&&pe.processing(),Je("PUT",ze(`/api/v1/company_users/${e==null?void 0:e.id}/preferences?include=company_user`),{react_settings:u().user.changes.company_user.react_settings}).then(_=>{!g&&pe.success("updated_user"),ii(["company_users"]),l(iw(_.data.data)),l(rw()),s(!1)}).catch(_=>{var v;g&&pe.dismiss(),((v=_.response)==null?void 0:v.status)===412&&a(_.response.data)}))},f=x.useMemo(()=>({children:g})=>h.jsxs(h.Fragment,{children:[h.jsxs(pr,{visible:r,onClose:s,title:t("preferences"),overflowVisible:!0,children:[g,h.jsx(dn,{onClick:d,children:t("save")})]}),h.jsx("div",{className:"flex items-center justify-center p-2 cursor-pointer border rounded-md shadow-sm",onClick:()=>s(!0),style:{backgroundColor:i.$1,borderColor:i.$24},children:h.jsx(WQe,{color:i.$3})})]}),[r,o]),p=Qo();return{Preferences:f,update:c,preferences:p.preferences,save:d}}/*! * currency.js - v2.0.4 * http://scurker.github.io/currency.js * * Copyright (c) 2021 Jason Wilson * Released under MIT license */var SZt={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:IZt,fromCents:!1},iJe=function(e){return Math.round(e)},vSe=function(e){return Math.pow(10,e)},EZt=function(e,t){return iJe(e/t)*t},kZt=/(\d)(?=(\d{3})+\b)/g,TZt=/(\d)(?=(\d\d)+\d\b)/g;function rb(n,e){var t=this;if(!(t instanceof rb))return new rb(n,e);var i=Object.assign({},SZt,e),r=vSe(i.precision),s=Mz(n,i);t.intValue=s,t.value=s/r,i.increment=i.increment||1/r,i.useVedic?i.groups=TZt:i.groups=kZt,this.s=i,this.p=r}function Mz(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=0,r=e.decimal,s=e.errorOnInvalid,o=e.precision,a=e.fromCents,l=vSe(o),c=typeof n=="number",u=n instanceof rb;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"),f=new RegExp("\\"+r,"g");i=n.replace(/\((.*)\)/,"-$1").replace(d,"").replace(f,"."),i=i||0}else{if(s)throw Error("Invalid Input");i=0}return a||(i*=l,i=i.toFixed(4)),t?iJe(i):i}function IZt(n,e){var t=e.pattern,i=e.negativePattern,r=e.symbol,s=e.separator,o=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"+s)+(u?o+u:""))}rb.prototype={add:function(e){var t=this.intValue,i=this.s,r=this.p;return rb((t+=Mz(e,i))/(i.fromCents?1:r),i)},subtract:function(e){var t=this.intValue,i=this.s,r=this.p;return rb((t-=Mz(e,i))/(i.fromCents?1:r),i)},multiply:function(e){var t=this.intValue,i=this.s;return rb((t*=e)/(i.fromCents?1:vSe(i.precision)),i)},divide:function(e){var t=this.intValue,i=this.s;return rb(t/=Mz(e,i,!1),i)},distribute:function(e){for(var t=this.intValue,i=this.p,r=this.s,s=[],o=Math[t>=0?"floor":"ceil"](t/e),a=Math.abs(t-o*e),l=r.fromCents?1:i;e!==0;e--){var c=rb(o/l,r);a-- >0&&(c=c[t>=0?"add":"subtract"](1/l)),s.push(c)}return s},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 EZt(e/t,i.increment).toFixed(i.precision)},toJSON:function(){return this.value}};function rJe(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 R8;(function(n){n.event="event",n.props="prop"})(R8||(R8={}));function yS(){}function LZt(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(s,o){return s===e[o]})||(e=i,t=n.apply(void 0,i)),t}}function P8(n){return!!(n||"").match(/\d/)}function xP(n){return n==null}function AZt(n){return typeof n=="number"&&isNaN(n)}function sJe(n){return xP(n)||AZt(n)||typeof n=="number"&&!isFinite(n)}function oJe(n){return n.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function NZt(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 DZt(n,e,t){var i=NZt(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 RZt(n){var e=x.useRef(n);e.current=n;var t=x.useRef(function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e.current.apply(e,i)});return t.current}function bSe(n,e){e===void 0&&(e=!0);var t=n[0]==="-",i=t&&e;n=n.replace("-","");var r=n.split("."),s=r[0],o=r[1]||"";return{beforeDecimal:s,afterDecimal:o,hasNegation:t,addNegation:i}}function PZt(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 aJe(n,e,t){for(var i="",r=t?"0":"",s=0;s<=e-1;s++)i+=n[s]||r;return i}function F3e(n,e){return Array(e+1).join(n)}function lJe(n){var e=n+"",t=e[0]==="-"?"-":"";t&&(e=e.substring(1));var i=e.split(/[eE]/g),r=i[0],s=i[1];if(s=Number(s),!s)return t+r;r=r.replace(".","");var o=1+s,a=r.length;return o<0?r="0."+F3e("0",Math.abs(o))+r:o>=a?r=r+F3e("0",o-a):r=(r.substring(0,o)||"0")+"."+r.substring(o),t+r}function B3e(n,e,t){if(["","-"].indexOf(n)!==-1)return n;var i=(n.indexOf(".")!==-1||t)&&e,r=bSe(n),s=r.beforeDecimal,o=r.afterDecimal,a=r.hasNegation,l=parseFloat("0."+(o||"0")),c=o.length<=e?"0."+o:l.toFixed(e),u=c.split("."),d=s;s&&Number(u[0])&&(d=s.split("").reverse().reduce(function(m,_,v){return m.length>v?(Number(m[0])+Number(_)).toString()+m.substring(1,m.length):_+m},u[0]));var f=aJe(u[1]||"",e,t),p=a?"-":"",g=i?".":"";return""+p+d+g+f}function p2(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 cJe=LZt(function(n,e){for(var t=0,i=0,r=n.length,s=e.length;n[t]===e[t]&&t<r;)t++;for(;n[r-1-i]===e[s-1-i]&&s-i>t&&r-i>t;)i++;return{from:{start:t,end:r-i},to:{start:t,end:s-i}}}),OZt=function(n,e){var t=Math.min(n.selectionStart,e);return{from:{start:t,end:n.selectionEnd},to:{start:t,end:e}}};function MZt(n,e,t){return Math.min(Math.max(n,e),t)}function ele(n){return Math.max(n.selectionStart,n.selectionEnd)}function jZt(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function FZt(n){return{from:{start:0,end:0},to:{start:0,end:n.length},lastValue:""}}function BZt(n){var e=n.currentValue,t=n.formattedValue,i=n.currentValueIndex,r=n.formattedValueIndex;return e[i]===t[r]}function $Zt(n,e,t,i,r,s,o){o===void 0&&(o=BZt);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={},f=new Array(c),p=0;p<c;p++){f[p]=-1;for(var g=0,m=u;g<m;g++){var _=o({currentValue:t,lastValue:e,formattedValue:n,currentValueIndex:p,formattedValueIndex:g});if(_&&d[g]!==!0){f[p]=g,d[g]=!0;break}}}for(var v=i;v<c&&(f[v]===-1||!s(t[v]));)v++;var b=v===c||f[v]===-1?u:f[v];for(v=i-1;v>0&&f[v]===-1;)v--;var y=v===-1||f[v]===-1?0:f[v]+1;return y>b?b:i-y<b-i?y:b}function $3e(n,e,t,i){var r=n.length;if(e=MZt(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 HZt(n){for(var e=Array.from({length:n.length+1}).map(function(){return!0}),t=0,i=e.length;t<i;t++)e[t]=!!(P8(n[t])||P8(n[t-1]));return e}function uJe(n,e,t,i,r,s){s===void 0&&(s=yS);var o=RZt(function(g,m){var _,v;return sJe(g)?(v="",_=""):typeof g=="number"||m?(v=typeof g=="number"?lJe(g):g,_=i(v)):(v=r(g,void 0),_=i(v)),{formattedValue:_,numAsString:v}}),a=x.useState(function(){return o(xP(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}),s(g,m)},d=n,f=t;xP(n)&&(d=l.numAsString,f=!0);var p=o(d,f);return x.useMemo(function(){c(p)},[p.formattedValue]),[l,u]}function VZt(n){return n.replace(/[^0-9]/g,"")}function WZt(n){return n}function zZt(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,s=n.getInputRef,o=n.format;o===void 0&&(o=WZt);var a=n.removeFormatting;a===void 0&&(a=VZt);var l=n.defaultValue,c=n.valueIsNumericString,u=n.onValueChange,d=n.isAllowed,f=n.onChange;f===void 0&&(f=yS);var p=n.onKeyDown;p===void 0&&(p=yS);var g=n.onMouseUp;g===void 0&&(g=yS);var m=n.onFocus;m===void 0&&(m=yS);var _=n.onBlur;_===void 0&&(_=yS);var v=n.value,b=n.getCaretBoundary;b===void 0&&(b=HZt);var y=n.isValidInputCharacter;y===void 0&&(y=P8);var C=n.isCharacterSame,S=rJe(n,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),k=uJe(v,l,!!c,o,a,u),I=k[0],L=I.formattedValue,N=I.numAsString,P=k[1],O=x.useRef(),F=x.useRef({formattedValue:L,numAsString:N}),V=function(ft,tt){F.current={formattedValue:ft.formattedValue,numAsString:ft.value},P(ft,tt)},M=x.useState(!1),B=M[0],W=M[1],q=x.useRef(null),U=x.useRef({setCaretTimeout:null,focusTimeout:null});x.useEffect(function(){return W(!0),function(){clearTimeout(U.current.setCaretTimeout),clearTimeout(U.current.focusTimeout)}},[]);var G=o,H=function(ft,tt){var St=parseFloat(tt);return{formattedValue:ft,value:tt,floatValue:isNaN(St)?void 0:St}},z=function(ft,tt,St){ft.selectionStart===0&&ft.selectionEnd===ft.value.length||(p2(ft,tt),U.current.setCaretTimeout=setTimeout(function(){ft.value===St&&ft.selectionStart!==tt&&p2(ft,tt)},0))},Z=function(ft,tt,St){return $3e(ft,tt,b(ft),St)},X=function(ft,tt,St){var Ft=b(tt),en=$Zt(tt,L,ft,St,Ft,y,C);return en=$3e(tt,en,Ft),en},oe=function(ft){var tt=ft.formattedValue;tt===void 0&&(tt="");var St=ft.input,Ft=ft.source,en=ft.event,Ke=ft.numAsString,dt;if(St){var nt=ft.inputValue||St.value,at=ele(St);St.value=tt,dt=X(nt,tt,at),dt!==void 0&&z(St,dt,tt)}tt!==L&&V(H(tt,Ke),{event:en,source:Ft})};x.useEffect(function(){var ft=F.current,tt=ft.formattedValue,St=ft.numAsString;(L!==tt||N!==St)&&V(H(L,N),{event:void 0,source:R8.props})},[L,N]);var fe=q.current?ele(q.current):void 0,Se=typeof window<"u"?x.useLayoutEffect:x.useEffect;Se(function(){var ft=q.current;if(L!==F.current.formattedValue&&ft){var tt=X(F.current.formattedValue,L,fe);ft.value=L,z(ft,tt,L)}},[L]);var Me=function(ft,tt,St){var Ft=tt.target,en=O.current?OZt(O.current,Ft.selectionEnd):cJe(L,ft),Ke=Object.assign(Object.assign({},en),{lastValue:L}),dt=a(ft,Ke),nt=G(dt);if(dt=a(nt,void 0),d&&!d(H(nt,dt))){var at=tt.target,Oe=ele(at),ce=X(ft,L,Oe);return at.value=L,z(at,ce,L),!1}return oe({formattedValue:nt,numAsString:dt,inputValue:ft,event:tt,source:St,input:tt.target}),!0},Ie=function(ft,tt){tt===void 0&&(tt=0);var St=ft.selectionStart,Ft=ft.selectionEnd;O.current={selectionStart:St,selectionEnd:Ft+tt}},ge=function(ft){var tt=ft.target,St=tt.value,Ft=Me(St,ft,R8.event);Ft&&f(ft),O.current=void 0},ye=function(ft){var tt=ft.target,St=ft.key,Ft=tt.selectionStart,en=tt.selectionEnd,Ke=tt.value;Ke===void 0&&(Ke="");var dt;St==="ArrowLeft"||St==="Backspace"?dt=Math.max(Ft-1,0):St==="ArrowRight"?dt=Math.min(Ft+1,Ke.length):St==="Delete"&&(dt=Ft);var nt=0;St==="Delete"&&Ft===en&&(nt=1);var at=St==="ArrowLeft"||St==="ArrowRight";if(dt===void 0||Ft!==en&&!at){p(ft),Ie(tt,nt);return}var Oe=dt;if(at){var ce=St==="ArrowLeft"?"left":"right";Oe=Z(Ke,dt,ce),Oe!==dt&&ft.preventDefault()}else St==="Delete"&&!y(Ke[dt])?Oe=Z(Ke,dt,"right"):St==="Backspace"&&!y(Ke[dt])&&(Oe=Z(Ke,dt,"left"));Oe!==dt&&z(tt,Oe,Ke),p(ft),Ie(tt,nt)},Pe=function(ft){var tt=ft.target,St=function(){var Ft=tt.selectionStart,en=tt.selectionEnd,Ke=tt.value;if(Ke===void 0&&(Ke=""),Ft===en){var dt=Z(Ke,Ft);dt!==Ft&&z(tt,dt,Ke)}};St(),requestAnimationFrame(function(){St()}),g(ft),Ie(tt)},Be=function(ft){ft.persist&&ft.persist();var tt=ft.target,St=ft.currentTarget;q.current=tt,U.current.focusTimeout=setTimeout(function(){var Ft=tt.selectionStart,en=tt.selectionEnd,Ke=tt.value;Ke===void 0&&(Ke="");var dt=Z(Ke,Ft);dt!==Ft&&!(Ft===0&&en===Ke.length)&&z(tt,dt,Ke),m(Object.assign(Object.assign({},ft),{currentTarget:St}))},0)},$e=function(ft){q.current=null,clearTimeout(U.current.focusTimeout),clearTimeout(U.current.setCaretTimeout),_(ft)},qe=B&&jZt()?"numeric":void 0,mt=Object.assign({inputMode:qe},S,{type:e,value:L,onChange:ge,onKeyDown:ye,onMouseUp:Pe,onFocus:Be,onBlur:$e});if(t==="text")return r?we.createElement(we.Fragment,null,r(L,S)||null):we.createElement("span",Object.assign({},S,{ref:s}),L);if(i){var vt=i;return we.createElement(vt,Object.assign({},mt,{ref:s}))}return we.createElement("input",Object.assign({},mt,{ref:s}))}function mpe(n,e){var t=e.decimalScale,i=e.fixedDecimalScale,r=e.prefix;r===void 0&&(r="");var s=e.suffix;s===void 0&&(s="");var o=e.allowNegative,a=e.thousandsGroupStyle;if(a===void 0&&(a="thousand"),n===""||n==="-")return n;var l=eee(e),c=l.thousandSeparator,u=l.decimalSeparator,d=t!==0&&n.indexOf(".")!==-1||t&&i,f=bSe(n,o),p=f.beforeDecimal,g=f.afterDecimal,m=f.addNegation;return t!==void 0&&(g=aJe(g,t,!!i)),c&&(p=DZt(p,c,a)),r&&(p=r+p),s&&(g=g+s),m&&(p="-"+p),n=p+(d&&u||"")+g,n}function eee(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 UZt(n,e){n===void 0&&(n="");var t=new RegExp("(-)"),i=new RegExp("(-)(.)*(-)"),r=t.test(n),s=i.test(n);return n=n.replace(/-/g,""),r&&!s&&e&&(n="-"+n),n}function qZt(n,e){return new RegExp("(^-)|[0-9]|"+oJe(n),"g")}function KZt(n,e,t){return n===""?!0:!(e!=null&&e.match(/\d/))&&!(t!=null&&t.match(/\d/))&&typeof n=="string"&&!isNaN(Number(n))}function GZt(n,e,t){var i;e===void 0&&(e=FZt(n));var r=t.allowNegative,s=t.prefix;s===void 0&&(s="");var o=t.suffix;o===void 0&&(o="");var a=t.decimalScale,l=e.from,c=e.to,u=c.start,d=c.end,f=eee(t),p=f.allowedDecimalSeparators,g=f.decimalSeparator,m=n[d]===g;if(P8(n)&&(n===s||n===o)&&e.lastValue==="")return n;if(d-u===1&&p.indexOf(n[u])!==-1){var _=a===0?"":g;n=n.substring(0,u)+_+n.substring(u+1,n.length)}var v=function(q,U,G){var H=!1,z=!1;s.startsWith("-")?H=!1:q.startsWith("--")?(H=!1,z=!0):o.startsWith("-")&&q.length===o.length?H=!1:q[0]==="-"&&(H=!0);var Z=H?1:0;return z&&(Z=2),Z&&(q=q.substring(Z),U-=Z,G-=Z),{value:q,start:U,end:G,hasNegation:H}},b=v(n,u,d),y=b.hasNegation;i=b,n=i.value,u=i.start,d=i.end;var C=v(e.lastValue,l.start,l.end),S=C.start,k=C.end,I=C.value,L=n.substring(u,d);n.length&&I.length&&(S>I.length-o.length||k<s.length)&&!(L&&o.startsWith(L))&&(n=I);var N=0;n.startsWith(s)?N+=s.length:u<s.length&&(N=u),n=n.substring(N),d-=N;var P=n.length,O=n.length-o.length;n.endsWith(o)?P=O:(d>O||d>n.length-o.length)&&(P=d),n=n.substring(0,P),n=UZt(y?"-"+n:n,r),n=(n.match(qZt(g))||[]).join("");var F=n.indexOf(g);n=n.replace(new RegExp(oJe(g),"g"),function(q,U){return U===F?".":""});var V=bSe(n,r),M=V.beforeDecimal,B=V.afterDecimal,W=V.addNegation;return c.end-c.start<l.end-l.start&&M===""&&m&&!parseFloat(B)&&(n=W?"-":""),n}function YZt(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}),s=n[0]==="-";r.fill(!1,0,t.length+(s?1:0));var o=n.length;return r.fill(!1,o-i.length+1,o+1),r}function QZt(n){var e=eee(n),t=e.thousandSeparator,i=e.decimalSeparator,r=n.prefix;r===void 0&&(r="");var s=n.allowNegative;if(s===void 0&&(s=!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("-")&&s&&(console.error(` Prefix can't start with '-' when allowNegative is true. prefix: `+r+` allowNegative: `+s+` `),s=!1),Object.assign(Object.assign({},n),{allowNegative:s})}function XZt(n){n=QZt(n),n.decimalSeparator,n.allowedDecimalSeparators,n.thousandsGroupStyle;var e=n.suffix,t=n.allowNegative,i=n.allowLeadingZeros,r=n.onKeyDown;r===void 0&&(r=yS);var s=n.onBlur;s===void 0&&(s=yS);var o=n.thousandSeparator,a=n.decimalScale,l=n.fixedDecimalScale,c=n.prefix;c===void 0&&(c="");var u=n.defaultValue,d=n.value,f=n.valueIsNumericString,p=n.onValueChange,g=rJe(n,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),m=eee(n),_=m.decimalSeparator,v=m.allowedDecimalSeparators,b=function(W){return mpe(W,n)},y=function(W,q){return GZt(W,q,n)},C=xP(d)?u:d,S=f??KZt(C,c,e);xP(d)?xP(u)||(S=S||typeof u=="number"):S=S||typeof d=="number";var k=function(W){return sJe(W)?W:(typeof W=="number"&&(W=lJe(W)),S&&typeof a=="number"?B3e(W,a,!!l):W)},I=uJe(k(d),k(u),!!S,b,y,p),L=I[0],N=L.numAsString,P=L.formattedValue,O=I[1],F=function(W){var q=W.target,U=W.key,G=q.selectionStart,H=q.selectionEnd,z=q.value;if(z===void 0&&(z=""),(U==="Backspace"||U==="Delete")&&H<c.length){W.preventDefault();return}if(G!==H){r(W);return}U==="Backspace"&&z[0]==="-"&&G===c.length+1&&t&&p2(q,1),a&&l&&(U==="Backspace"&&z[G-1]===_?(p2(q,G-1),W.preventDefault()):U==="Delete"&&z[G]===_&&W.preventDefault()),v!=null&&v.includes(U)&&z[G]===_&&p2(q,G+1);var Z=o===!0?",":o;U==="Backspace"&&z[G-1]===Z&&p2(q,G-1),U==="Delete"&&z[G]===Z&&p2(q,G+1),r(W)},V=function(W){var q=N;if(q.match(/\d/g)||(q=""),i||(q=PZt(q)),l&&a&&(q=B3e(q,a,l)),q!==N){var U=mpe(q,n);O({formattedValue:U,value:q,floatValue:parseFloat(q)},{event:W,source:R8.event})}s(W)},M=function(W){return W===_?!0:P8(W)},B=function(W){var q=W.currentValue,U=W.lastValue,G=W.formattedValue,H=W.currentValueIndex,z=W.formattedValueIndex,Z=q[H],X=G[z],oe=cJe(U,q),fe=oe.to,Se=function(Me){return y(Me).indexOf(".")+c.length};return d===0&&l&&a&&q[fe.start]===_&&Se(q)<H&&Se(G)>z?!1:H>=fe.start&&H<fe.end&&v&&v.includes(Z)&&X===_?!0:Z===X};return Object.assign(Object.assign({},g),{value:P,valueIsNumericString:!1,isValidInputCharacter:M,isCharacterSame:B,onValueChange:O,format:b,removeFormatting:y,getCaretBoundary:function(W){return YZt(W,n)},onKeyDown:F,onBlur:V})}function ZZt(n){var e=XZt(n);return we.createElement(zZt,Object.assign({},e))}function Qs(n){const e=xt(),t=zi(),i=Qo({overwrite:!1}),[r,s]=x.useState(typeof n.value=="number"?n.value:n.value?parseFloat(String(n.value)):void 0),o=()=>{if(n.precision!==0)return t!=null&&t.use_comma_as_decimal_place?",":"."},a=c=>{var d,f;const u=o();if(u===void 0)return 0;if(n.disablePrecision&&c)return c.includes(u)?((f=(d=c.split(u))==null?void 0:d[1])==null?void 0:f.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 xL(()=>{n.onValueChange&&n.changeOverride&&n.onValueChange(typeof r=="number"?String(r):"0")},500,[r]),x.useEffect(()=>{s(n.value?parseFloat(String(n.value)):void 0)},[n.value]),h.jsxs("section",{style:{width:n.width},children:[n.label&&h.jsxs(Lh,{className:$t("mb-1",{"whitespace-nowrap":n.withoutLabelWrapping}),for:n.id,children:[n.label,n.required&&h.jsx("span",{className:"ml-1 text-red-600",children:"*"})]}),h.jsx("div",{className:"relative",children:h.jsx(ZZt,{className:$t(`w-full py-2 px-3 rounded-md text-sm disabled:opacity-75 disabled:cursor-not-allowed focus:outline-none focus:ring-0 ${n.className}`,{border:n.border!==!1,"border-[#09090B26] focus:border-black":!i.dark_mode,"border-[#1f2e41] focus:border-white":i.dark_mode}),value:r||"",placeholder:n.placeholder??void 0,onChange:c=>{if(n.onValueChange&&n.changeOverride){const u=c.target.value,d=u?rb(u,{separator:l(),decimal:o(),symbol:"",precision:a(u)===void 0?0:a(u)}).value:void 0;s(d)}},onBlur:c=>{if(n.onValueChange&&!n.changeOverride){const u=c.target.value,d=u?String(rb(u,{separator:l(),decimal:o(),symbol:"",precision:a(u)===void 0?0:a(u)}).value):"0";n.onValueChange(d)}},thousandSeparator:l(),decimalSeparator:o(),decimalScale:a(),allowNegative:!0,style:{backgroundColor:e.$1,color:e.$3,...n.style},disabled:n.disabled})}),h.jsx(Kl,{className:"mt-2",children:n.errorMessage})]})}function JZt(){const[n]=xe(),e=Fr();xt();const t=Qo(),i=(r,s)=>{e(uA({property:r,value:s}))};return h.jsxs("div",{className:"space-y-4",children:[h.jsx(ne,{leftSide:n("show_pdf_preview"),children:h.jsx(jt,{checked:typeof t.show_pdf_preview=="boolean"?t.show_pdf_preview:!0,onValueChange:r=>i("company_user.react_settings.show_pdf_preview",r)})}),h.jsx(ne,{leftSide:n("show_document_preview"),children:h.jsx(jt,{checked:!!t.show_document_preview,onValueChange:r=>i("company_user.react_settings.show_document_preview",r)})}),h.jsx(ne,{leftSide:n("react_notification_link"),leftSideHelp:n("react_notification_link_help"),children:h.jsx(jt,{checked:t.react_notification_link,onValueChange:r=>i("company_user.react_settings.react_notification_link",r)})}),h.jsx(ne,{leftSide:n("number_precision"),leftSideHelp:n("number_precision_help"),children:h.jsx(Qs,{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})}),h.jsx(ne,{leftSide:n("dark_mode"),children:h.jsx(jt,{checked:!!(t!=null&&t.dark_mode),onChange:r=>i("company_user.react_settings.dark_mode",r)})}),h.jsx(ne,{leftSide:n("show_table_footer"),leftSideHelp:n("show_table_footer_help"),children:h.jsx(jt,{checked:!!(t!=null&&t.show_table_footer),onValueChange:r=>i("company_user.react_settings.show_table_footer",r)})}),h.jsx(ne,{leftSide:n("auto_expand_product_table_notes"),leftSideHelp:n("auto_expand_product_table_notes_help"),children:h.jsx(jt,{checked:!!t.preferences.auto_expand_product_table_notes,onValueChange:r=>i("company_user.react_settings.preferences.auto_expand_product_table_notes",r)})}),h.jsx(ne,{leftSide:n("enable_public_notifications"),leftSideHelp:n("enable_public_notifications_help"),children:h.jsx(jt,{checked:!!t.preferences.enable_public_notifications,onValueChange:r=>i("company_user.react_settings.preferences.enable_public_notifications",r)})}),h.jsx(ne,{leftSide:n("use_system_fonts"),leftSideHelp:n("use_system_fonts_help"),children:h.jsx(jt,{checked:!!t.preferences.use_system_fonts,onValueChange:r=>i("company_user.react_settings.preferences.use_system_fonts",r)})}),h.jsx(L5t,{}),h.jsxs(tle,{title:`${n("dashboard")} ${n("charts")}`,path:"dashboard_charts",children:[h.jsx(H5,{path:"dashboard_charts.default_view"}),h.jsx(H5,{path:"dashboard_charts.currency"}),h.jsx(H5,{path:"dashboard_charts.range"})]}),h.jsx(tle,{title:n("datatable"),path:"datatables",children:h.jsx(H5,{path:"datatables.clients.sort"})}),h.jsx(tle,{title:n("reports"),path:"reports",children:h.jsx(H5,{path:"reports.columns"})})]})}function tle({title:n,children:e,path:t}){const i=xt(),{preferences:r}=qw();return JSON.stringify(pn.get(ZU,t))===JSON.stringify(pn.get(r,t))?null:h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-4 sm:px-6 pt-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:i.$20})}),h.jsxs("div",{className:"px-4 sm:px-6",children:[h.jsx("div",{className:"text-lg pt-4 pb-2 font-medium",children:n}),h.jsx("div",{children:e})]})]})}function H5({path:n}){const e=xt(),{preferences:t,update:i}=qw(),{t:r}=xe(),s={"dashboard_charts.default_view":`${r("default")} ${r("view")}`,"dashboard_charts.currency":r("currency"),"dashboard_charts.range":r("range"),"datatables.clients.sort":`${r("clients")} ${r("sort")}`,"reports.columns":r("columns")};return pn.get(ZU,n)===pn.get(t,n)?null:h.jsxs("div",{className:"flex items-center justify-between w-60 py-3 px-4 sm:px-6",children:[h.jsx("div",{className:"text-sm font-medium",children:s[n]}),h.jsx("div",{className:"hover:opacity-75 cursor-pointer",onClick:()=>i(`preferences.${n}`,pn.get(ZU,n)),children:h.jsx(c1,{color:e.$16,hoverColor:e.$3,borderColor:e.$5,hoverBorderColor:e.$17,size:"1.6rem"})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function eJt(){const{t:n}=xe();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",enabled:To()},{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 tJt(){vr("user_details");const[n]=xe(),e=Fr(),t=Ml(),{isAdmin:i}=go(),r=xt(),s=eJt(),o=xu(),a=Wm(),[l,c]=x.useState(),[u,d]=x.useState(!1),f=[{name:n("settings"),href:"/settings"},{name:n("user_details"),href:"/settings/user_details"}],[p,g]=oo(FJ),[m,_]=x.useState(!1),[v,b]=x.useState(!1),y=Cu(k=>k.user),{save:C}=qw(),S=(k,I)=>{if(v)return;b(!0),pe.processing(),c(void 0);const L=[Je("PUT",ze("/api/v1/users/:id?include=company_user",{id:t.id}),y.changes,{headers:{"X-Api-Password":k}})];i&&L.push(Je("PUT",ze("/api/v1/companies/:id",{id:o==null?void 0:o.id}),o)),Nc.all(L).then(N=>{pe.success("updated_settings"),ii(["users"]),p&&(ii(["statics"]),g(!1)),N[0].data.data.phone!==(t==null?void 0:t.phone)&&(t!=null&&t.google_2fa_secret)&&!N[0].data.data.verified_phone_number&&d(!0),e(iw(N[0].data.data)),e(rw()),window.dispatchEvent(new CustomEvent("user.updated")),i&&(e(gk({object:"company",data:N[1].data.data})),e(zu("company")))}).catch(N=>{var P,O;((P=N.response)==null?void 0:P.status)===412&&(a(I),_(!0)),((O=N.response)==null?void 0:O.status)==422&&(pe.dismiss(),c(N.response.data))}).finally(()=>b(!1)),C({silent:!0})};return x.useEffect(()=>{e(ZWe())},[t]),h.jsxs(h.Fragment,{children:[h.jsxs(Kr,{onSaveClick:()=>_(!0),onCancelClick:()=>e(rw()),title:n("user_details"),breadcrumbs:f,docsLink:"en/basic-settings/#user_details",disableSaveButton:v,children:[h.jsx(wg,{show:m,onClose:_,onSave:S}),h.jsxs(er,{className:"shadow-sm",title:n("user_details"),withoutBodyPadding:!0,withoutHeaderBorder:!0,style:{borderColor:r.$24},children:[h.jsx(wk,{tabs:s,withHorizontalPadding:!0,fullRightPadding:!0,withHorizontalPaddingOnSmallScreen:!0}),h.jsx("div",{className:"pt-4 pb-8",children:h.jsx(Hm,{context:l})})]})]}),h.jsx(nJe,{checkVerification:u,setCheckVerification:d,checkOnlyPhoneNumberVerification:!0})]})}function nJt(){var m,_;const[n]=xe(),e=Fr(),t=xt(),i=Nr(),[r,s]=x.useState(""),[o,a]=x.useState(!1),l=[{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")}],[c,u]=x.useState(l);x.useEffect(()=>{var b;const v=Object.keys(((b=i==null?void 0:i.settings)==null?void 0:b.translations)??[]);u(l.filter(y=>!v.includes(y.property)))},[i]);const d=v=>{const b=l.find(y=>y.property===v);return b?b.translation:n(v)},f=v=>{var y;const b=pn.cloneDeep(i);(((y=b.settings.translations)==null?void 0:y.length)<=1||!b.settings.translations)&&(b.settings.translations={}),b.settings.translations[v]="",e(ME({object:"company",data:b}))},p=v=>e(Uo({object:"company",property:v.target.id,value:v.target.value})),g=v=>{var y;const b=pn.cloneDeep(i);(y=b==null?void 0:b.settings)==null||delete y.translations[v],e(ME({object:"company",data:b}))};return h.jsxs(h.Fragment,{children:[h.jsxs(pr,{title:n("add_custom"),visible:o,onClose:a,children:[h.jsx(lt,{onChange:v=>s(v.target.value),id:"custom_field",label:n("custom_field")}),h.jsx(dn,{onClick:()=>{f(r),s(""),a(!1)},children:n("submit")}),h.jsx(Ji,{external:!0,to:"https://github.com/invoiceninja/invoiceninja/blob/master/resources/lang/en/texts.php",children:n("labels")})]}),h.jsx(ne,{leftSide:h.jsxs(Dn,{onValueChange:v=>f(v),customSelector:!0,clearAfterSelection:!0,children:[h.jsx("option",{value:""}),c.map(v=>h.jsx("option",{value:v.property,children:v.translation},v.property))]}),children:h.jsx(dn,{behavior:"button",type:"secondary",onClick:()=>a(!0),children:n("add_custom")})}),Object.keys(((m=i==null?void 0:i.settings)==null?void 0:m.translations)??[]).length>0&&h.jsx("div",{className:"px-4 sm:px-6 pt-2 pb-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:t.$20})}),Object.keys(((_=i==null?void 0:i.settings)==null?void 0:_.translations)??[]).map(v=>{var b;return h.jsx(ne,{leftSide:d(v),children:h.jsxs("div",{className:"flex items-center space-x-4",children:[h.jsx(lt,{value:((b=i==null?void 0:i.settings)==null?void 0:b.translations[v])||"",onChange:p,id:`settings.translations.${v}`}),h.jsx("div",{className:"cursor-pointer",onClick:()=>g(v),children:h.jsx(c1,{color:t.$16,hoverColor:t.$3,borderColor:t.$5,hoverBorderColor:t.$17,size:"1.6rem"})})]})},v)})]})}function cn(n){const{propertyKey:e,defaultValue:t="",onCheckboxChange:i}=n,{isCompanySettingsActive:r}=el(),s=Nr(),o=Xs(),[a,l]=x.useState(typeof(s==null?void 0:s.settings[e])<"u"),c=u=>{l(u);const d=pn.cloneDeep(s==null?void 0:s.settings);d&&(u&&!Object.hasOwn(s==null?void 0:s.settings,e)&&(d[e]=t),!u&&Object.hasOwn(s==null?void 0:s.settings,e)&&delete d[e],o("settings",d))};return x.useEffect(()=>{c(a)},[a]),x.useEffect(()=>{s&&Object.hasOwn(s.settings,e)&&c(!0)},[e]),x.useEffect(()=>{typeof n.checked=="boolean"&&l(n.checked)},[n.checked]),h.jsxs("div",{className:"flex items-center space-x-2",children:[!r&&h.jsx(Vd,{checked:a,onValueChange:(u,d)=>{l(!!d),i==null||i(!!d)}}),h.jsx("div",{className:$t({"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 cl(){const n=Nr(),{isCompanySettingsActive:e}=el();return t=>n&&typeof n.settings[t]>"u"&&!e}function un(n){const{label:e,helpLabel:t,required:i}=n,r=xt();return h.jsxs("div",{className:"flex flex-col text-sm",children:[h.jsxs("span",{className:"font-medium",style:{color:r.$22},children:[e,i&&h.jsx("span",{className:"ml-1 text-red-600",children:"*"})]}),t&&h.jsx(h.Fragment,{children:typeof t=="string"?h.jsx("span",{className:"text-xs",dangerouslySetInnerHTML:{__html:t},style:{color:r.$22,opacity:.8}}):h.jsx("div",{className:"text-xs",style:{color:r.$22,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 ySe(){const{data:n}=Zd(),[e,t]=x.useState([]);return x.useEffect(()=>{n!=null&&n.currencies&&t(n.currencies)},[n]),e}function HO(n){const e=ySe(),{additionalCurrencies:t=[]}=n;return h.jsxs(Dn,{value:n.value,onValueChange:n.onChange,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,customSelector:!0,children:[t.map((i,r)=>h.jsx("option",{value:i.id,children:i.label},r)),e.map((i,r)=>h.jsxs("option",{value:i.id,children:[i.name," (",i.code,")"]},r))]})}/** * 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 _pe(n,e=0,t=".",i=","){const r=typeof n=="string"?parseFloat(n):n,s=r<0?"-":"",o=Math.abs(r).toFixed(e).toString().split("."),a=o[0],l=o[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 s+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 CSe=class{static formatValue(e,t){const i=t.thousand_separator,r=t.decimal_separator,s=t.precision;return _pe(e,s,r,i)}static formatMoney(e,t,i,r){var f,p;let s=t.thousand_separator,o=t.decimal_separator,a=t.swap_currency_symbol;const l=t.precision,c=t.code;((f=i.thousand_separator)==null?void 0:f.length)>=1&&(s=i.thousand_separator),((p=i.decimal_separator)==null?void 0:p.length)>=1&&(o=i.decimal_separator),i.swap_currency_symbol&&(a=i.swap_currency_symbol);const u=_pe(e,l,o,s),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 xk(){const n=kxe();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 Sk(n){const e=ySe(),{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 vf(){const n=xk(),e=Sk(),t=zi();return(i,r,s,o,a)=>{const l=r||(t==null?void 0:t.settings.country_id),c=s&&s!=="999"?s:t==null?void 0:t.settings.currency_id,u=n(l),d=e(c);return u&&d?CSe.formatMoney(isNaN(Number(i))?0:i,d,u,{showCurrencyCode:a??t.settings.show_currency_code}):o?Number(i).toFixed(o):i}}function iJt(){var f,p,g,m,_,v,b;const[n]=xe(),{data:e}=Zd(),t=xt(),i=xu(),{isCompanySettingsActive:r}=el(),s=Fr(),o=vf(),a=cl(),l=Xs(),c=ji(ya),u=ts(FJ),d=[{id:"symbol",title:`${n("currency_symbol")}: ${o(1e3,i==null?void 0:i.settings.country_id,i==null?void 0:i.settings.currency_id,2)}`,value:"false"},{id:"code",title:`${n("currency_code")}: ${o(1e3,i==null?void 0:i.settings.country_id,i==null?void 0:i.settings.currency_id,2,!0)}`,value:"true"}];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"currency_id",labelElement:h.jsx(un,{label:n("currency")}),defaultValue:"1"}),children:h.jsx(HO,{value:(i==null?void 0:i.settings.currency_id)||"",onChange:y=>l("settings.currency_id",y),disabled:a("currency_id"),errorMessage:c==null?void 0:c.errors["settings.currency_id"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"show_currency_code",labelElement:h.jsx(un,{label:n("currency_format")}),defaultValue:"false"}),children:h.jsx(uqe,{onValueChange:y=>s(Uo({object:"company",property:"settings.show_currency_code",value:y==="true"})),name:"show_currency_code",options:d,defaultSelected:((p=(f=i==null?void 0:i.settings)==null?void 0:f.show_currency_code)==null?void 0:p.toString())??"false",disabled:a("show_currency_code")})}),!bw()&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"language_id",labelElement:h.jsx(un,{label:n("language")}),defaultValue:"1"}),children:h.jsx(C9,{onChange:y=>{u(!0),l("settings.language_id",y)},value:((g=i==null?void 0:i.settings)==null?void 0:g.language_id)||"",disabled:a("language_id"),errorMessage:c==null?void 0:c.errors["settings.language_id"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"timezone_id",labelElement:h.jsx(un,{label:n("time_zone")}),defaultValue:"1"}),children:h.jsx(Dn,{value:((m=i==null?void 0:i.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),customSelector:!0,children:e==null?void 0:e.timezones.sort((y,C)=>y.name.localeCompare(C.name)).map(y=>h.jsx("option",{value:y.id,children:y.name},y.id))})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"date_format_id",labelElement:h.jsx(un,{label:n("date_format")}),defaultValue:"1"}),children:h.jsx(Dn,{value:((_=i==null?void 0:i.settings)==null?void 0:_.date_format_id)||"1",onValueChange:y=>l("settings.date_format_id",y),disabled:a("date_format_id"),errorMessage:c==null?void 0:c.errors["settings.date_format_id"],customSelector:!0,dismissable:!1,children:e==null?void 0:e.date_formats.map(y=>h.jsx("option",{value:y.id,children:Jn().format(y.format_moment)},y.id))})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"military_time",labelElement:h.jsx(un,{label:n("military_time")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!((v=i==null?void 0:i.settings)!=null&&v.military_time),onChange:y=>s(Uo({object:"company",property:"settings.military_time",value:y})),disabled:a("military_time"),cypressRef:"militaryTimeToggle"})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"enable_rappen_rounding",labelElement:h.jsx(un,{label:n("rappen_rounding")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!((b=i==null?void 0:i.settings)!=null&&b.enable_rappen_rounding),onChange:y=>s(Uo({object:"company",property:"settings.enable_rappen_rounding",value:y})),disabled:a("enable_rappen_rounding")})}),r&&h.jsx(ne,{leftSide:n("decimal_comma"),leftSideHelp:n("use_comma_as_decimal_place"),children:h.jsx(jt,{checked:!!(i!=null&&i.use_comma_as_decimal_place),onChange:y=>l("use_comma_as_decimal_place",y)})}),r&&h.jsx("div",{className:"px-4 sm:px-6 pt-2 pb-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:t.$20})}),r&&h.jsx(ne,{leftSide:n("first_month_of_the_year"),children:h.jsxs(Dn,{value:(i==null?void 0:i.first_month_of_year)||"1",onValueChange:y=>l("first_month_of_year",y),errorMessage:c==null?void 0:c.errors["settings.first_month_of_year"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"1",children:n("january")}),h.jsx("option",{value:"2",children:n("february")}),h.jsx("option",{value:"3",children:n("march")}),h.jsx("option",{value:"4",children:n("april")}),h.jsx("option",{value:"5",children:n("may")}),h.jsx("option",{value:"6",children:n("june")}),h.jsx("option",{value:"7",children:n("july")}),h.jsx("option",{value:"8",children:n("august")}),h.jsx("option",{value:"9",children:n("september")}),h.jsx("option",{value:"10",children:n("october")}),h.jsx("option",{value:"11",children:n("november")}),h.jsx("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 rJt(){const[n]=xe(),{isGroupSettingsActive:e,isClientSettingsActive:t}=el();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 sJt(){const[n]=xe();vr("localization");const e=xt(),t=rJt(),i=[{name:n("settings"),href:"/settings"},{name:n("localization"),href:"/settings/localization"}],r=xg(),s=pd(),o=ji(_f);return h.jsx(Kr,{onSaveClick:s,onCancelClick:r,title:n("localization"),breadcrumbs:i,docsLink:"en/basic-settings/#localization",disableSaveButton:o,children:h.jsxs(er,{className:"shadow-sm",title:n("user_details"),withoutBodyPadding:!0,withoutHeaderBorder:!0,style:{borderColor:e.$24},children:[h.jsx(wk,{tabs:t,withHorizontalPadding:!0,fullRightPadding:!0,withHorizontalPaddingOnSmallScreen:!0}),h.jsx("div",{className:"pt-4 pb-8",children:h.jsx(Hm,{})})]})})}function ev(n){const[e]=xe(),t=hs(n.entity);return t===Vr.Active?h.jsx(as,{variant:"primary",children:e("active")}):t===Vr.Archived?h.jsx(as,{variant:"yellow",children:e("archived")}):t===Vr.Deleted?h.jsx(as,{variant:"red",children:e("deleted")}):h.jsx(h.Fragment,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function oJt({size:n="1.2rem",color:e="#000"}){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 12 12",children:h.jsx("path",{d:"m7.75,11c-.192,0-.384-.073-.53-.22L2.97,6.53c-.293-.293-.293-.768,0-1.061L7.22,1.22c.293-.293.768-.293,1.061,0s.293.768,0,1.061l-3.72,3.72,3.72,3.72c.293.293.293.768,0,1.061-.146.146-.338.22-.53.22Z",strokeWidth:"0",fill:e})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function aJt({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 12 12",children:[h.jsx("polyline",{points:"5.75 2 1.75 6 5.75 10",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("polyline",{points:"10.25 2 6.25 6 10.25 10",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-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 */function lJt({size:n="1.2rem",color:e="#000"}){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 12 12",children:h.jsx("path",{d:"m4.25,11c-.192,0-.384-.073-.53-.22-.293-.293-.293-.768,0-1.061l3.72-3.72-3.72-3.72c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l4.25,4.25c.293.293.293.768,0,1.061l-4.25,4.25c-.146.146-.338.22-.53.22Z",strokeWidth:"0",fill: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 w_({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 12 12",children:[h.jsx("path",{d:"m6.25,10.75c-.192,0-.384-.073-.53-.22-.293-.293-.293-.768,0-1.061l3.47-3.47-3.47-3.47c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l4,4c.293.293.293.768,0,1.061l-4,4c-.146.146-.338.22-.53.22Z",fill:e,strokeWidth:"0","data-color":"color-2"}),h.jsx("path",{d:"m1.75,10.75c-.192,0-.384-.073-.53-.22-.293-.293-.293-.768,0-1.061l3.47-3.47L1.22,2.53c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l4,4c.293.293.293.768,0,1.061l-4,4c-.146.146-.338.22-.53.22Z",strokeWidth:"0",fill:e})]})}const gV=As.div` background-color: ${n=>n.theme.backgroundColor}; border-color: ${n=>n.theme.borderColor}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `,cJt={totalPages:1,currentPage:1,currentPerPage:"10",onPageChange:n=>n,onRowsChange:n=>n,totalRecords:0};function dJe(n){n={...cJt,...n};const[e]=xe(),t=xt(),i=r=>{r>=1&&r<=n.totalPages&&n.onPageChange(r)};return h.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mt-3 pb-2",children:[typeof n.totalRecords=="number"&&h.jsxs("span",{className:"text-sm font-medium",children:[e("total_results"),": ",n.totalRecords]}),h.jsxs("div",{className:"flex justify-center space-x-4 items-center",style:{color:t.$3},children:[h.jsxs("div",{className:"flex items-center",children:[h.jsx(gV,{className:"p-2 sm:p-[0.725rem] border rounded-l-md shadow-sm cursor-pointer",theme:{hoverColor:t.$4,backgroundColor:t.$1,borderColor:t.$24},onClick:()=>i(1),children:h.jsx(aJt,{size:"0.9rem",color:t.$3})}),h.jsx(gV,{className:"p-2 sm:p-[0.725rem] border-b border-t border-r rounded-r-md shadow-sm cursor-pointer",theme:{hoverColor:t.$4,backgroundColor:t.$1,borderColor:t.$24},onClick:()=>i(n.currentPage-1),children:h.jsx(oJt,{size:"0.9rem",color:t.$3})})]}),h.jsxs("span",{className:"text-sm font-medium",children:[n.currentPage," / ",n.totalPages]}),h.jsxs("div",{className:"flex",children:[h.jsx(gV,{className:"p-2 sm:p-[0.725rem] border-t border-b border-l rounded-l-md shadow-sm cursor-pointer",theme:{hoverColor:t.$4,backgroundColor:t.$1,borderColor:t.$24},onClick:()=>i(n.currentPage+1),children:h.jsx(lJt,{size:"0.9rem",color:t.$3})}),h.jsx(gV,{className:"p-2 sm:p-[0.725rem] border rounded-r-md shadow-sm cursor-pointer",theme:{hoverColor:t.$4,backgroundColor:t.$1,borderColor:t.$24},onClick:()=>i(n.totalPages),children:h.jsx(w_,{size:"0.9rem",color:t.$3})})]})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsxs("span",{className:"text-sm font-medium",style:{color:t.$3},children:[e("rows"),":"]}),h.jsxs(Dn,{className:"shadow-sm",value:n.currentPerPage,onValueChange:r=>n.onRowsChange(r),customSelector:!0,dismissable:!1,searchable:!1,dropdownIndicatorClassName:"pl-0",children:[h.jsx("option",{value:"10",children:"10"}),h.jsx("option",{value:"50",children:"50"}),h.jsx("option",{value:"100",children:"100"})]})]})]})}function h1(n){var t;const e=xt();return h.jsx("div",{className:$t("flex flex-col",{"mt-2":!n.withoutPadding}),children:h.jsx("div",{className:$t("align-middle inline-block min-w-full",{"py-1.5":!n.withoutPadding}),children:h.jsx("div",{className:$t("overflow-hidden border rounded-md 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:e.$1,color:e.$3,borderColor:e.$24},children:h.jsx("div",{className:`overflow-auto min-w-full rounded-md shadow-sm ${n.className}`,style:{...n.style,height:((t=n.style)==null?void 0:t.height)||"auto"},children:h.jsx("table",{className:$t({"min-w-full table-auto":!n.resizable,"min-w-full table-fixed":n.resizable}),children:n.children})})})})})}function f1(n){const[e]=xe();return h.jsxs("tbody",{style:n.style,ref:n.innerRef,children:[!n.data&&n.showHelperPlaceholders&&h.jsx(hc,{children:h.jsx(bs,{colSpan:20,children:h.jsx(yo,{})})}),n.data&&n.showHelperPlaceholders&&n.data.data.meta.pagination.total===0&&h.jsx(hc,{children:h.jsx(bs,{colSpan:20,children:h.jsx("p",{children:e("empty_table")})})}),n.children]})}const hJe=jJ("columnWidths",{});function uJt(n){const e=x.useRef(null),[t,i]=x.useState(!1),[r,s]=x.useState(0),[o,a]=x.useState(0),[l,c]=oo(hJe),u=x.useCallback(v=>{var S;const y=(S=e.current)==null?void 0:S.offsetWidth,C=v.clientX-e.current.getBoundingClientRect().left;return y&&C>y-10},[e]),d=x.useMemo(()=>n?pn.get(l,n,-1):-1,[l,n]),f=x.useCallback(v=>{n&&c(b=>({...b,[n]:v}))},[n]),p=x.useCallback(v=>{var S,k;if(!n||v.button!==0)return;const b=(S=e.current)==null?void 0:S.offsetWidth,y=v.clientX-e.current.getBoundingClientRect().left;if(b&&y>b-15){i(!0),s(v.clientX),a(b);const I=(k=e.current)==null?void 0:k.closest("table");I&&(I.style.userSelect="none")}},[n]),g=x.useCallback(v=>{if(document.body.style.cursor=u(v)&&n?"ew-resize":"",!t||!e.current||d===null)return;const b=v.clientX-r,y=o+b-45;y>=1&&(f(y),e.current.style.width=`${y}px`)},[t,r,o,d,f]),m=x.useCallback(()=>{var b;i(!1);const v=(b=e.current)==null?void 0:b.closest("table");v&&(v.style.userSelect="")},[]);x.useEffect(()=>{var b;t?(document.addEventListener("mousemove",g),document.addEventListener("mouseup",m)):(document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m));const v=(b=e.current)==null?void 0:b.closest("table");return v&&(t?v.classList.add("is-resizing"):v.classList.remove("is-resizing")),document.body.style.cursor=t&&n?"ew-resize":"",()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m)}},[t,g,m]);const _=x.useCallback(v=>{var S;const y=(S=e.current)==null?void 0:S.offsetWidth,C=v.clientX-e.current.getBoundingClientRect().left;n&&y&&C>y-30&&(f(-1),e.current&&(e.current.style.width="auto"))},[n,f]);return{thRef:e,currentWidth:d,handleMouseDown:p,handleMouseMove:g,handleMouseUp:m,handleDoubleClick:_,setCurrentWidth:f,isResizing:t,inResizeZone:u}}function dJt(n){const{customizeTextColor:e}=n,t=g4(),i=xt(),r=Lo(),{red:s,green:o,blue:a,hex:l}=f4(r),c=p4(s,o,a)?-220:220,u=e?t(l,c):i.$3;return h.jsx(hJt,{...n,color:u})}function hJt(n){const[e]=oo(hJe),t=we.useRef(null);return x.useEffect(()=>{if(t.current){const i=e[n.resizable]??-1;t.current.style.maxWidth=`${i}px`}},[e]),h.jsx("td",{width:n.width,colSpan:n.colSpan,rowSpan:n.rowSpan,onClick:n.onClick,className:$t(`text-sm break-words ${n.className} overflow-hidden whitespace-nowrap text-ellipsis`,{"px-2 lg:px-2.5 xl:px-4 py-2":!n.withoutPadding}),style:{color:n.color,...n.style},ref:t,children:n.children})}const bs=we.memo(dJt);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function H3e({color:n="#000",size:e="1.2rem",strokeWidth:t="1.5"}){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 20 20",children:h.jsx("polyline",{points:"16.5 12.5 10 6 3.5 12.5",fill:"none",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t})})}const fJt={isCurrentlyUsed:!1},pJt=As.span` background-color: ${({theme:n})=>n.backgroundColor}; &:hover { background-color: ${({theme:n})=>n.hoverBackgroundColor}; } `;function gJt(n){n={...fJt,...n};const e=xt(),{thRef:t,currentWidth:i,handleMouseDown:r,handleDoubleClick:s,handleMouseMove:o,isResizing:a}=uJt(n.resizable),[l,c]=x.useState("asc"),u=x.useCallback(()=>{n.onColumnClick&&(c(l==="desc"?"asc":"desc"),n.onColumnClick({sort:`${n.id}|${l}`,field:n.id}))},[l,n.onColumnClick,n.id]);return h.jsxs("th",{ref:t,style:{color:n.textColor||e.$17,borderColor:e.$20,width:i,...n.style},onMouseDown:r,onDoubleClick:s,className:$t(`text-left font-normal tracking-wider whitespace-nowrap ${n.className}`,{"border-r relative":n.resizable,"py-2.5":!n.withoutVerticalPadding,"text-xs":n.textSize==="extraSmall","text-sm":n.textSize==="small"||!n.textSize,"px-2 lg:px-2.5 xl:px-4":!n.withoutHorizontalPadding,"cursor-pointer":n.onClick}),onMouseMove:o,onClick:n.onClick,children:[h.jsx("div",{className:`flex items-center space-x-1 ${n.childrenClassName} select-none`,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.onColumnClick?h.jsxs("div",{className:"flex items-center space-x-1 overflow-hidden whitespace-nowrap text-ellipsis cursor-pointer",onClick:u,style:{width:i!==-1?i:"auto"},children:[h.jsx("span",{className:"overflow-hidden whitespace-nowrap text-ellipsis",children:n.children}),h.jsx("div",{className:$t("flex items-center bg-opacity-25",{hidden:i===-1?!1:i<50}),children:n.useOnlyCurrentSortDirectionIcon?h.jsx(h.Fragment,{children:n.isCurrentlyUsed&&h.jsx(h.Fragment,{children:l==="desc"?n.descIcon:n.ascIcon})}):h.jsx(h.Fragment,{children:n.isCurrentlyUsed?h.jsxs("div",{className:"flex flex-col items-center justify-center -space-y-1",children:[h.jsx("div",{children:h.jsx(H3e,{size:"0.7rem",strokeWidth:"3",color:l==="asc"?e.$3:e.$17})}),h.jsx("div",{children:h.jsx($y,{size:"0.7rem",strokeWidth:"3",color:l==="desc"?e.$3:e.$17})})]}):h.jsxs("div",{className:"flex flex-col items-center justify-center -space-y-1",children:[h.jsx("div",{children:h.jsx(H3e,{size:"0.7rem",color:e.$17,strokeWidth:"3"})}),h.jsx("div",{children:h.jsx($y,{size:"0.7rem",color:e.$17,strokeWidth:"3"})})]})})})]}):h.jsx("span",{children:n.children})}),n.resizable?h.jsx(pJt,{className:"column-resizer block absolute inset-y-0 right-0 m-0 w-1 h-full p-0 cursor-col-resize border border-transparent hover:transition duration-50",theme:{backgroundColor:a?e.$3:"transparent",hoverBackgroundColor:e.$3}}):null]})}const _a=we.memo(gJt);function p1(n){const{backgroundColor:e}=n,t=xt();return h.jsx("thead",{className:"border-b",style:{backgroundColor:e||t.$1,borderColor:t.$20,...n.style},children:h.jsx("tr",{children:n.children})})}function hc(n){const{onClick:e,innerRef:t,backgroundColor:i,resource:r,withoutBackgroundColor:s=!1,memoValue:o,...a}=n,l=xt();return h.jsx("tr",{style:{backgroundColor:s?void 0:i||l.$1,...n.style},onClick:c=>{var u;return n.onClick&&((u=c.target)==null?void 0:u.nodeName)==="TD"?n.onClick():null},ref:t,...a,className:$t(`${n.className}`,{"cursor-pointer":e}),tabIndex:n.tabIndex,children:n.children})}const mV=x.memo(hc,(n,e)=>pn.isEqual(n.resource,e.resource)&&pn.isEqual(n.memoValue,e.memoValue));function mJt(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 fJe(n,e){var t=x.useState(function(){return{inputs:e,result:n()}})[0],i=x.useRef(!0),r=x.useRef(t),s=i.current||!!(e&&r.current.inputs&&mJt(e,r.current.inputs)),o=s?r.current:{inputs:e,result:n()};return x.useEffect(function(){i.current=!1,r.current=o},[o]),o.result}function _Jt(n,e){return fJe(function(){return n},e)}var Ko=fJe,Hr=_Jt,vJt="Invariant failed";function bJt(n,e){throw new Error(vJt)}var _b=function(e){var t=e.top,i=e.right,r=e.bottom,s=e.left,o=i-s,a=r-t,l={top:t,right:i,bottom:r,left:s,width:o,height:a,x:s,y:t,center:{x:(i+s)/2,y:(r+t)/2}};return l},wSe=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},V3e=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},yJt=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},nle={top:0,right:0,bottom:0,left:0},xSe=function(e){var t=e.borderBox,i=e.margin,r=i===void 0?nle:i,s=e.border,o=s===void 0?nle:s,a=e.padding,l=a===void 0?nle:a,c=_b(wSe(t,r)),u=_b(V3e(t,o)),d=_b(V3e(u,l));return{marginBox:c,borderBox:_b(t),paddingBox:u,contentBox:d,margin:r,border:o,padding:l}},v_=function(e){var t=e.slice(0,-2),i=e.slice(-2);if(i!=="px")return 0;var r=Number(t);return isNaN(r)&&bJt(),r},CJt=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Zq=function(e,t){var i=e.borderBox,r=e.border,s=e.margin,o=e.padding,a=yJt(i,t);return xSe({borderBox:a,border:r,margin:s,padding:o})},Jq=function(e,t){return t===void 0&&(t=CJt()),Zq(e,t)},pJe=function(e,t){var i={top:v_(t.marginTop),right:v_(t.marginRight),bottom:v_(t.marginBottom),left:v_(t.marginLeft)},r={top:v_(t.paddingTop),right:v_(t.paddingRight),bottom:v_(t.paddingBottom),left:v_(t.paddingLeft)},s={top:v_(t.borderTopWidth),right:v_(t.borderRightWidth),bottom:v_(t.borderBottomWidth),left:v_(t.borderLeftWidth)};return xSe({borderBox:e,margin:i,padding:r,border:s})},gJe=function(e){var t=e.getBoundingClientRect(),i=window.getComputedStyle(e);return pJe(t,i)},O8=function(e){var t=[],i=null,r=function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;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};function mJe(n,e){}mJe.bind(null,"warn");mJe.bind(null,"error");function tE(){}function wJt(n,e){return{...n,...e}}function j_(n,e,t){const i=e.map(r=>{const s=wJt(t,r.options);return n.addEventListener(r.eventName,r.fn,s),function(){n.removeEventListener(r.eventName,r.fn,s)}});return function(){i.forEach(s=>{s()})}}const xJt="Invariant failed";class eK extends Error{}eK.prototype.toString=function(){return this.message};function Ri(n,e){throw new eK(xJt)}class SJt extends we.Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=tE,this.onWindowError=t=>{const i=this.getCallbacks();i.isDragging()&&i.tryAbort(),t.error instanceof eK&&t.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=t=>{this.callbacks=t}}componentDidMount(){this.unbind=j_(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(e instanceof eK){this.setState({});return}throw e}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const EJt=` 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 `,tK=n=>n+1,kJt=n=>` You have lifted an item in position ${tK(n.source.index)} `,_Je=(n,e)=>{const t=n.droppableId===e.droppableId,i=tK(n.index),r=tK(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} `},vJe=(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} `,TJt=n=>{const e=n.destination;if(e)return _Je(n.source,e);const t=n.combine;return t?vJe(n.draggableId,n.source,t):"You are over an area that cannot be dropped on"},W3e=n=>` The item has returned to its starting position of ${tK(n.index)} `,IJt=n=>{if(n.reason==="CANCEL")return` Movement cancelled. ${W3e(n.source)} `;const e=n.destination,t=n.combine;return e?` You have dropped the item. ${_Je(n.source,e)} `:t?` You have dropped the item. ${vJe(n.draggableId,n.source,t)} `:` The item has been dropped while not over a drop area. ${W3e(n.source)} `},LJt={dragHandleUsageInstructions:EJt,onDragStart:kJt,onDragUpdate:TJt,onDragEnd:IJt};var jz=LJt;const Qd={x:0,y:0},bh=(n,e)=>({x:n.x+e.x,y:n.y+e.y}),pm=(n,e)=>({x:n.x-e.x,y:n.y-e.y}),nE=(n,e)=>n.x===e.x&&n.y===e.y,w4=n=>({x:n.x!==0?-n.x:0,y:n.y!==0?-n.y:0}),LL=(n,e,t=0)=>n==="x"?{x:e,y:t}:{x:t,y:e},M8=(n,e)=>Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2),z3e=(n,e)=>Math.min(...e.map(t=>M8(n,t))),bJe=n=>e=>({x:n(e.x),y:n(e.y)});var AJt=(n,e)=>{const t=_b({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 w9=(n,e)=>({top:n.top+e.y,left:n.left+e.x,bottom:n.bottom+e.y,right:n.right+e.x}),U3e=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}],NJt={top:0,right:0,bottom:0,left:0},DJt=(n,e)=>e?w9(n,e.scroll.diff.displacement):n,RJt=(n,e,t)=>t&&t.increasedBy?{...n,[e.end]:n[e.end]+t.increasedBy[e.line]}:n,PJt=(n,e)=>e&&e.shouldClipSubject?AJt(e.pageMarginBox,n):_b(n);var VO=({page:n,withPlaceholder:e,axis:t,frame:i})=>{const r=DJt(n.marginBox,i),s=RJt(r,t,e),o=PJt(s,i);return{page:n,withPlaceholder:e,active:o}},SSe=(n,e)=>{n.frame||Ri();const t=n.frame,i=pm(e,t.scroll.initial),r=w4(i),s={...t,scroll:{initial:t.scroll.initial,current:e,diff:{value:i,displacement:r},max:t.scroll.max}},o=VO({page:n.subject.page,withPlaceholder:n.subject.withPlaceholder,axis:n.axis,frame:s});return{...n,frame:s,subject:o}};const yJe=ad(n=>n.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),CJe=ad(n=>n.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),tee=ad(n=>Object.values(n)),OJt=ad(n=>Object.values(n));var x4=ad((n,e)=>OJt(e).filter(i=>n===i.descriptor.droppableId).sort((i,r)=>i.descriptor.index-r.descriptor.index));function ESe(n){return n.at&&n.at.type==="REORDER"?n.at.destination:null}function nee(n){return n.at&&n.at.type==="COMBINE"?n.at.combine:null}var iee=ad((n,e)=>e.filter(t=>t.descriptor.id!==n.descriptor.id)),MJt=({isMovingForward:n,draggable:e,destination:t,insideDestination:i,previousImpact:r})=>{if(!t.isCombineEnabled||!ESe(r))return null;function o(p){const g={type:"COMBINE",combine:{draggableId:p,droppableId:t.descriptor.id}};return{...r,at:g}}const a=r.displaced.all,l=a.length?a[0]:null;if(n)return l?o(l):null;const c=iee(e,i);if(!l){if(!c.length)return null;const p=c[c.length-1];return o(p.descriptor.id)}const u=c.findIndex(p=>p.descriptor.id===l);u===-1&&Ri();const d=u-1;if(d<0)return null;const f=c[d];return o(f.descriptor.id)},S4=(n,e)=>n.descriptor.droppableId===e.descriptor.id;const wJe={point:Qd,value:0},j8={invisible:{},visible:{},all:[]},jJt={displaced:j8,displacedBy:wJe,at:null};var FJt=jJt,W_=(n,e)=>t=>n<=t&&t<=e,xJe=n=>{const e=W_(n.top,n.bottom),t=W_(n.left,n.right);return i=>{if(e(i.top)&&e(i.bottom)&&t(i.left)&&t(i.right))return!0;const s=e(i.top)||e(i.bottom),o=t(i.left)||t(i.right);if(s&&o)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&&o||c&&s}},BJt=n=>{const e=W_(n.top,n.bottom),t=W_(n.left,n.right);return i=>e(i.top)&&e(i.bottom)&&t(i.left)&&t(i.right)};const kSe={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},SJe={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var $Jt=n=>e=>{const t=W_(e.top,e.bottom),i=W_(e.left,e.right);return r=>n===kSe?t(r.top)&&t(r.bottom):i(r.left)&&i(r.right)};const HJt=(n,e)=>{const t=e.frame?e.frame.scroll.diff.displacement:Qd;return w9(n,t)},VJt=(n,e,t)=>e.subject.active?t(e.subject.active)(n):!1,WJt=(n,e,t)=>t(e)(n),TSe=({target:n,destination:e,viewport:t,withDroppableDisplacement:i,isVisibleThroughFrameFn:r})=>{const s=i?HJt(n,e):n;return VJt(s,e,r)&&WJt(s,t,r)},zJt=n=>TSe({...n,isVisibleThroughFrameFn:xJe}),EJe=n=>TSe({...n,isVisibleThroughFrameFn:BJt}),UJt=n=>TSe({...n,isVisibleThroughFrameFn:$Jt(n.destination.axis)}),qJt=(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 s=r[n];return s?s.shouldAnimate:!0};function KJt(n,e){const t=n.page.marginBox,i={top:e.point.y,right:0,bottom:0,left:e.point.x};return _b(wSe(t,i))}function F8({afterDragging:n,destination:e,displacedBy:t,viewport:i,forceShouldAnimate:r,last:s}){return n.reduce(function(a,l){const c=KJt(l,t),u=l.descriptor.id;if(a.all.push(u),!zJt({target:c,destination:e,viewport:i,withDroppableDisplacement:!0}))return a.invisible[l.descriptor.id]=!0,a;const f=qJt(u,s,r),p={draggableId:u,shouldAnimate:f};return a.visible[u]=p,a},{all:[],visible:{},invisible:{}})}function GJt(n,e){if(!n.length)return 0;const t=n[n.length-1].descriptor.index;return e.inHomeList?t:t+1}function q3e({insideDestination:n,inHomeList:e,displacedBy:t,destination:i}){const r=GJt(n,{inHomeList:e});return{displaced:j8,displacedBy:t,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:r}}}}function nK({draggable:n,insideDestination:e,destination:t,viewport:i,displacedBy:r,last:s,index:o,forceShouldAnimate:a}){const l=S4(n,t);if(o==null)return q3e({insideDestination:e,inHomeList:l,displacedBy:r,destination:t});const c=e.find(g=>g.descriptor.index===o);if(!c)return q3e({insideDestination:e,inHomeList:l,displacedBy:r,destination:t});const u=iee(n,e),d=e.indexOf(c),f=u.slice(d);return{displaced:F8({afterDragging:f,destination:t,displacedBy:r,last:s,viewport:i.frame,forceShouldAnimate:a}),displacedBy:r,at:{type:"REORDER",destination:{droppableId:t.descriptor.id,index:o}}}}function WE(n,e){return!!e.effected[n]}var YJt=({isMovingForward:n,destination:e,draggables:t,combine:i,afterCritical:r})=>{if(!e.isCombineEnabled)return null;const s=i.draggableId,a=t[s].descriptor.index;return WE(s,r)?n?a:a-1:n?a+1:a},QJt=({isMovingForward:n,isInHomeList:e,insideDestination:t,location:i})=>{if(!t.length)return null;const r=i.index,s=n?r+1:r-1,o=t[0].descriptor.index,a=t[t.length-1].descriptor.index,l=e?a:a+1;return s<o||s>l?null:s},XJt=({isMovingForward:n,isInHomeList:e,draggable:t,draggables:i,destination:r,insideDestination:s,previousImpact:o,viewport:a,afterCritical:l})=>{const c=o.at;if(c||Ri(),c.type==="REORDER"){const d=QJt({isMovingForward:n,isInHomeList:e,location:c.destination,insideDestination:s});return d==null?null:nK({draggable:t,insideDestination:s,destination:r,viewport:a,last:o.displaced,displacedBy:o.displacedBy,index:d})}const u=YJt({isMovingForward:n,destination:r,displaced:o.displaced,draggables:i,combine:c.combine,afterCritical:l});return u==null?null:nK({draggable:t,insideDestination:s,destination:r,viewport:a,last:o.displaced,displacedBy:o.displacedBy,index:u})},ZJt=({displaced:n,afterCritical:e,combineWith:t,displacedBy:i})=>{const r=!!(n.visible[t]||n.invisible[t]);return WE(t,e)?r?Qd:w4(i.point):r?i.point:Qd},JJt=({afterCritical:n,impact:e,draggables:t})=>{const i=nee(e);i||Ri();const r=i.draggableId,s=t[r].page.borderBox.center,o=ZJt({displaced:e.displaced,afterCritical:n,combineWith:r,displacedBy:e.displacedBy});return bh(s,o)};const kJe=(n,e)=>e.margin[n.start]+e.borderBox[n.size]/2,een=(n,e)=>e.margin[n.end]+e.borderBox[n.size]/2,ISe=(n,e,t)=>e[n.crossAxisStart]+t.margin[n.crossAxisStart]+t.borderBox[n.crossAxisSize]/2,K3e=({axis:n,moveRelativeTo:e,isMoving:t})=>LL(n.line,e.marginBox[n.end]+kJe(n,t),ISe(n,e.marginBox,t)),G3e=({axis:n,moveRelativeTo:e,isMoving:t})=>LL(n.line,e.marginBox[n.start]-een(n,t),ISe(n,e.marginBox,t)),ten=({axis:n,moveInto:e,isMoving:t})=>LL(n.line,e.contentBox[n.start]+kJe(n,t),ISe(n,e.contentBox,t));var nen=({impact:n,draggable:e,draggables:t,droppable:i,afterCritical:r})=>{const s=x4(i.descriptor.id,t),o=e.page,a=i.axis;if(!s.length)return ten({axis:a,moveInto:i.page,isMoving:o});const{displaced:l,displacedBy:c}=n,u=l.all[0];if(u){const f=t[u];if(WE(u,r))return G3e({axis:a,moveRelativeTo:f.page,isMoving:o});const p=Zq(f.page,c.point);return G3e({axis:a,moveRelativeTo:p,isMoving:o})}const d=s[s.length-1];if(d.descriptor.id===e.descriptor.id)return o.borderBox.center;if(WE(d.descriptor.id,r)){const f=Zq(d.page,w4(r.displacedBy.point));return K3e({axis:a,moveRelativeTo:f,isMoving:o})}return K3e({axis:a,moveRelativeTo:d.page,isMoving:o})},vpe=(n,e)=>{const t=n.frame;return t?bh(e,t.scroll.diff.displacement):e};const ien=({impact:n,draggable:e,droppable:t,draggables:i,afterCritical:r})=>{const s=e.page.borderBox.center,o=n.at;return!t||!o?s:o.type==="REORDER"?nen({impact:n,draggable:e,draggables:i,droppable:t,afterCritical:r}):JJt({impact:n,draggables:i,afterCritical:r})};var ree=n=>{const e=ien(n),t=n.droppable;return t?vpe(t,e):e},TJe=(n,e)=>{const t=pm(e,n.scroll.initial),i=w4(t);return{frame:_b({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 Y3e(n,e){return n.map(t=>e[t])}function ren(n,e){for(let t=0;t<e.length;t++){const i=e[t].visible[n];if(i)return i}return null}var sen=({impact:n,viewport:e,destination:t,draggables:i,maxScrollChange:r})=>{const s=TJe(e,bh(e.scroll.current,r)),o=t.frame?SSe(t,bh(t.frame.scroll.current,r)):t,a=n.displaced,l=F8({afterDragging:Y3e(a.all,i),destination:t,displacedBy:n.displacedBy,viewport:s.frame,last:a,forceShouldAnimate:!1}),c=F8({afterDragging:Y3e(a.all,i),destination:o,displacedBy:n.displacedBy,viewport:e.frame,last:a,forceShouldAnimate:!1}),u={},d={},f=[a,l,c];return a.all.forEach(g=>{const m=ren(g,f);if(m){d[g]=m;return}u[g]=!0}),{...n,displaced:{all:a.all,invisible:u,visible:d}}},oen=(n,e)=>bh(n.scroll.diff.displacement,e),LSe=({pageBorderBoxCenter:n,draggable:e,viewport:t})=>{const i=oen(t,n),r=pm(i,e.page.borderBox.center);return bh(e.client.borderBox.center,r)},IJe=({draggable:n,destination:e,newPageBorderBoxCenter:t,viewport:i,withDroppableDisplacement:r,onlyOnMainAxis:s=!1})=>{const o=pm(t,n.page.borderBox.center),l={target:w9(n.page.borderBox,o),destination:e,withDroppableDisplacement:r,viewport:i};return s?UJt(l):EJe(l)},aen=({isMovingForward:n,draggable:e,destination:t,draggables:i,previousImpact:r,viewport:s,previousPageBorderBoxCenter:o,previousClientSelection:a,afterCritical:l})=>{if(!t.isEnabled)return null;const c=x4(t.descriptor.id,i),u=S4(e,t),d=MJt({isMovingForward:n,draggable:e,destination:t,insideDestination:c,previousImpact:r})||XJt({isMovingForward:n,isInHomeList:u,draggable:e,draggables:i,destination:t,insideDestination:c,previousImpact:r,viewport:s,afterCritical:l});if(!d)return null;const f=ree({impact:d,draggable:e,droppable:t,draggables:i,afterCritical:l});if(IJe({draggable:e,destination:t,newPageBorderBoxCenter:f,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:LSe({pageBorderBoxCenter:f,draggable:e,viewport:s}),impact:d,scrollJumpRequest:null};const g=pm(f,o),m=sen({impact:d,viewport:s,destination:t,draggables:i,maxScrollChange:g});return{clientSelection:a,impact:m,scrollJumpRequest:g}};const Pf=n=>{const e=n.subject.active;return e||Ri(),e};var len=({isMovingForward:n,pageBorderBoxCenter:e,source:t,droppables:i,viewport:r})=>{const s=t.subject.active;if(!s)return null;const o=t.axis,a=W_(s[o.start],s[o.end]),l=tee(i).filter(u=>u!==t).filter(u=>u.isEnabled).filter(u=>!!u.subject.active).filter(u=>xJe(r.frame)(Pf(u))).filter(u=>{const d=Pf(u);return n?s[o.crossAxisEnd]<d[o.crossAxisEnd]:d[o.crossAxisStart]<s[o.crossAxisStart]}).filter(u=>{const d=Pf(u),f=W_(d[o.start],d[o.end]);return a(d[o.start])||a(d[o.end])||f(s[o.start])||f(s[o.end])}).sort((u,d)=>{const f=Pf(u)[o.crossAxisStart],p=Pf(d)[o.crossAxisStart];return n?f-p:p-f}).filter((u,d,f)=>Pf(u)[o.crossAxisStart]===Pf(f[0])[o.crossAxisStart]);if(!l.length)return null;if(l.length===1)return l[0];const c=l.filter(u=>W_(Pf(u)[o.start],Pf(u)[o.end])(e[o.line]));return c.length===1?c[0]:c.length>1?c.sort((u,d)=>Pf(u)[o.start]-Pf(d)[o.start])[0]:l.sort((u,d)=>{const f=z3e(e,U3e(Pf(u))),p=z3e(e,U3e(Pf(d)));return f!==p?f-p:Pf(u)[o.start]-Pf(d)[o.start]})[0]};const Q3e=(n,e)=>{const t=n.page.borderBox.center;return WE(n.descriptor.id,e)?pm(t,e.displacedBy.point):t},cen=(n,e)=>{const t=n.page.borderBox;return WE(n.descriptor.id,e)?w9(t,w4(e.displacedBy.point)):t};var uen=({pageBorderBoxCenter:n,viewport:e,destination:t,insideDestination:i,afterCritical:r})=>i.filter(o=>EJe({target:cen(o,r),destination:t,viewport:e.frame,withDroppableDisplacement:!0})).sort((o,a)=>{const l=M8(n,vpe(t,Q3e(o,r))),c=M8(n,vpe(t,Q3e(a,r)));return l<c?-1:c<l?1:o.descriptor.index-a.descriptor.index})[0]||null,x9=ad(function(e,t){const i=t[e.line];return{value:i,point:LL(e.line,i)}});const den=(n,e,t)=>{const i=n.axis;if(n.descriptor.mode==="virtual")return LL(i.line,e[i.line]);const r=n.subject.page.contentBox[i.size],l=x4(n.descriptor.id,t).reduce((c,u)=>c+u.client.marginBox[i.size],0)+e[i.line]-r;return l<=0?null:LL(i.line,l)},LJe=(n,e)=>({...n,scroll:{...n.scroll,max:e}}),AJe=(n,e,t)=>{const i=n.frame;S4(e,n)&&Ri(),n.subject.withPlaceholder&&Ri();const r=x9(n.axis,e.displaceBy).point,s=den(n,r,t),o={placeholderSize:r,increasedBy:s,oldFrameMaxScroll:n.frame?n.frame.scroll.max:null};if(!i){const u=VO({page:n.subject.page,withPlaceholder:o,axis:n.axis,frame:n.frame});return{...n,subject:u}}const a=s?bh(i.scroll.max,s):i.scroll.max,l=LJe(i,a),c=VO({page:n.subject.page,withPlaceholder:o,axis:n.axis,frame:l});return{...n,subject:c,frame:l}},hen=n=>{const e=n.subject.withPlaceholder;e||Ri();const t=n.frame;if(!t){const o=VO({page:n.subject.page,axis:n.axis,frame:null,withPlaceholder:null});return{...n,subject:o}}const i=e.oldFrameMaxScroll;i||Ri();const r=LJe(t,i),s=VO({page:n.subject.page,axis:n.axis,frame:r,withPlaceholder:null});return{...n,subject:s,frame:r}};var fen=({previousPageBorderBoxCenter:n,moveRelativeTo:e,insideDestination:t,draggable:i,draggables:r,destination:s,viewport:o,afterCritical:a})=>{if(!e){if(t.length)return null;const d={displaced:j8,displacedBy:wJe,at:{type:"REORDER",destination:{droppableId:s.descriptor.id,index:0}}},f=ree({impact:d,draggable:i,droppable:s,draggables:r,afterCritical:a}),p=S4(i,s)?s:AJe(s,i,r);return IJe({draggable:i,destination:p,newPageBorderBoxCenter:f,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?d:null}const l=n[s.axis.line]<=e.page.borderBox.center[s.axis.line],c=(()=>{const d=e.descriptor.index;return e.descriptor.id===i.descriptor.id||l?d:d+1})(),u=x9(s.axis,i.displaceBy);return nK({draggable:i,insideDestination:t,destination:s,viewport:o,displacedBy:u,last:j8,index:c})},pen=({isMovingForward:n,previousPageBorderBoxCenter:e,draggable:t,isOver:i,draggables:r,droppables:s,viewport:o,afterCritical:a})=>{const l=len({isMovingForward:n,pageBorderBoxCenter:e,source:i,droppables:s,viewport:o});if(!l)return null;const c=x4(l.descriptor.id,r),u=uen({pageBorderBoxCenter:e,viewport:o,destination:l,insideDestination:c,afterCritical:a}),d=fen({previousPageBorderBoxCenter:e,destination:l,draggable:t,draggables:r,moveRelativeTo:u,insideDestination:c,viewport:o,afterCritical:a});if(!d)return null;const f=ree({impact:d,draggable:t,droppable:l,draggables:r,afterCritical:a});return{clientSelection:LSe({pageBorderBoxCenter:f,draggable:t,viewport:o}),impact:d,scrollJumpRequest:null}},wm=n=>{const e=n.at;return e?e.type==="REORDER"?e.destination.droppableId:e.combine.droppableId:null};const gen=(n,e)=>{const t=wm(n);return t?e[t]:null};var men=({state:n,type:e})=>{const t=gen(n.impact,n.dimensions.droppables),i=!!t,r=n.dimensions.droppables[n.critical.droppable.id],s=t||r,o=s.axis.direction,a=o==="vertical"&&(e==="MOVE_UP"||e==="MOVE_DOWN")||o==="horizontal"&&(e==="MOVE_LEFT"||e==="MOVE_RIGHT");if(a&&!i)return null;const l=e==="MOVE_DOWN"||e==="MOVE_RIGHT",c=n.dimensions.draggables[n.critical.draggable.id],u=n.current.page.borderBoxCenter,{draggables:d,droppables:f}=n.dimensions;return a?aen({isMovingForward:l,previousPageBorderBoxCenter:u,draggable:c,destination:s,draggables:d,viewport:n.viewport,previousClientSelection:n.current.client.selection,previousImpact:n.impact,afterCritical:n.afterCritical}):pen({isMovingForward:l,previousPageBorderBoxCenter:u,draggable:c,isOver:s,draggables:d,droppables:f,viewport:n.viewport,afterCritical:n.afterCritical})};function JT(n){return n.phase==="DRAGGING"||n.phase==="COLLECTING"}function NJe(n){const e=W_(n.top,n.bottom),t=W_(n.left,n.right);return function(r){return e(r.y)&&t(r.x)}}function _en(n,e){return n.left<e.right&&n.right>e.left&&n.top<e.bottom&&n.bottom>e.top}function ven({pageBorderBox:n,draggable:e,candidates:t}){const i=e.page.borderBox.center,r=t.map(s=>{const o=s.axis,a=LL(s.axis.line,n.center[o.line],s.page.borderBox.center[o.crossAxisLine]);return{id:s.descriptor.id,distance:M8(i,a)}}).sort((s,o)=>o.distance-s.distance);return r[0]?r[0].id:null}function ben({pageBorderBox:n,draggable:e,droppables:t}){const i=tee(t).filter(r=>{if(!r.isEnabled)return!1;const s=r.subject.active;if(!s||!_en(n,s))return!1;if(NJe(s)(n.center))return!0;const o=r.axis,a=s.center[o.crossAxisLine],l=n[o.crossAxisStart],c=n[o.crossAxisEnd],u=W_(s[o.crossAxisStart],s[o.crossAxisEnd]),d=u(l),f=u(c);return!d&&!f?!0:d?l<a:c>a});return i.length?i.length===1?i[0].descriptor.id:ven({pageBorderBox:n,draggable:e,candidates:i}):null}const DJe=(n,e)=>_b(w9(n,e));var yen=(n,e)=>{const t=n.frame;return t?DJe(e,t.scroll.diff.value):e};function RJe({displaced:n,id:e}){return!!(n.visible[e]||n.invisible[e])}function Cen({draggable:n,closest:e,inHomeList:t}){return e?t&&e.descriptor.index>n.descriptor.index?e.descriptor.index-1:e.descriptor.index:null}var wen=({pageBorderBoxWithDroppableScroll:n,draggable:e,destination:t,insideDestination:i,last:r,viewport:s,afterCritical:o})=>{const a=t.axis,l=x9(t.axis,e.displaceBy),c=l.value,u=n[a.start],d=n[a.end],p=iee(e,i).find(m=>{const _=m.descriptor.id,v=m.page.borderBox.center[a.line],b=WE(_,o),y=RJe({displaced:r,id:_});return b?y?d<=v:u<v-c:y?d<=v+c:u<v})||null,g=Cen({draggable:e,closest:p,inHomeList:S4(e,t)});return nK({draggable:e,insideDestination:i,destination:t,viewport:s,last:r,displacedBy:l,index:g})};const xen=4;var Sen=({draggable:n,pageBorderBoxWithDroppableScroll:e,previousImpact:t,destination:i,insideDestination:r,afterCritical:s})=>{if(!i.isCombineEnabled)return null;const o=i.axis,a=x9(i.axis,n.displaceBy),l=a.value,c=e[o.start],u=e[o.end],f=iee(n,r).find(g=>{const m=g.descriptor.id,_=g.page.borderBox,b=_[o.size]/xen,y=WE(m,s),C=RJe({displaced:t.displaced,id:m});return y?C?u>_[o.start]+b&&u<_[o.end]-b:c>_[o.start]-l+b&&c<_[o.end]-l-b:C?u>_[o.start]+l+b&&u<_[o.end]+l-b:c>_[o.start]+b&&c<_[o.end]-b});return f?{displacedBy:a,displaced:t.displaced,at:{type:"COMBINE",combine:{draggableId:f.descriptor.id,droppableId:i.descriptor.id}}}:null},PJe=({pageOffset:n,draggable:e,draggables:t,droppables:i,previousImpact:r,viewport:s,afterCritical:o})=>{const a=DJe(e.page.borderBox,n),l=ben({pageBorderBox:a,draggable:e,droppables:i});if(!l)return FJt;const c=i[l],u=x4(c.descriptor.id,t),d=yen(c,a);return Sen({pageBorderBoxWithDroppableScroll:d,draggable:e,previousImpact:r,destination:c,insideDestination:u,afterCritical:o})||wen({pageBorderBoxWithDroppableScroll:d,draggable:e,destination:c,insideDestination:u,last:r.displaced,viewport:s,afterCritical:o})},ASe=(n,e)=>({...n,[e.descriptor.id]:e});const Een=({previousImpact:n,impact:e,droppables:t})=>{const i=wm(n),r=wm(e);if(!i||i===r)return t;const s=t[i];if(!s.subject.withPlaceholder)return t;const o=hen(s);return ASe(t,o)};var ken=({draggable:n,draggables:e,droppables:t,previousImpact:i,impact:r})=>{const s=Een({previousImpact:i,impact:r,droppables:t}),o=wm(r);if(!o)return s;const a=t[o];if(S4(n,a)||a.subject.withPlaceholder)return s;const l=AJe(a,n,e);return ASe(s,l)},MF=({state:n,clientSelection:e,dimensions:t,viewport:i,impact:r,scrollJumpRequest:s})=>{const o=i||n.viewport,a=t||n.dimensions,l=e||n.current.client.selection,c=pm(l,n.initial.client.selection),u={offset:c,selection:l,borderBoxCenter:bh(n.initial.client.borderBoxCenter,c)},d={selection:bh(u.selection,o.scroll.current),borderBoxCenter:bh(u.borderBoxCenter,o.scroll.current),offset:bh(u.offset,o.scroll.diff.value)},f={client:u,page:d};if(n.phase==="COLLECTING")return{...n,dimensions:a,viewport:o,current:f};const p=a.draggables[n.critical.draggable.id],g=r||PJe({pageOffset:d.offset,draggable:p,draggables:a.draggables,droppables:a.droppables,previousImpact:n.impact,viewport:o,afterCritical:n.afterCritical}),m=ken({draggable:p,impact:g,previousImpact:n.impact,draggables:a.draggables,droppables:a.droppables});return{...n,current:f,dimensions:{draggables:a.draggables,droppables:m},impact:g,viewport:o,scrollJumpRequest:s||null,forceShouldAnimate:s?!1:null}};function Ten(n,e){return n.map(t=>e[t])}var OJe=({impact:n,viewport:e,draggables:t,destination:i,forceShouldAnimate:r})=>{const s=n.displaced,o=Ten(s.all,t),a=F8({afterDragging:o,destination:i,displacedBy:n.displacedBy,viewport:e.frame,forceShouldAnimate:r,last:s});return{...n,displaced:a}},MJe=({impact:n,draggable:e,droppable:t,draggables:i,viewport:r,afterCritical:s})=>{const o=ree({impact:n,draggable:e,draggables:i,droppable:t,afterCritical:s});return LSe({pageBorderBoxCenter:o,draggable:e,viewport:r})},jJe=({state:n,dimensions:e,viewport:t})=>{n.movementMode!=="SNAP"&&Ri();const i=n.impact,r=t||n.viewport,s=e||n.dimensions,{draggables:o,droppables:a}=s,l=o[n.critical.draggable.id],c=wm(i);c||Ri();const u=a[c],d=OJe({impact:i,viewport:r,destination:u,draggables:o}),f=MJe({impact:d,draggable:l,droppable:u,draggables:o,viewport:r,afterCritical:n.afterCritical});return MF({impact:d,clientSelection:f,state:n,dimensions:s,viewport:r})},Ien=n=>({index:n.index,droppableId:n.droppableId}),FJe=({draggable:n,home:e,draggables:t,viewport:i})=>{const r=x9(e.axis,n.displaceBy),s=x4(e.descriptor.id,t),o=s.indexOf(n);o===-1&&Ri();const a=s.slice(o+1),l=a.reduce((f,p)=>(f[p.descriptor.id]=!0,f),{}),c={inVirtualList:e.descriptor.mode==="virtual",displacedBy:r,effected:l};return{impact:{displaced:F8({afterDragging:a,destination:e,displacedBy:r,last:null,viewport:i.frame,forceShouldAnimate:!1}),displacedBy:r,at:{type:"REORDER",destination:Ien(n.descriptor)}},afterCritical:c}},Len=(n,e)=>({draggables:n.draggables,droppables:ASe(n.droppables,e)}),Aen=({draggable:n,offset:e,initialWindowScroll:t})=>{const i=Zq(n.client,e),r=Jq(i,t);return{...n,placeholder:{...n.placeholder,client:i},client:i,page:r}},Nen=n=>{const e=n.frame;return e||Ri(),e},Den=({additions:n,updatedDroppables:e,viewport:t})=>{const i=t.scroll.diff.value;return n.map(r=>{const s=r.descriptor.droppableId,o=e[s],l=Nen(o).scroll.diff.value,c=bh(i,l);return Aen({draggable:r,offset:c,initialWindowScroll:t.scroll.initial})})},Ren=({state:n,published:e})=>{const t=e.modified.map(v=>{const b=n.dimensions.droppables[v.droppableId];return SSe(b,v.scroll)}),i={...n.dimensions.droppables,...yJe(t)},r=CJe(Den({additions:e.additions,updatedDroppables:i,viewport:n.viewport})),s={...n.dimensions.draggables,...r};e.removals.forEach(v=>{delete s[v]});const o={droppables:i,draggables:s},a=wm(n.impact),l=a?o.droppables[a]:null,c=o.draggables[n.critical.draggable.id],u=o.droppables[n.critical.droppable.id],{impact:d,afterCritical:f}=FJe({draggable:c,home:u,draggables:s,viewport:n.viewport}),p=l&&l.isCombineEnabled?n.impact:d,g=PJe({pageOffset:n.current.page.offset,draggable:o.draggables[n.critical.draggable.id],draggables:o.draggables,droppables:o.droppables,previousImpact:p,viewport:n.viewport,afterCritical:f}),m={...n,phase:"DRAGGING",impact:g,onLiftImpact:d,dimensions:o,afterCritical:f,forceShouldAnimate:!1};return n.phase==="COLLECTING"?m:{...m,phase:"DROP_PENDING",reason:n.reason,isWaiting:!1}};const bpe=n=>n.movementMode==="SNAP",ile=(n,e,t)=>{const i=Len(n.dimensions,e);return!bpe(n)||t?MF({state:n,dimensions:i}):jJe({state:n,dimensions:i})};function rle(n){return n.isDragging&&n.movementMode==="SNAP"?{...n,scrollJumpRequest:null}:n}const X3e={phase:"IDLE",completed:null,shouldFlush:!1};var Pen=(n=X3e,e)=>{if(e.type==="FLUSH")return{...X3e,shouldFlush:!0};if(e.type==="INITIAL_PUBLISH"){n.phase!=="IDLE"&&Ri();const{critical:t,clientSelection:i,viewport:r,dimensions:s,movementMode:o}=e.payload,a=s.draggables[t.draggable.id],l=s.droppables[t.droppable.id],c={selection:i,borderBoxCenter:a.client.borderBox.center,offset:Qd},u={client:c,page:{selection:bh(c.selection,r.scroll.initial),borderBoxCenter:bh(c.selection,r.scroll.initial),offset:bh(c.selection,r.scroll.diff.value)}},d=tee(s.droppables).every(m=>!m.isFixedOnPage),{impact:f,afterCritical:p}=FJe({draggable:a,home:l,draggables:s.draggables,viewport:r});return{phase:"DRAGGING",isDragging:!0,critical:t,movementMode:o,dimensions:s,initial:u,current:u,isWindowScrollAllowed:d,impact:f,afterCritical:p,onLiftImpact:f,viewport:r,scrollJumpRequest:null,forceShouldAnimate:null}}if(e.type==="COLLECTION_STARTING")return n.phase==="COLLECTING"||n.phase==="DROP_PENDING"?n:(n.phase!=="DRAGGING"&&Ri(),{...n,phase:"COLLECTING"});if(e.type==="PUBLISH_WHILE_DRAGGING")return n.phase==="COLLECTING"||n.phase==="DROP_PENDING"||Ri(),Ren({state:n,published:e.payload});if(e.type==="MOVE"){if(n.phase==="DROP_PENDING")return n;JT(n)||Ri();const{client:t}=e.payload;return nE(t,n.current.client.selection)?n:MF({state:n,clientSelection:t,impact:bpe(n)?n.impact:null})}if(e.type==="UPDATE_DROPPABLE_SCROLL"){if(n.phase==="DROP_PENDING"||n.phase==="COLLECTING")return rle(n);JT(n)||Ri();const{id:t,newScroll:i}=e.payload,r=n.dimensions.droppables[t];if(!r)return n;const s=SSe(r,i);return ile(n,s,!1)}if(e.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(n.phase==="DROP_PENDING")return n;JT(n)||Ri();const{id:t,isEnabled:i}=e.payload,r=n.dimensions.droppables[t];r||Ri(),r.isEnabled===i&&Ri();const s={...r,isEnabled:i};return ile(n,s,!0)}if(e.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(n.phase==="DROP_PENDING")return n;JT(n)||Ri();const{id:t,isCombineEnabled:i}=e.payload,r=n.dimensions.droppables[t];r||Ri(),r.isCombineEnabled===i&&Ri();const s={...r,isCombineEnabled:i};return ile(n,s,!0)}if(e.type==="MOVE_BY_WINDOW_SCROLL"){if(n.phase==="DROP_PENDING"||n.phase==="DROP_ANIMATING")return n;JT(n)||Ri(),n.isWindowScrollAllowed||Ri();const t=e.payload.newScroll;if(nE(n.viewport.scroll.current,t))return rle(n);const i=TJe(n.viewport,t);return bpe(n)?jJe({state:n,viewport:i}):MF({state:n,viewport:i})}if(e.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!JT(n))return n;const t=e.payload.maxScroll;if(nE(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"&&Ri();const t=men({state:n,type:e.type});return t?MF({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"&&Ri(),{...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"||Ri(),{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 Oen=n=>({type:"BEFORE_INITIAL_CAPTURE",payload:n}),Men=n=>({type:"LIFT",payload:n}),jen=n=>({type:"INITIAL_PUBLISH",payload:n}),Fen=n=>({type:"PUBLISH_WHILE_DRAGGING",payload:n}),Ben=()=>({type:"COLLECTION_STARTING",payload:null}),$en=n=>({type:"UPDATE_DROPPABLE_SCROLL",payload:n}),Hen=n=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:n}),Ven=n=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:n}),BJe=n=>({type:"MOVE",payload:n}),Wen=n=>({type:"MOVE_BY_WINDOW_SCROLL",payload:n}),zen=n=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:n}),Uen=()=>({type:"MOVE_UP",payload:null}),qen=()=>({type:"MOVE_DOWN",payload:null}),Ken=()=>({type:"MOVE_RIGHT",payload:null}),Gen=()=>({type:"MOVE_LEFT",payload:null}),NSe=()=>({type:"FLUSH",payload:null}),Yen=n=>({type:"DROP_ANIMATE",payload:n}),DSe=n=>({type:"DROP_COMPLETE",payload:n}),$Je=n=>({type:"DROP",payload:n}),Qen=n=>({type:"DROP_PENDING",payload:n}),HJe=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var Xen=n=>({getState:e,dispatch:t})=>i=>r=>{if(r.type!=="LIFT"){i(r);return}const{id:s,clientSelection:o,movementMode:a}=r.payload,l=e();l.phase==="DROP_ANIMATING"&&t(DSe({completed:l.completed})),e().phase!=="IDLE"&&Ri(),t(NSe()),t(Oen({draggableId:s,movementMode:a}));const u={draggableId:s,scrollOptions:{shouldPublishImmediately:a==="SNAP"}},{critical:d,dimensions:f,viewport:p}=n.startPublishing(u);t(jen({critical:d,dimensions:f,clientSelection:o,movementMode:a,viewport:p}))},Zen=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 RSe={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},B8={opacity:{drop:0,combining:.7},scale:{drop:.75}},VJe={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},MT=`${VJe.outOfTheWay}s ${RSe.outOfTheWay}`,jF={fluid:`opacity ${MT}`,snap:`transform ${MT}, opacity ${MT}`,drop:n=>{const e=`${n}s ${RSe.drop}`;return`transform ${e}, opacity ${e}`},outOfTheWay:`transform ${MT}`,placeholder:`height ${MT}, width ${MT}, margin ${MT}`},Z3e=n=>nE(n,Qd)?void 0:`translate(${n.x}px, ${n.y}px)`,ype={moveTo:Z3e,drop:(n,e)=>{const t=Z3e(n);if(t)return e?`${t} scale(${B8.scale.drop})`:t}},{minDropTime:Cpe,maxDropTime:WJe}=VJe,Jen=WJe-Cpe,J3e=1500,etn=.6;var ttn=({current:n,destination:e,reason:t})=>{const i=M8(n,e);if(i<=0)return Cpe;if(i>=J3e)return WJe;const r=i/J3e,s=Cpe+Jen*r,o=t==="CANCEL"?s*etn:s;return Number(o.toFixed(2))},ntn=({impact:n,draggable:e,dimensions:t,viewport:i,afterCritical:r})=>{const{draggables:s,droppables:o}=t,a=wm(n),l=a?o[a]:null,c=o[e.descriptor.droppableId],u=MJe({impact:n,draggable:e,draggables:s,afterCritical:r,droppable:l||c,viewport:i});return pm(u,e.client.borderBox.center)},itn=({draggables:n,reason:e,lastImpact:t,home:i,viewport:r,onLiftImpact:s})=>!t.at||e!=="DROP"?{impact:OJe({draggables:n,impact:s,destination:i,viewport:r,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:t.at.type==="REORDER"?{impact:t,didDropInsideDroppable:!0}:{impact:{...t,displaced:j8},didDropInsideDroppable:!0};const rtn=({getState:n,dispatch:e})=>t=>i=>{if(i.type!=="DROP"){t(i);return}const r=n(),s=i.payload.reason;if(r.phase==="COLLECTING"){e(Qen({reason:s}));return}if(r.phase==="IDLE")return;r.phase==="DROP_PENDING"&&r.isWaiting&&Ri(),r.phase==="DRAGGING"||r.phase==="DROP_PENDING"||Ri();const a=r.critical,l=r.dimensions,c=l.draggables[r.critical.draggable.id],{impact:u,didDropInsideDroppable:d}=itn({reason:s,lastImpact:r.impact,afterCritical:r.afterCritical,onLiftImpact:r.onLiftImpact,home:r.dimensions.droppables[r.critical.droppable.id],viewport:r.viewport,draggables:r.dimensions.draggables}),f=d?ESe(u):null,p=d?nee(u):null,g={index:a.draggable.index,droppableId:a.droppable.id},m={draggableId:c.descriptor.id,type:c.descriptor.type,source:g,reason:s,mode:r.movementMode,destination:f,combine:p},_=ntn({impact:u,draggable:c,dimensions:l,viewport:r.viewport,afterCritical:r.afterCritical}),v={critical:r.critical,afterCritical:r.afterCritical,result:m,impact:u};if(!(!nE(r.current.client.offset,_)||!!m.combine)){e(DSe({completed:v}));return}const y=ttn({current:r.current.client.offset,destination:_,reason:s});e(Yen({newHomeClientOffset:_,dropDuration:y,completed:v}))};var stn=rtn,zJe=()=>({x:window.pageXOffset,y:window.pageYOffset});function otn(n){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:e=>{e.target!==window&&e.target!==window.document||n()}}}function atn({onWindowScroll:n}){function e(){n(zJe())}const t=O8(e),i=otn(t);let r=tE;function s(){return r!==tE}function o(){s()&&Ri(),r=j_(window,[i])}function a(){s()||Ri(),t.cancel(),r(),r=tE}return{start:o,stop:a,isActive:s}}const ltn=n=>n.type==="DROP_COMPLETE"||n.type==="DROP_ANIMATE"||n.type==="FLUSH",ctn=n=>{const e=atn({onWindowScroll:t=>{n.dispatch(Wen({newScroll:t}))}});return t=>i=>{!e.isActive()&&i.type==="INITIAL_PUBLISH"&&e.start(),e.isActive()&<n(i)&&e.stop(),t(i)}};var utn=ctn,dtn=n=>{let e=!1,t=!1;const i=setTimeout(()=>{t=!0}),r=s=>{e||t||(e=!0,n(s),clearTimeout(i))};return r.wasCalled=()=>e,r},htn=()=>{const n=[],e=r=>{const s=n.findIndex(a=>a.timerId===r);s===-1&&Ri();const[o]=n.splice(s,1);o.callback()};return{add:r=>{const s=setTimeout(()=>e(s)),o={timerId:s,callback:r};n.push(o)},flush:()=>{if(!n.length)return;const r=[...n];n.length=0,r.forEach(s=>{clearTimeout(s.timerId),s.callback()})}}};const ftn=(n,e)=>n==null&&e==null?!0:n==null||e==null?!1:n.droppableId===e.droppableId&&n.index===e.index,ptn=(n,e)=>n==null&&e==null?!0:n==null||e==null?!1:n.draggableId===e.draggableId&&n.droppableId===e.droppableId,gtn=(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},V5=(n,e)=>{e()},_V=(n,e)=>({draggableId:n.draggable.id,type:n.droppable.type,source:{droppableId:n.droppable.id,index:n.draggable.index},mode:e});function sle(n,e,t,i){if(!n){t(i(e));return}const r=dtn(t);n(e,{announce:r}),r.wasCalled()||t(i(e))}var mtn=(n,e)=>{const t=htn();let i=null;const r=(d,f)=>{i&&Ri(),V5("onBeforeCapture",()=>{const p=n().onBeforeCapture;p&&p({draggableId:d,mode:f})})},s=(d,f)=>{i&&Ri(),V5("onBeforeDragStart",()=>{const p=n().onBeforeDragStart;p&&p(_V(d,f))})},o=(d,f)=>{i&&Ri();const p=_V(d,f);i={mode:f,lastCritical:d,lastLocation:p.source,lastCombine:null},t.add(()=>{V5("onDragStart",()=>sle(n().onDragStart,p,e,jz.onDragStart))})},a=(d,f)=>{const p=ESe(f),g=nee(f);i||Ri();const m=!gtn(d,i.lastCritical);m&&(i.lastCritical=d);const _=!ftn(i.lastLocation,p);_&&(i.lastLocation=p);const v=!ptn(i.lastCombine,g);if(v&&(i.lastCombine=g),!m&&!_&&!v)return;const b={..._V(d,i.mode),combine:g,destination:p};t.add(()=>{V5("onDragUpdate",()=>sle(n().onDragUpdate,b,e,jz.onDragUpdate))})},l=()=>{i||Ri(),t.flush()},c=d=>{i||Ri(),i=null,V5("onDragEnd",()=>sle(n().onDragEnd,d,e,jz.onDragEnd))};return{beforeCapture:r,beforeStart:s,start:o,update:a,flush:l,drop:c,abort:()=>{if(!i)return;const d={..._V(i.lastCritical,i.mode),combine:null,destination:null,reason:"CANCEL"};c(d)}}},_tn=(n,e)=>{const t=mtn(n,e);return i=>r=>s=>{if(s.type==="BEFORE_INITIAL_CAPTURE"){t.beforeCapture(s.payload.draggableId,s.payload.movementMode);return}if(s.type==="INITIAL_PUBLISH"){const a=s.payload.critical;t.beforeStart(a,s.payload.movementMode),r(s),t.start(a,s.payload.movementMode);return}if(s.type==="DROP_COMPLETE"){const a=s.payload.completed.result;t.flush(),r(s),t.drop(a);return}if(r(s),s.type==="FLUSH"){t.abort();return}const o=i.getState();o.phase==="DRAGGING"&&t.update(o.critical,o.impact)}};const vtn=n=>e=>t=>{if(t.type!=="DROP_ANIMATION_FINISHED"){e(t);return}const i=n.getState();i.phase!=="DROP_ANIMATING"&&Ri(),n.dispatch(DSe({completed:i.completed}))};var btn=vtn;const ytn=n=>{let e=null,t=null;function i(){t&&(cancelAnimationFrame(t),t=null),e&&(e(),e=null)}return r=>s=>{if((s.type==="FLUSH"||s.type==="DROP_COMPLETE"||s.type==="DROP_ANIMATION_FINISHED")&&i(),r(s),s.type!=="DROP_ANIMATE")return;const o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){n.getState().phase==="DROP_ANIMATING"&&n.dispatch(HJe())}};t=requestAnimationFrame(()=>{t=null,e=j_(window,[o])})}};var Ctn=ytn,wtn=n=>()=>e=>t=>{(t.type==="DROP_COMPLETE"||t.type==="FLUSH"||t.type==="DROP_ANIMATE")&&n.stopPublishing(),e(t)},xtn=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 Stn=n=>n.type==="DROP_COMPLETE"||n.type==="DROP_ANIMATE"||n.type==="FLUSH";var Etn=n=>e=>t=>i=>{if(Stn(i)){n.stop(),t(i);return}if(i.type==="INITIAL_PUBLISH"){t(i);const r=e.getState();r.phase!=="DRAGGING"&&Ri(),n.start(r);return}t(i),n.scroll(e.getState())};const ktn=n=>e=>t=>{if(e(t),t.type!=="PUBLISH_WHILE_DRAGGING")return;const i=n.getState();i.phase==="DROP_PENDING"&&(i.isWaiting||n.dispatch($Je({reason:i.reason})))};var Ttn=ktn;const Itn=pO;var Ltn=({dimensionMarshal:n,focusMarshal:e,styleMarshal:t,getResponders:i,announce:r,autoScroller:s})=>PB(Pen,Itn(nCe(Zen(t),wtn(n),Xen(n),stn,btn,Ctn,Ttn,Etn(s),utn,xtn(e),_tn(i,r))));const ole=()=>({additions:{},removals:{},modified:{}});function Atn({registry:n,callbacks:e}){let t=ole(),i=null;const r=()=>{i||(e.collectionStarting(),i=requestAnimationFrame(()=>{i=null;const{additions:l,removals:c,modified:u}=t,d=Object.keys(l).map(g=>n.draggable.getById(g).getDimension(Qd)).sort((g,m)=>g.descriptor.index-m.descriptor.index),f=Object.keys(u).map(g=>{const _=n.droppable.getById(g).callbacks.getScrollWhileDragging();return{droppableId:g,scroll:_}}),p={additions:d,removals:Object.keys(c),modified:f};t=ole(),e.publish(p)}))};return{add:l=>{const c=l.descriptor.id;t.additions[c]=l,t.modified[l.descriptor.droppableId]=!0,t.removals[c]&&delete t.removals[c],r()},remove:l=>{const c=l.descriptor;t.removals[c.id]=!0,t.modified[c.droppableId]=!0,t.additions[c.id]&&delete t.additions[c.id],r()},stop:()=>{i&&(cancelAnimationFrame(i),i=null,t=ole())}}}var UJe=({scrollHeight:n,scrollWidth:e,height:t,width:i})=>{const r=pm({x:e,y:n},{x:i,y:t});return{x:Math.max(0,r.x),y:Math.max(0,r.y)}},qJe=()=>{const n=document.documentElement;return n||Ri(),n},KJe=()=>{const n=qJe();return UJe({scrollHeight:n.scrollHeight,scrollWidth:n.scrollWidth,width:n.clientWidth,height:n.clientHeight})},Ntn=()=>{const n=zJe(),e=KJe(),t=n.y,i=n.x,r=qJe(),s=r.clientWidth,o=r.clientHeight,a=i+s,l=t+o;return{frame:_b({top:t,left:i,right:a,bottom:l}),scroll:{initial:n,current:n,max:e,diff:{value:Qd,displacement:Qd}}}},Dtn=({critical:n,scrollOptions:e,registry:t})=>{const i=Ntn(),r=i.scroll.current,s=n.droppable,o=t.droppable.getAllByType(s.type).map(u=>u.callbacks.getDimensionAndWatchScroll(r,e)),a=t.draggable.getAllByType(n.draggable.type).map(u=>u.getDimension(r));return{dimensions:{draggables:CJe(a),droppables:yJe(o)},critical:n,viewport:i}};function e5e(n,e,t){return!(t.descriptor.id===e.id||t.descriptor.type!==e.type||n.droppable.getById(t.descriptor.droppableId).descriptor.mode!=="virtual")}var Rtn=(n,e)=>{let t=null;const i=Atn({callbacks:{publish:e.publishWhileDragging,collectionStarting:e.collectionStarting},registry:n}),r=(f,p)=>{n.droppable.exists(f)||Ri(),t&&e.updateDroppableIsEnabled({id:f,isEnabled:p})},s=(f,p)=>{t&&(n.droppable.exists(f)||Ri(),e.updateDroppableIsCombineEnabled({id:f,isCombineEnabled:p}))},o=(f,p)=>{t&&(n.droppable.exists(f)||Ri(),e.updateDroppableScroll({id:f,newScroll:p}))},a=(f,p)=>{t&&n.droppable.getById(f).callbacks.scroll(p)},l=()=>{if(!t)return;i.stop();const f=t.critical.droppable;n.droppable.getAllByType(f.type).forEach(p=>p.callbacks.dragStopped()),t.unsubscribe(),t=null},c=f=>{t||Ri();const p=t.critical.draggable;f.type==="ADDITION"&&e5e(n,p,f.value)&&i.add(f.value),f.type==="REMOVAL"&&e5e(n,p,f.value)&&i.remove(f.value)};return{updateDroppableIsEnabled:r,updateDroppableIsCombineEnabled:s,scrollDroppable:a,updateDroppableScroll:o,startPublishing:f=>{t&&Ri();const p=n.draggable.getById(f.draggableId),g=n.droppable.getById(p.descriptor.droppableId),m={draggable:p.descriptor,droppable:g.descriptor},_=n.subscribe(c);return t={critical:m,unsubscribe:_},Dtn({critical:m,registry:n,scrollOptions:f.scrollOptions})},stopPublishing:l}},GJe=(n,e)=>n.phase==="IDLE"?!0:n.phase!=="DROP_ANIMATING"||n.completed.result.draggableId===e?!1:n.completed.result.reason==="DROP",Ptn=n=>{window.scrollBy(n.x,n.y)};const Otn=ad(n=>tee(n).filter(e=>!(!e.isEnabled||!e.frame))),Mtn=(n,e)=>Otn(e).find(i=>(i.frame||Ri(),NJe(i.frame.pageMarginBox)(n)))||null;var jtn=({center:n,destination:e,droppables:t})=>{if(e){const r=t[e];return r.frame?r:null}return Mtn(n,t)};const $8={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var Ftn=(n,e,t=()=>$8)=>{const i=t(),r=n[e.size]*i.startFromPercentage,s=n[e.size]*i.maxScrollAtPercentage;return{startScrollingFrom:r,maxScrollValueAt:s}},YJe=({startOfRange:n,endOfRange:e,current:t})=>{const i=e-n;return i===0?0:(t-n)/i},PSe=1,Btn=(n,e,t=()=>$8)=>{const i=t();if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return i.maxPixelScroll;if(n===e.startScrollingFrom)return PSe;const s=1-YJe({startOfRange:e.maxScrollValueAt,endOfRange:e.startScrollingFrom,current:n}),o=i.maxPixelScroll*i.ease(s);return Math.ceil(o)},$tn=(n,e,t)=>{const i=t(),r=i.durationDampening.accelerateAt,s=i.durationDampening.stopDampeningAt,o=e,a=s,c=Date.now()-o;if(c>=s)return n;if(c<r)return PSe;const u=YJe({startOfRange:r,endOfRange:a,current:c}),d=n*i.ease(u);return Math.ceil(d)},t5e=({distanceToEdge:n,thresholds:e,dragStartTime:t,shouldUseTimeDampening:i,getAutoScrollerOptions:r})=>{const s=Btn(n,e,r);return s===0?0:i?Math.max($tn(s,t,r),PSe):s},n5e=({container:n,distanceToEdges:e,dragStartTime:t,axis:i,shouldUseTimeDampening:r,getAutoScrollerOptions:s})=>{const o=Ftn(n,i,s);return e[i.end]<e[i.start]?t5e({distanceToEdge:e[i.end],thresholds:o,dragStartTime:t,shouldUseTimeDampening:r,getAutoScrollerOptions:s}):-1*t5e({distanceToEdge:e[i.start],thresholds:o,dragStartTime:t,shouldUseTimeDampening:r,getAutoScrollerOptions:s})},Htn=({container:n,subject:e,proposedScroll:t})=>{const i=e.height>n.height,r=e.width>n.width;return!r&&!i?t:r&&i?null:{x:r?0:t.x,y:i?0:t.y}};const Vtn=bJe(n=>n===0?0:n);var QJe=({dragStartTime:n,container:e,subject:t,center:i,shouldUseTimeDampening:r,getAutoScrollerOptions:s})=>{const o={top:i.y-e.top,right:e.right-i.x,bottom:e.bottom-i.y,left:i.x-e.left},a=n5e({container:e,distanceToEdges:o,dragStartTime:n,axis:kSe,shouldUseTimeDampening:r,getAutoScrollerOptions:s}),l=n5e({container:e,distanceToEdges:o,dragStartTime:n,axis:SJe,shouldUseTimeDampening:r,getAutoScrollerOptions:s}),c=Vtn({x:l,y:a});if(nE(c,Qd))return null;const u=Htn({container:e,subject:t,proposedScroll:c});return u?nE(u,Qd)?null:u:null};const Wtn=bJe(n=>n===0?0:n>0?1:-1),OSe=(()=>{const n=(e,t)=>e<0?e:e>t?e-t:0;return({current:e,max:t,change:i})=>{const r=bh(e,i),s={x:n(r.x,t.x),y:n(r.y,t.y)};return nE(s,Qd)?null:s}})(),XJe=({max:n,current:e,change:t})=>{const i={x:Math.max(e.x,n.x),y:Math.max(e.y,n.y)},r=Wtn(t),s=OSe({max:i,current:e,change:r});return!s||r.x!==0&&s.x===0||r.y!==0&&s.y===0},MSe=(n,e)=>XJe({current:n.scroll.current,max:n.scroll.max,change:e}),ztn=(n,e)=>{if(!MSe(n,e))return null;const t=n.scroll.max,i=n.scroll.current;return OSe({current:i,max:t,change:e})},jSe=(n,e)=>{const t=n.frame;return t?XJe({current:t.scroll.current,max:t.scroll.max,change:e}):!1},Utn=(n,e)=>{const t=n.frame;return!t||!jSe(n,e)?null:OSe({current:t.scroll.current,max:t.scroll.max,change:e})};var qtn=({viewport:n,subject:e,center:t,dragStartTime:i,shouldUseTimeDampening:r,getAutoScrollerOptions:s})=>{const o=QJe({dragStartTime:i,container:n.frame,subject:e,center:t,shouldUseTimeDampening:r,getAutoScrollerOptions:s});return o&&MSe(n,o)?o:null},Ktn=({droppable:n,subject:e,center:t,dragStartTime:i,shouldUseTimeDampening:r,getAutoScrollerOptions:s})=>{const o=n.frame;if(!o)return null;const a=QJe({dragStartTime:i,container:o.pageMarginBox,subject:e,center:t,shouldUseTimeDampening:r,getAutoScrollerOptions:s});return a&&jSe(n,a)?a:null},i5e=({state:n,dragStartTime:e,shouldUseTimeDampening:t,scrollWindow:i,scrollDroppable:r,getAutoScrollerOptions:s})=>{const o=n.current.page.borderBoxCenter,l=n.dimensions.draggables[n.critical.draggable.id].page.marginBox;if(n.isWindowScrollAllowed){const d=n.viewport,f=qtn({dragStartTime:e,viewport:d,subject:l,center:o,shouldUseTimeDampening:t,getAutoScrollerOptions:s});if(f){i(f);return}}const c=jtn({center:o,destination:wm(n.impact),droppables:n.dimensions.droppables});if(!c)return;const u=Ktn({dragStartTime:e,droppable:c,subject:l,center:o,shouldUseTimeDampening:t,getAutoScrollerOptions:s});u&&r(c.descriptor.id,u)},Gtn=({scrollWindow:n,scrollDroppable:e,getAutoScrollerOptions:t=()=>$8})=>{const i=O8(n),r=O8(e);let s=null;const o=c=>{s||Ri();const{shouldUseTimeDampening:u,dragStartTime:d}=s;i5e({state:c,scrollWindow:i,scrollDroppable:r,dragStartTime:d,shouldUseTimeDampening:u,getAutoScrollerOptions:t})};return{start:c=>{s&&Ri();const u=Date.now();let d=!1;const f=()=>{d=!0};i5e({state:c,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:f,scrollDroppable:f,getAutoScrollerOptions:t}),s={dragStartTime:u,shouldUseTimeDampening:d},d&&o(c)},stop:()=>{s&&(i.cancel(),r.cancel(),s=null)},scroll:o}},Ytn=({move:n,scrollDroppable:e,scrollWindow:t})=>{const i=(a,l)=>{const c=bh(a.current.client.selection,l);n({client:c})},r=(a,l)=>{if(!jSe(a,l))return l;const c=Utn(a,l);if(!c)return e(a.descriptor.id,l),null;const u=pm(l,c);return e(a.descriptor.id,u),pm(l,u)},s=(a,l,c)=>{if(!a||!MSe(l,c))return c;const u=ztn(l,c);if(!u)return t(c),null;const d=pm(c,u);return t(d),pm(c,d)};return a=>{const l=a.scrollJumpRequest;if(!l)return;const c=wm(a.impact);c||Ri();const u=r(a.dimensions.droppables[c],l);if(!u)return;const d=a.viewport,f=s(a.isWindowScrollAllowed,d,u);f&&i(a,f)}},Qtn=({scrollDroppable:n,scrollWindow:e,move:t,getAutoScrollerOptions:i})=>{const r=Gtn({scrollWindow:e,scrollDroppable:n,getAutoScrollerOptions:i}),s=Ytn({move:t,scrollWindow:e,scrollDroppable:n});return{scroll:l=>{if(!(i().disabled||l.phase!=="DRAGGING")){if(l.movementMode==="FLUID"){r.scroll(l);return}l.scrollJumpRequest&&s(l)}},start:r.start,stop:r.stop}};const WO="data-rfd",zO=(()=>{const n=`${WO}-drag-handle`;return{base:n,draggableId:`${n}-draggable-id`,contextId:`${n}-context-id`}})(),wpe=(()=>{const n=`${WO}-draggable`;return{base:n,contextId:`${n}-context-id`,id:`${n}-id`}})(),Xtn=(()=>{const n=`${WO}-droppable`;return{base:n,contextId:`${n}-context-id`,id:`${n}-id`}})(),r5e={contextId:`${WO}-scroll-container-context-id`},Ztn=n=>e=>`[${e}="${n}"]`,W5=(n,e)=>n.map(t=>{const i=t.styles[e];return i?`${t.selector} { ${i} }`:""}).join(" "),Jtn="pointer-events: none;";var enn=n=>{const e=Ztn(n),t=(()=>{const a=` cursor: -webkit-grab; cursor: grab; `;return{selector:e(zO.contextId),styles:{always:` -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; `,resting:a,dragging:Jtn,dropAnimating:a}}})(),i=(()=>{const a=` transition: ${jF.outOfTheWay}; `;return{selector:e(wpe.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}})(),r={selector:e(Xtn.contextId),styles:{always:"overflow-anchor: none;"}},o=[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:W5(o,"always"),resting:W5(o,"resting"),dragging:W5(o,"dragging"),dropAnimating:W5(o,"dropAnimating"),userCancel:W5(o,"userCancel")}};const tnn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?x.useLayoutEffect:x.useEffect;var xm=tnn;const ale=()=>{const n=document.querySelector("head");return n||Ri(),n},s5e=n=>{const e=document.createElement("style");return n&&e.setAttribute("nonce",n),e.type="text/css",e};function nnn(n,e){const t=Ko(()=>enn(n),[n]),i=x.useRef(null),r=x.useRef(null),s=Hr(ad(d=>{const f=r.current;f||Ri(),f.textContent=d}),[]),o=Hr(d=>{const f=i.current;f||Ri(),f.textContent=d},[]);xm(()=>{!i.current&&!r.current||Ri();const d=s5e(e),f=s5e(e);return i.current=d,r.current=f,d.setAttribute(`${WO}-always`,n),f.setAttribute(`${WO}-dynamic`,n),ale().appendChild(d),ale().appendChild(f),o(t.always),s(t.resting),()=>{const p=g=>{const m=g.current;m||Ri(),ale().removeChild(m),g.current=null};p(i),p(r)}},[e,o,s,t.always,t.resting,n]);const a=Hr(()=>s(t.dragging),[s,t.dragging]),l=Hr(d=>{if(d==="DROP"){s(t.dropAnimating);return}s(t.userCancel)},[s,t.dropAnimating,t.userCancel]),c=Hr(()=>{r.current&&s(t.resting)},[s,t.resting]);return Ko(()=>({dragging:a,dropping:l,resting:c}),[a,l,c])}function ZJe(n,e){return Array.from(n.querySelectorAll(e))}var JJe=n=>n&&n.ownerDocument&&n.ownerDocument.defaultView?n.ownerDocument.defaultView:window;function see(n){return n instanceof JJe(n).HTMLElement}function inn(n,e){const t=`[${zO.contextId}="${n}"]`,i=ZJe(document,t);if(!i.length)return null;const r=i.find(s=>s.getAttribute(zO.draggableId)===e);return!r||!see(r)?null:r}function rnn(n){const e=x.useRef({}),t=x.useRef(null),i=x.useRef(null),r=x.useRef(!1),s=Hr(function(f,p){const g={id:f,focus:p};return e.current[f]=g,function(){const _=e.current;_[f]!==g&&delete _[f]}},[]),o=Hr(function(f){const p=inn(n,f);p&&p!==document.activeElement&&p.focus()},[n]),a=Hr(function(f,p){t.current===f&&(t.current=p)},[]),l=Hr(function(){i.current||r.current&&(i.current=requestAnimationFrame(()=>{i.current=null;const f=t.current;f&&o(f)}))},[o]),c=Hr(function(f){t.current=null;const p=document.activeElement;p&&p.getAttribute(zO.draggableId)===f&&(t.current=f)},[]);return xm(()=>(r.current=!0,function(){r.current=!1;const f=i.current;f&&cancelAnimationFrame(f)}),[]),Ko(()=>({register:s,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:a}),[s,c,l,a])}function snn(){const n={draggables:{},droppables:{}},e=[];function t(d){return e.push(d),function(){const p=e.indexOf(d);p!==-1&&e.splice(p,1)}}function i(d){e.length&&e.forEach(f=>f(d))}function r(d){return n.draggables[d]||null}function s(d){const f=r(d);return f||Ri(),f}const o={register:d=>{n.draggables[d.descriptor.id]=d,i({type:"ADDITION",value:d})},update:(d,f)=>{const p=n.draggables[f.descriptor.id];p&&p.uniqueId===d.uniqueId&&(delete n.draggables[f.descriptor.id],n.draggables[d.descriptor.id]=d)},unregister:d=>{const f=d.descriptor.id,p=r(f);p&&d.uniqueId===p.uniqueId&&(delete n.draggables[f],n.droppables[d.descriptor.droppableId]&&i({type:"REMOVAL",value:d}))},getById:s,findById:r,exists:d=>!!r(d),getAllByType:d=>Object.values(n.draggables).filter(f=>f.descriptor.type===d)};function a(d){return n.droppables[d]||null}function l(d){const f=a(d);return f||Ri(),f}const c={register:d=>{n.droppables[d.descriptor.id]=d},unregister:d=>{const f=a(d.descriptor.id);f&&d.uniqueId===f.uniqueId&&delete n.droppables[d.descriptor.id]},getById:l,findById:a,exists:d=>!!a(d),getAllByType:d=>Object.values(n.droppables).filter(f=>f.descriptor.type===d)};function u(){n.draggables={},n.droppables={},e.length=0}return{draggable:o,droppable:c,subscribe:t,clean:u}}function onn(){const n=Ko(snn,[]);return x.useEffect(()=>function(){we.version.startsWith("16")||we.version.startsWith("17")?requestAnimationFrame(n.clean):n.clean()},[n]),n}var FSe=we.createContext(null),iK=()=>{const n=document.body;return n||Ri(),n};const ann={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 lnn=ann;const cnn=n=>`rfd-announcement-${n}`;function unn(n){const e=Ko(()=>cnn(n),[n]),t=x.useRef(null);return x.useEffect(function(){const s=document.createElement("div");return t.current=s,s.id=e,s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true"),hn(s.style,lnn),iK().appendChild(s),function(){setTimeout(function(){const l=iK();l.contains(s)&&l.removeChild(s),s===t.current&&(t.current=null)})}},[e]),Hr(r=>{const s=t.current;if(s){s.textContent=r;return}},[])}let dnn=0;const eet={separator:"::"};function hnn(n,e=eet){return Ko(()=>`${n}${e.separator}${dnn++}`,[e.separator,n])}function fnn(n,e=eet){const t=we.useId();return Ko(()=>`${n}${e.separator}${t}`,[e.separator,n,t])}var BSe="useId"in we?fnn:hnn;function pnn({contextId:n,uniqueId:e}){return`rfd-hidden-text-${n}-${e}`}function gnn({contextId:n,text:e}){const t=BSe("hidden-text",{separator:"-"}),i=Ko(()=>pnn({contextId:n,uniqueId:t}),[t,n]);return x.useEffect(function(){const s=document.createElement("div");return s.id=i,s.textContent=e,s.style.display="none",iK().appendChild(s),function(){const a=iK();a.contains(s)&&a.removeChild(s)}},[i,e]),i}var oee=we.createContext(null);function tet(n){const e=x.useRef(n);return x.useEffect(()=>{e.current=n}),e}function mnn(){let n=null;function e(){return!!n}function t(o){return o===n}function i(o){n&&Ri();const a={abandon:o};return n=a,a}function r(){n||Ri(),n=null}function s(){n&&(n.abandon(),r())}return{isClaimed:e,isActive:t,claim:i,release:r,tryAbandon:s}}function H8(n){return n.phase==="IDLE"||n.phase==="DROP_ANIMATING"?!1:n.isDragging}const _nn=9,vnn=13,$Se=27,net=32,bnn=33,ynn=34,Cnn=35,wnn=36,xnn=37,Snn=38,Enn=39,knn=40,Tnn={[vnn]:!0,[_nn]:!0};var iet=n=>{Tnn[n.keyCode]&&n.preventDefault()};const Inn=(()=>{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 aee=Inn;const ret=0,o5e=5;function Lnn(n,e){return Math.abs(e.x-n.x)>=o5e||Math.abs(e.y-n.y)>=o5e}const a5e={type:"IDLE"};function Ann({cancel:n,completed:e,getPhase:t,setPhase:i}){return[{eventName:"mousemove",fn:r=>{const{button:s,clientX:o,clientY:a}=r;if(s!==ret)return;const l={x:o,y:a},c=t();if(c.type==="DRAGGING"){r.preventDefault(),c.actions.move(l);return}c.type!=="PENDING"&&Ri();const u=c.point;if(!Lnn(u,l))return;r.preventDefault();const d=c.actions.fluidLift(l);i({type:"DRAGGING",actions:d})}},{eventName:"mouseup",fn:r=>{const s=t();if(s.type!=="DRAGGING"){n();return}r.preventDefault(),s.actions.drop({shouldBlockNextClick:!0}),e()}},{eventName:"mousedown",fn:r=>{t().type==="DRAGGING"&&r.preventDefault(),n()}},{eventName:"keydown",fn:r=>{if(t().type==="PENDING"){n();return}if(r.keyCode===$Se){r.preventDefault(),n();return}iet(r)}},{eventName:"resize",fn:n},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{t().type==="PENDING"&&n()}},{eventName:"webkitmouseforcedown",fn:r=>{const s=t();if(s.type==="IDLE"&&Ri(),s.actions.shouldRespectForcePress()){n();return}r.preventDefault()}},{eventName:aee,fn:n}]}function Nnn(n){const e=x.useRef(a5e),t=x.useRef(tE),i=Ko(()=>({eventName:"mousedown",fn:function(d){if(d.defaultPrevented||d.button!==ret||d.ctrlKey||d.metaKey||d.shiftKey||d.altKey)return;const f=n.findClosestDraggableId(d);if(!f)return;const p=n.tryGetLock(f,o,{sourceEvent:d});if(!p)return;d.preventDefault();const g={x:d.clientX,y:d.clientY};t.current(),c(p,g)}}),[n]),r=Ko(()=>({eventName:"webkitmouseforcewillbegin",fn:u=>{if(u.defaultPrevented)return;const d=n.findClosestDraggableId(u);if(!d)return;const f=n.findOptionsForDraggable(d);f&&(f.shouldRespectForcePress||n.canGetLock(d)&&u.preventDefault())}}),[n]),s=Hr(function(){const d={passive:!1,capture:!0};t.current=j_(window,[r,i],d)},[r,i]),o=Hr(()=>{e.current.type!=="IDLE"&&(e.current=a5e,t.current(),s())},[s]),a=Hr(()=>{const u=e.current;o(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[o]),l=Hr(function(){const d={capture:!0,passive:!1},f=Ann({cancel:a,completed:o,getPhase:()=>e.current,setPhase:p=>{e.current=p}});t.current=j_(window,f,d)},[a,o]),c=Hr(function(d,f){e.current.type!=="IDLE"&&Ri(),e.current={type:"PENDING",point:f,actions:d},l()},[l]);xm(function(){return s(),function(){t.current()}},[s])}function Dnn(){}const Rnn={[ynn]:!0,[bnn]:!0,[wnn]:!0,[Cnn]:!0};function Pnn(n,e){function t(){e(),n.cancel()}function i(){e(),n.drop()}return[{eventName:"keydown",fn:r=>{if(r.keyCode===$Se){r.preventDefault(),t();return}if(r.keyCode===net){r.preventDefault(),i();return}if(r.keyCode===knn){r.preventDefault(),n.moveDown();return}if(r.keyCode===Snn){r.preventDefault(),n.moveUp();return}if(r.keyCode===Enn){r.preventDefault(),n.moveRight();return}if(r.keyCode===xnn){r.preventDefault(),n.moveLeft();return}if(Rnn[r.keyCode]){r.preventDefault();return}iet(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:aee,fn:t}]}function Onn(n){const e=x.useRef(Dnn),t=Ko(()=>({eventName:"keydown",fn:function(s){if(s.defaultPrevented||s.keyCode!==net)return;const o=n.findClosestDraggableId(s);if(!o)return;const a=n.tryGetLock(o,u,{sourceEvent:s});if(!a)return;s.preventDefault();let l=!0;const c=a.snapLift();e.current();function u(){l||Ri(),l=!1,e.current(),i()}e.current=j_(window,Pnn(c,u),{capture:!0,passive:!1})}}),[n]),i=Hr(function(){const s={passive:!1,capture:!0};e.current=j_(window,[t],s)},[t]);xm(function(){return i(),function(){e.current()}},[i])}const lle={type:"IDLE"},Mnn=120,jnn=.15;function Fnn({cancel:n,getPhase:e}){return[{eventName:"orientationchange",fn:n},{eventName:"resize",fn:n},{eventName:"contextmenu",fn:t=>{t.preventDefault()}},{eventName:"keydown",fn:t=>{if(e().type!=="DRAGGING"){n();return}t.keyCode===$Se&&t.preventDefault(),n()}},{eventName:aee,fn:n}]}function Bnn({cancel:n,completed:e,getPhase:t}){return[{eventName:"touchmove",options:{capture:!1},fn:i=>{const r=t();if(r.type!=="DRAGGING"){n();return}r.hasMoved=!0;const{clientX:s,clientY:o}=i.touches[0],a={x:s,y:o};i.preventDefault(),r.actions.move(a)}},{eventName:"touchend",fn:i=>{const r=t();if(r.type!=="DRAGGING"){n();return}i.preventDefault(),r.actions.drop({shouldBlockNextClick:!0}),e()}},{eventName:"touchcancel",fn:i=>{if(t().type!=="DRAGGING"){n();return}i.preventDefault(),n()}},{eventName:"touchforcechange",fn:i=>{const r=t();r.type==="IDLE"&&Ri();const s=i.touches[0];if(!s||!(s.force>=jnn))return;const a=r.actions.shouldRespectForcePress();if(r.type==="PENDING"){a&&n();return}if(a){if(r.hasMoved){i.preventDefault();return}n();return}i.preventDefault()}},{eventName:aee,fn:n}]}function $nn(n){const e=x.useRef(lle),t=x.useRef(tE),i=Hr(function(){return e.current},[]),r=Hr(function(p){e.current=p},[]),s=Ko(()=>({eventName:"touchstart",fn:function(p){if(p.defaultPrevented)return;const g=n.findClosestDraggableId(p);if(!g)return;const m=n.tryGetLock(g,a,{sourceEvent:p});if(!m)return;const _=p.touches[0],{clientX:v,clientY:b}=_,y={x:v,y:b};t.current(),d(m,y)}}),[n]),o=Hr(function(){const p={capture:!0,passive:!1};t.current=j_(window,[s],p)},[s]),a=Hr(()=>{const f=e.current;f.type!=="IDLE"&&(f.type==="PENDING"&&clearTimeout(f.longPressTimerId),r(lle),t.current(),o())},[o,r]),l=Hr(()=>{const f=e.current;a(),f.type==="DRAGGING"&&f.actions.cancel({shouldBlockNextClick:!0}),f.type==="PENDING"&&f.actions.abort()},[a]),c=Hr(function(){const p={capture:!0,passive:!1},g={cancel:l,completed:a,getPhase:i},m=j_(window,Bnn(g),p),_=j_(window,Fnn(g),p);t.current=function(){m(),_()}},[l,i,a]),u=Hr(function(){const p=i();p.type!=="PENDING"&&Ri();const g=p.actions.fluidLift(p.point);r({type:"DRAGGING",actions:g,hasMoved:!1})},[i,r]),d=Hr(function(p,g){i().type!=="IDLE"&&Ri();const m=setTimeout(u,Mnn);r({type:"PENDING",point:g,actions:p,longPressTimerId:m}),c()},[c,i,r,u]);xm(function(){return o(),function(){t.current();const g=i();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),r(lle))}},[i,o,r]),xm(function(){return j_(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const Hnn=["input","button","textarea","select","option","optgroup","video","audio"];function set(n,e){if(e==null)return!1;if(Hnn.includes(e.tagName.toLowerCase()))return!0;const i=e.getAttribute("contenteditable");return i==="true"||i===""?!0:e===n?!1:set(n,e.parentElement)}function Vnn(n,e){const t=e.target;return see(t)?set(n,t):!1}var Wnn=n=>_b(n.getBoundingClientRect()).center;function znn(n){return n instanceof JJe(n).Element}const Unn=(()=>{const n="matches";return typeof document>"u"?n:[n,"msMatchesSelector","webkitMatchesSelector"].find(i=>i in Element.prototype)||n})();function oet(n,e){return n==null?null:n[Unn](e)?n:oet(n.parentElement,e)}function qnn(n,e){return n.closest?n.closest(e):oet(n,e)}function Knn(n){return`[${zO.contextId}="${n}"]`}function Gnn(n,e){const t=e.target;if(!znn(t))return null;const i=Knn(n),r=qnn(t,i);return!r||!see(r)?null:r}function Ynn(n,e){const t=Gnn(n,e);return t?t.getAttribute(zO.draggableId):null}function Qnn(n,e){const t=`[${wpe.contextId}="${n}"]`,r=ZJe(document,t).find(s=>s.getAttribute(wpe.id)===e);return!r||!see(r)?null:r}function Xnn(n){n.preventDefault()}function vV({expected:n,phase:e,isLockActive:t,shouldWarn:i}){return!(!t()||n!==e)}function aet({lockAPI:n,store:e,registry:t,draggableId:i}){if(n.isClaimed())return!1;const r=t.draggable.findById(i);return!(!r||!r.options.isEnabled||!GJe(e.getState(),i))}function Znn({lockAPI:n,contextId:e,store:t,registry:i,draggableId:r,forceSensorStop:s,sourceEvent:o}){if(!aet({lockAPI:n,store:t,registry:i,draggableId:r}))return null;const l=i.draggable.getById(r),c=Qnn(e,l.descriptor.id);if(!c||o&&!l.options.canDragInteractiveElements&&Vnn(c,o))return null;const u=n.claim(s||tE);let d="PRE_DRAG";function f(){return l.options.shouldRespectForcePress}function p(){return n.isActive(u)}function g(S,k){vV({expected:S,phase:d,isLockActive:p,shouldWarn:!0})&&t.dispatch(k())}const m=g.bind(null,"DRAGGING");function _(S){function k(){n.release(),d="COMPLETED"}d!=="PRE_DRAG"&&(k(),Ri()),t.dispatch(Men(S.liftActionArgs)),d="DRAGGING";function I(L,N={shouldBlockNextClick:!1}){if(S.cleanup(),N.shouldBlockNextClick){const P=j_(window,[{eventName:"click",fn:Xnn,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(P)}k(),t.dispatch($Je({reason:L}))}return{isActive:()=>vV({expected:"DRAGGING",phase:d,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:f,drop:L=>I("DROP",L),cancel:L=>I("CANCEL",L),...S.actions}}function v(S){const k=O8(L=>{m(()=>BJe({client:L}))});return{..._({liftActionArgs:{id:r,clientSelection:S,movementMode:"FLUID"},cleanup:()=>k.cancel(),actions:{move:k}}),move:k}}function b(){const S={moveUp:()=>m(Uen),moveRight:()=>m(Ken),moveDown:()=>m(qen),moveLeft:()=>m(Gen)};return _({liftActionArgs:{id:r,clientSelection:Wnn(c),movementMode:"SNAP"},cleanup:tE,actions:S})}function y(){vV({expected:"PRE_DRAG",phase:d,isLockActive:p,shouldWarn:!0})&&n.release()}return{isActive:()=>vV({expected:"PRE_DRAG",phase:d,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:f,fluidLift:v,snapLift:b,abort:y}}const Jnn=[Nnn,Onn,$nn];function ein({contextId:n,store:e,registry:t,customSensors:i,enableDefaultSensors:r}){const s=[...r?Jnn:[],...i||[]],o=x.useState(()=>mnn())[0],a=Hr(function(_,v){H8(_)&&!H8(v)&&o.tryAbandon()},[o]);xm(function(){let _=e.getState();return e.subscribe(()=>{const b=e.getState();a(_,b),_=b})},[o,e,a]),xm(()=>o.tryAbandon,[o.tryAbandon]);const l=Hr(m=>aet({lockAPI:o,registry:t,store:e,draggableId:m}),[o,t,e]),c=Hr((m,_,v)=>Znn({lockAPI:o,registry:t,contextId:n,store:e,draggableId:m,forceSensorStop:_||null,sourceEvent:v&&v.sourceEvent?v.sourceEvent:null}),[n,o,t,e]),u=Hr(m=>Ynn(n,m),[n]),d=Hr(m=>{const _=t.draggable.findById(m);return _?_.options:null},[t.draggable]),f=Hr(function(){o.isClaimed()&&(o.tryAbandon(),e.getState().phase!=="IDLE"&&e.dispatch(NSe()))},[o,e]),p=Hr(()=>o.isClaimed(),[o]),g=Ko(()=>({canGetLock:l,tryGetLock:c,findClosestDraggableId:u,findOptionsForDraggable:d,tryReleaseLock:f,isLockClaimed:p}),[l,c,u,d,f,p]);for(let m=0;m<s.length;m++)s[m](g)}const tin=n=>({onBeforeCapture:e=>{const t=()=>{n.onBeforeCapture&&n.onBeforeCapture(e)};we.version.startsWith("16")||we.version.startsWith("17")?t():Bm.flushSync(t)},onBeforeDragStart:n.onBeforeDragStart,onDragStart:n.onDragStart,onDragEnd:n.onDragEnd,onDragUpdate:n.onDragUpdate}),nin=n=>({...$8,...n.autoScrollerOptions,durationDampening:{...$8.durationDampening,...n.autoScrollerOptions}});function z5(n){return n.current||Ri(),n.current}function iin(n){const{contextId:e,setCallbacks:t,sensors:i,nonce:r,dragHandleUsageInstructions:s}=n,o=x.useRef(null),a=tet(n),l=Hr(()=>tin(a.current),[a]),c=Hr(()=>nin(a.current),[a]),u=unn(e),d=gnn({contextId:e,text:s}),f=nnn(e,r),p=Hr(P=>{z5(o).dispatch(P)},[]),g=Ko(()=>Ede({publishWhileDragging:Fen,updateDroppableScroll:$en,updateDroppableIsEnabled:Hen,updateDroppableIsCombineEnabled:Ven,collectionStarting:Ben},p),[p]),m=onn(),_=Ko(()=>Rtn(m,g),[m,g]),v=Ko(()=>Qtn({scrollWindow:Ptn,scrollDroppable:_.scrollDroppable,getAutoScrollerOptions:c,...Ede({move:BJe},p)}),[_.scrollDroppable,p,c]),b=rnn(e),y=Ko(()=>Ltn({announce:u,autoScroller:v,dimensionMarshal:_,focusMarshal:b,getResponders:l,styleMarshal:f}),[u,v,_,b,l,f]);o.current=y;const C=Hr(()=>{const P=z5(o);P.getState().phase!=="IDLE"&&P.dispatch(NSe())},[]),S=Hr(()=>{const P=z5(o).getState();return P.phase==="DROP_ANIMATING"?!0:P.phase==="IDLE"?!1:P.isDragging},[]),k=Ko(()=>({isDragging:S,tryAbort:C}),[S,C]);t(k);const I=Hr(P=>GJe(z5(o).getState(),P),[]),L=Hr(()=>JT(z5(o).getState()),[]),N=Ko(()=>({marshal:_,focus:b,contextId:e,canLift:I,isMovementAllowed:L,dragHandleUsageInstructionsId:d,registry:m}),[e,_,d,b,I,L,m]);return ein({contextId:e,store:y,registry:m,customSensors:i||null,enableDefaultSensors:n.enableDefaultSensors!==!1}),x.useEffect(()=>C,[C]),we.createElement(oee.Provider,{value:N},we.createElement(SVe,{context:FSe,store:y},n.children))}let rin=0;function sin(){return Ko(()=>`${rin++}`,[])}function oin(){return we.useId()}var ain="useId"in we?oin:sin;function lee(n){const e=ain(),t=n.dragHandleUsageInstructions||jz.dragHandleUsageInstructions;return we.createElement(SJt,null,i=>we.createElement(iin,{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 l5e={dragging:5e3,dropAnimating:4500},lin=(n,e)=>e?jF.drop(e.duration):n?jF.snap:jF.fluid,cin=(n,e)=>{if(n)return e?B8.opacity.drop:B8.opacity.combining},uin=n=>n.forceShouldAnimate!=null?n.forceShouldAnimate:n.mode==="SNAP";function din(n){const t=n.dimension.client,{offset:i,combineWith:r,dropping:s}=n,o=!!r,a=uin(n),l=!!s,c=l?ype.drop(i,o):ype.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:lin(a,s),transform:c,opacity:cin(o,l),zIndex:l?l5e.dropAnimating:l5e.dragging,pointerEvents:"none"}}function hin(n){return{transform:ype.moveTo(n.offset),transition:n.shouldAnimateDisplacement?void 0:"none"}}function fin(n){return n.type==="DRAGGING"?din(n):hin(n)}function pin(n,e,t=Qd){const i=window.getComputedStyle(e),r=e.getBoundingClientRect(),s=pJe(r,i),o=Jq(s,t),a={client:s,tagName:e.tagName.toLowerCase(),display:i.display},l={x:s.marginBox.width,y:s.marginBox.height};return{descriptor:n,placeholder:a,displaceBy:l,client:s,page:o}}function gin(n){const e=BSe("draggable"),{descriptor:t,registry:i,getDraggableRef:r,canDragInteractiveElements:s,shouldRespectForcePress:o,isEnabled:a}=n,l=Ko(()=>({canDragInteractiveElements:s,shouldRespectForcePress:o,isEnabled:a}),[s,a,o]),c=Hr(p=>{const g=r();return g||Ri(),pin(t,g,p)},[t,r]),u=Ko(()=>({uniqueId:e,descriptor:t,options:l,getDimension:c}),[t,c,l,e]),d=x.useRef(u),f=x.useRef(!0);xm(()=>(i.draggable.register(d.current),()=>i.draggable.unregister(d.current)),[i.draggable]),xm(()=>{if(f.current){f.current=!1;return}const p=d.current;d.current=u,i.draggable.update(u,p)},[u,i.draggable])}var HSe=we.createContext(null);function rK(n){const e=x.useContext(n);return e||Ri(),e}function min(n){n.preventDefault()}const _in=n=>{const e=x.useRef(null),t=Hr((k=null)=>{e.current=k},[]),i=Hr(()=>e.current,[]),{contextId:r,dragHandleUsageInstructionsId:s,registry:o}=rK(oee),{type:a,droppableId:l}=rK(HSe),c=Ko(()=>({id:n.draggableId,index:n.index,type:a,droppableId:l}),[n.draggableId,n.index,a,l]),{children:u,draggableId:d,isEnabled:f,shouldRespectForcePress:p,canDragInteractiveElements:g,isClone:m,mapped:_,dropAnimationFinished:v}=n;if(!m){const k=Ko(()=>({descriptor:c,registry:o,getDraggableRef:i,canDragInteractiveElements:g,shouldRespectForcePress:p,isEnabled:f}),[c,o,i,g,p,f]);gin(k)}const b=Ko(()=>f?{tabIndex:0,role:"button","aria-describedby":s,"data-rfd-drag-handle-draggable-id":d,"data-rfd-drag-handle-context-id":r,draggable:!1,onDragStart:min}:null,[r,s,d,f]),y=Hr(k=>{_.type==="DRAGGING"&&_.dropping&&k.propertyName==="transform"&&(we.version.startsWith("16")||we.version.startsWith("17")?v():Bm.flushSync(v))},[v,_]),C=Ko(()=>{const k=fin(_),I=_.type==="DRAGGING"&&_.dropping?y:void 0;return{innerRef:t,draggableProps:{"data-rfd-draggable-context-id":r,"data-rfd-draggable-id":d,style:k,onTransitionEnd:I},dragHandleProps:b}},[r,b,d,_,y,t]),S=Ko(()=>({draggableId:c.id,type:c.type,source:{index:c.index,droppableId:c.droppableId}}),[c.droppableId,c.id,c.index,c.type]);return we.createElement(we.Fragment,null,u(C,_.snapshot,S))};var vin=_in,cet=(n,e)=>n===e,uet=n=>{const{combine:e,destination:t}=n;return t?t.droppableId:e?e.droppableId:null};const bin=n=>n.combine?n.combine.draggableId:null,yin=n=>n.at&&n.at.type==="COMBINE"?n.at.combine.draggableId:null;function Cin(){const n=ad((r,s)=>({x:r,y:s})),e=ad((r,s,o=null,a=null,l=null)=>({isDragging:!0,isClone:s,isDropAnimating:!!l,dropAnimation:l,mode:r,draggingOver:o,combineWith:a,combineTargetFor:null})),t=ad((r,s,o,a,l=null,c=null,u=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:l,combineWith:c,mode:s,offset:r,dimension:o,forceShouldAnimate:u,snapshot:e(s,a,l,c,null)}}));return(r,s)=>{if(H8(r)){if(r.critical.draggable.id!==s.draggableId)return null;const o=r.current.client.offset,a=r.dimensions.draggables[s.draggableId],l=wm(r.impact),c=yin(r.impact),u=r.forceShouldAnimate;return t(n(o.x,o.y),r.movementMode,a,s.isClone,l,c,u)}if(r.phase==="DROP_ANIMATING"){const o=r.completed;if(o.result.draggableId!==s.draggableId)return null;const a=s.isClone,l=r.dimensions.draggables[s.draggableId],c=o.result,u=c.mode,d=uet(c),f=bin(c),g={duration:r.dropDuration,curve:RSe.drop,moveTo:r.newHomeClientOffset,opacity:f?B8.opacity.drop:null,scale:f?B8.scale.drop:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:l,dropping:g,draggingOver:d,combineWith:f,mode:u,forceShouldAnimate:null,snapshot:e(u,a,d,f,g)}}}return null}}function det(n=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:n,combineWith:null}}const win={mapped:{type:"SECONDARY",offset:Qd,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:det(null)}};function xin(){const n=ad((o,a)=>({x:o,y:a})),e=ad(det),t=ad((o,a=null,l)=>({mapped:{type:"SECONDARY",offset:o,combineTargetFor:a,shouldAnimateDisplacement:l,snapshot:e(a)}})),i=o=>o?t(Qd,o,!0):null,r=(o,a,l,c)=>{const u=l.displaced.visible[o],d=!!(c.inVirtualList&&c.effected[o]),f=nee(l),p=f&&f.draggableId===o?a:null;if(!u){if(!d)return i(p);if(l.displaced.invisible[o])return null;const _=w4(c.displacedBy.point),v=n(_.x,_.y);return t(v,p,!0)}if(d)return i(p);const g=l.displacedBy.point,m=n(g.x,g.y);return t(m,p,u.shouldAnimate)};return(o,a)=>{if(H8(o))return o.critical.draggable.id===a.draggableId?null:r(a.draggableId,o.critical.draggable.id,o.impact,o.afterCritical);if(o.phase==="DROP_ANIMATING"){const l=o.completed;return l.result.draggableId===a.draggableId?null:r(a.draggableId,l.result.draggableId,l.impact,l.afterCritical)}return null}}const Sin=()=>{const n=Cin(),e=xin();return(i,r)=>n(i,r)||e(i,r)||win},Ein={dropAnimationFinished:HJe},kin=xVe(Sin,Ein,null,{context:FSe,areStatePropsEqual:cet})(vin);var Tin=kin;function het(n){return rK(HSe).isUsingCloneFor===n.draggableId&&!n.isClone?null:we.createElement(Tin,n)}function cee(n){const e=typeof n.isDragDisabled=="boolean"?!n.isDragDisabled:!0,t=!!n.disableInteractiveElementBlocking,i=!!n.shouldRespectForcePress;return we.createElement(het,hn({},n,{isClone:!1,isEnabled:e,canDragInteractiveElements:t,shouldRespectForcePress:i}))}const fet=n=>e=>n===e,Iin=fet("scroll"),Lin=fet("auto"),c5e=(n,e)=>e(n.overflowX)||e(n.overflowY),Ain=n=>{const e=window.getComputedStyle(n),t={overflowX:e.overflowX,overflowY:e.overflowY};return c5e(t,Iin)||c5e(t,Lin)},Nin=()=>!1,pet=n=>n==null?null:n===document.body?Nin()?n:null:n===document.documentElement?null:Ain(n)?n:pet(n.parentElement);var xpe=n=>({x:n.scrollLeft,y:n.scrollTop});const get=n=>n?window.getComputedStyle(n).position==="fixed"?!0:get(n.parentElement):!1;var Din=n=>{const e=pet(n),t=get(n);return{closestScrollable:e,isFixedOnPage:t}},Rin=({descriptor:n,isEnabled:e,isCombineEnabled:t,isFixedOnPage:i,direction:r,client:s,page:o,closest:a})=>{const l=(()=>{if(!a)return null;const{scrollSize:f,client:p}=a,g=UJe({scrollHeight:f.scrollHeight,scrollWidth:f.scrollWidth,height:p.paddingBox.height,width:p.paddingBox.width});return{pageMarginBox:a.page.marginBox,frameClient:p,scrollSize:f,shouldClipSubject:a.shouldClipSubject,scroll:{initial:a.scroll,current:a.scroll,max:g,diff:{value:Qd,displacement:Qd}}}})(),c=r==="vertical"?kSe:SJe,u=VO({page:o,withPlaceholder:null,axis:c,frame:l});return{descriptor:n,isCombineEnabled:t,isFixedOnPage:i,axis:c,isEnabled:e,client:s,page:o,frame:l,subject:u}};const Pin=(n,e)=>{const t=gJe(n);if(!e||n!==e)return t;const i=t.paddingBox.top-e.scrollTop,r=t.paddingBox.left-e.scrollLeft,s=i+e.scrollHeight,o=r+e.scrollWidth,l=wSe({top:i,right:o,bottom:s,left:r},t.border);return xSe({borderBox:l,margin:t.margin,border:t.border,padding:t.padding})};var Oin=({ref:n,descriptor:e,env:t,windowScroll:i,direction:r,isDropDisabled:s,isCombineEnabled:o,shouldClipSubject:a})=>{const l=t.closestScrollable,c=Pin(n,l),u=Jq(c,i),d=(()=>{if(!l)return null;const p=gJe(l),g={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:p,page:Jq(p,i),scroll:xpe(l),scrollSize:g,shouldClipSubject:a}})();return Rin({descriptor:e,isEnabled:!s,isCombineEnabled:o,isFixedOnPage:t.isFixedOnPage,direction:r,client:c,page:u,closest:d})};const Min={passive:!1},jin={passive:!0};var u5e=n=>n.shouldPublishImmediately?Min:jin;const bV=n=>n&&n.env.closestScrollable||null;function Fin(n){const e=x.useRef(null),t=rK(oee),i=BSe("droppable"),{registry:r,marshal:s}=t,o=tet(n),a=Ko(()=>({id:n.droppableId,type:n.type,mode:n.mode}),[n.droppableId,n.mode,n.type]),l=x.useRef(a),c=Ko(()=>ad((C,S)=>{e.current||Ri();const k={x:C,y:S};s.updateDroppableScroll(a.id,k)}),[a.id,s]),u=Hr(()=>{const C=e.current;return!C||!C.env.closestScrollable?Qd:xpe(C.env.closestScrollable)},[]),d=Hr(()=>{const C=u();c(C.x,C.y)},[u,c]),f=Ko(()=>O8(d),[d]),p=Hr(()=>{const C=e.current,S=bV(C);if(C&&S||Ri(),C.scrollOptions.shouldPublishImmediately){d();return}f()},[f,d]),g=Hr((C,S)=>{e.current&&Ri();const k=o.current,I=k.getDroppableRef();I||Ri();const L=Din(I),N={ref:I,descriptor:a,env:L,scrollOptions:S};e.current=N;const P=Oin({ref:I,descriptor:a,env:L,windowScroll:C,direction:k.direction,isDropDisabled:k.isDropDisabled,isCombineEnabled:k.isCombineEnabled,shouldClipSubject:!k.ignoreContainerClipping}),O=L.closestScrollable;return O&&(O.setAttribute(r5e.contextId,t.contextId),O.addEventListener("scroll",p,u5e(N.scrollOptions))),P},[t.contextId,a,p,o]),m=Hr(()=>{const C=e.current,S=bV(C);return C&&S||Ri(),xpe(S)},[]),_=Hr(()=>{const C=e.current;C||Ri();const S=bV(C);e.current=null,S&&(f.cancel(),S.removeAttribute(r5e.contextId),S.removeEventListener("scroll",p,u5e(C.scrollOptions)))},[p,f]),v=Hr(C=>{const S=e.current;S||Ri();const k=bV(S);k||Ri(),k.scrollTop+=C.y,k.scrollLeft+=C.x},[]),b=Ko(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:m,dragStopped:_,scroll:v}),[_,g,m,v]),y=Ko(()=>({uniqueId:i,descriptor:a,callbacks:b}),[b,a,i]);xm(()=>(l.current=y.descriptor,r.droppable.register(y),()=>{e.current&&_(),r.droppable.unregister(y)}),[b,a,_,y,s,r.droppable]),xm(()=>{e.current&&s.updateDroppableIsEnabled(l.current.id,!n.isDropDisabled)},[n.isDropDisabled,s]),xm(()=>{e.current&&s.updateDroppableIsCombineEnabled(l.current.id,n.isCombineEnabled)},[n.isCombineEnabled,s])}function cle(){}const d5e={width:0,height:0,margin:NJt},Bin=({isAnimatingOpenOnMount:n,placeholder:e,animate:t})=>n||t==="close"?d5e:{height:e.client.borderBox.height,width:e.client.borderBox.width,margin:e.client.margin},$in=({isAnimatingOpenOnMount:n,placeholder:e,animate:t})=>{const i=Bin({isAnimatingOpenOnMount:n,placeholder:e,animate:t});return{display:e.display,boxSizing:"border-box",width:i.width,height:i.height,marginTop:i.margin.top,marginRight:i.margin.right,marginBottom:i.margin.bottom,marginLeft:i.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:t!=="none"?jF.placeholder:null}},Hin=n=>{const e=x.useRef(null),t=Hr(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),{animate:i,onTransitionEnd:r,onClose:s,contextId:o}=n,[a,l]=x.useState(n.animate==="open");x.useEffect(()=>a?i!=="open"?(t(),l(!1),cle):e.current?cle:(e.current=setTimeout(()=>{e.current=null,l(!1)}),t):cle,[i,a,t]);const c=Hr(d=>{d.propertyName==="height"&&(r(),i==="close"&&s())},[i,s,r]),u=$in({isAnimatingOpenOnMount:a,animate:n.animate,placeholder:n.placeholder});return we.createElement(n.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":o,onTransitionEnd:c,ref:n.innerRef})};var Vin=we.memo(Hin);class Win extends we.PureComponent{constructor(...e){super(...e),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 zin=n=>{const e=x.useContext(oee);e||Ri();const{contextId:t,isMovementAllowed:i}=e,r=x.useRef(null),s=x.useRef(null),{children:o,droppableId:a,type:l,mode:c,direction:u,ignoreContainerClipping:d,isDropDisabled:f,isCombineEnabled:p,snapshot:g,useClone:m,updateViewportMaxScroll:_,getContainerForClone:v}=n,b=Hr(()=>r.current,[]),y=Hr((O=null)=>{r.current=O},[]);Hr(()=>s.current,[]);const C=Hr((O=null)=>{s.current=O},[]),S=Hr(()=>{i()&&_({maxScroll:KJe()})},[i,_]);Fin({droppableId:a,type:l,mode:c,direction:u,isDropDisabled:f,isCombineEnabled:p,ignoreContainerClipping:d,getDroppableRef:b});const k=Ko(()=>we.createElement(Win,{on:n.placeholder,shouldAnimate:n.shouldAnimatePlaceholder},({onClose:O,data:F,animate:V})=>we.createElement(Vin,{placeholder:F,onClose:O,innerRef:C,animate:V,contextId:t,onTransitionEnd:S})),[t,S,n.placeholder,n.shouldAnimatePlaceholder,C]),I=Ko(()=>({innerRef:y,placeholder:k,droppableProps:{"data-rfd-droppable-id":a,"data-rfd-droppable-context-id":t}}),[t,a,k,y]),L=m?m.dragging.draggableId:null,N=Ko(()=>({droppableId:a,type:l,isUsingCloneFor:L}),[a,L,l]);function P(){if(!m)return null;const{dragging:O,render:F}=m,V=we.createElement(het,{draggableId:O.draggableId,index:O.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(M,B)=>F(M,B,O));return J6.createPortal(V,v())}return we.createElement(HSe.Provider,{value:N},o(I,g),P())};var Uin=zin;function qin(){return document.body||Ri(),document.body}const h5e={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:qin},met=n=>{let e={...n},t;for(t in h5e)n[t]===void 0&&(e={...e,[t]:h5e[t]});return e},ule=(n,e)=>n===e.droppable.type,f5e=(n,e)=>e.draggables[n.draggable.id],Kin=()=>{const n={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},e={...n,shouldAnimatePlaceholder:!1},t=ad(s=>({draggableId:s.id,type:s.type,source:{index:s.index,droppableId:s.droppableId}})),i=ad((s,o,a,l,c,u)=>{const d=c.descriptor.id;if(c.descriptor.droppableId===s){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(!o)return e;if(!l)return n;const p={isDraggingOver:a,draggingOverWith:d,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!0,snapshot:p,useClone:null}});return(s,o)=>{const a=met(o),l=a.droppableId,c=a.type,u=!a.isDropDisabled,d=a.renderClone;if(H8(s)){const f=s.critical;if(!ule(c,f))return e;const p=f5e(f,s.dimensions),g=wm(s.impact)===l;return i(l,u,g,g,p,d)}if(s.phase==="DROP_ANIMATING"){const f=s.completed;if(!ule(c,f.critical))return e;const p=f5e(f.critical,s.dimensions);return i(l,u,uet(f.result)===l,wm(f.impact)===l,p,d)}if(s.phase==="IDLE"&&s.completed&&!s.shouldFlush){const f=s.completed;if(!ule(c,f.critical))return e;const p=wm(f.impact)===l,g=!!(f.impact.at&&f.impact.at.type==="COMBINE"),m=f.critical.droppable.id===l;return p?g?n:e:m?n:e}return e}},Gin={updateViewportMaxScroll:zen},Yin=xVe(Kin,Gin,(n,e,t)=>({...met(t),...n,...e}),{context:FSe,areStatePropsEqual:cet})(Uin);var uee=Yin;function Qin(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,[s]=n.splice(e,1);n.splice(r,0,s)}}function VSe(n,e,t){return n=[...n],Qin(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 Xin(n){const{isCompanySettingsActive:e}=el(),{currentGateways:t,setCurrentGateways:i}=n,r=Nr(),s=Xs(),[o,a]=x.useState([]),[l,c]=x.useState("active"),{data:u}=wxe({status:l}),d=m=>{const _=m.map(v=>v.value);c(_.join(","))},f=m=>{const _=t.filter(({id:v})=>v!==m);i(_),_.length?s("settings.company_gateway_ids",_.map(({id:v})=>v).join(",")):s("settings.company_gateway_ids","0")},p=()=>{const m=(u==null?void 0:u.data.data)||[];m&&(i(m),s("settings.company_gateway_ids",m.map(({id:_})=>_).join(",")))},g=m=>{const _={};return m.forEach(v=>{_[v.id]||(_[v.id]=v)}),Object.values(_)};return x.useEffect(()=>{if(u)if((r==null?void 0:r.settings.company_gateway_ids)!=="0")if(r!=null&&r.settings.company_gateway_ids){let m=r.settings.company_gateway_ids.split(",").map(_=>u.data.data.find(v=>v.id===_));m=m.filter(_=>_),e&&u.data.data.forEach(_=>{m.some(b=>b.id===_.id)||m.push(_)}),a(g(m))}else a(g(u.data.data));else a([])},[u]),{gateways:o,handleRemoveGateway:f,handleReset:p,onStatusChange:d}}const Zin=As.button` background-color: ${n=>n.theme.backgroundColor}; color: ${n=>n.theme.textColor}; border-color: ${n=>n.theme.borderColor}; `;function _et(){return null}function vet(n){const e=xt(),t=n.getValue(),i=n.selectProps.placeholder,r=t.length>0?t.map(s=>s.label).join(", "):"";return h.jsx(o1.ValueContainer,{...n,children:h.jsxs("div",{className:"flex xl:space-x-1 cursor-pointer w-full",children:[h.jsx("span",{className:"hidden xl:inline-block font-medium text-sm",style:{color:e.$17},children:i&&`${i}:`}),h.jsx("span",{className:"truncate text-sm",style:{maxWidth:"6.5rem"},children:r})]})})}function bet(){const n=xt();return h.jsx("div",{className:$t("flex items-center justify-center hover:opacity-75 h-full w-full pr-2 cursor-pointer"),style:{color:n.$3},children:h.jsx($y,{color:n.$3,size:"1rem"})})}function yet(n){const{isSelected:e,label:t}=n;return h.jsx(o1.Option,{className:"rounded-sm",...n,children:h.jsxs("div",{className:"flex space-x-3 items-center w-full truncate",children:[h.jsx(Vd,{className:"rounded-md",checked:e}),h.jsx("span",{className:"text-sm",children:t})]})})}function Cet(n){const e=x.useRef(null),t=xt(),i=n.selectProps.placeholder,r=s=>{s.stopPropagation(),n.selectProps.menuIsOpen?n.selectProps.onMenuClose():n.selectProps.onMenuOpen()};return Uw(e,()=>{n.selectProps.onMenuClose()}),h.jsxs("div",{className:"relative",children:[i&&h.jsx("span",{className:"xl:hidden absolute left-3 px-1 text-xs font-medium z-10 rounded-sm",style:{color:t.$17,backgroundColor:t.$2,top:"-0.35rem"},children:i}),h.jsx(o1.Control,{className:$t("shadow-sm",{"pt-1":i}),...n,children:h.jsx("div",{ref:e,className:"flex items-center w-full",onClick:r,children:n.children})})]})}function Spe(n){const{options:e,defaultValue:t,onChange:i,components:r,...s}=n,[o,a]=x.useState(t),l=u=>{const[d]=xe(),f=xt(),p=Qo(),g=()=>{u.clearValue(),a([])},m=()=>{const _=u.getValue();i(_),u.selectProps.onMenuClose()};return h.jsx(o1.Menu,{className:"px-1",...u,children:h.jsxs("div",{className:"flex flex-col space-y-3 pb-3",children:[h.jsx("div",{children:u.children}),h.jsxs("div",{className:"flex w-full px-3 space-x-2",children:[h.jsx(Zin,{className:$t("w-1/2 rounded-md text-sm font-medium",{border:p==null?void 0:p.dark_mode}),onClick:g,theme:{textColor:f.$3,backgroundColor:"#09090B1A"},children:d("reset")}),h.jsx(dn,{className:"w-1/2 rounded-md font-medium",onClick:m,children:d("apply")})]})]})})},c=u=>{a(u)};return h.jsx(qZ,{...s,options:e,value:o,defaultValue:t,onChange:c,components:{...r,Menu:l},className:"sm:w-auto w-full"})}function Jin(n){const[e]=xe(),{customFilter:t}=n,i=xt(),r=n.customFilters?ql(n.customFilters).pluck("dropdownKey").unique().toArray().map(c=>c??"0"):[],s=c=>{if(n.onStatusChange){const u=[];return c.map(d=>u.push(d.value)),n.onStatusChange(u)}},o=(c,u)=>{var d;if(n.onCustomFilterChange&&r.length===1){const f=[];return c.map(p=>f.push(p.value)),n.onCustomFilterChange(f)}else if(n.onCustomFilterChange&&r.length>1){const f=[];if(c.map(p=>f.push(p.value)),t!=null&&t.length){const p=((d=n.customFilters)==null?void 0:d.filter(g=>g.dropdownKey!==u&&t.some(m=>m===g.value)))||[];return n.onCustomFilterChange([...p.map(g=>g.value),...f])}else return n.onCustomFilterChange(f)}},a={control:c=>({...c,backgroundColor:i.$1,borderColor:i.$24,borderRadius:"0.375rem",padding:"0 6px"}),valueContainer:c=>({...c,padding:"0px 8px"}),placeholder:c=>({...c,color:"#6b7280"}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:c=>({...c,color:"#6b7280",padding:"0 8px"}),menu:c=>({...c,backgroundColor:i.$1,border:`1px solid ${i.$19}`,zIndex:10,width:"16rem",boxShadow:"none"}),option:c=>({...c,color:i.$3,backgroundColor:i.$1,padding:"8px 12px",cursor:"pointer",borderRadius:"0.1875rem","&:hover":{backgroundColor:i.$4}})},l={MultiValueContainer:_et,ValueContainer:vet,DropdownIndicator:bet,Option:yet,Control:Cet};return h.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between",style:{color:i.$3,colorScheme:i.$0,borderColor:i.$4},children:[h.jsxs("div",{className:"flex flex-col space-y-2 mt-2 lg:mt-0 lg:flex-row lg:items-center lg:space-x-2 lg:space-y-0",style:{color:i.$3,colorScheme:i.$0,borderColor:i.$4},children:[n.children,h.jsx(lt,{id:"filter",className:"shadow-sm",changeOverride:!0,placeholder:e("filter"),value:n.filter,onValueChange:c=>n.onFilterChange&&n.onFilterChange(c),debounceTimeout:800}),n.options&&n.defaultOptions&&!n.withoutStatusFilter&&h.jsx(Spe,{styles:a,defaultValue:n.defaultOptions,onChange:s,placeholder:e("lifecycle"),options:n.options,isMulti:n.optionsMultiSelect,closeMenuOnSelect:!1,hideSelectedOptions:!1,components:l,isClearable:!1,menuPosition:"fixed"}),r.map((c,u)=>{var d;return n.customFilters&&n.customFilterPlaceholder&&n.defaultCustomFilterOptions&&h.jsx(Spe,{styles:a,defaultValue:n.defaultCustomFilterOptions.filter(f=>(f.dropdownKey??"0")===c),onChange:f=>o(f,c),placeholder:e(((d=n.customFilters.filter(f=>f.dropdownKey===c)[0])==null?void 0:d.placeHolder)??n.customFilterPlaceholder),components:l,options:n.customFilters.filter(f=>(f.dropdownKey??"0")===c),isMulti:n.optionsMultiSelect,closeMenuOnSelect:!1,hideSelectedOptions:!1,isClearable:!1,menuPosition:"fixed"},u)})]}),h.jsxs("div",{className:"flex flex-col space-y-2 mt-2 lg:mt-0 lg:flex-row lg:items-center lg:space-x-2 lg:space-y-0",children:[n.beforeFilter,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 WSe(){const n=xt();return{customStyles:{multiValue:(i,{data:r})=>pn.merge(i,{backgroundColor:r.backgroundColor,color:r.color,borderRadius:"3px"}),multiValueLabel:(i,{data:r})=>pn.merge(i,{color:r.color}),multiValueRemove:i=>pn.merge(i,{":hover":{color:"white"},color:"#999999"}),menu:i=>pn.merge(i,{width:"max-content",minWidth:"100%",backgroundColor:n.$4,borderColor:n.$4}),control:i=>pn.merge(i,{borderRadius:"3px",backgroundColor:n.$1,color:n.$3,borderColor:n.$5}),option:i=>pn.merge(i,{backgroundColor:n.$1,":hover":{backgroundColor:n.$7}})},newCustomStyles:{control:i=>({...i,backgroundColor:n.$1,borderColor:n.$24,borderRadius:"0.375rem",padding:"0 6px"}),valueContainer:i=>({...i,padding:"0px 8px"}),placeholder:i=>({...i,color:"#6b7280"}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:i=>({...i,color:"#6b7280",padding:"0 8px"}),menu:i=>({...i,backgroundColor:n.$1,border:`1px solid ${n.$19}`,zIndex:10,width:"16rem",boxShadow:"none"}),option:i=>({...i,color:n.$3,backgroundColor:n.$1,padding:"8px 12px",cursor:"pointer",borderRadius:"0.1875rem","&:hover":{backgroundColor:n.$4}})}}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function wet({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("circle",{cx:"6.75",cy:"9",r:"1.25",fill:e,"data-color":"color-2"}),h.jsx("circle",{cx:"6.75",cy:"3.75",r:"1.25",fill:e}),h.jsx("circle",{cx:"6.75",cy:"14.25",r:"1.25",fill:e}),h.jsx("circle",{cx:"11.25",cy:"9",r:"1.25",fill:e,"data-color":"color-2"}),h.jsx("circle",{cx:"11.25",cy:"3.75",r:"1.25",fill:e}),h.jsx("circle",{cx:"11.25",cy:"14.25",r:"1.25",fill:e})]})}function ern(n){const[e]=xe(),t=xt(),i=Nr(),{newCustomStyles:r}=WSe(),{isCompanySettingsActive:s}=el(),{includeRemoveAction:o,includeResetAction:a}=n,l={MultiValueContainer:_et,ValueContainer:vet,DropdownIndicator:bet,Option:yet,Control:Cet},c=OQe(),u=pd(),d=Xs(),f=x.useRef(null),[p,g]=x.useState([]),[m,_]=x.useState(!1),[v,b]=x.useState([]),[y,C]=x.useState([]),{gateways:S,handleRemoveGateway:k,handleReset:I,onStatusChange:L}=Xin({currentGateways:v,setCurrentGateways:b}),N=()=>{g([]),f.current&&(f.current.checked=!1)},P=()=>y.every(B=>hs(B)!==Vr.Active),O=B=>{var q;const W=VSe(v,B.source.index,(q=B.destination)==null?void 0:q.index);d("settings.company_gateway_ids",W.map(({id:U})=>U).join(",")),b(W)},F=B=>{const W=JSON.parse(B.config);return xet===B.gateway_key&&!W.account_id},V=B=>{i!=null&&i.settings.company_gateway_ids&&((i==null?void 0:i.settings).company_gateway_ids.split(",").length>1||s?d("settings.company_gateway_ids",v.filter(({id:q})=>!B.includes(q)).map(({id:q})=>q).join(",")):d("settings.company_gateway_ids","0"),_(!0))},M=[{value:"active",label:e("active"),color:"black",backgroundColor:"#e4e4e4"},{value:"archived",label:e("archived"),color:"white",backgroundColor:"#e6b05c"},{value:"deleted",label:e("deleted"),color:"white",backgroundColor:"#c95f53"}];return x.useEffect(()=>{m&&(u({excludeToasters:!0}),_(!1))},[m]),x.useEffect(()=>{S&&b(S.filter(B=>B))},[S]),x.useEffect(()=>{if(S){const B=S.filter(W=>W&&p.includes(W.id));C(B)}},[p]),h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("div",{className:"flex justify-between",children:[h.jsxs("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:[!!p.length&&h.jsxs(Z_,{label:e("actions"),children:[h.jsx($n,{onClick:()=>{c(p,"archive").then(()=>V(p)),N()},icon:h.jsx(an,{element:yu}),children:e("archive")}),h.jsx($n,{onClick:()=>{c(p,"delete").then(()=>V(p)),N()},icon:h.jsx(an,{element:fc}),children:e("delete")}),P()&&h.jsx($n,{onClick:()=>{c(p,"restore"),N()},icon:h.jsx(an,{element:bu}),children:e("restore")})]}),h.jsx(Spe,{styles:r,defaultValue:M[0],onChange:B=>L(B),placeholder:e("status"),options:M,isMulti:!0,components:l,closeMenuOnSelect:!1,hideSelectedOptions:!1,isClearable:!1,menuPosition:"fixed"})]}),h.jsxs("div",{className:"flex space-x-5",children:[a&&h.jsx(dn,{behavior:"button",type:"secondary",onClick:I,children:e("reset")}),h.jsx(dn,{to:"/settings/gateways/create",children:e("add_gateway")})]})]}),h.jsxs(h1,{children:[h.jsxs(p1,{children:[h.jsx(_a,{children:h.jsx(Vd,{innerRef:f,checked:p.length===v.length&&v.length>0,onChange:B=>{Array.from(document.querySelectorAll(".child-checkbox")).forEach(W=>{W.checked=B.target.checked,B.target.checked?g(q=>[...q,W.id]):g(q=>q.filter(U=>U!==W.id))})}})}),h.jsx(_a,{children:e("status")}),h.jsx(_a,{children:e("label")}),h.jsx(_a,{children:e("test_mode")}),h.jsx(_a,{disableUppercase:!0,children:h.jsx(Ah,{placement:"bottom",message:e("priority"),width:"auto",withoutArrow:!0,children:h.jsx(kq,{color:t.$17,size:"1.3rem"})})})]}),h.jsx(lee,{onDragEnd:O,children:h.jsx(uee,{droppableId:"gateways-table",children:B=>h.jsxs(f1,{...B.droppableProps,innerRef:B.innerRef,children:[v.map((W,q)=>h.jsx(cee,{draggableId:q.toString(),index:q,children:U=>x.createElement(hc,{...U.draggableProps,innerRef:U.innerRef,key:q},h.jsx(bs,{width:"10%",style:{borderBottom:q!==v.length-1?`1px solid ${t.$20}`:"none"},children:h.jsx(Vd,{checked:p.includes(W.id),className:"child-checkbox",value:W.id,id:W.id,onValueChange:G=>p.includes(G)?g(H=>H.filter(z=>z!==G)):g(H=>[...H,G])})}),h.jsx(bs,{width:"30%",style:{borderBottom:q!==v.length-1?`1px solid ${t.$20}`:"none"},children:h.jsx(ev,{entity:W})}),h.jsx(bs,{width:o?"30%":"35%",style:{borderBottom:q!==v.length-1?`1px solid ${t.$20}`:"none"},children:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(Ji,{to:Ut("/settings/gateways/:id/edit?tab=:tab",{id:W.id,tab:F(W)?1:0}),children:W.label}),F(W)&&h.jsx(Ah,{message:e("stripe_connect_migration_title"),width:"auto",placement:"top",children:h.jsxs("div",{className:"flex space-x-2",children:[h.jsx(jC,{color:"red",size:22}),h.jsx(jC,{color:"red",size:22})]})})]})}),h.jsx(bs,{width:o?"20%":"25%",style:{borderBottom:q!==v.length-1?`1px solid ${t.$20}`:"none"},children:W.test_mode?h.jsx(o8,{size:20}):""}),h.jsx(bs,{width:"25%",style:{borderBottom:q!==v.length-1?`1px solid ${t.$20}`:"none"},children:h.jsxs("div",{className:"flex items-center space-x-7 py-1",children:[o&&h.jsx(dn,{behavior:"button",type:"minimal",onClick:()=>k(W.id),children:e("remove")}),h.jsx("div",{className:"cursor-grab",...U.dragHandleProps,children:h.jsx(wet,{size:"1.2rem",color:t.$17})})]})}))},q)),v.length?h.jsx(x.Fragment,{}):h.jsx(hc,{children:h.jsxs(bs,{colSpan:100,children:[e("no_records_found"),"."]})}),B.placeholder]})})})]})]})}const xet="d14dd26a47cecc30fdd65700bfb67b34";function trn(){const{isGroupSettingsActive:n,isClientSettingsActive:e}=el();return h.jsx(ern,{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 Eet(n){return lr(["/api/v1/payment_terms",n],()=>Je("GET",ze("/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 nrn(n){return lr(["/api/v1/payment_terms",n],()=>Je("GET",ze("/api/v1/payment_terms/:id",n),{headers:PE()}),{staleTime:1/0})}function zSe(n,e){return Je("POST",ze("/api/v1/payment_terms/bulk"),{action:e,ids:n})}function irn(){const{isAdmin:n}=go();return lr(["/api/v1/payment_terms/create"],()=>Je("GET",ze("/api/v1/payment_terms/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function rrn(){var v,b,y,C,S;vr("online_payments");const[n]=xe(),e=Fr(),t=cl(),i=xt(),r=xu(),{data:s}=Zd(),o=ji(ya),{data:a}=Eet({}),{isCompanySettingsActive:l}=el(),c=ji(_f),u=[{name:n("settings"),href:"/settings"},{name:n("online_payments"),href:"/settings/online_payments"}],[d,f]=x.useState(),p=xg(),g=pd(),m=Xs(),_=(k,I)=>{e(Uo({object:"company",property:k,value:I}))};return x.useEffect(()=>{a&&f(a.data.data)},[a]),h.jsxs(Kr,{title:n("online_payments"),breadcrumbs:u,docsLink:"en/basic-settings/#online_payments",onSaveClick:g,onCancelClick:p,disableSaveButton:c,children:[h.jsx(trn,{}),h.jsxs(er,{title:n("settings"),className:"shadow-sm",style:{borderColor:i.$24},headerStyle:{borderColor:i.$20},children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"auto_bill_standard_invoices",labelElement:h.jsx(un,{label:n("auto_bill_standard_invoices"),helpLabel:n("auto_bill_standard_invoices_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!((v=r==null?void 0:r.settings)!=null&&v.auto_bill_standard_invoices),onChange:k=>m("settings.auto_bill_standard_invoices",k),disabled:t("auto_bill_standard_invoices")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"auto_bill",labelElement:h.jsx(un,{label:`${n("auto_bill")} ${n("recurring_invoices")}`}),defaultValue:"off"}),children:h.jsxs(Dn,{value:(r==null?void 0:r.settings.auto_bill)||"off",onValueChange:k=>m("settings.auto_bill",k),disabled:t("auto_bill"),errorMessage:o==null?void 0:o.errors["settings.auto_bill"],customSelector:!0,dismissable:!1,children:[h.jsxs("option",{value:"always",children:[n("enabled")," (",n("auto_bill_help_always"),")"]}),h.jsxs("option",{value:"optout",children:[n("optout")," (",n("auto_bill_help_optout"),")"]}),h.jsxs("option",{value:"optin",children:[n("optin")," (",n("auto_bill_help_optin"),")"]}),h.jsxs("option",{value:"off",children:[n("disabled")," (",n("auto_bill_help_off"),")"]})]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"auto_bill_date",labelElement:h.jsx(un,{label:n("auto_bill_on"),helpLabel:n("auto_bill_on_help")}),defaultValue:"on_send_date"}),children:h.jsxs(Dn,{value:(r==null?void 0:r.settings.auto_bill_date)||"on_send_date",onValueChange:k=>m("settings.auto_bill_date",k),disabled:t("auto_bill_date"),errorMessage:o==null?void 0:o.errors["settings.auto_bill_date"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"on_send_date",children:n("send_date")}),h.jsx("option",{value:"on_due_date",children:n("due_date")})]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"use_credits_payment",labelElement:h.jsx(un,{label:n("use_available_credits"),helpLabel:n("use_available_credits_help")}),defaultValue:"off"}),children:h.jsxs(Dn,{value:(r==null?void 0:r.settings.use_credits_payment)||"off",onValueChange:k=>m("settings.use_credits_payment",k),disabled:t("use_credits_payment"),errorMessage:o==null?void 0:o.errors["settings.use_credits_payment"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"always",children:n("enabled")}),h.jsx("option",{value:"option",children:n("show_option")}),h.jsx("option",{value:"off",children:n("off")})]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"use_unapplied_payment",labelElement:h.jsx(un,{label:n("use_unapplied_payments"),helpLabel:n("use_unapplied_payments_help")}),defaultValue:"off"}),children:h.jsxs(Dn,{value:(r==null?void 0:r.settings.use_unapplied_payment)||"off",onValueChange:k=>m("settings.use_unapplied_payment",k),disabled:t("use_unapplied_payment"),errorMessage:o==null?void 0:o.errors["settings.use_unapplied_payment"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"always",children:n("enabled")}),h.jsx("option",{value:"option",children:n("show_option")}),h.jsx("option",{value:"off",children:n("off")})]})}),d&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"payment_terms",labelElement:h.jsx(un,{label:h.jsxs("div",{className:"flex items-center space-x-1 whitespace-nowrap",children:[h.jsx("span",{className:"text-sm",style:{color:i.$3},children:n("payment_terms")}),h.jsxs("div",{className:"flex",children:[h.jsx("span",{className:"text-sm",style:{color:i.$3},children:"("}),h.jsx(Ji,{to:"/settings/payment_terms",children:n("configure")}),h.jsx("span",{className:"text-sm",style:{color:i.$3},children:")"})]})]}),helpLabel:n("payment_terms_help")})}),children:h.jsx(Dn,{value:((b=r==null?void 0:r.settings)==null?void 0:b.payment_terms)||"",onValueChange:k=>m("settings.payment_terms",k),disabled:t("payment_terms"),errorMessage:o==null?void 0:o.errors["settings.payment_terms"],customSelector:!0,withBlank:!0,children:d.map(k=>h.jsx("option",{value:k.num_days.toString(),children:k.name},k.id))})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"payment_type_id",labelElement:h.jsx(un,{label:n("payment_type"),helpLabel:n("payment_type_help")})}),children:h.jsx(Dn,{value:((y=r==null?void 0:r.settings)==null?void 0:y.payment_type_id)||"0",onValueChange:k=>m("settings.payment_type_id",k),blankOptionValue:"0",disabled:t("payment_type_id"),withBlank:!0,errorMessage:o==null?void 0:o.errors["settings.payment_type_id"],customSelector:!0,children:s==null?void 0:s.payment_types.map(k=>h.jsx("option",{value:k.id,children:k.name},k.id))})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"valid_until",labelElement:h.jsx(un,{label:n("quote_valid_until"),helpLabel:n("quote_valid_until_help")})}),children:h.jsx(Dn,{value:((C=r==null?void 0:r.settings)==null?void 0:C.valid_until)||"",onValueChange:k=>m("settings.valid_until",k),disabled:t("valid_until"),withBlank:!0,errorMessage:o==null?void 0:o.errors["settings.valid_until"],customSelector:!0,children:d==null?void 0:d.map(k=>h.jsx("option",{value:k.num_days.toString(),children:k.name},k.id))})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"default_expense_payment_type_id",labelElement:h.jsx(un,{label:n("expense_payment_type"),helpLabel:n("expense_payment_type_help")})}),children:h.jsx(Dn,{value:((S=r==null?void 0:r.settings)==null?void 0:S.default_expense_payment_type_id)||"",onValueChange:k=>m("settings.default_expense_payment_type_id",k),disabled:t("default_expense_payment_type_id"),blankOptionValue:"0",withBlank:!0,errorMessage:o==null?void 0:o.errors["settings.default_expense_payment_type_id"],customSelector:!0,children:s==null?void 0:s.payment_types.map(k=>h.jsx("option",{value:k.id,children:k.name},k.id))})}),h.jsx(ne,{leftSideHelp:n("manual_payment_email_help"),leftSide:h.jsx(cn,{propertyKey:"client_manual_payment_notification",labelElement:h.jsx(un,{label:n("manual_payment_email")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(r!=null&&r.settings.client_manual_payment_notification),onChange:k=>_("settings.client_manual_payment_notification",k),disabled:t("client_manual_payment_notification")})}),h.jsx(ne,{leftSideHelp:n("online_payment_email_help"),leftSide:h.jsx(cn,{propertyKey:"client_online_payment_notification",labelElement:h.jsx(un,{label:n("online_payment_email")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(r!=null&&r.settings.client_online_payment_notification),onChange:k=>_("settings.client_online_payment_notification",k),disabled:t("client_online_payment_notification")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"send_email_on_mark_paid",labelElement:h.jsx(un,{label:n("mark_paid_payment_email"),helpLabel:n("mark_paid_payment_email_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(r!=null&&r.settings.send_email_on_mark_paid),onChange:k=>_("settings.send_email_on_mark_paid",k),disabled:t("send_email_on_mark_paid")})}),l&&h.jsx(ne,{leftSide:n("enable_applying_payments"),leftSideHelp:n("enable_applying_payments_help"),children:h.jsx(jt,{id:"allow_over_payment",checked:!!(r!=null&&r.enable_applying_payments),onChange:k=>m("enable_applying_payments",k)})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"client_portal_allow_over_payment",labelElement:h.jsx(un,{label:n("allow_over_payment")}),defaultValue:!1}),leftSideHelp:n("allow_over_payment_help"),children:h.jsx(jt,{id:"allow_over_payment",checked:!!(r!=null&&r.settings.client_portal_allow_over_payment),onChange:k=>m("settings.client_portal_allow_over_payment",k),disabled:t("client_portal_allow_over_payment")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"client_portal_allow_under_payment",labelElement:h.jsx(un,{label:n("allow_under_payment")}),defaultValue:!1}),leftSideHelp:n("allow_under_payment_help"),children:h.jsx(jt,{id:"allow_under_payment",checked:!!(r!=null&&r.settings.client_portal_allow_under_payment),onChange:k=>m("settings.client_portal_allow_under_payment",k),disabled:t("client_portal_allow_under_payment")})}),(r==null?void 0:r.settings.client_portal_allow_under_payment)&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"client_portal_under_payment_minimum",labelElement:h.jsx(un,{label:n("minimum_under_payment_amount")})}),children:h.jsx(Qs,{value:(r==null?void 0:r.settings.client_portal_under_payment_minimum)||"",onValueChange:k=>m("settings.client_portal_under_payment_minimum",parseFloat(k)||0),disabled:t("client_portal_under_payment_minimum"),errorMessage:o==null?void 0:o.errors["settings.client_portal_under_payment_minimum"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"client_initiated_payments",labelElement:h.jsx(un,{label:n("client_initiated_payments")}),defaultValue:!1}),leftSideHelp:n("client_initiated_payments_help"),children:h.jsx(jt,{id:"client_initiated_payments",checked:!!(r!=null&&r.settings.client_initiated_payments),onChange:k=>m("settings.client_initiated_payments",k),disabled:t("client_initiated_payments")})}),(r==null?void 0:r.settings.client_initiated_payments)&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"client_initiated_payments_minimum",labelElement:h.jsx(un,{label:n("minimum_payment_amount")})}),children:h.jsx(Qs,{value:(r==null?void 0:r.settings.client_initiated_payments_minimum)||"",onValueChange:k=>m("settings.client_initiated_payments_minimum",parseFloat(k)),disabled:t("client_initiated_payments_minimum"),errorMessage:o==null?void 0:o.errors["settings.client_initiated_payments_minimum"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"payment_email_all_contacts",labelElement:h.jsx(un,{label:n("payment_email_all_contacts")}),defaultValue:!1}),leftSideHelp:n("payment_email_all_contacts_help"),children:h.jsx(jt,{id:"payment_email_all_contacts",checked:!!(r!=null&&r.settings.payment_email_all_contacts),onChange:k=>m("settings.payment_email_all_contacts",k),disabled:t("payment_email_all_contacts")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"payment_flow",labelElement:h.jsx(un,{label:n("one_page_checkout")}),defaultValue:!1}),leftSideHelp:n("one_page_checkout_help"),children:h.jsx(jt,{id:"payment_flow",checked:(r==null?void 0:r.settings.payment_flow)==="smooth",onChange:k=>m("settings.payment_flow",k?"smooth":"default"),disabled:t("payment_flow")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"unlock_invoice_documents_after_payment",labelElement:h.jsx(un,{label:n("unlock_invoice_documents_after_payment")}),defaultValue:!1}),leftSideHelp:n("unlock_invoice_documents_after_payment_help"),children:h.jsx(jt,{id:"unlock_invoice_documents_after_payment",checked:!!(r!=null&&r.settings.unlock_invoice_documents_after_payment),onChange:k=>m("settings.unlock_invoice_documents_after_payment",k),disabled:t("unlock_invoice_documents_after_payment")})})]})]})}function p5e(n){var d,f,p;const[e]=xe(),t=xt(),i=Nr(),r=Xs(),s=cl(),{title:o}=n,a=ji(ya),{data:l}=xxe({perPage:100,status:["active"]}),c=g=>{const m=g.target.options[g.target.selectedIndex];r(g.target.id,parseFloat(m.dataset.rate||"0")),r(m.dataset.rateName,g.target.value)},u=g=>{const m=pn.cloneDeep(i==null?void 0:i.settings);delete m[g],r("settings",m)};return h.jsx(h.Fragment,{children:(i==null?void 0:i.enabled_tax_rates)>0&&h.jsxs(er,{title:o?e(o):void 0,className:"shadow-sm",style:{borderColor:t.$24},children:[(i==null?void 0:i.enabled_tax_rates)>0&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"tax_name1",labelElement:h.jsx(un,{label:e("default_tax_rate")}),onCheckboxChange:g=>{g?r("settings.tax_rate1",0):u("tax_rate1")}}),children:h.jsxs(Dn,{id:"settings.tax_rate1",onChange:c,value:((d=i==null?void 0:i.settings)==null?void 0:d.tax_name1)||0,disabled:s("tax_name1"),errorMessage:a==null?void 0:a.errors["settings.tax_rate1"],children:[h.jsx("option",{"data-rate":0,"data-rate-name":"settings.tax_name1",value:""}),l&&l.data.data.map(g=>h.jsxs("option",{"data-rate":g.rate,"data-rate-name":"settings.tax_name1",value:g.name,children:[g.rate,"% — ",g.name]},g.id))]})}),(i==null?void 0:i.enabled_tax_rates)>1&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"tax_name2",labelElement:h.jsx(un,{label:e("default_tax_rate")}),onCheckboxChange:g=>{g?r("settings.tax_rate2",0):u("tax_rate2")}}),children:h.jsxs(Dn,{id:"settings.tax_rate2",onChange:c,value:((f=i==null?void 0:i.settings)==null?void 0:f.tax_name2)||0,disabled:s("tax_name2"),errorMessage:a==null?void 0:a.errors["settings.tax_rate2"],children:[h.jsx("option",{"data-rate":0,"data-rate-name":"settings.tax_name2",value:""}),l&&l.data.data.map(g=>h.jsxs("option",{"data-rate":g.rate,"data-rate-name":"settings.tax_name2",value:g.name,children:[g.rate,"% — ",g.name]},g.id))]})}),(i==null?void 0:i.enabled_tax_rates)>2&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"tax_name3",labelElement:h.jsx(un,{label:e("default_tax_rate")}),onCheckboxChange:g=>{g?r("settings.tax_rate3",0):u("tax_rate3")}}),children:h.jsxs(Dn,{id:"settings.tax_rate3",onChange:c,value:((p=i==null?void 0:i.settings)==null?void 0:p.tax_name3)||0,disabled:s("tax_name3"),errorMessage:a==null?void 0:a.errors["settings.tax_rate3"],children:[h.jsx("option",{"data-rate":0,"data-rate-name":"settings.tax_name3",value:""}),l&&l.data.data.map(g=>h.jsxs("option",{"data-rate":g.rate,"data-rate-name":"settings.tax_name3",value:g.name,children:[g.rate,"% — ",g.name]},g.id))]})})]})})}function dee(n){const[e]=xe(),{visible:t,setVisible:i,region:r,subregion:s,taxSetting:o}=n,a=Xs(),l=()=>{i(!1)};return h.jsxs(pr,{title:`${r} - ${s}`,visible:t,onClose:l,children:[h.jsx(lt,{label:e("tax_name"),value:o.tax_name,onValueChange:c=>a(`tax_data.regions.${r}.subregions.${s}.tax_name`,c)}),h.jsx(Qs,{label:e("tax_rate"),value:o.tax_rate||"",onValueChange:c=>a(`tax_data.regions.${r}.subregions.${s}.tax_rate`,parseFloat(c))}),h.jsx(Qs,{label:e("reduced_rate"),value:o.reduced_tax_rate||"",onValueChange:c=>a(`tax_data.regions.${r}.subregions.${s}.reduced_tax_rate`,parseFloat(c))}),h.jsx(dn,{className:"self-end",behavior:"button",onClick:l,disableWithoutIcon:!0,children:e("save")})]})}function srn(){const[n]=xe(),e=Xs(),t=Nr(),[i,r]=x.useState(!1),[s,o]=x.useState(!1),a=Object.entries(t.tax_data.regions.AU.subregions),[l,c]=x.useState(a[0][1]),[u,d]=x.useState(a[0][0]),f=x.useMemo(()=>a.filter(([,m])=>m.apply_tax).length,[a]),p=(m,_)=>{e(m,_),r(!_)},g=m=>{const _=document.getElementById(m.replace(".apply_tax",""));_==null||_.click()};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:"Australia",children:h.jsxs("div",{className:"grid grid-cols-5 gap-4",children:[h.jsx("div",{className:"col-span-4",children:h.jsxs(Dn,{id:"tax_data.regions.AU.tax_all_subregions",className:"",value:t.tax_data.regions.AU.tax_all_subregions,onValueChange:m=>p("tax_data.regions.AU.tax_all_subregions",m==="true"),children:[h.jsx("option",{value:"true",children:n("tax_all")}),h.jsxs("option",{value:"false",children:[n("tax_selected")," - [ ",f," ",n("selected")," ]"]})]})}),!t.tax_data.regions.AU.tax_all_subregions&&h.jsx("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:h.jsx(dn,{type:"primary",className:"",onClick:m=>{m.preventDefault(),r(_=>!_)},children:n(i?"hide":"show")})})]})},"AU"),i&&(a==null?void 0:a.map((m,_)=>h.jsxs("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:[h.jsxs("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:v=>{v.target instanceof HTMLInputElement||g(`tax_data.regions.AU.subregions.${m[0]}.apply_tax`)},children:[h.jsx(Vd,{id:`tax_data.regions.AU.subregions.${m[0]}`,value:`tax_data.regions.AU.subregions.${m[0]}.apply_tax`,checked:!!m[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:t.tax_data.regions.AU.tax_all_subregions,onValueChange:(v,b)=>e(v,b)}),h.jsx("div",{className:"",children:m[0]})]}),h.jsxs("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}%`:""]}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.AU.tax_all_subregions,onClick:v=>{v.preventDefault(),c(m[1]),d(m[0]),o(!0)},children:n("edit")})})]},_))),h.jsx(dee,{visible:s,setVisible:o,region:"AU",subregion:u,taxSetting:l})]})}function orn(){var _,v,b;const[n]=xe(),e=Xs(),t=Nr(),[i,r]=x.useState(!1),[s,o]=x.useState(!1),a=Object.entries(t.tax_data.regions.EU.subregions),[l,c]=x.useState(a[0][1]),[u,d]=x.useState(a[0][0]),f=y=>!!y,p=x.useMemo(()=>a.filter(([,y])=>f(y.apply_tax)).length,[a]),g=(y,C)=>{e(y,C),r(!C)},m=y=>{const C=document.getElementById(y.replace(".apply_tax",""));C==null||C.click()};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:"Europe",children:h.jsxs("div",{className:"grid grid-cols-5 gap-4",children:[h.jsx("div",{className:"col-span-4",children:h.jsxs(Dn,{id:"tax_data.regions.EU.tax_all_subregions",className:"",value:t.tax_data.regions.EU.tax_all_subregions,onValueChange:y=>g("tax_data.regions.EU.tax_all_subregions",y==="true"),children:[h.jsx("option",{value:"true",children:n("tax_all")}),h.jsxs("option",{value:"false",children:[n("tax_selected")," - [ ",p," ",n("selected")," ]"]})]})}),!t.tax_data.regions.EU.tax_all_subregions&&h.jsx("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:h.jsx(dn,{type:"primary",className:"",onClick:y=>{y.preventDefault(),r(C=>!C)},children:n(i?"hide":"show")})})]})},"EU"),i&&(a==null?void 0:a.map((y,C)=>h.jsxs("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 text-sm",children:[h.jsxs("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:S=>{S.target instanceof HTMLInputElement||m(`tax_data.regions.EU.subregions.${y[0]}.apply_tax`)},children:[h.jsx(Vd,{id:`tax_data.regions.EU.subregions.${y[0]}`,value:`tax_data.regions.EU.subregions.${y[0]}.apply_tax`,checked:!!y[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:t.tax_data.regions.EU.tax_all_subregions,onValueChange:(S,k)=>e(S,k)}),h.jsx("div",{className:"",children:y[0]})]}),h.jsxs("div",{onClick:()=>m(`tax_data.regions.EU.subregions.${y[0]}.apply_tax`),children:[y[1].tax_name," ",y[1].tax_rate,"%"," ",y[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${y[1].reduced_tax_rate}%`:""]}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.EU.tax_all_subregions,onClick:S=>{S.preventDefault(),c(y[1]),d(y[0]),o(!0)},children:n("edit")})})]},C))),h.jsx(dee,{visible:s,setVisible:o,region:"EU",subregion:u,taxSetting:l}),h.jsx(ne,{leftSide:h.jsxs("p",{className:"lg:pl-5",children:["(EU) ",n("sales_above_threshold")]}),children:h.jsx(jt,{id:"tax_data.regions.EU.has_sales_above_threshold",checked:(b=(v=(_=t==null?void 0:t.tax_data)==null?void 0:_.regions)==null?void 0:v.EU)==null?void 0:b.has_sales_above_threshold,onValueChange:y=>e("tax_data.regions.EU.has_sales_above_threshold",y)})})]})}function arn(){var _,v,b;const[n]=xe(),e=Xs(),t=Nr(),[i,r]=x.useState(!1),[s,o]=x.useState(!1),a=Object.entries(t==null?void 0:t.tax_data.regions.UK.subregions),[l,c]=x.useState(a[0][1]),[u,d]=x.useState(a[0][0]),f=y=>!!y,p=x.useMemo(()=>a.filter(([,y])=>f(y.apply_tax)).length,[a]),g=(y,C)=>{e(y,C),r(!C)},m=y=>{const C=document.getElementById(y.replace(".apply_tax",""));C==null||C.click()};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:"United Kingdom",children:h.jsxs("div",{className:"grid grid-cols-5 gap-4",children:[h.jsx("div",{className:"col-span-4",children:h.jsxs(Dn,{id:"tax_data.regions.UK.tax_all_subregions",className:"",value:t.tax_data.regions.UK.tax_all_subregions,onValueChange:y=>g("tax_data.regions.UK.tax_all_subregions",y==="true"),children:[h.jsx("option",{value:"true",children:n("tax_all")}),h.jsxs("option",{value:"false",children:[n("tax_selected")," - [ ",p," ",n("selected")," ]"]})]})}),!t.tax_data.regions.UK.tax_all_subregions&&h.jsx("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:h.jsx(dn,{type:"primary",className:"",onClick:y=>{y.preventDefault(),r(C=>!C)},children:n(i?"hide":"show")})})]})},"EU"),i&&(a==null?void 0:a.map((y,C)=>{var S,k,I,L,N,P;return h.jsxs("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 text-sm",children:[h.jsxs("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:O=>{O.target instanceof HTMLInputElement||m(`tax_data.regions.UK.subregions.${y[0]}.apply_tax`)},children:[h.jsx(Vd,{id:`tax_data.regions.UK.subregions.${y[0]}`,value:`tax_data.regions.UK.subregions.${y[0]}.apply_tax`,checked:!!y[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:(I=(k=(S=t==null?void 0:t.tax_data)==null?void 0:S.regions)==null?void 0:k.UK)==null?void 0:I.tax_all_subregions,onValueChange:(O,F)=>e(O,F)}),h.jsx("div",{className:"",children:y[0]})]}),h.jsxs("div",{onClick:()=>m(`tax_data.regions.UK.subregions.${y[0]}.apply_tax`),children:[y[1].tax_name," ",y[1].tax_rate,"%"," ",y[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${(L=y[1])==null?void 0:L.reduced_tax_rate}%`:""]}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{type:"primary",className:"",disableWithoutIcon:!0,disabled:(P=(N=t==null?void 0:t.tax_data.regions)==null?void 0:N.UK)==null?void 0:P.tax_all_subregions,onClick:O=>{O.preventDefault(),c(y[1]),d(y[0]),o(!0)},children:n("edit")})})]},C)})),h.jsx(dee,{visible:s,setVisible:o,region:"UK",subregion:u,taxSetting:l}),h.jsx(ne,{leftSide:h.jsxs("p",{className:"lg:pl-5",children:["(UK) ",n("sales_above_threshold")]}),children:h.jsx(jt,{id:"tax_data.regions.UK.has_sales_above_threshold",checked:(b=(v=(_=t==null?void 0:t.tax_data)==null?void 0:_.regions)==null?void 0:v.UK)==null?void 0:b.has_sales_above_threshold,onValueChange:y=>e("tax_data.regions.UK.has_sales_above_threshold",y)})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const lrn={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 crn(n){return h.jsx(Dn,{value:n.value,label:n.label,disabled:n.disabled,onValueChange:n.onChange,errorMessage:n.errorMessage,dismissable:!0,customSelector:!0,children:Object.entries(lrn).map((e,t)=>h.jsx("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 ket={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",NO:"Norway",IS:"Iceland",LI:"Liechtenstein",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 urn(n){return h.jsx(Dn,{value:n.value,label:n.label,disabled:n.disabled,onValueChange:n.onChange,errorMessage:n.errorMessage,dismissable:!0,customSelector:!0,children:Object.entries(ket).map((e,t)=>h.jsx("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 drn(){const n=kxe();return e=>{const t=n.find(i=>i.id===e);return!!(t&&ket[t.iso_3166_2])}}function hrn(){var s,o,a,l,c,u,d;const[n]=xe(),e=Nr(),t=Xs(),i=xk(),r=drn();return x.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]),h.jsxs(ne,{leftSide:n("seller_subregion"),children:[((s=i(e==null?void 0:e.settings.country_id))==null?void 0:s.iso_3166_2)==="US"&&h.jsx(crn,{value:(o=e.tax_data)==null?void 0:o.seller_subregion,onChange:f=>t("tax_data.seller_subregion",f)}),r(e==null?void 0:e.settings.country_id)&&h.jsx(urn,{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:f=>t("tax_data.seller_subregion",f)}),((u=i(e==null?void 0:e.settings.country_id))==null?void 0:u.iso_3166_2)==="AU"&&h.jsx(lt,{type:"text",disabled:!0,name:"tax_data.seller_subregion",value:"AU"}),((d=i(e==null?void 0:e.settings.country_id))==null?void 0:d.iso_3166_2)==="GB"&&h.jsx(lt,{type:"text",disabled:!0,name:"tax_data.seller_subregion",value:"GB"})]})}function frn(){const[n]=xe(),e=Xs(),t=Nr(),[i,r]=x.useState(!1),[s,o]=x.useState(!1),a=Object.entries(t.tax_data.regions.US.subregions),[l,c]=x.useState(a[0][1]),[u,d]=x.useState(a[0][0]),f=_=>!!_,p=x.useMemo(()=>a.filter(([,_])=>f(_.apply_tax)).length,[a]),g=(_,v)=>{e(_,v),r(!v)},m=_=>{const v=document.getElementById(_.replace(".apply_tax",""));v==null||v.click()};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("united_states"),children:h.jsxs("div",{className:"grid grid-cols-5 gap-4",children:[h.jsx("div",{className:"col-span-4",children:h.jsxs(Dn,{id:"tax_data.regions.US.tax_all_subregions",className:"",value:t.tax_data.regions.US.tax_all_subregions,onValueChange:_=>g("tax_data.regions.US.tax_all_subregions",_==="true"),children:[h.jsx("option",{value:"true",children:n("tax_all")}),h.jsxs("option",{value:"false",children:[n("tax_selected")," - [ ",p," ",n("selected")," ]"]})]})}),!t.tax_data.regions.US.tax_all_subregions&&h.jsx("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:h.jsx(dn,{type:"primary",className:"",onClick:_=>{_.preventDefault(),r(v=>!v)},children:n(i?"hide":"show")})})]})},"US"),i&&(a==null?void 0:a.map((_,v)=>h.jsxs("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:[h.jsxs("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:b=>{b.target instanceof HTMLInputElement||m(`tax_data.regions.US.subregions.${_[0]}.apply_tax`)},children:[h.jsx(Vd,{id:`tax_data.regions.US.subregions.${_[0]}`,value:`tax_data.regions.US.subregions.${_[0]}.apply_tax`,checked:!!_[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:t.tax_data.regions.US.tax_all_subregions,onValueChange:(b,y)=>e(b,y)}),h.jsx("div",{className:"",children:_[0]})]}),h.jsxs("div",{onClick:()=>m(`tax_data.regions.US.subregions.${_[0]}.apply_tax`),children:[_[1].tax_name," ",_[1].tax_rate,"%"," ",_[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${_[1].reduced_tax_rate}%`:""]}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.US.tax_all_subregions,onClick:b=>{b.preventDefault(),c(_[1]),d(_[0]),o(!0)},children:n("edit")})})]},v))),h.jsx(dee,{visible:s,setVisible:o,region:"US",subregion:u,taxSetting:l})]})}function prn(){return h.jsxs(h.Fragment,{children:[h.jsx(hrn,{}),h.jsx(frn,{}),h.jsx(orn,{}),h.jsx(arn,{}),h.jsx(srn,{})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.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(){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","GB","NO","IS","LI"],e=xk();return t=>{var i;return n.includes(((i=e(t))==null?void 0:i.iso_3166_2)||"")}}function g5e(n){const e=[],t=String(n||"");let i=t.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=t.length,s=!0);const o=t.slice(r,i).trim();(o||!s)&&e.push(o),r=i+1,i=t.indexOf(",",r)}return e}function Tet(n,e){const t={};return(n[n.length-1]===""?[...n,""]:n).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const mrn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_rn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vrn={};function m5e(n,e){return(vrn.jsx?_rn:mrn).test(n)}const brn=/[ \t\n\f\r]/g;function yrn(n){return typeof n=="object"?n.type==="text"?_5e(n.value):!1:_5e(n)}function _5e(n){return n.replace(brn,"")===""}class S9{constructor(e,t,i){this.property=e,this.normal=t,i&&(this.space=i)}}S9.prototype.property={};S9.prototype.normal={};S9.prototype.space=null;function Iet(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 S9(t,i,e)}function V8(n){return n.toLowerCase()}class gv{constructor(e,t){this.property=e,this.attribute=t}}gv.prototype.space=null;gv.prototype.boolean=!1;gv.prototype.booleanish=!1;gv.prototype.overloadedBoolean=!1;gv.prototype.number=!1;gv.prototype.commaSeparated=!1;gv.prototype.spaceSeparated=!1;gv.prototype.commaOrSpaceSeparated=!1;gv.prototype.mustUseProperty=!1;gv.prototype.defined=!1;let Crn=0;const Js=IA(),Ru=IA(),Let=IA(),xi=IA(),Vl=IA(),SP=IA(),Gg=IA();function IA(){return 2**++Crn}const Epe=Object.freeze(Object.defineProperty({__proto__:null,boolean:Js,booleanish:Ru,commaOrSpaceSeparated:Gg,commaSeparated:SP,number:xi,overloadedBoolean:Let,spaceSeparated:Vl},Symbol.toStringTag,{value:"Module"})),dle=Object.keys(Epe);class USe extends gv{constructor(e,t,i,r){let s=-1;if(super(e,t),v5e(this,"space",r),typeof i=="number")for(;++s<dle.length;){const o=dle[s];v5e(this,dle[s],(i&Epe[o])===Epe[o])}}}USe.prototype.defined=!0;function v5e(n,e,t){t&&(n[e]=t)}const wrn={}.hasOwnProperty;function E4(n){const e={},t={};let i;for(i in n.properties)if(wrn.call(n.properties,i)){const r=n.properties[i],s=new USe(i,n.transform(n.attributes||{},i),r,n.space);n.mustUseProperty&&n.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),e[i]=s,t[V8(i)]=i,t[V8(s.attribute)]=i}return new S9(e,t,n.space)}const Aet=E4({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}}),Net=E4({space:"xml",transform(n,e){return"xml:"+e.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Det(n,e){return e in n?n[e]:e}function Ret(n,e){return Det(n,e.toLowerCase())}const Pet=E4({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Ret,properties:{xmlns:null,xmlnsXLink:null}}),Oet=E4({transform(n,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Ru,ariaAutoComplete:null,ariaBusy:Ru,ariaChecked:Ru,ariaColCount:xi,ariaColIndex:xi,ariaColSpan:xi,ariaControls:Vl,ariaCurrent:null,ariaDescribedBy:Vl,ariaDetails:null,ariaDisabled:Ru,ariaDropEffect:Vl,ariaErrorMessage:null,ariaExpanded:Ru,ariaFlowTo:Vl,ariaGrabbed:Ru,ariaHasPopup:null,ariaHidden:Ru,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vl,ariaLevel:xi,ariaLive:null,ariaModal:Ru,ariaMultiLine:Ru,ariaMultiSelectable:Ru,ariaOrientation:null,ariaOwns:Vl,ariaPlaceholder:null,ariaPosInSet:xi,ariaPressed:Ru,ariaReadOnly:Ru,ariaRelevant:null,ariaRequired:Ru,ariaRoleDescription:Vl,ariaRowCount:xi,ariaRowIndex:xi,ariaRowSpan:xi,ariaSelected:Ru,ariaSetSize:xi,ariaSort:null,ariaValueMax:xi,ariaValueMin:xi,ariaValueNow:xi,ariaValueText:null,role:null}}),xrn=E4({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Ret,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:SP,acceptCharset:Vl,accessKey:Vl,action:null,allow:null,allowFullScreen:Js,allowPaymentRequest:Js,allowUserMedia:Js,alt:null,as:null,async:Js,autoCapitalize:null,autoComplete:Vl,autoFocus:Js,autoPlay:Js,blocking:Vl,capture:null,charSet:null,checked:Js,cite:null,className:Vl,cols:xi,colSpan:null,content:null,contentEditable:Ru,controls:Js,controlsList:Vl,coords:xi|SP,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Js,defer:Js,dir:null,dirName:null,disabled:Js,download:Let,draggable:Ru,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Js,formTarget:null,headers:Vl,height:xi,hidden:Js,high:xi,href:null,hrefLang:null,htmlFor:Vl,httpEquiv:Vl,id:null,imageSizes:null,imageSrcSet:null,inert:Js,inputMode:null,integrity:null,is:null,isMap:Js,itemId:null,itemProp:Vl,itemRef:Vl,itemScope:Js,itemType:Vl,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Js,low:xi,manifest:null,max:null,maxLength:xi,media:null,method:null,min:null,minLength:xi,multiple:Js,muted:Js,name:null,nonce:null,noModule:Js,noValidate:Js,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:Js,optimum:xi,pattern:null,ping:Vl,placeholder:null,playsInline:Js,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Js,referrerPolicy:null,rel:Vl,required:Js,reversed:Js,rows:xi,rowSpan:xi,sandbox:Vl,scope:null,scoped:Js,seamless:Js,selected:Js,shadowRootClonable:Js,shadowRootDelegatesFocus:Js,shadowRootMode:null,shape:null,size:xi,sizes:null,slot:null,span:xi,spellCheck:Ru,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xi,step:null,style:null,tabIndex:xi,target:null,title:null,translate:null,type:null,typeMustMatch:Js,useMap:null,value:Ru,width:xi,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Vl,axis:null,background:null,bgColor:null,border:xi,borderColor:null,bottomMargin:xi,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Js,declare:Js,event:null,face:null,frame:null,frameBorder:null,hSpace:xi,leftMargin:xi,link:null,longDesc:null,lowSrc:null,marginHeight:xi,marginWidth:xi,noResize:Js,noHref:Js,noShade:Js,noWrap:Js,object:null,profile:null,prompt:null,rev:null,rightMargin:xi,rules:null,scheme:null,scrolling:Ru,standby:null,summary:null,text:null,topMargin:xi,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xi,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Js,disableRemotePlayback:Js,prefix:null,property:null,results:xi,security:null,unselectable:null}}),Srn=E4({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:Det,properties:{about:Gg,accentHeight:xi,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xi,amplitude:xi,arabicForm:null,ascent:xi,attributeName:null,attributeType:null,azimuth:xi,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xi,by:null,calcMode:null,capHeight:xi,className:Vl,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:xi,diffuseConstant:xi,direction:null,display:null,dur:null,divisor:xi,dominantBaseline:null,download:Js,dx:null,dy:null,edgeMode:null,editable:null,elevation:xi,enableBackground:null,end:null,event:null,exponent:xi,externalResourcesRequired:null,fill:null,fillOpacity:xi,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:SP,g2:SP,glyphName:SP,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xi,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xi,horizOriginX:xi,horizOriginY:xi,id:null,ideographic:xi,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xi,k:xi,k1:xi,k2:xi,k3:xi,k4:xi,kernelMatrix:Gg,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xi,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:xi,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:xi,overlineThickness:xi,paintOrder:null,panose1:null,path:null,pathLength:xi,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Vl,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xi,pointsAtY:xi,pointsAtZ:xi,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gg,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gg,rev:Gg,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gg,requiredFeatures:Gg,requiredFonts:Gg,requiredFormats:Gg,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:xi,specularExponent:xi,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xi,strikethroughThickness:xi,string:null,stroke:null,strokeDashArray:Gg,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xi,strokeOpacity:xi,strokeWidth:null,style:null,surfaceScale:xi,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gg,tabIndex:xi,tableValues:null,target:null,targetX:xi,targetY:xi,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gg,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xi,underlineThickness:xi,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xi,values:null,vAlphabetic:xi,vMathematical:xi,vectorEffect:null,vHanging:xi,vIdeographic:xi,version:null,vertAdvY:xi,vertOriginX:xi,vertOriginY:xi,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xi,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Ern=/^data[-\w.:]+$/i,b5e=/-[a-z]/g,krn=/[A-Z]/g;function hee(n,e){const t=V8(e);let i=e,r=gv;if(t in n.normal)return n.property[n.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Ern.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(b5e,Irn);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!b5e.test(s)){let o=s.replace(krn,Trn);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}r=USe}return new r(i,e)}function Trn(n){return"-"+n.toLowerCase()}function Irn(n){return n.charAt(1).toUpperCase()}const Lrn={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"},E9=Iet([Net,Aet,Pet,Oet,xrn],"html"),Ek=Iet([Net,Aet,Pet,Oet,Srn],"svg");function y5e(n){const e=String(n||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Met(n){return n.join(" ").trim()}var SD={},hle,C5e;function Arn(){if(C5e)return hle;C5e=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=` `,c="/",u="*",d="",f="comment",p="declaration";hle=function(m,_){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];_=_||{};var v=1,b=1;function y(V){var M=V.match(e);M&&(v+=M.length);var B=V.lastIndexOf(l);b=~B?V.length-B:b+V.length}function C(){var V={line:v,column:b};return function(M){return M.position=new S(V),L(),M}}function S(V){this.start=V,this.end={line:v,column:b},this.source=_.source}S.prototype.content=m;function k(V){var M=new Error(_.source+":"+v+":"+b+": "+V);if(M.reason=V,M.filename=_.source,M.line=v,M.column=b,M.source=m,!_.silent)throw M}function I(V){var M=V.exec(m);if(M){var B=M[0];return y(B),m=m.slice(B.length),M}}function L(){I(t)}function N(V){var M;for(V=V||[];M=P();)M!==!1&&V.push(M);return V}function P(){var V=C();if(!(c!=m.charAt(0)||u!=m.charAt(1))){for(var M=2;d!=m.charAt(M)&&(u!=m.charAt(M)||c!=m.charAt(M+1));)++M;if(M+=2,d===m.charAt(M-1))return k("End of comment missing");var B=m.slice(2,M-2);return b+=2,y(B),m=m.slice(M),b+=2,V({type:f,comment:B})}}function O(){var V=C(),M=I(i);if(M){if(P(),!I(r))return k("property missing ':'");var B=I(s),W=V({type:p,property:g(M[0].replace(n,d)),value:B?g(B[0].replace(n,d)):d});return I(o),W}}function F(){var V=[];N(V);for(var M;M=O();)M!==!1&&(V.push(M),N(V));return V}return L(),F()};function g(m){return m?m.replace(a,d):d}return hle}var w5e;function Nrn(){if(w5e)return SD;w5e=1;var n=SD&&SD.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(SD,"__esModule",{value:!0}),SD.default=t;var e=n(Arn());function t(i,r){var s=null;if(!i||typeof i!="string")return s;var o=(0,e.default)(i),a=typeof r=="function";return o.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;a?r(c,u,l):u&&(s=s||{},s[c]=u)}}),s}return SD}var Drn=Nrn();const x5e=Cl(Drn),Rrn=x5e.default||x5e,fee=jet("end"),g1=jet("start");function jet(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 Prn(n){const e=g1(n),t=fee(n);if(e&&t)return{start:e,end:t}}function FF(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?S5e(n.position):"start"in n||"end"in n?S5e(n):"line"in n||"column"in n?kpe(n):""}function kpe(n){return E5e(n&&n.line)+":"+E5e(n&&n.column)}function S5e(n){return kpe(n&&n.start)+"-"+kpe(n&&n.end)}function E5e(n){return n&&typeof n=="number"?n:1}class bf extends Error{constructor(e,t,i){super(),typeof t=="string"&&(i=t,t=void 0);let r="",s={},o=!1;if(t&&("line"in t&&"column"in t?s={place:t}:"start"in t&&"end"in t?s={place:t}:"type"in t?s={ancestors:[t],place:t.position}:s={...t}),typeof e=="string"?r=e:!s.cause&&e&&(o=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?s.ruleId=i:(s.source=i.slice(0,l),s.ruleId=i.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.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=FF(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}bf.prototype.file="";bf.prototype.name="";bf.prototype.reason="";bf.prototype.message="";bf.prototype.stack="";bf.prototype.column=void 0;bf.prototype.line=void 0;bf.prototype.ancestors=void 0;bf.prototype.cause=void 0;bf.prototype.fatal=void 0;bf.prototype.place=void 0;bf.prototype.ruleId=void 0;bf.prototype.source=void 0;const qSe={}.hasOwnProperty,Orn=new Map,Mrn=/[A-Z]/g,jrn=/-([a-z])/g,Frn=new Set(["table","tbody","thead","tfoot","tr"]),Brn=new Set(["td","th"]),Fet="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $rn(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=Grn(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=Krn(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"?Ek:E9,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=Bet(r,n,void 0);return s&&typeof s!="string"?s:r.create(n,r.Fragment,{children:s||void 0},void 0)}function Bet(n,e,t){if(e.type==="element")return Hrn(n,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Vrn(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return zrn(n,e,t);if(e.type==="mdxjsEsm")return Wrn(n,e);if(e.type==="root")return Urn(n,e,t);if(e.type==="text")return qrn(n,e)}function Hrn(n,e,t){const i=n.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Ek,n.schema=r),n.ancestors.push(e);const s=Het(n,e.tagName,!1),o=Yrn(n,e);let a=GSe(n,e);return Frn.has(e.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!yrn(l):!0})),$et(n,o,s,e),KSe(o,a),n.ancestors.pop(),n.schema=i,n.create(e,s,o,t)}function Vrn(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)}W8(n,e.position)}function Wrn(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);W8(n,e.position)}function zrn(n,e,t){const i=n.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=Ek,n.schema=r),n.ancestors.push(e);const s=e.name===null?n.Fragment:Het(n,e.name,!0),o=Qrn(n,e),a=GSe(n,e);return $et(n,o,s,e),KSe(o,a),n.ancestors.pop(),n.schema=i,n.create(e,s,o,t)}function Urn(n,e,t){const i={};return KSe(i,GSe(n,e)),n.create(e,n.Fragment,i,t)}function qrn(n,e){return e.value}function $et(n,e,t,i){typeof t!="string"&&t!==n.Fragment&&n.passNode&&(e.node=i)}function KSe(n,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(n.children=t)}}function Krn(n,e,t){return i;function i(r,s,o,a){const c=Array.isArray(o.children)?t:e;return a?c(s,o,a):c(s,o)}}function Grn(n,e){return t;function t(i,r,s,o){const a=Array.isArray(s.children),l=g1(i);return e(r,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:n,lineNumber:l?l.line:void 0},void 0)}}function Yrn(n,e){const t={};let i,r;for(r in e.properties)if(r!=="children"&&qSe.call(e.properties,r)){const s=Xrn(n,r,e.properties[r]);if(s){const[o,a]=s;n.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Brn.has(e.tagName)?i=a:t[o]=a}}if(i){const s=t.style||(t.style={});s[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return t}function Qrn(n,e){const t={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&n.evaluater){const s=i.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,n.evaluater.evaluateExpression(a.argument))}else W8(n,e.position);else{const r=i.name;let s;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,s=n.evaluater.evaluateExpression(a.expression)}else W8(n,e.position);else s=i.value===null?!0:i.value;t[r]=s}return t}function GSe(n,e){const t=[];let i=-1;const r=n.passKeys?new Map:Orn;for(;++i<e.children.length;){const s=e.children[i];let o;if(n.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=r.get(l)||0;o=l+"-"+c,r.set(l,c+1)}}const a=Bet(n,s,o);a!==void 0&&t.push(a)}return t}function Xrn(n,e,t){const i=hee(n.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=i.commaSeparated?Tet(t):Met(t)),i.property==="style"){let r=typeof t=="object"?t:Zrn(n,String(t));return n.stylePropertyNameCase==="css"&&(r=Jrn(r)),["style",r]}return[n.elementAttributeNameCase==="react"&&i.space?Lrn[i.property]||i.property:i.attribute,t]}}function Zrn(n,e){const t={};try{Rrn(e,i)}catch(r){if(!n.ignoreInvalidStyle){const s=r,o=new bf("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=n.filePath||void 0,o.url=Fet+"#cannot-parse-style-attribute",o}}return t;function i(r,s){let o=r;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(jrn,tsn)),t[o]=s}}function Het(n,e,t){let i;if(!t)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let s=-1,o;for(;++s<r.length;){const a=m5e(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}i=o}else i=m5e(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return qSe.call(n.components,r)?n.components[r]:r}if(n.evaluater)return n.evaluater.evaluateExpression(i);W8(n)}function W8(n,e){const t=new bf("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=Fet+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Jrn(n){const e={};let t;for(t in n)qSe.call(n,t)&&(e[esn(t)]=n[t]);return e}function esn(n){let e=n.replace(Mrn,nsn);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function tsn(n,e){return e.toUpperCase()}function nsn(n){return"-"+n.toLowerCase()}const fle={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"]},isn={};function rsn(n,e){const t=isn,i=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,r=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Vet(n,i,r)}function Vet(n,e,t){if(ssn(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 k5e(n.children,e,t)}return Array.isArray(n)?k5e(n,e,t):""}function k5e(n,e,t){const i=[];let r=-1;for(;++r<n.length;)i[r]=Vet(n[r],e,t);return i.join("")}function ssn(n){return!!(n&&typeof n=="object")}const T5e=document.createElement("i");function YSe(n){const e="&"+n+";";T5e.innerHTML=e;const t=T5e.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===e?!1:t}function Ew(n,e,t,i){const r=n.length;let s=0,o;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,t=t>0?t:0,i.length<1e4)o=Array.from(i),o.unshift(e,t),n.splice(...o);else for(t&&n.splice(e,t);s<i.length;)o=i.slice(s,s+1e4),o.unshift(e,0),n.splice(...o),s+=1e4,e+=1e4}function A_(n,e){return n.length>0?(Ew(n,n.length,0,e),n):e}const I5e={}.hasOwnProperty;function osn(n){const e={};let t=-1;for(;++t<n.length;)asn(e,n[t]);return e}function asn(n,e){let t;for(t in e){const r=(I5e.call(n,t)?n[t]:void 0)||(n[t]={}),s=e[t];let o;if(s)for(o in s){I5e.call(r,o)||(r[o]=[]);const a=s[o];lsn(r[o],Array.isArray(a)?a:a?[a]:[])}}}function lsn(n,e){let t=-1;const i=[];for(;++t<e.length;)(e[t].add==="after"?n:i).push(e[t]);Ew(n,0,0,i)}function Wet(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?"�":String.fromCodePoint(t)}function EP(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const py=kk(/[A-Za-z]/),gm=kk(/[\dA-Za-z]/),csn=kk(/[#-'*+\--9=?A-Z^-~]/);function Tpe(n){return n!==null&&(n<32||n===127)}const Ipe=kk(/\d/),usn=kk(/[\dA-Fa-f]/),dsn=kk(/[!-/:-@[-`{-~]/);function Rs(n){return n!==null&&n<-2}function cg(n){return n!==null&&(n<0||n===32)}function Ia(n){return n===-2||n===-1||n===32}const hsn=kk(new RegExp("\\p{P}|\\p{S}","u")),fsn=kk(/\s/);function kk(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function k4(n){const e=[];let t=-1,i=0,r=0;for(;++t<n.length;){const s=n.charCodeAt(t);let o="";if(s===37&&gm(n.charCodeAt(t+1))&&gm(n.charCodeAt(t+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=n.charCodeAt(t+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),r=1):o="�"}else o=String.fromCharCode(s);o&&(e.push(n.slice(i,t),encodeURIComponent(o)),i=t+r+1,o=""),r&&(t+=r,r=0)}return e.join("")+n.slice(i)}function zl(n,e,t,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return Ia(l)?(n.enter(t),a(l)):e(l)}function a(l){return Ia(l)&&s++<r?(n.consume(l),a):(n.exit(t),e(l))}}const psn={tokenize:gsn};function gsn(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"),zl(n,e,"linePrefix")}function r(a){return n.enter("paragraph"),s(a)}function s(a){const l=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,o(a)}function o(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return Rs(a)?(n.consume(a),n.exit("chunkText"),s):(n.consume(a),o)}}const msn={tokenize:_sn},L5e={tokenize:vsn};function _sn(n){const e=this,t=[];let i=0,r,s,o;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 S=C,k;for(;S--;)if(e.events[S][0]==="exit"&&e.events[S][1].type==="chunkFlow"){k=e.events[S][1].end;break}v(i);let I=C;for(;I<e.events.length;)e.events[I][1].end=Object.assign({},k),I++;return Ew(e.events,S+1,0,e.events.slice(C)),e.events.length=I,c(y)}return a(y)}function c(y){if(i===t.length){if(!r)return f(y);if(r.currentConstruct&&r.currentConstruct.concrete)return g(y);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(L5e,u,d)(y)}function u(y){return r&&b(),v(i),f(y)}function d(y){return e.parser.lazy[e.now().line]=i!==t.length,o=e.now().offset,g(y)}function f(y){return e.containerState={},n.attempt(L5e,p,g)(y)}function p(y){return i++,t.push([e.currentConstruct,e.containerState]),f(y)}function g(y){if(y===null){r&&b(),v(0),n.consume(y);return}return r=r||e.parser.flow(e.now()),n.enter("chunkFlow",{contentType:"flow",previous:s,_tokenizer:r}),m(y)}function m(y){if(y===null){_(n.exit("chunkFlow"),!0),v(0),n.consume(y);return}return Rs(y)?(n.consume(y),_(n.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(n.consume(y),m)}function _(y,C){const S=e.sliceStream(y);if(C&&S.push(null),y.previous=s,s&&(s.next=y),s=y,r.defineSkip(y.start),r.write(S),e.parser.lazy[y.start.line]){let k=r.events.length;for(;k--;)if(r.events[k][1].start.offset<o&&(!r.events[k][1].end||r.events[k][1].end.offset>o))return;const I=e.events.length;let L=I,N,P;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){if(N){P=e.events[L][1].end;break}N=!0}for(v(i),k=I;k<e.events.length;)e.events[k][1].end=Object.assign({},P),k++;Ew(e.events,L+1,0,e.events.slice(I)),e.events.length=k}}function v(y){let C=t.length;for(;C-- >y;){const S=t[C];e.containerState=S[1],S[0].exit.call(e,n)}t.length=y}function b(){r.write([null]),s=void 0,r=void 0,e.containerState._closeFlow=void 0}}function vsn(n,e,t){return zl(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function A5e(n){if(n===null||cg(n)||fsn(n))return 1;if(hsn(n))return 2}function QSe(n,e,t){const i=[];let r=-1;for(;++r<n.length;){const s=n[r].resolveAll;s&&!i.includes(s)&&(e=s(e,t),i.push(s))}return e}const Lpe={name:"attention",tokenize:ysn,resolveAll:bsn};function bsn(n,e){let t=-1,i,r,s,o,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),f=Object.assign({},n[t][1].start);N5e(d,-l),N5e(f,l),o={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:f},s={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({},o.start),end:Object.assign({},a.end)},n[i][1].end=Object.assign({},o.start),n[t][1].start=Object.assign({},a.end),c=[],n[i][1].end.offset-n[i][1].start.offset&&(c=A_(c,[["enter",n[i][1],e],["exit",n[i][1],e]])),c=A_(c,[["enter",r,e],["enter",o,e],["exit",o,e],["enter",s,e]]),c=A_(c,QSe(e.parser.constructs.insideSpan.null,n.slice(i+1,t),e)),c=A_(c,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",r,e]]),n[t][1].end.offset-n[t][1].start.offset?(u=2,c=A_(c,[["enter",n[t][1],e],["exit",n[t][1],e]])):u=0,Ew(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 ysn(n,e){const t=this.parser.constructs.attentionMarkers.null,i=this.previous,r=A5e(i);let s;return o;function o(l){return s=l,n.enter("attentionSequence"),a(l)}function a(l){if(l===s)return n.consume(l),a;const c=n.exit("attentionSequence"),u=A5e(l),d=!u||u===2&&r||t.includes(l),f=!r||r===2&&u||t.includes(i);return c._open=!!(s===42?d:d&&(r||!f)),c._close=!!(s===42?f:f&&(u||!d)),e(l)}}function N5e(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const Csn={name:"autolink",tokenize:wsn};function wsn(n,e,t){let i=0;return r;function r(p){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),s}function s(p){return py(p)?(n.consume(p),o):p===64?t(p):c(p)}function o(p){return p===43||p===45||p===46||gm(p)?(i=1,a(p)):c(p)}function a(p){return p===58?(n.consume(p),i=0,l):(p===43||p===45||p===46||gm(p))&&i++<32?(n.consume(p),a):(i=0,c(p))}function l(p){return p===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.exit("autolink"),e):p===null||p===32||p===60||Tpe(p)?t(p):(n.consume(p),l)}function c(p){return p===64?(n.consume(p),u):csn(p)?(n.consume(p),c):t(p)}function u(p){return gm(p)?d(p):t(p)}function d(p){return p===46?(n.consume(p),i=0,u):p===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.exit("autolink"),e):f(p)}function f(p){if((p===45||gm(p))&&i++<63){const g=p===45?f:d;return n.consume(p),g}return t(p)}}const pee={tokenize:xsn,partial:!0};function xsn(n,e,t){return i;function i(s){return Ia(s)?zl(n,r,"linePrefix")(s):r(s)}function r(s){return s===null||Rs(s)?e(s):t(s)}}const zet={name:"blockQuote",tokenize:Ssn,continuation:{tokenize:Esn},exit:ksn};function Ssn(n,e,t){const i=this;return r;function r(o){if(o===62){const a=i.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(o),n.exit("blockQuoteMarker"),s}return t(o)}function s(o){return Ia(o)?(n.enter("blockQuotePrefixWhitespace"),n.consume(o),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(o))}}function Esn(n,e,t){const i=this;return r;function r(o){return Ia(o)?zl(n,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return n.attempt(zet,e,t)(o)}}function ksn(n){n.exit("blockQuote")}const Uet={name:"characterEscape",tokenize:Tsn};function Tsn(n,e,t){return i;function i(s){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(s),n.exit("escapeMarker"),r}function r(s){return dsn(s)?(n.enter("characterEscapeValue"),n.consume(s),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(s)}}const qet={name:"characterReference",tokenize:Isn};function Isn(n,e,t){const i=this;let r=0,s,o;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"),s=31,o=gm,u(d))}function c(d){return d===88||d===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(d),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),s=6,o=usn,u):(n.enter("characterReferenceValue"),s=7,o=Ipe,u(d))}function u(d){if(d===59&&r){const f=n.exit("characterReferenceValue");return o===gm&&!YSe(i.sliceSerialize(f))?t(d):(n.enter("characterReferenceMarker"),n.consume(d),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return o(d)&&r++<s?(n.consume(d),u):t(d)}}const D5e={tokenize:Asn,partial:!0},R5e={name:"codeFenced",tokenize:Lsn,concrete:!0};function Lsn(n,e,t){const i=this,r={tokenize:S,partial:!0};let s=0,o=0,a;return l;function l(k){return c(k)}function c(k){const I=i.events[i.events.length-1];return s=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=k,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(o++,n.consume(k),u):o<3?t(k):(n.exit("codeFencedFenceSequence"),Ia(k)?zl(n,d,"whitespace")(k):d(k))}function d(k){return k===null||Rs(k)?(n.exit("codeFencedFence"),i.interrupt?e(k):n.check(D5e,m,C)(k)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||Rs(k)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),d(k)):Ia(k)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),zl(n,p,"whitespace")(k)):k===96&&k===a?t(k):(n.consume(k),f)}function p(k){return k===null||Rs(k)?d(k):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||Rs(k)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),d(k)):k===96&&k===a?t(k):(n.consume(k),g)}function m(k){return n.attempt(r,C,_)(k)}function _(k){return n.enter("lineEnding"),n.consume(k),n.exit("lineEnding"),v}function v(k){return s>0&&Ia(k)?zl(n,b,"linePrefix",s+1)(k):b(k)}function b(k){return k===null||Rs(k)?n.check(D5e,m,C)(k):(n.enter("codeFlowValue"),y(k))}function y(k){return k===null||Rs(k)?(n.exit("codeFlowValue"),b(k)):(n.consume(k),y)}function C(k){return n.exit("codeFenced"),e(k)}function S(k,I,L){let N=0;return P;function P(B){return k.enter("lineEnding"),k.consume(B),k.exit("lineEnding"),O}function O(B){return k.enter("codeFencedFence"),Ia(B)?zl(k,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):F(B)}function F(B){return B===a?(k.enter("codeFencedFenceSequence"),V(B)):L(B)}function V(B){return B===a?(N++,k.consume(B),V):N>=o?(k.exit("codeFencedFenceSequence"),Ia(B)?zl(k,M,"whitespace")(B):M(B)):L(B)}function M(B){return B===null||Rs(B)?(k.exit("codeFencedFence"),I(B)):L(B)}}}function Asn(n,e,t){const i=this;return r;function r(o){return o===null?t(o):(n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?t(o):e(o)}}const ple={name:"codeIndented",tokenize:Dsn},Nsn={tokenize:Rsn,partial:!0};function Dsn(n,e,t){const i=this;return r;function r(c){return n.enter("codeIndented"),zl(n,s,"linePrefix",5)(c)}function s(c){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):t(c)}function o(c){return c===null?l(c):Rs(c)?n.attempt(Nsn,o,l)(c):(n.enter("codeFlowValue"),a(c))}function a(c){return c===null||Rs(c)?(n.exit("codeFlowValue"),o(c)):(n.consume(c),a)}function l(c){return n.exit("codeIndented"),e(c)}}function Rsn(n,e,t){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?t(o):Rs(o)?(n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),r):zl(n,s,"linePrefix",5)(o)}function s(o){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):Rs(o)?r(o):t(o)}}const Psn={name:"codeText",tokenize:jsn,resolve:Osn,previous:Msn};function Osn(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 Msn(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jsn(n,e,t){let i=0,r,s;return o;function o(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?(s=n.enter("codeTextSequence"),r=0,u(d)):Rs(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||Rs(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)):(s.type="codeTextData",c(d))}}class Fsn{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 s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&U5(this.left,i),s.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),U5(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),U5(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);U5(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);U5(this.left,t.reverse())}}}function U5(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 Ket(n){const e={};let t=-1,i,r,s,o,a,l,c;const u=new Fsn(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,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,Bsn(u,t)),t=e[t],c=!0);else if(i[1]._container){for(s=t,r=void 0;s--&&(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank");)o[0]==="enter"&&(r&&(u.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=s);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 Ew(n,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Bsn(n,e){const t=n.get(e)[1],i=n.get(e)[2];let r=e-1;const s=[],o=t._tokenizer||i.parser[t.contentType](t.start),a=o.events,l=[],c={};let u,d,f=-1,p=t,g=0,m=0;const _=[m];for(;p;){for(;n.get(++r)[1]!==p;);s.push(r),p._tokenizer||(u=i.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=t;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(m=f+1,_.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):_.pop(),f=_.length;f--;){const v=a.slice(_[f],_[f+1]),b=s.pop();l.push([b,b+v.length-1]),n.splice(b,2,v)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}const $sn={tokenize:Wsn,resolve:Vsn},Hsn={tokenize:zsn,partial:!0};function Vsn(n){return Ket(n),n}function Wsn(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?s(a):Rs(a)?n.check(Hsn,o,s)(a):(n.consume(a),r)}function s(a){return n.exit("chunkContent"),n.exit("content"),e(a)}function o(a){return n.consume(a),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,r}}function zsn(n,e,t){const i=this;return r;function r(o){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),zl(n,s,"linePrefix")}function s(o){if(o===null||Rs(o))return t(o);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(o):n.interrupt(i.parser.constructs.flow,t,e)(o)}}function Get(n,e,t,i,r,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(n.enter(i),n.enter(r),n.enter(s),n.consume(v),n.exit(s),f):v===null||v===32||v===41||Tpe(v)?t(v):(n.enter(i),n.enter(o),n.enter(a),n.enter("chunkString",{contentType:"string"}),m(v))}function f(v){return v===62?(n.enter(s),n.consume(v),n.exit(s),n.exit(r),n.exit(i),e):(n.enter(a),n.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===62?(n.exit("chunkString"),n.exit(a),f(v)):v===null||v===60||Rs(v)?t(v):(n.consume(v),v===92?g:p)}function g(v){return v===60||v===62||v===92?(n.consume(v),p):p(v)}function m(v){return!u&&(v===null||v===41||cg(v))?(n.exit("chunkString"),n.exit(a),n.exit(o),n.exit(i),e(v)):u<c&&v===40?(n.consume(v),u++,m):v===41?(n.consume(v),u--,m):v===null||v===32||v===40||Tpe(v)?t(v):(n.consume(v),v===92?_:m)}function _(v){return v===40||v===41||v===92?(n.consume(v),m):m(v)}}function Yet(n,e,t,i,r,s){const o=this;let a=0,l;return c;function c(p){return n.enter(i),n.enter(r),n.consume(p),n.exit(r),n.enter(s),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(p):p===93?(n.exit(s),n.enter(r),n.consume(p),n.exit(r),n.exit(i),e):Rs(p)?(n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),u):(n.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Rs(p)||a++>999?(n.exit("chunkString"),u(p)):(n.consume(p),l||(l=!Ia(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(n.consume(p),a++,d):d(p)}}function Qet(n,e,t,i,r,s){let o;return a;function a(f){return f===34||f===39||f===40?(n.enter(i),n.enter(r),n.consume(f),n.exit(r),o=f===40?41:f,l):t(f)}function l(f){return f===o?(n.enter(r),n.consume(f),n.exit(r),n.exit(i),e):(n.enter(s),c(f))}function c(f){return f===o?(n.exit(s),l(o)):f===null?t(f):Rs(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),zl(n,c,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===o||f===null||Rs(f)?(n.exit("chunkString"),c(f)):(n.consume(f),f===92?d:u)}function d(f){return f===o||f===92?(n.consume(f),u):u(f)}}function BF(n,e){let t;return i;function i(r){return Rs(r)?(n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),t=!0,i):Ia(r)?zl(n,i,t?"linePrefix":"lineSuffix")(r):e(r)}}const Usn={name:"definition",tokenize:Ksn},qsn={tokenize:Gsn,partial:!0};function Ksn(n,e,t){const i=this;let r;return s;function s(p){return n.enter("definition"),o(p)}function o(p){return Yet.call(i,n,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return r=EP(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),p===58?(n.enter("definitionMarker"),n.consume(p),n.exit("definitionMarker"),l):t(p)}function l(p){return cg(p)?BF(n,c)(p):c(p)}function c(p){return Get(n,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return n.attempt(qsn,d,d)(p)}function d(p){return Ia(p)?zl(n,f,"whitespace")(p):f(p)}function f(p){return p===null||Rs(p)?(n.exit("definition"),i.parser.defined.push(r),e(p)):t(p)}}function Gsn(n,e,t){return i;function i(a){return cg(a)?BF(n,r)(a):t(a)}function r(a){return Qet(n,s,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Ia(a)?zl(n,o,"whitespace")(a):o(a)}function o(a){return a===null||Rs(a)?e(a):t(a)}}const Ysn={name:"hardBreakEscape",tokenize:Qsn};function Qsn(n,e,t){return i;function i(s){return n.enter("hardBreakEscape"),n.consume(s),r}function r(s){return Rs(s)?(n.exit("hardBreakEscape"),e(s)):t(s)}}const Xsn={name:"headingAtx",tokenize:Jsn,resolve:Zsn};function Zsn(n,e){let t=n.length-2,i=3,r,s;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},s={type:"chunkText",start:n[i][1].start,end:n[t][1].end,contentType:"text"},Ew(n,i,t-i+1,[["enter",r,e],["enter",s,e],["exit",s,e],["exit",r,e]])),n}function Jsn(n,e,t){let i=0;return r;function r(u){return n.enter("atxHeading"),s(u)}function s(u){return n.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&i++<6?(n.consume(u),o):u===null||cg(u)?(n.exit("atxHeadingSequence"),a(u)):t(u)}function a(u){return u===35?(n.enter("atxHeadingSequence"),l(u)):u===null||Rs(u)?(n.exit("atxHeading"),e(u)):Ia(u)?zl(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||cg(u)?(n.exit("atxHeadingText"),a(u)):(n.consume(u),c)}}const eon=["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"],P5e=["pre","script","style","textarea"],ton={name:"htmlFlow",tokenize:son,resolveTo:ron,concrete:!0},non={tokenize:aon,partial:!0},ion={tokenize:oon,partial:!0};function ron(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 son(n,e,t){const i=this;let r,s,o,a,l;return c;function c(X){return u(X)}function u(X){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(X),d}function d(X){return X===33?(n.consume(X),f):X===47?(n.consume(X),s=!0,m):X===63?(n.consume(X),r=3,i.interrupt?e:H):py(X)?(n.consume(X),o=String.fromCharCode(X),_):t(X)}function f(X){return X===45?(n.consume(X),r=2,p):X===91?(n.consume(X),r=5,a=0,g):py(X)?(n.consume(X),r=4,i.interrupt?e:H):t(X)}function p(X){return X===45?(n.consume(X),i.interrupt?e:H):t(X)}function g(X){const oe="CDATA[";return X===oe.charCodeAt(a++)?(n.consume(X),a===oe.length?i.interrupt?e:F:g):t(X)}function m(X){return py(X)?(n.consume(X),o=String.fromCharCode(X),_):t(X)}function _(X){if(X===null||X===47||X===62||cg(X)){const oe=X===47,fe=o.toLowerCase();return!oe&&!s&&P5e.includes(fe)?(r=1,i.interrupt?e(X):F(X)):eon.includes(o.toLowerCase())?(r=6,oe?(n.consume(X),v):i.interrupt?e(X):F(X)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?t(X):s?b(X):y(X))}return X===45||gm(X)?(n.consume(X),o+=String.fromCharCode(X),_):t(X)}function v(X){return X===62?(n.consume(X),i.interrupt?e:F):t(X)}function b(X){return Ia(X)?(n.consume(X),b):P(X)}function y(X){return X===47?(n.consume(X),P):X===58||X===95||py(X)?(n.consume(X),C):Ia(X)?(n.consume(X),y):P(X)}function C(X){return X===45||X===46||X===58||X===95||gm(X)?(n.consume(X),C):S(X)}function S(X){return X===61?(n.consume(X),k):Ia(X)?(n.consume(X),S):y(X)}function k(X){return X===null||X===60||X===61||X===62||X===96?t(X):X===34||X===39?(n.consume(X),l=X,I):Ia(X)?(n.consume(X),k):L(X)}function I(X){return X===l?(n.consume(X),l=null,N):X===null||Rs(X)?t(X):(n.consume(X),I)}function L(X){return X===null||X===34||X===39||X===47||X===60||X===61||X===62||X===96||cg(X)?S(X):(n.consume(X),L)}function N(X){return X===47||X===62||Ia(X)?y(X):t(X)}function P(X){return X===62?(n.consume(X),O):t(X)}function O(X){return X===null||Rs(X)?F(X):Ia(X)?(n.consume(X),O):t(X)}function F(X){return X===45&&r===2?(n.consume(X),W):X===60&&r===1?(n.consume(X),q):X===62&&r===4?(n.consume(X),z):X===63&&r===3?(n.consume(X),H):X===93&&r===5?(n.consume(X),G):Rs(X)&&(r===6||r===7)?(n.exit("htmlFlowData"),n.check(non,Z,V)(X)):X===null||Rs(X)?(n.exit("htmlFlowData"),V(X)):(n.consume(X),F)}function V(X){return n.check(ion,M,Z)(X)}function M(X){return n.enter("lineEnding"),n.consume(X),n.exit("lineEnding"),B}function B(X){return X===null||Rs(X)?V(X):(n.enter("htmlFlowData"),F(X))}function W(X){return X===45?(n.consume(X),H):F(X)}function q(X){return X===47?(n.consume(X),o="",U):F(X)}function U(X){if(X===62){const oe=o.toLowerCase();return P5e.includes(oe)?(n.consume(X),z):F(X)}return py(X)&&o.length<8?(n.consume(X),o+=String.fromCharCode(X),U):F(X)}function G(X){return X===93?(n.consume(X),H):F(X)}function H(X){return X===62?(n.consume(X),z):X===45&&r===2?(n.consume(X),H):F(X)}function z(X){return X===null||Rs(X)?(n.exit("htmlFlowData"),Z(X)):(n.consume(X),z)}function Z(X){return n.exit("htmlFlow"),e(X)}}function oon(n,e,t){const i=this;return r;function r(o){return Rs(o)?(n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),s):t(o)}function s(o){return i.parser.lazy[i.now().line]?t(o):e(o)}}function aon(n,e,t){return i;function i(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),n.attempt(pee,e,t)}}const lon={name:"htmlText",tokenize:con};function con(n,e,t){const i=this;let r,s,o;return a;function a(H){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(H),l}function l(H){return H===33?(n.consume(H),c):H===47?(n.consume(H),S):H===63?(n.consume(H),y):py(H)?(n.consume(H),L):t(H)}function c(H){return H===45?(n.consume(H),u):H===91?(n.consume(H),s=0,g):py(H)?(n.consume(H),b):t(H)}function u(H){return H===45?(n.consume(H),p):t(H)}function d(H){return H===null?t(H):H===45?(n.consume(H),f):Rs(H)?(o=d,q(H)):(n.consume(H),d)}function f(H){return H===45?(n.consume(H),p):d(H)}function p(H){return H===62?W(H):H===45?f(H):d(H)}function g(H){const z="CDATA[";return H===z.charCodeAt(s++)?(n.consume(H),s===z.length?m:g):t(H)}function m(H){return H===null?t(H):H===93?(n.consume(H),_):Rs(H)?(o=m,q(H)):(n.consume(H),m)}function _(H){return H===93?(n.consume(H),v):m(H)}function v(H){return H===62?W(H):H===93?(n.consume(H),v):m(H)}function b(H){return H===null||H===62?W(H):Rs(H)?(o=b,q(H)):(n.consume(H),b)}function y(H){return H===null?t(H):H===63?(n.consume(H),C):Rs(H)?(o=y,q(H)):(n.consume(H),y)}function C(H){return H===62?W(H):y(H)}function S(H){return py(H)?(n.consume(H),k):t(H)}function k(H){return H===45||gm(H)?(n.consume(H),k):I(H)}function I(H){return Rs(H)?(o=I,q(H)):Ia(H)?(n.consume(H),I):W(H)}function L(H){return H===45||gm(H)?(n.consume(H),L):H===47||H===62||cg(H)?N(H):t(H)}function N(H){return H===47?(n.consume(H),W):H===58||H===95||py(H)?(n.consume(H),P):Rs(H)?(o=N,q(H)):Ia(H)?(n.consume(H),N):W(H)}function P(H){return H===45||H===46||H===58||H===95||gm(H)?(n.consume(H),P):O(H)}function O(H){return H===61?(n.consume(H),F):Rs(H)?(o=O,q(H)):Ia(H)?(n.consume(H),O):N(H)}function F(H){return H===null||H===60||H===61||H===62||H===96?t(H):H===34||H===39?(n.consume(H),r=H,V):Rs(H)?(o=F,q(H)):Ia(H)?(n.consume(H),F):(n.consume(H),M)}function V(H){return H===r?(n.consume(H),r=void 0,B):H===null?t(H):Rs(H)?(o=V,q(H)):(n.consume(H),V)}function M(H){return H===null||H===34||H===39||H===60||H===61||H===96?t(H):H===47||H===62||cg(H)?N(H):(n.consume(H),M)}function B(H){return H===47||H===62||cg(H)?N(H):t(H)}function W(H){return H===62?(n.consume(H),n.exit("htmlTextData"),n.exit("htmlText"),e):t(H)}function q(H){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(H),n.exit("lineEnding"),U}function U(H){return Ia(H)?zl(n,G,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):G(H)}function G(H){return n.enter("htmlTextData"),o(H)}}const XSe={name:"labelEnd",tokenize:gon,resolveTo:pon,resolveAll:fon},uon={tokenize:mon},don={tokenize:_on},hon={tokenize:von};function fon(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 pon(n,e){let t=n.length,i=0,r,s,o,a;for(;t--;)if(r=n[t][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;n[t][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(o){if(n[t][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=t,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(o=t);const l={type:n[s][1].type==="labelLink"?"link":"image",start:Object.assign({},n[s][1].start),end:Object.assign({},n[n.length-1][1].end)},c={type:"label",start:Object.assign({},n[s][1].start),end:Object.assign({},n[o][1].end)},u={type:"labelText",start:Object.assign({},n[s+i+2][1].end),end:Object.assign({},n[o-2][1].start)};return a=[["enter",l,e],["enter",c,e]],a=A_(a,n.slice(s+1,s+i+3)),a=A_(a,[["enter",u,e]]),a=A_(a,QSe(e.parser.constructs.insideSpan.null,n.slice(s+i+4,o-3),e)),a=A_(a,[["exit",u,e],n[o-2],n[o-1],["exit",c,e]]),a=A_(a,n.slice(o+1)),a=A_(a,[["exit",l,e]]),Ew(n,s,n.length,a),n}function gon(n,e,t){const i=this;let r=i.events.length,s,o;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){s=i.events[r][1];break}return a;function a(f){return s?s._inactive?d(f):(o=i.parser.defined.includes(EP(i.sliceSerialize({start:s.end,end:i.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelEnd"),l):t(f)}function l(f){return f===40?n.attempt(uon,u,o?u:d)(f):f===91?n.attempt(don,u,o?c:d)(f):o?u(f):d(f)}function c(f){return n.attempt(hon,u,d)(f)}function u(f){return e(f)}function d(f){return s._balanced=!0,t(f)}}function mon(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 cg(d)?BF(n,s)(d):s(d)}function s(d){return d===41?u(d):Get(n,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return cg(d)?BF(n,l)(d):u(d)}function a(d){return t(d)}function l(d){return d===34||d===39||d===40?Qet(n,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return cg(d)?BF(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 _on(n,e,t){const i=this;return r;function r(a){return Yet.call(i,n,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return i.parser.defined.includes(EP(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(a):t(a)}function o(a){return t(a)}}function von(n,e,t){return i;function i(s){return n.enter("reference"),n.enter("referenceMarker"),n.consume(s),n.exit("referenceMarker"),r}function r(s){return s===93?(n.enter("referenceMarker"),n.consume(s),n.exit("referenceMarker"),n.exit("reference"),e):t(s)}}const bon={name:"labelStartImage",tokenize:yon,resolveAll:XSe.resolveAll};function yon(n,e,t){const i=this;return r;function r(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),s}function s(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(a):e(a)}}const Con={name:"labelStartLink",tokenize:won,resolveAll:XSe.resolveAll};function won(n,e,t){const i=this;return r;function r(o){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(o):e(o)}}const gle={name:"lineEnding",tokenize:xon};function xon(n,e){return t;function t(i){return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),zl(n,e,"linePrefix")}}const Fz={name:"thematicBreak",tokenize:Son};function Son(n,e,t){let i=0,r;return s;function s(c){return n.enter("thematicBreak"),o(c)}function o(c){return r=c,a(c)}function a(c){return c===r?(n.enter("thematicBreakSequence"),l(c)):i>=3&&(c===null||Rs(c))?(n.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===r?(n.consume(c),i++,l):(n.exit("thematicBreakSequence"),Ia(c)?zl(n,a,"whitespace")(c):a(c))}}const Op={name:"list",tokenize:Ton,continuation:{tokenize:Ion},exit:Aon},Eon={tokenize:Non,partial:!0},kon={tokenize:Lon,partial:!0};function Ton(n,e,t){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return a;function a(p){const g=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:Ipe(p)){if(i.containerState.type||(i.containerState.type=g,n.enter(g,{_container:!0})),g==="listUnordered")return n.enter("listItemPrefix"),p===42||p===45?n.check(Fz,t,c)(p):c(p);if(!i.interrupt||p===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),l(p)}return t(p)}function l(p){return Ipe(p)&&++o<10?(n.consume(p),l):(!i.interrupt||o<2)&&(i.containerState.marker?p===i.containerState.marker:p===41||p===46)?(n.exit("listItemValue"),c(p)):t(p)}function c(p){return n.enter("listItemMarker"),n.consume(p),n.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||p,n.check(pee,i.interrupt?t:u,n.attempt(Eon,f,d))}function u(p){return i.containerState.initialBlankLine=!0,s++,f(p)}function d(p){return Ia(p)?(n.enter("listItemPrefixWhitespace"),n.consume(p),n.exit("listItemPrefixWhitespace"),f):t(p)}function f(p){return i.containerState.size=s+i.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(p)}}function Ion(n,e,t){const i=this;return i.containerState._closeFlow=void 0,n.check(pee,r,s);function r(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,zl(n,e,"listItemIndent",i.containerState.size+1)(a)}function s(a){return i.containerState.furtherBlankLines||!Ia(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,n.attempt(kon,e,o)(a))}function o(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,zl(n,n.attempt(Op,e,t),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Lon(n,e,t){const i=this;return zl(n,r,"listItemIndent",i.containerState.size+1);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?e(s):t(s)}}function Aon(n){n.exit(this.containerState.type)}function Non(n,e,t){const i=this;return zl(n,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=i.events[i.events.length-1];return!Ia(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):t(s)}}const O5e={name:"setextUnderline",tokenize:Ron,resolveTo:Don};function Don(n,e){let t=n.length,i,r,s;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),!s&&n[t][1].type==="definition"&&(s=t);const o={type:"setextHeading",start:Object.assign({},n[r][1].start),end:Object.assign({},n[n.length-1][1].end)};return n[r][1].type="setextHeadingText",s?(n.splice(r,0,["enter",o,e]),n.splice(s+1,0,["exit",n[i][1],e]),n[i][1].end=Object.assign({},n[s][1].end)):n[i][1]=o,n.push(["exit",o,e]),n}function Ron(n,e,t){const i=this;let r;return s;function s(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,o(c)):t(c)}function o(c){return n.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===r?(n.consume(c),a):(n.exit("setextHeadingLineSequence"),Ia(c)?zl(n,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Rs(c)?(n.exit("setextHeadingLine"),e(c)):t(c)}}const Pon={tokenize:Oon};function Oon(n){const e=this,t=n.attempt(pee,i,n.attempt(this.parser.constructs.flowInitial,r,zl(n,n.attempt(this.parser.constructs.flow,r,n.attempt($sn,r)),"linePrefix")));return t;function i(s){if(s===null){n.consume(s);return}return n.enter("lineEndingBlank"),n.consume(s),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function r(s){if(s===null){n.consume(s);return}return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const Mon={resolveAll:Zet()},jon=Xet("string"),Fon=Xet("text");function Xet(n){return{tokenize:e,resolveAll:Zet(n==="text"?Bon:void 0)};function e(t){const i=this,r=this.parser.constructs[n],s=t.attempt(r,o,a);return o;function o(u){return c(u)?s(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"),s(u)):(t.consume(u),l)}function c(u){if(u===null)return!0;const d=r[u];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(i,i.previous))return!0}return!1}}}function Zet(n){return e;function e(t,i){let r=-1,s;for(;++r<=t.length;)s===void 0?t[r]&&t[r][1].type==="data"&&(s=r,r++):(!t[r]||t[r][1].type!=="data")&&(r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),r=s+2),s=void 0);return n?n(t,i):t}}function Bon(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 s=r.length,o=-1,a=0,l;for(;s--;){const c=r[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;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+s,_bufferIndex:s?o:i.start._bufferIndex+o},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 $on(n,e,t){let i=Object.assign(t?Object.assign({},t):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const r={},s=[];let o=[],a=[];const l={consume:b,enter:y,exit:C,attempt:I(S),check:I(k),interrupt:I(k,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:n,sliceStream:p,sliceSerialize:f,now:g,defineSkip:m,write:d};let u=e.tokenize.call(c,l);return e.resolveAll&&s.push(e),c;function d(O){return o=A_(o,O),_(),o[o.length-1]!==null?[]:(L(e,0),c.events=QSe(s,c.events,c),c.events)}function f(O,F){return Von(p(O),F)}function p(O){return Hon(o,O)}function g(){const{line:O,column:F,offset:V,_index:M,_bufferIndex:B}=i;return{line:O,column:F,offset:V,_index:M,_bufferIndex:B}}function m(O){r[O.line]=O.column,P()}function _(){let O;for(;i._index<o.length;){const F=o[i._index];if(typeof F=="string")for(O=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===O&&i._bufferIndex<F.length;)v(F.charCodeAt(i._bufferIndex));else v(F)}}function v(O){u=u(O)}function b(O){Rs(O)?(i.line++,i.column=1,i.offset+=O===-3?2:1,P()):O!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=O}function y(O,F){const V=F||{};return V.type=O,V.start=g(),c.events.push(["enter",V,c]),a.push(V),V}function C(O){const F=a.pop();return F.end=g(),c.events.push(["exit",F,c]),F}function S(O,F){L(O,F.from)}function k(O,F){F.restore()}function I(O,F){return V;function V(M,B,W){let q,U,G,H;return Array.isArray(M)?Z(M):"tokenize"in M?Z([M]):z(M);function z(Se){return Me;function Me(Ie){const ge=Ie!==null&&Se[Ie],ye=Ie!==null&&Se.null,Pe=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return Z(Pe)(Ie)}}function Z(Se){return q=Se,U=0,Se.length===0?W:X(Se[U])}function X(Se){return Me;function Me(Ie){return H=N(),G=Se,Se.partial||(c.currentConstruct=Se),Se.name&&c.parser.constructs.disable.null.includes(Se.name)?fe():Se.tokenize.call(F?Object.assign(Object.create(c),F):c,l,oe,fe)(Ie)}}function oe(Se){return O(G,H),B}function fe(Se){return H.restore(),++U<q.length?X(q[U]):W}}}function L(O,F){O.resolveAll&&!s.includes(O)&&s.push(O),O.resolve&&Ew(c.events,F,c.events.length-F,O.resolve(c.events.slice(F),c)),O.resolveTo&&(c.events=O.resolveTo(c.events,c))}function N(){const O=g(),F=c.previous,V=c.currentConstruct,M=c.events.length,B=Array.from(a);return{restore:W,from:M};function W(){i=O,c.previous=F,c.currentConstruct=V,c.events.length=M,a=B,P()}}function P(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function Hon(n,e){const t=e.start._index,i=e.start._bufferIndex,r=e.end._index,s=e.end._bufferIndex;let o;if(t===r)o=[n[t].slice(i,s)];else{if(o=n.slice(t,r),i>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(i):o.shift()}s>0&&o.push(n[r].slice(0,s))}return o}function Von(n,e){let t=-1;const i=[];let r;for(;++t<n.length;){const s=n[t];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=` `;break}case-3:{o=`\r `;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&r)continue;o=" ";break}default:o=String.fromCharCode(s)}r=s===-2,i.push(o)}return i.join("")}const Won={42:Op,43:Op,45:Op,48:Op,49:Op,50:Op,51:Op,52:Op,53:Op,54:Op,55:Op,56:Op,57:Op,62:zet},zon={91:Usn},Uon={[-2]:ple,[-1]:ple,32:ple},qon={35:Xsn,42:Fz,45:[O5e,Fz],60:ton,61:O5e,95:Fz,96:R5e,126:R5e},Kon={38:qet,92:Uet},Gon={[-5]:gle,[-4]:gle,[-3]:gle,33:bon,38:qet,42:Lpe,60:[Csn,lon],91:Con,92:[Ysn,Uet],93:XSe,95:Lpe,96:Psn},Yon={null:[Lpe,Mon]},Qon={null:[42,95]},Xon={null:[]},Zon=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Qon,contentInitial:zon,disable:Xon,document:Won,flow:qon,flowInitial:Uon,insideSpan:Yon,string:Kon,text:Gon},Symbol.toStringTag,{value:"Module"}));function Jon(n){const t=osn([Zon,...(n||{}).extensions||[]]),i={defined:[],lazy:{},constructs:t,content:r(psn),document:r(msn),flow:r(Pon),string:r(jon),text:r(Fon)};return i;function r(s){return o;function o(a){return $on(i,s,a)}}}function ean(n){for(;!Ket(n););return n}const M5e=/[\0\t\n\r]/g;function tan(){let n=1,e="",t=!0,i;return r;function r(s,o,a){const l=[];let c,u,d,f,p;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,e="",t&&(s.charCodeAt(0)===65279&&d++,t=void 0);d<s.length;){if(M5e.lastIndex=d,c=M5e.exec(s),f=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(f),!c){e=s.slice(d);break}if(p===10&&d===f&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),d<f&&(l.push(s.slice(d,f)),n+=f-d),p){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=f+1}return a&&(i&&l.push(-5),e&&l.push(e),l.push(null)),l}}const nan=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ian(n){return n.replace(nan,ran)}function ran(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const r=t.charCodeAt(1),s=r===120||r===88;return Wet(t.slice(s?2:1),s?16:10)}return YSe(t)||n}const Jet={}.hasOwnProperty;function san(n,e,t){return typeof e!="string"&&(t=e,e=void 0),oan(t)(ean(Jon(t).document().write(tan()(n,e,!0))))}function oan(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(St),autolinkProtocol:N,autolinkEmail:N,atxHeading:s(mt),blockQuote:s(ye),characterEscape:N,characterReference:N,codeFenced:s(Pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Pe,o),codeText:s(Be,o),codeTextData:N,data:N,codeFlowValue:N,definition:s($e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(qe),hardBreakEscape:s(vt),hardBreakTrailing:s(vt),htmlFlow:s(ft,o),htmlFlowData:N,htmlText:s(ft,o),htmlTextData:N,image:s(tt),label:o,link:s(St),listItem:s(en),listItemValue:f,listOrdered:s(Ft,d),listUnordered:s(Ft),paragraph:s(Ke),reference:X,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(mt),strong:s(dt),thematicBreak:s(at)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ge,autolinkProtocol:Ie,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:Se,characterReference:Me,codeFenced:l(_),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:P,codeIndented:l(v),codeText:l(B),codeTextData:P,data:P,definition:l(),definitionDestinationString:C,definitionLabelString:b,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(F),hardBreakTrailing:l(F),htmlFlow:l(V),htmlFlowData:P,htmlText:l(M),htmlTextData:P,image:l(q),label:G,labelText:U,lineEnding:O,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:H,resourceTitleString:z,resource:Z,setextHeading:l(L),setextHeadingLineSequence:I,setextHeadingText:k,strong:l(),thematicBreak:l()}};ett(e,(n||{}).mdastExtensions||[]);const t={};return i;function i(Oe){let ce={type:"root",children:[]};const Ne={stack:[ce],tokenStack:[],config:e,enter:a,exit:c,buffer:o,resume:u,data:t},Xe=[];let it=-1;for(;++it<Oe.length;)if(Oe[it][1].type==="listOrdered"||Oe[it][1].type==="listUnordered")if(Oe[it][0]==="enter")Xe.push(it);else{const Tt=Xe.pop();it=r(Oe,Tt,it)}for(it=-1;++it<Oe.length;){const Tt=e[Oe[it][0]];Jet.call(Tt,Oe[it][1].type)&&Tt[Oe[it][1].type].call(Object.assign({sliceSerialize:Oe[it][2].sliceSerialize},Ne),Oe[it][1])}if(Ne.tokenStack.length>0){const Tt=Ne.tokenStack[Ne.tokenStack.length-1];(Tt[1]||j5e).call(Ne,void 0,Tt[0])}for(ce.position={start:Wx(Oe.length>0?Oe[0][1].start:{line:1,column:1,offset:0}),end:Wx(Oe.length>0?Oe[Oe.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it<e.transforms.length;)ce=e.transforms[it](ce)||ce;return ce}function r(Oe,ce,Ne){let Xe=ce-1,it=-1,Tt=!1,Ct,Rt,se,ke;for(;++Xe<=Ne;){const Ae=Oe[Xe];switch(Ae[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ae[0]==="enter"?it++:it--,ke=void 0;break}case"lineEndingBlank":{Ae[0]==="enter"&&(Ct&&!ke&&!it&&!se&&(se=Xe),ke=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ke=void 0}if(!it&&Ae[0]==="enter"&&Ae[1].type==="listItemPrefix"||it===-1&&Ae[0]==="exit"&&(Ae[1].type==="listUnordered"||Ae[1].type==="listOrdered")){if(Ct){let je=Xe;for(Rt=void 0;je--;){const Ve=Oe[je];if(Ve[1].type==="lineEnding"||Ve[1].type==="lineEndingBlank"){if(Ve[0]==="exit")continue;Rt&&(Oe[Rt][1].type="lineEndingBlank",Tt=!0),Ve[1].type="lineEnding",Rt=je}else if(!(Ve[1].type==="linePrefix"||Ve[1].type==="blockQuotePrefix"||Ve[1].type==="blockQuotePrefixWhitespace"||Ve[1].type==="blockQuoteMarker"||Ve[1].type==="listItemIndent"))break}se&&(!Rt||se<Rt)&&(Ct._spread=!0),Ct.end=Object.assign({},Rt?Oe[Rt][1].start:Ae[1].end),Oe.splice(Rt||Xe,0,["exit",Ct,Ae[2]]),Xe++,Ne++}if(Ae[1].type==="listItemPrefix"){const je={type:"listItem",_spread:!1,start:Object.assign({},Ae[1].start),end:void 0};Ct=je,Oe.splice(Xe,0,["enter",je,Ae[2]]),Xe++,Ne++,se=void 0,ke=!0}}}return Oe[ce][1]._spread=Tt,Ne}function s(Oe,ce){return Ne;function Ne(Xe){a.call(this,Oe(Xe),Xe),ce&&ce.call(this,Xe)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(Oe,ce,Ne){this.stack[this.stack.length-1].children.push(Oe),this.stack.push(Oe),this.tokenStack.push([ce,Ne]),Oe.position={start:Wx(ce.start),end:void 0}}function l(Oe){return ce;function ce(Ne){Oe&&Oe.call(this,Ne),c.call(this,Ne)}}function c(Oe,ce){const Ne=this.stack.pop(),Xe=this.tokenStack.pop();if(Xe)Xe[0].type!==Oe.type&&(ce?ce.call(this,Oe,Xe[0]):(Xe[1]||j5e).call(this,Oe,Xe[0]));else throw new Error("Cannot close `"+Oe.type+"` ("+FF({start:Oe.start,end:Oe.end})+"): it’s not open");Ne.position.end=Wx(Oe.end)}function u(){return rsn(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(Oe){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(Oe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=Oe}function g(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=Oe}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Oe.replace(/(\r?\n|\r)$/g,"")}function b(Oe){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=ce,Ne.identifier=EP(this.sliceSerialize(Oe)).toLowerCase()}function y(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.title=Oe}function C(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.url=Oe}function S(Oe){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Ne=this.sliceSerialize(Oe).length;ce.depth=Ne}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function I(Oe){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(Oe).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function N(Oe){const Ne=this.stack[this.stack.length-1].children;let Xe=Ne[Ne.length-1];(!Xe||Xe.type!=="text")&&(Xe=nt(),Xe.position={start:Wx(Oe.start),end:void 0},Ne.push(Xe)),this.stack.push(Xe)}function P(Oe){const ce=this.stack.pop();ce.value+=this.sliceSerialize(Oe),ce.position.end=Wx(Oe.end)}function O(Oe){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=ce.children[ce.children.length-1];Ne.position.end=Wx(Oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ce.type)&&(N.call(this,Oe),P.call(this,Oe))}function F(){this.data.atHardBreak=!0}function V(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Oe}function M(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Oe}function B(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Oe}function W(){const Oe=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";Oe.type+="Reference",Oe.referenceType=ce,delete Oe.url,delete Oe.title}else delete Oe.identifier,delete Oe.label;this.data.referenceType=void 0}function q(){const Oe=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";Oe.type+="Reference",Oe.referenceType=ce,delete Oe.url,delete Oe.title}else delete Oe.identifier,delete Oe.label;this.data.referenceType=void 0}function U(Oe){const ce=this.sliceSerialize(Oe),Ne=this.stack[this.stack.length-2];Ne.label=ian(ce),Ne.identifier=EP(ce).toLowerCase()}function G(){const Oe=this.stack[this.stack.length-1],ce=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const Xe=Oe.children;Ne.children=Xe}else Ne.alt=ce}function H(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.url=Oe}function z(){const Oe=this.resume(),ce=this.stack[this.stack.length-1];ce.title=Oe}function Z(){this.data.inReference=void 0}function X(){this.data.referenceType="collapsed"}function oe(Oe){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=ce,Ne.identifier=EP(this.sliceSerialize(Oe)).toLowerCase(),this.data.referenceType="full"}function fe(Oe){this.data.characterReferenceType=Oe.type}function Se(Oe){const ce=this.sliceSerialize(Oe),Ne=this.data.characterReferenceType;let Xe;Ne?(Xe=Wet(ce,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Xe=YSe(ce);const it=this.stack[this.stack.length-1];it.value+=Xe}function Me(Oe){const ce=this.stack.pop();ce.position.end=Wx(Oe.end)}function Ie(Oe){P.call(this,Oe);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(Oe)}function ge(Oe){P.call(this,Oe);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(Oe)}function ye(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function Be(){return{type:"inlineCode",value:""}}function $e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qe(){return{type:"emphasis",children:[]}}function mt(){return{type:"heading",depth:0,children:[]}}function vt(){return{type:"break"}}function ft(){return{type:"html",value:""}}function tt(){return{type:"image",title:null,url:"",alt:null}}function St(){return{type:"link",title:null,url:"",children:[]}}function Ft(Oe){return{type:"list",ordered:Oe.type==="listOrdered",start:null,spread:Oe._spread,children:[]}}function en(Oe){return{type:"listItem",spread:Oe._spread,checked:null,children:[]}}function Ke(){return{type:"paragraph",children:[]}}function dt(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function at(){return{type:"thematicBreak"}}}function Wx(n){return{line:n.line,column:n.column,offset:n.offset}}function ett(n,e){let t=-1;for(;++t<e.length;){const i=e[t];Array.isArray(i)?ett(n,i):aan(n,i)}}function aan(n,e){let t;for(t in e)if(Jet.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 j5e(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+FF({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+FF({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+FF({start:e.start,end:e.end})+") is still open")}function lan(n){const e=this;e.parser=t;function t(i){return san(i,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function can(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 uan(n,e){const t={type:"element",tagName:"br",properties:{},children:[]};return n.patch(e,t),[n.applyData(e,t),{type:"text",value:` `}]}function dan(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 han(n,e){const t={type:"element",tagName:"del",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function fan(n,e){const t={type:"element",tagName:"em",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function pan(n,e){const t=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=k4(i.toLowerCase()),s=n.footnoteOrder.indexOf(i);let o,a=n.footnoteCounts.get(i);a===void 0?(a=0,n.footnoteOrder.push(i),o=n.footnoteOrder.length):o=s+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(o)}]};n.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return n.patch(e,c),n.applyData(e,c)}function gan(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 man(n,e){if(n.options.allowDangerousHtml){const t={type:"raw",value:e.value};return n.patch(e,t),n.applyData(e,t)}}function ttt(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),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function _an(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return ttt(n,e);const r={src:k4(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return n.patch(e,s),n.applyData(e,s)}function van(n,e){const t={src:k4(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 ban(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 yan(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return ttt(n,e);const r={href:k4(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:n.all(e)};return n.patch(e,s),n.applyData(e,s)}function Can(n,e){const t={href:k4(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 wan(n,e,t){const i=n.all(e),r=t?xan(t):ntt(e),s={},o=[];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:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<i.length;){const u=i[a];(r||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:` `}),u.type==="element"&&u.tagName==="p"&&!r?o.push(...u.children):o.push(u)}const l=i[i.length-1];l&&(r||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:` `});const c={type:"element",tagName:"li",properties:s,children:o};return n.patch(e,c),n.applyData(e,c)}function xan(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=ntt(t[i])}return e}function ntt(n){const e=n.spread;return e??n.children.length>1}function San(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 o=i[r];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:n.wrap(i,!0)};return n.patch(e,s),n.applyData(e,s)}function Ean(n,e){const t={type:"element",tagName:"p",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function kan(n,e){const t={type:"root",children:n.wrap(n.all(e))};return n.patch(e,t),n.applyData(e,t)}function Tan(n,e){const t={type:"element",tagName:"strong",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function Ian(n,e){const t=n.all(e),i=t.shift(),r=[];if(i){const o={type:"element",tagName:"thead",properties:{},children:n.wrap([i],!0)};n.patch(e.children[0],o),r.push(o)}if(t.length>0){const o={type:"element",tagName:"tbody",properties:{},children:n.wrap(t,!0)},a=g1(e.children[1]),l=fee(e.children[e.children.length-1]);a&&l&&(o.position={start:a,end:l}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:n.wrap(r,!0)};return n.patch(e,s),n.applyData(e,s)}function Lan(n,e,t){const i=t?t.children:void 0,s=(i?i.indexOf(e):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:e.children.length;let l=-1;const c=[];for(;++l<a;){const d=e.children[l],f={},p=o?o[l]:void 0;p&&(f.align=p);let g={type:"element",tagName:s,properties:f,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 Aan(n,e){const t={type:"element",tagName:"td",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}const F5e=9,B5e=32;function Nan(n){const e=String(n),t=/\r?\n|\r/g;let i=t.exec(e),r=0;const s=[];for(;i;)s.push($5e(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return s.push($5e(e.slice(r),r>0,!1)),s.join("")}function $5e(n,e,t){let i=0,r=n.length;if(e){let s=n.codePointAt(i);for(;s===F5e||s===B5e;)i++,s=n.codePointAt(i)}if(t){let s=n.codePointAt(r-1);for(;s===F5e||s===B5e;)r--,s=n.codePointAt(r-1)}return r>i?n.slice(i,r):""}function Dan(n,e){const t={type:"text",value:Nan(String(e.value))};return n.patch(e,t),n.applyData(e,t)}function Ran(n,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(e,t),n.applyData(e,t)}const Pan={blockquote:can,break:uan,code:dan,delete:han,emphasis:fan,footnoteReference:pan,heading:gan,html:man,imageReference:_an,image:van,inlineCode:ban,linkReference:yan,link:Can,listItem:wan,list:San,paragraph:Ean,root:kan,strong:Tan,table:Ian,tableCell:Aan,tableRow:Lan,text:Dan,thematicBreak:Ran,toml:yV,yaml:yV,definition:yV,footnoteDefinition:yV};function yV(){}const itt=-1,gee=0,sK=1,oK=2,ZSe=3,JSe=4,eEe=5,tEe=6,rtt=7,stt=8,H5e=typeof self=="object"?self:globalThis,Oan=(n,e)=>{const t=(r,s)=>(n.set(s,r),r),i=r=>{if(n.has(r))return n.get(r);const[s,o]=e[r];switch(s){case gee:case itt:return t(o,r);case sK:{const a=t([],r);for(const l of o)a.push(i(l));return a}case oK:{const a=t({},r);for(const[l,c]of o)a[i(l)]=i(c);return a}case ZSe:return t(new Date(o),r);case JSe:{const{source:a,flags:l}=o;return t(new RegExp(a,l),r)}case eEe:{const a=t(new Map,r);for(const[l,c]of o)a.set(i(l),i(c));return a}case tEe:{const a=t(new Set,r);for(const l of o)a.add(i(l));return a}case rtt:{const{name:a,message:l}=o;return t(new H5e[a](l),r)}case stt:return t(BigInt(o),r);case"BigInt":return t(Object(BigInt(o)),r)}return t(new H5e[s](o),r)};return i},V5e=n=>Oan(new Map,n)(0),ED="",{toString:Man}={},{keys:jan}=Object,q5=n=>{const e=typeof n;if(e!=="object"||!n)return[gee,e];const t=Man.call(n).slice(8,-1);switch(t){case"Array":return[sK,ED];case"Object":return[oK,ED];case"Date":return[ZSe,ED];case"RegExp":return[JSe,ED];case"Map":return[eEe,ED];case"Set":return[tEe,ED]}return t.includes("Array")?[sK,t]:t.includes("Error")?[rtt,t]:[oK,t]},CV=([n,e])=>n===gee&&(e==="function"||e==="symbol"),Fan=(n,e,t,i)=>{const r=(o,a)=>{const l=i.push(o)-1;return t.set(a,l),l},s=o=>{if(t.has(o))return t.get(o);let[a,l]=q5(o);switch(a){case gee:{let u=o;switch(l){case"bigint":a=stt,u=o.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return r([itt],o)}return r([a,u],o)}case sK:{if(l)return r([l,[...o]],o);const u=[],d=r([a,u],o);for(const f of o)u.push(s(f));return d}case oK:{if(l)switch(l){case"BigInt":return r([l,o.toString()],o);case"Boolean":case"Number":case"String":return r([l,o.valueOf()],o)}if(e&&"toJSON"in o)return s(o.toJSON());const u=[],d=r([a,u],o);for(const f of jan(o))(n||!CV(q5(o[f])))&&u.push([s(f),s(o[f])]);return d}case ZSe:return r([a,o.toISOString()],o);case JSe:{const{source:u,flags:d}=o;return r([a,{source:u,flags:d}],o)}case eEe:{const u=[],d=r([a,u],o);for(const[f,p]of o)(n||!(CV(q5(f))||CV(q5(p))))&&u.push([s(f),s(p)]);return d}case tEe:{const u=[],d=r([a,u],o);for(const f of o)(n||!CV(q5(f)))&&u.push(s(f));return d}}const{message:c}=o;return r([a,{name:l,message:c}],o)};return s},W5e=(n,{json:e,lossy:t}={})=>{const i=[];return Fan(!(e||t),!!e,new Map,i)(n),i},UO=typeof structuredClone=="function"?(n,e)=>e&&("json"in e||"lossy"in e)?V5e(W5e(n,e)):structuredClone(n):(n,e)=>V5e(W5e(n,e));function Ban(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 $an(n,e){return"Back to reference "+(n+1)+(e>1?"-"+e:"")}function Han(n){const e=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",t=n.options.footnoteBackContent||Ban,i=n.options.footnoteBackLabel||$an,r=n.options.footnoteLabel||"Footnotes",s=n.options.footnoteLabelTagName||"h2",o=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(),f=k4(d.toLowerCase());let p=0;const g=[],m=n.footnoteCounts.get(d);for(;m!==void 0&&++p<=m;){g.length>0&&g.push({type:"text",value:" "});let b=typeof t=="string"?t:t(l,p);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(l,p),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const _=u[u.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const b=_.children[_.children.length-1];b&&b.type==="text"?b.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...g)}else u.push(...g);const v={type:"element",tagName:"li",properties:{id:e+"fn-"+f},children:n.wrap(u,!0)};n.patch(c,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...UO(o),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 ott=function(n){if(n==null)return Uan;if(typeof n=="function")return mee(n);if(typeof n=="object")return Array.isArray(n)?Van(n):Wan(n);if(typeof n=="string")return zan(n);throw new Error("Expected function, string, or object as test")};function Van(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=ott(n[t]);return mee(i);function i(...r){let s=-1;for(;++s<e.length;)if(e[s].apply(this,r))return!0;return!1}}function Wan(n){const e=n;return mee(t);function t(i){const r=i;let s;for(s in n)if(r[s]!==e[s])return!1;return!0}}function zan(n){return mee(e);function e(t){return t&&t.type===n}}function mee(n){return e;function e(t,i,r){return!!(qan(t)&&n.call(this,t,typeof i=="number"?i:void 0,r||void 0))}}function Uan(){return!0}function qan(n){return n!==null&&typeof n=="object"&&"type"in n}const att=[],Kan=!0,z5e=!1,Gan="skip";function Yan(n,e,t,i){let r;typeof e=="function"&&typeof t!="function"?(i=t,t=e):r=e;const s=ott(r),o=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 p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=att,g,m,_;if((!e||s(l,c,u[u.length-1]||void 0))&&(p=Qan(t(l,u)),p[0]===z5e))return p;if("children"in l&&l.children){const v=l;if(v.children&&p[0]!==Gan)for(m=(i?v.children.length:-1)+o,_=u.concat(v);m>-1&&m<v.children.length;){const b=v.children[m];if(g=a(b,m,_)(),g[0]===z5e)return g;m=typeof g[1]=="number"?g[1]:m+o}}return p}}}function Qan(n){return Array.isArray(n)?n:typeof n=="number"?[Kan,n]:n==null?att:[n]}function nEe(n,e,t,i){let r,s,o;typeof e=="function"&&typeof t!="function"?(s=void 0,o=e,r=t):(s=e,o=t,r=i),Yan(n,s,a,r);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return o(l,d,u)}}const Ape={}.hasOwnProperty,Xan={};function Zan(n,e){const t=e||Xan,i=new Map,r=new Map,s=new Map,o={...Pan,...t.handlers},a={all:c,applyData:eln,definitionById:i,footnoteById:r,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:t,patch:Jan,wrap:nln};return nEe(n,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?i:r,f=String(u.identifier).toUpperCase();d.has(f)||d.set(f,u)}}),a;function l(u,d){const f=u.type,p=a.handlers[f];if(Ape.call(a.handlers,f)&&p)return p(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in u){const{children:m,..._}=u,v=UO(_);return v.children=a.all(u),v}return UO(u)}return(a.options.unknownHandler||tln)(a,u,d)}function c(u){const d=[];if("children"in u){const f=u.children;let p=-1;for(;++p<f.length;){const g=a.one(f[p],u);if(g){if(p&&f[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=U5e(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=U5e(m.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function Jan(n,e){n.position&&(e.position=Prn(n))}function eln(n,e){let t=e;if(n&&n.data){const i=n.data.hName,r=n.data.hChildren,s=n.data.hProperties;if(typeof i=="string")if(t.type==="element")t.tagName=i;else{const o="children"in t?t.children:[t];t={type:"element",tagName:i,properties:{},children:o}}t.type==="element"&&s&&Object.assign(t.properties,UO(s)),"children"in t&&t.children&&r!==null&&r!==void 0&&(t.children=r)}return t}function tln(n,e){const t=e.data||{},i="value"in e&&!(Ape.call(t,"hProperties")||Ape.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 nln(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 U5e(n){let e=0,t=n.charCodeAt(e);for(;t===9||t===32;)e++,t=n.charCodeAt(e);return n.slice(e)}function q5e(n,e){const t=Zan(n,e),i=t.one(n,void 0),r=Han(t),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` `},r),s}function iln(n,e){return n&&"run"in n?async function(t,i){const r=q5e(t,{file:i,...e});await n.run(r,i)}:function(t,i){return q5e(t,{file:i,...n||e})}}function K5e(n){if(n)throw n}var mle,G5e;function rln(){if(G5e)return mle;G5e=1;var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},s=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var u=n.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&n.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var f;for(f in c);return typeof f>"u"||n.call(c,f)},o=function(c,u){t&&u.name==="__proto__"?t(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(n.call(c,u)){if(i)return i(c,u).value}else return;return c[u]};return mle=function l(){var c,u,d,f,p,g,m=arguments[0],_=1,v=arguments.length,b=!1;for(typeof m=="boolean"&&(b=m,m=arguments[1]||{},_=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});_<v;++_)if(c=arguments[_],c!=null)for(u in c)d=a(m,u),f=a(c,u),m!==f&&(b&&f&&(s(f)||(p=r(f)))?(p?(p=!1,g=d&&r(d)?d:[]):g=d&&s(d)?d:{},o(m,{name:u,newValue:l(b,g,f)})):typeof f<"u"&&o(m,{name:u,newValue:f}));return m},mle}var sln=rln();const _le=Cl(sln);function Npe(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 oln(){const n=[],e={run:t,use:i};return e;function t(...r){let s=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...r);function a(l,...c){const u=n[++s];let d=-1;if(l){o(l);return}for(;++d<r.length;)(c[d]===null||c[d]===void 0)&&(c[d]=r[d]);r=c,u?aln(u,a)(...c):o(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 aln(n,e){let t;return i;function i(...o){const a=n.length>o.length;let l;a&&o.push(r);try{l=n.apply(this,o)}catch(c){const u=c;if(a&&t)throw u;return r(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,r):l instanceof Error?r(l):s(l))}function r(o,...a){t||(t=!0,e(o,...a))}function s(o){r(null,o)}}const H0={basename:lln,dirname:cln,extname:uln,join:dln,sep:"/"};function lln(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');k9(n);let t=0,i=-1,r=n.length,s;if(e===void 0||e.length===0||e.length>n.length){for(;r--;)if(n.codePointAt(r)===47){if(s){t=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":n.slice(t,i)}if(e===n)return"";let o=-1,a=e.length-1;for(;r--;)if(n.codePointAt(r)===47){if(s){t=r+1;break}}else o<0&&(s=!0,o=r+1),a>-1&&(n.codePointAt(r)===e.codePointAt(a--)?a<0&&(i=r):(a=-1,i=o));return t===i?i=o:i<0&&(i=n.length),n.slice(t,i)}function cln(n){if(k9(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 uln(n){k9(n);let e=n.length,t=-1,i=0,r=-1,s=0,o;for(;e--;){const a=n.codePointAt(e);if(a===47){if(o){i=e+1;break}continue}t<0&&(o=!0,t=e+1),a===46?r<0?r=e:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||t<0||s===0||s===1&&r===t-1&&r===i+1?"":n.slice(r,t)}function dln(...n){let e=-1,t;for(;++e<n.length;)k9(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":hln(t)}function hln(n){k9(n);const e=n.codePointAt(0)===47;let t=fln(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function fln(n,e){let t="",i=0,r=-1,s=0,o=-1,a,l;for(;++o<=n.length;){if(o<n.length)a=n.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(r===o-1||s===1))if(r!==o-1&&s===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=o,s=0;continue}}else if(t.length>0){t="",i=0,r=o,s=0;continue}}e&&(t=t.length>0?t+"/..":"..",i=2)}else t.length>0?t+="/"+n.slice(r+1,o):t=n.slice(r+1,o),i=o-r-1;r=o,s=0}else a===46&&s>-1?s++:s=-1}return t}function k9(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const pln={cwd:gln};function gln(){return"/"}function Dpe(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function mln(n){if(typeof n=="string")n=new URL(n);else if(!Dpe(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 _ln(n)}function _ln(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 vle=["history","path","basename","stem","extname","dirname"];class ltt{constructor(e){let t;e?Dpe(e)?t={path:e}:typeof e=="string"||vln(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":pln.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<vle.length;){const s=vle[i];s in t&&t[s]!==void 0&&t[s]!==null&&(this[s]=s==="history"?[...t[s]]:t[s])}let r;for(r in t)vle.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path=="string"?H0.basename(this.path):void 0}set basename(e){yle(e,"basename"),ble(e,"basename"),this.path=H0.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?H0.dirname(this.path):void 0}set dirname(e){Y5e(this.basename,"dirname"),this.path=H0.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?H0.extname(this.path):void 0}set extname(e){if(ble(e,"extname"),Y5e(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=H0.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Dpe(e)&&(e=mln(e)),yle(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?H0.basename(this.path,this.extname):void 0}set stem(e){yle(e,"stem"),ble(e,"stem"),this.path=H0.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 bf(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 ble(n,e){if(n&&n.includes(H0.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+H0.sep+"`")}function yle(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function Y5e(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function vln(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const bln=function(n){const i=this.constructor.prototype,r=i[n],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,i),s},yln={}.hasOwnProperty;class iEe extends bln{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=oln()}copy(){const e=new iEe;let t=-1;for(;++t<this.attachers.length;){const i=this.attachers[t];e.use(...i)}return e.data(_le(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(xle("data",this.frozen),this.namespace[e]=t,this):yln.call(this.namespace,e)&&this.namespace[e]||void 0:e?(xle("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=wV(e),i=this.parser||this.Parser;return Cle("parse",i),i(String(t),t)}process(e,t){const i=this;return this.freeze(),Cle("process",this.parser||this.Parser),wle("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(s,o){const a=wV(e),l=i.parse(a);i.run(l,a,function(u,d,f){if(u||!d||!f)return c(u);const p=d,g=i.stringify(p,f);xln(g)?f.value=g:f.result=g,c(u,f)});function c(u,d){u||!d?o(u):s?s(d):t(void 0,d)}}}processSync(e){let t=!1,i;return this.freeze(),Cle("processSync",this.parser||this.Parser),wle("processSync",this.compiler||this.Compiler),this.process(e,r),X5e("processSync","process",t),i;function r(s,o){t=!0,K5e(s),i=o}}run(e,t,i){Q5e(e),this.freeze();const r=this.transformers;return!i&&typeof t=="function"&&(i=t,t=void 0),i?s(void 0,i):new Promise(s);function s(o,a){const l=wV(t);r.run(e,l,c);function c(u,d,f){const p=d||e;u?a(u):o?o(p):i(void 0,p,f)}}}runSync(e,t){let i=!1,r;return this.run(e,t,s),X5e("runSync","run",i),r;function s(o,a){K5e(o),r=a,i=!0}}stringify(e,t){this.freeze();const i=wV(t),r=this.compiler||this.Compiler;return wle("stringify",r),Q5e(e),r(e,i)}use(e,...t){const i=this.attachers,r=this.namespace;if(xle("use",this.frozen),e!=null)if(typeof e=="function")l(e,t);else if(typeof e=="object")Array.isArray(e)?a(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(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=_le(!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];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<i.length;)if(i[d][0]===c){f=d;break}if(f===-1)i.push([c,...u]);else if(u.length>0){let[p,...g]=u;const m=i[f][1];Npe(m)&&Npe(p)&&(p=_le(!0,m,p)),i[f]=[c,p,...g]}}}}const Cln=new iEe().freeze();function Cle(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function wle(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function xle(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 Q5e(n){if(!Npe(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function X5e(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function wV(n){return wln(n)?n:new ltt(n)}function wln(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function xln(n){return typeof n=="string"||Sln(n)}function Sln(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Eln="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Z5e=[],J5e={allowDangerousHtml:!0},kln=/^(https?|ircs?|mailto|xmpp)$/i,Tln=[{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:"className",id:"remove-classname"},{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 Iln(n){const e=Lln(n),t=Aln(n);return Nln(e.runSync(e.parse(t),t),n)}function Lln(n){const e=n.rehypePlugins||Z5e,t=n.remarkPlugins||Z5e,i=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...J5e}:J5e;return Cln().use(lan).use(t).use(iln,i).use(e)}function Aln(n){const e=n.children||"",t=new ltt;return typeof e=="string"&&(t.value=e),t}function Nln(n,e){const t=e.allowedElements,i=e.allowElement,r=e.components,s=e.disallowedElements,o=e.skipHtml,a=e.unwrapDisallowed,l=e.urlTransform||Dln;for(const u of Tln)Object.hasOwn(e,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+Eln+u.id,void 0);return nEe(n,c),$rn(n,{Fragment:h.Fragment,components:r,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return o?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in fle)if(Object.hasOwn(fle,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],m=fle[p];(m===null||m.includes(u.tagName))&&(u.properties[p]=l(String(g||""),p,u))}}if(u.type==="element"){let p=t?!t.includes(u.tagName):s?s.includes(u.tagName):!1;if(!p&&i&&typeof d=="number"&&(p=!i(u,d,f)),p&&f&&typeof d=="number")return a&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function Dln(n){const e=n.indexOf(":"),t=n.indexOf("?"),i=n.indexOf("#"),r=n.indexOf("/");return e===-1||r!==-1&&e>r||t!==-1&&e>t||i!==-1&&e>i||kln.test(n.slice(0,e))?n:""}const eje=/[#.]/g;function Rln(n,e){const t=n||"",i={};let r=0,s,o;for(;r<t.length;){eje.lastIndex=r;const a=eje.exec(t),l=t.slice(r,a?a.index:t.length);l&&(s?s==="#"?i.id=l:Array.isArray(i.className)?i.className.push(l):i.className=[l]:o=l,r+=l.length),a&&(s=a[0],r++)}return{type:"element",tagName:o||e||"div",properties:i,children:[]}}const Pln=new Set(["button","menu","reset","submit"]),Rpe={}.hasOwnProperty;function ctt(n,e,t){const i=t&&Fln(t);function r(s,o,...a){let l=-1,c;if(s==null){c={type:"root",children:[]};const u=o;a.unshift(u)}else if(c=Rln(s,e),c.tagName=c.tagName.toLowerCase(),i&&Rpe.call(i,c.tagName)&&(c.tagName=i[c.tagName]),Oln(o,c.tagName)){let u;for(u in o)Rpe.call(o,u)&&Mln(n,c.properties,u,o[u])}else a.unshift(o);for(;++l<a.length;)Ppe(c.children,a[l]);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return r}function Oln(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"?Pln.has(n.type.toLowerCase()):!("value"in n)}function Mln(n,e,t,i){const r=hee(n,t);let s=-1,o;if(i!=null){if(typeof i=="number"){if(Number.isNaN(i))return;o=i}else typeof i=="boolean"?o=i:typeof i=="string"?r.spaceSeparated?o=y5e(i):r.commaSeparated?o=g5e(i):r.commaOrSpaceSeparated?o=y5e(g5e(i).join(" ")):o=tje(r,r.property,i):Array.isArray(i)?o=i.concat():o=r.property==="style"?jln(i):String(i);if(Array.isArray(o)){const a=[];for(;++s<o.length;){const l=tje(r,r.property,o[s]);a[s]=l}o=a}if(r.property==="className"&&Array.isArray(e.className)){const a=o;o=e.className.concat(a)}e[r.property]=o}}function Ppe(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;)Ppe(n,e[t]);else if(typeof e=="object"&&"type"in e)e.type==="root"?Ppe(n,e.children):n.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function tje(n,e,t){if(typeof t=="string"){if(n.number&&t&&!Number.isNaN(Number(t)))return Number(t);if((n.boolean||n.overloadedBoolean)&&(t===""||V8(t)===V8(e)))return!0}return t}function jln(n){const e=[];let t;for(t in n)Rpe.call(n,t)&&e.push([t,n[t]].join(": "));return e.join("; ")}function Fln(n){const e={};let t=-1;for(;++t<n.length;)e[n[t].toLowerCase()]=n[t];return e}const Bln=["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"],$ln=ctt(E9,"div"),Hln=ctt(Ek,"g",Bln);function Vln(n){const e=String(n),t=[];return{toOffset:r,toPoint:i};function i(s){if(typeof s=="number"&&s>-1&&s<=e.length){let o=0;for(;;){let a=t[o];if(a===void 0){const l=nje(e,t[o-1]);a=l===-1?e.length+1:l+1,t[o]=a}if(a>s)return{line:o+1,column:s-(o>0?t[o-1]:0)+1,offset:s};o++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;t.length<s.line;){const a=t[t.length-1],l=nje(e,a),c=l===-1?e.length+1:l+1;if(a===c)break;t.push(c)}const o=(s.line>1?t[s.line-2]:0)+s.column-1;if(o<t[s.line-1])return o}}}function nje(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 z2={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/"},utt={}.hasOwnProperty,Wln=Object.prototype;function zln(n,e){const t=e||{};return rEe({file:t.file||void 0,location:!1,schema:t.space==="svg"?Ek:E9,verbose:t.verbose||!1},n)}function rEe(n,e){let t;switch(e.nodeName){case"#comment":{const i=e;return t={type:"comment",value:i.data},Bz(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:dtt(n,e.childNodes),data:{quirksMode:r}},n.file&&n.location){const s=String(n.file),o=Vln(s),a=o.toPoint(0),l=o.toPoint(s.length);t.position={start:a,end:l}}return t}case"#documentType":{const i=e;return t={type:"doctype"},Bz(n,i,t),t}case"#text":{const i=e;return t={type:"text",value:i.value},Bz(n,i,t),t}default:return t=Uln(n,e),t}}function dtt(n,e){let t=-1;const i=[];for(;++t<e.length;){const r=rEe(n,e[t]);i.push(r)}return i}function Uln(n,e){const t=n.schema;n.schema=e.namespaceURI===z2.svg?Ek:E9;let i=-1;const r={};for(;++i<e.attrs.length;){const a=e.attrs[i],l=(a.prefix?a.prefix+":":"")+a.name;utt.call(Wln,l)||(r[l]=a.value)}const o=(n.schema.space==="svg"?Hln:$ln)(e.tagName,r,dtt(n,e.childNodes));if(Bz(n,e,o),o.tagName==="template"){const a=e,l=a.sourceCodeLocation,c=l&&l.startTag&&CR(l.startTag),u=l&&l.endTag&&CR(l.endTag),d=rEe(n,a.content);c&&u&&n.file&&(d.position={start:c.end,end:u.start}),o.content=d}return n.schema=t,o}function Bz(n,e,t){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&n.file){const i=qln(n,t,e.sourceCodeLocation);i&&(n.location=!0,t.position=i)}}function qln(n,e,t){const i=CR(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 s={};let o;if(t.attrs)for(o in t.attrs)utt.call(t.attrs,o)&&(s[hee(n.schema,o).property]=CR(t.attrs[o]));t.startTag;const a=CR(t.startTag),l=t.endTag?CR(t.endTag):void 0,c={opening:a};l&&(c.closing=l),c.properties=s,e.data={position:c}}}return i}function CR(n){const e=ije({line:n.startLine,column:n.startCol,offset:n.startOffset}),t=ije({line:n.endLine,column:n.endCol,offset:n.endOffset});return e||t?{start:e,end:t}:void 0}function ije(n){return n.line&&n.column?n:void 0}const rje={}.hasOwnProperty;function htt(n,e){const t=e||{};function i(r,...s){let o=i.invalid;const a=i.handlers;if(r&&rje.call(r,n)){const l=String(r[n]);o=rje.call(a,l)?a[l]:i.unknown}if(o)return o.call(this,r,...s)}return i.handlers=t.handlers||{},i.invalid=t.invalid,i.unknown=t.unknown,i}const Kln={},Gln={}.hasOwnProperty,ftt=htt("type",{handlers:{root:Qln,element:tcn,text:Jln,comment:ecn,doctype:Zln}});function Yln(n,e){const i=(e||Kln).space;return ftt(n,i==="svg"?Ek:E9)}function Qln(n,e){const t={nodeName:"#document",mode:(n.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return t.childNodes=sEe(n.children,t,e),T4(n,t),t}function Xln(n,e){const t={nodeName:"#document-fragment",childNodes:[]};return t.childNodes=sEe(n.children,t,e),T4(n,t),t}function Zln(n){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return T4(n,e),e}function Jln(n){const e={nodeName:"#text",value:n.value,parentNode:null};return T4(n,e),e}function ecn(n){const e={nodeName:"#comment",data:n.value,parentNode:null};return T4(n,e),e}function tcn(n,e){const t=e;let i=t;n.type==="element"&&n.tagName.toLowerCase()==="svg"&&t.space==="html"&&(i=Ek);const r=[];let s;if(n.properties){for(s in n.properties)if(s!=="children"&&Gln.call(n.properties,s)){const l=ncn(i,s,n.properties[s]);l&&r.push(l)}}const o=i.space,a={nodeName:n.tagName,tagName:n.tagName,attrs:r,namespaceURI:z2[o],childNodes:[],parentNode:null};return a.childNodes=sEe(n.children,a,i),T4(n,a),n.tagName==="template"&&n.content&&(a.content=Xln(n.content,i)),a}function ncn(n,e,t){const i=hee(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?Tet(t):Met(t));const r={name:i.attribute,value:t===!0?"":String(t)};if(i.space&&i.space!=="html"&&i.space!=="svg"){const s=r.name.indexOf(":");s<0?r.prefix="":(r.name=r.name.slice(s+1),r.prefix=i.attribute.slice(0,s)),r.namespace=z2[i.space]}return r}function sEe(n,e,t){let i=-1;const r=[];if(n)for(;++i<n.length;){const s=ftt(n[i],t);s.parentNode=e,r.push(s)}return r}function T4(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 icn=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],rcn=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]),ac="�";var Re;(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"})(Re=Re||(Re={}));const Rp={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function ptt(n){return n>=55296&&n<=57343}function scn(n){return n>=56320&&n<=57343}function ocn(n,e){return(n-55296)*1024+9216+e}function gtt(n){return n!==32&&n!==10&&n!==13&&n!==9&&n!==12&&n>=1&&n<=31||n>=127&&n<=159}function mtt(n){return n>=64976&&n<=65007||rcn.has(n)}var fn;(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"})(fn=fn||(fn={}));const acn=65536;class lcn{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=acn,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(scn(t))return this.pos++,this._addGap(),ocn(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Re.EOF;return this._err(fn.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,Re.EOF;const i=this.html.charCodeAt(t);return i===Re.CARRIAGE_RETURN?Re.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,Re.EOF;let e=this.html.charCodeAt(this.pos);return e===Re.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Re.LINE_FEED):e===Re.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ptt(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===Re.LINE_FEED||e===Re.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){gtt(e)?this._err(fn.controlCharacterInInputStream):mtt(e)&&this._err(fn.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var fo;(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"})(fo=fo||(fo={}));function _tt(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 eS=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୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢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;怳Ādpuct;戏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ǣጓ\0y;䐎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Ā;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀ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Ā;elƀ;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\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»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ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀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℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proø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;䅓Ācrir;榿;쀀𝔬ͯ\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\0m;櫳;櫽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))),ccn=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(n=>n.charCodeAt(0)));var Sle;const ucn=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]]),dcn=(Sle=String.fromCodePoint)!==null&&Sle!==void 0?Sle: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 hcn(n){var e;return n>=55296&&n<=57343||n>1114111?65533:(e=ucn.get(n))!==null&&e!==void 0?e:n}var zd;(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"})(zd||(zd={}));const fcn=32;var Ey;(function(n){n[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE"})(Ey||(Ey={}));function Ope(n){return n>=zd.ZERO&&n<=zd.NINE}function pcn(n){return n>=zd.UPPER_A&&n<=zd.UPPER_F||n>=zd.LOWER_A&&n<=zd.LOWER_F}function gcn(n){return n>=zd.UPPER_A&&n<=zd.UPPER_Z||n>=zd.LOWER_A&&n<=zd.LOWER_Z||Ope(n)}function mcn(n){return n===zd.EQUALS||gcn(n)}var Nd;(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"})(Nd||(Nd={}));var g2;(function(n){n[n.Legacy=0]="Legacy",n[n.Strict=1]="Strict",n[n.Attribute=2]="Attribute"})(g2||(g2={}));class _cn{constructor(e,t,i){this.decodeTree=e,this.emitCodePoint=t,this.errors=i,this.state=Nd.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=g2.Strict}startEntity(e){this.decodeMode=e,this.state=Nd.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Nd.EntityStart:return e.charCodeAt(t)===zd.NUM?(this.state=Nd.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Nd.NamedEntity,this.stateNamedEntity(e,t));case Nd.NumericStart:return this.stateNumericStart(e,t);case Nd.NumericDecimal:return this.stateNumericDecimal(e,t);case Nd.NumericHex:return this.stateNumericHex(e,t);case Nd.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|fcn)===zd.LOWER_X?(this.state=Nd.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Nd.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,i,r){if(t!==i){const s=i-t;this.result=this.result*Math.pow(r,s)+parseInt(e.substr(t,s),r),this.consumed+=s}}stateNumericHex(e,t){const i=t;for(;t<e.length;){const r=e.charCodeAt(t);if(Ope(r)||pcn(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(Ope(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===zd.SEMI)this.consumed+=1;else if(this.decodeMode===g2.Strict)return 0;return this.emitCodePoint(hcn(this.result),this.consumed),this.errors&&(e!==zd.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:i}=this;let r=i[this.treeIndex],s=(r&Ey.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const o=e.charCodeAt(t);if(this.treeIndex=btt(i,r,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===g2.Attribute&&(s===0||mcn(o))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],s=(r&Ey.VALUE_LENGTH)>>14,s!==0){if(o===zd.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==g2.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]&Ey.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]&~Ey.VALUE_LENGTH:r[e+1],i),t===3&&this.emitCodePoint(r[e+2],i),i}end(){var e;switch(this.state){case Nd.NamedEntity:return this.result!==0&&(this.decodeMode!==g2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Nd.NumericDecimal:return this.emitNumericEntity(0,2);case Nd.NumericHex:return this.emitNumericEntity(0,3);case Nd.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Nd.EntityStart:return 0}}}function vtt(n){let e="";const t=new _cn(n,i=>e+=dcn(i));return function(r,s){let o=0,a=0;for(;(a=r.indexOf("&",a))>=0;){e+=r.slice(o,a),t.startEntity(s);const c=t.write(r,a+1);if(c<0){o=a+t.end();break}o=a+c,a=c===0?o+1:o}const l=e+r.slice(o);return e="",l}}function btt(n,e,t,i){const r=(e&Ey.BRANCH_LENGTH)>>7,s=e&Ey.JUMP_TABLE;if(r===0)return s!==0&&i===s?t:-1;if(s){const l=i-s;return l<0||l>=r?-1:n[t+l]-1}let o=t,a=o+r-1;for(;o<=a;){const l=o+a>>>1,c=n[l];if(c<i)o=l+1;else if(c>i)a=l-1;else return n[l+r]}return-1}vtt(eS);vtt(ccn);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 iE;(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"})(iE=iE||(iE={}));var sm;(function(n){n.NO_QUIRKS="no-quirks",n.QUIRKS="quirks",n.LIMITED_QUIRKS="limited-quirks"})(sm=sm||(sm={}));var Wt;(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"})(Wt=Wt||(Wt={}));var K;(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"})(K=K||(K={}));const vcn=new Map([[Wt.A,K.A],[Wt.ADDRESS,K.ADDRESS],[Wt.ANNOTATION_XML,K.ANNOTATION_XML],[Wt.APPLET,K.APPLET],[Wt.AREA,K.AREA],[Wt.ARTICLE,K.ARTICLE],[Wt.ASIDE,K.ASIDE],[Wt.B,K.B],[Wt.BASE,K.BASE],[Wt.BASEFONT,K.BASEFONT],[Wt.BGSOUND,K.BGSOUND],[Wt.BIG,K.BIG],[Wt.BLOCKQUOTE,K.BLOCKQUOTE],[Wt.BODY,K.BODY],[Wt.BR,K.BR],[Wt.BUTTON,K.BUTTON],[Wt.CAPTION,K.CAPTION],[Wt.CENTER,K.CENTER],[Wt.CODE,K.CODE],[Wt.COL,K.COL],[Wt.COLGROUP,K.COLGROUP],[Wt.DD,K.DD],[Wt.DESC,K.DESC],[Wt.DETAILS,K.DETAILS],[Wt.DIALOG,K.DIALOG],[Wt.DIR,K.DIR],[Wt.DIV,K.DIV],[Wt.DL,K.DL],[Wt.DT,K.DT],[Wt.EM,K.EM],[Wt.EMBED,K.EMBED],[Wt.FIELDSET,K.FIELDSET],[Wt.FIGCAPTION,K.FIGCAPTION],[Wt.FIGURE,K.FIGURE],[Wt.FONT,K.FONT],[Wt.FOOTER,K.FOOTER],[Wt.FOREIGN_OBJECT,K.FOREIGN_OBJECT],[Wt.FORM,K.FORM],[Wt.FRAME,K.FRAME],[Wt.FRAMESET,K.FRAMESET],[Wt.H1,K.H1],[Wt.H2,K.H2],[Wt.H3,K.H3],[Wt.H4,K.H4],[Wt.H5,K.H5],[Wt.H6,K.H6],[Wt.HEAD,K.HEAD],[Wt.HEADER,K.HEADER],[Wt.HGROUP,K.HGROUP],[Wt.HR,K.HR],[Wt.HTML,K.HTML],[Wt.I,K.I],[Wt.IMG,K.IMG],[Wt.IMAGE,K.IMAGE],[Wt.INPUT,K.INPUT],[Wt.IFRAME,K.IFRAME],[Wt.KEYGEN,K.KEYGEN],[Wt.LABEL,K.LABEL],[Wt.LI,K.LI],[Wt.LINK,K.LINK],[Wt.LISTING,K.LISTING],[Wt.MAIN,K.MAIN],[Wt.MALIGNMARK,K.MALIGNMARK],[Wt.MARQUEE,K.MARQUEE],[Wt.MATH,K.MATH],[Wt.MENU,K.MENU],[Wt.META,K.META],[Wt.MGLYPH,K.MGLYPH],[Wt.MI,K.MI],[Wt.MO,K.MO],[Wt.MN,K.MN],[Wt.MS,K.MS],[Wt.MTEXT,K.MTEXT],[Wt.NAV,K.NAV],[Wt.NOBR,K.NOBR],[Wt.NOFRAMES,K.NOFRAMES],[Wt.NOEMBED,K.NOEMBED],[Wt.NOSCRIPT,K.NOSCRIPT],[Wt.OBJECT,K.OBJECT],[Wt.OL,K.OL],[Wt.OPTGROUP,K.OPTGROUP],[Wt.OPTION,K.OPTION],[Wt.P,K.P],[Wt.PARAM,K.PARAM],[Wt.PLAINTEXT,K.PLAINTEXT],[Wt.PRE,K.PRE],[Wt.RB,K.RB],[Wt.RP,K.RP],[Wt.RT,K.RT],[Wt.RTC,K.RTC],[Wt.RUBY,K.RUBY],[Wt.S,K.S],[Wt.SCRIPT,K.SCRIPT],[Wt.SECTION,K.SECTION],[Wt.SELECT,K.SELECT],[Wt.SOURCE,K.SOURCE],[Wt.SMALL,K.SMALL],[Wt.SPAN,K.SPAN],[Wt.STRIKE,K.STRIKE],[Wt.STRONG,K.STRONG],[Wt.STYLE,K.STYLE],[Wt.SUB,K.SUB],[Wt.SUMMARY,K.SUMMARY],[Wt.SUP,K.SUP],[Wt.TABLE,K.TABLE],[Wt.TBODY,K.TBODY],[Wt.TEMPLATE,K.TEMPLATE],[Wt.TEXTAREA,K.TEXTAREA],[Wt.TFOOT,K.TFOOT],[Wt.TD,K.TD],[Wt.TH,K.TH],[Wt.THEAD,K.THEAD],[Wt.TITLE,K.TITLE],[Wt.TR,K.TR],[Wt.TRACK,K.TRACK],[Wt.TT,K.TT],[Wt.U,K.U],[Wt.UL,K.UL],[Wt.SVG,K.SVG],[Wt.VAR,K.VAR],[Wt.WBR,K.WBR],[Wt.XMP,K.XMP]]);function I4(n){var e;return(e=vcn.get(n))!==null&&e!==void 0?e:K.UNKNOWN}const pi=K,bcn={[Nn.HTML]:new Set([pi.ADDRESS,pi.APPLET,pi.AREA,pi.ARTICLE,pi.ASIDE,pi.BASE,pi.BASEFONT,pi.BGSOUND,pi.BLOCKQUOTE,pi.BODY,pi.BR,pi.BUTTON,pi.CAPTION,pi.CENTER,pi.COL,pi.COLGROUP,pi.DD,pi.DETAILS,pi.DIR,pi.DIV,pi.DL,pi.DT,pi.EMBED,pi.FIELDSET,pi.FIGCAPTION,pi.FIGURE,pi.FOOTER,pi.FORM,pi.FRAME,pi.FRAMESET,pi.H1,pi.H2,pi.H3,pi.H4,pi.H5,pi.H6,pi.HEAD,pi.HEADER,pi.HGROUP,pi.HR,pi.HTML,pi.IFRAME,pi.IMG,pi.INPUT,pi.LI,pi.LINK,pi.LISTING,pi.MAIN,pi.MARQUEE,pi.MENU,pi.META,pi.NAV,pi.NOEMBED,pi.NOFRAMES,pi.NOSCRIPT,pi.OBJECT,pi.OL,pi.P,pi.PARAM,pi.PLAINTEXT,pi.PRE,pi.SCRIPT,pi.SECTION,pi.SELECT,pi.SOURCE,pi.STYLE,pi.SUMMARY,pi.TABLE,pi.TBODY,pi.TD,pi.TEMPLATE,pi.TEXTAREA,pi.TFOOT,pi.TH,pi.THEAD,pi.TITLE,pi.TR,pi.TRACK,pi.UL,pi.WBR,pi.XMP]),[Nn.MATHML]:new Set([pi.MI,pi.MO,pi.MN,pi.MS,pi.MTEXT,pi.ANNOTATION_XML]),[Nn.SVG]:new Set([pi.TITLE,pi.FOREIGN_OBJECT,pi.DESC]),[Nn.XLINK]:new Set,[Nn.XML]:new Set,[Nn.XMLNS]:new Set};function ytt(n){return n===pi.H1||n===pi.H2||n===pi.H3||n===pi.H4||n===pi.H5||n===pi.H6}Wt.STYLE,Wt.SCRIPT,Wt.XMP,Wt.IFRAME,Wt.NOEMBED,Wt.NOFRAMES,Wt.PLAINTEXT;const ycn=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 He;(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"})(He||(He={}));const fu={DATA:He.DATA,RCDATA:He.RCDATA,RAWTEXT:He.RAWTEXT,SCRIPT_DATA:He.SCRIPT_DATA,PLAINTEXT:He.PLAINTEXT,CDATA_SECTION:He.CDATA_SECTION};function $F(n){return n>=Re.DIGIT_0&&n<=Re.DIGIT_9}function Wj(n){return n>=Re.LATIN_CAPITAL_A&&n<=Re.LATIN_CAPITAL_Z}function Ccn(n){return n>=Re.LATIN_SMALL_A&&n<=Re.LATIN_SMALL_Z}function tS(n){return Ccn(n)||Wj(n)}function Mpe(n){return tS(n)||$F(n)}function Ctt(n){return n>=Re.LATIN_CAPITAL_A&&n<=Re.LATIN_CAPITAL_F}function wtt(n){return n>=Re.LATIN_SMALL_A&&n<=Re.LATIN_SMALL_F}function wcn(n){return $F(n)||Ctt(n)||wtt(n)}function xV(n){return n+32}function xtt(n){return n===Re.SPACE||n===Re.LINE_FEED||n===Re.TABULATION||n===Re.FORM_FEED}function xcn(n){return n===Re.EQUALS_SIGN||Mpe(n)}function sje(n){return xtt(n)||n===Re.SOLIDUS||n===Re.GREATER_THAN_SIGN}class Scn{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=He.DATA,this.returnState=He.DATA,this.charRefCode=-1,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new lcn(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:fo.START_TAG,tagName:"",tagID:K.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:fo.END_TAG,tagName:"",tagID:K.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:fo.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:fo.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(_tt(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(fn.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=I4(e.tagName),e.type===fo.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(fn.endTagWithAttributes),e.selfClosing&&this._err(fn.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 fo.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case fo.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case fo.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:fo.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=xtt(e)?fo.WHITESPACE_CHARACTER:e===Re.NULL?fo.NULL_CHARACTER:fo.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(fo.CHARACTER,e)}_matchNamedCharacterReference(e){let t=null,i=0,r=!1;for(let s=0,o=eS[0];s>=0&&(s=btt(eS,o,s+1,e),!(s<0));e=this._consume()){i+=1,o=eS[s];const a=o&Ey.VALUE_LENGTH;if(a){const l=(a>>14)-1;if(e!==Re.SEMICOLON&&this._isCharacterReferenceInAttribute()&&xcn(this.preprocessor.peek(1))?(t=[Re.AMPERSAND],s+=l):(t=l===0?[eS[s]&~Ey.VALUE_LENGTH]:l===1?[eS[++s]]:[eS[++s],eS[++s]],i=0,r=e!==Re.SEMICOLON),l===0){this._consume();break}}}return this._unconsume(i),r&&!this.preprocessor.endOfChunkHit&&this._err(fn.missingSemicolonAfterCharacterReference),this._unconsume(1),t}_isCharacterReferenceInAttribute(){return this.returnState===He.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===He.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===He.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case He.DATA:{this._stateData(e);break}case He.RCDATA:{this._stateRcdata(e);break}case He.RAWTEXT:{this._stateRawtext(e);break}case He.SCRIPT_DATA:{this._stateScriptData(e);break}case He.PLAINTEXT:{this._statePlaintext(e);break}case He.TAG_OPEN:{this._stateTagOpen(e);break}case He.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case He.TAG_NAME:{this._stateTagName(e);break}case He.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case He.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case He.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case He.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case He.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case He.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case He.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case He.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case He.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case He.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case He.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case He.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case He.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case He.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case He.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case He.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case He.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case He.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case He.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case He.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case He.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case He.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case He.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case He.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case He.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case He.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case He.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case He.BOGUS_COMMENT:{this._stateBogusComment(e);break}case He.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case He.COMMENT_START:{this._stateCommentStart(e);break}case He.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case He.COMMENT:{this._stateComment(e);break}case He.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case He.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case He.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case He.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case He.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case He.COMMENT_END:{this._stateCommentEnd(e);break}case He.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case He.DOCTYPE:{this._stateDoctype(e);break}case He.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case He.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case He.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case He.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case He.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case He.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case He.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case He.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case He.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case He.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case He.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case He.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case He.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case He.CDATA_SECTION:{this._stateCdataSection(e);break}case He.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case He.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case He.CHARACTER_REFERENCE:{this._stateCharacterReference(e);break}case He.NAMED_CHARACTER_REFERENCE:{this._stateNamedCharacterReference(e);break}case He.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}case He.NUMERIC_CHARACTER_REFERENCE:{this._stateNumericCharacterReference(e);break}case He.HEXADEMICAL_CHARACTER_REFERENCE_START:{this._stateHexademicalCharacterReferenceStart(e);break}case He.HEXADEMICAL_CHARACTER_REFERENCE:{this._stateHexademicalCharacterReference(e);break}case He.DECIMAL_CHARACTER_REFERENCE:{this._stateDecimalCharacterReference(e);break}case He.NUMERIC_CHARACTER_REFERENCE_END:{this._stateNumericCharacterReferenceEnd(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Re.LESS_THAN_SIGN:{this.state=He.TAG_OPEN;break}case Re.AMPERSAND:{this.returnState=He.DATA,this.state=He.CHARACTER_REFERENCE;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this._emitCodePoint(e);break}case Re.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case Re.AMPERSAND:{this.returnState=He.RCDATA,this.state=He.CHARACTER_REFERENCE;break}case Re.LESS_THAN_SIGN:{this.state=He.RCDATA_LESS_THAN_SIGN;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this._emitChars(ac);break}case Re.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case Re.LESS_THAN_SIGN:{this.state=He.RAWTEXT_LESS_THAN_SIGN;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this._emitChars(ac);break}case Re.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case Re.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_LESS_THAN_SIGN;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this._emitChars(ac);break}case Re.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case Re.NULL:{this._err(fn.unexpectedNullCharacter),this._emitChars(ac);break}case Re.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(tS(e))this._createStartTagToken(),this.state=He.TAG_NAME,this._stateTagName(e);else switch(e){case Re.EXCLAMATION_MARK:{this.state=He.MARKUP_DECLARATION_OPEN;break}case Re.SOLIDUS:{this.state=He.END_TAG_OPEN;break}case Re.QUESTION_MARK:{this._err(fn.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=He.BOGUS_COMMENT,this._stateBogusComment(e);break}case Re.EOF:{this._err(fn.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(fn.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=He.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(tS(e))this._createEndTagToken(),this.state=He.TAG_NAME,this._stateTagName(e);else switch(e){case Re.GREATER_THAN_SIGN:{this._err(fn.missingEndTagName),this.state=He.DATA;break}case Re.EOF:{this._err(fn.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(fn.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=He.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const t=this.currentToken;switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:{this.state=He.BEFORE_ATTRIBUTE_NAME;break}case Re.SOLIDUS:{this.state=He.SELF_CLOSING_START_TAG;break}case Re.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentTagToken();break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),t.tagName+=ac;break}case Re.EOF:{this._err(fn.eofInTag),this._emitEOFToken();break}default:t.tagName+=String.fromCodePoint(Wj(e)?xV(e):e)}}_stateRcdataLessThanSign(e){e===Re.SOLIDUS?this.state=He.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=He.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){tS(e)?(this.state=He.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=He.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 Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=He.BEFORE_ATTRIBUTE_NAME,!1;case Re.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=He.SELF_CLOSING_START_TAG,!1;case Re.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=He.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=He.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===Re.SOLIDUS?this.state=He.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=He.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){tS(e)?(this.state=He.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=He.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=He.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case Re.SOLIDUS:{this.state=He.SCRIPT_DATA_END_TAG_OPEN;break}case Re.EXCLAMATION_MARK:{this.state=He.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=He.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){tS(e)?(this.state=He.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=He.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=He.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===Re.HYPHEN_MINUS?(this.state=He.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=He.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===Re.HYPHEN_MINUS?(this.state=He.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=He.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case Re.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case Re.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this._emitChars(ac);break}case Re.EOF:{this._err(fn.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case Re.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case Re.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_ESCAPED,this._emitChars(ac);break}case Re.EOF:{this._err(fn.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case Re.HYPHEN_MINUS:{this._emitChars("-");break}case Re.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Re.GREATER_THAN_SIGN:{this.state=He.SCRIPT_DATA,this._emitChars(">");break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_ESCAPED,this._emitChars(ac);break}case Re.EOF:{this._err(fn.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Re.SOLIDUS?this.state=He.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:tS(e)?(this._emitChars("<"),this.state=He.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){tS(e)?(this.state=He.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Rp.SCRIPT,!1)&&sje(this.preprocessor.peek(Rp.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<Rp.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case Re.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case Re.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this._emitChars(ac);break}case Re.EOF:{this._err(fn.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case Re.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case Re.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(ac);break}case Re.EOF:{this._err(fn.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case Re.HYPHEN_MINUS:{this._emitChars("-");break}case Re.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Re.GREATER_THAN_SIGN:{this.state=He.SCRIPT_DATA,this._emitChars(">");break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(ac);break}case Re.EOF:{this._err(fn.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Re.SOLIDUS?(this.state=He.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Rp.SCRIPT,!1)&&sje(this.preprocessor.peek(Rp.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<Rp.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=He.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:break;case Re.SOLIDUS:case Re.GREATER_THAN_SIGN:case Re.EOF:{this.state=He.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case Re.EQUALS_SIGN:{this._err(fn.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=He.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=He.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:case Re.SOLIDUS:case Re.GREATER_THAN_SIGN:case Re.EOF:{this._leaveAttrName(),this.state=He.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case Re.EQUALS_SIGN:{this._leaveAttrName(),this.state=He.BEFORE_ATTRIBUTE_VALUE;break}case Re.QUOTATION_MARK:case Re.APOSTROPHE:case Re.LESS_THAN_SIGN:{this._err(fn.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this.currentAttr.name+=ac;break}default:this.currentAttr.name+=String.fromCodePoint(Wj(e)?xV(e):e)}}_stateAfterAttributeName(e){switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:break;case Re.SOLIDUS:{this.state=He.SELF_CLOSING_START_TAG;break}case Re.EQUALS_SIGN:{this.state=He.BEFORE_ATTRIBUTE_VALUE;break}case Re.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentTagToken();break}case Re.EOF:{this._err(fn.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=He.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:break;case Re.QUOTATION_MARK:{this.state=He.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case Re.APOSTROPHE:{this.state=He.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case Re.GREATER_THAN_SIGN:{this._err(fn.missingAttributeValue),this.state=He.DATA,this.emitCurrentTagToken();break}default:this.state=He.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case Re.QUOTATION_MARK:{this.state=He.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Re.AMPERSAND:{this.returnState=He.ATTRIBUTE_VALUE_DOUBLE_QUOTED,this.state=He.CHARACTER_REFERENCE;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this.currentAttr.value+=ac;break}case Re.EOF:{this._err(fn.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case Re.APOSTROPHE:{this.state=He.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Re.AMPERSAND:{this.returnState=He.ATTRIBUTE_VALUE_SINGLE_QUOTED,this.state=He.CHARACTER_REFERENCE;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this.currentAttr.value+=ac;break}case Re.EOF:{this._err(fn.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:{this._leaveAttrValue(),this.state=He.BEFORE_ATTRIBUTE_NAME;break}case Re.AMPERSAND:{this.returnState=He.ATTRIBUTE_VALUE_UNQUOTED,this.state=He.CHARACTER_REFERENCE;break}case Re.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=He.DATA,this.emitCurrentTagToken();break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),this.currentAttr.value+=ac;break}case Re.QUOTATION_MARK:case Re.APOSTROPHE:case Re.LESS_THAN_SIGN:case Re.EQUALS_SIGN:case Re.GRAVE_ACCENT:{this._err(fn.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case Re.EOF:{this._err(fn.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:{this._leaveAttrValue(),this.state=He.BEFORE_ATTRIBUTE_NAME;break}case Re.SOLIDUS:{this._leaveAttrValue(),this.state=He.SELF_CLOSING_START_TAG;break}case Re.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=He.DATA,this.emitCurrentTagToken();break}case Re.EOF:{this._err(fn.eofInTag),this._emitEOFToken();break}default:this._err(fn.missingWhitespaceBetweenAttributes),this.state=He.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case Re.GREATER_THAN_SIGN:{const t=this.currentToken;t.selfClosing=!0,this.state=He.DATA,this.emitCurrentTagToken();break}case Re.EOF:{this._err(fn.eofInTag),this._emitEOFToken();break}default:this._err(fn.unexpectedSolidusInTag),this.state=He.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const t=this.currentToken;switch(e){case Re.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentComment(t);break}case Re.EOF:{this.emitCurrentComment(t),this._emitEOFToken();break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),t.data+=ac;break}default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Rp.DASH_DASH,!0)?(this._createCommentToken(Rp.DASH_DASH.length+1),this.state=He.COMMENT_START):this._consumeSequenceIfMatch(Rp.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Rp.DOCTYPE.length+1),this.state=He.DOCTYPE):this._consumeSequenceIfMatch(Rp.CDATA_START,!0)?this.inForeignNode?this.state=He.CDATA_SECTION:(this._err(fn.cdataInHtmlContent),this._createCommentToken(Rp.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=He.BOGUS_COMMENT):this._ensureHibernation()||(this._err(fn.incorrectlyOpenedComment),this._createCommentToken(2),this.state=He.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case Re.HYPHEN_MINUS:{this.state=He.COMMENT_START_DASH;break}case Re.GREATER_THAN_SIGN:{this._err(fn.abruptClosingOfEmptyComment),this.state=He.DATA;const t=this.currentToken;this.emitCurrentComment(t);break}default:this.state=He.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const t=this.currentToken;switch(e){case Re.HYPHEN_MINUS:{this.state=He.COMMENT_END;break}case Re.GREATER_THAN_SIGN:{this._err(fn.abruptClosingOfEmptyComment),this.state=He.DATA,this.emitCurrentComment(t);break}case Re.EOF:{this._err(fn.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=He.COMMENT,this._stateComment(e)}}_stateComment(e){const t=this.currentToken;switch(e){case Re.HYPHEN_MINUS:{this.state=He.COMMENT_END_DASH;break}case Re.LESS_THAN_SIGN:{t.data+="<",this.state=He.COMMENT_LESS_THAN_SIGN;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),t.data+=ac;break}case Re.EOF:{this._err(fn.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const t=this.currentToken;switch(e){case Re.EXCLAMATION_MARK:{t.data+="!",this.state=He.COMMENT_LESS_THAN_SIGN_BANG;break}case Re.LESS_THAN_SIGN:{t.data+="<";break}default:this.state=He.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===Re.HYPHEN_MINUS?this.state=He.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=He.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===Re.HYPHEN_MINUS?this.state=He.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=He.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==Re.GREATER_THAN_SIGN&&e!==Re.EOF&&this._err(fn.nestedComment),this.state=He.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const t=this.currentToken;switch(e){case Re.HYPHEN_MINUS:{this.state=He.COMMENT_END;break}case Re.EOF:{this._err(fn.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=He.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const t=this.currentToken;switch(e){case Re.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentComment(t);break}case Re.EXCLAMATION_MARK:{this.state=He.COMMENT_END_BANG;break}case Re.HYPHEN_MINUS:{t.data+="-";break}case Re.EOF:{this._err(fn.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--",this.state=He.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const t=this.currentToken;switch(e){case Re.HYPHEN_MINUS:{t.data+="--!",this.state=He.COMMENT_END_DASH;break}case Re.GREATER_THAN_SIGN:{this._err(fn.incorrectlyClosedComment),this.state=He.DATA,this.emitCurrentComment(t);break}case Re.EOF:{this._err(fn.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--!",this.state=He.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:{this.state=He.BEFORE_DOCTYPE_NAME;break}case Re.GREATER_THAN_SIGN:{this.state=He.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case Re.EOF:{this._err(fn.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(fn.missingWhitespaceBeforeDoctypeName),this.state=He.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Wj(e))this._createDoctypeToken(String.fromCharCode(xV(e))),this.state=He.DOCTYPE_NAME;else switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:break;case Re.NULL:{this._err(fn.unexpectedNullCharacter),this._createDoctypeToken(ac),this.state=He.DOCTYPE_NAME;break}case Re.GREATER_THAN_SIGN:{this._err(fn.missingDoctypeName),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=He.DATA;break}case Re.EOF:{this._err(fn.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=He.DOCTYPE_NAME}}_stateDoctypeName(e){const t=this.currentToken;switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:{this.state=He.AFTER_DOCTYPE_NAME;break}case Re.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentDoctype(t);break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),t.name+=ac;break}case Re.EOF:{this._err(fn.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.name+=String.fromCodePoint(Wj(e)?xV(e):e)}}_stateAfterDoctypeName(e){const t=this.currentToken;switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:break;case Re.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentDoctype(t);break}case Re.EOF:{this._err(fn.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Rp.PUBLIC,!1)?this.state=He.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Rp.SYSTEM,!1)?this.state=He.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(fn.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const t=this.currentToken;switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:{this.state=He.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case Re.QUOTATION_MARK:{this._err(fn.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Re.APOSTROPHE:{this._err(fn.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Re.GREATER_THAN_SIGN:{this._err(fn.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(t);break}case Re.EOF:{this._err(fn.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(fn.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:break;case Re.QUOTATION_MARK:{t.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Re.APOSTROPHE:{t.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Re.GREATER_THAN_SIGN:{this._err(fn.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(t);break}case Re.EOF:{this._err(fn.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(fn.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case Re.QUOTATION_MARK:{this.state=He.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),t.publicId+=ac;break}case Re.GREATER_THAN_SIGN:{this._err(fn.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=He.DATA;break}case Re.EOF:{this._err(fn.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 Re.APOSTROPHE:{this.state=He.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),t.publicId+=ac;break}case Re.GREATER_THAN_SIGN:{this._err(fn.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=He.DATA;break}case Re.EOF:{this._err(fn.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 Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:{this.state=He.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case Re.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentDoctype(t);break}case Re.QUOTATION_MARK:{this._err(fn.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Re.APOSTROPHE:{this._err(fn.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Re.EOF:{this._err(fn.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(fn.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const t=this.currentToken;switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:break;case Re.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=He.DATA;break}case Re.QUOTATION_MARK:{t.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Re.APOSTROPHE:{t.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Re.EOF:{this._err(fn.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(fn.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const t=this.currentToken;switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:{this.state=He.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case Re.QUOTATION_MARK:{this._err(fn.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Re.APOSTROPHE:{this._err(fn.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Re.GREATER_THAN_SIGN:{this._err(fn.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(t);break}case Re.EOF:{this._err(fn.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(fn.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:break;case Re.QUOTATION_MARK:{t.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Re.APOSTROPHE:{t.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Re.GREATER_THAN_SIGN:{this._err(fn.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(t);break}case Re.EOF:{this._err(fn.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(fn.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case Re.QUOTATION_MARK:{this.state=He.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),t.systemId+=ac;break}case Re.GREATER_THAN_SIGN:{this._err(fn.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=He.DATA;break}case Re.EOF:{this._err(fn.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 Re.APOSTROPHE:{this.state=He.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter),t.systemId+=ac;break}case Re.GREATER_THAN_SIGN:{this._err(fn.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=He.DATA;break}case Re.EOF:{this._err(fn.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 Re.SPACE:case Re.LINE_FEED:case Re.TABULATION:case Re.FORM_FEED:break;case Re.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=He.DATA;break}case Re.EOF:{this._err(fn.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(fn.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const t=this.currentToken;switch(e){case Re.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=He.DATA;break}case Re.NULL:{this._err(fn.unexpectedNullCharacter);break}case Re.EOF:{this.emitCurrentDoctype(t),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case Re.RIGHT_SQUARE_BRACKET:{this.state=He.CDATA_SECTION_BRACKET;break}case Re.EOF:{this._err(fn.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===Re.RIGHT_SQUARE_BRACKET?this.state=He.CDATA_SECTION_END:(this._emitChars("]"),this.state=He.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case Re.GREATER_THAN_SIGN:{this.state=He.DATA;break}case Re.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=He.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(e){e===Re.NUMBER_SIGN?this.state=He.NUMERIC_CHARACTER_REFERENCE:Mpe(e)?(this.state=He.NAMED_CHARACTER_REFERENCE,this._stateNamedCharacterReference(e)):(this._flushCodePointConsumedAsCharacterReference(Re.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(Re.AMPERSAND),this.state=He.AMBIGUOUS_AMPERSAND}_stateAmbiguousAmpersand(e){Mpe(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===Re.SEMICOLON&&this._err(fn.unknownNamedCharacterReference),this._reconsumeInState(this.returnState,e))}_stateNumericCharacterReference(e){this.charRefCode=0,e===Re.LATIN_SMALL_X||e===Re.LATIN_CAPITAL_X?this.state=He.HEXADEMICAL_CHARACTER_REFERENCE_START:$F(e)?(this.state=He.DECIMAL_CHARACTER_REFERENCE,this._stateDecimalCharacterReference(e)):(this._err(fn.absenceOfDigitsInNumericCharacterReference),this._flushCodePointConsumedAsCharacterReference(Re.AMPERSAND),this._flushCodePointConsumedAsCharacterReference(Re.NUMBER_SIGN),this._reconsumeInState(this.returnState,e))}_stateHexademicalCharacterReferenceStart(e){wcn(e)?(this.state=He.HEXADEMICAL_CHARACTER_REFERENCE,this._stateHexademicalCharacterReference(e)):(this._err(fn.absenceOfDigitsInNumericCharacterReference),this._flushCodePointConsumedAsCharacterReference(Re.AMPERSAND),this._flushCodePointConsumedAsCharacterReference(Re.NUMBER_SIGN),this._unconsume(2),this.state=this.returnState)}_stateHexademicalCharacterReference(e){Ctt(e)?this.charRefCode=this.charRefCode*16+e-55:wtt(e)?this.charRefCode=this.charRefCode*16+e-87:$F(e)?this.charRefCode=this.charRefCode*16+e-48:e===Re.SEMICOLON?this.state=He.NUMERIC_CHARACTER_REFERENCE_END:(this._err(fn.missingSemicolonAfterCharacterReference),this.state=He.NUMERIC_CHARACTER_REFERENCE_END,this._stateNumericCharacterReferenceEnd(e))}_stateDecimalCharacterReference(e){$F(e)?this.charRefCode=this.charRefCode*10+e-48:e===Re.SEMICOLON?this.state=He.NUMERIC_CHARACTER_REFERENCE_END:(this._err(fn.missingSemicolonAfterCharacterReference),this.state=He.NUMERIC_CHARACTER_REFERENCE_END,this._stateNumericCharacterReferenceEnd(e))}_stateNumericCharacterReferenceEnd(e){if(this.charRefCode===Re.NULL)this._err(fn.nullCharacterReference),this.charRefCode=Re.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(fn.characterReferenceOutsideUnicodeRange),this.charRefCode=Re.REPLACEMENT_CHARACTER;else if(ptt(this.charRefCode))this._err(fn.surrogateCharacterReference),this.charRefCode=Re.REPLACEMENT_CHARACTER;else if(mtt(this.charRefCode))this._err(fn.noncharacterCharacterReference);else if(gtt(this.charRefCode)||this.charRefCode===Re.CARRIAGE_RETURN){this._err(fn.controlCharacterReference);const t=ycn.get(this.charRefCode);t!==void 0&&(this.charRefCode=t)}this._flushCodePointConsumedAsCharacterReference(this.charRefCode),this._reconsumeInState(this.returnState,e)}}const Stt=new Set([K.DD,K.DT,K.LI,K.OPTGROUP,K.OPTION,K.P,K.RB,K.RP,K.RT,K.RTC]),oje=new Set([...Stt,K.CAPTION,K.COLGROUP,K.TBODY,K.TD,K.TFOOT,K.TH,K.THEAD,K.TR]),SV=new Map([[K.APPLET,Nn.HTML],[K.CAPTION,Nn.HTML],[K.HTML,Nn.HTML],[K.MARQUEE,Nn.HTML],[K.OBJECT,Nn.HTML],[K.TABLE,Nn.HTML],[K.TD,Nn.HTML],[K.TEMPLATE,Nn.HTML],[K.TH,Nn.HTML],[K.ANNOTATION_XML,Nn.MATHML],[K.MI,Nn.MATHML],[K.MN,Nn.MATHML],[K.MO,Nn.MATHML],[K.MS,Nn.MATHML],[K.MTEXT,Nn.MATHML],[K.DESC,Nn.SVG],[K.FOREIGN_OBJECT,Nn.SVG],[K.TITLE,Nn.SVG]]),Ecn=[K.H1,K.H2,K.H3,K.H4,K.H5,K.H6],kcn=[K.TR,K.TEMPLATE,K.HTML],Tcn=[K.TBODY,K.TFOOT,K.THEAD,K.TEMPLATE,K.HTML],Icn=[K.TABLE,K.TEMPLATE,K.HTML],Lcn=[K.TD,K.TH];class Acn{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=K.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===K.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(Ecn,Nn.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Lcn,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(Icn,Nn.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Tcn,Nn.HTML)}clearBackToTableRowContext(){this.clearBackTo(kcn,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]===K.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]===K.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(SV.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(ytt(t)&&i===Nn.HTML)return!0;if(SV.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===K.UL||i===K.OL)&&r===Nn.HTML||SV.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===K.BUTTON&&r===Nn.HTML||SV.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===K.TABLE||i===K.TEMPLATE||i===K.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===K.TBODY||t===K.THEAD||t===K.TFOOT)return!0;if(t===K.TABLE||t===K.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!==K.OPTION&&i!==K.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;Stt.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;oje.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==e&&oje.has(this.currentTagId);)this.pop()}}const Ele=3;var sb;(function(n){n[n.Marker=0]="Marker",n[n.Element=1]="Element"})(sb=sb||(sb={}));const aje={type:sb.Marker};class Ncn{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const i=[],r=t.length,s=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let a=0;a<this.entries.length;a++){const l=this.entries[a];if(l.type===sb.Marker)break;const{element:c}=l;if(this.treeAdapter.getTagName(c)===s&&this.treeAdapter.getNamespaceURI(c)===o){const u=this.treeAdapter.getAttrList(c);u.length===r&&i.push({idx:a,attrs:u})}}return i}_ensureNoahArkCondition(e){if(this.entries.length<Ele)return;const t=this.treeAdapter.getAttrList(e),i=this._getNoahArkConditionCandidates(e,t);if(i.length<Ele)return;const r=new Map(t.map(o=>[o.name,o.value]));let s=0;for(let o=0;o<i.length;o++){const a=i[o];a.attrs.every(l=>r.get(l.name)===l.value)&&(s+=1,s>=Ele&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(aje)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:sb.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:sb.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(aje);e>=0?this.entries.splice(0,e+1):this.entries.length=0}getElementEntryInScopeWithTagName(e){const t=this.entries.find(i=>i.type===sb.Marker||this.treeAdapter.getTagName(i.element)===e);return t&&t.type===sb.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===sb.Element&&t.element===e)}}function lje(n){return{nodeName:"#text",value:n,parentNode:null}}const iR={createDocument(){return{nodeName:"#document",mode:sm.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(s=>s.nodeName==="#documentType");if(r)r.name=e,r.publicId=t,r.systemId=i;else{const s={nodeName:"#documentType",name:e,publicId:t,systemId:i,parentNode:null};iR.appendChild(n,s)}},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(iR.isTextNode(t)){t.value+=e;return}}iR.appendChild(n,lje(e))},insertTextBefore(n,e,t){const i=n.childNodes[n.childNodes.indexOf(t)-1];i&&iR.isTextNode(i)?i.value+=e:iR.insertBefore(n,lje(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}}},Ett="html",Dcn="about:legacy-compat",Rcn="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ktt=["+//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//"],Pcn=[...ktt,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Ocn=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ttt=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Mcn=[...Ttt,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function cje(n,e){return e.some(t=>n.startsWith(t))}function jcn(n){return n.name===Ett&&n.publicId===null&&(n.systemId===null||n.systemId===Dcn)}function Fcn(n){if(n.name!==Ett)return sm.QUIRKS;const{systemId:e}=n;if(e&&e.toLowerCase()===Rcn)return sm.QUIRKS;let{publicId:t}=n;if(t!==null){if(t=t.toLowerCase(),Ocn.has(t))return sm.QUIRKS;let i=e===null?Pcn:ktt;if(cje(t,i))return sm.QUIRKS;if(i=e===null?Ttt:Mcn,cje(t,i))return sm.LIMITED_QUIRKS}return sm.NO_QUIRKS}const uje={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Bcn="definitionurl",$cn="definitionURL",Hcn=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])),Vcn=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}]]),Wcn=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])),zcn=new Set([K.B,K.BIG,K.BLOCKQUOTE,K.BODY,K.BR,K.CENTER,K.CODE,K.DD,K.DIV,K.DL,K.DT,K.EM,K.EMBED,K.H1,K.H2,K.H3,K.H4,K.H5,K.H6,K.HEAD,K.HR,K.I,K.IMG,K.LI,K.LISTING,K.MENU,K.META,K.NOBR,K.OL,K.P,K.PRE,K.RUBY,K.S,K.SMALL,K.SPAN,K.STRONG,K.STRIKE,K.SUB,K.SUP,K.TABLE,K.TT,K.U,K.UL,K.VAR]);function Ucn(n){const e=n.tagID;return e===K.FONT&&n.attrs.some(({name:i})=>i===iE.COLOR||i===iE.SIZE||i===iE.FACE)||zcn.has(e)}function Itt(n){for(let e=0;e<n.attrs.length;e++)if(n.attrs[e].name===Bcn){n.attrs[e].name=$cn;break}}function Ltt(n){for(let e=0;e<n.attrs.length;e++){const t=Hcn.get(n.attrs[e].name);t!=null&&(n.attrs[e].name=t)}}function oEe(n){for(let e=0;e<n.attrs.length;e++){const t=Vcn.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 qcn(n){const e=Wcn.get(n.tagName);e!=null&&(n.tagName=e,n.tagID=I4(n.tagName))}function Kcn(n,e){return e===Nn.MATHML&&(n===K.MI||n===K.MO||n===K.MN||n===K.MS||n===K.MTEXT)}function Gcn(n,e,t){if(e===Nn.MATHML&&n===K.ANNOTATION_XML){for(let i=0;i<t.length;i++)if(t[i].name===iE.ENCODING){const r=t[i].value.toLowerCase();return r===uje.TEXT_HTML||r===uje.APPLICATION_XML}}return e===Nn.SVG&&(n===K.FOREIGN_OBJECT||n===K.DESC||n===K.TITLE)}function Ycn(n,e,t,i){return(!i||i===Nn.HTML)&&Gcn(n,e,t)||(!i||i===Nn.MATHML)&&Kcn(n,e)}const Qcn="hidden",Xcn=8,Zcn=3;var ct;(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"})(ct||(ct={}));const Jcn={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Att=new Set([K.TABLE,K.TBODY,K.TFOOT,K.THEAD,K.TR]),dje={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:iR,onParseError:null};let hje=class{constructor(e,t,i=null,r=null){this.fragmentContext=i,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=ct.INITIAL,this.originalInsertionMode=ct.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={...dje,...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 Scn(this.options,this),this.activeFormattingElements=new Ncn(this.treeAdapter),this.fragmentContextID=i?I4(this.treeAdapter.getTagName(i)):K.UNKNOWN,this._setContextModes(i??this.document,this.fragmentContextID),this.openElements=new Acn(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={...dje,...t};e??(e=i.treeAdapter.createElement(Wt.TEMPLATE,Nn.HTML,[]));const r=i.treeAdapter.createElement("documentmock",Nn.HTML,[]),s=new this(i,r,e);return s.fragmentContextID===K.TEMPLATE&&s.tmplInsertionModeStack.unshift(ct.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}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 s=(r=e.location)!==null&&r!==void 0?r:Jcn,o={code:t,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:i?s.startLine:s.endLine,endCol:i?s.startCol:s.endCol,endOffset:i?s.startOffset:s.endOffset};this.onParseError(o)}onItemPush(e,t,i){var r,s;(s=(r=this.treeAdapter).onItemPush)===null||s===void 0||s.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 s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_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=ct.TEXT}switchToPlaintextParsing(){this.insertionMode=ct.TEXT,this.originalInsertionMode=ct.IN_BODY,this.tokenizer.state=fu.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)===Wt.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 K.TITLE:case K.TEXTAREA:{this.tokenizer.state=fu.RCDATA;break}case K.STYLE:case K.XMP:case K.IFRAME:case K.NOEMBED:case K.NOFRAMES:case K.NOSCRIPT:{this.tokenizer.state=fu.RAWTEXT;break}case K.SCRIPT:{this.tokenizer.state=fu.SCRIPT_DATA;break}case K.PLAINTEXT:{this.tokenizer.state=fu.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 o=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));o&&this.treeAdapter.setNodeSourceCodeLocation(o,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(Wt.HTML,Nn.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,K.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),s=i?r.lastIndexOf(i):r.length,o=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:l,endCol:c,endOffset:u}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:l,endCol:c,endOffset:u})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,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),s=t.type===fo.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,s)}}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===K.SVG&&this.treeAdapter.getTagName(t)===Wt.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===Nn.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===K.MGLYPH||e.tagID===K.MALIGNMARK)&&!this._isIntegrationPoint(i,t,Nn.HTML)}_processToken(e){switch(e.type){case fo.CHARACTER:{this.onCharacter(e);break}case fo.NULL_CHARACTER:{this.onNullCharacter(e);break}case fo.COMMENT:{this.onComment(e);break}case fo.DOCTYPE:{this.onDoctype(e);break}case fo.START_TAG:{this._processStartTag(e);break}case fo.END_TAG:{this.onEndTag(e);break}case fo.EOF:{this.onEof(e);break}case fo.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,t,i){const r=this.treeAdapter.getNamespaceURI(t),s=this.treeAdapter.getAttrList(t);return Ycn(e,r,s,i)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex(r=>r.type===sb.Marker||this.openElements.contains(r.element)),i=t<0?e-1:t-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=ct.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(K.P),this.openElements.popUntilTagNamePopped(K.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case K.TR:{this.insertionMode=ct.IN_ROW;return}case K.TBODY:case K.THEAD:case K.TFOOT:{this.insertionMode=ct.IN_TABLE_BODY;return}case K.CAPTION:{this.insertionMode=ct.IN_CAPTION;return}case K.COLGROUP:{this.insertionMode=ct.IN_COLUMN_GROUP;return}case K.TABLE:{this.insertionMode=ct.IN_TABLE;return}case K.BODY:{this.insertionMode=ct.IN_BODY;return}case K.FRAMESET:{this.insertionMode=ct.IN_FRAMESET;return}case K.SELECT:{this._resetInsertionModeForSelect(e);return}case K.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case K.HTML:{this.insertionMode=this.headElement?ct.AFTER_HEAD:ct.BEFORE_HEAD;return}case K.TD:case K.TH:{if(e>0){this.insertionMode=ct.IN_CELL;return}break}case K.HEAD:{if(e>0){this.insertionMode=ct.IN_HEAD;return}break}}this.insertionMode=ct.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const i=this.openElements.tagIDs[t];if(i===K.TEMPLATE)break;if(i===K.TABLE){this.insertionMode=ct.IN_SELECT_IN_TABLE;return}}this.insertionMode=ct.IN_SELECT}_isElementCausesFosterParenting(e){return Att.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 K.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(t)===Nn.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break}case K.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 bcn[i].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Ldn(this,e);return}switch(this.insertionMode){case ct.INITIAL:{K5(this,e);break}case ct.BEFORE_HTML:{HF(this,e);break}case ct.BEFORE_HEAD:{VF(this,e);break}case ct.IN_HEAD:{WF(this,e);break}case ct.IN_HEAD_NO_SCRIPT:{zF(this,e);break}case ct.AFTER_HEAD:{UF(this,e);break}case ct.IN_BODY:case ct.IN_CAPTION:case ct.IN_CELL:case ct.IN_TEMPLATE:{Dtt(this,e);break}case ct.TEXT:case ct.IN_SELECT:case ct.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case ct.IN_TABLE:case ct.IN_TABLE_BODY:case ct.IN_ROW:{kle(this,e);break}case ct.IN_TABLE_TEXT:{Ftt(this,e);break}case ct.IN_COLUMN_GROUP:{aK(this,e);break}case ct.AFTER_BODY:{lK(this,e);break}case ct.AFTER_AFTER_BODY:{$z(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Idn(this,e);return}switch(this.insertionMode){case ct.INITIAL:{K5(this,e);break}case ct.BEFORE_HTML:{HF(this,e);break}case ct.BEFORE_HEAD:{VF(this,e);break}case ct.IN_HEAD:{WF(this,e);break}case ct.IN_HEAD_NO_SCRIPT:{zF(this,e);break}case ct.AFTER_HEAD:{UF(this,e);break}case ct.TEXT:{this._insertCharacters(e);break}case ct.IN_TABLE:case ct.IN_TABLE_BODY:case ct.IN_ROW:{kle(this,e);break}case ct.IN_COLUMN_GROUP:{aK(this,e);break}case ct.AFTER_BODY:{lK(this,e);break}case ct.AFTER_AFTER_BODY:{$z(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){jpe(this,e);return}switch(this.insertionMode){case ct.INITIAL:case ct.BEFORE_HTML:case ct.BEFORE_HEAD:case ct.IN_HEAD:case ct.IN_HEAD_NO_SCRIPT:case ct.AFTER_HEAD:case ct.IN_BODY:case ct.IN_TABLE:case ct.IN_CAPTION:case ct.IN_COLUMN_GROUP:case ct.IN_TABLE_BODY:case ct.IN_ROW:case ct.IN_CELL:case ct.IN_SELECT:case ct.IN_SELECT_IN_TABLE:case ct.IN_TEMPLATE:case ct.IN_FRAMESET:case ct.AFTER_FRAMESET:{jpe(this,e);break}case ct.IN_TABLE_TEXT:{G5(this,e);break}case ct.AFTER_BODY:{oun(this,e);break}case ct.AFTER_AFTER_BODY:case ct.AFTER_AFTER_FRAMESET:{aun(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case ct.INITIAL:{lun(this,e);break}case ct.BEFORE_HEAD:case ct.IN_HEAD:case ct.IN_HEAD_NO_SCRIPT:case ct.AFTER_HEAD:{this._err(e,fn.misplacedDoctype);break}case ct.IN_TABLE_TEXT:{G5(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,fn.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Adn(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case ct.INITIAL:{K5(this,e);break}case ct.BEFORE_HTML:{cun(this,e);break}case ct.BEFORE_HEAD:{dun(this,e);break}case ct.IN_HEAD:{Yb(this,e);break}case ct.IN_HEAD_NO_SCRIPT:{pun(this,e);break}case ct.AFTER_HEAD:{mun(this,e);break}case ct.IN_BODY:{yf(this,e);break}case ct.IN_TABLE:{qO(this,e);break}case ct.IN_TABLE_TEXT:{G5(this,e);break}case ct.IN_CAPTION:{hdn(this,e);break}case ct.IN_COLUMN_GROUP:{cEe(this,e);break}case ct.IN_TABLE_BODY:{bee(this,e);break}case ct.IN_ROW:{yee(this,e);break}case ct.IN_CELL:{gdn(this,e);break}case ct.IN_SELECT:{Htt(this,e);break}case ct.IN_SELECT_IN_TABLE:{_dn(this,e);break}case ct.IN_TEMPLATE:{bdn(this,e);break}case ct.AFTER_BODY:{Cdn(this,e);break}case ct.IN_FRAMESET:{wdn(this,e);break}case ct.AFTER_FRAMESET:{Sdn(this,e);break}case ct.AFTER_AFTER_BODY:{kdn(this,e);break}case ct.AFTER_AFTER_FRAMESET:{Tdn(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Ndn(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case ct.INITIAL:{K5(this,e);break}case ct.BEFORE_HTML:{uun(this,e);break}case ct.BEFORE_HEAD:{hun(this,e);break}case ct.IN_HEAD:{fun(this,e);break}case ct.IN_HEAD_NO_SCRIPT:{gun(this,e);break}case ct.AFTER_HEAD:{_un(this,e);break}case ct.IN_BODY:{vee(this,e);break}case ct.TEXT:{ndn(this,e);break}case ct.IN_TABLE:{z8(this,e);break}case ct.IN_TABLE_TEXT:{G5(this,e);break}case ct.IN_CAPTION:{fdn(this,e);break}case ct.IN_COLUMN_GROUP:{pdn(this,e);break}case ct.IN_TABLE_BODY:{Fpe(this,e);break}case ct.IN_ROW:{$tt(this,e);break}case ct.IN_CELL:{mdn(this,e);break}case ct.IN_SELECT:{Vtt(this,e);break}case ct.IN_SELECT_IN_TABLE:{vdn(this,e);break}case ct.IN_TEMPLATE:{ydn(this,e);break}case ct.AFTER_BODY:{ztt(this,e);break}case ct.IN_FRAMESET:{xdn(this,e);break}case ct.AFTER_FRAMESET:{Edn(this,e);break}case ct.AFTER_AFTER_BODY:{$z(this,e);break}}}onEof(e){switch(this.insertionMode){case ct.INITIAL:{K5(this,e);break}case ct.BEFORE_HTML:{HF(this,e);break}case ct.BEFORE_HEAD:{VF(this,e);break}case ct.IN_HEAD:{WF(this,e);break}case ct.IN_HEAD_NO_SCRIPT:{zF(this,e);break}case ct.AFTER_HEAD:{UF(this,e);break}case ct.IN_BODY:case ct.IN_TABLE:case ct.IN_CAPTION:case ct.IN_COLUMN_GROUP:case ct.IN_TABLE_BODY:case ct.IN_ROW:case ct.IN_CELL:case ct.IN_SELECT:case ct.IN_SELECT_IN_TABLE:{Mtt(this,e);break}case ct.TEXT:{idn(this,e);break}case ct.IN_TABLE_TEXT:{G5(this,e);break}case ct.IN_TEMPLATE:{Wtt(this,e);break}case ct.AFTER_BODY:case ct.IN_FRAMESET:case ct.AFTER_FRAMESET:case ct.AFTER_AFTER_BODY:case ct.AFTER_AFTER_FRAMESET:{lEe(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===Re.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 ct.IN_HEAD:case ct.IN_HEAD_NO_SCRIPT:case ct.AFTER_HEAD:case ct.TEXT:case ct.IN_COLUMN_GROUP:case ct.IN_SELECT:case ct.IN_SELECT_IN_TABLE:case ct.IN_FRAMESET:case ct.AFTER_FRAMESET:{this._insertCharacters(e);break}case ct.IN_BODY:case ct.IN_CAPTION:case ct.IN_CELL:case ct.IN_TEMPLATE:case ct.AFTER_BODY:case ct.AFTER_AFTER_BODY:case ct.AFTER_AFTER_FRAMESET:{Ntt(this,e);break}case ct.IN_TABLE:case ct.IN_TABLE_BODY:case ct.IN_ROW:{kle(this,e);break}case ct.IN_TABLE_TEXT:{jtt(this,e);break}}}};function eun(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):Ott(n,e),t}function tun(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 nun(n,e,t){let i=e,r=n.openElements.getCommonAncestor(e);for(let s=0,o=r;o!==t;s++,o=r){r=n.openElements.getCommonAncestor(o);const a=n.activeFormattingElements.getElementEntry(o),l=a&&s>=Zcn;!a||l?(l&&n.activeFormattingElements.removeEntry(a),n.openElements.remove(o)):(o=iun(n,a),i===e&&(n.activeFormattingElements.bookmark=a),n.treeAdapter.detachNode(i),n.treeAdapter.appendChild(o,i),i=o)}return i}function iun(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 run(n,e,t){const i=n.treeAdapter.getTagName(e),r=I4(i);if(n._isElementCausesFosterParenting(r))n._fosterParentElement(t);else{const s=n.treeAdapter.getNamespaceURI(e);r===K.TEMPLATE&&s===Nn.HTML&&(e=n.treeAdapter.getTemplateContent(e)),n.treeAdapter.appendChild(e,t)}}function sun(n,e,t){const i=n.treeAdapter.getNamespaceURI(t.element),{token:r}=t,s=n.treeAdapter.createElement(r.tagName,i,r.attrs);n._adoptNodes(e,s),n.treeAdapter.appendChild(e,s),n.activeFormattingElements.insertElementAfterBookmark(s,r),n.activeFormattingElements.removeEntry(t),n.openElements.remove(t.element),n.openElements.insertAfter(e,s,r.tagID)}function aEe(n,e){for(let t=0;t<Xcn;t++){const i=eun(n,e);if(!i)break;const r=tun(n,i);if(!r)break;n.activeFormattingElements.bookmark=i;const s=nun(n,r,i.element),o=n.openElements.getCommonAncestor(i.element);n.treeAdapter.detachNode(s),o&&run(n,o,s),sun(n,r,i)}}function jpe(n,e){n._appendCommentNode(e,n.openElements.currentTmplContentOrNode)}function oun(n,e){n._appendCommentNode(e,n.openElements.items[0])}function aun(n,e){n._appendCommentNode(e,n.document)}function lEe(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 s=n.openElements.items[1],o=n.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&n._setEndLocation(s,e)}}}}function lun(n,e){n._setDocumentType(e);const t=e.forceQuirks?sm.QUIRKS:Fcn(e);jcn(e)||n._err(e,fn.nonConformingDoctype),n.treeAdapter.setDocumentMode(n.document,t),n.insertionMode=ct.BEFORE_HTML}function K5(n,e){n._err(e,fn.missingDoctype,!0),n.treeAdapter.setDocumentMode(n.document,sm.QUIRKS),n.insertionMode=ct.BEFORE_HTML,n._processToken(e)}function cun(n,e){e.tagID===K.HTML?(n._insertElement(e,Nn.HTML),n.insertionMode=ct.BEFORE_HEAD):HF(n,e)}function uun(n,e){const t=e.tagID;(t===K.HTML||t===K.HEAD||t===K.BODY||t===K.BR)&&HF(n,e)}function HF(n,e){n._insertFakeRootElement(),n.insertionMode=ct.BEFORE_HEAD,n._processToken(e)}function dun(n,e){switch(e.tagID){case K.HTML:{yf(n,e);break}case K.HEAD:{n._insertElement(e,Nn.HTML),n.headElement=n.openElements.current,n.insertionMode=ct.IN_HEAD;break}default:VF(n,e)}}function hun(n,e){const t=e.tagID;t===K.HEAD||t===K.BODY||t===K.HTML||t===K.BR?VF(n,e):n._err(e,fn.endTagWithoutMatchingOpenElement)}function VF(n,e){n._insertFakeElement(Wt.HEAD,K.HEAD),n.headElement=n.openElements.current,n.insertionMode=ct.IN_HEAD,n._processToken(e)}function Yb(n,e){switch(e.tagID){case K.HTML:{yf(n,e);break}case K.BASE:case K.BASEFONT:case K.BGSOUND:case K.LINK:case K.META:{n._appendElement(e,Nn.HTML),e.ackSelfClosing=!0;break}case K.TITLE:{n._switchToTextParsing(e,fu.RCDATA);break}case K.NOSCRIPT:{n.options.scriptingEnabled?n._switchToTextParsing(e,fu.RAWTEXT):(n._insertElement(e,Nn.HTML),n.insertionMode=ct.IN_HEAD_NO_SCRIPT);break}case K.NOFRAMES:case K.STYLE:{n._switchToTextParsing(e,fu.RAWTEXT);break}case K.SCRIPT:{n._switchToTextParsing(e,fu.SCRIPT_DATA);break}case K.TEMPLATE:{n._insertTemplate(e),n.activeFormattingElements.insertMarker(),n.framesetOk=!1,n.insertionMode=ct.IN_TEMPLATE,n.tmplInsertionModeStack.unshift(ct.IN_TEMPLATE);break}case K.HEAD:{n._err(e,fn.misplacedStartTagForHeadElement);break}default:WF(n,e)}}function fun(n,e){switch(e.tagID){case K.HEAD:{n.openElements.pop(),n.insertionMode=ct.AFTER_HEAD;break}case K.BODY:case K.BR:case K.HTML:{WF(n,e);break}case K.TEMPLATE:{LA(n,e);break}default:n._err(e,fn.endTagWithoutMatchingOpenElement)}}function LA(n,e){n.openElements.tmplCount>0?(n.openElements.generateImpliedEndTagsThoroughly(),n.openElements.currentTagId!==K.TEMPLATE&&n._err(e,fn.closingOfElementWithOpenChildElements),n.openElements.popUntilTagNamePopped(K.TEMPLATE),n.activeFormattingElements.clearToLastMarker(),n.tmplInsertionModeStack.shift(),n._resetInsertionMode()):n._err(e,fn.endTagWithoutMatchingOpenElement)}function WF(n,e){n.openElements.pop(),n.insertionMode=ct.AFTER_HEAD,n._processToken(e)}function pun(n,e){switch(e.tagID){case K.HTML:{yf(n,e);break}case K.BASEFONT:case K.BGSOUND:case K.HEAD:case K.LINK:case K.META:case K.NOFRAMES:case K.STYLE:{Yb(n,e);break}case K.NOSCRIPT:{n._err(e,fn.nestedNoscriptInHead);break}default:zF(n,e)}}function gun(n,e){switch(e.tagID){case K.NOSCRIPT:{n.openElements.pop(),n.insertionMode=ct.IN_HEAD;break}case K.BR:{zF(n,e);break}default:n._err(e,fn.endTagWithoutMatchingOpenElement)}}function zF(n,e){const t=e.type===fo.EOF?fn.openElementsLeftAfterEof:fn.disallowedContentInNoscriptInHead;n._err(e,t),n.openElements.pop(),n.insertionMode=ct.IN_HEAD,n._processToken(e)}function mun(n,e){switch(e.tagID){case K.HTML:{yf(n,e);break}case K.BODY:{n._insertElement(e,Nn.HTML),n.framesetOk=!1,n.insertionMode=ct.IN_BODY;break}case K.FRAMESET:{n._insertElement(e,Nn.HTML),n.insertionMode=ct.IN_FRAMESET;break}case K.BASE:case K.BASEFONT:case K.BGSOUND:case K.LINK:case K.META:case K.NOFRAMES:case K.SCRIPT:case K.STYLE:case K.TEMPLATE:case K.TITLE:{n._err(e,fn.abandonedHeadElementChild),n.openElements.push(n.headElement,K.HEAD),Yb(n,e),n.openElements.remove(n.headElement);break}case K.HEAD:{n._err(e,fn.misplacedStartTagForHeadElement);break}default:UF(n,e)}}function _un(n,e){switch(e.tagID){case K.BODY:case K.HTML:case K.BR:{UF(n,e);break}case K.TEMPLATE:{LA(n,e);break}default:n._err(e,fn.endTagWithoutMatchingOpenElement)}}function UF(n,e){n._insertFakeElement(Wt.BODY,K.BODY),n.insertionMode=ct.IN_BODY,_ee(n,e)}function _ee(n,e){switch(e.type){case fo.CHARACTER:{Dtt(n,e);break}case fo.WHITESPACE_CHARACTER:{Ntt(n,e);break}case fo.COMMENT:{jpe(n,e);break}case fo.START_TAG:{yf(n,e);break}case fo.END_TAG:{vee(n,e);break}case fo.EOF:{Mtt(n,e);break}}}function Ntt(n,e){n._reconstructActiveFormattingElements(),n._insertCharacters(e)}function Dtt(n,e){n._reconstructActiveFormattingElements(),n._insertCharacters(e),n.framesetOk=!1}function vun(n,e){n.openElements.tmplCount===0&&n.treeAdapter.adoptAttributes(n.openElements.items[0],e.attrs)}function bun(n,e){const t=n.openElements.tryPeekProperlyNestedBodyElement();t&&n.openElements.tmplCount===0&&(n.framesetOk=!1,n.treeAdapter.adoptAttributes(t,e.attrs))}function yun(n,e){const t=n.openElements.tryPeekProperlyNestedBodyElement();n.framesetOk&&t&&(n.treeAdapter.detachNode(t),n.openElements.popAllUpToHtmlElement(),n._insertElement(e,Nn.HTML),n.insertionMode=ct.IN_FRAMESET)}function Cun(n,e){n.openElements.hasInButtonScope(K.P)&&n._closePElement(),n._insertElement(e,Nn.HTML)}function wun(n,e){n.openElements.hasInButtonScope(K.P)&&n._closePElement(),ytt(n.openElements.currentTagId)&&n.openElements.pop(),n._insertElement(e,Nn.HTML)}function xun(n,e){n.openElements.hasInButtonScope(K.P)&&n._closePElement(),n._insertElement(e,Nn.HTML),n.skipNextNewLine=!0,n.framesetOk=!1}function Sun(n,e){const t=n.openElements.tmplCount>0;(!n.formElement||t)&&(n.openElements.hasInButtonScope(K.P)&&n._closePElement(),n._insertElement(e,Nn.HTML),t||(n.formElement=n.openElements.current))}function Eun(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===K.LI&&r===K.LI||(t===K.DD||t===K.DT)&&(r===K.DD||r===K.DT)){n.openElements.generateImpliedEndTagsWithExclusion(r),n.openElements.popUntilTagNamePopped(r);break}if(r!==K.ADDRESS&&r!==K.DIV&&r!==K.P&&n._isSpecialElement(n.openElements.items[i],r))break}n.openElements.hasInButtonScope(K.P)&&n._closePElement(),n._insertElement(e,Nn.HTML)}function kun(n,e){n.openElements.hasInButtonScope(K.P)&&n._closePElement(),n._insertElement(e,Nn.HTML),n.tokenizer.state=fu.PLAINTEXT}function Tun(n,e){n.openElements.hasInScope(K.BUTTON)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(K.BUTTON)),n._reconstructActiveFormattingElements(),n._insertElement(e,Nn.HTML),n.framesetOk=!1}function Iun(n,e){const t=n.activeFormattingElements.getElementEntryInScopeWithTagName(Wt.A);t&&(aEe(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 Lun(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,Nn.HTML),n.activeFormattingElements.pushElement(n.openElements.current,e)}function Aun(n,e){n._reconstructActiveFormattingElements(),n.openElements.hasInScope(K.NOBR)&&(aEe(n,e),n._reconstructActiveFormattingElements()),n._insertElement(e,Nn.HTML),n.activeFormattingElements.pushElement(n.openElements.current,e)}function Nun(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,Nn.HTML),n.activeFormattingElements.insertMarker(),n.framesetOk=!1}function Dun(n,e){n.treeAdapter.getDocumentMode(n.document)!==sm.QUIRKS&&n.openElements.hasInButtonScope(K.P)&&n._closePElement(),n._insertElement(e,Nn.HTML),n.framesetOk=!1,n.insertionMode=ct.IN_TABLE}function Rtt(n,e){n._reconstructActiveFormattingElements(),n._appendElement(e,Nn.HTML),n.framesetOk=!1,e.ackSelfClosing=!0}function Ptt(n){const e=_tt(n,iE.TYPE);return e!=null&&e.toLowerCase()===Qcn}function Run(n,e){n._reconstructActiveFormattingElements(),n._appendElement(e,Nn.HTML),Ptt(e)||(n.framesetOk=!1),e.ackSelfClosing=!0}function Pun(n,e){n._appendElement(e,Nn.HTML),e.ackSelfClosing=!0}function Oun(n,e){n.openElements.hasInButtonScope(K.P)&&n._closePElement(),n._appendElement(e,Nn.HTML),n.framesetOk=!1,e.ackSelfClosing=!0}function Mun(n,e){e.tagName=Wt.IMG,e.tagID=K.IMG,Rtt(n,e)}function jun(n,e){n._insertElement(e,Nn.HTML),n.skipNextNewLine=!0,n.tokenizer.state=fu.RCDATA,n.originalInsertionMode=n.insertionMode,n.framesetOk=!1,n.insertionMode=ct.TEXT}function Fun(n,e){n.openElements.hasInButtonScope(K.P)&&n._closePElement(),n._reconstructActiveFormattingElements(),n.framesetOk=!1,n._switchToTextParsing(e,fu.RAWTEXT)}function Bun(n,e){n.framesetOk=!1,n._switchToTextParsing(e,fu.RAWTEXT)}function fje(n,e){n._switchToTextParsing(e,fu.RAWTEXT)}function $un(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,Nn.HTML),n.framesetOk=!1,n.insertionMode=n.insertionMode===ct.IN_TABLE||n.insertionMode===ct.IN_CAPTION||n.insertionMode===ct.IN_TABLE_BODY||n.insertionMode===ct.IN_ROW||n.insertionMode===ct.IN_CELL?ct.IN_SELECT_IN_TABLE:ct.IN_SELECT}function Hun(n,e){n.openElements.currentTagId===K.OPTION&&n.openElements.pop(),n._reconstructActiveFormattingElements(),n._insertElement(e,Nn.HTML)}function Vun(n,e){n.openElements.hasInScope(K.RUBY)&&n.openElements.generateImpliedEndTags(),n._insertElement(e,Nn.HTML)}function Wun(n,e){n.openElements.hasInScope(K.RUBY)&&n.openElements.generateImpliedEndTagsWithExclusion(K.RTC),n._insertElement(e,Nn.HTML)}function zun(n,e){n._reconstructActiveFormattingElements(),Itt(e),oEe(e),e.selfClosing?n._appendElement(e,Nn.MATHML):n._insertElement(e,Nn.MATHML),e.ackSelfClosing=!0}function Uun(n,e){n._reconstructActiveFormattingElements(),Ltt(e),oEe(e),e.selfClosing?n._appendElement(e,Nn.SVG):n._insertElement(e,Nn.SVG),e.ackSelfClosing=!0}function pje(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,Nn.HTML)}function yf(n,e){switch(e.tagID){case K.I:case K.S:case K.B:case K.U:case K.EM:case K.TT:case K.BIG:case K.CODE:case K.FONT:case K.SMALL:case K.STRIKE:case K.STRONG:{Lun(n,e);break}case K.A:{Iun(n,e);break}case K.H1:case K.H2:case K.H3:case K.H4:case K.H5:case K.H6:{wun(n,e);break}case K.P:case K.DL:case K.OL:case K.UL:case K.DIV:case K.DIR:case K.NAV:case K.MAIN:case K.MENU:case K.ASIDE:case K.CENTER:case K.FIGURE:case K.FOOTER:case K.HEADER:case K.HGROUP:case K.DIALOG:case K.DETAILS:case K.ADDRESS:case K.ARTICLE:case K.SECTION:case K.SUMMARY:case K.FIELDSET:case K.BLOCKQUOTE:case K.FIGCAPTION:{Cun(n,e);break}case K.LI:case K.DD:case K.DT:{Eun(n,e);break}case K.BR:case K.IMG:case K.WBR:case K.AREA:case K.EMBED:case K.KEYGEN:{Rtt(n,e);break}case K.HR:{Oun(n,e);break}case K.RB:case K.RTC:{Vun(n,e);break}case K.RT:case K.RP:{Wun(n,e);break}case K.PRE:case K.LISTING:{xun(n,e);break}case K.XMP:{Fun(n,e);break}case K.SVG:{Uun(n,e);break}case K.HTML:{vun(n,e);break}case K.BASE:case K.LINK:case K.META:case K.STYLE:case K.TITLE:case K.SCRIPT:case K.BGSOUND:case K.BASEFONT:case K.TEMPLATE:{Yb(n,e);break}case K.BODY:{bun(n,e);break}case K.FORM:{Sun(n,e);break}case K.NOBR:{Aun(n,e);break}case K.MATH:{zun(n,e);break}case K.TABLE:{Dun(n,e);break}case K.INPUT:{Run(n,e);break}case K.PARAM:case K.TRACK:case K.SOURCE:{Pun(n,e);break}case K.IMAGE:{Mun(n,e);break}case K.BUTTON:{Tun(n,e);break}case K.APPLET:case K.OBJECT:case K.MARQUEE:{Nun(n,e);break}case K.IFRAME:{Bun(n,e);break}case K.SELECT:{$un(n,e);break}case K.OPTION:case K.OPTGROUP:{Hun(n,e);break}case K.NOEMBED:{fje(n,e);break}case K.FRAMESET:{yun(n,e);break}case K.TEXTAREA:{jun(n,e);break}case K.NOSCRIPT:{n.options.scriptingEnabled?fje(n,e):pje(n,e);break}case K.PLAINTEXT:{kun(n,e);break}case K.COL:case K.TH:case K.TD:case K.TR:case K.HEAD:case K.FRAME:case K.TBODY:case K.TFOOT:case K.THEAD:case K.CAPTION:case K.COLGROUP:break;default:pje(n,e)}}function qun(n,e){if(n.openElements.hasInScope(K.BODY)&&(n.insertionMode=ct.AFTER_BODY,n.options.sourceCodeLocationInfo)){const t=n.openElements.tryPeekProperlyNestedBodyElement();t&&n._setEndLocation(t,e)}}function Kun(n,e){n.openElements.hasInScope(K.BODY)&&(n.insertionMode=ct.AFTER_BODY,ztt(n,e))}function Gun(n,e){const t=e.tagID;n.openElements.hasInScope(t)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(t))}function Yun(n){const e=n.openElements.tmplCount>0,{formElement:t}=n;e||(n.formElement=null),(t||e)&&n.openElements.hasInScope(K.FORM)&&(n.openElements.generateImpliedEndTags(),e?n.openElements.popUntilTagNamePopped(K.FORM):t&&n.openElements.remove(t))}function Qun(n){n.openElements.hasInButtonScope(K.P)||n._insertFakeElement(Wt.P,K.P),n._closePElement()}function Xun(n){n.openElements.hasInListItemScope(K.LI)&&(n.openElements.generateImpliedEndTagsWithExclusion(K.LI),n.openElements.popUntilTagNamePopped(K.LI))}function Zun(n,e){const t=e.tagID;n.openElements.hasInScope(t)&&(n.openElements.generateImpliedEndTagsWithExclusion(t),n.openElements.popUntilTagNamePopped(t))}function Jun(n){n.openElements.hasNumberedHeaderInScope()&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilNumberedHeaderPopped())}function edn(n,e){const t=e.tagID;n.openElements.hasInScope(t)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(t),n.activeFormattingElements.clearToLastMarker())}function tdn(n){n._reconstructActiveFormattingElements(),n._insertFakeElement(Wt.BR,K.BR),n.openElements.pop(),n.framesetOk=!1}function Ott(n,e){const t=e.tagName,i=e.tagID;for(let r=n.openElements.stackTop;r>0;r--){const s=n.openElements.items[r],o=n.openElements.tagIDs[r];if(i===o&&(i!==K.UNKNOWN||n.treeAdapter.getTagName(s)===t)){n.openElements.generateImpliedEndTagsWithExclusion(i),n.openElements.stackTop>=r&&n.openElements.shortenToLength(r);break}if(n._isSpecialElement(s,o))break}}function vee(n,e){switch(e.tagID){case K.A:case K.B:case K.I:case K.S:case K.U:case K.EM:case K.TT:case K.BIG:case K.CODE:case K.FONT:case K.NOBR:case K.SMALL:case K.STRIKE:case K.STRONG:{aEe(n,e);break}case K.P:{Qun(n);break}case K.DL:case K.UL:case K.OL:case K.DIR:case K.DIV:case K.NAV:case K.PRE:case K.MAIN:case K.MENU:case K.ASIDE:case K.BUTTON:case K.CENTER:case K.FIGURE:case K.FOOTER:case K.HEADER:case K.HGROUP:case K.DIALOG:case K.ADDRESS:case K.ARTICLE:case K.DETAILS:case K.SECTION:case K.SUMMARY:case K.LISTING:case K.FIELDSET:case K.BLOCKQUOTE:case K.FIGCAPTION:{Gun(n,e);break}case K.LI:{Xun(n);break}case K.DD:case K.DT:{Zun(n,e);break}case K.H1:case K.H2:case K.H3:case K.H4:case K.H5:case K.H6:{Jun(n);break}case K.BR:{tdn(n);break}case K.BODY:{qun(n,e);break}case K.HTML:{Kun(n,e);break}case K.FORM:{Yun(n);break}case K.APPLET:case K.OBJECT:case K.MARQUEE:{edn(n,e);break}case K.TEMPLATE:{LA(n,e);break}default:Ott(n,e)}}function Mtt(n,e){n.tmplInsertionModeStack.length>0?Wtt(n,e):lEe(n,e)}function ndn(n,e){var t;e.tagID===K.SCRIPT&&((t=n.scriptHandler)===null||t===void 0||t.call(n,n.openElements.current)),n.openElements.pop(),n.insertionMode=n.originalInsertionMode}function idn(n,e){n._err(e,fn.eofInElementThatCanContainOnlyText),n.openElements.pop(),n.insertionMode=n.originalInsertionMode,n.onEof(e)}function kle(n,e){if(Att.has(n.openElements.currentTagId))switch(n.pendingCharacterTokens.length=0,n.hasNonWhitespacePendingCharacterToken=!1,n.originalInsertionMode=n.insertionMode,n.insertionMode=ct.IN_TABLE_TEXT,e.type){case fo.CHARACTER:{Ftt(n,e);break}case fo.WHITESPACE_CHARACTER:{jtt(n,e);break}}else T9(n,e)}function rdn(n,e){n.openElements.clearBackToTableContext(),n.activeFormattingElements.insertMarker(),n._insertElement(e,Nn.HTML),n.insertionMode=ct.IN_CAPTION}function sdn(n,e){n.openElements.clearBackToTableContext(),n._insertElement(e,Nn.HTML),n.insertionMode=ct.IN_COLUMN_GROUP}function odn(n,e){n.openElements.clearBackToTableContext(),n._insertFakeElement(Wt.COLGROUP,K.COLGROUP),n.insertionMode=ct.IN_COLUMN_GROUP,cEe(n,e)}function adn(n,e){n.openElements.clearBackToTableContext(),n._insertElement(e,Nn.HTML),n.insertionMode=ct.IN_TABLE_BODY}function ldn(n,e){n.openElements.clearBackToTableContext(),n._insertFakeElement(Wt.TBODY,K.TBODY),n.insertionMode=ct.IN_TABLE_BODY,bee(n,e)}function cdn(n,e){n.openElements.hasInTableScope(K.TABLE)&&(n.openElements.popUntilTagNamePopped(K.TABLE),n._resetInsertionMode(),n._processStartTag(e))}function udn(n,e){Ptt(e)?n._appendElement(e,Nn.HTML):T9(n,e),e.ackSelfClosing=!0}function ddn(n,e){!n.formElement&&n.openElements.tmplCount===0&&(n._insertElement(e,Nn.HTML),n.formElement=n.openElements.current,n.openElements.pop())}function qO(n,e){switch(e.tagID){case K.TD:case K.TH:case K.TR:{ldn(n,e);break}case K.STYLE:case K.SCRIPT:case K.TEMPLATE:{Yb(n,e);break}case K.COL:{odn(n,e);break}case K.FORM:{ddn(n,e);break}case K.TABLE:{cdn(n,e);break}case K.TBODY:case K.TFOOT:case K.THEAD:{adn(n,e);break}case K.INPUT:{udn(n,e);break}case K.CAPTION:{rdn(n,e);break}case K.COLGROUP:{sdn(n,e);break}default:T9(n,e)}}function z8(n,e){switch(e.tagID){case K.TABLE:{n.openElements.hasInTableScope(K.TABLE)&&(n.openElements.popUntilTagNamePopped(K.TABLE),n._resetInsertionMode());break}case K.TEMPLATE:{LA(n,e);break}case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:case K.TBODY:case K.TD:case K.TFOOT:case K.TH:case K.THEAD:case K.TR:break;default:T9(n,e)}}function T9(n,e){const t=n.fosterParentingEnabled;n.fosterParentingEnabled=!0,_ee(n,e),n.fosterParentingEnabled=t}function jtt(n,e){n.pendingCharacterTokens.push(e)}function Ftt(n,e){n.pendingCharacterTokens.push(e),n.hasNonWhitespacePendingCharacterToken=!0}function G5(n,e){let t=0;if(n.hasNonWhitespacePendingCharacterToken)for(;t<n.pendingCharacterTokens.length;t++)T9(n,n.pendingCharacterTokens[t]);else for(;t<n.pendingCharacterTokens.length;t++)n._insertCharacters(n.pendingCharacterTokens[t]);n.insertionMode=n.originalInsertionMode,n._processToken(e)}const Btt=new Set([K.CAPTION,K.COL,K.COLGROUP,K.TBODY,K.TD,K.TFOOT,K.TH,K.THEAD,K.TR]);function hdn(n,e){const t=e.tagID;Btt.has(t)?n.openElements.hasInTableScope(K.CAPTION)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(K.CAPTION),n.activeFormattingElements.clearToLastMarker(),n.insertionMode=ct.IN_TABLE,qO(n,e)):yf(n,e)}function fdn(n,e){const t=e.tagID;switch(t){case K.CAPTION:case K.TABLE:{n.openElements.hasInTableScope(K.CAPTION)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(K.CAPTION),n.activeFormattingElements.clearToLastMarker(),n.insertionMode=ct.IN_TABLE,t===K.TABLE&&z8(n,e));break}case K.BODY:case K.COL:case K.COLGROUP:case K.HTML:case K.TBODY:case K.TD:case K.TFOOT:case K.TH:case K.THEAD:case K.TR:break;default:vee(n,e)}}function cEe(n,e){switch(e.tagID){case K.HTML:{yf(n,e);break}case K.COL:{n._appendElement(e,Nn.HTML),e.ackSelfClosing=!0;break}case K.TEMPLATE:{Yb(n,e);break}default:aK(n,e)}}function pdn(n,e){switch(e.tagID){case K.COLGROUP:{n.openElements.currentTagId===K.COLGROUP&&(n.openElements.pop(),n.insertionMode=ct.IN_TABLE);break}case K.TEMPLATE:{LA(n,e);break}case K.COL:break;default:aK(n,e)}}function aK(n,e){n.openElements.currentTagId===K.COLGROUP&&(n.openElements.pop(),n.insertionMode=ct.IN_TABLE,n._processToken(e))}function bee(n,e){switch(e.tagID){case K.TR:{n.openElements.clearBackToTableBodyContext(),n._insertElement(e,Nn.HTML),n.insertionMode=ct.IN_ROW;break}case K.TH:case K.TD:{n.openElements.clearBackToTableBodyContext(),n._insertFakeElement(Wt.TR,K.TR),n.insertionMode=ct.IN_ROW,yee(n,e);break}case K.CAPTION:case K.COL:case K.COLGROUP:case K.TBODY:case K.TFOOT:case K.THEAD:{n.openElements.hasTableBodyContextInTableScope()&&(n.openElements.clearBackToTableBodyContext(),n.openElements.pop(),n.insertionMode=ct.IN_TABLE,qO(n,e));break}default:qO(n,e)}}function Fpe(n,e){const t=e.tagID;switch(e.tagID){case K.TBODY:case K.TFOOT:case K.THEAD:{n.openElements.hasInTableScope(t)&&(n.openElements.clearBackToTableBodyContext(),n.openElements.pop(),n.insertionMode=ct.IN_TABLE);break}case K.TABLE:{n.openElements.hasTableBodyContextInTableScope()&&(n.openElements.clearBackToTableBodyContext(),n.openElements.pop(),n.insertionMode=ct.IN_TABLE,z8(n,e));break}case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:case K.TD:case K.TH:case K.TR:break;default:z8(n,e)}}function yee(n,e){switch(e.tagID){case K.TH:case K.TD:{n.openElements.clearBackToTableRowContext(),n._insertElement(e,Nn.HTML),n.insertionMode=ct.IN_CELL,n.activeFormattingElements.insertMarker();break}case K.CAPTION:case K.COL:case K.COLGROUP:case K.TBODY:case K.TFOOT:case K.THEAD:case K.TR:{n.openElements.hasInTableScope(K.TR)&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=ct.IN_TABLE_BODY,bee(n,e));break}default:qO(n,e)}}function $tt(n,e){switch(e.tagID){case K.TR:{n.openElements.hasInTableScope(K.TR)&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=ct.IN_TABLE_BODY);break}case K.TABLE:{n.openElements.hasInTableScope(K.TR)&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=ct.IN_TABLE_BODY,Fpe(n,e));break}case K.TBODY:case K.TFOOT:case K.THEAD:{(n.openElements.hasInTableScope(e.tagID)||n.openElements.hasInTableScope(K.TR))&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=ct.IN_TABLE_BODY,Fpe(n,e));break}case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:case K.TD:case K.TH:break;default:z8(n,e)}}function gdn(n,e){const t=e.tagID;Btt.has(t)?(n.openElements.hasInTableScope(K.TD)||n.openElements.hasInTableScope(K.TH))&&(n._closeTableCell(),yee(n,e)):yf(n,e)}function mdn(n,e){const t=e.tagID;switch(t){case K.TD:case K.TH:{n.openElements.hasInTableScope(t)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(t),n.activeFormattingElements.clearToLastMarker(),n.insertionMode=ct.IN_ROW);break}case K.TABLE:case K.TBODY:case K.TFOOT:case K.THEAD:case K.TR:{n.openElements.hasInTableScope(t)&&(n._closeTableCell(),$tt(n,e));break}case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:break;default:vee(n,e)}}function Htt(n,e){switch(e.tagID){case K.HTML:{yf(n,e);break}case K.OPTION:{n.openElements.currentTagId===K.OPTION&&n.openElements.pop(),n._insertElement(e,Nn.HTML);break}case K.OPTGROUP:{n.openElements.currentTagId===K.OPTION&&n.openElements.pop(),n.openElements.currentTagId===K.OPTGROUP&&n.openElements.pop(),n._insertElement(e,Nn.HTML);break}case K.INPUT:case K.KEYGEN:case K.TEXTAREA:case K.SELECT:{n.openElements.hasInSelectScope(K.SELECT)&&(n.openElements.popUntilTagNamePopped(K.SELECT),n._resetInsertionMode(),e.tagID!==K.SELECT&&n._processStartTag(e));break}case K.SCRIPT:case K.TEMPLATE:{Yb(n,e);break}}}function Vtt(n,e){switch(e.tagID){case K.OPTGROUP:{n.openElements.stackTop>0&&n.openElements.currentTagId===K.OPTION&&n.openElements.tagIDs[n.openElements.stackTop-1]===K.OPTGROUP&&n.openElements.pop(),n.openElements.currentTagId===K.OPTGROUP&&n.openElements.pop();break}case K.OPTION:{n.openElements.currentTagId===K.OPTION&&n.openElements.pop();break}case K.SELECT:{n.openElements.hasInSelectScope(K.SELECT)&&(n.openElements.popUntilTagNamePopped(K.SELECT),n._resetInsertionMode());break}case K.TEMPLATE:{LA(n,e);break}}}function _dn(n,e){const t=e.tagID;t===K.CAPTION||t===K.TABLE||t===K.TBODY||t===K.TFOOT||t===K.THEAD||t===K.TR||t===K.TD||t===K.TH?(n.openElements.popUntilTagNamePopped(K.SELECT),n._resetInsertionMode(),n._processStartTag(e)):Htt(n,e)}function vdn(n,e){const t=e.tagID;t===K.CAPTION||t===K.TABLE||t===K.TBODY||t===K.TFOOT||t===K.THEAD||t===K.TR||t===K.TD||t===K.TH?n.openElements.hasInTableScope(t)&&(n.openElements.popUntilTagNamePopped(K.SELECT),n._resetInsertionMode(),n.onEndTag(e)):Vtt(n,e)}function bdn(n,e){switch(e.tagID){case K.BASE:case K.BASEFONT:case K.BGSOUND:case K.LINK:case K.META:case K.NOFRAMES:case K.SCRIPT:case K.STYLE:case K.TEMPLATE:case K.TITLE:{Yb(n,e);break}case K.CAPTION:case K.COLGROUP:case K.TBODY:case K.TFOOT:case K.THEAD:{n.tmplInsertionModeStack[0]=ct.IN_TABLE,n.insertionMode=ct.IN_TABLE,qO(n,e);break}case K.COL:{n.tmplInsertionModeStack[0]=ct.IN_COLUMN_GROUP,n.insertionMode=ct.IN_COLUMN_GROUP,cEe(n,e);break}case K.TR:{n.tmplInsertionModeStack[0]=ct.IN_TABLE_BODY,n.insertionMode=ct.IN_TABLE_BODY,bee(n,e);break}case K.TD:case K.TH:{n.tmplInsertionModeStack[0]=ct.IN_ROW,n.insertionMode=ct.IN_ROW,yee(n,e);break}default:n.tmplInsertionModeStack[0]=ct.IN_BODY,n.insertionMode=ct.IN_BODY,yf(n,e)}}function ydn(n,e){e.tagID===K.TEMPLATE&&LA(n,e)}function Wtt(n,e){n.openElements.tmplCount>0?(n.openElements.popUntilTagNamePopped(K.TEMPLATE),n.activeFormattingElements.clearToLastMarker(),n.tmplInsertionModeStack.shift(),n._resetInsertionMode(),n.onEof(e)):lEe(n,e)}function Cdn(n,e){e.tagID===K.HTML?yf(n,e):lK(n,e)}function ztt(n,e){var t;if(e.tagID===K.HTML){if(n.fragmentContext||(n.insertionMode=ct.AFTER_AFTER_BODY),n.options.sourceCodeLocationInfo&&n.openElements.tagIDs[0]===K.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 lK(n,e)}function lK(n,e){n.insertionMode=ct.IN_BODY,_ee(n,e)}function wdn(n,e){switch(e.tagID){case K.HTML:{yf(n,e);break}case K.FRAMESET:{n._insertElement(e,Nn.HTML);break}case K.FRAME:{n._appendElement(e,Nn.HTML),e.ackSelfClosing=!0;break}case K.NOFRAMES:{Yb(n,e);break}}}function xdn(n,e){e.tagID===K.FRAMESET&&!n.openElements.isRootHtmlElementCurrent()&&(n.openElements.pop(),!n.fragmentContext&&n.openElements.currentTagId!==K.FRAMESET&&(n.insertionMode=ct.AFTER_FRAMESET))}function Sdn(n,e){switch(e.tagID){case K.HTML:{yf(n,e);break}case K.NOFRAMES:{Yb(n,e);break}}}function Edn(n,e){e.tagID===K.HTML&&(n.insertionMode=ct.AFTER_AFTER_FRAMESET)}function kdn(n,e){e.tagID===K.HTML?yf(n,e):$z(n,e)}function $z(n,e){n.insertionMode=ct.IN_BODY,_ee(n,e)}function Tdn(n,e){switch(e.tagID){case K.HTML:{yf(n,e);break}case K.NOFRAMES:{Yb(n,e);break}}}function Idn(n,e){e.chars=ac,n._insertCharacters(e)}function Ldn(n,e){n._insertCharacters(e),n.framesetOk=!1}function Utt(n){for(;n.treeAdapter.getNamespaceURI(n.openElements.current)!==Nn.HTML&&!n._isIntegrationPoint(n.openElements.currentTagId,n.openElements.current);)n.openElements.pop()}function Adn(n,e){if(Ucn(e))Utt(n),n._startTagOutsideForeignContent(e);else{const t=n._getAdjustedCurrentElement(),i=n.treeAdapter.getNamespaceURI(t);i===Nn.MATHML?Itt(e):i===Nn.SVG&&(qcn(e),Ltt(e)),oEe(e),e.selfClosing?n._appendElement(e,i):n._insertElement(e,i),e.ackSelfClosing=!0}}function Ndn(n,e){if(e.tagID===K.P||e.tagID===K.BR){Utt(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}}}Wt.AREA,Wt.BASE,Wt.BASEFONT,Wt.BGSOUND,Wt.BR,Wt.COL,Wt.EMBED,Wt.FRAME,Wt.HR,Wt.IMG,Wt.INPUT,Wt.KEYGEN,Wt.LINK,Wt.META,Wt.PARAM,Wt.SOURCE,Wt.TRACK,Wt.WBR;const Ddn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),gje={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function qtt(n,e){const t=Vdn(n),i=htt("type",{handlers:{root:Rdn,element:Pdn,text:Odn,comment:Gtt,doctype:Mdn,raw:Fdn},unknown:Bdn}),r={parser:t?new hje(gje):hje.getFragmentParser(void 0,gje),handle(a){i(a,r)},stitches:!1,options:e||{}};i(n,r),L4(r,g1());const s=t?r.parser.document:r.parser.getFragment(),o=zln(s,{file:r.options.file});return r.stitches&&nEe(o,"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}}),o.type==="root"&&o.children.length===1&&o.children[0].type===n.type?o.children[0]:o}function Ktt(n,e){let t=-1;if(n)for(;++t<n.length;)e.handle(n[t])}function Rdn(n,e){Ktt(n.children,e)}function Pdn(n,e){$dn(n,e),Ktt(n.children,e),Hdn(n,e)}function Odn(n,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const t={type:fo.CHARACTER,chars:n.value,location:I9(n)};L4(e,g1(n)),e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken)}function Mdn(n,e){const t={type:fo.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:I9(n)};L4(e,g1(n)),e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken)}function jdn(n,e){e.stitches=!0;const t=Wdn(n);if("children"in n&&"children"in t){const i=qtt({type:"root",children:n.children},e.options);t.children=i.children}Gtt({type:"comment",value:{stitch:t}},e)}function Gtt(n,e){const t=n.value,i={type:fo.COMMENT,data:t,location:I9(n)};L4(e,g1(n)),e.parser.currentToken=i,e.parser._processToken(e.parser.currentToken)}function Fdn(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,Ytt(e,g1(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 Bdn(n,e){const t=n;if(e.options.passThrough&&e.options.passThrough.includes(t.type))jdn(t,e);else{let i="";throw Ddn.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 L4(n,e){Ytt(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=fu.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 Ytt(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 $dn(n,e){const t=n.tagName.toLowerCase();if(e.parser.tokenizer.state===fu.PLAINTEXT)return;L4(e,g1(n));const i=e.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:z2.html;r===z2.html&&t==="svg"&&(r=z2.svg);const s=Yln({...n,children:[]},{space:r===z2.svg?"svg":"html"}),o={type:fo.START_TAG,tagName:t,tagID:I4(t),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:I9(n)};e.parser.currentToken=o,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=t}function Hdn(n,e){const t=n.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&icn.includes(t)||e.parser.tokenizer.state===fu.PLAINTEXT)return;L4(e,fee(n));const i={type:fo.END_TAG,tagName:t,tagID:I4(t),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:I9(n)};e.parser.currentToken=i,e.parser._processToken(e.parser.currentToken),t===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===fu.RCDATA||e.parser.tokenizer.state===fu.RAWTEXT||e.parser.tokenizer.state===fu.SCRIPT_DATA)&&(e.parser.tokenizer.state=fu.DATA)}function Vdn(n){const e=n.type==="root"?n.children[0]:n;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function I9(n){const e=g1(n)||{line:void 0,column:void 0,offset:void 0},t=fee(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 Wdn(n){return"children"in n?UO({...n,children:[]}):UO(n)}function zdn(n){return function(e,t){return qtt(e,{...n,file:t})}}function Udn(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 uEe({id:n,url:e}){const{t}=xe(),{data:i}=lr({queryKey:["help-widget",n,e],queryFn:()=>fetch(e).then(l=>l.text().then(Udn))}),[,r]=e.split("v5-rework/source"),s=xt(),o=x.useRef(null),a=x.useRef(null);return x.useEffect(()=>{const l=new AbortController;return window.addEventListener(`help-widget-${n}:moveToHeading`,c=>{var u;if("detail"in c&&o.current&&a.current){const d=(u=o.current)==null?void 0:u.querySelectorAll("h3");if(d){const f=Array.from(d).findIndex(p=>p.innerText===c.detail);if(f>-1){const p=d[f];p&&a.current.scrollTo({behavior:"smooth",top:p.offsetTop-50})}}}},{signal:l.signal}),()=>l.abort()},[]),Bm.createPortal(h.jsxs("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:s.$1,color:s.$3,borderColor:s.$4},ref:a,children:[h.jsxs("div",{className:"flex justify-between items-center sticky px-5 py-3 top-0",style:{backgroundColor:s.$1},children:[h.jsx("div",{}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("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:h.jsx(NCe,{size:18})}),h.jsx("button",{children:h.jsx(JM,{size:20,onClick:()=>KO(n)})})]})]}),h.jsxs("div",{className:"prose-sm p-5",ref:o,children:[h.jsx(Iln,{rehypePlugins:[zdn],children:i}),h.jsx("div",{className:"flex justify-center",children:h.jsxs(Ji,{to:`https://invoiceninja.github.io/${r.replace(".md","")}`,external:!0,className:"flex items-center space-x-2",children:[h.jsx("span",{children:t("view_docs")})," ",h.jsx(TZ,{size:16})]})})]})]}),document.body)}function KO(n,e){const t=document.querySelector(`div#help-widget-${n}`);t&&(t.classList.toggle("hidden"),e!=null&&e.moveToHeading&&window.dispatchEvent(new CustomEvent(`help-widget-${n}:moveToHeading`,{detail:e.moveToHeading})))}function qdn(){const{t:n}=xe(),e=xt(),t=Lo(),i=Nr(),r=Xs(),[s,o]=x.useState(!1),a=(l,c)=>{r("calculate_taxes",l),o(!1)};return h.jsxs(h.Fragment,{children:[h.jsx(pr,{title:n("calculate_taxes"),visible:s,onClose:()=>a(!1),children:h.jsxs("div",{className:"flex flex-col space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[h.jsx("div",{children:h.jsx(an,{element:cTt,color:"orange",size:24})}),h.jsxs("span",{className:"font-medium text-center break-words",children:[n("calculate_taxes_warning"),"."]})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx(dn,{type:"secondary",behavior:"button",onClick:()=>a(!1),children:n("cancel")}),h.jsx(dn,{behavior:"button",onClick:()=>o(!1),children:n("continue")})]})]})}),h.jsx(ne,{leftSide:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{children:n("calculate_taxes")}),h.jsxs("div",{className:"flex",children:[h.jsx("span",{style:{color:e.$22},children:"("}),h.jsx("button",{type:"button",style:{color:t},onClick:()=>KO("calculate-taxes",{moveToHeading:"Turn on Calculate Taxes"}),className:"inline-flex items-center space-x-1",children:h.jsx("span",{children:n("learn_more")})}),h.jsx("span",{style:{color:e.$22},children:")"})]})]}),leftSideHelp:n("calculate_taxes_help"),children:h.jsx(jt,{checked:!!(i!=null&&i.calculate_taxes),onValueChange:l=>{r("calculate_taxes",l),l&&o(!0)}})})]})}function Kdn(){var a,l,c,u,d,f,p,g,m;const[n]=xe(),e=xt(),t=Nr(),i=ji(ya),{data:r}=xxe({perPage:100,status:["active"]}),s=Xs(),o=(_,v,b)=>{v?(s(`settings.tax_name${_}`,v),s(`settings.tax_rate${_}`,b)):(s(`settings.tax_name${_}`,""),s(`settings.tax_rate${_}`,0))};return!Number(t.enabled_item_tax_rates)||Number(t.enabled_tax_rates)?null:h.jsxs(er,{className:"shadow-sm",style:{borderColor:e.$24},children:[(t==null?void 0:t.enabled_item_tax_rates)>0&&r&&h.jsx(ne,{leftSide:n("default_tax_rate"),children:h.jsx(Dn,{value:(a=t==null?void 0:t.settings)!=null&&a.tax_name1?`${(l=t==null?void 0:t.settings)==null?void 0:l.tax_name1}|%|${(c=t==null?void 0:t.settings)==null?void 0:c.tax_rate1}`:"",onValueChange:_=>{var v,b;return o("1",(v=_.split("|%|"))==null?void 0:v[0],Number(((b=_.split("|%|"))==null?void 0:b[1])||0))},withBlank:!0,errorMessage:i==null?void 0:i.errors["settings.tax_rate1"],customSelector:!0,children:r.data.data.map(_=>h.jsxs("option",{value:`${_.name}|%|${_.rate}`,children:[_.rate,"% — ",_.name]},_.id))})}),(t==null?void 0:t.enabled_item_tax_rates)>1&&r&&h.jsx(ne,{leftSide:n("default_tax_rate"),children:h.jsx(Dn,{value:(u=t==null?void 0:t.settings)!=null&&u.tax_name2?`${(d=t==null?void 0:t.settings)==null?void 0:d.tax_name2}|%|${(f=t==null?void 0:t.settings)==null?void 0:f.tax_rate2}`:"",onValueChange:_=>{var v,b;return o("2",(v=_.split("|%|"))==null?void 0:v[0],Number(((b=_.split("|%|"))==null?void 0:b[1])||0))},withBlank:!0,errorMessage:i==null?void 0:i.errors["settings.tax_rate2"],customSelector:!0,children:r.data.data.map(_=>h.jsxs("option",{value:`${_.name}|%|${_.rate}`,children:[_.rate,"% — ",_.name]},_.id))})}),(t==null?void 0:t.enabled_item_tax_rates)>2&&r&&h.jsx(ne,{leftSide:n("default_tax_rate"),children:h.jsx(Dn,{value:(p=t==null?void 0:t.settings)!=null&&p.tax_name3?`${(g=t==null?void 0:t.settings)==null?void 0:g.tax_name3}|%|${(m=t==null?void 0:t.settings)==null?void 0:m.tax_rate3}`:"",onValueChange:_=>{var v,b;return o("3",(v=_.split("|%|"))==null?void 0:v[0],Number(((b=_.split("|%|"))==null?void 0:b[1])||0))},withBlank:!0,errorMessage:i==null?void 0:i.errors["settings.tax_rate3"],customSelector:!0,children:r.data.data.map(_=>h.jsxs("option",{value:`${_.name}|%|${_.rate}`,children:[_.rate,"% — ",_.name]},_.id))})})]})}function Gdn(){var m,_,v,b;const[n]=xe(),e=[{name:n("settings"),href:"/settings"},{name:n("tax_settings"),href:"/settings/tax_settings"}];xu(),vr("tax_settings");const t=xt();HUt();const i=grn(),{isCompanySettingsActive:r,isGroupSettingsActive:s,isClientSettingsActive:o}=el(),a=ji(ya),l=Fr(),c=Nr(),u=Xs(),d=(y,C)=>{l(Uo({object:"company",property:y,value:C}))},f=pd(),p=xg(),g=ji(_f);return h.jsxs(Kr,{onSaveClick:f,onCancelClick:p,title:n("tax_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#tax_settings",disableSaveButton:g,children:[r&&h.jsxs(h.Fragment,{children:[h.jsxs(er,{title:n("tax_settings"),className:"shadow-sm pb-6",childrenClassName:"pt-4",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},withoutBodyPadding:!0,children:[!c.calculate_taxes&&h.jsx(ne,{leftSide:n("invoice_tax_rates"),children:h.jsxs(Dn,{value:((m=c==null?void 0:c.enabled_tax_rates)==null?void 0:m.toString())||"0",onValueChange:y=>u("enabled_tax_rates",Number(y)),errorMessage:a==null?void 0:a.errors.enabled_tax_rates,customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"0",children:n("disabled")}),h.jsx("option",{value:"1",children:n("one_tax_rate")}),h.jsx("option",{value:"2",children:n("two_tax_rates")}),h.jsx("option",{value:"3",children:n("three_tax_rates")})]})}),h.jsx(ne,{leftSide:n("line_item_tax_rates"),children:h.jsxs(Dn,{value:((_=c==null?void 0:c.enabled_item_tax_rates)==null?void 0:_.toString())||"0",onValueChange:y=>u("enabled_item_tax_rates",Number(y)),errorMessage:a==null?void 0:a.errors.enabled_item_tax_rates,customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"0",children:n("disabled")}),h.jsx("option",{value:"1",children:n("one_tax_rate")}),h.jsx("option",{value:"2",children:n("two_tax_rates")}),h.jsx("option",{value:"3",children:n("three_tax_rates")})]})}),h.jsx(ne,{leftSide:n("expense_tax_rates"),children:h.jsxs(Dn,{value:((v=c==null?void 0:c.enabled_expense_tax_rates)==null?void 0:v.toString())||"0",onValueChange:y=>u("enabled_expense_tax_rates",Number(y)),errorMessage:a==null?void 0:a.errors.enabled_expense_tax_rates,customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"0",children:n("disabled")}),h.jsx("option",{value:"1",children:n("one_tax_rate")}),h.jsx("option",{value:"2",children:n("two_tax_rates")}),h.jsx("option",{value:"3",children:n("three_tax_rates")})]})}),c.calculate_taxes?null:h.jsx(ne,{leftSide:n("inclusive_taxes"),children:h.jsxs("div",{className:"flex items-center space-x-7",children:[h.jsx(jt,{onChange:y=>d("settings.inclusive_taxes",y),checked:!!(c!=null&&c.settings.inclusive_taxes),cypressRef:"inclusiveTaxToggle"}),c!=null&&c.settings.inclusive_taxes?h.jsxs("span",{children:[n("inclusive"),": 100 + 10% = 90.91 + 9.09"]}):h.jsxs("span",{children:[n("exclusive"),": 100 + 10% = 100 + 10"]})]})}),i((b=c==null?void 0:c.settings)==null?void 0:b.country_id)&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-2",children:h.jsx(Ki,{className:"border-dashed",style:{borderColor:t.$20},withoutPadding:!0})}),h.jsx(qdn,{}),c.calculate_taxes&&h.jsx(prn,{})]})]}),h.jsx(p5e,{}),c.enabled_item_tax_rates>0&&!c.enabled_tax_rates&&h.jsx(Kdn,{})]}),(s||o)&&h.jsx(p5e,{title:"tax_settings"}),h.jsx(oCn,{}),h.jsx(uEe,{id:"calculate-taxes",url:"https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source/en/taxes.md"})]})}function Ydn(){vr("product_settings");const[n]=xe(),e=[{name:n("settings"),href:"/settings"},{name:n("product_settings"),href:"/settings/product_settings"}];xu();const t=xt(),i=Nr(),r=Fr(),s=xg(),o=pd(),a=Xs(),l=ji(ya),c=ji(_f),u=(d,f)=>{r(Uo({object:"company",property:d,value:f}))};return h.jsx(Kr,{onSaveClick:o,onCancelClick:s,title:n("product_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#product_settings",disableSaveButton:c,children:h.jsxs(er,{title:n("settings"),className:"shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:[h.jsx(ne,{leftSide:n("track_inventory"),leftSideHelp:n("track_inventory_help"),children:h.jsx(jt,{checked:i==null?void 0:i.track_inventory,onChange:d=>u("track_inventory",d)})}),h.jsx(ne,{leftSide:n("stock_notifications"),leftSideHelp:n("stock_notifications_help"),children:h.jsx(jt,{checked:i==null?void 0:i.stock_notification,onChange:d=>u("stock_notification",d)})}),(i==null?void 0:i.stock_notification)===!0?h.jsx(h.Fragment,{children:h.jsx(ne,{leftSide:n("notification_threshold"),children:h.jsx(Qs,{precision:0,value:(i==null?void 0:i.inventory_notification_threshold)||"",onValueChange:d=>a("inventory_notification_threshold",parseFloat(d)),errorMessage:l==null?void 0:l.errors.inventory_notification_threshold,disablePrecision:!0})})}):"",h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",style:{borderColor:t.$20},withoutPadding:!0})}),h.jsx(ne,{leftSide:n("show_product_discount"),leftSideHelp:n("show_product_discount_help"),children:h.jsx(jt,{checked:i==null?void 0:i.enable_product_discount,onChange:d=>u("enable_product_discount",d)})}),h.jsx(ne,{leftSide:n("show_product_cost"),leftSideHelp:n("show_cost_help"),children:h.jsx(jt,{checked:i==null?void 0:i.enable_product_cost,onChange:d=>u("enable_product_cost",d)})}),h.jsx(ne,{leftSide:n("show_product_quantity"),leftSideHelp:n("show_product_quantity_help"),children:h.jsx(jt,{checked:i==null?void 0:i.enable_product_quantity,onChange:d=>u("enable_product_quantity",d)})}),h.jsx(ne,{leftSide:n("default_quantity"),leftSideHelp:n("default_quantity_help"),children:h.jsx(jt,{checked:i==null?void 0:i.default_quantity,onChange:d=>u("default_quantity",d)})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",style:{borderColor:t.$20},withoutPadding:!0})}),h.jsx(ne,{leftSide:n("fill_products"),leftSideHelp:n("fill_products_help"),children:h.jsx(jt,{checked:i==null?void 0:i.fill_products,onChange:d=>u("fill_products",d)})}),h.jsx(ne,{leftSide:n("update_products"),leftSideHelp:n("update_products_help"),children:h.jsx(jt,{checked:i==null?void 0:i.update_products,onChange:d=>u("update_products",d)})}),h.jsx(ne,{leftSide:n("convert_products"),leftSideHelp:n("convert_products_help"),children:h.jsx(jt,{checked:i==null?void 0:i.convert_products,onChange:d=>u("convert_products",d)})})]})})}function Qdn(){var g,m,_,v,b,y,C,S;vr("task_settings");const[n]=xe();xu();const e=Fr(),t=xg(),i=pd(),r=cl(),s=Xs(),o=xt(),a=Nr(),l=ji(ya),c=ji(_f),{isCompanySettingsActive:u}=el(),d=[{name:n("settings"),href:"/settings"},{name:n("task_settings"),href:"/settings/task_settings"}],f=()=>{var k;return((k=a==null?void 0:a.settings)==null?void 0:k.task_round_to_nearest)===-1||![1,60,300,900,1800,3600,86400].find(I=>{var L;return I===((L=a==null?void 0:a.settings)==null?void 0:L.task_round_to_nearest)})},p=(k,I)=>e(Uo({object:"company",property:k,value:I}));return h.jsxs(Kr,{onSaveClick:i,onCancelClick:t,title:n("task_settings"),breadcrumbs:d,docsLink:"en/basic-settings/#task_settings",disableSaveButton:c,children:[h.jsxs(er,{title:n("settings"),className:"shadow-sm pb-6",childrenClassName:"pt-4",style:{borderColor:o.$24},headerStyle:{borderColor:o.$20},withoutBodyPadding:!0,children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"default_task_rate",labelElement:h.jsx(un,{label:n("default_task_rate")})}),children:h.jsx(Qs,{value:((g=a==null?void 0:a.settings)==null?void 0:g.default_task_rate)||"",onValueChange:k=>s("settings.default_task_rate",parseFloat(k)),disabled:r("default_task_rate"),errorMessage:l==null?void 0:l.errors["settings.default_task_rate"]})}),u&&h.jsx(ne,{leftSide:n("auto_start_tasks"),leftSideHelp:n("auto_start_tasks_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.auto_start_tasks),onChange:k=>p("auto_start_tasks",k)})}),u&&h.jsx(ne,{leftSide:n("show_task_end_date"),leftSideHelp:n("show_task_end_date_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.show_task_end_date),onChange:k=>p("show_task_end_date",k)})}),u&&h.jsx(ne,{leftSide:n("show_task_item_description"),leftSideHelp:n("show_task_item_description_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.settings.show_task_item_description),onChange:k=>p("settings.show_task_item_description",k)})}),u&&h.jsx(ne,{leftSide:n("allow_billable_task_items"),leftSideHelp:n("allow_billable_task_items_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.settings.allow_billable_task_items),onChange:k=>p("settings.allow_billable_task_items",k)})}),u&&h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",style:{borderColor:o.$20},withoutPadding:!0})}),u&&h.jsx(ne,{leftSide:n("show_tasks_table"),leftSideHelp:n("show_tasks_table_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.show_tasks_table),onChange:k=>p("show_tasks_table",k)})}),u&&h.jsx(ne,{leftSide:n("invoice_task_datelog"),leftSideHelp:n("invoice_task_datelog_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.invoice_task_datelog),onChange:k=>p("invoice_task_datelog",k)})}),u&&h.jsx(ne,{leftSide:n("invoice_task_timelog"),leftSideHelp:n("invoice_task_timelog_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.invoice_task_timelog),onChange:k=>p("invoice_task_timelog",k)})}),u&&h.jsx(ne,{leftSide:n("invoice_task_hours"),leftSideHelp:n("invoice_task_hours_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.invoice_task_hours),onChange:k=>p("invoice_task_hours",k)})}),u&&h.jsx(ne,{leftSide:n("invoice_task_project"),leftSideHelp:n("invoice_task_project_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.invoice_task_project),onChange:k=>p("invoice_task_project",k)})}),u&&h.jsx(ne,{leftSide:n("invoice_task_item_description"),leftSideHelp:n("invoice_task_item_description_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.invoice_task_item_description),onChange:k=>p("invoice_task_item_description",k)})}),u&&h.jsx(ne,{leftSide:n("lock_invoiced_tasks"),leftSideHelp:n("lock_invoiced_tasks_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.invoice_task_lock),onChange:k=>p("invoice_task_lock",k)})}),u&&h.jsx(ne,{leftSide:n("add_documents_to_invoice"),leftSideHelp:n("add_documents_to_invoice_help"),children:h.jsx(jt,{checked:!!(a!=null&&a.invoice_task_documents),onChange:k=>p("invoice_task_documents",k)})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",style:{borderColor:o.$20},withoutPadding:!0})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"enable_client_portal_tasks",labelElement:h.jsx(un,{label:n("show_tasks_in_client_portal")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!((m=a==null?void 0:a.settings)!=null&&m.enable_client_portal_tasks),onChange:k=>p("settings.enable_client_portal_tasks",k),disabled:r("enable_client_portal_tasks")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"show_all_tasks_client_portal",labelElement:h.jsx(un,{label:n("tasks_shown_in_portal")}),defaultValue:"invoiced"}),children:h.jsxs(Dn,{value:((v=(_=a==null?void 0:a.settings)==null?void 0:_.show_all_tasks_client_portal)==null?void 0:v.toString())||"invoiced",onValueChange:k=>s("settings.show_all_tasks_client_portal",k),disabled:!((b=a==null?void 0:a.settings)!=null&&b.enable_client_portal_tasks)||r("show_all_tasks_client_portal"),errorMessage:l==null?void 0:l.errors["settings.show_all_tasks_client_portal"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"invoiced",children:n("invoiced")}),h.jsx("option",{value:"uninvoiced",children:n("uninvoiced")}),h.jsx("option",{value:"all",children:n("all")})]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"task_round_up",labelElement:h.jsx(un,{label:n("round_tasks"),helpLabel:n("round_tasks_help")}),defaultValue:!0}),children:h.jsxs("div",{className:"flex items-center space-x-7",children:[h.jsx(jt,{checked:!!(((y=a==null?void 0:a.settings)==null?void 0:y.task_round_up)??!0),onChange:k=>p("settings.task_round_up",k),disabled:r("task_round_up")}),a!=null&&a.settings.task_round_up?h.jsx("span",{children:n("round_up")}):h.jsx("span",{children:n("round_down")})]})}),h.jsx(ne,{leftSideHelp:n("task_round_to_nearest_help"),leftSide:h.jsx(cn,{propertyKey:"task_round_to_nearest",labelElement:h.jsx(un,{label:n("task_round_to_nearest")}),defaultValue:1}),children:h.jsxs(Dn,{value:typeof((C=a==null?void 0:a.settings)==null?void 0:C.task_round_to_nearest)<"u"?f()?"-1":a.settings.task_round_to_nearest.toString():"1",onValueChange:k=>s("settings.task_round_to_nearest",parseFloat(k)),disabled:r("task_round_to_nearest"),customSelector:!0,dismissable:!1,children:[h.jsxs("option",{value:"1",children:[n("1_second")," (",n("disabled"),")"]}),h.jsx("option",{value:"60",children:n("1_minute")}),h.jsx("option",{value:"300",children:Ua("count_minutes",{count:5})}),h.jsx("option",{value:"900",children:Ua("count_minutes",{count:15})}),h.jsx("option",{value:"1800",children:Ua("count_minutes",{count:30})}),h.jsx("option",{value:"3600",children:n("1_hour")}),h.jsx("option",{value:"86400",children:n("1_day")}),h.jsx("option",{value:"-1",children:n("custom")})]})}),f()&&h.jsx(ne,{leftSide:n("task_round_to_nearest"),children:h.jsx(Qs,{precision:0,value:((S=a==null?void 0:a.settings)==null?void 0:S.task_round_to_nearest)||-1,onValueChange:k=>s("settings.task_round_to_nearest",parseFloat(k)),disabled:r("task_round_to_nearest"),disablePrecision:!0})})]}),u&&h.jsx(mCn,{})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Qtt(){const[n]=xe();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 Xdn=HQe(()=>sessionStorage),Xtt=jJ("dataTableFilters",{},Xdn);function Zdn(n){const{tableKey:e}=n,t=ts(Xtt);return(i,r)=>{e&&t(s=>({...s,[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 Ztt(n){const e=bZ(),{tableKey:t}=n,i=ji(Xtt);return r=>{var o,a,l;if(!t)return"";if(r==="filter"||r==="currentPage")return(o=i==null?void 0:i[t])!=null&&o[r]?i[t][r]:"";const s=(a=e==null?void 0:e.company_user)==null?void 0:a.react_settings.table_filters;return(l=s==null?void 0:s[t])!=null&&l[r]?s[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 Jdn(n){const e=Qtt(),{isInitialConfiguration:t,tableKey:i,customFilters:r,apiEndpoint:s,customFilter:o}=n,a=Ztt({tableKey:i}),l=()=>{if(!t){const d=a("status"),f=d!=null&&d.length?d:["active"];return e.filter(({value:p})=>f.includes(p))||[e[0]]}},c=()=>{if(!t&&r){const d=a("customFilter"),f=d!=null&&d.length?d:[];return r.filter(({value:p})=>f.includes(p))||[r[0]]}},u=()=>{r&&ql(r).pluck("queryKey").unique().toArray().forEach(f=>{const p=f||"client_status",g=[];r.forEach((m,_)=>{(m.queryKey||null)===f&&(o!=null&&o.includes(m.value))&&g.push(m.value),_===r.length-1&&s.searchParams.set(p,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 ehn(n){const e=Ml(),t=Fr(),i=x.useRef(),{apiEndpoint:r,customFilters:s,tableKey:o,isInitialConfiguration:a,customFilter:l,setFilter:c,setCustomFilter:u,setCurrentPage:d,setSort:f,setSortedBy:p,setStatus:g,setPerPage:m,setArePreferencesApplied:_,withoutStoringPerPage:v,enableSavingFilterPreference:b,withoutStoringPage:y}=n,C=Ztt({tableKey:o}),S=Zdn({tableKey:o}),k=L=>{Je("PUT",ze("/api/v1/company_users/:id",{id:L.id}),L).then(N=>{pn.set(L,"company_user",N.data.data),ii(["company_users"]),i.current=L})},I=(L,N,P,O,F,V)=>{var U,G,H;if(!l||!o||!b)return;const M=(G=(U=e==null?void 0:e.company_user)==null?void 0:U.react_settings.table_filters)==null?void 0:G[o],B={...s&&{customFilter:[]},sort:r.searchParams.get("sort")||"id|asc",status:["active"],...!v&&{perPage:"10"},...!y&&{currentPage:1}},W={...N&&{sortedBy:N},...s&&{customFilter:l},sort:P,status:F,...!v&&{perPage:V},...!y&&{currentPage:O}};if(M&&v&&delete M.perPage,M&&y&&delete M.currentPage,S(L,O),pn.isEqual(B,W)&&!M||pn.isEqual(M,W)&&M)return;const q=pn.cloneDeep(e);if(q){const z=((H=q.company_user)==null?void 0:H.react_settings.table_filters)||{};Object.keys(z).forEach(Z=>{Z.includes("/")&&delete z[Z]}),pn.set(q,`company_user.react_settings.table_filters.${o}`,W),k(q)}};return x.useEffect(()=>{!a&&!l&&(c(C("filter")||""),s?C("customFilter").length?u(C("customFilter")):u([]):u([]),v||m(C("perPage")||"10"),y||d(C("currentPage")||1),f(C("sort")||"id|asc"),p(C("sortedBy")||void 0),C("status").length?g(C("status")):g(["active"]),_(!0))},[a]),x.useEffect(()=>()=>{i.current&&(t(iw(i.current)),t(Mj(i.current)))},[]),{handleUpdateTableFilters: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 thn(n){const{size:e="1.2rem",color:t="#000"}=n;return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("line",{x1:"5.75",y1:"2.75",x2:"5.75",y2:".75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("line",{x1:"12.25",y1:"2.75",x2:"12.25",y2:".75",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("rect",{x:"2.25",y:"2.75",width:"13.5",height:"12.5",rx:"2",ry:"2",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"2.25",y1:"6.25",x2:"15.75",y2:"6.25",fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}const dEe=Ls(null),{RangePicker:nhn}=SA,ihn=As(nhn)` &:focus { border: none; outline: none; } &.ant-picker { border-color: var(--picker-border-color); width: 16rem; height: 2.5rem; background-color: var(--picker-bg); } &.ant-picker-focused { border-color: var(--accent-color) !important; box-shadow: none !important; } .ant-picker-suffix { display: none; } .ant-picker-input { text-align: center; display: flex; justify-content: center; } .ant-picker-input input { text-align: center; justify-content: center; color: var(--input-text-color) !important; } .ant-picker-input-active { background-color: var(--active-state-bg); border-radius: 4px; } .ant-picker-input-active input { color: var(--accent-color); font-weight: 500; } &.ant-picker-range-active .ant-picker-input-active input { color: var(--accent-color); } .ant-picker-range-separator { display: flex; align-items: center; margin-bottom: 0.25rem; } .ant-picker-active-bar { display: none !important; } .ant-picker-panels { display: flex; flex-direction: row; } .ant-picker-panel { border: none; background-color: var(--calendar-bg); } .ant-picker-date-panel, .ant-picker-datetime-panel, .ant-picker-time-panel { width: auto; } .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner { background-color: var(--accent-color); } .ant-picker-cell-in-view.ant-picker-cell-in-range::before { background-color: var(--active-state-bg); } .ant-picker-cell-in-view.ant-picker-cell-range-start .ant-picker-cell-inner, .ant-picker-cell-in-view.ant-picker-cell-range-end .ant-picker-cell-inner { background-color: var(--accent-color); color: var(--calendar-bg); } .ant-picker-header-view button { color: var(--input-text-color); } .ant-picker-header-view button:hover { color: var(--accent-color); } &:not(.ant-picker-focused) .ant-picker-input input { background-color: transparent; color: var(--input-text-color) !important; font-weight: normal; } &:not(.ant-picker-focused):not(.ant-picker-range-active) .ant-picker-input-active { background-color: transparent; } &:not(.ant-picker-focused) .ant-picker-active-bar { display: none; } `;function Z3r(n){const[e]=xe(),t=xt(),{dateFormat:i}=Zc(),r=ji(dEe),[s,o]=x.useState(!1),[a,l]=x.useState(),[c,u]=x.useState(),d=f=>{if(Jn.extend(hxe),f[0]===""||f[1]==="")return;const p=["DD. MMM. YYYY","ddd MMM D, YYYY"];n.handleDateChange(Jn(f[0],p.includes(i)?void 0:i,r==null?void 0:r.locale).format("YYYY-MM-DD")+","+Jn(f[1],p.includes(i)?void 0:i,r==null?void 0:r.locale).format("YYYY-MM-DD"))};return x.useEffect(()=>{u(n.startDate),l(n.endDate)},[n.startDate,n.endDate]),x.useEffect(()=>()=>{o(!1)},[]),h.jsxs("div",{className:"flex justify-end items-center",children:[h.jsxs(Dn,{className:"rounded-md shadow-sm",value:n.value,onValueChange:f=>{o(f==="custom"),n.handleDateRangeChange(f)},style:{width:"9.7rem",borderRadius:"0.375rem"},customSelector:!0,dismissable:!1,searchable:!1,controlIcon:h.jsx(thn,{color:t.$3}),...n.value==="custom"&&{controlStyle:{borderTopRightRadius:"0",borderBottomRightRadius:"0",borderRight:"none"}},children:[h.jsx("option",{value:"last7_days",children:e("last_7_days")}),h.jsx("option",{value:"last30_days",children:e("last_30_days")}),h.jsx("option",{value:"this_month",children:e("this_month")}),h.jsx("option",{value:"last_month",children:e("last_month")}),h.jsx("option",{value:"last_quarter",children:e("last_quarter")}),h.jsx("option",{value:"this_quarter",children:e("current_quarter")}),h.jsx("option",{value:"this_year",children:e("this_year")}),h.jsx("option",{value:"last_year",children:e("last_year")}),h.jsx("option",{value:"last365_days",children:e("last365_days")}),h.jsx("option",{value:"custom",children:e("custom")})]}),s&&h.jsx("div",{className:"flex flex-row space-x-2",style:{"--accent-color":t.$3,"--active-state-bg":t.$4,"--calendar-bg":t.$2,"--input-text-color":t.$3,"--picker-border-color":t.$5,"--picker-bg":t.$1},children:h.jsx(bk,{locale:r==null?void 0:r.default,children:h.jsx(ihn,{size:"large",className:"rounded-md",defaultValue:[Jn(c),Jn(a)],format:i,onChange:(f,p)=>d(p),style:{borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},separator:h.jsx("span",{style:{color:t.$4},children:"—"}),allowClear:!1})})})]})}function rhn(n){const e=x.useRef(null),{RangePicker:t}=SA,i=xt(),{setDateRange:r,onClick:s}=n,[o,a]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState(""),f=ji(dEe),{dateFormat:p}=Zc();Uw(e,()=>{o&&!l&&a(!1)});const g=_=>{Jn.extend(hxe);const v=["DD. MMM. YYYY","ddd MMM D, YYYY"],b=_[0]?Jn(_[0],v.includes(p)?void 0:p,f==null?void 0:f.locale).format("YYYY-MM-DD"):"",y=_[1]?Jn(_[1],v.includes(p)?void 0:p,f==null?void 0:f.locale).format("YYYY-MM-DD"):"";d(b||y?[b,y].join(","):""),r(b||y?[b,y].join(","):"")},m=()=>{var b,y;const _=(b=u==null?void 0:u.split(","))==null?void 0:b[0],v=(y=u==null?void 0:u.split(","))==null?void 0:y[1];return!!(_&&v)};return x.useEffect(()=>{var _,v;if(o){const b=(_=u==null?void 0:u.split(","))==null?void 0:_[0],y=(v=u==null?void 0:u.split(","))==null?void 0:v[1];r((u==null?void 0:u.length)>1?[b,y].join(","):"")}},[o]),h.jsx("div",{ref:e,children:h.jsx(o9,{visible:o,placement:"bottom",interactive:!0,popperOptions:{strategy:"fixed"},render:()=>{var _,v;return h.jsx("div",{className:"flex flex-col p-3",style:{backgroundColor:i.$2,border:`1px solid ${i.$5}`,width:300},onClick:b=>b.stopPropagation(),children:h.jsx(bk,{locale:f==null?void 0:f.default,children:h.jsx(t,{size:"large",value:[(_=u==null?void 0:u.split(","))!=null&&_[0]?Jn(u.split(",")[0]):null,(v=u==null?void 0:u.split(","))!=null&&v[1]?Jn(u.split(",")[1]):null],format:p,onCalendarChange:(b,y)=>g(y),onOpenChange:b=>c(b)})})})},children:h.jsx("div",{className:"cursor-pointer",onClick:_=>{_.stopPropagation(),s(),a(v=>!v)},children:h.jsx(an,{element:SCe,color:m()?"#22c55e":i.$17,style:{width:"1.4rem",height:"1.4rem"}})})})})}function shn(n){const{children:e}=n,t=Lo();return h.jsx("tfoot",{style:{backgroundColor:t},children:h.jsx("tr",{children:e})})}const Jtt=Ls({});function mje({resourceId:n,resource:e,dataLength:t}){var r,s;const i=ji(Jtt);return n?h.jsx(Vd,{checked:(r=i==null?void 0:i[e])==null?void 0:r.includes(n),className:"child-checkbox",value:n,id:n,cypressRef:"dataTableCheckbox"}):h.jsx(Vd,{checked:((s=i==null?void 0:i[e])==null?void 0:s.length)===t&&t>0})}function qm(n){var je,Ve,Qt;const[e]=xe(),t=xt(),i=Qtt(),r=Qo(),[s,o]=x.useState(new URL(ze(n.endpoint))),a=ts(wu),{styleOptions:l,customFilters:c,onBulkActionCall:u,hideEditableOptions:d=!1,dateRangeColumns:f=[],excludeColumns:p=[],methodType:g="GET",queryIdentificator:m,disableQuery:_,footerColumns:v=[],bottomActionsKeys:b=[],withoutPerPageAsPreference:y=!1,withoutSortQueryParameter:C=!1,showRestoreBulk:S,enableSavingFilterPreference:k=!1,onDeleteBulkAction:I,withoutPageAsPreference:L=!1}=n,N=x.useRef(void 0),[P,O]=x.useState(""),[F,V]=x.useState(void 0),[M,B]=x.useState(1),[W,q]=x.useState(s.searchParams.get("per_page")||"10"),[U,G]=x.useState(s.searchParams.get("sort")||"id|asc"),[H,z]=x.useState(void 0),[Z,X]=x.useState(["active"]),[oe,fe]=x.useState(""),[Se,Me]=x.useState(""),[Ie,ge]=x.useState([]),ye=ts(Jtt),[Pe,Be]=x.useState(!0),[$e,qe]=x.useState(!1),[mt,vt]=x.useState([]),[ft,tt]=x.useState(!1),{handleUpdateTableFilters:St}=ehn({apiEndpoint:s,isInitialConfiguration:Pe,customFilter:F,setCurrentPage:B,setCustomFilter:V,setFilter:O,setPerPage:q,setSort:G,setSortedBy:z,setStatus:X,setArePreferencesApplied:qe,tableKey:`${n.resource}s`,customFilters:c,withoutStoringPerPage:y,withoutStoringPage:L,enableSavingFilterPreference:k}),{defaultOptions:Ft,defaultCustomFilterOptions:en,handleChangingCustomFilters:Ke}=Jdn({apiEndpoint:s,isInitialConfiguration:Pe,tableKey:`${n.resource}s`,customFilter:F,customFilters:c});x.useEffect(()=>{if(!Pe){clearTimeout(N.current);const rt=setTimeout(()=>St(P,H,U,M,Z,W),1500);N.current=rt}return s.searchParams.set("per_page",W),s.searchParams.set("page",M.toString()),s.searchParams.set("filter",P),Ke(),(!C||C&&U!=="id|asc")&&s.searchParams.set("sort",U),s.searchParams.set("status",Z),f.length&&Se&&(oe!=null&&oe.split(",").every(rt=>rt.length>1))&&s.searchParams.set(Se,oe),o(s),Pe&&Be(!1),()=>{a(void 0)}},[W,M,P,U,Z,F,oe,Se]),x.useEffect(()=>{ye(rt=>({...rt,[n.resource]:Ie})),mt.forEach(rt=>{const Cn=document.querySelector(`tr[row-id="${rt.id}"]`);Cn&&(Ie.includes(rt.id)?Cn.style.backgroundColor=t.$7:Cn.style.backgroundColor="transparent")})},[Ie,n.resource]),x.useEffect(()=>()=>{ge([]),ye(rt=>({...rt,[n.resource]:[]}))},[]);const{data:dt,isLoading:nt,isFetching:at,isError:Oe}=lr([...m?[m]:[],s.pathname,n.endpoint,W,M,P,U,Z,F,...oe!=null&&oe.split(",").every(rt=>rt.length>1)?[oe]:[],...oe!=null&&oe.split(",").every(rt=>rt.length>1)&&Se?[Se]:[]],()=>Je(g,s.href),{staleTime:n.staleTime??1/0,enabled:!_&&$e}),ce=x.useMemo(()=>Ie!=null&&Ie.length?mt.filter(rt=>Ie==null?void 0:Ie.includes(rt==null?void 0:rt.id))||[]:[],[mt,Ie]),Ne=()=>ce.every(rt=>hs(rt)!==Vr.Active),Xe=(rt,Cn)=>{pe.processing(),Je("POST",ze(n.bulkRoute??`${n.endpoint}/bulk`),{action:rt,ids:Cn?[Cn]:Array.from(Ie)}).then(Rn=>{var li;pe.success(`${rt}d_${n.resource}`),(li=n.onBulkActionSuccess)==null||li.call(n,Rn.data.data,rt),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:ze(n.endpoint)}}))}).finally(()=>{ewt([n.endpoint,s.pathname]),ge([])})},it=x.useMemo(()=>n.customBulkActions?n.customBulkActions.some(rt=>we.isValidElement(rt({selectedIds:Ie,selectedResources:ce,setSelected:ge}))):!1,[n.customBulkActions,Ie,ce]),Tt=rt=>n.customActions?n.customActions.some(Cn=>we.isValidElement(Cn(rt))):!1,Ct=rt=>{var li,Mi;const Cn=(li=f.find(si=>Se===si.queryParameterKey))==null?void 0:li.column,Rn=(Mi=f.find(si=>rt===si.column))==null?void 0:Mi.queryParameterKey;Cn!==rt&&Rn&&Me(Rn)},Rt=rt=>v.find(Cn=>Cn.id===rt),se=rt=>mt.map(Cn=>Cn[rt]),ke=x.useCallback(rt=>{ge(Cn=>Cn.includes(rt)?Cn.filter(Rn=>Rn!==rt):[...Cn,rt])},[Ie]),Ae=x.useCallback(()=>{mt.length===0?ge([]):Ie.length===mt.length&&mt.length>0?ge([]):ge(mt.map(rt=>rt.id)||[])},[Ie,mt]);return x.useEffect(()=>{a(s.pathname)},[s.pathname]),xL(()=>{dt&&!at&&vt(dt.data.data)},10,[dt,at]),x.useEffect(()=>{nt&&vt([])},[nt]),x.useEffect(()=>{tt(!1)},[m,s.pathname,n.endpoint,W,M,P,U,Z,F,oe,Se]),x.useEffect(()=>{(at||nt)&&(tt(!1),vt([]))},[at,nt]),x.useEffect(()=>{tt(!1)},[dt]),x.useEffect(()=>{!mt.length&&!nt&&!at&&B(1),W==="10"&&tt(!0),W==="50"&&setTimeout(()=>{tt(!0)},50),W==="100"&&setTimeout(()=>{tt(!0)},150)},[mt]),x.useEffect(()=>{(Number(W)<Ie.length||Number(W)===Ie.length)&&ge(mt.map(rt=>rt.id).filter(rt=>Ie.includes(rt))||[])},[mt,W]),x.useEffect(()=>{B1e.on("bulk.completed",()=>ge([]))},[]),h.jsxs("div",{"data-cy":"dataTable",children:[!n.withoutActions&&h.jsx(Jin,{filter:P,onFilterChange:O,optionsMultiSelect:!0,options:i,defaultOptions:Ft,defaultCustomFilterOptions:en,onStatusChange:X,customFilters:n.customFilters,customFilterPlaceholder:n.customFilterPlaceholder,onCustomFilterChange:V,customFilter:F,rightSide:h.jsxs(h.Fragment,{children:[n.rightSide,n.linkToCreate&&h.jsx(Si,{type:"component",guards:n.linkToCreateGuards||[],component:h.jsx(dn,{to:n.linkToCreate,className:"shadow-sm",children:e(`new_${n.resource}`)})})]}),beforeFilter:n.beforeFilter,withoutStatusFilter:n.withoutStatusFilter,children:!!(!d&&ce.length)&&h.jsxs(Z_,{label:e("actions"),disabled:!Ie.length,cypressRef:"bulkActionsDropdown",children:[n.customBulkActions&&n.customBulkActions.map((rt,Cn)=>h.jsx("div",{children:rt({selectedIds:Ie,selectedResources:ce,setSelected:ge})},Cn)),n.customBulkActions&&it&&h.jsx(Ki,{withoutPadding:!0}),!n.withoutDefaultBulkActions&&h.jsx($n,{onClick:()=>{u?u(Ie,"archive"):Xe("archive")},icon:h.jsx(an,{element:yu}),children:e("archive")}),!n.withoutDefaultBulkActions&&h.jsx($n,{onClick:()=>{I?I(Ie):u?u(Ie,"delete"):Xe("delete")},icon:h.jsx(an,{element:fc}),children:e("delete")}),!n.withoutDefaultBulkActions&&(S?S(ce):Ne())&&h.jsx($n,{onClick:()=>{u?u(Ie,"restore"):Xe("restore")},icon:h.jsx(an,{element:bu}),children:e("restore")})]})}),h.jsxs(h1,{className:n.className,withoutPadding:n.withoutPadding,withoutBottomBorder:l==null?void 0:l.withoutBottomBorder,withoutTopBorder:l==null?void 0:l.withoutTopBorder,withoutLeftBorder:l==null?void 0:l.withoutLeftBorder,withoutRightBorder:l==null?void 0:l.withoutRightBorder,isDataLoading:nt,style:n.style,resizable:s.pathname,children:[h.jsxs(p1,{backgroundColor:l==null?void 0:l.headerBackgroundColor,style:l==null?void 0:l.thStyle,children:[!n.withoutActions&&!d&&h.jsx(_a,{className:l==null?void 0:l.thClassName,resizable:`${s.pathname}.leftCheckbox`,withoutVerticalPadding:l==null?void 0:l.withoutThVerticalPadding,textSize:l==null?void 0:l.thTextSize,disableUppercase:l==null?void 0:l.disableThUppercase,onClick:Ae,children:h.jsx(mje,{resource:n.resource,dataLength:mt.length})}),n.columns.map((rt,Cn)=>!p.includes(rt.id)&&h.jsx(_a,{id:rt.id,className:l==null?void 0:l.thClassName,isCurrentlyUsed:H===rt.id,onColumnClick:Rn=>{z(Rn.field),G(Rn.sort)},childrenClassName:l==null?void 0:l.thChildrenClassName,resizable:`${s.pathname}.${rt.id}`,useOnlyCurrentSortDirectionIcon:l==null?void 0:l.useOnlyCurrentSortDirectionIcon,textSize:l==null?void 0:l.thTextSize,disableUppercase:l==null?void 0:l.disableThUppercase,descIcon:l==null?void 0:l.descIcon,ascIcon:l==null?void 0:l.ascIcon,children:h.jsxs("div",{className:"flex items-center space-x-3",children:[f.some(Rn=>rt.id===Rn.column)&&h.jsx(rhn,{setDateRange:fe,onClick:()=>Ct(rt.id)}),h.jsx("span",{children:rt.label})]})},Cn)),n.withResourcefulActions&&!d&&h.jsx(_a,{})]}),h.jsxs(f1,{style:{...l==null?void 0:l.tBodyStyle,opacity:ft||!mt.length?1:.5,pointerEvents:ft||!mt.length?"auto":"none",cursor:ft||!mt.length?"default":"progress"},children:[(nt||!pn.isEqual(mt,(je=dt==null?void 0:dt.data)==null?void 0:je.data))&&h.jsx(mV,{className:"border-b",style:{borderColor:t.$20},children:h.jsx(bs,{colSpan:100,children:h.jsx(yo,{})})}),Oe&&!nt&&h.jsx(mV,{className:"border-b",style:{borderColor:t.$20},children:h.jsx(bs,{className:"text-center",colSpan:100,children:e("error_refresh_page")})}),!nt&&(mt==null?void 0:mt.length)===0&&pn.isEqual(mt,(Ve=dt==null?void 0:dt.data)==null?void 0:Ve.data)&&h.jsx(mV,{className:"border-b",style:{borderColor:t.$20},children:h.jsx(bs,{className:l==null?void 0:l.tdClassName,colSpan:100,children:h.jsx("div",{className:"flex items-center justify-center py-10",children:h.jsx("span",{className:"text-sm",style:{color:t.$17},children:e("no_records_found")})})})}),pn.isEqual(mt,(Qt=dt==null?void 0:dt.data)==null?void 0:Qt.data)&&mt.map((rt,Cn)=>{var Rn,li,Mi,si,oi,_n;return h.jsxs(mV,{className:"border-b table-row",style:{borderColor:t.$20},resource:rt,memoValue:n.columns,withoutBackgroundColor:!0,children:[!n.withoutActions&&!d&&h.jsx(bs,{className:"cursor-pointer",onClick:()=>ke(rt.id),children:h.jsx(mje,{resourceId:rt.id,resource:n.resource})}),n.columns.map((de,_e)=>!p.includes(de.id)&&h.jsx(bs,{className:$t({"cursor-pointer":_e<3,"py-4":d},l==null?void 0:l.tdClassName),onClick:()=>{var Le;_e<3&&(n.onTableRowClick?n.onTableRowClick(rt):(Le=document.getElementById(rt.id))==null||Le.click())},withoutPadding:l==null?void 0:l.withoutTdPadding,resizable:`${s.pathname}.${de.id}`,children:de.format?de.format(rt[de.id],rt):rt[de.id]},_e)),n.withResourcefulActions&&!d&&h.jsx(bs,{children:h.jsxs(Z_,{label:e("actions"),children:[n.linkToEdit&&(((Rn=n.showEdit)==null?void 0:Rn.call(n,rt))||!n.showEdit)&&h.jsx($n,{to:Ut(n.linkToEdit,{id:rt==null?void 0:rt.id}),icon:h.jsx(an,{element:$Z}),children:e("edit")}),n.linkToEdit&&n.customActions&&Tt(rt)&&(((li=n.showEdit)==null?void 0:li.call(n,rt))||!n.showEdit)&&h.jsx(Ki,{withoutPadding:!0}),n.customActions&&n.customActions.map((de,_e)=>{var Le;return!b.includes(((Le=de(rt))==null?void 0:Le.key)||"")&&h.jsx("div",{children:de(rt)},_e)}),n.customActions&&(((Mi=n.showRestore)==null?void 0:Mi.call(n,rt))||!n.showRestore)&&h.jsx(Ki,{withoutPadding:!0}),(rt==null?void 0:rt.archived_at)===0&&(((si=n.showArchive)==null?void 0:si.call(n,rt))||!n.showArchive)&&h.jsx($n,{onClick:()=>Xe("archive",rt.id),icon:h.jsx(an,{element:yu}),children:e("archive")}),(rt==null?void 0:rt.archived_at)>0&&(((oi=n.showRestore)==null?void 0:oi.call(n,rt))||!n.showRestore)&&h.jsx($n,{onClick:()=>Xe("restore",rt.id),icon:h.jsx(an,{element:bu}),children:e("restore")}),!(rt!=null&&rt.is_deleted)&&(((_n=n.showDelete)==null?void 0:_n.call(n,rt))||!n.showDelete)&&h.jsx($n,{onClick:()=>Xe("delete",rt.id),icon:h.jsx(an,{element:fc}),children:e("delete")}),n.customActions&&n.customActions.map((de,_e)=>{var Le;return b.includes(((Le=de(rt))==null?void 0:Le.key)||"")&&h.jsx("div",{children:de(rt)},_e)})]})})]},Cn)})]}),!!v.length&&!!(mt!=null&&mt.length)&&!!r.show_table_footer&&h.jsxs(shn,{children:[!n.withoutActions&&!d&&h.jsx(_a,{}),n.columns.map((rt,Cn)=>{var Rn;return!p.includes(rt.id)&&h.jsx(bs,{customizeTextColor:!0,resizable:`${s.pathname}.${rt.id}`,children:Rt(rt.id)?h.jsx("div",{className:"flex items-center space-x-3",children:((Rn=Rt(rt.id))==null?void 0:Rn.format(se(rt.id),mt||[]))??"-/-"}):h.jsx(h.Fragment,{})},Cn)}),n.withResourcefulActions&&!d&&h.jsx(_a,{})]})]}),dt&&!n.withoutPagination&&h.jsx(dJe,{currentPerPage:W,currentPage:M,onPageChange:B,onRowsChange:q,totalPages:dt.data.meta.pagination.total_pages,totalRecords:dt.data.meta.pagination.total})]})}function ohn(){const n=[{id:"category",label:"name",format:(e,t)=>h.jsx(Ji,{to:Ut("/settings/expense_categories/:id/edit",{id:t.id}),children:t.name})},{id:"color",label:"color",format:e=>h.jsx("div",{style:{backgroundColor:e},className:"p-1 h-4 w-10"})}];return h.jsx(qm,{endpoint:"/api/v1/expense_categories?sort=id|desc",bulkRoute:"/api/v1/expense_categories/bulk",resource:"expense_category",columns:n,linkToCreate:"/settings/expense_categories/create",linkToEdit:"/settings/expense_categories/:id/edit",withResourcefulActions:!0,enableSavingFilterPreference:!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 hEe(n){return lr(["/api/v1/expense_categories",n],()=>{var e;return Je("GET",ze("/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 ahn(n){return lr(["/api/v1/expense_categories",n.id],()=>Je("GET",ze("/api/v1/expense_categories/:id",{id:n.id})),{enabled:n.enabled??!0,staleTime:1/0})}function lhn(){return(n,e)=>{pe.processing(),Je("POST",ze("/api/v1/expense_categories/bulk"),{action:e,ids:[n]}).then(()=>{pe.success(`${e}d_expense_category`),ii(["expense_categories"])})}}function ent(){const{isAdmin:n}=go();return lr("/api/v1/expense_categories/create",()=>Je("GET",ze("/api/v1/expense_categories/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function tnt(n){const[e]=xe(),{errors:t,setErrors:i,setExpenseCategory:r,expenseCategory:s,nameFieldRef:o,withCardContainer:a=!1}=n,l=(c,u)=>{i(void 0),r(d=>d&&{...d,[c]:u})};return a?h.jsxs(l1,{children:[h.jsx(lt,{innerRef:o,required:!0,label:e("name"),value:s==null?void 0:s.name,onValueChange:c=>l("name",c),errorMessage:t==null?void 0:t.errors.name,cypressRef:"expenseCategoryNameField"}),h.jsxs("div",{children:[h.jsx(Lh,{className:"mb-1",children:e("color")}),h.jsx(xw,{value:s==null?void 0:s.color,onValueChange:c=>l("color",c)})]})]}):h.jsxs(h.Fragment,{children:[h.jsx(lt,{innerRef:o,required:!0,label:e("name"),value:s==null?void 0:s.name,onValueChange:c=>l("name",c),errorMessage:t==null?void 0:t.errors.name,cypressRef:"expenseCategoryNameField"}),h.jsxs("div",{children:[h.jsx(Lh,{className:"mb-1",children:e("color")}),h.jsx(xw,{value:s==null?void 0:s.color,onValueChange:c=>l("color",c)})]})]})}function chn(){vr("new_expense_category");const[n]=xe(),e=Yi(),t=xt(),i=Lo(),r=x.useRef(null),{data:s}=ent(),[o,a]=x.useState(),[l,c]=x.useState(!1),[u,d]=x.useState(),f=[{name:n("settings"),href:"/settings"},{name:n("expense_settings"),href:"/settings/expense_settings"},{name:n("new_expense_category"),href:"/settings/expense_categories/create"}],p=()=>{r.current&&r.current.focus()},g=_=>{l||(c(!0),pe.processing(),Je("POST",ze("/api/v1/expense_categories"),u).then(v=>{pe.success("created_expense_category"),ii(["expense_categories"]),_==="save"?e(Ut("/settings/expense_categories/:id/edit",{id:v.data.data.id})):s&&(d({...s,color:i}),p())}).catch(v=>{var b;((b=v.response)==null?void 0:b.status)===422&&(pe.dismiss(),a(v.response.data))}).finally(()=>c(!1)))},m=[{onClick:()=>g("create"),text:`${n("save")} / ${n("create")}`,icon:h.jsx(an,{element:mb})}];return x.useEffect(()=>{s&&d({...s,color:i})},[s]),x.useEffect(()=>{p()},[r]),h.jsx(Kr,{title:n("expense_categories"),breadcrumbs:f,children:h.jsx(er,{title:n("create_expense_category"),className:"shadow-sm",childrenClassName:"pt-4 pb-4",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},withoutBodyPadding:!0,withSaveButton:!0,disableSubmitButton:l,onSaveClick:()=>g("save"),additionalSaveOptions:m,children:h.jsx(tnt,{nameFieldRef:r,expenseCategory:u,setExpenseCategory:d,errors:o,setErrors:a,withCardContainer:!0})})})}function uhn(){const[n]=xe(),e=lhn();return[i=>i.archived_at===0&&h.jsx($n,{onClick:()=>e(i.id,"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),i=>i.archived_at>0&&h.jsx($n,{onClick:()=>e(i.id,"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),i=>!i.is_deleted&&h.jsx($n,{onClick:()=>e(i.id,"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}function Kw(n){const[e]=xe(),t=xt(),{onSaveClick:i,disableSaveButton:r,label:s,saveButtonLabel:o,disableSaveButtonOnly:a}=n;return h.jsxs(h.Fragment,{children:[i&&h.jsxs("div",{className:"flex",children:[h.jsx(dn,{behavior:"button",className:"rounded-br-none rounded-tr-none px-3",onClick:i,disabled:r||a,disableWithoutIcon:!0,children:o??e("save")}),h.jsx(Z_,{className:"rounded-bl-none rounded-tl-none h-full border-l-1 border-y-0 border-r-0",cardActions:!0,disabled:r,cypressRef:n.cypressRef,labelButtonBorderColor:t.$1,children:n.actions.map((l,c)=>h.jsx(x.Fragment,{children:l(n.resource)},c))})]}),!i&&s&&h.jsx(Z_,{label:n.label,cypressRef:n.cypressRef,children:n.actions.map((l,c)=>h.jsx(x.Fragment,{children:l(n.resource)},c))})]})}function dhn(){const{setDocumentTitle:n}=vr("edit_expense_category"),[e]=xe(),{id:t}=Yl(),i=uhn(),r=xt(),{data:s}=ahn({id:t}),o=[{name:e("settings"),href:"/settings"},{name:e("expense_settings"),href:"/settings/expense_settings"},{name:e("edit_expense_category"),href:Ut("/settings/expense_categories/:id/edit",{id:t})}],[a,l]=x.useState(),[c,u]=x.useState(!1),[d,f]=x.useState({name:"",color:""});console.log(d==null?void 0:d.name);const p=(g,m)=>{l(void 0),f(_=>({..._,[g]:m}))};return x.useEffect(()=>{n(s==null?void 0:s.data.data.name),f(s==null?void 0:s.data.data)},[s]),h.jsxs(Kr,{title:e("expense_categories"),breadcrumbs:o,navigationTopRight:d&&h.jsx(Kw,{label:e("actions"),resource:d,actions:i}),children:[!s&&h.jsx("div",{className:"flex justify-center",children:h.jsx(yo,{})}),s&&h.jsxs(er,{className:"shadow-sm",childrenClassName:"pt-4 pb-4",style:{borderColor:r.$24},headerStyle:{borderColor:r.$20},withoutBodyPadding:!0,withSaveButton:!0,disableSubmitButton:c,title:d==null?void 0:d.name,disableWithoutIcon:!0,children:[h.jsxs(ne,{leftSide:e("status"),children:[!s.data.data.is_deleted&&!s.data.data.archived_at&&h.jsx(as,{variant:"primary",children:e("active")}),s.data.data.archived_at&&!s.data.data.is_deleted?h.jsx(as,{variant:"yellow",children:e("archived")}):null,s.data.data.is_deleted&&h.jsx(as,{variant:"red",children:e("deleted")})]}),h.jsxs(l1,{children:[h.jsx(lt,{label:e("name"),onValueChange:g=>p("name",g),value:d==null?void 0:d.name,errorMessage:a==null?void 0:a.errors.name,required:!0}),h.jsxs("div",{children:[h.jsx(Lh,{className:"mb-1",children:e("color")}),h.jsx(xw,{value:d==null?void 0:d.color,onValueChange:g=>p("color",g)})]})]})]})]})}function hhn(){vr("expense_settings");const[n]=xe(),e=[{name:n("settings"),href:"/settings"},{name:n("expense_settings"),href:"/settings/expense_settings"}],t=xt(),i=xu(),{isCompanySettingsActive:r}=el(),s=ji(_f),o=Fr(),a=xg(),l=pd(),c=Xs();return h.jsxs(Kr,{onSaveClick:l,onCancelClick:a,title:n("expense_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#expense_settings",disableSaveButton:s,children:[h.jsxs(er,{title:n("settings"),className:"shadow-sm pb-6",childrenClassName:"pt-4",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},withoutBodyPadding:!0,children:[h.jsx(ne,{leftSide:n("should_be_invoiced"),leftSideHelp:n("should_be_invoiced_help"),children:h.jsx(jt,{checked:i==null?void 0:i.mark_expenses_invoiceable,onChange:u=>c("mark_expenses_invoiceable",u),cypressRef:"shouldBeInvoicedToggle"})}),h.jsx(ne,{leftSide:n("mark_paid"),leftSideHelp:n("mark_paid_help"),children:h.jsx(jt,{checked:i==null?void 0:i.mark_expenses_paid,onChange:u=>c("mark_expenses_paid",u),cypressRef:"markPaidToggle"})}),h.jsx(ne,{leftSide:n("convert_currency"),leftSideHelp:n("convert_expense_currency_help"),children:h.jsx(jt,{checked:i==null?void 0:i.convert_expense_currency,onChange:u=>c("convert_expense_currency",u),cypressRef:"convertCurrencyToggle"})}),h.jsx(ne,{leftSide:n("add_documents_to_invoice"),leftSideHelp:n("add_documents_to_invoice_help"),children:h.jsx(jt,{checked:i==null?void 0:i.invoice_expense_documents,onChange:u=>c("invoice_expense_documents",u),cypressRef:"addDocumentsToInvoiceToggle"})}),h.jsx(ne,{leftSide:n("notify_vendor_when_paid"),leftSideHelp:n("notify_vendor_when_paid_help"),children:h.jsx(jt,{onChange:u=>c("notify_vendor_when_paid",u),checked:(i==null?void 0:i.notify_vendor_when_paid)||!1})}),r&&UB()&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-4 sm:px-6 pt-4",children:h.jsx(Ki,{className:"border-dashed",style:{borderColor:t.$20},withoutPadding:!0})}),h.jsx(ne,{className:"mt-3.5",leftSide:n("expense_mailbox_active"),children:h.jsx(jt,{checked:!!(i!=null&&i.expense_mailbox_active),onChange:u=>c("expense_mailbox_active",u)})}),!!(i!=null&&i.expense_mailbox_active)&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("expense_mailbox"),children:h.jsx(lt,{value:(i==null?void 0:i.expense_mailbox)||"",onValueChange:u=>c("expense_mailbox",u)})}),h.jsx(ne,{leftSide:n("inbound_mailbox_allow_company_users"),children:h.jsx(jt,{checked:!!(i!=null&&i.inbound_mailbox_allow_company_users),onChange:u=>c("inbound_mailbox_allow_company_users",u)})}),h.jsx(ne,{leftSide:n("inbound_mailbox_allow_vendors"),children:h.jsx(jt,{checked:!!(i!=null&&i.inbound_mailbox_allow_vendors),onChange:u=>c("inbound_mailbox_allow_vendors",u)})}),h.jsx(ne,{leftSide:n("inbound_mailbox_allow_clients"),children:h.jsx(jt,{checked:!!(i!=null&&i.inbound_mailbox_allow_clients),onChange:u=>c("inbound_mailbox_allow_clients",u)})}),h.jsx(ne,{leftSide:n("inbound_mailbox_whitelist"),leftSideHelp:n("inbound_mailbox_whitelist_help"),children:h.jsx(lt,{value:(i==null?void 0:i.inbound_mailbox_whitelist)||"",onValueChange:u=>c("inbound_mailbox_whitelist",u)})}),h.jsx(ne,{leftSide:n("inbound_mailbox_blacklist"),leftSideHelp:n("inbound_mailbox_blacklist_help"),children:h.jsx(lt,{value:(i==null?void 0:i.inbound_mailbox_blacklist)||"",onValueChange:u=>c("inbound_mailbox_blacklist",u)})}),h.jsx(ne,{leftSide:n("inbound_mailbox_allow_unknown"),children:h.jsx(jt,{checked:!!(i!=null&&i.inbound_mailbox_allow_unknown),onChange:u=>c("inbound_mailbox_allow_unknown",u)})})]})]}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",style:{borderColor:t.$20},withoutPadding:!0})}),h.jsx(ne,{leftSide:n("enter_taxes"),children:h.jsx(uqe,{onValueChange:u=>o(Uo({object:"company",property:"calculate_expense_tax_by_amount",value:u==="true"})),options:[{id:"by_rate",title:n("by_rate"),value:"false"},{id:"by_amount",title:n("by_amount"),value:"true"}],name:"calculate_expense_tax_by_amount",defaultSelected:i==null?void 0:i.calculate_expense_tax_by_amount.toString(),cypressRef:"taxByRadio"})}),h.jsx(ne,{leftSide:n("inclusive_taxes"),leftSideHelp:h.jsxs("span",{className:"flex flex-col",children:[h.jsxs("span",{children:[n("exclusive"),": 100 + 10% = 100 + 10"]}),h.jsxs("span",{children:[n("inclusive"),": 100 + 10% = 90.91 + 9.09"]})]}),children:h.jsx(jt,{onChange:u=>c("expense_inclusive_taxes",u),checked:(i==null?void 0:i.expense_inclusive_taxes)||!1,cypressRef:"inclusiveTaxesToggle"})})]}),h.jsx(ohn,{})]})}const fhn=As.button` border-color: ${({theme:n})=>n.borderColor}; color: ${({theme:n})=>n.textColor}; &:hover { color: ${({theme:n})=>n.hoverTextColor}; } `;function Qb(n){const e=xt(),{withoutVerticalMargin:t,withHorizontalPadding:i=!1,horizontalPaddingWidth:r="7rem",fullRightPadding:s=!1,style:o}=n,[a,l]=x.useState(n.defaultTabIndex||0),c=u=>{var d;l(u),(d=n.onTabChange)==null||d.call(n,u)};return x.useEffect(()=>{l(n.defaultTabIndex||0)},[n.defaultTabIndex]),h.jsxs("div",{className:$t(n.className,{"w-full":n.width==="full"}),"data-cy":"tabs",style:o,children:[h.jsx("div",{className:"flex justify-between relative",children:h.jsxs("div",{className:"flex flex-1 overflow-x-auto relative",children:[i&&h.jsx("div",{style:{width:r,height:"100%",borderBottom:`1px solid ${e.$20}`}}),n.tabs.map((u,d)=>{var f;return h.jsx("div",{className:$t({"flex-1":n.width==="full"}),children:h.jsx(fhn,{className:$t("whitespace-nowrap font-medium text-sm py-3 px-4",{"w-full":n.width==="full"}),type:"button",onClick:()=>c(d),theme:{textColor:a===d?e.$3:e.$17,hoverTextColor:e.$3},style:{borderBottom:a===d?`1px solid ${e.$3}`:`1px solid ${e.$20}`},children:((f=n.formatTabLabel)==null?void 0:f.call(n,d))||u})},d)}),h.jsx("div",{className:$t({"flex-1":!i||s}),style:{...!!(i&&!s)&&{width:r},height:"100%",borderBottom:`1px solid ${e.$20}`}})]})}),h.jsx("div",{className:$t(n.childrenClassName,{"flex flex-1":n.height==="full","my-4":n.height!=="full"&&!t,"overflow-y-scroll px-[5px]":n.withScrollableContent}),children:[...n.children].map((u,d)=>{var f;return we.isValidElement(u)&&we.cloneElement(u,{key:d,className:$t((f=u.props)==null?void 0:f.className,{"flex flex-col flex-1":n.height==="full","block my-4":n.height!=="full"&&!t,hidden:a!==d})})})})]})}function phn(){var l,c,u,d,f;const[n]=xe(),e=Fr(),t=xt(),i=Nr(),r=cl(),{isCompanySettingsActive:s}=el(),o=ji(ya),a=(p,g)=>e(Uo({object:"company",property:p,value:g}));return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"auto_email_invoice",labelElement:h.jsx(un,{label:n("auto_email_invoice"),helpLabel:n("auto_email_invoice_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!((l=i==null?void 0:i.settings)!=null&&l.auto_email_invoice),onChange:p=>a("settings.auto_email_invoice",p),disabled:r("auto_email_invoice")})}),s&&h.jsx(ne,{leftSide:n("stop_on_unpaid"),leftSideHelp:n("stop_on_unpaid_help"),children:h.jsx(jt,{checked:!!(i!=null&&i.stop_on_unpaid_recurring),onChange:p=>a("stop_on_unpaid_recurring",p)})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,style:{borderColor:t.$20}})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"auto_archive_invoice",labelElement:h.jsx(un,{label:n("auto_archive_invoice"),helpLabel:n("auto_archive_invoice_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!((c=i==null?void 0:i.settings)!=null&&c.auto_archive_invoice),onChange:p=>a("settings.auto_archive_invoice",p),disabled:r("auto_archive_invoice")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"auto_archive_invoice_cancelled",labelElement:h.jsx(un,{label:n("auto_archive_invoice_cancelled"),helpLabel:n("auto_archive_invoice_cancelled_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!((u=i==null?void 0:i.settings)!=null&&u.auto_archive_invoice_cancelled),onChange:p=>a("settings.auto_archive_invoice_cancelled",p),disabled:r("auto_archive_invoice_cancelled")})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,style:{borderColor:t.$20}})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"lock_invoices",labelElement:h.jsx(un,{label:n("lock_invoices")}),defaultValue:"off"}),children:h.jsxs(Dn,{value:((f=(d=i==null?void 0:i.settings)==null?void 0:d.lock_invoices)==null?void 0:f.toString())||"off",onValueChange:p=>a("settings.lock_invoices",p),disabled:r("lock_invoices"),errorMessage:o==null?void 0:o.errors["settings.lock_invoices"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"off",children:n("off")}),h.jsx("option",{value:"when_sent",children:n("when_sent")}),h.jsx("option",{value:"when_paid",children:n("when_paid")}),h.jsx("option",{value:"end_of_month",children:n("end_of_month")})]})})]})}function ghn(){var o,a;const[n]=xe(),e=Fr(),t=Nr(),{isCompanySettingsActive:i}=el(),r=cl(),s=(l,c)=>e(Uo({object:"company",property:l,value:c}));return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"auto_convert_quote",labelElement:h.jsx(un,{label:n("auto_convert_quote"),helpLabel:n("auto_convert_quote_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!((o=t==null?void 0:t.settings)!=null&&o.auto_convert_quote),onChange:l=>s("settings.auto_convert_quote",l),disabled:r("auto_convert_quote")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"auto_archive_quote",labelElement:h.jsx(un,{label:n("auto_archive_quote"),helpLabel:n("auto_archive_quote_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!((a=t==null?void 0:t.settings)!=null&&a.auto_archive_quote),onChange:l=>s("settings.auto_archive_quote",l),disabled:r("auto_archive_quote")})}),i&&h.jsx(ne,{leftSide:n("use_quote_terms"),leftSideHelp:n("use_quote_terms_help"),children:h.jsx(jt,{checked:!!(t!=null&&t.use_quote_terms_on_conversion),onChange:l=>s("use_quote_terms_on_conversion",l)})})]})}function mhn(){const[n]=xe(),e=xt(),t=[{name:n("settings"),href:"/settings"},{name:n("workflow_settings"),href:"/settings/workflow_settings"}];vr("workflow_settings"),xu();const i=ji(_f),r=pd(),s=xg(),o=[n("invoices"),n("quotes")];return h.jsx(Kr,{onSaveClick:r,onCancelClick:s,title:n("workflow_settings"),breadcrumbs:t,docsLink:"en/advanced-settings/#workflow_settings",disableSaveButton:i,children:h.jsx(er,{title:n("workflow_settings"),className:"shadow-sm",style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},withoutBodyPadding:!0,withoutHeaderBorder:!0,children:h.jsxs(Qb,{tabs:o,horizontalPaddingWidth:"1.5rem",withHorizontalPadding:!0,fullRightPadding:!0,withoutVerticalMargin:!0,children:[h.jsx("div",{className:"pt-4 pb-6",children:h.jsx(phn,{})}),h.jsx("div",{className:"pt-4 pb-6",children:h.jsx(ghn,{})})]})})})}const Tle={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"]},_hn=[{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:"last_year",label:"last_year"},{identifier:"custom",label:"custom"}],_je={date_key:"",date_range:"",end_date:"",report_keys:[],send_email:!0,start_date:""};function vhn(){const[n]=xe(),e=xt(),[t,i]=x.useState(),[r,s]=x.useState(!1),[o,a]=x.useState("activities"),[l,c]=x.useState(_je),u=(f,p)=>{c(p==="date_key"?g=>({...g,date_key:f,date_range:f?"last7":""}):p==="date_range"?g=>({...g,date_range:f,start_date:f==="custom"?g.start_date:"",end_date:f==="custom"?g.end_date:""}):g=>({...g,[p]:f}))},d=()=>{r||(pe.processing(),s(!0),Je("POST",ze(`/api/v1/reports/${o}`),l).then(()=>pe.success("exported_data")).catch(f=>{var p;((p=f.response)==null?void 0:p.status)===422&&(pe.dismiss(),i(f.response.data))}).finally(()=>s(!1)))};return x.useEffect(()=>{c(_je)},[o]),h.jsxs(er,{title:n("export"),className:"shadow-sm",saveButtonLabel:n("export"),withSaveButton:!0,onSaveClick:f=>{f.preventDefault(),d()},disableSubmitButton:r,disableWithoutIcon:!0,style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},children:[h.jsx(ne,{leftSide:n("export"),children:n("csv")}),h.jsx(ne,{leftSide:n("export_type"),children:h.jsx(Dn,{value:o,onValueChange:f=>a(f),customSelector:!0,dismissable:!1,children:Object.keys(Tle).map((f,p)=>h.jsx("option",{value:f,children:n(f)},p))})}),!!Tle[o].length&&h.jsx(ne,{leftSide:n("date"),children:h.jsx(Dn,{value:l.date_key,onValueChange:f=>u(f,"date_key"),customSelector:!0,withBlank:!0,errorMessage:t==null?void 0:t.errors.date_key,children:Tle[o].map((f,p)=>h.jsx("option",{value:f,children:n(f)},p))})}),l.date_key&&h.jsx(ne,{leftSide:n("date_range"),children:h.jsx(Dn,{value:l.date_range,onValueChange:f=>u(f,"date_range"),errorMessage:t==null?void 0:t.errors.date_range,customSelector:!0,dismissable:!1,children:_hn.map(({identifier:f,label:p},g)=>h.jsx("option",{value:f,children:n(p)},g))})}),l.date_range==="custom"&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("start_date"),children:h.jsx(lt,{type:"date",value:l.start_date,onValueChange:f=>u(f,"start_date"),errorMessage:t==null?void 0:t.errors.start_date})}),h.jsx(ne,{leftSide:n("end_date"),children:h.jsx(lt,{type:"date",value:l.end_date,onValueChange:f=>u(f,"end_date"),errorMessage:t==null?void 0:t.errors.end_date})})]})]})}function AA(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(d){o(d)}}function l(u){try{c(i.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}const bhn=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function GO(n,e,t){const i=yhn(n),{webkitRelativePath:r}=n,s=typeof e=="string"?e:typeof r=="string"&&r.length>0?r:`./${n.name}`;return typeof i.path!="string"&&vje(i,"path",s),vje(i,"relativePath",s),i}function yhn(n){const{name:e}=n;if(e&&e.lastIndexOf(".")!==-1&&!n.type){const i=e.split(".").pop().toLowerCase(),r=bhn.get(i);r&&Object.defineProperty(n,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return n}function vje(n,e,t){Object.defineProperty(n,e,{value:t,writable:!1,configurable:!1,enumerable:!0})}const Chn=[".DS_Store","Thumbs.db"];function whn(n){return AA(this,void 0,void 0,function*(){return cK(n)&&xhn(n.dataTransfer)?Thn(n.dataTransfer,n.type):Shn(n)?Ehn(n):Array.isArray(n)&&n.every(e=>"getFile"in e&&typeof e.getFile=="function")?khn(n):[]})}function xhn(n){return cK(n)}function Shn(n){return cK(n)&&cK(n.target)}function cK(n){return typeof n=="object"&&n!==null}function Ehn(n){return Bpe(n.target.files).map(e=>GO(e))}function khn(n){return AA(this,void 0,void 0,function*(){return(yield Promise.all(n.map(t=>t.getFile()))).map(t=>GO(t))})}function Thn(n,e){return AA(this,void 0,void 0,function*(){if(n.items){const t=Bpe(n.items).filter(r=>r.kind==="file");if(e!=="drop")return t;const i=yield Promise.all(t.map(Ihn));return bje(nnt(i))}return bje(Bpe(n.files).map(t=>GO(t)))})}function bje(n){return n.filter(e=>Chn.indexOf(e.name)===-1)}function Bpe(n){if(n===null)return[];const e=[];for(let t=0;t<n.length;t++){const i=n[t];e.push(i)}return e}function Ihn(n){if(typeof n.webkitGetAsEntry!="function")return yje(n);const e=n.webkitGetAsEntry();return e&&e.isDirectory?int(e):yje(n,e)}function nnt(n){return n.reduce((e,t)=>[...e,...Array.isArray(t)?nnt(t):[t]],[])}function yje(n,e){return AA(this,void 0,void 0,function*(){var t;if(globalThis.isSecureContext&&typeof n.getAsFileSystemHandle=="function"){const s=yield n.getAsFileSystemHandle();if(s===null)throw new Error(`${n} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,GO(o)}}const i=n.getAsFile();if(!i)throw new Error(`${n} is not a File`);return GO(i,(t=e==null?void 0:e.fullPath)!==null&&t!==void 0?t:void 0)})}function Lhn(n){return AA(this,void 0,void 0,function*(){return n.isDirectory?int(n):Ahn(n)})}function int(n){const e=n.createReader();return new Promise((t,i)=>{const r=[];function s(){e.readEntries(o=>AA(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(Lhn));r.push(a),s()}else try{const a=yield Promise.all(r);t(a)}catch(a){i(a)}}),o=>{i(o)})}s()})}function Ahn(n){return AA(this,void 0,void 0,function*(){return new Promise((e,t)=>{n.file(i=>{const r=GO(i,n.fullPath);e(r)},i=>{t(i)})})})}var EV={},Cje;function Nhn(){return Cje||(Cje=1,EV.__esModule=!0,EV.default=function(n,e){if(n&&e){var t=Array.isArray(e)?e:e.split(",");if(t.length===0)return!0;var i=n.name||"",r=(n.type||"").toLowerCase(),s=r.replace(/\/.*$/,"");return t.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?i.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):r===a})}return!0}),EV}var Dhn=Nhn();const Ile=Cl(Dhn);function wje(n){return Ohn(n)||Phn(n)||snt(n)||Rhn()}function Rhn(){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 Phn(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Ohn(n){if(Array.isArray(n))return $pe(n)}function xje(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 Sje(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xje(Object(t),!0).forEach(function(i){rnt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xje(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function rnt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function U8(n,e){return Fhn(n)||jhn(n,e)||snt(n,e)||Mhn()}function Mhn(){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 snt(n,e){if(n){if(typeof n=="string")return $pe(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 $pe(n,e)}}function $pe(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 jhn(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,s=!1,o,a;try{for(t=t.call(n);!(r=(o=t.next()).done)&&(i.push(o.value),!(e&&i.length===e));r=!0);}catch(l){s=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(s)throw a}}return i}}function Fhn(n){if(Array.isArray(n))return n}var Bhn=typeof Ile=="function"?Ile:Ile.default,$hn="file-invalid-type",Hhn="file-too-large",Vhn="file-too-small",Whn="too-many-files",zhn=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=e.split(","),i=t.length>1?"one of ".concat(t.join(", ")):t[0];return{code:$hn,message:"File type must be ".concat(i)}},Eje=function(e){return{code:Hhn,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},kje=function(e){return{code:Vhn,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},Uhn={code:Whn,message:"Too many files"};function ont(n,e){var t=n.type==="application/x-moz-file"||Bhn(n,e);return[t,t?null:zhn(e)]}function ant(n,e,t){if(m2(n.size))if(m2(e)&&m2(t)){if(n.size>t)return[!1,Eje(t)];if(n.size<e)return[!1,kje(e)]}else{if(m2(e)&&n.size<e)return[!1,kje(e)];if(m2(t)&&n.size>t)return[!1,Eje(t)]}return[!0,null]}function m2(n){return n!=null}function qhn(n){var e=n.files,t=n.accept,i=n.minSize,r=n.maxSize,s=n.multiple,o=n.maxFiles,a=n.validator;return!s&&e.length>1||s&&o>=1&&e.length>o?!1:e.every(function(l){var c=ont(l,t),u=U8(c,1),d=u[0],f=ant(l,i,r),p=U8(f,1),g=p[0],m=a?a(l):null;return d&&g&&!m})}function uK(n){return typeof n.isPropagationStopped=="function"?n.isPropagationStopped():typeof n.cancelBubble<"u"?n.cancelBubble:!1}function kV(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 Tje(n){n.preventDefault()}function Khn(n){return n.indexOf("MSIE")!==-1||n.indexOf("Trident/")!==-1}function Ghn(n){return n.indexOf("Edge/")!==-1}function Yhn(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Khn(n)||Ghn(n)}function I0(){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,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return e.some(function(a){return!uK(i)&&a&&a.apply(void 0,[i].concat(s)),uK(i)})}}function Qhn(){return"showOpenFilePicker"in window}function Xhn(n){if(m2(n)){var e=Object.entries(n).filter(function(t){var i=U8(t,2),r=i[0],s=i[1],o=!0;return lnt(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.')),o=!1),(!Array.isArray(s)||!s.every(cnt))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(t,i){var r=U8(i,2),s=r[0],o=r[1];return Sje(Sje({},t),{},rnt({},s,o))},{});return[{description:"Files",accept:e}]}return n}function Zhn(n){if(m2(n))return Object.entries(n).reduce(function(e,t){var i=U8(t,2),r=i[0],s=i[1];return[].concat(wje(e),[r],wje(s))},[]).filter(function(e){return lnt(e)||cnt(e)}).join(",")}function Jhn(n){return n instanceof DOMException&&(n.name==="AbortError"||n.code===n.ABORT_ERR)}function efn(n){return n instanceof DOMException&&(n.name==="SecurityError"||n.code===n.SECURITY_ERR)}function lnt(n){return n==="audio/*"||n==="video/*"||n==="image/*"||n==="text/*"||n==="application/*"||/\w+\/[-+.\w]+/g.test(n)}function cnt(n){return/^.*\.[\w]+$/.test(n)}var tfn=["children"],nfn=["open"],ifn=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],rfn=["refKey","onChange","onClick"];function sfn(n){return lfn(n)||afn(n)||unt(n)||ofn()}function ofn(){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 afn(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function lfn(n){if(Array.isArray(n))return Hpe(n)}function Lle(n,e){return dfn(n)||ufn(n,e)||unt(n,e)||cfn()}function cfn(){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 unt(n,e){if(n){if(typeof n=="string")return Hpe(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 Hpe(n,e)}}function Hpe(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 ufn(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,s=!1,o,a;try{for(t=t.call(n);!(r=(o=t.next()).done)&&(i.push(o.value),!(e&&i.length===e));r=!0);}catch(l){s=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(s)throw a}}return i}}function dfn(n){if(Array.isArray(n))return n}function Ije(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 xc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ije(Object(t),!0).forEach(function(i){Vpe(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ije(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Vpe(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dK(n,e){if(n==null)return{};var t=hfn(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function hfn(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var fEe=x.forwardRef(function(n,e){var t=n.children,i=dK(n,tfn),r=NA(i),s=r.open,o=dK(r,nfn);return x.useImperativeHandle(e,function(){return{open:s}},[s]),we.createElement(x.Fragment,null,t(xc(xc({},o),{},{open:s})))});fEe.displayName="Dropzone";var dnt={disabled:!1,getFilesFromEvent:whn,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};fEe.defaultProps=dnt;fEe.propTypes={children:nn.func,accept:nn.objectOf(nn.arrayOf(nn.string)),multiple:nn.bool,preventDropOnDocument:nn.bool,noClick:nn.bool,noKeyboard:nn.bool,noDrag:nn.bool,noDragEventsBubbling:nn.bool,minSize:nn.number,maxSize:nn.number,maxFiles:nn.number,disabled:nn.bool,getFilesFromEvent:nn.func,onFileDialogCancel:nn.func,onFileDialogOpen:nn.func,useFsAccessApi:nn.bool,autoFocus:nn.bool,onDragEnter:nn.func,onDragLeave:nn.func,onDragOver:nn.func,onDrop:nn.func,onDropAccepted:nn.func,onDropRejected:nn.func,onError:nn.func,validator:nn.func};var Wpe={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function NA(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=xc(xc({},dnt),n),t=e.accept,i=e.disabled,r=e.getFilesFromEvent,s=e.maxSize,o=e.minSize,a=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,f=e.onDrop,p=e.onDropAccepted,g=e.onDropRejected,m=e.onFileDialogCancel,_=e.onFileDialogOpen,v=e.useFsAccessApi,b=e.autoFocus,y=e.preventDropOnDocument,C=e.noClick,S=e.noKeyboard,k=e.noDrag,I=e.noDragEventsBubbling,L=e.onError,N=e.validator,P=x.useMemo(function(){return Zhn(t)},[t]),O=x.useMemo(function(){return Xhn(t)},[t]),F=x.useMemo(function(){return typeof _=="function"?_:Lje},[_]),V=x.useMemo(function(){return typeof m=="function"?m:Lje},[m]),M=x.useRef(null),B=x.useRef(null),W=x.useReducer(ffn,Wpe),q=Lle(W,2),U=q[0],G=q[1],H=U.isFocused,z=U.isFileDialogActive,Z=x.useRef(typeof window<"u"&&window.isSecureContext&&v&&Qhn()),X=function(){!Z.current&&z&&setTimeout(function(){if(B.current){var at=B.current.files;at.length||(G({type:"closeDialog"}),V())}},300)};x.useEffect(function(){return window.addEventListener("focus",X,!1),function(){window.removeEventListener("focus",X,!1)}},[B,z,V,Z]);var oe=x.useRef([]),fe=function(at){M.current&&M.current.contains(at.target)||(at.preventDefault(),oe.current=[])};x.useEffect(function(){return y&&(document.addEventListener("dragover",Tje,!1),document.addEventListener("drop",fe,!1)),function(){y&&(document.removeEventListener("dragover",Tje),document.removeEventListener("drop",fe))}},[M,y]),x.useEffect(function(){return!i&&b&&M.current&&M.current.focus(),function(){}},[M,b,i]);var Se=x.useCallback(function(nt){L?L(nt):console.error(nt)},[L]),Me=x.useCallback(function(nt){nt.preventDefault(),nt.persist(),Ft(nt),oe.current=[].concat(sfn(oe.current),[nt.target]),kV(nt)&&Promise.resolve(r(nt)).then(function(at){if(!(uK(nt)&&!I)){var Oe=at.length,ce=Oe>0&&qhn({files:at,accept:P,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:N}),Ne=Oe>0&&!ce;G({isDragAccept:ce,isDragReject:Ne,isDragActive:!0,type:"setDraggedFiles"}),c&&c(nt)}}).catch(function(at){return Se(at)})},[r,c,Se,I,P,o,s,a,l,N]),Ie=x.useCallback(function(nt){nt.preventDefault(),nt.persist(),Ft(nt);var at=kV(nt);if(at&&nt.dataTransfer)try{nt.dataTransfer.dropEffect="copy"}catch{}return at&&d&&d(nt),!1},[d,I]),ge=x.useCallback(function(nt){nt.preventDefault(),nt.persist(),Ft(nt);var at=oe.current.filter(function(ce){return M.current&&M.current.contains(ce)}),Oe=at.indexOf(nt.target);Oe!==-1&&at.splice(Oe,1),oe.current=at,!(at.length>0)&&(G({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),kV(nt)&&u&&u(nt))},[M,u,I]),ye=x.useCallback(function(nt,at){var Oe=[],ce=[];nt.forEach(function(Ne){var Xe=ont(Ne,P),it=Lle(Xe,2),Tt=it[0],Ct=it[1],Rt=ant(Ne,o,s),se=Lle(Rt,2),ke=se[0],Ae=se[1],je=N?N(Ne):null;if(Tt&&ke&&!je)Oe.push(Ne);else{var Ve=[Ct,Ae];je&&(Ve=Ve.concat(je)),ce.push({file:Ne,errors:Ve.filter(function(Qt){return Qt})})}}),(!a&&Oe.length>1||a&&l>=1&&Oe.length>l)&&(Oe.forEach(function(Ne){ce.push({file:Ne,errors:[Uhn]})}),Oe.splice(0)),G({acceptedFiles:Oe,fileRejections:ce,isDragReject:ce.length>0,type:"setFiles"}),f&&f(Oe,ce,at),ce.length>0&&g&&g(ce,at),Oe.length>0&&p&&p(Oe,at)},[G,a,P,o,s,l,f,p,g,N]),Pe=x.useCallback(function(nt){nt.preventDefault(),nt.persist(),Ft(nt),oe.current=[],kV(nt)&&Promise.resolve(r(nt)).then(function(at){uK(nt)&&!I||ye(at,nt)}).catch(function(at){return Se(at)}),G({type:"reset"})},[r,ye,Se,I]),Be=x.useCallback(function(){if(Z.current){G({type:"openDialog"}),F();var nt={multiple:a,types:O};window.showOpenFilePicker(nt).then(function(at){return r(at)}).then(function(at){ye(at,null),G({type:"closeDialog"})}).catch(function(at){Jhn(at)?(V(at),G({type:"closeDialog"})):efn(at)?(Z.current=!1,B.current?(B.current.value=null,B.current.click()):Se(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."))):Se(at)});return}B.current&&(G({type:"openDialog"}),F(),B.current.value=null,B.current.click())},[G,F,V,v,ye,Se,O,a]),$e=x.useCallback(function(nt){!M.current||!M.current.isEqualNode(nt.target)||(nt.key===" "||nt.key==="Enter"||nt.keyCode===32||nt.keyCode===13)&&(nt.preventDefault(),Be())},[M,Be]),qe=x.useCallback(function(){G({type:"focus"})},[]),mt=x.useCallback(function(){G({type:"blur"})},[]),vt=x.useCallback(function(){C||(Yhn()?setTimeout(Be,0):Be())},[C,Be]),ft=function(at){return i?null:at},tt=function(at){return S?null:ft(at)},St=function(at){return k?null:ft(at)},Ft=function(at){I&&at.stopPropagation()},en=x.useMemo(function(){return function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},at=nt.refKey,Oe=at===void 0?"ref":at,ce=nt.role,Ne=nt.onKeyDown,Xe=nt.onFocus,it=nt.onBlur,Tt=nt.onClick,Ct=nt.onDragEnter,Rt=nt.onDragOver,se=nt.onDragLeave,ke=nt.onDrop,Ae=dK(nt,ifn);return xc(xc(Vpe({onKeyDown:tt(I0(Ne,$e)),onFocus:tt(I0(Xe,qe)),onBlur:tt(I0(it,mt)),onClick:ft(I0(Tt,vt)),onDragEnter:St(I0(Ct,Me)),onDragOver:St(I0(Rt,Ie)),onDragLeave:St(I0(se,ge)),onDrop:St(I0(ke,Pe)),role:typeof ce=="string"&&ce!==""?ce:"presentation"},Oe,M),!i&&!S?{tabIndex:0}:{}),Ae)}},[M,$e,qe,mt,vt,Me,Ie,ge,Pe,S,k,i]),Ke=x.useCallback(function(nt){nt.stopPropagation()},[]),dt=x.useMemo(function(){return function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},at=nt.refKey,Oe=at===void 0?"ref":at,ce=nt.onChange,Ne=nt.onClick,Xe=dK(nt,rfn),it=Vpe({accept:P,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ft(I0(ce,Pe)),onClick:ft(I0(Ne,Ke)),tabIndex:-1},Oe,B);return xc(xc({},it),Xe)}},[B,t,a,Pe,i]);return xc(xc({},U),{},{isFocused:H&&!i,getRootProps:en,getInputProps:dt,rootRef:M,inputRef:B,open:ft(Be)})}function ffn(n,e){switch(e.type){case"focus":return xc(xc({},n),{},{isFocused:!0});case"blur":return xc(xc({},n),{},{isFocused:!1});case"openDialog":return xc(xc({},Wpe),{},{isFileDialogActive:!0});case"closeDialog":return xc(xc({},n),{},{isFileDialogActive:!1});case"setDraggedFiles":return xc(xc({},n),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return xc(xc({},n),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return xc({},Wpe);default:return n}}function Lje(){}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function AL({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M11.9999 21L11.9999 10L12 10.5",stroke:e,strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"square","data-color":"color-2",fill:"none"}),h.jsx("path",{d:"M16.2427 14.2428L12 10.0001L7.75739 14.2428",stroke:e,strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"square","data-color":"color-2",fill:"none"}),h.jsx("path",{d:"M7 19H5C2.8 19 1 17.2 1 15C1 13.1 2.3 11.5 4 11.1C4.2 7.2 7.5 4 11.5 4C15.5 4 18.7 7.1 19 11C21.2 11 23 12.8 23 15C23 17.2 21.2 19 19 19H17",stroke:e,strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"square",fill:"none"})]})}const pfn=As.div` border-color: ${n=>n.theme.borderColor}; &:hover { border-color: ${n=>n.theme.hoverBorderColor}; } `;function gfn(n){const[e]=xe(),t=xt(),{group:i,files:r,setFiles:s}=n,[o,a]=x.useState([]),l=g=>{s(m=>m.filter(({file:_})=>_!==g))},c=g=>new Promise(m=>{try{const _=new FileReader;_.onload=v=>{var C;const y=(((C=v.target)==null?void 0:C.result)||"").split(` `);!y.length||y.length===1||y.length===2&&!y[1]?m(!1):m(!0)},_.readAsText(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:f,isDragActive:p}=NA({accept:i==="backup"?{"application/zip":[".zip"]}:{"text/*":[".csv"],"application/vnd.ms-excel":[".csv"],"application/csv":[".csv"]},onDrop:async g=>{i==="backup"?g.forEach(m=>{s(_=>[..._,{group:i,file:m}])}):await u(g)?g.forEach(_=>{s(v=>[...v,{group:i,file:_}])}):pe.error("csv_rows_length")}});return x.useEffect(()=>{a(r.filter(({group:g})=>g===i).map(({file:g})=>g))},[r]),h.jsx(ne,{leftSide:e(i),children:o.length?h.jsx("ul",{className:"grid xs:grid-rows-6 lg:grid-cols-2",children:o.map((g,m)=>h.jsxs("li",{className:"flex items-center hover:bg-gray-50 cursor-pointer p-2",children:[g.name," - ",(g.size/1024).toPrecision(2)," KB"," ",h.jsx(SO,{fontSize:15,className:"cursor-pointer ml-3",onClick:()=>l(g)})]},m))}):h.jsx("div",{...d(),className:"flex flex-col md:flex-row md:items-center",children:h.jsxs(pfn,{className:"relative block w-full border-2 border-dashed rounded-lg p-12 text-center",theme:{borderColor:t.$21,hoverBorderColor:t.$17},children:[h.jsx("input",{...f()}),h.jsx("div",{className:"flex justify-center",children:h.jsx(AL,{size:"2.3rem",color:t.$3})}),h.jsx("span",{className:"mt-2 block text-sm font-medium",style:{color:t.$3,colorScheme:t.$0},children:e(p?"drop_file_here":"dropzone_default_message")})]})})})}const mfn={clients:"client",invoices:"invoice",accounting:"invoice",contacts:"client",backup:"backup"},Aje={freshbooks:["clients","invoices"],invoice2go:["invoices"],invoicely:["clients","invoices"],waveaccounting:["clients","accounting"],zoho:["contacts","invoices"],quickbooks:["backup"]};function _fn(){const[n]=xe(),e=xt(),[t,i]=x.useState("freshbooks"),[r,s]=x.useState([]),[o,a]=x.useState(),[l,c]=x.useState(!1),u=()=>{if(!l){pe.processing(),c(!0);const f=new FormData;f.append("import_type",t),r.forEach(({file:p,group:g})=>{f.append(`files[${mfn[g]}]`,p)}),Je("POST",ze("/api/v1/import"),f).then(p=>pe.success(p.data.message)).catch(p=>{var g;((g=p.response)==null?void 0:g.status)===422&&(pe.dismiss(),a(p.response.data))}).finally(()=>{c(!1),s([])})}},d=()=>Aje[t].some(f=>!r.filter(({group:p})=>p===f).length);return x.useEffect(()=>{a(void 0),s([])},[t]),h.jsxs(er,{title:n("import"),className:"shadow-sm",saveButtonLabel:n("import"),onSaveClick:f=>{f.preventDefault(),u()},disableSubmitButton:d()||l,withSaveButton:!0,disableWithoutIcon:!0,style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},children:[h.jsx(ne,{leftSide:n("import_type"),children:h.jsxs(Dn,{value:t,onValueChange:f=>i(f),errorMessage:o==null?void 0:o.errors.import_type,customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"freshbooks",children:n("freshbooks")}),h.jsx("option",{value:"invoice2go",children:n("invoice2go")}),h.jsx("option",{value:"invoicely",children:n("invoicely")}),h.jsx("option",{value:"quickbooks",children:n("quickbooks")}),h.jsx("option",{value:"waveaccounting",children:n("waveaccounting")}),h.jsx("option",{value:"zoho",children:n("zoho")})]})}),Aje[t].map(f=>h.jsx(gfn,{group:f,files:r,setFiles:s},f)),h.jsx(ne,{children:o&&Object.keys(o.errors).map((f,p)=>f!=="import_type"&&h.jsx(Kl,{children:o.errors[f]},p))})]})}function vfn(){vr("import_export");const[n]=xe(),e=[{name:n("settings"),href:"/settings"},{name:n("import_export"),href:"/settings/import_export"}];return h.jsxs(Kr,{title:n("import_export"),breadcrumbs:e,docsLink:"en/basic-settings/#import_export",children:[h.jsx(_fn,{}),h.jsx(vhn,{})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function bfn(){const[n]=xe();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,bw()?e:[...e,{name:n("danger_zone"),href:"/settings/account_management/danger_zone"}]}function yfn(){const[n]=xe(),e=xt(),t=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"}];vr("account_management"),xu();const i=pd(),r=xg(),s=ji(_f),o=bfn();return h.jsx(Kr,{onSaveClick:i,onCancelClick:r,title:n("account_management"),breadcrumbs:t,docsLink:"en/basic-settings/#account_management",disableSaveButton:s,children:h.jsxs(er,{title:n("account_management"),className:"shadow-sm pb-6",withoutBodyPadding:!0,style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},withoutHeaderBorder:!0,children:[h.jsx(wk,{tabs:o,withHorizontalPadding:!0,horizontalPaddingWidth:"1.5rem",fullRightPadding:!0,withHorizontalPaddingOnSmallScreen:!0}),h.jsx("div",{className:"pt-4",children:h.jsx(Hm,{})})]})})}function Cfn(){vr("custom_fields");const[n]=xe(),e=xt(),t=[{name:n("settings"),href:"/settings"},{name:n("custom_fields"),href:"/settings/custom_fields"}],i=[{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"}],r=gc(),s=pd(),o=xg(),a=ji(_f);return h.jsxs(Kr,{title:n("custom_fields"),breadcrumbs:t,docsLink:"en/advanced-settings/#custom_fields",onSaveClick:s,onCancelClick:o,disableSaveButton:a,children:[r.pathname.endsWith("custom_fields")&&h.jsx(OE,{to:"/settings/custom_fields/company"}),h.jsx(Gb,{}),h.jsxs(er,{title:n("custom_fields"),className:"shadow-sm",style:{borderColor:e.$24},withoutBodyPadding:!0,withoutHeaderBorder:!0,children:[h.jsx(wk,{tabs:i,withHorizontalPadding:!0,horizontalPaddingWidth:"1.5rem",fullRightPadding:!0,withHorizontalPaddingOnSmallScreen:!0}),h.jsx("div",{className:"pt-4 pb-6",children:h.jsx(Hm,{})})]})]})}function wfn(){vr("custom_fields");const[n]=xe();`${n("custom_fields")}${n("company")}`;const e=Nr(),t=pv();return e?h.jsx("div",{className:"px-4 sm:px-6",children:["company1","company2","company3","company4"].map(i=>h.jsx(Qf,{field:i,placeholder:n("company_field"),onChange:r=>t(i,r),initialValue:e.custom_fields[i],withArrowAsSeparator:!0},i))}):null}function xfn(){vr("custom_fields");const[n]=xe(),e=xt(),t=Nr(),i=pv();return t?h.jsxs("div",{className:"px-4 sm:px-6",children:[["client1","client2","client3","client4"].map(r=>h.jsx(Qf,{field:r,placeholder:n("client_field"),onChange:s=>i(r,s),initialValue:t.custom_fields[r],withArrowAsSeparator:!0},r)),h.jsx("div",{className:"py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:e.$20,withoutPadding:!0})}),["contact1","contact2","contact3","contact4"].map(r=>h.jsx(Qf,{field:r,placeholder:n("contact_field"),onChange:s=>i(r,s),initialValue:t.custom_fields[r],withArrowAsSeparator:!0},r)),h.jsx("div",{className:"py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:e.$20,withoutPadding:!0})}),["location1","location2","location3","location4"].map(r=>h.jsx(Qf,{field:r,placeholder:n("location_field"),onChange:s=>i(r,s),initialValue:t.custom_fields[r],withArrowAsSeparator:!0},r))]}):null}function Sfn(){vr("custom_fields");const[n]=xe(),e=Nr(),t=pv();return e?h.jsx("div",{className:"px-4 sm:px-6",children:["product1","product2","product3","product4"].map(i=>h.jsx(Qf,{field:i,placeholder:n("product_field"),onChange:r=>t(i,r),initialValue:e.custom_fields[i],withArrowAsSeparator:!0},i))}):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 Efn(){const n=xu(),e=Fr();return(t,i)=>{if(i===""){const r=pn.cloneDeep(n);return r&&delete r.custom_fields[t],e(ME({object:"company",data:r}))}e(Uo({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 kfn(){const n=Fr(),e=zi();return t=>{switch(t){case 0:n(Uo({object:"company",property:"custom_surcharge_taxes1",value:!(e!=null&&e.custom_surcharge_taxes1)}));break;case 1:n(Uo({object:"company",property:"custom_surcharge_taxes2",value:!(e!=null&&e.custom_surcharge_taxes2)}));break;case 2:n(Uo({object:"company",property:"custom_surcharge_taxes3",value:!(e!=null&&e.custom_surcharge_taxes3)}));break;case 3:n(Uo({object:"company",property:"custom_surcharge_taxes4",value:!(e!=null&&e.custom_surcharge_taxes4)}));break}}}function Tfn(){const[n]=xe(),e=YZe(),t=xt(),i=Nr(),r=pv(),s=Efn(),o=l=>{switch(l){case 0:return i==null?void 0:i.custom_surcharge_taxes1;case 1:return i==null?void 0:i.custom_surcharge_taxes2;case 2:return i==null?void 0:i.custom_surcharge_taxes3;case 3:return i==null?void 0:i.custom_surcharge_taxes4}},a=kfn();return i?h.jsxs("div",{className:"px-4 sm:px-6",children:[["invoice1","invoice2","invoice3","invoice4"].map(l=>h.jsx(Qf,{field:l,placeholder:n("invoice_field"),onChange:c=>r(l,c),initialValue:i.custom_fields[l],withArrowAsSeparator:!0},l)),h.jsx("div",{className:"py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:t.$20,withoutPadding:!0})}),i&&["surcharge1","surcharge2","surcharge3","surcharge4"].map((l,c)=>h.jsx(ne,{leftSide:h.jsx(lt,{className:"w-full sm:w-4/6",id:l,value:i.custom_fields[l],placeholder:n("surcharge_field"),onValueChange:u=>s(l,u),disabled:e}),noExternalPadding:!0,twoGridColumns:!0,children:!!(i!=null&&i.enabled_tax_rates)&&h.jsx(jt,{label:n("charge_taxes"),checked:o(c),onChange:()=>a(c)})},c))]}):null}function Ifn(){vr("custom_fields");const[n]=xe(),e=Nr(),t=pv();return e?h.jsx("div",{className:"px-4 sm:px-6",children:["payment1","payment2","payment3","payment4"].map(i=>h.jsx(Qf,{field:i,placeholder:n("payment_field"),onChange:r=>t(i,r),initialValue:e.custom_fields[i],withArrowAsSeparator:!0},i))}):null}function Lfn(){vr("custom_fields");const[n]=xe(),e=Nr(),t=pv();return e?h.jsx("div",{className:"px-4 sm:px-6",children:["project1","project2","project3","project4"].map(i=>h.jsx(Qf,{field:i,placeholder:n("project_field"),onChange:r=>t(i,r),initialValue:e.custom_fields[i],withArrowAsSeparator:!0},i))}):null}function Afn(){vr("custom_fields");const[n]=xe(),e=Nr(),t=pv();return e?h.jsx("div",{className:"px-4 sm:px-6",children:["task1","task2","task3","task4"].map(i=>h.jsx(Qf,{field:i,placeholder:n("task_field"),onChange:r=>t(i,r),initialValue:e.custom_fields[i],withArrowAsSeparator:!0},i))}):null}function Nfn(){vr("custom_fields");const[n]=xe(),e=xt(),t=Nr(),i=pv();return t?h.jsxs("div",{className:"px-4 sm:px-6",children:[["vendor1","vendor2","vendor3","vendor4"].map(r=>h.jsx(Qf,{field:r,placeholder:n("vendor_field"),onChange:s=>i(r,s),initialValue:t.custom_fields[r],withArrowAsSeparator:!0},r)),h.jsx("div",{className:"py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:e.$20,withoutPadding:!0})}),["vendor_contact1","vendor_contact2","vendor_contact3","vendor_contact4"].map(r=>h.jsx(Qf,{field:r,placeholder:n("contact_field"),onChange:s=>i(r,s),initialValue:t.custom_fields[r],withArrowAsSeparator:!0},r))]}):null}function Dfn(){vr("custom_fields");const[n]=xe(),e=Nr(),t=pv();return e?h.jsx("div",{className:"px-4 sm:px-6",children:["expense1","expense2","expense3","expense4"].map(i=>h.jsx(Qf,{field:i,placeholder:n("expense_field"),onChange:r=>t(i,r),initialValue:e.custom_fields[i],withArrowAsSeparator:!0},i))}):null}function Rfn(){vr("custom_fields");const[n]=xe(),e=Nr(),t=pv();return e?h.jsx("div",{className:"px-4 sm:px-6",children:["user1","user2","user3","user4"].map(i=>h.jsx(Qf,{field:i,placeholder:n("user_field"),onChange:r=>t(i,r),initialValue:e.custom_fields[i],withArrowAsSeparator:!0},i))}):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 Pfn(){const{t:n}=xe();return[{name:n("settings"),href:Ut("/settings/generated_numbers")},{name:n("clients"),href:Ut("/settings/generated_numbers/clients")},{name:n("invoices"),href:Ut("/settings/generated_numbers/invoices")},{name:n("recurring_invoices"),href:Ut("/settings/generated_numbers/recurring_invoices")},{name:n("payments"),href:Ut("/settings/generated_numbers/payments")},{name:n("quotes"),href:Ut("/settings/generated_numbers/quotes")},{name:n("credits"),href:Ut("/settings/generated_numbers/credits")},{name:n("projects"),href:Ut("/settings/generated_numbers/projects")},{name:n("tasks"),href:Ut("/settings/generated_numbers/tasks")},{name:n("vendors"),href:Ut("/settings/generated_numbers/vendors")},{name:n("purchase_orders"),href:Ut("/settings/generated_numbers/purchase_orders")},{name:n("expenses"),href:Ut("/settings/generated_numbers/expenses")},{name:n("recurring_expenses"),href:Ut("/settings/generated_numbers/recurring_expenses")}]}function Ofn(){vr("generated_numbers");const[n]=xe(),e=[{name:n("settings"),href:"/settings"},{name:n("generated_numbers"),href:"/settings/generated_numbers"}];xu();const t=xt(),i=Pfn(),r=ji(_f),s=xg(),o=pd();return h.jsxs(Kr,{title:n("generated_numbers"),docsLink:"en/advanced-settings/#generated_numbers",breadcrumbs:e,onSaveClick:o,onCancelClick:s,disableSaveButton:r,children:[h.jsx(Gb,{}),h.jsxs(er,{title:n("generated_numbers"),className:"shadow-sm",style:{borderColor:t.$24},withoutBodyPadding:!0,withoutHeaderBorder:!0,children:[h.jsx(wk,{tabs:i,withHorizontalPadding:!0,horizontalPaddingWidth:"1.5rem",withHorizontalPaddingOnSmallScreen:!0,fullRightPadding:!0}),h.jsx("div",{className:"pt-4 pb-6",children:h.jsx(Hm,{})})]})]})}function mv(){const[n]=xe();return h.jsx(Ji,{className:"pl-4 sm:pl-6",to:"https://invoiceninja.github.io/en/custom-fields/#custom-fields",external:!0,children:n("click_to_variables")})}function Mfn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"client_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.client_number_pattern)||"",onValueChange:d=>a("settings.client_number_pattern",d),disabled:s("client_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.client_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"client_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.client_number_counter)||"",onValueChange:d=>a("settings.client_number_counter",parseFloat(d)||0),disabled:s("client_number_counter"),errorMessage:o==null?void 0:o.errors["settings.client_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function jfn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"invoice_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.invoice_number_pattern)||"",onValueChange:d=>a("settings.invoice_number_pattern",d),disabled:s("invoice_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.invoice_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"invoice_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.invoice_number_counter)||"",onValueChange:d=>a("settings.invoice_number_counter",parseFloat(d)||0),disabled:s("invoice_number_counter"),errorMessage:o==null?void 0:o.errors["settings.invoice_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function Ffn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"recurring_invoice_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.recurring_invoice_number_pattern)||"",onValueChange:d=>a("settings.recurring_invoice_number_pattern",d),disabled:s("recurring_invoice_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.recurring_invoice_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"recurring_invoice_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.recurring_invoice_number_counter)||"",onValueChange:d=>a("settings.recurring_invoice_number_counter",parseFloat(d)||0),disabled:s("recurring_invoice_number_counter"),errorMessage:o==null?void 0:o.errors["settings.recurring_invoice_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function Bfn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"payment_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.payment_number_pattern)||"",onValueChange:d=>a("settings.payment_number_pattern",d),disabled:s("payment_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.payment_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"payment_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.payment_number_counter)||"",onValueChange:d=>a("settings.payment_number_counter",parseFloat(d)||0),disabled:s("payment_number_counter"),errorMessage:o==null?void 0:o.errors["settings.payment_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function $fn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"quote_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.quote_number_pattern)||"",onValueChange:d=>a("settings.quote_number_pattern",d),disabled:s("quote_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.quote_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"quote_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.quote_number_counter)||"",onValueChange:d=>a("settings.quote_number_counter",parseFloat(d)||0),disabled:s("quote_number_counter"),errorMessage:o==null?void 0:o.errors["settings.quote_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function Hfn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"credit_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.credit_number_pattern)||"",onValueChange:d=>a("settings.credit_number_pattern",d),disabled:s("credit_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.credit_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"credit_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.credit_number_counter)||"",onValueChange:d=>a("settings.credit_number_counter",parseFloat(d)||0),disabled:s("credit_number_counter"),errorMessage:o==null?void 0:o.errors["settings.credit_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function Vfn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"project_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.project_number_pattern)||"",onValueChange:d=>a("settings.project_number_pattern",d),disabled:s("project_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.project_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"project_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.project_number_counter)||"",onValueChange:d=>a("settings.project_number_counter",parseFloat(d)||0),disabled:s("project_number_counter"),errorMessage:o==null?void 0:o.errors["settings.project_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function Wfn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"task_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.task_number_pattern)||"",onValueChange:d=>a("settings.task_number_pattern",d),disabled:s("task_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.task_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"task_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.task_number_counter)||"",onValueChange:d=>a("settings.task_number_counter",parseFloat(d)||0),disabled:s("task_number_counter"),errorMessage:o==null?void 0:o.errors["settings.task_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function zfn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"vendor_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.vendor_number_pattern)||"",onValueChange:d=>a("settings.vendor_number_pattern",d),disabled:s("vendor_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.vendor_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"vendor_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.vendor_number_counter)||"",onValueChange:d=>a("settings.vendor_number_counter",parseFloat(d)||0),disabled:s("vendor_number_counter"),errorMessage:o==null?void 0:o.errors["settings.vendor_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function Ufn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"purchase_order_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.purchase_order_number_pattern)||"",onValueChange:d=>a("settings.purchase_order_number_pattern",d),disabled:s("purchase_order_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.purchase_order_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"purchase_order_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.purchase_order_number_counter)||"",onValueChange:d=>a("settings.purchase_order_number_counter",parseFloat(d)||0),disabled:s("purchase_order_number_counter"),errorMessage:o==null?void 0:o.errors["settings.purchase_order_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function qfn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"expense_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.expense_number_pattern)||"",onValueChange:d=>a("settings.expense_number_pattern",d),disabled:s("expense_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.expense_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"expense_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.expense_number_counter)||"",onValueChange:d=>a("settings.expense_number_counter",parseFloat(d)||0),disabled:s("expense_number_counter"),errorMessage:o==null?void 0:o.errors["settings.expense_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}function Kfn(){var c,u;const[n]=xe(),[e,t]=x.useState(""),i=xt(),r=Nr(),s=cl(),o=ji(ya),a=Xs(),l=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"recurring_expense_number_pattern",labelElement:h.jsx(un,{label:n("number_pattern")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.recurring_expense_number_pattern)||"",onValueChange:d=>a("settings.recurring_expense_number_pattern",d),disabled:s("recurring_expense_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.recurring_expense_number_pattern"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"recurring_expense_number_counter",labelElement:h.jsx(un,{label:n("number_counter")})}),children:h.jsx(Qs,{precision:0,value:((u=r==null?void 0:r.settings)==null?void 0:u.recurring_expense_number_counter)||"",onValueChange:d=>a("settings.recurring_expense_number_counter",parseFloat(d)||0),disabled:s("recurring_expense_number_counter"),errorMessage:o==null?void 0:o.errors["settings.recurring_expense_number_counter"]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),l.map((d,f)=>h.jsx(zm,{onClick:()=>t(e+d),children:h.jsx(Tc,{text:d})},f)),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-6",children:h.jsx(Ki,{className:"border-dashed",borderColor:i.$20,withoutPadding:!0})}),h.jsx(mv,{})]})}const Gfn=["1","01","001","0001","00001","000001","0000001","00000001","000000001","0000000001"],Yfn=["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 Qfn(){var s,o,a,l,c,u,d,f,p,g;const[n]=xe(),e=xu(),t=cl(),i=Xs(),r=ji(ya);return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"counter_padding",labelElement:h.jsx(un,{label:n("number_padding")}),defaultValue:"1"}),children:h.jsx(Dn,{value:((o=(s=e==null?void 0:e.settings)==null?void 0:s.counter_padding)==null?void 0:o.toString())||"1",onValueChange:m=>i("settings.counter_padding",parseInt(m)),disabled:t("counter_padding"),errorMessage:r==null?void 0:r.errors["settings.counter_padding"],customSelector:!0,dismissable:!1,children:Gfn.map((m,_)=>h.jsx("option",{value:(_+1).toString(),children:m},_))})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"counter_number_applied",labelElement:h.jsx(un,{label:n("generate_number")}),defaultValue:"when_saved"}),children:h.jsxs(Dn,{value:((a=e==null?void 0:e.settings)==null?void 0:a.counter_number_applied)||"when_saved",onValueChange:m=>i("settings.counter_number_applied",m),disabled:t("counter_number_applied"),errorMessage:r==null?void 0:r.errors["settings.counter_number_applied"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"when_saved",children:n("when_saved")}),h.jsx("option",{value:"when_sent",children:n("when_sent")})]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"recurring_number_prefix",labelElement:h.jsx(un,{label:n("recurring_prefix")})}),children:h.jsx(lt,{value:((l=e==null?void 0:e.settings)==null?void 0:l.recurring_number_prefix)||"",onValueChange:m=>i("settings.recurring_number_prefix",m),disabled:t("recurring_number_prefix"),errorMessage:r==null?void 0:r.errors["settings.recurring_number_prefix"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"shared_invoice_quote_counter",labelElement:h.jsx(un,{label:n("shared_invoice_quote_counter")}),defaultValue:!1}),children:h.jsx(jt,{onChange:m=>i("settings.shared_invoice_quote_counter",m),checked:!!((c=e==null?void 0:e.settings)!=null&&c.shared_invoice_quote_counter),disabled:t("shared_invoice_quote_counter")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"shared_invoice_credit_counter",labelElement:h.jsx(un,{label:n("shared_invoice_credit_counter")}),defaultValue:!1}),children:h.jsx(jt,{onChange:m=>i("settings.shared_invoice_credit_counter",m),checked:!!((u=e==null?void 0:e.settings)!=null&&u.shared_invoice_credit_counter),disabled:t("shared_invoice_credit_counter")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"reset_counter_frequency_id",labelElement:h.jsx(un,{label:n("reset_counter")}),defaultValue:"0"}),children:h.jsx(Dn,{value:((f=(d=e==null?void 0:e.settings)==null?void 0:d.reset_counter_frequency_id)==null?void 0:f.toString())||"0",onValueChange:m=>{i("settings.reset_counter_frequency_id",parseInt(m)),m==="0"&&i("settings.reset_counter_date","")},disabled:t("reset_counter_frequency_id"),errorMessage:r==null?void 0:r.errors["settings.reset_counter_frequency_id"],customSelector:!0,dismissable:!1,children:Yfn.map((m,_)=>h.jsx("option",{value:_.toString(),children:n(m)},_))})}),(e==null?void 0:e.settings)&&((p=e==null?void 0:e.settings)==null?void 0:p.reset_counter_frequency_id)>0&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"reset_counter_date",labelElement:h.jsx(un,{label:n("next_reset")})}),children:h.jsx(lt,{type:"date",value:((g=e==null?void 0:e.settings)==null?void 0:g.reset_counter_date)||"",onValueChange:m=>i("settings.reset_counter_date",m),disabled:t("reset_counter_date"),errorMessage:r==null?void 0:r.errors["settings.reset_counter_date"]})})]})}const Xfn={1:"Instrument not defined",2:"Automated clearing house credit",3:"Automated clearing house debit",4:"ACH demand debit reversal",5:"ACH demand credit reversal",6:"ACH demand credit",7:"ACH demand debit",8:"Hold",9:"National or regional clearing",10:"In cash",11:"ACH savings credit reversal",12:"ACH savings debit reversal",13:"ACH savings credit",14:"ACH savings debit",15:"Bookentry credit",16:"Bookentry debit",17:"ACH demand cash concentration/disbursement (CCD) credit",18:"ACH demand cash concentration/disbursement (CCD) debit",19:"ACH demand corporate trade payment (CTP) credit",20:"Cheque",21:"Banker's draft",22:"Certified banker's draft",23:"Bank cheque (issued by a banking or similar establishment)",24:"Bill of exchange awaiting acceptance",25:"Certified cheque",26:"Local cheque",27:"ACH demand corporate trade payment (CTP) debit",28:"ACH demand corporate trade exchange (CTX) credit",29:"ACH demand corporate trade exchange (CTX) debit",30:"Credit transfer",31:"Debit transfer",32:"ACH demand cash concentration/disbursement plus (CCD+)",33:"ACH demand cash concentration/disbursement plus (CCD+)",34:"ACH prearranged payment and deposit (PPD)",35:"ACH savings cash concentration/disbursement (CCD) credit",36:"ACH savings cash concentration/disbursement (CCD) debit",37:"ACH savings corporate trade payment (CTP) credit",38:"ACH savings corporate trade payment (CTP) debit",39:"ACH savings corporate trade exchange (CTX) credit",40:"ACH savings corporate trade exchange (CTX) debit",41:"ACH savings cash concentration/disbursement plus (CCD+)",42:"Payment to bank account",43:"ACH savings cash concentration/disbursement plus (CCD+)",44:"Accepted bill of exchange",45:"Referenced home-banking credit transfer",46:"Interbank debit transfer",47:"Home-banking debit transfer",48:"Bank card",49:"Direct debit",50:"Payment by postgiro",51:"FR, norme 6 97-Telereglement CFONB (French Organisation for",52:"Urgent commercial payment",53:"Urgent Treasury Payment",54:"Credit card",55:"Debit card",56:"Bankgiro",57:"Standing agreement",58:"SEPA credit transfer",59:"SEPA direct debit",60:"Promissory note",61:"Promissory note signed by the debtor",62:"Promissory note signed by the debtor and endorsed by a bank",63:"Promissory note signed by the debtor and endorsed by a",64:"Promissory note signed by a bank",65:"Promissory note signed by a bank and endorsed by another",66:"Promissory note signed by a third party",67:"Promissory note signed by a third party and endorsed by a",68:"Online payment service",69:"Transfer Advice",70:"Bill drawn by the creditor on the debtor",74:"Bill drawn by the creditor on a bank",75:"Bill drawn by the creditor, endorsed by another bank",76:"Bill drawn by the creditor on a bank and endorsed by a",77:"Bill drawn by the creditor on a third party",78:"Bill drawn by creditor on third party, accepted and",91:"Not transferable banker's draft",92:"Not transferable local cheque",93:"Reference giro",94:"Urgent giro",95:"Free format giro",96:"Requested method for payment was not used",97:"Clearing between partners",ZZZ:"Mutually defined"},Zfn={1:[],2:["iban","bic_swift"],3:["payer_bank_account","iban","bic_swift"],4:["payer_bank_account","iban","bic_swift"],5:["iban","bic_swift"],6:["iban","bic_swift"],7:["payer_bank_account","iban","bic_swift"],8:[],9:["iban","bic_swift"],10:[],11:["iban","bic_swift"],12:["payer_bank_account","iban","bic_swift"],13:["iban","bic_swift"],14:["payer_bank_account","iban","bic_swift"],15:["account_holder","bsb_sort"],16:["account_holder","bsb_sort"],17:["iban","bic_swift"],18:["payer_bank_account","iban","bic_swift"],19:["iban","bic_swift"],20:[],21:[],22:[],23:[],24:[],25:[],26:[],27:["payer_bank_account","iban","bic_swift"],28:["iban","bic_swift"],29:["payer_bank_account","iban","bic_swift"],30:["iban","bic_swift","account_holder"],31:["iban","bic_swift","account_holder"],32:["iban","bic_swift","account_holder"],33:["payer_bank_account","iban","bic_swift","account_holder"],34:["iban","bic_swift","account_holder"],35:["iban","bic_swift","account_holder"],36:["payer_bank_account","iban","bic_swift","account_holder"],37:["iban","bic_swift","account_holder"],38:["payer_bank_account","iban","bic_swift","account_holder"],39:["iban","bic_swift","account_holder"],40:["payer_bank_account","iban","bic_swift","account_holder"],41:["iban","bic_swift","account_holder"],42:["iban","bic_swift","account_holder"],43:["payer_bank_account","iban","bic_swift","account_holder"],44:[],45:["iban","bic_swift"],46:["iban","bic_swift"],47:["iban","bic_swift"],48:["card_type","card_number"],49:["payer_bank_account","iban","bic_swift"],50:["account_holder"],51:["iban","bic_swift"],52:["iban","bic_swift"],53:["iban","bic_swift"],54:["card_type","card_number","card_holder"],55:["card_type","card_number","card_holder"],56:["account_holder"],57:["iban","bic_swift"],58:["iban","bic_swift"],59:["payer_bank_account","iban","bic_swift"],60:[],61:[],62:["bic_swift"],63:[],64:["bic_swift"],65:["bic_swift"],66:[],67:["bic_swift"],68:["iban"],69:["iban","bic_swift"],70:[],74:["bic_swift"],75:["bic_swift"],76:["bic_swift"],77:[],78:[],91:[],92:[],93:["iban","bic_swift"],94:["iban","bic_swift"],95:["iban","bic_swift"],96:[],97:["account_holder"],ZZZ:[]},Jfn=x.forwardRef((n,e)=>{var u,d,f,p,g,m,_,v,b;const t=xt(),i=zi(),[r]=xe(),s=u1(),[o,a]=x.useState(null),l=fd({initialValues:{entity:n.entity,payment_means:[{code:"1",iban:null,bic_swift:"",payer_bank_account:"",account_holder:"",bsb_sort:"",card_type:"",card_number:"",card_holder:""}]},onSubmit:(y,{setSubmitting:C})=>{pe.processing(),a(null),Je("POST",ze("/api/v1/einvoice/configurations"),y).then(()=>{pe.success("saved_einvoice_details"),s()}).catch(S=>{var k;if(((k=S.response)==null?void 0:k.status)===422){pe.dismiss(),a(S.response.data);return}pe.error()}).finally(()=>C(!1))}});x.useImperativeHandle(e,()=>({saveEInvoice(){l.submitForm()}}),[l.values]);const c=x.useMemo(()=>l.values.payment_means[0].code?Zfn[l.values.payment_means[0].code]||[]:[],[l.values.payment_means]);return x.useEffect(()=>{l.setFieldValue("payment_means.0.code",pn.get(i.e_invoice,"Invoice.PaymentMeans.0.PaymentMeansCode.value")||"1"),l.setFieldValue("payment_means.0.iban",pn.get(i.e_invoice,"Invoice.PaymentMeans.0.PayeeFinancialAccount.ID.value")||null),l.setFieldValue("payment_means.0.bic_swift",pn.get(i.e_invoice,"Invoice.PaymentMeans.0.PayeeFinancialAccount.FinancialInstitutionBranch.FinancialInstitution.ID.value")||""),l.setFieldValue("payment_means.0.account_holder",pn.get(i.e_invoice,"Invoice.PaymentMeans.0.PayeeFinancialAccount.Name")||""),l.setFieldValue("payment_means.0.payer_bank_account",pn.get(i.e_invoice,"Invoice.PaymentMeans.0.PayerFinancialAccount.ID.value")||""),l.setFieldValue("payment_means.0.bsb_sort",pn.get(i.e_invoice,"Invoice.PaymentMeans.0.PayeeFinancialAccount.SortCode.value")||""),l.setFieldValue("payment_means.0.card_type",pn.get(i.e_invoice,"Invoice.PaymentMeans.0.CardAccount.NetworkID.value")||""),l.setFieldValue("payment_means.0.card_number",pn.get(i.e_invoice,"Invoice.PaymentMeans.0.CardAccount.PrimaryAccountNumberID.value")||""),l.setFieldValue("payment_means.0.card_holder",pn.get(i.e_invoice,"Invoice.PaymentMeans.0.CardAccount.HolderName.value")||"")},[i.e_invoice]),h.jsxs(er,{title:r("payment_means"),className:"shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:[h.jsx(ne,{leftSide:"Code",children:h.jsx(Dn,{value:l.values.payment_means[0].code,onValueChange:y=>l.setFieldValue("payment_means.0.code",y),errorMessage:(u=o==null?void 0:o.errors)==null?void 0:u["payment_means.0.code"],dismissable:!1,customSelector:!0,children:Object.entries(Xfn).map(([y,C])=>h.jsx("option",{value:y,children:C},y))})}),c.includes("iban")?h.jsx(ne,{leftSide:r("iban"),leftSideHelp:r("iban_help"),children:h.jsx(lt,{value:l.values.payment_means[0].iban,onValueChange:y=>l.setFieldValue("payment_means.0.iban",y),errorMessage:(d=o==null?void 0:o.errors)==null?void 0:d["payment_means.0.iban"]})}):null,c.includes("bic_swift")?h.jsx(ne,{leftSide:r("bic"),leftSideHelp:r("bic_swift_help"),children:h.jsx(lt,{value:l.values.payment_means[0].bic_swift,onValueChange:y=>l.setFieldValue("payment_means.0.bic_swift",y),errorMessage:(f=o==null?void 0:o.errors)==null?void 0:f["payment_means.0.bic_swift"]})}):null,c.includes("payer_bank_account")?h.jsx(ne,{leftSide:r("payer_bank_account"),leftSideHelp:r("payer_bank_account_help"),children:h.jsx(lt,{value:l.values.payment_means[0].payer_bank_account,onValueChange:y=>l.setFieldValue("payment_means.0.payer_bank_account",y),errorMessage:(p=o==null?void 0:o.errors)==null?void 0:p["payment_means.0.payer_bank_account"]})}):null,c.includes("account_holder")?h.jsx(ne,{leftSide:r("account_holder"),leftSideHelp:r("account_holder_help"),children:h.jsx(lt,{value:l.values.payment_means[0].account_holder,onValueChange:y=>l.setFieldValue("payment_means.0.account_holder",y),errorMessage:(g=o==null?void 0:o.errors)==null?void 0:g["payment_means.0.account_holder"]})}):null,c.includes("bsb_sort")?h.jsx(ne,{leftSide:r("bsb_sort"),leftSideHelp:r("bsb_sort_help"),children:h.jsx(lt,{value:l.values.payment_means[0].bsb_sort,onValueChange:y=>l.setFieldValue("payment_means.0.bsb_sort",y),errorMessage:(m=o==null?void 0:o.errors)==null?void 0:m["payment_means.0.bsb_sort"]})}):null,c.includes("card_type")?h.jsx(ne,{leftSide:r("card_type"),leftSideHelp:r("card_type_help"),children:h.jsx(lt,{value:l.values.payment_means[0].card_type,onValueChange:y=>l.setFieldValue("payment_means.0.card_type",y),errorMessage:(_=o==null?void 0:o.errors)==null?void 0:_["payment_means.0.card_type"]})}):null,c.includes("card_number")?h.jsx(ne,{leftSide:r("card_number"),leftSideHelp:r("card_number_help"),children:h.jsx(lt,{value:l.values.payment_means[0].card_number,onValueChange:y=>l.setFieldValue("payment_means.0.card_number",y),errorMessage:(v=o==null?void 0:o.errors)==null?void 0:v["payment_means.0.card_number"]})}):null,c.includes("card_holder")?h.jsx(ne,{leftSide:r("card_holder"),leftSideHelp:r("card_holder_help"),children:h.jsx(lt,{value:l.values.payment_means[0].card_holder,onValueChange:y=>l.setFieldValue("payment_means.0.card_holder",y),errorMessage:(b=o==null?void 0:o.errors)==null?void 0:b["payment_means.0.card_holder"]})}):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 epn(){var n,e;return((e=(n=kO.getState().companyUsers.api)==null?void 0:n[kO.getState().companyUsers.currentIndex])==null?void 0:e.account.plan)==="white_label"}/** * 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 pEe=["40","56","208","276","352","372","442","528","578","752","826"];function tpn(){const[n]=xe(),e=xt(),t=zi(),i=xk(),r=s=>{var l;const o=(l=i(s))==null?void 0:l.iso_3166_2,a=o==="GB"?"UK":"EU";return o?pn.get(t.tax_data.regions[a].subregions,`${o}.vat_number`):!1};return h.jsxs(er,{title:n("additional_tax_identifiers"),description:n("additional_tax_identifiers_help").toString(),className:"shadow-sm",style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},children:[h.jsx(ne,{leftSide:n("new_identifier"),children:h.jsx(ipn,{})}),pEe.filter(s=>r(s)).map(s=>{var o;return h.jsx(ne,{leftSide:(o=i(s))==null?void 0:o.name,children:i(s)?h.jsx(npn,{country:i(s),vat:r(s)}):null},s)})]})}function npn({country:n,vat:e}){const[t,i]=x.useState(!1),{t:r}=xe(),s=Lo(),o=u1(),a=fd({initialValues:{country:n.iso_3166_2,vat_number:e},onSubmit(l,{setSubmitting:c}){pe.processing(),Je("DELETE",ze("/api/v1/einvoice/peppol/remove_additional_legal_identifier"),l).then(()=>{pe.success(),o(),i(!1)}).catch(u=>{var d;if(((d=u.response)==null?void 0:d.status)===422){const f=pn.get(u.response.data,"errors.vat_number.0");if(f)return pe.error(f)}return pe.error()}).finally(()=>c(!1))}});return h.jsxs(h.Fragment,{children:[h.jsxs(pr,{visible:t,onClose:()=>i(!1),title:r("delete_identifier"),children:[h.jsx("p",{children:r("delete_identifier_description")}),h.jsx("form",{onSubmit:a.handleSubmit,children:h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{disabled:a.isSubmitting,children:r("continue")})})})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[e,h.jsx("button",{type:"button",style:{color:s},onClick:()=>i(!0),children:h.jsx(JM,{size:18})})]})]})}function ipn(){var d,f;const{t:n}=xe(),e=Lo(),t=zi(),i=xk(),r=u1(),[s,o]=x.useState(!1),[a,l]=x.useState(null),c=fd({initialValues:{country:"",vat_number:""},onSubmit:(p,{setSubmitting:g})=>{l(null),g(!0),pe.processing(),Je("POST",ze("/api/v1/einvoice/peppol/add_additional_legal_identifier"),p).then(()=>{pe.success(),r(),o(!1),c.resetForm()}).catch(m=>{var _,v;if(((_=m.response)==null?void 0:_.status)===422){pn.get(m.response.data,"0.source")!==""&&pn.get(m.response.data,"0.source")!==void 0?pe.error(`Error: ${pn.get(m.response.data,"0.details")}`):(l(m.response.data),pe.dismiss());return}if(((v=m.response)==null?void 0:v.status)===400){pe.error(m.response.data.message);return}console.error(m),pe.error()}).finally(()=>g(!1))}}),u=p=>{var _;const g=(_=i(p))==null?void 0:_.iso_3166_2,m=g==="GB"?"UK":"EU";return!g||t.settings.country_id===p?!1:!pn.get(t.tax_data.regions[m].subregions,`${g}.vat_number`)};return h.jsxs(h.Fragment,{children:[h.jsx(pr,{title:n("new_identifier"),visible:s,onClose:()=>o(!1),overflowVisible:!0,size:"small",children:h.jsxs("form",{onSubmit:c.handleSubmit,className:"space-y-5",children:[h.jsx(Dn,{value:c.values.country,label:n("country"),onValueChange:p=>c.setFieldValue("country",p),errorMessage:(d=a==null?void 0:a.errors)==null?void 0:d.country,customSelector:!0,children:pEe.filter(p=>u(p)).map(p=>{var g;return h.jsx("option",{value:p,children:(g=i(p))==null?void 0:g.name},p)})}),h.jsx(lt,{label:n("vat_number"),value:c.values.vat_number,onValueChange:p=>c.setFieldValue("vat_number",p),errorMessage:(f=a==null?void 0:a.errors)==null?void 0:f.vat_number}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{disabled:c.isSubmitting,children:n("continue")})})]})}),h.jsx("button",{type:"button",style:{color:e},onClick:()=>o(!0),children:n("configure")})]})}function rpn(){var r;const[n]=xe(),e=Ml(),{isAdmin:t,isOwner:i}=go();return $u()||!((r=e==null?void 0:e.company_user)!=null&&r.ninja_portal_url)||!t&&!i?null:h.jsx(KZ,{className:"mb-4",type:"warning",disableClosing:!0,children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{children:h.jsx(an,{element:gUe,size:20})}),h.jsx("span",{children:n("peppol_plan_warning")})]}),(e==null?void 0:e.company_user)&&h.jsx(Ji,{className:"ml-10",to:Ut("/settings/account_management"),children:n("plan_change")})]})})}const spn={PEPPOL:"PEPPOL",FACT1:"FACT1",EN16931:"EN16931",XInvoice_3_0:"XInvoice_3.0",XInvoice_2_3:"XInvoice_2.3",XInvoice_2_2:"XInvoice_2.2",XInvoice_2_1:"XInvoice_2.1",XInvoice_2_0:"XInvoice_2.0",XInvoice_1_0:"XInvoice_1.0","XInvoice-Extended":"XInvoice-Extended","XInvoice-BasicWL":"XInvoice-BasicWL","XInvoice-Basic":"XInvoice-Basic","Facturae_3.2.2":"Facturae_3.2.2","Facturae_3.2.1":"Facturae_3.2.1","Facturae_3.2":"Facturae_3.2",FatturaPA:"FatturaPA"};function opn(){const n=xu(),[e]=xe(),t=()=>epn()&&pEe.includes((n==null?void 0:n.settings.country_id)||""),i=x.useRef(null),r=[{name:e("settings"),href:"/settings"},{name:e("e_invoicing"),href:"/settings/e_invoice"}],s=xt(),o=Fr(),a=pd(),l=cl(),c=Xs(),{isCompanySettingsActive:u}=el(),[d,f]=oo(ya),p=ji(_f),[g,m]=x.useState(new FormData),[_,v]=x.useState(!1),b=fd({enableReinitialize:!0,initialValues:g,onSubmit:()=>{pe.processing(),f(void 0),Je("POST",ze("/api/v1/companies/:id",{id:n==null?void 0:n.id}),g,{headers:{"Content-Type":"multipart/form-data"}}).then(I=>{o(gk({object:"company",data:I.data.data})),o(zu("company")),pe.success("uploaded_document")}).catch(I=>{var L;((L=I.response)==null?void 0:L.status)===422&&(f(I.response.data),pe.dismiss())}).finally(()=>m(new FormData))}}),y=x.useCallback(I=>{if(I.length===0){pe.error("invalid_file");return}g.append("e_invoice_certificate",I[0]),g.append("_method","PUT"),m(g),b.submitForm()},[g]),{getRootProps:C,getInputProps:S,isDragActive:k}=NA({onDrop:y,multiple:!1,maxFiles:1,accept:{"application/*":[".p12",".pfx",".pem",".cer",".crt",".der",".txt",".p7b",".spc",".bin"]}});return x.useEffect(()=>{_&&(a(),v(!1))},[_]),h.jsxs(Kr,{title:e("e_invoicing"),docsLink:"en/advanced-settings/#e_invoice",breadcrumbs:r,onSaveClick:()=>{var I;(I=i==null?void 0:i.current)==null||I.saveEInvoice(),a()},disableSaveButton:p,children:[h.jsx(rpn,{}),!(n!=null&&n.legal_entity_id)&&h.jsxs(er,{title:e("e_invoicing"),className:"shadow-sm",style:{borderColor:s.$24},headerStyle:{borderColor:s.$20},children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"e_invoice_type",labelElement:h.jsx(un,{label:e("e_invoice_type")}),defaultValue:"EN16931"}),children:h.jsx(Dn,{value:(n==null?void 0:n.settings.e_invoice_type)||"EN16931",onValueChange:I=>c("settings.e_invoice_type",I),disabled:l("e_invoice_type"),dismissable:!1,customSelector:!0,children:Object.entries(spn).filter(([I])=>I!=="PEPPOL"||t()).map(([I,L])=>h.jsx("option",{value:I,children:L},I))})}),(n==null?void 0:n.settings.e_invoice_type)!=="PEPPOL"?h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"enable_e_invoice",labelElement:h.jsx(un,{label:e("enable_e_invoice")})}),children:h.jsx(jt,{checked:!!(n!=null&&n.settings.enable_e_invoice),onValueChange:I=>c("settings.enable_e_invoice",I),disabled:l("enable_e_invoice")})}):null,(n==null?void 0:n.settings.e_invoice_type)==="PEPPOL"?h.jsx(h.Fragment,{children:n!=null&&n.settings.enable_e_invoice&&(n!=null&&n.legal_entity_id)?h.jsx("div",{className:"flex flex-col space-y-4"}):h.jsx(UUt,{})}):h.jsx(h.Fragment,{children:n!=null&&n.settings.enable_e_invoice?h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"merge_e_invoice_to_pdf",labelElement:h.jsx(un,{label:e("merge_e_invoice_to_pdf")})}),children:h.jsx(jt,{checked:!!(n!=null&&n.settings.merge_e_invoice_to_pdf),onValueChange:I=>c("settings.merge_e_invoice_to_pdf",I),disabled:l("merge_e_invoice_to_pdf")})}),u&&h.jsx(ne,{leftSide:e("upload_certificate"),leftSideHelp:n!=null&&n.has_e_invoice_certificate?e("certificate_set"):e("certificate_not_set"),children:h.jsx("div",{...C(),className:"flex flex-col md:flex-row md:items-center",children:h.jsxs("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:[h.jsx("input",{...S()}),h.jsx("div",{className:"flex justify-center",children:h.jsx(AL,{size:"2.3rem",color:s.$3})}),h.jsx("span",{className:"mt-2 block text-sm font-medium text-gray-900",children:k?"drop_your_logo_here":e("dropzone_default_message")})]})})}),u&&h.jsx(ne,{leftSide:e("certificate_passphrase"),leftSideHelp:n!=null&&n.has_e_invoice_certificate_passphrase?e("passphrase_set"):e("passphrase_not_set"),children:h.jsx(lt,{value:"",id:"password",type:"password",onValueChange:I=>c("has_e_invoice_certificate_passphrase",I),errorMessage:d==null?void 0:d.errors.has_e_invoice_certificate_passphrase})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"e_quote_type",labelElement:h.jsx(un,{label:e("e_quote_type")}),defaultValue:"OrderX_Comfort"}),children:h.jsxs(Dn,{value:(n==null?void 0:n.settings.e_quote_type)||"OrderX_Comfort",onValueChange:I=>c("settings.e_quote_type",I),disabled:l("e_quote_type"),dismissable:!1,customSelector:!0,children:[h.jsx("option",{value:"OrderX_Comfort",children:"OrderX_Comfort"}),h.jsx("option",{value:"OrderX_Basic",children:"OrderX_Basic"}),h.jsx("option",{value:"OrderX_Extended",children:"OrderX_Extended"})]})})]}):null})]}),(n==null?void 0:n.settings.e_invoice_type)==="PEPPOL"&&t()&&n.legal_entity_id?h.jsx(ZUt,{}):null,n!=null&&n.settings.enable_e_invoice?h.jsx(Jfn,{ref:i,currentEInvoice:(n==null?void 0:n.e_invoice)||{},entity:"company"}):null,n!=null&&n.settings.enable_e_invoice&&(n!=null&&n.legal_entity_id)&&t()?h.jsx(tpn,{}):null]})}const Nje=As(XD.Option)` &:hover { background-color: ${n=>n.theme.hoverColor}; } `,hnt=As.button` &:hover { background-color: ${n=>n.theme.hoverColor}; } `,apn=As.li` background-color: ${n=>n.theme.backgroundColor}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function lpn({inputOptions:n,entries:e,readonly:t,nullable:i,initiallyVisible:r=!1,exclude:s=[],includeOnly:o=[],includeByLabel:a,action:l,onChange:c,onDismiss:u,entryOptions:d,errorMessage:f,clearInputAfterSelection:p,onEmptyValues:g,onFocus:m,onInputValueChange:_,withShadow:v}){const b=xt(),y=Qo(),[C,S]=x.useState(String(n.value??"")),[k,I]=x.useState(r),[L,N]=x.useState(null),[P,O]=x.useState(-1),F=x.useRef(null),V=x.useRef(null);let M=C===""?e:e.filter(U=>{var G,H,z,Z,X;return((H=(G=U.label)==null?void 0:G.toLowerCase())==null?void 0:H.includes(C==null?void 0:C.toLowerCase()))||((X=(Z=(z=U.value)==null?void 0:z.toString())==null?void 0:Z.toLowerCase())==null?void 0:X.includes(C==null?void 0:C.toLowerCase()))||U.searchable.toLowerCase().includes(C==null?void 0:C.toLowerCase())});M=M.filter(U=>s.length>0?!s.includes(U.value):!0),M=M.filter(U=>o.length>0?o.includes(U[a?"label":"value"]):!0),x.useEffect(()=>{const U=e.findIndex(G=>G.value===n.value||G.label===n.value);if(U>=0){N(e[U]),O(U);return}if(i){N({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 B=U=>{S(U),N(null),I(!0),O(-1)},W=U=>{L&&L.value===U.value||(N(U),S(U.label),c(U),p&&(S(""),N(null)),setTimeout(()=>I(!1),100))},q=U=>{if(U.key==="ArrowDown"&&P<M.length-1){U.preventDefault(),O(P+1);return}if(U.key==="ArrowUp"&&P>0){U.preventDefault(),O(P-1);return}if(U.key==="Enter"){if(I(!1),P>=0){W(M[P]);return}P===-1&&i&&W({id:Date.now(),label:C,value:C,resource:null,eventType:"internal",searchable:C.toLowerCase()});return}if(U.key==="Escape"){I(!1);return}if(U.key==="Tab"&&i){I(!1),W({id:Date.now(),label:C,value:C,resource:null,eventType:"internal",searchable:C.toLowerCase()});return}};return Uw(F,()=>{if(I(!1),_==null||_(C),L&&L.value&&C===L.value||C==="")return;const U={id:Date.now(),label:C,value:C,resource:null,eventType:"internal",searchable:C.toLowerCase()};W(U),c(U)}),xL(()=>{if(g&&(C===""&&M.length>0||M.length<=3))return g(C)},600,[C,M]),x.useEffect(()=>{const U=document.querySelector(`[data-combobox-element-id="${P+1}"]`);U&&U.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})},[P]),h.jsxs("div",{ref:F,className:"w-full",tabIndex:-1,children:[n.label?h.jsx("p",{className:$t("text-sm font-medium block",n.className),style:{color:b.$16},children:n.label}):null,h.jsx("div",{className:"relative mt-1",children:h.jsxs("div",{className:$t("relative w-full cursor-default overflow-hidden rounded-md border text-left sm:text-sm",{"shadow-sm":v,"border-[#09090B26]":!y.dark_mode&&!k,"border-black":!y.dark_mode&&k,"border-[#1f2e41]":y.dark_mode&&!k,"border-white":y.dark_mode&&k}),children:[h.jsx("input",{type:"text",onChange:U=>B(U.target.value),onKeyDown:q,onFocus:()=>{I(!0),m&&m()},placeholder:n.placeholder,disabled:t,defaultValue:L?L.label:C==null?void 0:C.toString(),className:"w-full rounded-md py-1.5 pl-3 pr-10 shadow-sm sm:text-sm sm:leading-6 focus:outline-none focus:ring-0",ref:V,style:{backgroundColor:b.$1,color:b.$3,border:"none"},"data-cy":"comboboxInput",tabIndex:-1}),!t&&h.jsx("button",{tabIndex:-1,type:"button",onClick:U=>{if(u)return U.preventDefault(),I(!1),u()},className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",children:u&&L?h.jsx(gA,{size:"0.9rem",color:b.$3,"data-testid":"combobox-clear-icon"}):h.jsx($y,{color:b.$3,size:"0.9rem","data-testid":"combobox-chevrondown-icon"})})]})}),k&&h.jsxs("ul",{className:"border absolute z-10 mt-1 rounded-md text-base shadow-2xl focus:outline-none sm:text-sm",style:{backgroundColor:b.$1,borderColor:b.$24},tabIndex:-1,children:[h.jsx("div",{className:"flex flex-col overflow-y-auto overflow-x-hidden max-h-60 p-1",children:M.map((U,G)=>h.jsxs(apn,{theme:{backgroundColor:b.$1,hoverColor:b.$20},className:"flex items-center space-x-2 min-w-[14rem] relative cursor-pointer select-none py-2 px-3 rounded-[0.1875rem]",onClick:()=>W(U),"data-combobox-element-id":G,tabIndex:-1,children:[P===G&&h.jsx("div",{className:"self-start mt-1",children:h.jsx(Nwe,{size:"0.9rem",color:b.$3})}),h.jsx("div",{className:$t({"pl-6":P!==G&&(L==null?void 0:L.value)}),children:U.resource&&typeof d.dropdownLabelFn<"u"?d.dropdownLabelFn(U.resource):U.label})]},U.id))}),l&&l.visible&&h.jsx("div",{className:"border-t w-full p-1",style:{borderColor:b.$21},children:h.jsxs(hnt,{theme:{hoverColor:b.$20},"data-testid":"combobox-action-button",type:"button",onClick:l.onClick,className:"flex items-center space-x-2 justify-start w-full relative cursor-pointer select-none py-2 px-3 rounded-[0.1875rem]",tabIndex:-1,style:{color:b.$3},children:[h.jsx("div",{children:h.jsx(nc,{size:"1rem",color:b.$16})}),h.jsx("span",{className:"text-sm font-medium",children:l.label})]})})]}),h.jsx(Kl,{className:"mt-2",children:f})]})}function fnt({inputOptions:n,entries:e,readonly:t,nullable:i,initiallyVisible:r=!1,exclude:s=[],includeOnly:o=[],includeByLabel:a,action:l,onEmptyValues:c,onChange:u,onDismiss:d,entryOptions:f,errorMessage:p,clearInputAfterSelection:g,isDataLoading:m,compareOnlyByValue:_,withShadow:v}){const[b]=xe(),y=xt(),C=Qo(),[S,k]=x.useState(""),[I,L]=x.useState(r),[N,P]=x.useState(null);let O=S===""?e:e.filter(B=>{var W,q,U,G,H;return((q=(W=B.label)==null?void 0:W.toLowerCase())==null?void 0:q.includes(S==null?void 0:S.toLowerCase()))||((H=(G=(U=B.value)==null?void 0:U.toString())==null?void 0:G.toLowerCase())==null?void 0:H.includes(S==null?void 0:S.toLowerCase()))||B.searchable.toLowerCase().includes(S==null?void 0:S.toLowerCase())});O=O.filter(B=>s.length>0?!s.includes(B.value):!0),O=O.filter(B=>o.length>0?o.includes(B[a?"label":"value"]):!0);const F=x.useRef(null),V=x.useRef(null);Uw(F,()=>{L(!1)}),xL(()=>{if(c&&(S===""&&O.length>0||O.length<=3))return c(S)},600,[O]);const M=B=>{B&&(N&&B.value===N.value?d&&d():P(()=>({...B,eventType:"internal"})))};return x.useEffect(()=>{N&&N.eventType==="internal"&&u(N),g&&(P(null),k("")),L(!1),V!=null&&V.current&&V.current.blur()},[N]),x.useEffect(()=>{const B=e.find(W=>_?W.value===n.value:W.value===n.value||W.label===n.value);P(B||(i?{id:-1,label:n.value?n.value.toString():"",value:n.value?n.value.toString():"",resource:null,eventType:"external",searchable:f.searchable||f.value}:null))},[e,n.value]),x.useEffect(()=>(r&&L(!0),()=>{L(!1)}),[r]),h.jsxs("div",{className:"w-full",children:[h.jsxs(XD,{as:"div",value:N,onChange:B=>M(B),disabled:t,ref:F,children:[n.label&&h.jsx(XD.Label,{className:$t("text-sm font-medium block",n.className),style:{color:y.$16},children:n.label}),h.jsx("div",{className:"relative mt-1",children:h.jsxs("div",{className:$t("relative w-full cursor-default overflow-hidden rounded-md border text-left sm:text-sm",{"shadow-sm":v,"border-[#09090B26]":!C.dark_mode&&!I,"border-black":!C.dark_mode&&I,"border-[#1f2e41]":C.dark_mode&&!I,"border-white":C.dark_mode&&I}),children:[h.jsx(XD.Input,{"data-testid":"combobox-input-field",ref:V,className:"w-full rounded-md py-1.5 pl-3 pr-10 sm:text-sm sm:leading-6 focus:outline-none focus:ring-0",onChange:B=>k(B.target.value),displayValue:B=>{var W;return((W=f.inputLabelFn)==null?void 0:W.call(f,B==null?void 0:B.resource))??((B==null?void 0:B.label)||S)},onClick:()=>L(!0),placeholder:n.placeholder,style:{backgroundColor:y.$1,color:y.$3,border:"none"}}),!t&&h.jsx(XD.Button,{onClick:B=>{if(d)return B.preventDefault(),k(""),N&&L(!1),!N&&L(W=>!W),d();L(W=>!W)},className:"absolute inset-y-0 right-0 flex items-center rounded-r-md pl-2 pr-3 focus:outline-none",children:d&&N?h.jsx(gA,{size:"0.9rem",color:y.$3,"data-testid":"combobox-clear-icon"}):h.jsx($y,{color:y.$3,size:"1rem","data-testid":"combobox-chevrondown-icon"})})]})}),I&&h.jsxs(XD.Options,{static:!0,className:"border absolute z-10 mt-1 rounded-md shadow-2xl focus:outline-none sm:text-sm",style:{backgroundColor:y.$1,borderColor:y.$24},children:[h.jsxs("div",{className:"flex flex-col overflow-y-auto overflow-x-hidden max-h-60 p-1",children:[!!m&&h.jsx("div",{className:"min-w-[14rem] relative cursor-default select-none py-2 pl-3 pr-9",children:h.jsx(yo,{})}),!m&&!O.length&&h.jsxs("div",{className:"min-w-[14rem] relative cursor-default select-none py-2 px-3 text-sm font-medium",children:[b("no_records_found"),"."]}),i&&S.length>0&&!m&&h.jsx(Nje,{theme:{hoverColor:y.$20},className:"min-w-[14rem] relative cursor-pointer select-none py-2 px-3 rounded-[0.1875rem]",value:{id:-1,label:i?S:null,value:i?S:null,resource:null},children:()=>h.jsxs("div",{className:"block space-x-1",children:[h.jsx("span",{children:b("Select")}),h.jsx("q",{className:"font-semibold",children:S})]})},"combobox-not-found"),O.length>0&&!m&&O.map(B=>h.jsx(Nje,{theme:{hoverColor:y.$20},value:B,className:"min-w-[14rem] relative cursor-pointer select-none py-2 px-3 rounded-[0.1875rem]",style:{color:y.$3},children:({selected:W})=>h.jsxs("div",{className:"flex items-center space-x-2",children:[W&&h.jsx("div",{className:"self-start mt-1",style:{color:y.$3},children:h.jsx(Nwe,{size:"0.9rem",color:y.$3})}),h.jsx("div",{className:$t("block",{"pl-6":!W&&(N==null?void 0:N.value)}),children:B.resource&&typeof f.dropdownLabelFn<"u"?f.dropdownLabelFn(B.resource):B.label})]})},B.id))]}),l&&l.visible&&h.jsx("div",{className:"border-t w-full p-1",style:{borderColor:y.$21},children:h.jsxs(hnt,{theme:{hoverColor:y.$20},"data-testid":"combobox-action-button",type:"button",onClick:l.onClick,className:"flex items-center space-x-2 justify-start w-full relative cursor-pointer select-none py-2 px-3 rounded-[0.1875rem]",tabIndex:-1,style:{color:y.$3},children:[h.jsx("div",{children:h.jsx(nc,{size:"1rem",color:y.$16})}),h.jsx("span",{className:"text-sm font-medium",children:l.label})]})})]})]}),h.jsx(Kl,{className:"mt-2",children:p})]})}function qd({endpoint:n,inputOptions:e,entryOptions:t,readonly:i,staleTime:r,initiallyVisible:s,sortBy:o="created_at|desc",exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,onChange:f,onDismiss:p,disableWithQueryParameter:g,errorMessage:m,clearInputAfterSelection:_,onInputValueChange:v,compareOnlyByValue:b,withShadow:y}){const[C,S]=x.useState([]),[k,I]=x.useState(n),[L,N]=x.useState(!1);x.useEffect(()=>{I(n)},[n]);const P=x.useRef(void 0),O=()=>C.length?!!C.find(W=>W.value===e.value||W.label===e.value):!0,{data:F,isLoading:V}=lr([new URL(k).pathname,new URL(k).pathname+new URL(k).search],()=>Je("GET",new URL(k).href).then(B=>{const W=[];return B.data.data.map(q=>{var U;return W.push({id:q[t.id],label:q[t.label],value:t.customValue?t.customValue(q):q[t.value],resource:q,eventType:"external",searchable:((U=t.customSearchableValue)==null?void 0:U.call(t,q))||q[t.searchable||t.id]})}),W}),{staleTime:r??1/0,enabled:L});x.useEffect(()=>{if(!k.includes("/api/v1/products")&&!L){clearTimeout(P.current);const B=setTimeout(()=>N(!0),100);P.current=B}},[e.value]),x.useEffect(()=>{L&&e.value&&!g&&!O()&&I(B=>{const W=new URL(B);return e.value&&e.value.toString().length>0&&(W.searchParams.set("with",e.value.toString()),W.searchParams.get("sort")&&W.searchParams.delete("sort")),W.href}),L&&!e.value&&I(B=>{const W=new URL(B);return W.searchParams.get("with")&&W.searchParams.delete("with"),o&&W.searchParams.set("sort",o),W.href})},[C,L,e.value]),x.useEffect(()=>{F&&S([...F])},[F]),x.useEffect(()=>(I(B=>{const W=new URL(B);return o&&W.searchParams.set("sort",o),W.searchParams.set("status","active"),W.searchParams.set("filter",""),W.href}),()=>{S([]),N(!1),P.current=void 0}),[]);const M=B=>{I(W=>{const q=new URL(W);return q.searchParams.set("filter",B),q.href})};return k.includes("/api/v1/products")?h.jsx(lpn,{entries:C,inputOptions:e,readonly:i,onChange:f,onDismiss:p,initiallyVisible:s,exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,entryOptions:t,errorMessage:m,clearInputAfterSelection:_,isDataLoading:V,onFocus:()=>N(!0),onInputValueChange:v,onEmptyValues:M,compareOnlyByValue:b,withShadow:y}):h.jsx(fnt,{entries:C,inputOptions:e,readonly:i,onChange:f,onEmptyValues:M,onDismiss:p,initiallyVisible:s,exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,entryOptions:t,errorMessage:m,clearInputAfterSelection:_,isDataLoading:V,onInputValueChange:v,compareOnlyByValue:b,withShadow:y})}function Cee(n){var o;const[e]=xe(),t=Yi(),i=Vw(),{isAdmin:r,isOwner:s}=go();return h.jsx(qd,{inputOptions:{label:(o=n.inputLabel)==null?void 0:o.toString(),value:n.value??null},endpoint:ze(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||s)&&!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 cpn(){const[n]=xe(),{isCompanySettingsActive:e}=el();return`${n("default")}`,(Vy()||$u())&&!0&&e&&bw(),[{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:"client_ses",label:"Amazon SES",enabled:!0},{value:"smtp",label:"SMTP",enabled:e&&!bw()}]}function upn(){var o;const[n]=xe(),e=Nr(),t=Xs(),[i,r]=x.useState(!1),s=()=>{i||(pe.processing(),r(!0),Je("POST",ze("/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(a=>pe.success(a.data.message)).finally(()=>r(!1)))};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("host"),leftSideHelp:n("host_help"),children:h.jsx(lt,{value:(e==null?void 0:e.smtp_host)||"",onValueChange:a=>t("smtp_host",a),disabled:i})}),h.jsx(ne,{leftSide:n("port"),leftSideHelp:n("port_help"),children:h.jsx(lt,{value:(e==null?void 0:e.smtp_port)||"",onValueChange:a=>t("smtp_port",a),disabled:i})}),h.jsx(ne,{leftSide:n("encryption"),children:h.jsxs(Dn,{value:(e==null?void 0:e.smtp_encryption)||"",onValueChange:a=>t("smtp_encryption",a),withBlank:!0,disabled:i,customSelector:!0,children:[h.jsx("option",{value:"tls",children:"STARTTLS"}),h.jsx("option",{value:"ssl",children:"SSL/TLS"})]})}),h.jsx(ne,{leftSide:n("username"),children:h.jsx(lt,{value:(e==null?void 0:e.smtp_username)||"",onValueChange:a=>t("smtp_username",a),disabled:i})}),h.jsx(ne,{leftSide:n("password"),children:h.jsx(lt,{value:(e==null?void 0:e.smtp_password)||"",onValueChange:a=>t("smtp_password",a),disabled:i})}),h.jsx(ne,{leftSide:n("local_domain"),leftSideHelp:n("local_domain_help"),children:h.jsx(lt,{value:(e==null?void 0:e.smtp_local_domain)||"",onValueChange:a=>t("smtp_local_domain",a),disabled:i})}),h.jsx(ne,{leftSide:n("bcc_email"),leftSideHelp:n("comma_sparated_list"),children:h.jsx(lt,{value:(e==null?void 0:e.settings.bcc_email)||"",onValueChange:a=>t("settings.bcc_email",a)})}),h.jsx(ne,{leftSide:n("send_time"),children:h.jsx(Dn,{value:((o=e==null?void 0:e.settings.entity_send_time)==null?void 0:o.toString())||"",onValueChange:a=>t("settings.entity_send_time",a.length>0?a:6),withBlank:!0,customSelector:!0,children:[...Array(24).keys()].map((a,l)=>h.jsx("option",{value:(a+1).toString(),children:Jn().startOf("day").add(a+1,"hour").format("h:ss A")},l))})}),h.jsx(ne,{leftSide:n("verify_peer"),children:h.jsx(jt,{checked:(e==null?void 0:e.smtp_verify_peer)??!0,onValueChange:a=>t("smtp_verify_peer",a),disabled:i})}),h.jsx(ne,{pushContentToRight:!0,children:h.jsx(dn,{behavior:"button",onClick:s,disableWithoutIcon:!0,disabled:i,children:n("send_test_email")})})]})}function dpn({visible:n,setVisible:e,onConfirm:t}){const[i]=xe(),[r,s]=x.useState(!1),o=()=>{s(!1),e(!1)};return h.jsx(pr,{title:i("send_time"),visible:n,onClose:o,children:h.jsxs("div",{className:"flex flex-col space-y-4",children:[h.jsxs("div",{className:"flex flex-col space-y-2",children:[h.jsx(ne,{leftSide:i("sync_send_time"),noExternalPadding:!0,noVerticalPadding:!0,withoutWrappingLeftSide:!0,children:h.jsx(jt,{checked:r,onChange:()=>s(!r)})}),h.jsx("span",{className:"text-sm text-gray-500",children:i("sync_send_time_help")})]}),h.jsx(dn,{behavior:"button",onClick:()=>{t(r),o()},children:i("confirm")})]})})}function hpn(){var m;vr("email_settings");const[n]=xe(),e=[{name:n("settings"),href:"/settings"},{name:n("email_settings"),href:"/settings/email_settings"}],t=xt(),i=xu(),r=zi(),s=cpn(),o=ji(ya),a=ji(_f),[l,c]=x.useState(!1),u=xg(),d=pd(),f=cl(),p=Xs(),g=()=>{(r==null?void 0:r.settings.entity_send_time)!==(i==null?void 0:i.settings.entity_send_time)?c(!0):d()};return h.jsxs(h.Fragment,{children:[h.jsxs(Kr,{title:n("email_settings"),docsLink:"en/advanced-settings/#email_settings",breadcrumbs:e,onSaveClick:g,onCancelClick:u,disableSaveButton:a,children:[h.jsx(Gb,{}),h.jsxs(er,{title:n("email_settings"),className:"shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"show_email_footer",labelElement:h.jsx(un,{label:n("show_email_footer")})}),children:h.jsx(jt,{checked:!!(i!=null&&i.settings.show_email_footer),onValueChange:_=>p("settings.show_email_footer",_),disabled:f("show_email_footer")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"pdf_email_attachment",labelElement:h.jsx(un,{label:n("attach_pdf")})}),children:h.jsx(jt,{checked:!!(i!=null&&i.settings.pdf_email_attachment),onValueChange:_=>p("settings.pdf_email_attachment",_),disabled:f("pdf_email_attachment")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"document_email_attachment",labelElement:h.jsx(un,{label:n("attach_documents")})}),children:h.jsx(jt,{checked:!!(i!=null&&i.settings.document_email_attachment),onValueChange:_=>p("settings.document_email_attachment",_),disabled:f("document_email_attachment")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"ubl_email_attachment",labelElement:h.jsx(un,{label:n("attach_ubl"),helpLabel:_9(`${n("ubl_email_attachment_help")}.`,":here",()=>h.jsx(Ji,{className:"text-xs",to:"/settings/e_invoice",children:n("here")}))})}),children:h.jsx(jt,{checked:!!(i!=null&&i.settings.ubl_email_attachment),onValueChange:_=>p("settings.ubl_email_attachment",_),disabled:f("ubl_email_attachment")})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,style:{borderColor:t.$20}})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"email_sending_method",labelElement:h.jsx(un,{label:n("email_provider")}),defaultValue:"default"}),children:h.jsx(Dn,{value:(i==null?void 0:i.settings.email_sending_method)||"default",onValueChange:_=>p("settings.email_sending_method",_),disabled:f("email_sending_method")||!Vy()&&!$u(),errorMessage:o==null?void 0:o.errors["settings.email_sending_method"],customSelector:!0,dismissable:!1,children:s.filter(({enabled:_})=>_).map(({value:_,label:v})=>h.jsx("option",{value:_,children:v},_))})}),((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")&&To(),(i==null?void 0:i.settings.email_sending_method)==="client_postmark"&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"postmark_secret",labelElement:h.jsx(un,{label:n("secret")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.postmark_secret)||"",onValueChange:_=>p("settings.postmark_secret",_),disabled:f("postmark_secret"),errorMessage:o==null?void 0:o.errors["settings.postmark_secret"]})}),(i==null?void 0:i.settings.email_sending_method)==="client_ses"&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"ses_secret_key",labelElement:h.jsx(un,{label:n("ses_secret_key")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.ses_secret_key)||"",onValueChange:_=>p("settings.ses_secret_key",_),disabled:f("ses_secret_key"),errorMessage:o==null?void 0:o.errors["settings.ses_secret_key"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"ses_access_key",labelElement:h.jsx(un,{label:n("ses_access_key")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.ses_access_key)||"",onValueChange:_=>p("settings.ses_access_key",_),disabled:f("ses_access_key"),errorMessage:o==null?void 0:o.errors["settings.ses_access_key"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"ses_region",labelElement:h.jsx(un,{label:n("region")})}),leftSideHelp:n("ses_region_help"),children:h.jsx(lt,{value:(i==null?void 0:i.settings.ses_region)||"",onValueChange:_=>p("settings.ses_region",_),disabled:f("ses_region"),errorMessage:o==null?void 0:o.errors["settings.ses_region"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"ses_from_address",labelElement:h.jsx(un,{label:n("ses_from_address")})}),leftSideHelp:n("ses_from_address_help"),children:h.jsx(lt,{value:(i==null?void 0:i.settings.ses_from_address)||"",onValueChange:_=>p("settings.ses_from_address",_),disabled:f("ses_from_address"),errorMessage:o==null?void 0:o.errors["settings.ses_from_address"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"ses_topic_arn",labelElement:h.jsx(un,{label:n("topic_arn")})}),leftSideHelp:n("ses_topic_arn_help"),children:h.jsx(lt,{value:(i==null?void 0:i.settings.ses_topic_arn)||"",onValueChange:_=>p("settings.ses_topic_arn",_),disabled:f("ses_topic_arn"),errorMessage:o==null?void 0:o.errors["settings.ses_topic_arn"]})})]}),(i==null?void 0:i.settings.email_sending_method)==="client_mailgun"&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"mailgun_secret",labelElement:h.jsx(un,{label:n("secret")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.mailgun_secret)||"",onValueChange:_=>p("settings.mailgun_secret",_),disabled:f("mailgun_secret"),errorMessage:o==null?void 0:o.errors["settings.mailgun_secret"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"mailgun_domain",labelElement:h.jsx(un,{label:n("domain")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.mailgun_domain)||"",onValueChange:_=>p("settings.mailgun_domain",_),disabled:f("mailgun_domain"),errorMessage:o==null?void 0:o.errors["settings.mailgun_domain"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"mailgun_endpoint",labelElement:h.jsx(un,{label:n("endpoint")}),defaultValue:"api.mailgun.net"}),children:h.jsxs(Dn,{value:(i==null?void 0:i.settings.mailgun_endpoint)||"api.mailgun.net",onValueChange:_=>p("settings.mailgun_endpoint",_),disabled:f("mailgun_endpoint"),errorMessage:o==null?void 0:o.errors["settings.mailgun_endpoint"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"api.mailgun.net",defaultChecked:!0,children:"api.mailgun.net"}),h.jsx("option",{value:"api.eu.mailgun.net",children:"api.eu.mailgun.net"})]})})]}),(i==null?void 0:i.settings.email_sending_method)==="client_brevo"&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"brevo_secret",labelElement:h.jsx(un,{label:n("secret")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.brevo_secret)||"",onValueChange:_=>p("settings.brevo_secret",_),disabled:f("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")&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"custom_sending_email",labelElement:h.jsx(un,{label:n("from_email")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.custom_sending_email)||"",onValueChange:_=>p("settings.custom_sending_email",_),disabled:f("custom_sending_email"),errorMessage:o==null?void 0:o.errors["settings.custom_sending_email"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"email_from_name",labelElement:h.jsx(un,{label:n("from_name")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.email_from_name)||"",onValueChange:_=>p("settings.email_from_name",_),disabled:f("email_from_name"),errorMessage:o==null?void 0:o.errors["settings.email_from_name"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"reply_to_name",labelElement:h.jsx(un,{label:n("reply_to_name")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.reply_to_name)||"",onValueChange:_=>p("settings.reply_to_name",_),disabled:f("reply_to_name"),errorMessage:o==null?void 0:o.errors["settings.reply_to_name"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"reply_to_email",labelElement:h.jsx(un,{label:n("reply_to_email")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.reply_to_email)||"",onValueChange:_=>p("settings.reply_to_email",_),disabled:f("reply_to_email"),errorMessage:o==null?void 0:o.errors["settings.reply_to_email"]})}),(i==null?void 0:i.settings.email_sending_method)!=="smtp"&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"bcc_email",labelElement:h.jsx(un,{label:n("bcc_email"),helpLabel:n("comma_sparated_list")})}),children:h.jsx(lt,{value:(i==null?void 0:i.settings.bcc_email)||"",onValueChange:_=>p("settings.bcc_email",_),disabled:f("bcc_email"),errorMessage:o==null?void 0:o.errors["settings.bcc_email"]})}),(i==null?void 0:i.settings.email_sending_method)!=="smtp"&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"entity_send_time",labelElement:h.jsx(un,{label:n("send_time")})}),children:h.jsx(Dn,{value:((m=i==null?void 0:i.settings.entity_send_time)==null?void 0:m.toString())||"",onValueChange:_=>p("settings.entity_send_time",_.length>0?_:6),withBlank:!0,disabled:f("entity_send_time"),errorMessage:o==null?void 0:o.errors["settings.entity_send_time"],customSelector:!0,children:[...Array(24).keys()].map((_,v)=>h.jsx("option",{value:(_+1).toString(),children:Jn().startOf("day").add(_+1,"hour").format("h:ss A")},v))})}),(i==null?void 0:i.settings.email_sending_method)==="smtp"&&h.jsx(upn,{}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,style:{borderColor:t.$20}})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"email_style",labelElement:h.jsx(un,{label:n("email_design")}),defaultValue:"plain"}),children:h.jsxs(Dn,{value:(i==null?void 0:i.settings.email_style)||"plain",onValueChange:_=>p("settings.email_style",_),disabled:f("email_style"),errorMessage:o==null?void 0:o.errors["settings.email_style"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"plain",children:n("plain")}),h.jsx("option",{value:"light",children:n("light")}),h.jsx("option",{value:"dark",children:n("dark")}),h.jsx("option",{value:"custom",children:n("custom")})]})}),(i==null?void 0:i.settings.email_style)==="custom"&&h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"email_style_custom",labelElement:h.jsx(un,{label:n("custom")})}),children:h.jsx(lt,{element:"textarea",value:(i==null?void 0:i.settings.email_style_custom)||"",onValueChange:_=>_.includes("$body")?p("settings.email_style_custom",_):pe.error(Ua("body_variable_missing",{body:"$body"})),disabled:f("email_style_custom"),errorMessage:o==null?void 0:o.errors["settings.email_style_custom"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"email_signature",labelElement:h.jsx(un,{label:n("signature")})}),children:h.jsx(dh,{value:(i==null?void 0:i.settings.email_signature)||"",onChange:_=>p("settings.email_signature",_),disabled:f("email_signature")})})]})]}),h.jsx(dpn,{visible:l,setVisible:c,onConfirm:_=>{d({syncSendTime:_})}})]})}function fpn(){var u,d,f,p,g;const[n]=xe();xu();const{isCompanySettingsActive:e}=el(),t=xt(),i=Nr(),r=cl(),s=Xs(),[o,a]=oo(ya),[l,c]=x.useState("");return h.jsxs(h.Fragment,{children:[To(),e&&h.jsx(ne,{leftSide:n("domain_url"),children:h.jsx(lt,{value:(i==null?void 0:i.portal_domain)||"",onValueChange:m=>s("portal_domain",m),errorMessage:o==null?void 0:o.errors.portal_domain})}),e&&h.jsx(ne,{leftSide:h.jsxs("div",{className:"flex items-center space-x-1",children:[h.jsxs("span",{children:[n("login")," ",n("url")]}),!!To()&&h.jsxs("div",{className:"flex items-center space-x-0.5",children:[h.jsx("span",{children:"("}),h.jsx(Ji,{to:"https://invoiceninja.github.io/en/hosted-custom-domain/#custom-domain-configuration",external:!0,withoutExternalIcon:!0,children:n("app_help_link")}),h.jsx("span",{children:")"})]})]}),children:h.jsxs("div",{className:"flex flex-col space-y-1",children:[h.jsx(Tc,{className:"break-all",text:`${i==null?void 0:i.portal_domain}/client/login/${i==null?void 0:i.company_key}`}),!!To()&&h.jsx(Tc,{className:"break-all",text:`${i==null?void 0:i.portal_domain}/client/login`}),!!To()&&h.jsx(Tc,{className:"break-all",text:`${i==null?void 0:i.subdomain}.invoicing.co/client/login`})]})}),e&&h.jsx("div",{className:"px-4 sm:px-6 pt-5",children:h.jsx(Ki,{className:"border-dashed",borderColor:t.$20,withoutPadding:!0})}),h.jsx(ne,{className:$t({"mt-4":e}),leftSide:h.jsx(cn,{propertyKey:"enable_client_portal",labelElement:h.jsx(un,{label:n("client_portal")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(i!=null&&i.settings.enable_client_portal),onValueChange:m=>s("settings.enable_client_portal",m),disabled:r("enable_client_portal")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"client_portal_enable_uploads",labelElement:h.jsx(un,{label:n("client_document_upload"),helpLabel:n("document_upload_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(i!=null&&i.settings.client_portal_enable_uploads),onValueChange:m=>s("settings.client_portal_enable_uploads",m),disabled:r("client_portal_enable_uploads")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"vendor_portal_enable_uploads",labelElement:h.jsx(un,{label:n("vendor_document_upload"),helpLabel:n("vendor_document_upload_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(i!=null&&i.settings.vendor_portal_enable_uploads),onValueChange:m=>s("settings.vendor_portal_enable_uploads",m),disabled:r("vendor_portal_enable_uploads")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"accept_client_input_quote_approval",labelElement:h.jsx(un,{label:n("accept_purchase_order_number"),helpLabel:n("accept_purchase_order_number_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(i!=null&&i.settings.accept_client_input_quote_approval),onValueChange:m=>s("settings.accept_client_input_quote_approval",m),disabled:r("accept_client_input_quote_approval")})}),h.jsx(ne,{leftSide:n("show_pdfhtml_on_mobile"),leftSideHelp:n("show_pdfhtml_on_mobile_help"),children:h.jsx(jt,{checked:!!((u=i==null?void 0:i.settings)!=null&&u.show_pdfhtml_on_mobile),onValueChange:m=>s("settings.show_pdfhtml_on_mobile",m),disabled:r("show_pdfhtml_on_mobile")})}),((d=i==null?void 0:i.settings)==null?void 0:d.show_pdfhtml_on_mobile)&&h.jsx(ne,{leftSide:n("preference_product_notes_for_html_view"),leftSideHelp:n("preference_product_notes_for_html_view_help"),children:h.jsx(jt,{checked:!!((f=i==null?void 0:i.settings)!=null&&f.preference_product_notes_for_html_view),onValueChange:m=>s("settings.preference_product_notes_for_html_view",m)})}),h.jsx(ne,{leftSide:n("enable_client_portal_dashboard"),leftSideHelp:n("enable_client_portal_dashboard_help"),children:h.jsx(jt,{checked:!!((p=i==null?void 0:i.settings)!=null&&p.enable_client_portal_dashboard),onValueChange:m=>s("settings.enable_client_portal_dashboard",m)})}),h.jsx(ne,{leftSide:n("enable_client_profile_update"),leftSideHelp:n("enable_client_profile_update_help"),children:h.jsx(jt,{checked:!!((g=i==null?void 0:i.settings)!=null&&g.enable_client_profile_update),onValueChange:m=>s("settings.enable_client_profile_update",m)})}),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-2",children:h.jsx(Ki,{className:"border-dashed",borderColor:t.$20,withoutPadding:!0})}),h.jsx(ne,{className:"mt-4",leftSide:h.jsx(cn,{propertyKey:"client_portal_terms",labelElement:h.jsx(un,{label:n("terms_of_service")})}),children:h.jsx(lt,{element:"textarea",onValueChange:m=>s("settings.client_portal_terms",m),value:(i==null?void 0:i.settings.client_portal_terms)||"",disabled:r("client_portal_terms"),errorMessage:o==null?void 0:o.errors["settings.client_portal_terms"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"client_portal_privacy_policy",labelElement:h.jsx(un,{label:n("privacy_policy")})}),children:h.jsx(lt,{element:"textarea",onValueChange:m=>s("settings.client_portal_privacy_policy",m),value:(i==null?void 0:i.settings.client_portal_privacy_policy)||"",disabled:r("client_portal_privacy_policy"),errorMessage:o==null?void 0:o.errors["settings.client_portal_privacy_policy"]})})]})}function ppn(){const[n]=xe(),e=xt(),t=Nr(),i=cl(),r=Xs();return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"enable_client_portal_password",labelElement:h.jsx(un,{label:n("enable_portal_password"),helpLabel:n("enable_portal_password_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(t!=null&&t.settings.enable_client_portal_password),onValueChange:s=>r("settings.enable_client_portal_password",s),disabled:i("enable_client_portal_password")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"show_accept_invoice_terms",labelElement:h.jsx(un,{label:n("show_accept_invoice_terms"),helpLabel:n("show_accept_invoice_terms_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(t!=null&&t.settings.show_accept_invoice_terms),onValueChange:s=>r("settings.show_accept_invoice_terms",s),disabled:i("show_accept_invoice_terms")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"show_accept_quote_terms",labelElement:h.jsx(un,{label:n("show_accept_quote_terms"),helpLabel:n("show_accept_quote_terms_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(t!=null&&t.settings.show_accept_quote_terms),onValueChange:s=>r("settings.show_accept_quote_terms",s),disabled:i("show_accept_quote_terms")})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:e.$20,withoutPadding:!0})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"require_invoice_signature",labelElement:h.jsx(un,{label:n("require_invoice_signature"),helpLabel:n("require_invoice_signature_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(t!=null&&t.settings.require_invoice_signature),onValueChange:s=>r("settings.require_invoice_signature",s),disabled:i("require_invoice_signature")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"require_quote_signature",labelElement:h.jsx(un,{label:n("require_quote_signature"),helpLabel:n("require_quote_signature_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(t!=null&&t.settings.require_quote_signature),onValueChange:s=>r("settings.require_quote_signature",s),disabled:i("require_quote_signature")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"require_purchase_order_signature",labelElement:h.jsx(un,{label:n("require_purchase_order_signature"),helpLabel:n("require_purchase_order_signature_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(t!=null&&t.settings.require_purchase_order_signature),onValueChange:s=>r("settings.require_purchase_order_signature",s),disabled:i("require_purchase_order_signature")})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"signature_on_pdf",labelElement:h.jsx(un,{label:n("signature_on_pdf"),helpLabel:n("signature_on_pdf_help")}),defaultValue:!1}),children:h.jsx(jt,{checked:!!(t!=null&&t.settings.signature_on_pdf),onValueChange:s=>r("settings.signature_on_pdf",s),disabled:i("signature_on_pdf")})})]})}function gpn(){const[n]=xe();xt();const e=Nr(),t=cl(),i=Xs(),r=ji(ya);return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"portal_custom_head",labelElement:h.jsx(un,{label:n("header")})}),children:h.jsx(lt,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_head)||"",onValueChange:s=>i("settings.portal_custom_head",s),disabled:t("portal_custom_head"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_head"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"portal_custom_footer",labelElement:h.jsx(un,{label:n("footer")})}),children:h.jsx(lt,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_footer)||"",onValueChange:s=>i("settings.portal_custom_footer",s),disabled:t("portal_custom_footer"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_footer"]})}),h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"portal_custom_css",labelElement:h.jsx(un,{label:n("custom_css")})}),children:h.jsx(lt,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_css)||"",onValueChange:s=>i("settings.portal_custom_css",s),disabled:t("portal_custom_css"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_css"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"portal_custom_js",labelElement:h.jsx(un,{label:n("custom_javascript")})}),children:h.jsx(lt,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_js)||"",onValueChange:s=>i("settings.portal_custom_js",s),disabled:t("portal_custom_js"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_js"]})})]})]})}function mpn(){const[n]=xe();xt();const e=Nr(),{isCompanySettingsActive:t}=el(),i=cl(),r=Xs(),s=ji(ya);return h.jsxs(h.Fragment,{children:[t&&h.jsx(ne,{leftSide:n("dashboard"),children:h.jsx(lt,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_dashboard)||"",onValueChange:o=>r("settings.custom_message_dashboard",o),errorMessage:s==null?void 0:s.errors["settings.custom_message_dashboard"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"custom_message_unpaid_invoice",labelElement:h.jsx(un,{label:n("unpaid_invoice")})}),children:h.jsx(lt,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_unpaid_invoice)||"",onValueChange:o=>r("settings.custom_message_unpaid_invoice",o),disabled:i("custom_message_unpaid_invoice"),errorMessage:s==null?void 0:s.errors["settings.custom_message_unpaid_invoice"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"custom_message_paid_invoice",labelElement:h.jsx(un,{label:n("paid_invoice")})}),children:h.jsx(lt,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_paid_invoice)||"",onValueChange:o=>r("settings.custom_message_paid_invoice",o),disabled:i("custom_message_paid_invoice"),errorMessage:s==null?void 0:s.errors["settings.custom_message_paid_invoice"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"custom_message_unapproved_quote",labelElement:h.jsx(un,{label:n("unapproved_quote")})}),children:h.jsx(lt,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_unapproved_quote)||"",onValueChange:o=>r("settings.custom_message_unapproved_quote",o),disabled:i("custom_message_unapproved_quote"),errorMessage:s==null?void 0:s.errors["settings.custom_message_unapproved_quote"]})})]})}function _pn(){const[n]=xe(),e=xt(),t=Nr(),i=Xs(),r=[{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")}],s=a=>{const c=pn.cloneDeep((t==null?void 0:t.client_registration_fields)||[]).find(d=>d.key===a);let u="hidden";return c!=null&&c.required&&(c!=null&&c.visible)&&(u="required"),!(c!=null&&c.required)&&(c!=null&&c.visible)&&(u="optional"),u},o=(a,l)=>{let c=pn.cloneDeep((t==null?void 0:t.client_registration_fields)||[]);const u=c.some(f=>f.key===a),d=r.findIndex(f=>f.field===a);if(d>=0){let f={visible:!1,required:!1};if(l==="optional"&&(f={...f,visible:!0}),l==="required"&&(f={visible:!0,required:!0}),u){const p=c.map(g=>({...g,required:g.key===a?f.required:g.required,visible:g.key===a?f.visible:g.visible}));i("client_registration_fields",p)}else{const p=r[d];c=[...c,{key:p.field,...f}],i("client_registration_fields",c)}}};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("client_registration"),leftSideHelp:n("client_registration_help"),children:h.jsx(jt,{checked:!!(t!=null&&t.client_can_register),onValueChange:a=>i("client_can_register",a)})}),(t==null?void 0:t.client_can_register)&&h.jsx(ne,{leftSide:n("registration_url"),children:h.jsx(Tc,{text:`${t==null?void 0:t.portal_domain}/client/register?company_key=${t==null?void 0:t.company_key}`})}),h.jsx("div",{className:"px-4 sm:px-6 pt-3 pb-4",children:h.jsx(Ki,{className:"border-dashed",borderColor:e.$20,withoutPadding:!0})}),r.map(a=>h.jsx(ne,{leftSide:a.label,children:h.jsxs(Dn,{value:s(a.field),onValueChange:l=>o(a.field,l),customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"hidden",defaultChecked:!0,children:n("hidden")}),h.jsx("option",{value:"optional",children:n("optional")}),h.jsx("option",{value:"required",children:n("required")})]})},a.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 vpn(){const[n]=xe(),{isGroupSettingsActive:e,isClientSettingsActive:t}=el();let i=[{name:n("settings"),href:Ut("/settings/client_portal")},{name:n("authorization"),href:Ut("/settings/client_portal/authorization")},{name:n("registration"),href:Ut("/settings/client_portal/registration")},{name:n("messages"),href:Ut("/settings/client_portal/messages")},{name:n("customize"),href:Ut("/settings/client_portal/customize")}];return(e||t)&&(i=i.filter(r=>r.name!==n("registration"))),i}function bpn(){vr("client_portal");const[n]=xe();xu();const e=xg(),t=pd(),i=vpn(),r=xt(),s=ji(_f),o=[{name:n("settings"),href:"/settings"},{name:n("client_portal"),href:"/settings/client_portal"}];return h.jsxs(Kr,{title:n("client_portal"),docsLink:"en/advanced-settings/#client_portal",breadcrumbs:o,onSaveClick:t,onCancelClick:e,disableSaveButton:s,children:[h.jsx(Gb,{}),h.jsxs(er,{title:n("client_portal"),className:"shadow-sm",style:{borderColor:r.$24},withoutBodyPadding:!0,withoutHeaderBorder:!0,children:[h.jsx(wk,{tabs:i,withHorizontalPadding:!0,horizontalPaddingWidth:"1.5rem",fullRightPadding:!0,withHorizontalPaddingOnSmallScreen:!0}),h.jsx("div",{className:"pt-4 pb-6",children:h.jsx(Hm,{})})]})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ypn(n,e){return e.replace("$body",n)}function TV(n){const e=xt();return h.jsx("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),rze.success(Ua("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 Cpn={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 wpn={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 Qh=(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))(Qh||{});/** * 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 NL={[Qh.Daily]:"freq_daily",[Qh.Weekly]:"freq_weekly",[Qh.TwoWeeks]:"freq_two_weeks",[Qh.FourWeeks]:"freq_four_weeks",[Qh.Monthly]:"freq_monthly",[Qh.TwoMonths]:"freq_two_months",[Qh.ThreeMonths]:"freq_three_months",[Qh.FourMonths]:"freq_four_months",[Qh.SixMonths]:"freq_six_months",[Qh.Annually]:"freq_annually",[Qh.TwoYears]:"freq_two_years",[Qh.ThreeYears]:"freq_three_years"},zx=["reminder1","reminder2","reminder3"];function xpn(){vr("templates_and_reminders");const[n]=xe(),e=[{name:n("settings"),href:"/settings"},{name:n("templates_and_reminders"),href:"/settings/templates_and_reminders"}],t=xt(),i=xu(),r=ji(_f),{isCompanySettingsActive:s}=el(),o=xg(),a=pd(),l=cl(),c=Xs(),{data:u}=Zd(),[d,f]=x.useState(s||i!=null&&i.settings.email_template_invoice?"invoice":""),[p,g]=x.useState(),[m,_]=x.useState(),[v,b]=x.useState(!0),[y,C]=x.useState(-1),[S,k]=x.useState(!1),I=H=>H==="partial_payment"?"payment_partial":H,L=d==="quote_reminder1"?"email_quote_subject_reminder1":`email_subject_${I(d)||"invoice"}`,N=d==="quote_reminder1"?"email_quote_template_reminder1":`email_template_${I(d)||"invoice"}`,P=H=>d==="quote_reminder1"?"quote_num_days_reminder1":`num_days_reminder${H}`,O=H=>d==="quote_reminder1"?"quote_schedule_reminder1":`schedule_reminder${H}`,F=H=>d==="quote_reminder1"?"enable_quote_reminder1":`enable_reminder${H}`,V=H=>d==="quote_reminder1"?"quote_late_fee_amount1":`late_fee_amount${H}`,M=H=>d==="quote_reminder1"?"quote_late_fee_percent1":`late_fee_percent${H}`,B=()=>{var H,z;if(u!=null&&u.templates&&i&&d){const Z={subject:i.settings[L],body:i.settings[N]};if(((H=Z.subject)==null?void 0:H.length)>0||((z=Z.body)==null?void 0:z.length)>0)g({...Z});else{const X=u.templates[d]||{subject:i.settings[L]||"",body:i.settings[N]||""};g({...X})}}},W=H=>{const z=pn.cloneDeep(i==null?void 0:i.settings);z&&(H?(z[P(H)]=0,z[O(H)]="disabled",z[F(H)]=!1,z[V(H)]=0,z[M(H)]=0):(z.enable_reminder_endless=!1,z.endless_reminder_frequency_id=""),c("settings",z))},q=(H,z)=>{const Z=pn.cloneDeep(z||(i==null?void 0:i.settings));Z&&(H?(delete Z[P(H)],delete Z[O(H)],delete Z[F(H)],delete Z[V(H)],delete Z[M(H)]):(delete Z.enable_reminder_endless,delete Z.endless_reminder_frequency_id),c("settings",Z))},U=H=>{if(!H){const z=pn.cloneDeep(i==null?void 0:i.settings);if(z){const Z=y>-1?`reminder${y}`:"";delete z[d==="quote_reminder1"?"email_quote_subject_reminder1":`email_subject_${I(Z||d)}`],zx.includes(d)||d==="reminder_endless"?q(zx.indexOf(d)+1,z):c("settings",z),g(void 0)}}H&&!d&&f("invoice"),H&&d&&(B(),l(N)&&zx.includes(d)&&W(zx.indexOf(d)+1),d==="reminder_endless"&&l("email_template_reminder_endless")&&W())};x.useEffect(()=>{if(u!=null&&u.templates&&i&&d){zx.includes(d)?C(zx.indexOf(d)+1):C(-1);const H=i==null?void 0:i.settings[N];(s||H&&!s||d==="invoice"&&!H&&!s&&v)&&B(),v&&b(!1)}},[u,d]),x.useEffect(()=>{d&&p&&(c(`settings.${L}`,p==null?void 0:p.subject),c(`settings.${N}`,p==null?void 0:p.body),k(!0),Je("POST",ze("/api/v1/templates"),{body:p==null?void 0:p.body,subject:p==null?void 0:p.subject,entity:"",entity_id:"",template:N}).then(H=>_(H.data)).finally(()=>k(!1)))},[p]);const G=d==="payment"?wpn:Cpn;return h.jsxs(Kr,{title:n("templates_and_reminders"),docsLink:"en/advanced-settings/#templates_and_reminders",breadcrumbs:e,onSaveClick:a,onCancelClick:o,disableSaveButton:r,children:[h.jsx(Gb,{}),h.jsxs(er,{title:n("templates_and_reminders"),className:"shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:[h.jsx(ne,{leftSide:h.jsx(cn,{checked:typeof(i==null?void 0:i.settings[N])<"u",propertyKey:N,labelElement:h.jsx(un,{label:n("template")}),defaultValue:d||"invoice",onCheckboxChange:H=>U(H)}),children:h.jsxs(Dn,{value:d,onValueChange:H=>{f(H),!s&&g(void 0)},cypressRef:"templateSelector",customSelector:!0,dismissable:!1,children:[u&&Object.keys(u.templates).map((H,z)=>h.jsx("option",{value:H,children:n(H)},z)),h.jsx("option",{value:"credit",children:n("credit")}),h.jsx("option",{value:"purchase_order",children:n("purchase_order")}),h.jsx("option",{value:"custom1",children:n("first_custom")}),h.jsx("option",{value:"custom2",children:n("second_custom")}),h.jsx("option",{value:"custom3",children:n("third_custom")})]})}),h.jsx(ne,{leftSide:n("subject"),disabledLabels:l(N),children:h.jsx(lt,{id:"subject",value:(p==null?void 0:p.subject)||"",onValueChange:H=>g(z=>z&&{...z,subject:H}),disabled:l(N)})}),h.jsx(ne,{leftSide:n("body"),disabledLabels:l(N),children:h.jsx(dh,{value:(p==null?void 0:p.body)||"",onChange:H=>g(z=>z&&{...z,body:H}),disabled:l(N)})})]}),(zx.includes(d)||d==="reminder_endless"||d==="quote_reminder1")&&!l(N)&&h.jsx(er,{className:"shadow-sm",style:{borderColor:t.$24},children:zx.includes(d)||d==="quote_reminder1"?h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("days"),children:h.jsx(Qs,{precision:0,value:(i==null?void 0:i.settings[P(y)])||0,onValueChange:H=>c(`settings.${P(y)}`,parseFloat(H)||0),disablePrecision:!0})}),h.jsx(ne,{leftSide:n("schedule"),children:h.jsxs(Dn,{value:(i==null?void 0:i.settings[O(y)])||"disabled",onValueChange:H=>c(`settings.${O(y)}`,H),customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"disabled",defaultChecked:!0,children:n("disabled")}),h.jsx("option",{value:d==="quote_reminder1"?"after_quote_date":"after_invoice_date",children:n(d==="quote_reminder1"?"after_quote_date":"after_invoice_date")}),h.jsx("option",{value:d==="quote_reminder1"?"before_valid_until_date":"before_due_date",children:n(d==="quote_reminder1"?"before_valid_until_date":"before_due_date")}),h.jsx("option",{value:d==="quote_reminder1"?"after_valid_until_date":"after_due_date",children:n(d==="quote_reminder1"?"after_valid_until_date":"after_due_date")})]})}),h.jsx(ne,{leftSide:n("send_email"),children:h.jsx(jt,{checked:!!(i!=null&&i.settings[F(y)])||!1,onValueChange:H=>c(`settings.${F(y)}`,H)})}),h.jsx(ne,{leftSide:n("late_fee_amount"),children:h.jsx(Qs,{value:(i==null?void 0:i.settings[V(y)])||0,onValueChange:H=>c(`settings.${V(y)}`,parseFloat(H)||0)})}),h.jsx(ne,{leftSide:n("late_fee_percent"),children:h.jsx(Qs,{value:(i==null?void 0:i.settings[M(y)])||0,onValueChange:H=>c(`settings.${M(y)}`,parseFloat(H)||0)})})]}):h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:n("send_email"),children:h.jsx(jt,{checked:!!(i!=null&&i.settings.enable_reminder_endless),onValueChange:H=>c("settings.enable_reminder_endless",H)})}),h.jsx(ne,{leftSide:n("frequency"),children:h.jsx(Dn,{value:(i==null?void 0:i.settings.endless_reminder_frequency_id)||"",onValueChange:H=>c("settings.endless_reminder_frequency_id",H),withBlank:!0,customSelector:!0,children:Object.keys(NL).map((H,z)=>h.jsx("option",{value:H,children:n(NL[H])},z))})})]})}),m&&h.jsx(er,{className:"scale-y-100 shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},title:m.subject,children:S?h.jsx("div",{className:"flex justify-center items-center",style:{height:800},children:h.jsx(yo,{})}):h.jsx("iframe",{srcDoc:ypn(m.body,m.wrapper),frameBorder:"0",width:"100%",height:800,tabIndex:-1,loading:"lazy"})}),h.jsxs(er,{title:n("variables"),className:"shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:[h.jsx(ne,{leftSide:n("invoice"),className:"flex-wrap",children:h.jsx("div",{className:"flex flex-wrap",children:G.invoice.map((H,z)=>h.jsx(TV,{children:H},z))})}),h.jsx(ne,{leftSide:n("client"),className:"flex-wrap",children:h.jsx("div",{className:"flex flex-wrap",children:G.client.map((H,z)=>h.jsx(TV,{children:H},z))})}),h.jsx(ne,{leftSide:n("contact"),className:"flex-wrap",children:h.jsx("div",{className:"flex flex-wrap",children:G.contact.map((H,z)=>h.jsx(TV,{children:H},z))})}),h.jsx(ne,{leftSide:n("company"),className:"flex-wrap",children:h.jsx("div",{className:"flex flex-wrap",children:G.company.map((H,z)=>h.jsx(TV,{children:H},z))})})]})]})}const Spn=()=>{const{t:n}=xe(),e=zi(),t=vf(),i=Sk({resolveBy:"code"}),r=a=>{Je("POST",ze("/api/v1/one_time_token"),{context:"nordigen",platform:"react",institution_id:a}).then(l=>{var c;window.open(ze("/nordigen/connect/:hash",{hash:(c=l==null?void 0:l.data)==null?void 0:c.hash}))})},s=()=>{Je("POST",ze("/api/v1/one_time_token"),{context:"yodlee",platform:"react"}).then(a=>{var l;window.open(Ut("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)=>h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Ji,{to:Ut("/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&&h.jsx(Ah,{message:n("reconnect"),width:"auto",placement:"top",children:h.jsx("div",{className:"cursor-pointer",onClick:c=>{c.stopPropagation(),l.integration_type==="NORDIGEN"&&r(l.nordigen_institution_id),l.integration_type==="YODLEE"&&s()},children:h.jsx(jC,{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)}}]},Epn="/dap-logos/yodlee.svg",kpn="/dap-logos/goCardless.png";function Tpn(){const[n]=xe(),e=Lo(),t=xt(),i=x.useRef(null),[r,s]=x.useState(),[o,a]=x.useState(!1);Uw(i,()=>{s(void 0)});const l=()=>{a(!1),s(void 0)},c=()=>{Je("POST",ze("/api/v1/one_time_token"),{context:"yodlee",platform:"react"}).then(f=>{var p;l(),window.open(Ut("https://invoicing.co/yodlee/onboard/:hash",{hash:(p=f==null?void 0:f.data)==null?void 0:p.hash}))})},u=()=>{Je("POST",ze("/api/v1/one_time_token"),{context:"nordigen",platform:"react"}).then(f=>{var p;l(),window.open(ze("/nordigen/connect/:hash",{hash:(p=f==null?void 0:f.data)==null?void 0:p.hash}))})},d=()=>{r==="yodlee"&&c(),r==="nordigen"&&u()};return h.jsxs(h.Fragment,{children:[h.jsxs(dn,{type:"secondary",onClick:()=>u(),children:[h.jsx("span",{className:"mr-2",children:h.jsx(an,{element:nTt,size:20})}),n("connect_accounts")]}),h.jsx(pr,{title:n("connect_accounts"),visible:o,onClose:l,children:h.jsxs("div",{ref:i,className:"flex flex-col space-y-6",children:[$u()&&h.jsxs("div",{className:"flex flex-col cursor-pointer border-4",style:{borderColor:r==="yodlee"?e:t.$24,height:"10.25rem"},onClick:()=>s("yodlee"),children:[h.jsx("img",{className:"h-32",src:Epn}),h.jsxs("div",{className:"flex items-center justify-center space-x-2 text-xs pb-3",onClick:f=>f.stopPropagation(),children:[h.jsxs("p",{className:"text-gray-500",children:[n("yodlee_regions"),"."]}),h.jsxs(Ji,{className:"text-xs",to:"https://www.yodlee.com/open-banking/data-connections",external:!0,children:[n("learn_more"),"."]})]})]}),$u()&&h.jsxs("div",{"data-cy":"nordigenBox",className:"flex flex-col items-center cursor-pointer border-4",style:{borderColor:r==="nordigen"?e:t.$24,height:"10.25rem"},onClick:()=>s("nordigen"),children:[h.jsx("div",{className:"flex flex-1 items-center justify-center",children:h.jsx("img",{src:kpn,style:{width:"15rem"}})}),h.jsxs("div",{className:"flex items-center justify-center space-x-2 text-xs pb-3",onClick:f=>f.stopPropagation(),children:[h.jsxs("p",{className:"text-gray-500",children:[n("nordigen_regions"),"."]}),h.jsxs(Ji,{className:"text-xs",to:"https://gocardless.com/bank-account-data/coverage/",external:!0,children:[n("learn_more"),"."]})]})]}),h.jsx(dn,{behavior:"button",onClick:d,disableWithoutIcon:!0,disabled:!r,children:n("connect")})]})})]})}function Ipn(){vr("bank_accounts");const[n]=xe(),e=Spn(),t=Yi(),i=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"}];return h.jsxs(Kr,{title:n("bank_accounts"),breadcrumbs:i,docsLink:"/docs/advanced-settings/#bank_accounts",children:[!$u()&&To(),h.jsx(qm,{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:h.jsxs("div",{className:"flex space-x-2",children:[h.jsx(Tpn,{}),To(),h.jsxs(dn,{type:"secondary",onClick:()=>t("/settings/bank_accounts/transaction_rules"),children:[h.jsx("span",{className:"mr-2",children:h.jsx(an,{element:sTt,size:20})}),n("rules")]})]}),enableSavingFilterPreference:!0})]})}function Lpn(){vr("edit_bank_account");const[n]=xe(),e=xt(),t=Yi(),{id:i}=Yl(),{data:r}=MQe({id:i}),[s,o]=x.useState(!1),[a,l]=x.useState(),[c,u]=x.useState(),d=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("edit_bank_account"),href:Ut("/bank_accounts/:id/edit",{id:i})}],f=(g,m)=>{u(_=>_&&{..._,[g]:m})},p=async g=>{s||(g.preventDefault(),pe.processing(),l(void 0),o(!0),Je("PUT",ze("/api/v1/bank_integrations/:id",{id:i}),c).then(()=>{pe.success("updated_bank_account"),ii(["bank_integrations"]),t("/settings/bank_accounts")}).catch(m=>{var _;((_=m.response)==null?void 0:_.status)===422&&(l(m.response.data),pe.dismiss())}).finally(()=>o(!1)))};return x.useEffect(()=>{r&&u(r)},[r]),h.jsx(Kr,{title:n("edit_bank_account"),breadcrumbs:d,docsLink:"en/basic-settings/#edit_bank_account",onSaveClick:p,disableSaveButton:s,children:h.jsxs(er,{onFormSubmit:p,title:n("edit_bank_account"),className:"shadow-sm",style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},disableSubmitButton:s,children:[h.jsx(ne,{leftSide:n("account_name"),children:h.jsx(lt,{value:c==null?void 0:c.bank_account_name,onValueChange:g=>f("bank_account_name",g),errorMessage:a==null?void 0:a.errors.bank_account_name})}),h.jsx(ne,{leftSide:n("sync_from"),children:h.jsx(lt,{type:"date",value:c==null?void 0:c.from_date,onValueChange:g=>f("from_date",g),errorMessage:a==null?void 0:a.errors.from_date})}),h.jsx(ne,{leftSide:n("auto_sync"),children:h.jsx(jt,{checked:(c==null?void 0:c.auto_sync)||!1,onValueChange:g=>f("auto_sync",g)})})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function pnt(n,e,t,i,r,s){const o=Yi();return a=>{a.preventDefault(),!i&&n&&(pe.processing(),e(void 0),t(!0),Je("POST",ze("/api/v1/bank_integrations"),n).then(l=>{pe.success("created_bank_account"),ii(["bank_integrations"]),r?(ii(["bank_integrations"]),s&&s(l.data.data),r(!1)):o("/settings/bank_accounts")}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(pe.dismiss(),e(l.response.data))}).finally(()=>t(!1)))}}function Apn(){const[n]=xe();vr("new_bank_account");const e=xt(),{data:t}=jQe(),i=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("new_bank_account"),href:"/settings/bank_accounts/create"}],[r,s]=x.useState(!1),[o,a]=x.useState(),[l,c]=x.useState(),u=pnt(l,a,s,r),d=(f,p)=>{c(g=>g&&{...g,[f]:p})};return x.useEffect(()=>{t&&c(t)},[t]),h.jsxs(Kr,{title:n("new_bank_account"),breadcrumbs:i,docsLink:"en/basic-settings/#create_bank_account",disableSaveButton:r,onSaveClick:u,children:[!$u()&&To(),h.jsx(er,{onFormSubmit:u,title:n("new_bank_account"),className:"shadow-sm",style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},children:h.jsx(ne,{leftSide:n("account_name"),children:h.jsx(lt,{value:l==null?void 0:l.bank_account_name,onValueChange:f=>d("bank_account_name",f),errorMessage:o==null?void 0:o.errors.bank_account_name})})})]})}function Npn(n){var d;const{balance:e,bank_account_type:t,provider_name:i,bank_account_status:r,currency:s=""}=(n==null?void 0:n.accountDetails)||{},[o]=xe(),a=xt(),l=zi(),c=vf(),u=Sk({resolveBy:"code"});return h.jsxs(er,{title:o("details"),className:"shadow-sm",style:{borderColor:a.$24},headerStyle:{borderColor:a.$20},children:[h.jsx(ne,{leftSide:o("balance"),children:h.jsx("span",{className:"font-mono",children:c(e||0,l.settings.country_id,(d=u(s))==null?void 0:d.id)})}),h.jsx(ne,{leftSide:o("type"),children:t}),h.jsx(ne,{leftSide:o("provider"),children:i}),h.jsx(ne,{leftSide:o("status"),children:r})]})}function Dpn(){vr("bank_account");const{id:n}=Yl(),[e]=xe(),t=[{name:e("settings"),href:"/settings"},{name:e("bank_accounts"),href:"/settings/bank_accounts"},{name:e("bank_account"),href:Ut("/settings/bank_accounts/:id/details",{id:n})}],{data:i}=MQe({id:n}),[r,s]=x.useState();return x.useEffect(()=>{s(i)},[i]),h.jsx(Kr,{title:e("bank_account"),breadcrumbs:t,docsLink:"en/basic-settings/#bank_account_details",children:h.jsx(Npn,{accountDetails:r})})}function Rpn(){const[n]=xe();return[{id:"name",label:n("name"),format:(t,i)=>h.jsx(Ji,{to:Ut("/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 h.jsx(Ji,{to:Ut("/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 h.jsx(Ji,{to:Ut("/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 Ppn(){const{documentTitle:n}=vr("transaction_rules"),[e]=xe(),t=Rpn(),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 h.jsx(Kr,{title:n,breadcrumbs:i,docsLink:"/docs/advanced-settings/#bank_transaction_rules",children:h.jsx(qm,{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,enableSavingFilterPreference:!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 Opn(){const{isAdmin:n}=go();return lr(["/api/v1/bank_transaction_rules","create"],()=>Je("GET",ze("/api/v1/bank_transaction_rules/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function Mpn(n){return lr(["/api/v1/bank_transaction_rules",n.id],()=>Je("GET",ze("/api/v1/bank_transaction_rules/:id",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function gnt(n){const[e]=xe(),t=Lo(),{data:i}=ent(),[r,s]=x.useState(),[o,a]=x.useState(!1),[l,c]=x.useState(),u=()=>{o||(pe.processing(),a(!0),Je("POST",ze("/api/v1/expense_categories"),l).then(d=>{pe.success("created_expense_category"),ii(["expense_categories"]),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:ze("/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 f;((f=d.response)==null?void 0:f.status)===422&&(s(d.response.data),pe.dismiss())}).finally(()=>a(!1)))};return x.useEffect(()=>{i&&c({...i,color:t})},[i]),h.jsx(pr,{title:e("create_expense_category"),visible:n.visible,onClose:()=>n.setVisible(!1),stopPropagationInHeader:!0,children:h.jsxs("div",{className:"flex flex-col space-y-4",onClick:d=>d.stopPropagation(),children:[h.jsx(tnt,{expenseCategory:l,setExpenseCategory:c,errors:r,setErrors:s}),h.jsx("div",{className:"flex justify-end space-x-4 mt-5",children:h.jsx(dn,{behavior:"button",onClick:u,children:e("save")})})]})})}function jpn(n){var o;const[e]=xe(),[t,i]=x.useState(!1),r=jo();return h.jsxs(h.Fragment,{children:[h.jsx(gnt,{visible:n.initiallyVisible||t,setVisible:n.setVisible||i,setSelectedIds:n.setSelectedIds,onCreatedCategory:a=>n.onChange(a)}),!n.setSelectedIds&&h.jsx(qd,{endpoint:ze("/api/v1/expense_categories?status=active&per_page=500"),onChange:a=>a.resource&&n.onChange(a.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_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 J3r(n){return lr(["/api/v1/vendors",n.id],()=>Je("GET",ze("/api/v1/vendors/:id",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function Fpn(){const n=jo();return lr(["/api/v1/vendors","create"],()=>Je("GET",ze("/api/v1/vendors/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n("create_vendor")})}function Bpn(n){return lr(["/api/v1/vendors",n],()=>Je("GET",ze("/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 e5r(){return(n,e)=>{pe.processing(),Je("POST",ze("/api/v1/vendors/bulk"),{action:e,ids:[n]}).then(()=>{pe.success(`${e}d_vendor`),ii(["vendors"])})}}function $pn(n){var y,C,S,k,I;const[e]=xe(),{vendor:t,setVendor:i,errors:r,page:s,setContacts:o,contacts:a,fundamentalConceptVisible:l}=n,c=xt(),u=wZ(),d=zi(),{isAdmin:f,isOwner:p}=go(),g=(L,N)=>{i(P=>P&&{...P,[L]:N})},m=(L,N,P)=>{pn.set(a[P],L,N),o([...a])},_=L=>{let N=[...a];N=N.filter((P,O)=>L!==O),o(N)},v=()=>{const L=[...a];L.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}),o(L)},b=()=>{v(),setTimeout(()=>{const L=document.querySelectorAll('[id^="first_name_"]');L.length>2&&L[L.length-1].scrollIntoView({behavior:"smooth",block:"center"})},50)};return h.jsx(h.Fragment,{children:l?h.jsxs("div",{className:"flex flex-col space-y-3",children:[h.jsx(lt,{label:e("name"),value:(t==null?void 0:t.name)||"",onValueChange:L=>g("name",L),errorMessage:r==null?void 0:r.errors.name}),h.jsx(lt,{label:`${e("contact")} ${e("first_name")}`,value:a[0].first_name,onValueChange:L=>m("first_name",L,0),errorMessage:r==null?void 0:r.errors["contacts.0.first_name"]}),h.jsx(lt,{label:`${e("contact")} ${e("last_name")}`,value:a[0].last_name,onValueChange:L=>m("last_name",L,0),errorMessage:r==null?void 0:r.errors["contacts.0.last_name"]}),h.jsx(lt,{label:`${e("contact")} ${e("email")}`,value:a[0].email,onValueChange:L=>m("email",L,0),errorMessage:r==null?void 0:r.errors["contacts.0.email"]}),h.jsx(lt,{label:`${e("contact")} ${e("phone")}`,value:a[0].phone,onValueChange:L=>m("phone",L,0),errorMessage:r==null?void 0:r.errors["contacts.0.phone"]}),h.jsx(HO,{label:e("currency"),value:(t==null?void 0:t.currency_id)||"",onChange:L=>g("currency_id",L),errorMessage:r==null?void 0:r.errors.currency_id,dismissable:!0})]}):h.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[h.jsxs("div",{className:"col-span-12 xl:col-span-6 space-y-4",children:[h.jsxs(er,{className:"shadow-sm",title:e("details"),style:{borderColor:c.$24},headerStyle:{borderColor:c.$20},children:[s==="edit"&&h.jsx(ne,{leftSide:e("status"),children:h.jsx(ev,{entity:t})}),h.jsx(ne,{leftSide:e("name"),children:h.jsx(lt,{id:"name",value:t.name||"",onValueChange:L=>g("name",L),errorMessage:r==null?void 0:r.errors.name})}),h.jsx(ne,{leftSide:e("number"),children:h.jsx(lt,{value:t.number||"",onValueChange:L=>g("number",L),errorMessage:r==null?void 0:r.errors.number})}),h.jsx(ne,{leftSide:e("assigned_user"),children:h.jsx(Cee,{value:t.assigned_user_id,onChange:L=>g("assigned_user_id",L.id),onClearButtonClick:()=>g("assigned_user_id",""),clearButton:!0,errorMessage:r==null?void 0:r.errors.assigned_user_id})}),h.jsx(ne,{leftSide:e("id_number"),children:h.jsx(lt,{value:t.id_number||"",onValueChange:L=>g("id_number",L),errorMessage:r==null?void 0:r.errors.id_number})}),h.jsx(ne,{leftSide:e("vat_number"),children:h.jsx(lt,{value:t.vat_number||"",onValueChange:L=>g("vat_number",L),errorMessage:r==null?void 0:r.errors.vat_number})}),h.jsx(ne,{leftSide:e("website"),children:h.jsx(lt,{value:t.website||"",onValueChange:L=>g("website",L),errorMessage:r==null?void 0:r.errors.website})}),h.jsx(ne,{leftSide:e("phone"),children:h.jsx(lt,{value:t.phone||"",onValueChange:L=>g("phone",L),errorMessage:r==null?void 0:r.errors.phone})}),h.jsx(ne,{leftSide:e("routing_id"),children:h.jsx(lt,{value:t.routing_id||"",onValueChange:L=>g("routing_id",L),errorMessage:(y=n.errors)==null?void 0:y.errors.routing_id})}),h.jsx(ne,{leftSide:e("tax_exempt"),children:h.jsx(jt,{checked:!!t.is_tax_exempt,onValueChange:L=>g("is_tax_exempt",L)})}),h.jsx(ne,{leftSide:e("classification"),children:h.jsxs(Dn,{value:t.classification??"",onValueChange:L=>g("classification",L),errorMessage:r==null?void 0:r.errors.classification,customSelector:!0,dismissable:!0,children:[h.jsx("option",{value:"individual",children:e("individual")}),h.jsx("option",{value:"business",children:e("business")}),h.jsx("option",{value:"company",children:e("company")}),h.jsx("option",{value:"partnership",children:e("partnership")}),h.jsx("option",{value:"trust",children:e("trust")}),h.jsx("option",{value:"charity",children:e("charity")}),h.jsx("option",{value:"government",children:e("government")}),h.jsx("option",{value:"other",children:e("other")})]})}),((C=d==null?void 0:d.custom_fields)==null?void 0:C.vendor1)&&h.jsx(qo,{field:"contact1",defaultValue:t.custom_value1,value:d.custom_fields.vendor1,onValueChange:L=>g("custom_value1",L)}),((S=d==null?void 0:d.custom_fields)==null?void 0:S.vendor2)&&h.jsx(qo,{field:"vendor2",defaultValue:t.custom_value2,value:d.custom_fields.vendor2,onValueChange:L=>g("custom_value2",L)}),((k=d==null?void 0:d.custom_fields)==null?void 0:k.vendor3)&&h.jsx(qo,{field:"vendor3",defaultValue:t.custom_value3,value:d.custom_fields.vendor3,onValueChange:L=>g("custom_value3",L)}),((I=d==null?void 0:d.custom_fields)==null?void 0:I.vendor4)&&h.jsx(qo,{field:"vendor4",defaultValue:t.custom_value4,value:d.custom_fields.vendor4,onValueChange:L=>g("custom_value4",L)})]}),h.jsxs(er,{className:"shadow-sm",title:e("address"),style:{borderColor:c.$24},headerStyle:{borderColor:c.$20},children:[h.jsx(ne,{leftSide:e("address1"),children:h.jsx(lt,{value:t.address1,onValueChange:L=>g("address1",L),errorMessage:r==null?void 0:r.errors.address1})}),h.jsx(ne,{leftSide:e("address2"),children:h.jsx(lt,{value:t.address2,onValueChange:L=>g("address2",L),errorMessage:r==null?void 0:r.errors.address2})}),h.jsx(ne,{leftSide:e("city"),children:h.jsx(lt,{value:t.city,onValueChange:L=>g("city",L),errorMessage:r==null?void 0:r.errors.city})}),h.jsx(ne,{leftSide:e("state"),children:h.jsx(lt,{value:t.state,onValueChange:L=>g("state",L),errorMessage:r==null?void 0:r.errors.state})}),h.jsx(ne,{leftSide:e("postal_code"),children:h.jsx(lt,{value:t.postal_code,onValueChange:L=>g("postal_code",L),errorMessage:r==null?void 0:r.errors.postal_code})}),h.jsx(ne,{leftSide:e("country"),children:h.jsx(_4,{value:t.country_id,onChange:L=>g("country_id",L),errorMessage:r==null?void 0:r.errors.country_id})})]})]}),h.jsxs("div",{className:"col-span-12 xl:col-span-6 space-y-4",children:[h.jsx(er,{className:"shadow-sm",title:e("contacts"),headerClassName:"px-4 sm:px-6 py-[0.825rem]",style:{borderColor:c.$24},headerStyle:{borderColor:c.$20},withoutBodyPadding:!0,withoutHeaderPadding:!0,topRight:h.jsx(dn,{className:"shadow-sm",type:"secondary",behavior:"button",onClick:b,children:h.jsxs("div",{className:"flex items-center",children:[h.jsx("div",{children:h.jsx(nc,{size:"0.7rem",color:c.$3})}),h.jsx("span",{className:"font-medium",children:e("add_contact")})]})}),children:a.map((L,N)=>{var P,O,F,V,M,B,W,q;return h.jsx("div",{className:"px-6",children:h.jsxs("div",{className:$t("pb-2 pt-4 border-b border-dashed",{"border-b-0":N===a.length-1}),style:{borderColor:c.$24},children:[h.jsx(ne,{leftSide:e("first_name"),noExternalPadding:!0,children:h.jsx(lt,{id:`first_name_${N}`,value:L.first_name,onValueChange:U=>m("first_name",U,N),errorMessage:(P=n.errors)==null?void 0:P.errors[`contacts.${N}.first_name`]})}),h.jsx(ne,{leftSide:e("last_name"),noExternalPadding:!0,children:h.jsx(lt,{id:`last_name_${N}`,value:L.last_name,onValueChange:U=>m("last_name",U,N),errorMessage:(O=n.errors)==null?void 0:O.errors[`contacts.${N}.last_name`]})}),h.jsx(ne,{leftSide:e("email"),noExternalPadding:!0,children:h.jsx(lt,{id:`email_${N}`,value:L.email,onValueChange:U=>m("email",U,N),errorMessage:(F=n.errors)==null?void 0:F.errors[`contacts.${N}.email`]})}),h.jsx(ne,{leftSide:e("phone"),noExternalPadding:!0,children:h.jsx(lt,{value:L.phone,onValueChange:U=>m("phone",U,N),errorMessage:(V=n.errors)==null?void 0:V.errors[`contacts.${N}.phone`]})}),h.jsx(ne,{leftSide:e("send_email"),noExternalPadding:!0,children:h.jsx(jt,{checked:L.send_email,onChange:U=>m("send_email",U,N)})}),((M=d==null?void 0:d.custom_fields)==null?void 0:M.vendor_contact1)&&h.jsx(qo,{field:"vendor_contact1",defaultValue:L.custom_value1||"",value:d.custom_fields.vendor_contact1,onValueChange:U=>m("custom_value1",U,N),noExternalPadding:!0}),((B=d==null?void 0:d.custom_fields)==null?void 0:B.vendor_contact2)&&h.jsx(qo,{field:"vendor_contact2",defaultValue:L.custom_value2||"",value:d.custom_fields.vendor_contact2,onValueChange:U=>m("custom_value2",U,N),noExternalPadding:!0}),((W=d==null?void 0:d.custom_fields)==null?void 0:W.vendor_contact3)&&h.jsx(qo,{field:"vendor_contact3",defaultValue:L.custom_value3||"",value:d.custom_fields.vendor_contact3,onValueChange:U=>m("custom_value3",U,N),noExternalPadding:!0}),((q=d==null?void 0:d.custom_fields)==null?void 0:q.vendor_contact4)&&h.jsx(qo,{field:"vendor_contact4",defaultValue:L.custom_value4||"",value:d.custom_fields.vendor_contact4,onValueChange:U=>m("custom_value4",U,N),noExternalPadding:!0}),h.jsx(ne,{noExternalPadding:!0,pushContentToRight:!0,children:h.jsx("div",{className:"flex items-center",children:a.length>=2&&h.jsx(dn,{className:"shadow-sm",type:"secondary",behavior:"button",onClick:()=>_(N),children:h.jsxs("div",{className:"flex space-x-2 items-center",children:[h.jsx("div",{children:h.jsx(MO,{size:"1rem",color:"#ef4444"})}),h.jsx("span",{className:"font-medium text-red-500",children:e("remove_contact")})]})})})})]})},N)})}),h.jsx(er,{className:"shadow-sm",title:e("additional_info"),style:{borderColor:c.$24},headerStyle:{borderColor:c.$20},children:h.jsxs(Qb,{tabs:[e("settings"),...f||p?[e("custom_fields")]:[]],withHorizontalPadding:!0,horizontalPaddingWidth:"1.5rem",fullRightPadding:!0,children:[h.jsxs("div",{className:"flex flex-col space-y-4 px-6",children:[h.jsx(ne,{leftSide:e("currency"),noExternalPadding:!0,children:h.jsx(HO,{value:t.currency_id,onChange:L=>g("currency_id",parseInt(L)),errorMessage:r==null?void 0:r.errors.currency_id})}),u.length>1&&h.jsx(ne,{leftSide:e("language"),noExternalPadding:!0,children:h.jsx(C9,{value:t.language_id,onChange:L=>g("language_id",L),errorMessage:r==null?void 0:r.errors.language_id,dismissable:!0})}),h.jsx(dh,{label:e("public_notes").toString(),onChange:L=>g("public_notes",L),value:t.public_notes}),h.jsx("div",{className:"pt-3",children:h.jsx(dh,{label:e("private_notes").toString(),onChange:L=>g("private_notes",L),value:t.private_notes})})]}),h.jsxs("div",{className:"px-6 pt-1",children:[h.jsxs("span",{className:"text-sm",children:[e("custom_fields")," "]}),h.jsxs(Ji,{to:"/settings/custom_fields/vendors",className:"capitalize",children:[e("click_here"),"."]})]})]})})]})]})})}function Hpn(n){const[e]=xe(),{fundamentalConceptVisible:t,setFundamentalConceptVisible:i}=n,{data:r}=Fpn(),[s,o]=x.useState(),[a,l]=x.useState(),[c,u]=x.useState([{first_name:"",last_name:"",email:"",phone:"",send_email:!1}]);x.useEffect(()=>{r&&o({...r,country_id:""})},[r]);const d=pd(),f=async()=>{pn.set(s,"contacts",c),pe.processing(),await d({excludeToasters:!0}),Je("POST",ze("/api/v1/vendors"),s).then(p=>{pe.success("created_vendor"),ii(["vendors"]),n.setSelectedIds&&n.setSelectedIds([p.data.data.id]),n.onVendorCreated&&n.onVendorCreated(p.data.data),o(r),n.setVisible(!1)}).catch(p=>{var g;((g=p.response)==null?void 0:g.status)===422&&(pe.dismiss(),l(p.response.data))})};return h.jsxs(h.Fragment,{children:[s&&h.jsx($pn,{vendor:s,setVendor:o,errors:a,setContacts:u,contacts:c,fundamentalConceptVisible:t}),h.jsxs("div",{className:$t("flex",{"justify-between":t,"justify-end space-x-5":!t}),children:[h.jsx(dn,{behavior:"button",type:"secondary",onClick:()=>i(p=>!p),children:e(t?"more_fields":"less_fields")}),h.jsx(dn,{behavior:"button",onClick:f,children:e("save")})]})]})}function Vpn(n){const[e]=xe(),[t,i]=x.useState(!0);return h.jsx(pr,{title:e("create_vendor"),visible:n.visible,onClose:()=>n.setVisible(!1),size:t?"extraSmall":"large",renderTransitionChildAsFragment:!0,overflowVisible:!0,children:h.jsx(Hpn,{setSelectedIds:n.setSelectedIds,setVisible:n.setVisible,onVendorCreated:n.onVendorCreated,fundamentalConceptVisible:t,setFundamentalConceptVisible:i})})}function Wpn(n){var s;const[e]=xe(),t=jo(),[i,r]=x.useState(!1);return h.jsxs(h.Fragment,{children:[h.jsx(Vpn,{visible:n.initiallyVisibleModal||i,setVisible:n.setVisible||r,setSelectedIds:n.setSelectedIds,onVendorCreated:o=>n.onChange(o)}),!n.setSelectedIds&&h.jsx(qd,{endpoint:ze("/api/v1/vendors?status=active&per_page=500"),onChange:o=>o.resource&&n.onChange(o.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_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 mnt(n){const{setErrors:e,setTransactionRule:t}=n;return(i,r)=>{e(void 0),t(s=>s&&{...s,[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 zpn={search_key:"description",operator:"contains",value:""},Upn={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 qpn(n){const[e]=xe(),{visible:t,setVisible:i,transactionRule:r,ruleIndex:s,setTransactionRule:o,setErrors:a}=n,[l,c]=x.useState(),u=mnt({setTransactionRule:o,setErrors:a}),d=(g,m)=>{c(_=>_&&{..._,[g]:m})},f=g=>{d("search_key",g),g==="description"&&d("operator","contains"),g==="amount"&&d("operator","<")},p=()=>{if(l){const g=r.rules||[];s>-1?(g[s]=l,u("rules",g),i(!1)):(u("rules",[...g,l]),i(!1))}};return x.useEffect(()=>{r&&(s>-1?c(r.rules[s]):c(zpn))},[r,s]),h.jsxs(pr,{title:s>-1?e("edit_rule"):e("add_rule"),visible:t,onClose:()=>i(!1),overflowVisible:!0,children:[h.jsxs(Dn,{required:!0,label:e("field"),value:l==null?void 0:l.search_key,onValueChange:g=>f(g),customSelector:!0,dismissable:!1,children:[h.jsx("option",{defaultChecked:!0,value:"description",children:e("description")}),h.jsx("option",{value:"amount",children:e("amount")})]}),h.jsx(Dn,{required:!0,label:e("operator"),value:l==null?void 0:l.operator,onValueChange:g=>d("operator",g),customSelector:!0,dismissable:!1,children:(l==null?void 0:l.search_key)&&Upn[l.search_key].map((g,m)=>h.jsx("option",{value:g.value,children:e(g.label)},m))}),h.jsx(lt,{changeOverride:!0,required:!0,label:e("value"),value:l==null?void 0:l.value,onValueChange:g=>d("value",g)}),h.jsx(dn,{className:"self-end",onClick:p,disableWithoutIcon:!0,disabled:!(l!=null&&l.value),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 */function Kpn({size:n="1.2rem",color:e="#FFF"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:n,height:n,viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M13.953,7.578l1.109-1.109c.586-.586,.586-1.536,0-2.121l-1.409-1.409c-.586-.586-1.536-.586-2.121,0l-1.109,1.109,3.53,3.53Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5","data-color":"color-2"}),h.jsx("path",{d:"M8.922,5.547l-4.775,4.775c-.25,.25-.429,.562-.52,.904l-1.127,4.273h0s4.273-1.127,4.273-1.127c.342-.09,.654-.27,.904-.52l4.775-4.775",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),h.jsx("line",{x1:"10.672",y1:"7.297",x2:"6.265",y2:"11.704",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}const Gpn=As.div` background-color: ${({theme:n})=>n.backgroundColor}; &:hover { background-color: ${({theme:n})=>n.hoverBackgroundColor}; } `;function _nt(n){var p;const[e]=xe();Lo();const[t,i]=x.useState(!1),[r,s]=x.useState(-1),{transactionRule:o,setTransactionRule:a,errors:l,setErrors:c}=n,u=mnt({setErrors:c,setTransactionRule:a}),d=g=>{const m=o.rules.filter((_,v)=>v!==g);u("rules",m)},f=xt();return h.jsxs(h.Fragment,{children:[h.jsxs(er,{title:n.page==="create"?e("new_transaction_rule"):e("edit_transaction_rule"),className:"shadow-sm",style:{borderColor:f.$24},headerStyle:{borderColor:f.$20},children:[h.jsx(ne,{leftSide:e("name"),required:!0,children:h.jsx(lt,{required:!0,value:o.name,onValueChange:g=>u("name",g),errorMessage:l==null?void 0:l.errors.name})}),h.jsx(ne,{leftSide:e("match_all_rules"),leftSideHelp:e("match_all_rules_help"),children:h.jsx(jt,{checked:o.matches_on_all||!1,onValueChange:g=>u("matches_on_all",g)})}),h.jsx(ne,{leftSide:e("auto_convert"),leftSideHelp:e("auto_convert_help"),children:h.jsx(jt,{checked:o.auto_convert||!1,onValueChange:g=>u("auto_convert",g)})}),h.jsx(ne,{leftSide:e("vendor"),children:h.jsx(Wpn,{value:o.vendor_id,onChange:g=>u("vendor_id",g.id),onClearButtonClick:()=>u("vendor_id",""),errorMessage:l==null?void 0:l.errors.vendor_id})}),h.jsx(ne,{leftSide:e("expense_category"),children:h.jsx(jpn,{value:o.category_id,onChange:g=>u("category_id",g.id),onClearButtonClick:()=>u("category_id",""),errorMessage:l==null?void 0:l.errors.category_id})})]}),h.jsxs(h1,{children:[h.jsxs(p1,{children:[h.jsx(_a,{children:e("field")},"field"),h.jsx(_a,{children:e("operator")},"operator"),h.jsx(_a,{children:e("value")},"value")]}),h.jsxs(f1,{children:[(p=o.rules)==null?void 0:p.map((g,m)=>h.jsxs(hc,{className:"py-2 border-b",style:{borderColor:f.$20},children:[h.jsx(bs,{width:"30%",children:e(g.search_key)}),h.jsx(bs,{width:"30%",children:e(g.operator)}),h.jsx(bs,{width:"40%",children:h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{children:g.value}),h.jsxs("div",{className:"flex space-x-6",children:[h.jsx("div",{className:"cursor-pointer hover:opacity-75",onClick:()=>{s(m),i(!0)},children:h.jsx(Kpn,{color:"#2176FF",size:"1.2rem"})}),h.jsx("div",{className:"cursor-pointer hover:opacity-75",onClick:()=>d(m),children:h.jsx(MO,{color:"#ef4444",size:"1.2rem"})})]})]})})]},m)),h.jsx(hc,{children:h.jsx(bs,{colSpan:100,className:"p-1",withoutPadding:!0,children:h.jsxs(Gpn,{className:"w-full py-2 inline-flex justify-center items-center space-x-2 rounded-[0.1875rem] cursor-pointer",onClick:()=>{s(-1),i(!0)},theme:{backgroundColor:f.$1,hoverBackgroundColor:f.$20},children:[h.jsx(nc,{color:f.$3,size:"1rem"}),h.jsx("span",{children:e("add_rule")})]})})})]})]}),h.jsx(qpn,{visible:t,setVisible:i,ruleIndex:r,setTransactionRule:a,setErrors:c,transactionRule:o})]})}function Ypn(){const[n]=xe();vr("new_transaction_rule");const e=Yi(),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}=Opn(),[r,s]=x.useState(),[o,a]=x.useState(!1),[l,c]=x.useState();x.useEffect(()=>{i&&s({...i,matches_on_all:!0,applies_to:"DEBIT"})},[i]);const u=d=>{d.preventDefault(),o||(pe.processing(),c(void 0),a(!0),Je("POST",ze("/api/v1/bank_transaction_rules"),r).then(f=>{pe.success("created_transaction_rule"),ii(["bank_transaction_rules"]),e(Ut("/settings/bank_accounts/transaction_rules/:id/edit",{id:f.data.data.id}))}).catch(f=>{var p;((p=f.response)==null?void 0:p.status)===422&&(pe.dismiss(),c(f.response.data))}).finally(()=>a(!1)))};return h.jsx(Kr,{title:n("new_transaction_rule"),breadcrumbs:t,docsLink:"en/basic-settings/#create_transaction_rule",disableSaveButton:!r||o,onSaveClick:u,children:r?h.jsx(_nt,{page:"create",transactionRule:r,setTransactionRule:s,errors:l,setErrors:c}):h.jsx(yo,{})})}function Qpn(){const[n]=xe();vr("edit_transaction_rule");const{id:e}=Yl(),t=Yi(),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:Ut("/settings/bank_accounts/transaction_rules/:id/edit",{id:e})}],{data:r}=Mpn({id:e}),[s,o]=x.useState(),[a,l]=x.useState(!1),[c,u]=x.useState();x.useEffect(()=>{r&&o(r)},[r]);const d=f=>{f.preventDefault(),a||(pe.processing(),u(void 0),l(!0),Je("PUT",ze("/api/v1/bank_transaction_rules/:id",{id:e}),s).then(()=>{pe.success("updated_transaction_rule"),ii(["bank_transaction_rules"]),t("/settings/bank_accounts/transaction_rules")}).catch(p=>{var g;((g=p.response)==null?void 0:g.status)===422&&(pe.dismiss(),u(p.response.data))}).finally(()=>l(!1)))};return h.jsx(Kr,{title:n("edit_transaction_rule"),breadcrumbs:i,docsLink:"en/basic-settings/#edit_transaction_rule",disableSaveButton:!s||a,onSaveClick:d,children:s?h.jsx(_nt,{transactionRule:s,setTransactionRule:o,errors:c,setErrors:u}):h.jsx(yo,{})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Xpn({color:n="#000",filledColor:e="#000",size:t="1.2rem"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:t,height:t},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M6.75 15.25L14.25 15.25C15.3546 15.25 16.25 14.3546 16.25 13.25V7.75C16.25 6.64543 15.3546 5.75 14.25 5.75L6.75 5.75C5.64543 5.75 4.75 6.64543 4.75 7.75L4.75 13.25C4.75 14.3546 5.64543 15.25 6.75 15.25Z",fill:e,"fill-opacity":"0.3","data-color":"color-2","data-stroke":"none"}),h.jsx("path",{d:"M4.75 12.25H3.75C2.645 12.25 1.75 11.355 1.75 10.25V4.75C1.75 3.645 2.645 2.75 3.75 2.75H11.25C12.355 2.75 13.25 3.645 13.25 4.75V5.75",stroke:n,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"}),h.jsx("path",{d:"M6.75 15.25L14.25 15.25C15.3546 15.25 16.25 14.3546 16.25 13.25V7.75C16.25 6.64543 15.3546 5.75 14.25 5.75L6.75 5.75C5.64543 5.75 4.75 6.64543 4.75 7.75L4.75 13.25C4.75 14.3546 5.64543 15.25 6.75 15.25Z",stroke:n,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"})]})}function gEe({text:n,className:e,secure:t,limit:i=0}){const r=n||"",s=xt(),o=a=>{a.stopPropagation(),navigator.clipboard.writeText(r),pe.success("copied_to_clipboard",{value:""})};return h.jsxs("div",{className:$t("inline-flex",{"space-x-2":!!(r&&i)},e),children:[!!r&&h.jsx("span",{children:t?n.split("").map(()=>"*"):r.length>i?r.substring(0,i).concat(" "):r}),r.length>0&&h.jsx("button",{type:"button",onClick:o,children:h.jsx(Xpn,{size:"1.1rem",color:s.$3,filledColor:"transparent"})})]})}const Zpn=()=>{const[n]=xe(),e=vf(),t=zi();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=>h.jsxs("div",{className:"flex space-x-2",onClick:s=>s.stopPropagation(),children:[h.jsx(Ji,{to:r,external:!0,children:n("purchase_page")}),h.jsx(gEe,{text:r})]})}]};function Jpn(){const{documentTitle:n}=vr("payment_links"),[e]=xe(),t=Zpn(),i=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"}];return h.jsxs(Kr,{title:n,docsLink:"en/advanced-settings/#subscriptions",breadcrumbs:i,children:[h.jsx(Gb,{}),h.jsx(qm,{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,enableSavingFilterPreference:!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 vnt(n){return lr(["/api/v1/products"],()=>Je("GET",ze("/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 t5r(n){return lr(["/api/v1/products",n.id],()=>Je("GET",ze("/api/v1/products/:id",{id:n.id})),{staleTime:1/0})}function egn(n){const e=jo();return lr(["/api/v1/products/create"],()=>Je("GET",ze("/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 tgn(n,e){return Je("POST",ze("/api/v1/products/bulk"),{action:e,ids:Array.from(n)})}function ngn(n){return Ui({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 n5r(n){return Ui({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 i5r(n){return Ui({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 IV(n){const e=xt(),t=Lo(),i=Yi(),r=vf(),[s,o]=x.useState([]),[a,l]=x.useState(),c=d=>{const f=s.findIndex(({id:p})=>p===d);if(f>-1){const p=s.filter((m,_)=>_!==f);o(p);const g=p.map(({id:m})=>m);n.handleChange(n.type,g.join(","))}},u=d=>{var f,p;return d.product_key+" "+r(d.price,(f=d.company)==null?void 0:f.settings.country_id,(p=d.company)==null?void 0:p.settings.currency_id).toString()};return x.useEffect(()=>{if(n.products){let d=[];n.subscription[n.type].split(",").forEach(f=>{var p;d=d.concat(((p=n.products)==null?void 0:p.filter(({id:g})=>g===f))||[])}),o(d)}},[n.products]),x.useEffect(()=>{if(n.products&&a){const d=n.products.filter(({id:f})=>a===f);o(f=>[...f,...d]),l("")}},[a]),x.useEffect(()=>{if(n.products){const d=s.map(({id:f})=>f);n.handleChange(n.type,d.join(","))}},[s]),h.jsxs(h.Fragment,{children:[n.products&&h.jsx(Dn,{value:a,onValueChange:d=>l(d),withBlank:!0,customSelector:!0,children:n.products.map((d,f)=>h.jsx("option",{value:d.id,children:u(d)},f))}),h.jsx("div",{className:"flex justify-center",children:h.jsx("ul",{role:"list",className:"-mb-8 mt-3",children:s.map((d,f)=>{var p,g;return h.jsx("li",{children:h.jsxs("div",{className:"relative pb-8",children:[f!==s.length-1&&h.jsx("span",{className:"absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200","aria-hidden":"true"}),h.jsxs("div",{className:"relative flex space-x-3",children:[h.jsx("span",{className:"h-8 w-8 rounded-full flex items-center justify-center ring-8 ring-white",style:{backgroundColor:t},children:h.jsx(ngn,{className:"h-4 w-4 text-white cursor-pointer","aria-hidden":"true",onClick:()=>i(Ut("/products/:id/edit",{id:d.id}))})}),h.jsxs("div",{className:"flex min-w-0 flex-1 justify-between space-x-4 pt-1.5",children:[h.jsxs("div",{className:"flex items-center flex-1 justify-between space-x-5",children:[h.jsx(Ji,{to:Ut("/products/:id/edit",{id:d.id}),children:d.product_key}),h.jsx("span",{className:"font-mono",children:r(d.price,(p=d.company)==null?void 0:p.settings.country_id,(g=d.company)==null?void 0:g.settings.currency_id)})]}),h.jsx("div",{className:"whitespace-nowrap text-right cursor-pointer",onClick:()=>c(d.id),children:h.jsx(c1,{color:e.$16,hoverColor:e.$3,borderColor:e.$5,hoverBorderColor:e.$17,size:"1.4rem"})})]})]})]})},f)})})})]})}function bnt(n){const[e]=xe(),{subscription:t,handleChange:i,errors:r,products:s,page:o}=n;return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("name"),required:!0,children:h.jsx(lt,{value:t.name,onValueChange:a=>i("name",a),errorMessage:r==null?void 0:r.errors.name})}),h.jsx(ne,{leftSide:e("group"),children:h.jsx(qd,{endpoint:ze("/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})}),h.jsx(ne,{leftSide:e("assigned_user"),children:h.jsx(Cee,{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})}),h.jsx(ne,{leftSide:e("products"),children:h.jsx(IV,{type:"product_ids",handleChange:i,subscription:t,products:s})}),h.jsx(ne,{leftSide:e("recurring_products"),children:h.jsx(IV,{type:"recurring_product_ids",handleChange:i,subscription:t,products:s})}),h.jsx(ne,{leftSide:e("optional_products"),children:h.jsx(IV,{type:"optional_product_ids",handleChange:i,subscription:t,products:s})}),h.jsx(ne,{leftSide:e("optional_recurring_products"),children:h.jsx(IV,{type:"optional_recurring_product_ids",handleChange:i,subscription:t,products:s})}),o!=="create"&&h.jsx(ne,{leftSide:e("purchase_page"),children:h.jsx(Tc,{className:"break-all",text:t.purchase_page})})]})}function ynt(n){const[e]=xe(),{subscription:t,handleChange:i,errors:r}=n;return x.useEffect(()=>{t.allow_cancellation||i("refund_period",0),t.trial_enabled||i("trial_duration",0)},[t.trial_enabled,t.allow_cancellation]),h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("frequency"),children:h.jsxs(Dn,{value:t.frequency_id,errorMessage:r==null?void 0:r.errors.frequency_id,onValueChange:s=>i("frequency_id",s),customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"",children:e("once")}),Object.keys(NL).map((s,o)=>h.jsx("option",{value:s,children:e(NL[s])},o))]})}),h.jsx(ne,{leftSide:e("remaining_cycles"),children:h.jsxs(Dn,{value:t==null?void 0:t.remaining_cycles.toString(),onValueChange:s=>i("remaining_cycles",s),errorMessage:r==null?void 0:r.errors.remaining_cycles,customSelector:!0,children:[h.jsx("option",{value:"-1",children:e("endless")}),[...Array(37).keys()].map((s,o)=>h.jsx("option",{value:s.toString(),children:s},o))]})}),h.jsx(ne,{leftSide:e("auto_bill"),children:h.jsxs(Dn,{value:t.auto_bill||"",onValueChange:s=>i("auto_bill",s),errorMessage:r==null?void 0:r.errors.auto_bill,customSelector:!0,children:[h.jsx("option",{defaultChecked:!0,value:""}),h.jsx("option",{value:"always",children:e("enabled")}),h.jsx("option",{value:"optout",children:e("optout")}),h.jsx("option",{value:"optin",children:e("optin")}),h.jsx("option",{value:"off",children:e("disabled")})]})}),h.jsx(ne,{leftSide:e("promo_code"),children:h.jsx(lt,{value:t.promo_code,onValueChange:s=>i("promo_code",s),errorMessage:r==null?void 0:r.errors.promo_code})}),h.jsx(ne,{leftSide:e("promo_discount"),children:h.jsxs(L8,{children:[h.jsx("div",{className:"w-full lg:w-1/2",children:h.jsxs(Dn,{value:t.is_amount_discount.toString(),onValueChange:s=>i("is_amount_discount",JSON.parse(s)),errorMessage:r==null?void 0:r.errors.is_amount_discount,customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"true",children:e("amount")}),h.jsx("option",{value:"false",children:e("percent")})]})}),h.jsx("div",{className:"w-full lg:w-1/2",children:h.jsx(Qs,{value:t.promo_discount||"",onValueChange:s=>i("promo_discount",parseFloat(s)),errorMessage:r==null?void 0:r.errors.promo_discount})})]})}),h.jsx(ne,{leftSide:e("registration_required"),leftSideHelp:e("registration_required_help"),children:h.jsx(jt,{checked:t.registration_required,onValueChange:s=>i("registration_required",s)})}),h.jsx(ne,{leftSide:e("use_inventory_management"),leftSideHelp:e("use_inventory_management_help"),children:h.jsx(jt,{checked:t.use_inventory_management,onValueChange:s=>i("use_inventory_management",s)})}),h.jsx(ne,{leftSide:e("return_url"),children:h.jsx(lt,{value:t.webhook_configuration.return_url,onValueChange:s=>i("webhook_configuration.return_url",s),errorMessage:r==null?void 0:r.errors["webhook_configuration.return_url"]})}),h.jsx(ne,{leftSide:e("allow_query_overrides"),children:h.jsx(jt,{checked:t.allow_query_overrides,onValueChange:s=>i("allow_query_overrides",s)})}),h.jsx(ne,{leftSide:e("allow_plan_changes"),children:h.jsx(jt,{checked:t.allow_plan_changes,onValueChange:s=>i("allow_plan_changes",s)})}),h.jsx(ne,{leftSide:e("allow_cancellation"),children:h.jsx(jt,{checked:t.allow_cancellation,onValueChange:s=>i("allow_cancellation",s)})}),t.allow_cancellation&&h.jsx(ne,{children:h.jsxs(Dn,{label:e("refund_period"),value:t.refund_period,onValueChange:s=>i("refund_period",parseFloat(s)||0),withBlank:!0,blankOptionValue:0,errorMessage:r==null?void 0:r.errors.refund_period,children:[h.jsx("option",{value:86400,children:e("count_day")}),h.jsx("option",{value:172800,children:Ua("count_days",{count:2})}),h.jsx("option",{value:259200,children:Ua("count_days",{count:3})}),h.jsx("option",{value:604800,children:Ua("count_days",{count:7})}),h.jsx("option",{value:1209600,children:Ua("count_days",{count:14})}),h.jsx("option",{value:2592e3,children:Ua("count_days",{count:30})}),h.jsx("option",{value:5184e3,children:Ua("count_days",{count:60})})]})}),h.jsx(ne,{leftSide:e("trial_enabled"),children:h.jsx(jt,{checked:t.trial_enabled,onValueChange:s=>i("trial_enabled",s)})}),t.trial_enabled&&h.jsx(ne,{children:h.jsxs(Dn,{label:e("trial_duration"),value:t.trial_duration,onValueChange:s=>i("trial_duration",parseFloat(s)||0),withBlank:!0,blankOptionValue:0,errorMessage:r==null?void 0:r.errors.trial_duration,children:[h.jsx("option",{value:86400,children:e("count_day")}),h.jsx("option",{value:172800,children:Ua("count_days",{count:2})}),h.jsx("option",{value:259200,children:Ua("count_days",{count:3})}),h.jsx("option",{value:604800,children:Ua("count_days",{count:7})}),h.jsx("option",{value:1209600,children:Ua("count_days",{count:14})}),h.jsx("option",{value:2592e3,children:Ua("count_days",{count:30})}),h.jsx("option",{value:5184e3,children:Ua("count_days",{count:60})})]})}),h.jsx(ne,{leftSide:e("per_seat_enabled"),children:h.jsx(jt,{checked:t.per_seat_enabled,onValueChange:s=>i("per_seat_enabled",s)})}),t.per_seat_enabled&&h.jsx(ne,{children:h.jsx(lt,{label:e("max_seats_limit"),value:t.max_seats_limit,onValueChange:s=>i("max_seats_limit",parseFloat(s)||0),errorMessage:r==null?void 0:r.errors.max_seats_limit})})]})}function Cnt(n){var p;const[e]=xe(),t=xt();Lo();const{subscription:i,handleChange:r,errors:s}=n,[o,a]=x.useState(""),[l,c]=x.useState(""),u=Object.entries(((p=i==null?void 0:i.webhook_configuration)==null?void 0:p.post_purchase_headers)??[]),d=()=>{r(`webhook_configuration.post_purchase_headers.${o}`,l),a(""),c("")},f=g=>{Object.hasOwn(i.webhook_configuration.post_purchase_headers,g)&&(delete i.webhook_configuration.post_purchase_headers[g],r("webhook_configuration",i.webhook_configuration))};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("webhook_url"),children:h.jsx(lt,{value:i.webhook_configuration.post_purchase_url,onValueChange:g=>r("webhook_configuration.post_purchase_url",g),errorMessage:s==null?void 0:s.errors["webhook_configuration.post_purchase_url"]})}),h.jsx(ne,{leftSide:e("rest_method"),children:h.jsxs(Dn,{value:i.webhook_configuration.post_purchase_rest_method,onValueChange:g=>r("webhook_configuration.post_purchase_rest_method",g),errorMessage:s==null?void 0:s.errors["webhook_configuration.post_purchase_rest_method"],customSelector:!0,children:[h.jsx("option",{defaultChecked:!0,value:""}),h.jsx("option",{value:"post",children:e("post")}),h.jsx("option",{value:"put",children:e("put")})]})}),h.jsx(ne,{leftSide:e("add_header"),children:h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("div",{className:"flex flex-1 justify-between items-center",children:[h.jsx(lt,{label:e("header_key"),value:o,onValueChange:g=>a(g)}),h.jsx(lt,{label:e("header_value"),value:l,onValueChange:g=>c(g)}),h.jsx("div",{className:"mt-7 cursor-pointer hover:opacity-75",onClick:()=>o&&l&&d(),children:h.jsx(nc,{color:t.$3,size:"1.3rem"})})]}),u==null?void 0:u.map(([g,m],_)=>h.jsxs("div",{className:"flex flex-1 justify-between items-center space-x-2 mt-4",children:[h.jsx("span",{className:"flex-1 text-start",children:g}),h.jsx("span",{className:"flex-1 text-start",children:m}),h.jsx("div",{className:"cursor-pointer",onClick:()=>f(g),children:h.jsx(c1,{color:t.$16,hoverColor:t.$3,borderColor:t.$5,hoverBorderColor:t.$17,size:"1.6rem"})})]},_)),!u.length&&h.jsx("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 wnt(n){return(e,t)=>{n.setErrors(void 0);const i=pn.cloneDeep(n.subscription);n.setSubscription(pn.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 ign(){const{isAdmin:n,isOwner:e}=go();return lr(["/api/v1/subscriptions","create"],()=>Je("GET",ze("/api/v1/subscriptions/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}function rgn(n){const{isAdmin:e,isOwner:t}=go();return lr(["/api/v1/subscriptions",n.id],()=>Je("GET",ze("/api/v1/subscriptions/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function sgn(){const n=Vs(),e=ji(wu);return async(t,i)=>(pe.processing(),Je("POST",ze("/api/v1/subscriptions/bulk"),{action:i,ids:t}).then(()=>{pe.success(`${i}d_subscription`),ii(["subscriptions"]),e&&n.invalidateQueries([e])}))}function xnt({subscription:n,handleChange:e,errors:t}){const{t:i}=xe(),r=xt(),s=n.steps?n.steps.split(","):[],[o,a]=x.useState([]),{data:l}=lr({initialData:{},queryKey:["subscriptions","dependencies"],queryFn:()=>Je("GET",ze("/api/v1/subscriptions/steps")).then(g=>g.data)}),c=l?Object.values(l).filter(g=>!s.includes(g.id)):[];function u(g){e("steps",s.filter(m=>m!==g).join(","))}function d(g){if(!g.destination||!l)return;const m=Array.from(s),[_]=m.splice(g.source.index,1);m.splice(g.destination.index,0,_),e("steps",m.join(",")),f(m.join(","))}function f(g){Je("POST",ze("/api/v1/subscriptions/steps/check"),{steps:g??s.join(",")}).then(()=>a([])).catch(m=>{var _;(_=m.response)!=null&&_.data.errors.steps&&a(m.response.data.errors.steps)})}x.useEffect(()=>{l&&f()},[s.length]);const p=c.filter(g=>g.id.startsWith("auth.")).filter(g=>s.some(m=>m.startsWith("auth."))?!g.id.startsWith("auth."):!0);return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:i("authentication"),children:h.jsx(Dn,{value:"",onValueChange:g=>{e("steps",[...s,g].join(","))},withBlank:!0,customSelector:!0,children:p.map((g,m)=>h.jsx("option",{value:g.id,children:i(g.id)},m))})}),h.jsx(ne,{leftSide:i("other_steps"),children:h.jsx(Dn,{value:"",onValueChange:g=>{e("steps",[...s,g].join(","))},withBlank:!0,customSelector:!0,children:c.filter(g=>!g.id.startsWith("auth.")).map((g,m)=>h.jsx("option",{value:g.id,children:i(g.id)},m))})}),h.jsxs(ne,{leftSide:i("order"),leftSideHelp:i("steps_order_help"),children:[h.jsx(lee,{onDragEnd:d,children:h.jsx(uee,{droppableId:"columns",children:g=>h.jsxs("div",{...g.droppableProps,ref:g.innerRef,children:[s.map((m,_)=>h.jsx(cee,{draggableId:`item-${_}`,index:_,children:v=>h.jsxs("div",{ref:v.innerRef,...v.draggableProps,className:"flex items-center justify-between py-2",children:[h.jsxs("div",{className:"flex space-x-2 items-center",children:[h.jsx("div",{...v.dragHandleProps,children:h.jsx(wet,{size:"1.2rem",color:r.$17})}),h.jsx("p",{children:i(m)})]}),h.jsx("div",{className:"cursor-pointer",onClick:()=>u(m),children:h.jsx(c1,{color:r.$16,hoverColor:r.$3,borderColor:r.$5,hoverBorderColor:r.$17,size:"1.6rem"})})]})},_)),g.placeholder]})})}),t!=null&&t.errors.steps?h.jsx("div",{className:"text-red-500 mt-2",children:t.errors.steps}):o.length?h.jsx("div",{className:"text-red-500 mt-2",children:o.map((g,m)=>h.jsx("p",{children:g},m))}):null]})]})}function ogn(){const{documentTitle:n}=vr("new_payment_link"),[e]=xe(),t=Yi(),{data:i}=ign(),{data:r}=vnt({include:"company",status:["active"]}),s=xt(),o=_Se(),a=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"},{name:e("new_payment_link"),href:"/settings/subscriptions/create"}],l=[e("overview"),e("settings"),e("webhook"),e("steps")],[c,u]=x.useState(),[d,f]=x.useState(),[p,g]=x.useState(!1),[m,_]=x.useState(),v=wnt({setErrors:u,setSubscription:_,subscription:m});x.useEffect(()=>{i&&_({...i,frequency_id:Qh.Monthly,webhook_configuration:{post_purchase_headers:{},post_purchase_body:"",post_purchase_rest_method:"",post_purchase_url:"",return_url:""}})},[i]),x.useEffect(()=>{r&&f(r)},[r]);const b=y=>{y.preventDefault(),!p&&(g(!0),u(void 0),pe.processing(),Je("POST",ze("/api/v1/subscriptions"),m).then(C=>{pe.success("created_subscription"),ii(["subscriptions"]),t(Ut("/settings/subscriptions/:id/edit",{id:C.data.data.id}))}).catch(C=>{var S;((S=C.response)==null?void 0:S.status)===422&&(u(C.response.data),pe.dismiss())}).finally(()=>g(!1)))};return h.jsxs(Kr,{title:n,breadcrumbs:a,onSaveClick:b,disableSaveButton:!m||o||p,children:[h.jsx(Gb,{}),h.jsx(er,{title:e("new_payment_link"),className:"shadow-sm",childrenClassName:"pb-4",style:{borderColor:s.$24},headerStyle:{borderColor:s.$20},withoutHeaderBorder:!0,withoutBodyPadding:!0,children:h.jsxs(Qb,{tabs:l,withHorizontalPadding:!0,fullRightPadding:!0,horizontalPaddingWidth:"1.5rem",children:[h.jsx("div",{children:m&&h.jsx(bnt,{subscription:m,handleChange:v,errors:c,products:d,page:"create"})}),h.jsx("div",{children:m&&h.jsx(ynt,{subscription:m,handleChange:v,errors:c})}),h.jsx("div",{children:m&&h.jsx(Cnt,{subscription:m,handleChange:v,errors:c})}),h.jsx("div",{children:m&&h.jsx(xnt,{subscription:m,handleChange:v,errors:c})})]})})]})}function agn(){const[n]=xe(),e=sgn();return[i=>hs(i)===Vr.Active&&h.jsx($n,{onClick:()=>e([i.id],"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),i=>(hs(i)===Vr.Archived||hs(i)===Vr.Deleted)&&h.jsx($n,{onClick:()=>e([i.id],"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),i=>(hs(i)===Vr.Active||hs(i)===Vr.Archived)&&h.jsx($n,{onClick:()=>e([i.id],"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}function lgn(){const{documentTitle:n}=vr("edit_payment_link"),[e]=xe(),t=agn(),i=xt(),{id:r}=Yl(),{data:s}=rgn({id:r}),{data:o}=vnt({status:["active"]}),a=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"},{name:e("edit_payment_link"),href:Ut("/settings/subscriptions/:id/edit",{id:r})}],l=_Se(),c=[e("overview"),e("settings"),e("webhook"),e("steps")],[u,d]=x.useState(),[f,p]=x.useState(),[g,m]=x.useState(),[_,v]=x.useState(!1),b=wnt({setErrors:m,setSubscription:p,subscription:f});x.useEffect(()=>{if(s){const{post_purchase_headers:C,post_purchase_body:S,post_purchase_rest_method:k,post_purchase_url:I,return_url:L}=s.webhook_configuration;p({...s,webhook_configuration:{...s.webhook_configuration,post_purchase_headers:Array.isArray(C)?{}:C,post_purchase_body:S||"",post_purchase_rest_method:k||"",post_purchase_url:I||"",return_url:L||""}})}},[s]),x.useEffect(()=>{o&&d(o)},[o]);const y=()=>{_||(m(void 0),v(!0),pe.processing(),Je("PUT",ze("/api/v1/subscriptions/:id",{id:r}),f).then(()=>{pe.success("updated_subscription"),ii(["subscriptions"])}).catch(C=>{var S;((S=C.response)==null?void 0:S.status)===422&&(m(C.response.data),pe.dismiss())}).finally(()=>v(!1)))};return h.jsx(Kr,{title:n,breadcrumbs:a,navigationTopRight:f&&h.jsx(Kw,{resource:f,onSaveClick:y,actions:t,disableSaveButton:!f||l||_}),children:h.jsx(er,{title:e("edit_payment_link"),className:"shadow-sm",childrenClassName:"pb-4",style:{borderColor:i.$24},headerStyle:{borderColor:i.$20},withoutHeaderBorder:!0,withoutBodyPadding:!0,children:h.jsxs(Qb,{tabs:c,withHorizontalPadding:!0,fullRightPadding:!0,horizontalPaddingWidth:"1.5rem",children:[h.jsx("div",{children:f&&h.jsx(bnt,{subscription:f,handleChange:b,errors:g,products:u})}),h.jsx("div",{children:f&&h.jsx(ynt,{subscription:f,handleChange:b,errors:g})}),h.jsx("div",{children:f&&h.jsx(Cnt,{subscription:f,handleChange:b,errors:g})}),h.jsx("div",{children:f&&h.jsx(xnt,{subscription:f,handleChange:b,errors:g})})]})})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function cgn(n){const e=jo();return lr("/api/v1/clients/create",()=>Je("GET",ze("/api/v1/clients/create")).then(t=>t.data.data),{refetchOnWindowFocus:!!n.refetchOnWindowFocus,staleTime:1/0,enabled:e("create_client")})}function mEe(n){return lr(["/api/v1/clients","per_page=500",n],()=>{var e;return Je("GET",ze("/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 r5r({id:n,enabled:e}){return lr(["/api/v1/clients",n],()=>Je("GET",ze("/api/v1/clients/:id?include=group_settings,activities.history",{id:n})).then(t=>t.data.data),{enabled:e,staleTime:1/0})}const ugn={assign_group:"updated_group",bulk_update:"updated_records"};function _Ee(){const n=Vs(),e=ji(wu);return async(t,i,r)=>{const{groupSettingsId:s,column:o,newValue:a}=r||{};return pe.processing(),Je("POST",ze("/api/v1/clients/bulk"),{action:i,ids:t,...s&&{group_settings_id:s},...o&&{column:o},...i==="bulk_update"&&{new_value:a}}).then(()=>{const l=ugn[i]||`${i}d_client`;pe.success(l),e&&n.invalidateQueries([e]),ii(["clients"]),i==="delete"&&ii(["projects"])})}}function dgn(n){var o,a,l,c,u,d;const[e]=xe(),{errors:t,setClient:i,setErrors:r}=n,s=f=>{r(void 0),i(p=>p&&pn.set(p,f.target.id,f.target.value))};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("billing_address1"),children:h.jsx(lt,{id:"address1",value:((o=n.client)==null?void 0:o.address1)||"",onChange:s,errorMessage:t==null?void 0:t.errors.address1})}),h.jsx(ne,{leftSide:e("address2"),children:h.jsx(lt,{id:"address2",value:((a=n.client)==null?void 0:a.address2)||"",onChange:s,errorMessage:t==null?void 0:t.errors.address2})}),h.jsx(ne,{leftSide:e("city"),children:h.jsx(lt,{id:"city",value:((l=n.client)==null?void 0:l.city)||"",onChange:s,errorMessage:t==null?void 0:t.errors.city})}),h.jsx(ne,{leftSide:e("state"),children:h.jsx(lt,{id:"state",value:((c=n.client)==null?void 0:c.state)||"",onChange:s,errorMessage:t==null?void 0:t.errors.state})}),h.jsx(ne,{leftSide:e("postal_code"),children:h.jsx(lt,{id:"postal_code",value:((u=n.client)==null?void 0:u.postal_code)||"",onChange:s,errorMessage:t==null?void 0:t.errors.postal_code})}),h.jsx(ne,{leftSide:e("country"),children:h.jsx(_4,{value:((d=n.client)==null?void 0:d.country_id)||"",errorMessage:t==null?void 0:t.errors.country_id,onChange:f=>i(p=>p&&{...p,country_id:f}),dismissable:!0})})]})}function hgn(n){var a,l,c,u,d,f;const[e]=xe(),{errors:t,setErrors:i,setClient:r}=n,s=p=>{i(void 0),r(g=>g&&pn.set(g,p.target.id,p.target.value))},o=()=>{n.setClient(p=>p&&{...p,shipping_address1:p==null?void 0:p.address1,shipping_address2:p==null?void 0:p.address2,shipping_city:p==null?void 0:p.city,shipping_state:p==null?void 0:p.state,shipping_postal_code:p==null?void 0:p.postal_code,shipping_country_id:p==null?void 0:p.country_id})};return h.jsxs(h.Fragment,{children:[h.jsx(dn,{onClick:o,type:"secondary",behavior:"button",className:"mx-4 rounded-md bg-grey h-6",children:e("copy_billing")}),h.jsx(ne,{leftSide:e("shipping_address1"),children:h.jsx(lt,{id:"shipping_address1",value:((a=n.client)==null?void 0:a.shipping_address1)||"",onChange:s,errorMessage:t==null?void 0:t.errors.shipping_address1})}),h.jsx(ne,{leftSide:e("address2"),children:h.jsx(lt,{id:"shipping_address2",value:((l=n.client)==null?void 0:l.shipping_address2)||"",onChange:s})}),h.jsx(ne,{leftSide:e("city"),children:h.jsx(lt,{id:"shipping_city",value:((c=n.client)==null?void 0:c.shipping_city)||"",onChange:s,errorMessage:t==null?void 0:t.errors.shipping_city})}),h.jsx(ne,{leftSide:e("state"),children:h.jsx(lt,{id:"shipping_state",value:((u=n.client)==null?void 0:u.shipping_state)||"",onChange:s,errorMessage:t==null?void 0:t.errors.shipping_state})}),h.jsx(ne,{leftSide:e("postal_code"),children:h.jsx(lt,{id:"shipping_postal_code",value:((d=n.client)==null?void 0:d.shipping_postal_code)||"",onChange:s,errorMessage:t==null?void 0:t.errors.shipping_postal_code})}),h.jsx(ne,{leftSide:e("country"),children:h.jsx(_4,{onChange:p=>r(g=>g&&{...g,shipping_country_id:p}),value:((f=n.client)==null?void 0:f.shipping_country_id)||"",errorMessage:t==null?void 0:t.errors.shipping_country_id,dismissable:!0})})]})}function fgn(n){const[e]=xe(),t=xt();return h.jsx(er,{className:"shadow-sm",title:e("address"),style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},withoutBodyPadding:!0,children:h.jsx("div",{className:"pt-2",children:h.jsxs(Qb,{tabs:[e("billing_address"),e("shipping_address")],withHorizontalPadding:!0,horizontalPaddingWidth:"1.5rem",fullRightPadding:!0,children:[h.jsx("div",{children:h.jsx(dgn,{...n})}),h.jsx("div",{children:h.jsx(hgn,{...n})})]})})})}function pgn(n){const[e]=xe(),{size:t=22}=n||{};return h.jsx(Ah,{tooltipElement:_9(e("user_unsubscribed"),":link",()=>h.jsxs(Ji,{className:"lowercase text-xs",to:"https://invoiceninja.github.io/en/hosted-mail/",external:!0,children:[e("link"),"."]})),width:"auto",placement:"top",children:h.jsx(jC,{color:"red",size:t})})}function ggn(n){const[e]=xe(),t=xt(),i=zi();Lo();const r=(l,c,u)=>{n.setErrors(void 0);const d=n.contacts.findIndex(f=>f.contact_key===u);pn.set(n.contacts[d],c,l),n.setContacts([...n.contacts])},s=l=>{const c=[...n.contacts];c.splice(l,1),n.setContacts(c)},o=()=>{const l=[...n.contacts];l.push({contact_key:MJ().replaceAll("-",""),first_name:"",last_name:"",email:"",password:"",phone:"",send_email:!1}),n.setContacts(l)},a=()=>{o(),setTimeout(()=>{const l=document.querySelectorAll('[id^="first_name_"]');l.length>2&&l[l.length-1].scrollIntoView({behavior:"smooth",block:"center"})},50)};return h.jsx(er,{className:"shadow-sm",title:e("contacts"),style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},withoutBodyPadding:!0,topRight:h.jsx(dn,{className:"shadow-sm",type:"secondary",behavior:"button",onClick:a,children:h.jsxs("div",{className:"flex items-center",children:[h.jsx("div",{children:h.jsx(nc,{size:"0.7rem",color:t.$3})}),h.jsx("span",{className:"font-medium",children:e("add_contact")})]})}),children:n.contacts.map((l,c)=>{var u,d,f,p,g,m,_,v,b;return h.jsx("div",{className:"px-6",children:h.jsxs("div",{className:$t("pb-2 pt-4 border-b border-dashed",{"border-b-0":c===n.contacts.length-1}),style:{borderColor:t.$24},children:[h.jsx(ne,{leftSide:e("first_name"),noExternalPadding:!0,children:h.jsx(lt,{id:`first_name_${c}`,value:l.first_name,onChange:y=>r(y.target.value,"first_name",l.contact_key),errorMessage:(u=n.errors)==null?void 0:u.errors.name})}),h.jsx(ne,{leftSide:e("last_name"),noExternalPadding:!0,children:h.jsx(lt,{id:`last_name_${c}`,value:l.last_name,onChange:y=>r(y.target.value,"last_name",l.contact_key),errorMessage:(d=n.errors)==null?void 0:d.errors.name})}),h.jsx(ne,{leftSide:e("email"),noExternalPadding:!0,children:h.jsx(lt,{id:`email_${c}`,value:l.email,onChange:y=>r(y.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)&&h.jsx(ne,{leftSide:e("password"),noExternalPadding:!0,children:h.jsx(lt,{id:`password_${c}`,type:"password",value:l.password,onChange:y=>r(y.target.value,"password",l.contact_key),errorMessage:(p=n.errors)==null?void 0:p.errors[`contacts.${c}.password`]})}),h.jsx(ne,{leftSide:e("phone"),noExternalPadding:!0,children:h.jsx(lt,{id:`phone_${c}`,value:l.phone,onChange:y=>r(y.target.value,"phone",l.contact_key),errorMessage:(g=n.errors)==null?void 0:g.errors[`contacts.${c}.phone`]})}),h.jsx(ne,{leftSide:e("add_to_invoices"),noExternalPadding:!0,children:h.jsx(jt,{checked:!!(l!=null&&l.send_email),onChange:y=>r(y,"send_email",l.contact_key)})}),((m=i==null?void 0:i.custom_fields)==null?void 0:m.contact1)&&h.jsx(qo,{field:"contact1",defaultValue:l.custom_value1,value:i.custom_fields.contact1,onValueChange:y=>r(y,"custom_value1",l.contact_key),noExternalPadding:!0}),((_=i==null?void 0:i.custom_fields)==null?void 0:_.contact2)&&h.jsx(qo,{field:"contact2",defaultValue:l.custom_value2,value:i.custom_fields.contact2,onValueChange:y=>r(y,"custom_value2",l.contact_key),noExternalPadding:!0}),((v=i==null?void 0:i.custom_fields)==null?void 0:v.contact3)&&h.jsx(qo,{field:"contact3",defaultValue:l.custom_value3,value:i.custom_fields.contact3,onValueChange:y=>r(y,"custom_value3",l.contact_key),noExternalPadding:!0}),((b=i==null?void 0:i.custom_fields)==null?void 0:b.contact4)&&h.jsx(qo,{field:"contact4",defaultValue:l.custom_value4,value:i.custom_fields.contact4,onValueChange:y=>r(y,"custom_value4",l.contact_key),noExternalPadding:!0}),h.jsx(ne,{...l.is_locked&&{leftSide:h.jsx("div",{className:"flex",children:h.jsx(pgn,{size:25})})},noExternalPadding:!0,pushContentToRight:!0,children:h.jsx("div",{className:"flex items-center",children:n.contacts.length>=2&&h.jsx(dn,{className:"shadow-sm",type:"secondary",behavior:"button",onClick:()=>s(c),children:h.jsxs("div",{className:"flex space-x-2 items-center",children:[h.jsx("div",{children:h.jsx(MO,{size:"1rem",color:"#ef4444"})}),h.jsx("span",{className:"font-medium text-red-500",children:e("remove_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 Snt(n){return lr(["/api/v1/group_settings",n],()=>Je("GET",ze("/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 mgn(n){const{id:e}=n;return lr(["/api/v1/group_settings",e],()=>Je("GET",ze("/api/v1/group_settings/:id",{id:e})).then(t=>t.data.data),{staleTime:1/0})}function _gn(){return(n,e)=>{pe.processing(),Je("POST",ze("/api/v1/group_settings/bulk"),{action:e,ids:n}).then(()=>{pe.success(`${e}d_group`),ii(["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 vgn(){return lr(["/api/v1/users"],()=>Je("GET",ze("/api/v1/users")),{staleTime:1/0})}function bgn(n){return lr(["/api/v1/users",n.id],()=>Je("GET",ze("/api/v1/users/:id?include=company_user",{id:n.id})),{enabled:n.enabled,staleTime:1/0})}function ygn(){const{isAdmin:n}=go();return lr(["/api/v1/users/create"],()=>Je("GET",ze("/api/v1/users/create")),{staleTime:1/0,enabled:n})}function Cgn(n){const e=fze(),t=Wm(),{setIsPasswordConfirmModalOpen:i}=n;return(r,s,o,a)=>{pe.processing(),Je("POST",ze("/api/v1/users/bulk"),{action:s,ids:r},{headers:{"X-Api-Password":o}}).then(()=>{pe.success(`${s}d_user`),e(["users"])}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===412&&(t(a),i(!0))})}}function wgn(n){var l,c,u,d,f,p,g,m,_,v,b,y,C,S,k,I,L,N,P,O,F,V,M,B,W,q,U,G,H;const[e]=xe(),t=xt(),{data:i}=vgn(),{data:r}=Snt(),s=(z,Z)=>{n.setErrors(void 0),n.setClient(X=>X&&pn.set({...X},z,Z))},o=(z,Z)=>{n.setClient(X=>X&&pn.set({...X},z,Z))},a=zi();return h.jsxs(er,{className:"shadow-sm",title:e("company_details"),style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:[n.client&&n.page==="edit"&&h.jsx(ne,{leftSide:e("status"),children:h.jsx(ev,{entity:n.client})}),h.jsx(ne,{leftSide:e("name"),children:h.jsx(lt,{value:((l=n.client)==null?void 0:l.name)||"",onValueChange:z=>s("name",z),errorMessage:(c=n.errors)==null?void 0:c.errors.name})}),h.jsx(ne,{leftSide:e("number"),children:h.jsx(lt,{value:((u=n.client)==null?void 0:u.number)||"",onValueChange:z=>s("number",z),errorMessage:(d=n.errors)==null?void 0:d.errors.number})}),r&&h.jsx(ne,{leftSide:e("group"),children:h.jsx(Dn,{value:(f=n.client)==null?void 0:f.group_settings_id,onValueChange:z=>s("group_settings_id",z),errorMessage:(p=n.errors)==null?void 0:p.errors.group_settings_id,withBlank:!0,customSelector:!0,children:r.map((z,Z)=>h.jsx("option",{value:z.id,children:z.name},Z))})}),i&&h.jsx(ne,{leftSide:e("assigned_user"),children:h.jsx(Dn,{value:(g=n.client)==null?void 0:g.assigned_user_id,onValueChange:z=>s("assigned_user_id",z),errorMessage:(m=n.errors)==null?void 0:m.errors.assigned_user_id,withBlank:!0,customSelector:!0,children:i.data.data.map((z,Z)=>h.jsxs("option",{value:z.id,children:[z.first_name," ",z.last_name]},Z))})}),h.jsx(ne,{leftSide:e("id_number"),children:h.jsx(lt,{value:((_=n.client)==null?void 0:_.id_number)||"",onValueChange:z=>s("id_number",z),errorMessage:(v=n.errors)==null?void 0:v.errors.id_number})}),h.jsx(ne,{leftSide:e("vat_number"),children:h.jsx(lt,{value:((b=n.client)==null?void 0:b.vat_number)||"",onValueChange:z=>s("vat_number",z),errorMessage:(y=n.errors)==null?void 0:y.errors.vat_number})}),h.jsx(ne,{leftSide:e("website"),children:h.jsx(lt,{value:((C=n.client)==null?void 0:C.website)||"",onValueChange:z=>s("website",z),errorMessage:(S=n.errors)==null?void 0:S.errors.website})}),h.jsx(ne,{leftSide:e("phone"),children:h.jsx(lt,{value:((k=n.client)==null?void 0:k.phone)||"",onValueChange:z=>s("phone",z),errorMessage:(I=n.errors)==null?void 0:I.errors.phone})}),h.jsx(ne,{leftSide:e("routing_id"),children:h.jsx(lt,{value:((L=n.client)==null?void 0:L.routing_id)||"",onValueChange:z=>s("routing_id",z),errorMessage:(N=n.errors)==null?void 0:N.errors.routing_id})}),h.jsx(ne,{leftSide:e("valid_vat_number"),children:h.jsx(jt,{checked:!!((P=n.client)!=null&&P.has_valid_vat_number),onValueChange:z=>o("has_valid_vat_number",z)})}),h.jsx(ne,{leftSide:e("tax_exempt"),children:h.jsx(jt,{checked:!!((O=n.client)!=null&&O.is_tax_exempt),onValueChange:z=>o("is_tax_exempt",z)})}),h.jsx(ne,{leftSide:e("classification"),children:h.jsxs(Dn,{value:((F=n.client)==null?void 0:F.classification)??"",onValueChange:z=>s("classification",z),withBlank:!0,customSelector:!0,children:[h.jsx("option",{value:"individual",children:e("individual")}),h.jsx("option",{value:"business",children:e("business")}),h.jsx("option",{value:"company",children:e("company")}),h.jsx("option",{value:"partnership",children:e("partnership")}),h.jsx("option",{value:"trust",children:e("trust")}),h.jsx("option",{value:"charity",children:e("charity")}),h.jsx("option",{value:"government",children:e("government")}),h.jsx("option",{value:"other",children:e("other")})]})}),((V=a==null?void 0:a.custom_fields)==null?void 0:V.client1)&&h.jsx(qo,{field:"client1",defaultValue:(M=n.client)==null?void 0:M.custom_value1,value:a.custom_fields.client1,onValueChange:z=>o("custom_value1",z)}),((B=a==null?void 0:a.custom_fields)==null?void 0:B.client2)&&h.jsx(qo,{field:"client2",defaultValue:(W=n.client)==null?void 0:W.custom_value2,value:a.custom_fields.client2,onValueChange:z=>o("custom_value2",z)}),((q=a==null?void 0:a.custom_fields)==null?void 0:q.client3)&&h.jsx(qo,{field:"client3",defaultValue:(U=n.client)==null?void 0:U.custom_value3,value:a.custom_fields.client3,onValueChange:z=>o("custom_value3",z)}),((G=a==null?void 0:a.custom_fields)==null?void 0:G.client4)&&h.jsx(qo,{field:"client4",defaultValue:(H=n.client)==null?void 0:H.custom_value4,value:a.custom_fields.client4,onValueChange:z=>o("custom_value4",z)})]})}const xgn=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Sgn=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Egn=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],kgn=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Dje=(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 Ent(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?kgn:Egn:e.binary?Sgn:xgn,i=e.space?" ":"";if(e.signed&&n===0)return` 0${i}${t[0]}`;const r=n<0,s=r?"-":e.signed?"+":"";r&&(n=-n);let o;if(e.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:e.maximumFractionDigits,...o}),n<1){const u=Dje(n,e.locale,o);return s+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,o||(n=n.toPrecision(3));const l=Dje(Number(n),e.locale,o),c=t[a];return s+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 Tgn(n){return h.jsxs("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:[h.jsx("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"}),h.jsx("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),h.jsx("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"}),h.jsx("circle",{cx:"18.5",cy:"47",r:"3",fill:"#FFF"}),h.jsx("circle",{cx:"28.5",cy:"47",r:"3",fill:"#FFF"}),h.jsx("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 Ign(n){return h.jsxs("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:[h.jsx("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"}),h.jsx("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),h.jsx("circle",{cx:"18.931",cy:"14.431",r:"4.569",fill:"#F3D55B"}),h.jsx("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"}),h.jsx("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"}),h.jsx("g",{fill:"#FFF",children:h.jsx("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 Lgn(n){return h.jsxs("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:[h.jsx("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"}),h.jsx("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),h.jsx("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"}),h.jsx("g",{fill:"#FFF",children:h.jsx("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 Agn(n){return h.jsxs("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:[h.jsx("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"}),h.jsx("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"}),h.jsx("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),h.jsx("g",{fill:"#FFF",children:h.jsx("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"})}),h.jsx("circle",{cx:"18.931",cy:"14.431",r:"4.569",fill:"#F3D55B"}),h.jsx("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 Ngn(n){return h.jsxs("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:[h.jsx("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"}),h.jsx("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),h.jsx("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"}),h.jsx("g",{fill:"#FFF",children:h.jsx("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"})}),h.jsx("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 knt(n){const e=["jpg","svg","png","pdf"],{size:t=26,type:i}=n;return h.jsxs(h.Fragment,{children:[i==="jpg"&&h.jsx(Ign,{height:t}),i==="svg"&&h.jsx(Ngn,{height:t}),i==="png"&&h.jsx(Agn,{height:t}),i==="pdf"&&h.jsx(Lgn,{height:t}),!e.includes(i)&&h.jsx(Tgn,{height: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 Tnt({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M7.25,9c-.414,0-.75-.336-.75-.75v-3.25c0-1.378-1.122-2.5-2.5-2.5S1.5,3.622,1.5,5v1.25c0,.414-.336,.75-.75,.75s-.75-.336-.75-.75v-1.25C0,2.794,1.794,1,4,1s4,1.794,4,4v3.25c0,.414-.336,.75-.75,.75Z",fill:e,"data-color":"color-2"}),h.jsx("path",{d:"M13.25,7.5H5.75c-1.517,0-2.75,1.233-2.75,2.75v4c0,1.517,1.233,2.75,2.75,2.75h7.5c1.517,0,2.75-1.233,2.75-2.75v-4c0-1.517-1.233-2.75-2.75-2.75Zm-3,5.25c0,.414-.336,.75-.75,.75s-.75-.336-.75-.75v-1c0-.414,.336-.75,.75-.75s.75,.336,.75,.75v1Z",fill: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 Int({size:n="1.2rem",color:e="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M12.25,9c-.414,0-.75-.336-.75-.75v-3.25c0-1.378-1.122-2.5-2.5-2.5s-2.5,1.122-2.5,2.5v3.25c0,.414-.336,.75-.75,.75s-.75-.336-.75-.75v-3.25c0-2.206,1.794-4,4-4s4,1.794,4,4v3.25c0,.414-.336,.75-.75,.75Z",fill:e,"data-color":"color-2"}),h.jsx("path",{d:"M12.75,7.5H5.25c-1.517,0-2.75,1.233-2.75,2.75v4c0,1.517,1.233,2.75,2.75,2.75h7.5c1.517,0,2.75-1.233,2.75-2.75v-4c0-1.517-1.233-2.75-2.75-2.75Zm-3,5.25c0,.414-.336,.75-.75,.75s-.75-.336-.75-.75v-1c0-.414,.336-.75,.75-.75s.75,.336,.75,.75v1Z",fill:e})]})}function Lnt(n){const[e]=xe(),t=xt(),i=Qo(),{disableEditableOptions:r=!1}=n,s=Wm(),o=XQe(),[a,l]=x.useState(!1),[c,u]=x.useState(),[d,f]=x.useState([]),{dateFormat:p}=Zc(),g=Vs(),m=b=>{var y;return(y=d.find(({documentId:C})=>C===b))==null?void 0:y.url},_=(b,y)=>{pe.processing(),g.fetchQuery(["/api/v1/documents",b.hash],()=>Je("GET",ze("/documents/:hash",{hash:b.hash}),{headers:PE()},{responseType:"arraybuffer"}),{staleTime:1/0}).then(C=>{const S=new Blob([C.data],{type:C.headers["content-type"]}),k=URL.createObjectURL(S);if(y){window.open(k);return}const I=document.createElement("a");I.download=b.name,I.href=k,I.target="_blank",document.body.appendChild(I),I.click(),document.body.removeChild(I),pe.dismiss()})},v=(b,y)=>{pe.processing(),Je("delete",ze("/api/v1/documents/:id",{id:c}),{},{headers:{"X-Api-Password":b}}).then(()=>{var C;pe.success("deleted_document"),(C=n.onDocumentDelete)==null||C.call(n)}).catch(C=>{var S;((S=C.response)==null?void 0:S.status)===412&&(s(y),l(!0))})};return x.useEffect(()=>{i.show_document_preview&&n.documents.forEach(async({id:b,hash:y,type:C})=>{if(!d.find(({documentId:k})=>k===b)&&(C==="png"||C==="jpg")){const k=await g.fetchQuery(["documents",y],()=>Je("GET",ze("/documents/:hash",{hash:y}),{headers:PE()},{responseType:"arraybuffer"}),{staleTime:1/0}),I=new Blob([k.data],{type:k.headers["content-type"]}),L=URL.createObjectURL(I);f(N=>[...N,{documentId:b,url:L}])}})},[i,n.documents]),h.jsxs(h.Fragment,{children:[h.jsxs(h1,{withoutTopBorder:!0,withoutLeftBorder:!0,withoutRightBorder:!0,withoutBottomBorder:!0,children:[h.jsxs(p1,{children:[h.jsx(_a,{children:e("name")}),h.jsx(_a,{children:e("date")}),h.jsx(_a,{children:e("type")}),h.jsx(_a,{children:e("size")}),!r&&h.jsx(_a,{})]}),h.jsxs(f1,{children:[!n.documents.length&&h.jsx(hc,{className:"border-b",style:{borderColor:t.$20},children:h.jsx(bs,{colSpan:5,children:e("no_records_found")})}),n.documents.map((b,y)=>h.jsxs(hc,{className:"border-b",style:{borderColor:t.$20},children:[h.jsx(bs,{children:h.jsxs("div",{className:"flex items-center space-x-10",style:{width:"max-content"},children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(knt,{type:b.type}),h.jsx("span",{children:b.name}),b.is_public?h.jsx(Tnt,{color:t.$3,size:"1.4rem"}):h.jsx(Int,{color:t.$3,size:"1.4rem"})]}),i.show_document_preview&&(b.type==="png"||b.type==="jpg")&&h.jsx(h.Fragment,{children:m(b.id)?h.jsx("img",{src:m(b.id),style:{width:150,height:75}}):h.jsx(yo,{})})]})}),h.jsx(bs,{children:so(b.updated_at,p)}),h.jsx(bs,{children:b.type}),h.jsx(bs,{children:Ent(b.size)}),!r&&h.jsx(bs,{children:h.jsxs(Z_,{label:e("actions"),children:[h.jsx($n,{onClick:()=>{_(b,!0)},icon:h.jsx(an,{element:nwe}),children:e("view")}),h.jsx($n,{onClick:()=>{_(b,!1)},icon:h.jsx(an,{element:FE}),children:e("download")}),b.is_public?h.jsx($n,{onClick:()=>{o(b.id,!1).then(()=>{var C;return(C=n.onDocumentDelete)==null?void 0:C.call(n)})},icon:h.jsx(an,{element:mUe}),children:e("set_private")}):h.jsx($n,{onClick:()=>{o(b.id,!0).then(()=>{var C;return(C=n.onDocumentDelete)==null?void 0:C.call(n)})},icon:h.jsx(an,{element:yUe}),children:e("set_public")}),h.jsx($n,{onClick:()=>{u(b.id),l(!0)},icon:h.jsx(an,{element:fc}),children:e("delete")})]})})]},y))]})]}),h.jsx(wg,{show:a,onClose:l,onSave:v})]})}function Dgn(){const[n]=xe(),e=xt(),t=Vs(),i=Qo(),{dateFormat:r}=Zc(),s=Wm(),o=XQe(),[a,l]=x.useState(1),[c,u]=x.useState("10"),[d,f]=x.useState(""),[p,g]=x.useState(!1),[m,_]=x.useState([]),{data:v,isLoading:b}=YQe({perPage:c,currentPage:a,companyDocuments:"true"}),y=I=>{var L;return(L=m.find(({documentId:N})=>N===I))==null?void 0:L.url},C=()=>{ii(["documents"])},S=async(I,L)=>{pe.processing();const N=await t.fetchQuery(["/api/v1/documents",I.hash],()=>Je("GET",ze("/documents/:hash",{hash:I.hash}),{headers:PE()},{responseType:"arraybuffer"}),{staleTime:1/0});pe.dismiss();const P=new Blob([N.data],{type:N.headers["content-type"]}),O=URL.createObjectURL(P);if(L){window.open(O);return}const F=document.createElement("a");F.download=I.name,F.href=O,F.target="_blank",document.body.appendChild(F),F.click(),document.body.removeChild(F)},k=(I,L)=>{pe.processing(),Je("delete",ze("/api/v1/documents/:id",{id:d}),{},{headers:{"X-Api-Password":I}}).then(()=>pe.success("deleted_document")).catch(N=>{var P;((P=N.response)==null?void 0:P.status)===412&&(s(L),g(!0))}).finally(()=>C())};return x.useEffect(()=>{i.show_document_preview&&v&&v.data.data.forEach(async({id:I,hash:L,type:N})=>{if(!m.find(({documentId:O})=>O===I)&&(N==="png"||N==="jpg")){const O=await t.fetchQuery(["/api/v1/documents",L],()=>Je("GET",ze("/documents/:hash",{hash:L}),{headers:PE()},{responseType:"arraybuffer"}),{staleTime:1/0}),F=new Blob([O.data],{type:O.headers["content-type"]}),V=URL.createObjectURL(F);_(M=>[...M,{documentId:I,url:V}])}})},[i,v==null?void 0:v.data.data]),h.jsxs(h.Fragment,{children:[h.jsxs(h1,{children:[h.jsxs(p1,{children:[h.jsx(_a,{children:n("name")}),h.jsx(_a,{children:n("date")}),h.jsx(_a,{children:n("type")}),h.jsx(_a,{children:n("size")}),h.jsx(_a,{})]}),h.jsxs(f1,{children:[b&&h.jsx(hc,{children:h.jsx(bs,{colSpan:5,children:h.jsx(yo,{})})}),!!(v&&!v.data.data.length&&!b)&&h.jsx(hc,{className:"border-b",style:{borderColor:e.$20},children:h.jsx(bs,{colSpan:5,children:n("no_records_found")})}),v&&v.data.data.map((I,L)=>h.jsxs(hc,{className:$t({"border-b":L!==v.data.data.length-1}),style:{borderColor:e.$20},children:[h.jsx(bs,{children:h.jsxs("div",{className:"flex items-center space-x-10",style:{width:"max-content"},children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(knt,{type:I.type}),h.jsx("span",{children:I.name}),I.is_public?h.jsx(Tnt,{color:e.$3,size:"1.4rem"}):h.jsx(Int,{color:e.$3,size:"1.4rem"})]}),i.show_document_preview&&(I.type==="png"||I.type==="jpg")&&h.jsx(h.Fragment,{children:y(I.id)?h.jsx("img",{src:y(I.id),style:{width:150,height:75}}):h.jsx(yo,{})})]})}),h.jsx(bs,{children:so(I.updated_at,r)}),h.jsx(bs,{children:I.type}),h.jsx(bs,{children:Ent(I.size)}),h.jsx(bs,{children:h.jsxs(Z_,{label:n("actions"),children:[h.jsx($n,{onClick:()=>{S(I,!0)},icon:h.jsx(an,{element:nwe}),children:n("view")}),h.jsx($n,{onClick:()=>{S(I,!1)},icon:h.jsx(an,{element:FE}),children:n("download")}),I.is_public?h.jsx($n,{onClick:()=>{o(I.id,!1).then(()=>C())},icon:h.jsx(an,{element:mUe}),children:n("set_private")}):h.jsx($n,{onClick:()=>{o(I.id,!0).then(()=>C())},icon:h.jsx(an,{element:yUe}),children:n("set_public")}),h.jsx($n,{onClick:()=>{f(I.id),g(!0)},icon:h.jsx(an,{element:fc}),children:n("delete")})]})})]},I.id))]})]}),v&&h.jsx(dJe,{currentPage:a,onPageChange:l,onRowsChange:u,totalPages:v.data.meta.pagination.total_pages,totalRecords:v.data.meta.pagination.total}),h.jsx(wg,{show:p,onClose:g,onSave:k})]})}const Rje=As.div` border-color: ${n=>n.theme.borderColor}; &:hover { border-color: ${n=>n.theme.hoverBorderColor}; } `;function vEe(n){const[e]=xe(),{disableUpload:t=!1}=n;Ml();const i=xt(),[r,s]=x.useState(new FormData),[o,a]=x.useState(),l=fd({enableReinitialize:!0,initialValues:{},onSubmit:()=>{pe.processing(),a(void 0),Je("POST",n.endpoint,r,{headers:{"Content-Type":"multipart/form-data"}}).then(()=>{var f;pe.success("uploaded_document"),s(new FormData),(f=n.onSuccess)==null||f.call(n)}).catch(f=>{var p;((p=f.response)==null?void 0:p.status)===422&&(pe.dismiss(),a(f.response.data)),s(new FormData)})}}),{getRootProps:c,getInputProps:u,isDragActive:d}=NA({disabled:t,onDrop:f=>{r.append("_method","PUT"),f.forEach(p=>r.append("documents[]",p)),s(r),l.submitForm()}});return n.widgetOnly?h.jsxs(h.Fragment,{children:[!$u()&&To(),h.jsx("div",{...c(),className:"flex flex-col md:flex-row md:items-center",children:h.jsxs(Rje,{className:"relative block w-full border-2 border-dashed rounded-lg p-12 text-center",theme:{borderColor:i.$21,hoverBorderColor:i.$17},children:[h.jsx("input",{...u()}),h.jsx("div",{className:"flex justify-center",children:h.jsx(AL,{size:"2.3rem",color:i.$3})}),h.jsx("span",{className:"mt-3 block text-sm font-medium",style:{color:i.$17},children:e(d?"drop_file_here":"dropzone_default_message")})]})}),o&&Object.keys(o.errors).map((f,p)=>h.jsx(Kl,{className:"mt-2",children:o.errors[f]},p))]}):h.jsxs(h.Fragment,{children:[!$u()&&To(),h.jsx(er,{title:e("upload"),children:h.jsx(ne,{leftSide:e("upload"),children:h.jsx("div",{...c(),className:"flex flex-col md:flex-row md:items-center",children:h.jsxs(Rje,{className:"relative block w-full border-2 border-dashed rounded-lg p-12 text-center",theme:{borderColor:i.$21,hoverBorderColor:i.$17},children:[h.jsx("input",{...u()}),h.jsx(LCe,{className:"mx-auto h-12 w-12 text-gray-400"}),h.jsx("span",{className:"mt-2 block text-sm font-medium",style:{color:i.$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 wee(){const n=Ml(),{isAdmin:e,isOwner:t}=go();return(i,r)=>{if(r)return!!(n&&i&&i.user_id===n.id)||e||t;const s=n&&i&&"assigned_user_id"in i&&i.assigned_user_id===n.id;return!!(n&&i&&(i.user_id===n.id||s||e||t))}}function Rgn({client:n,errors:e,setClient:t}){var _,v,b,y,C,S,k;const[i]=xe(),r=ySe(),s=wZ(),o=jo(),a=wee(),{data:l}=Eet({}),{data:c}=Zd(),{id:u}=Yl(),d=(I,L)=>{t(N=>N&&{...N,[I]:L})},f=(I,L)=>{var P;const N=pn.cloneDeep(n);I!=="currency_id"&&L===""?(P=N.settings)==null||delete P[I]:pn.set(N,`settings.${I}`,L),t(N)},[p,g]=x.useState([i("settings"),i("notes"),i("classify"),i("documents")]);x.useEffect(()=>{u||g(I=>I.filter(L=>L!==i("documents")))},[]);const m=()=>{ii(["clients"])};return h.jsx(er,{title:i("additional_info"),children:h.jsxs(Qb,{className:"px-5",tabs:p,formatTabLabel:I=>{if(I===3)return h.jsx(Ixe,{numberOfDocuments:n==null?void 0:n.documents.length})},children:[h.jsxs("div",{className:"-mx-5",children:[r.length>1&&h.jsx(ne,{leftSide:i("currency"),children:h.jsx(HO,{value:((_=n==null?void 0:n.settings)==null?void 0:_.currency_id)||"",onChange:I=>f("currency_id",I),errorMessage:e==null?void 0:e.errors["settings.currency_id"],dismissable:!0})}),s.length>1&&h.jsx(ne,{leftSide:i("language"),children:h.jsx(C9,{value:((v=n==null?void 0:n.settings)==null?void 0:v.language_id)||"",onChange:I=>f("language_id",I),errorMessage:e==null?void 0:e.errors["settings.language_id"],dismissable:!0})}),l&&h.jsx(ne,{leftSide:i("payment_terms"),children:h.jsx(Dn,{id:"settings.payment_terms",value:((b=n==null?void 0:n.settings)==null?void 0:b.payment_terms)||"",errorMessage:e==null?void 0:e.errors["settings.payment_terms"],onValueChange:I=>f("payment_terms",I),withBlank:!0,customSelector:!0,children:l.data.data.map((I,L)=>h.jsx("option",{value:I.num_days.toString(),children:I.name},L))})}),l&&h.jsx(ne,{leftSide:i("quote_valid_until"),children:h.jsx(Dn,{id:"settings.valid_until",value:((y=n==null?void 0:n.settings)==null?void 0:y.valid_until)||"",onValueChange:I=>f("valid_until",I),errorMessage:e==null?void 0:e.errors["settings.valid_until"],withBlank:!0,customSelector:!0,children:l.data.data.map((I,L)=>h.jsx("option",{value:I.num_days.toString(),children:I.name},L))})}),h.jsx(ne,{leftSide:i("task_rate"),children:h.jsx(Qs,{value:((C=n==null?void 0:n.settings)==null?void 0:C.default_task_rate)||"",onValueChange:I=>f("default_task_rate",parseFloat(I)),errorMessage:e==null?void 0:e.errors["settings.default_task_rate"]})}),h.jsx(ne,{leftSide:i("send_reminders"),children:h.jsxs(Dn,{id:"settings.send_reminders",value:((S=n==null?void 0:n.settings)==null?void 0:S.send_reminders)===!0?"enabled":((k=n==null?void 0:n.settings)==null?void 0:k.send_reminders)===!1?"disabled":"",onValueChange:I=>f("send_reminders",I==="enabled"?!0:I===""?"":!1),withBlank:!0,errorMessage:e==null?void 0:e.errors["settings.send_reminders"],customSelector:!0,children:[h.jsx("option",{value:"enabled",children:i("enabled")}),h.jsx("option",{value:"disabled",children:i("disabled")})]})})]}),h.jsxs("div",{className:"-mx-5",children:[h.jsx(ne,{leftSide:i("public_notes"),children:h.jsx(dh,{value:n==null?void 0:n.public_notes,onChange:I=>d("public_notes",I)})}),h.jsx(ne,{leftSide:i("private_notes"),children:h.jsx(dh,{value:n==null?void 0:n.private_notes,onChange:I=>d("private_notes",I)})})]}),h.jsxs("div",{className:"-mx-5",children:[c&&h.jsx(ne,{leftSide:i("size_id"),children:h.jsx(Dn,{id:"size_id",value:(n==null?void 0:n.size_id)||"",onValueChange:I=>d("size_id",I),errorMessage:e==null?void 0:e.errors.size_id,withBlank:!0,customSelector:!0,children:c==null?void 0:c.sizes.map((I,L)=>h.jsx("option",{value:I.id,children:I.name},L))})}),c&&h.jsx(ne,{leftSide:i("industry"),children:h.jsx(Dn,{id:"industry_id",value:(n==null?void 0:n.industry_id)||"",errorMessage:e==null?void 0:e.errors.industry_id,onValueChange:I=>d("industry_id",I),withBlank:!0,customSelector:!0,children:c==null?void 0:c.industries.map((I,L)=>h.jsx("option",{value:I.id,children:I.name},L))})})]}),u?h.jsx("div",{children:h.jsxs("div",{className:"px-6",children:[h.jsx(vEe,{widgetOnly:!0,endpoint:ze("/api/v1/clients/:id/upload",{id:u}),onSuccess:m}),h.jsx(Lnt,{documents:(n==null?void 0:n.documents)||[],onDocumentDelete:m,disableEditableOptions:!a(n,!0)&&!o("edit_client")})]})}):h.jsx(h.Fragment,{})]})})}function Ant({isModalOpen:n,setIsModalOpen:e,onClientCreated:t}){var v;const[i]=xe(),[r,s]=x.useState(),[o,a]=x.useState(),[l,c]=x.useState([{first_name:"",last_name:"",email:"",phone:"",send_email:!1}]),[u,d]=x.useState(!0),{data:f}=cgn({refetchOnWindowFocus:!1}),p=(b,y)=>{a(void 0),s(C=>C&&pn.set({...C},b,y))},g=(b,y)=>{a(void 0);const C=l.findIndex(S=>S.contact_key===l[0].contact_key);pn.set(l[C],y,b),c([...l])},m=b=>{d(!0),e(b),a(void 0),s(void 0),c(()=>[{first_name:"",last_name:"",email:"",phone:"",send_email:!1}])},_=()=>{if(pn.set(r,"contacts",l),pe.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")]}}),pe.error(),_;Je("POST",ze("/api/v1/clients"),r).then(b=>{pe.success("created_client"),t&&t(b.data.data),ii(["clients"]),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:ze("/api/v1/clients")}})),m(!1)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(a(b.response.data),pe.dismiss())})};return x.useEffect(()=>{f&&n&&s({...f})},[n]),h.jsx(pr,{title:i("new_client"),visible:n,onClose:()=>m(!1),size:u?"extraSmall":"large",renderTransitionChildAsFragment:!0,overflowVisible:!0,children:h.jsxs("div",{className:"flex flex-col space-y-7",children:[r?h.jsx(h.Fragment,{children:u?h.jsxs("div",{className:"flex flex-col space-y-3",children:[h.jsx(lt,{label:i("name"),value:(r==null?void 0:r.name)||"",onValueChange:b=>p("name",b),errorMessage:(o==null?void 0:o.errors.name)||(o==null?void 0:o.errors.id)}),h.jsx(lt,{label:`${i("contact")} ${i("first_name")}`,value:l[0].first_name,onValueChange:b=>g(b,"first_name"),errorMessage:o==null?void 0:o.errors.name}),h.jsx(lt,{label:`${i("contact")} ${i("last_name")}`,value:l[0].last_name,onValueChange:b=>g(b,"last_name"),errorMessage:o==null?void 0:o.errors.name}),h.jsx(lt,{label:`${i("contact")} ${i("email")}`,value:l[0].email,onValueChange:b=>g(b,"email"),errorMessage:o==null?void 0:o.errors["contacts.0.email"]}),h.jsx(lt,{label:`${i("contact")} ${i("phone")}`,value:l[0].phone,onValueChange:b=>g(b,"phone"),errorMessage:o==null?void 0:o.errors["contacts.0.phone"]}),h.jsx(HO,{label:i("currency"),value:((v=r==null?void 0:r.settings)==null?void 0:v.currency_id)||"",onChange:b=>{const y=pn.cloneDeep(r);pn.set(y,"settings.currency_id",b),s(y)},errorMessage:o==null?void 0:o.errors["settings.currency_id"],dismissable:!0})]}):h.jsxs("div",{className:"flex flex-col xl:flex-row xl:gap-4",children:[h.jsxs("div",{className:"w-full xl:w-1/2",children:[h.jsx(wgn,{client:r,setClient:s,setErrors:a,errors:o}),h.jsx("div",{className:"mt-5",children:h.jsx(fgn,{client:r,setClient:s,setErrors:a,errors:o})})]}),h.jsxs("div",{className:"w-full xl:w-1/2",children:[h.jsx(ggn,{contacts:l,setContacts:c,setErrors:a,errors:o}),h.jsx("div",{className:"mt-5",children:h.jsx(Rgn,{client:r,setClient:s,setErrors:a,errors:o})})]})]})}):h.jsx(yo,{}),h.jsxs("div",{className:$t("flex",{"justify-between":u,"justify-end space-x-5":!u}),children:[h.jsx(dn,{behavior:"button",type:"secondary",onClick:()=>d(b=>!b),children:i(u?"more_fields":"less_fields")}),h.jsx(dn,{behavior:"button",onClick:_,children:i("save")})]})]})})}function DA(n){var o;const[e]=xe(),[t,i]=x.useState(!1),r=jo(),{dropdownLabelFn:s}=n;return h.jsxs(h.Fragment,{children:[h.jsx(Ant,{isModalOpen:t,setIsModalOpen:i,onClientCreated:a=>n.onChange(a)}),h.jsx(qd,{inputOptions:{label:(o=n.inputLabel)==null?void 0:o.toString(),value:n.value||null},endpoint:ze("/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:s},onChange:a=>a.resource&&n.onChange(a.resource),staleTime:n.staleTime||1/0,sortBy:"display_name|asc",exclude:n.exclude,action:{label:e("new_client"),visible:!(n.withoutAction||!r("create_client")),onClick:()=>i(!0)},clearInputAfterSelection:n.clearInputAfterSelection},"client_selector"),h.jsx(Kl,{className:"mt-2",children:n.errorMessage})]})}const xee=Ls(void 0);function Pgn(n){const[e]=xe(),t=xt();Lo();const i=ji(xee),{schedule:r,handleChange:s,errors:o,page:a}=n,{data:l}=mEe({enabled:a==="edit"||!!i}),[c,u]=x.useState([]),d=p=>{const g={...r.parameters};g.clients=p.map(({id:m})=>m),s("parameters",g)},f=p=>{const g=c.filter((m,_)=>_!==p);d(g),u(g)};return x.useEffect(()=>{if((a==="edit"||i)&&l){const p=l==null?void 0:l.filter(g=>{var m;return(m=r.parameters.clients)==null?void 0:m.includes(g.id)});u(p)}},[l]),h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("date_range"),children:h.jsxs(Dn,{value:r.parameters.date_range,onValueChange:p=>s("parameters.date_range",p),errorMessage:o==null?void 0:o.errors["parameters.date_range"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"last7_days",children:e("last7_days")}),h.jsx("option",{value:"last30_days",children:e("last30_days")}),h.jsx("option",{value:"last365_days",children:e("last365_days")}),h.jsx("option",{value:"this_month",children:e("this_month")}),h.jsx("option",{value:"last_month",children:e("last_month")}),h.jsx("option",{value:"this_quarter",children:e("this_quarter")}),h.jsx("option",{value:"last_quarter",children:e("last_quarter")}),h.jsx("option",{value:"this_year",children:e("this_year")}),h.jsx("option",{value:"last_year",children:e("last_year")}),h.jsx("option",{value:"all_time",children:e("all_time")})]})}),h.jsx(ne,{leftSide:e("status"),children:h.jsxs(Dn,{value:r.parameters.status,onValueChange:p=>s("parameters.status",p),errorMessage:o==null?void 0:o.errors["parameters.status"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"all",children:e("all")}),h.jsx("option",{value:"paid",children:e("paid")}),h.jsx("option",{value:"unpaid",children:e("unpaid")})]})}),h.jsx(ne,{leftSide:e("show_aging_table"),children:h.jsx(jt,{checked:r.parameters.show_aging_table,onValueChange:p=>s("parameters.show_aging_table",p)})}),h.jsx(ne,{leftSide:e("show_payments_table"),children:h.jsx(jt,{checked:r.parameters.show_payments_table,onValueChange:p=>s("parameters.show_payments_table",p)})}),h.jsx(ne,{leftSide:e("show_credits_table"),children:h.jsx(jt,{checked:r.parameters.show_credits_table,onValueChange:p=>s("parameters.show_credits_table",p)})}),h.jsx(ne,{leftSide:e("only_clients_with_invoices"),children:h.jsx(jt,{checked:r.parameters.only_clients_with_invoices,onValueChange:p=>s("parameters.only_clients_with_invoices",p)})}),h.jsxs(ne,{leftSide:e("client"),children:[h.jsx(DA,{onChange:p=>{u(g=>{const m=[...g,p];return d(m),m})},withoutAction:!0,clearInputAfterSelection:!0,exclude:r.parameters.clients}),h.jsxs("div",{className:"flex justify-center",children:[h.jsx("div",{className:"flex flex-col space-y-2 pt-3",children:c==null?void 0:c.map((p,g)=>h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{children:p.display_name}),h.jsx("div",{className:"cursor-pointer ml-16",onClick:()=>f(g),children:h.jsx(c1,{color:t.$16,hoverColor:t.$3,borderColor:t.$5,hoverBorderColor:t.$17,size:"1.6rem"})})]},p.id))}),!(c!=null&&c.length)&&h.jsx("span",{className:"self-center text-xl mt-4",style:{color:t.$17},children:e("all_clients")})]})]})]})}function Ogn(n){const[e]=xe(),t=vf(),{schedule:i,handleChange:r,errors:s}=n,o=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 h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("type"),children:h.jsxs(Dn,{value:i.parameters.entity,onValueChange:a=>r("parameters.entity",a),errorMessage:s==null?void 0:s.errors["parameters.entity"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"invoice",defaultChecked:!0,children:e("invoice")}),h.jsx("option",{value:"quote",children:e("quote")}),h.jsx("option",{value:"credit",children:e("credit")}),h.jsx("option",{value:"purchase_order",children:e("purchase_order")})]})}),i.parameters.entity==="invoice"&&h.jsx(ne,{leftSide:e("invoice"),children:h.jsx(qd,{endpoint:ze("/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=>o(a),inputLabelFn:a=>a?o(a):""},onDismiss:()=>r("parameters.entity_id",""),errorMessage:s==null?void 0:s.errors["parameters.entity_id"]})}),i.parameters.entity==="quote"&&h.jsx(ne,{leftSide:e("quote"),children:h.jsx(qd,{endpoint:ze("/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=>o(a),inputLabelFn:a=>a?o(a):""},onDismiss:()=>r("parameters.entity_id",""),errorMessage:s==null?void 0:s.errors["parameters.entity_id"]})}),i.parameters.entity==="credit"&&h.jsx(ne,{leftSide:e("credit"),children:h.jsx(qd,{endpoint:ze("/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=>o(a),inputLabelFn:a=>a?o(a):""},onDismiss:()=>r("parameters.entity_id",""),errorMessage:s==null?void 0:s.errors["parameters.entity_id"]})}),i.parameters.entity==="purchase_order"&&h.jsx(ne,{leftSide:e("purchase_order"),children:h.jsx(qd,{endpoint:ze("/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:s==null?void 0:s.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 Mgn={email_statement:["template","next_run","frequency","remaining_cycles"],email_record:["template","next_run"],email_report:["template","next_run","frequency","remaining_cycles"],invoice_outstanding_tasks:["template","next_run"],payment_schedule:["template"]};function jgn(n){const{template:e}=n;return t=>Mgn[e].includes(t)}const Fgn=As.div` background-color: ${({theme:n})=>n.backgroundColor}; &:hover { background-color: ${({theme:n})=>n.hoverBackgroundColor}; } `;function Bgn(){return null}function $gn(n){const e=xt();return h.jsx(o1.ClearIndicator,{...n,className:"opacity-70 hover:opacity-100 transition-opacity duration-150 cursor-pointer",children:h.jsx("div",{className:"pr-5 pl-1.5",children:h.jsx(gA,{size:"0.9rem",color:e.$3})})})}function Hgn(n){const e=xt(),t=n.getValue(),i=n.selectProps,r=i.placeholder,s=t.length>0?t.map(d=>d.label).join(", "):"",o=i.menuIsOpen,a=i.isSearchable,l=i.withoutLabel,c=i.inputValue||"",u=i.onSearchTermChange;return h.jsx(o1.ValueContainer,{...n,children:h.jsxs("div",{className:"flex xl:space-x-1 cursor-pointer w-full",children:[r&&h.jsx("span",{className:"hidden xl:inline-block font-medium text-sm",style:{color:e.$17},children:l?`${_L("select")}:`:`${r}:`}),o&&a?h.jsx("div",{className:"flex-1 flex items-center",children:h.jsx("input",{type:"text",value:c,onChange:d=>u&&u(d.target.value),placeholder:_L("search"),className:"w-full text-sm border-0 focus:outline-none focus:ring-0 p-0",onClick:d=>d.stopPropagation(),onKeyDown:d=>{["Escape","Tab","Enter","ArrowUp","ArrowDown"].includes(d.key)&&d.stopPropagation()},autoFocus:!0,style:{backgroundColor:"transparent"}})}):h.jsx("div",{className:"truncate text-sm max-w-48 lg:max-w-20 xl:max-w-48",children:s})]})})}function Vgn(){const n=xt();return h.jsx("div",{className:$t("flex items-center justify-center hover:opacity-75 h-full w-full pr-2 cursor-pointer"),style:{color:n.$3},children:h.jsx($y,{color:n.$3,size:"1rem"})})}function Wgn(n){const e=xt(),t=x.useRef(null),i=n.selectProps,r=i.placeholder,s=i.withoutLabel,o=a=>{a.stopPropagation(),n.selectProps.menuIsOpen?n.selectProps.onMenuClose():n.selectProps.onMenuOpen()};return Uw(t,()=>{n.selectProps.onMenuClose()}),h.jsxs("div",{className:"relative",children:[r&&h.jsx("span",{className:"xl:hidden absolute left-3 px-1 text-xs font-medium z-10 rounded-sm truncate",style:{color:e.$17,backgroundColor:e.$1,top:"-0.475rem",maxWidth:"50%"},children:s?`${_L("select")}`:`${r}`}),h.jsx(o1.Control,{className:$t("shadow-sm",{"pt-1":r}),...n,children:h.jsx("div",{ref:t,className:"flex items-center w-full h-[2.2rem] cursor-pointer",onClick:o,children:n.children})})]})}function zgn(n){const{isSelected:e,label:t,data:i,innerProps:r}=n,s=xt();return h.jsxs(Fgn,{...r,className:"flex space-x-3 items-center w-full truncate px-[0.75rem] py-2 cursor-pointer rounded-[0.1875rem]",theme:{backgroundColor:s.$1,hoverBackgroundColor:s.$4},children:[h.jsx(Vd,{className:"rounded-md",checked:e}),h.jsx("span",{className:"text-sm",children:t})]})}function Ugn(n){return h.jsx(o1.Menu,{className:"p-1",...n,children:n.children})}function qgn(n){const e=xt();return h.jsx(o1.NoOptionsMessage,{...n,children:h.jsxs("div",{className:"p-3 text-sm text-center",style:{color:e.$3},children:[_L("no_records_found"),"."]})})}function Kgn(n){const{options:e,defaultValue:t,onChange:i,components:r,isSearchable:s,onInputChange:o,...a}=n,[l,c]=x.useState(""),u=()=>{i([])},d=m=>{i(m)},f=()=>{c(""),o==null||o(""),a.onMenuClose&&a.onMenuClose()},p=m=>{c(m),o==null||o(m)},g=(m,_)=>!_||!s?!0:m.label.toLowerCase().includes(_.toLowerCase());return h.jsx(qZ,{...a,options:e,value:a.value,defaultValue:t,onChange:d,components:{...r},className:"sm:w-auto w-full",onMenuClose:f,inputValue:l,onSearchTermChange:p,isSearchable:s,clearValues:u,withoutLabel:!a.placeholder,filterOption:g})}function A4(n){const e=xt(),{id:t,defaultValue:i,options:r,onValueChange:s,placeholder:o,onInputChange:a,isSearchable:l=!1,value:c}=n,u={MultiValueContainer:Bgn,ValueContainer:Hgn,DropdownIndicator:Vgn,Control:Wgn,ClearIndicator:$gn,Option:zgn,Menu:Ugn,NoOptionsMessage:qgn,Input:()=>null},d={control:f=>({...f,backgroundColor:e.$1,borderColor:e.$24,borderRadius:"0.375rem",padding:"0 6px"}),valueContainer:f=>({...f,padding:"0px 8px"}),placeholder:f=>({...f,color:"#6b7280"}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:f=>({...f,color:"#6b7280",padding:"0 8px"}),menu:f=>({...f,backgroundColor:e.$1,border:`1px solid ${e.$19}`,zIndex:10,width:"16rem",boxShadow:"none",padding:"0.25rem"}),option:f=>({...f,backgroundColor:"transparent",cursor:"pointer",padding:"0",margin:"0","&:hover":{backgroundColor:"transparent"},"&:active":{backgroundColor:"transparent"}}),clearIndicator:f=>({...f,padding:"0px",cursor:"pointer"})};return h.jsx(Kgn,{id:t,value:c,defaultValue:i,onChange:f=>s(f),components:u,placeholder:o,options:r,isMulti:!0,styles:d,onInputChange:a,hideSelectedOptions:!1,isSearchable:l})}function Nnt(n){const[e]=xe(),t=xt(),i=Vs(),{value:r,onValueChange:s,errorMessage:o}=n,a=x.useRef(void 0),[l,c]=x.useState(""),[u,d]=x.useState(!!r),[f,p]=x.useState(),{data:g,isLoading:m}=lr({queryKey:["/api/v1/products","perPage=500","status=active",l],queryFn:()=>Je("GET",ze("/api/v1/products?per_page=:perPage&include=&status=active&filter=:filter",{filter:l,perPage:500})).then(v=>v.data.data),enabled:!u,staleTime:1/0});x.useEffect(()=>{if(g&&!u){const v=r?r.split("',").map(S=>S.trim().replace(/'/g,"")).filter(Boolean):[],b=g.map(S=>({value:S.product_key,label:S.product_key,color:t.$3,backgroundColor:t.$1}));let y;if(f!==void 0&&f.length>0){const S=b.filter(k=>!f.some(I=>I.value===k.value));y=[...f,...S]}else y=b;const C=y.sort((S,k)=>{const I=v.indexOf(S.value),L=v.indexOf(k.value);return I!==-1&&L===-1?-1:L!==-1&&I===-1?1:I!==-1&&L!==-1?I-L:0});p(C)}},[g,u,r]),x.useEffect(()=>{r&&u&&(async()=>{var v;for(let b=0;b<r.split("',").length;b++){const y=((v=r.split("',")[b])==null?void 0:v.trim().replace(/'/g,""))||"",C=await i.fetchQuery(["/api/v1/products","perPage=500","status=active",y],()=>Je("GET",ze("/api/v1/products?per_page=:perPage&include=&status=active&filter=:filter",{filter:y,perPage:500})).then(S=>S.data.data),{staleTime:1/0});p(S=>{const k=S||[],I=k.find(({value:L})=>L===y)?[]:C.map(L=>({value:L.product_key,label:L.product_key,color:t.$3,backgroundColor:t.$1})).filter(L=>L.value===y);return I[0]?[...k,I[0]]:[...k]})}d(!1)})()},[r]);const _=v=>v.map(b=>`'${b.value}'`).join(",");return h.jsxs(h.Fragment,{children:[f&&!u?h.jsx(ne,{leftSide:e("products"),children:h.jsxs("div",{className:"flex space-x-3",children:[h.jsx("div",{className:"flex-1",children:h.jsx(A4,{id:"productItemSelector",...r&&{defaultValue:f==null?void 0:f.filter(v=>r.split("',").find(b=>b.trim().replace(/'/g,"")===v.value))},onValueChange:v=>s(_(v)),options:f,onInputChange:v=>{clearTimeout(a.current);const b=setTimeout(()=>c(v),600);a.current=b},isSearchable:!0})}),m&&h.jsx("div",{className:"flex justify-center items-center",children:h.jsx(yo,{})})]})}):h.jsx("div",{className:"flex justify-center items-center",children:h.jsx(yo,{})}),h.jsx(Kl,{className:"mt-2",children: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 Ggn(){const[n]=xe(),e=Um();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 Ygn(){const[n]=xe(),e=Um();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 us=(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.DEBIT="3",n.GOOGLE_WALLET="14",n.MONEY_ORDER="26",n.SWISH="24",n))(us||{});/** * 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 Qgn={[us.ACH]:"payment_type_ACH",[us.ACSS]:"payment_type_ACSS",[us.ALIPAY]:"payment_type_Alipay",[us.AMERICAN_EXPRESS]:"payment_type_American Express",[us.BANCONTACT]:"bancontact",[us.BACS]:"payment_type_BACS",[us.BECS]:"becs",[us.BANK_TRANSFER]:"payment_type_Bank Transfer",[us.CARTE_BLANCHE]:"payment_type_Carte Blanche",[us.CASH]:"payment_type_Cash",[us.CASH_APP]:"payment_type_Cash App",[us.CHECK]:"payment_type_Check",[us.CREDIT]:"payment_type_Credit",[us.CREDIT_CARD_OTHER]:"payment_type_Credit Card Other",[us.CRYPTO]:"payment_type_Crypto",[us.DINERS]:"payment_type_Diners Card",[us.DIRECT_DEBIT]:"payment_type_direct_debit",[us.DISCOVER]:"payment_type_Discover Card",[us.EPS]:"eps",[us.EUROCARD]:"payment_type_EuroCard",[us.FPX]:"fpx",[us.GIROPAY]:"giropay",[us.GOCARDLESS]:"payment_type_GoCardless",[us.HOSTED_PAGE]:"payment_type_Hosted Page",[us.IDEAL]:"ideal",[us.IZETTLE]:"payment_type_iZettle",[us.INSTANT_BANK_PAY]:"instant_bank_pay",[us.INTERAC]:"payment_type_Interac E-Transfer",[us.JCB]:"payment_type_JCB",[us.KBC]:"kbc_cbc",[us.KLARNA]:"payment_type_Klarna",[us.LASER]:"payment_type_Laser",[us.MAESTRO]:"payment_type_Maestro",[us.MASTERCARD]:"payment_type_MasterCard",[us.MOLLIE_BANK_TRANSFER]:"payment_type_Mollie Bank Transfer",[us.NOVA]:"payment_type_Nova",[us.PAYPAL]:"payment_type_PayPal",[us.PRZELEWY24]:"przelewy24",[us.SEPA]:"payment_type_SEPA",[us.SOFORT]:"payment_type_Sofort",[us.SOLO]:"payment_type_Solo",[us.SWITCH]:"payment_type_Switch",[us.UNIONPAY]:"payment_type_UnionPay",[us.VENMO]:"payment_type_Venmo",[us.VISA]:"payment_type_Visa Card",[us.ZELLE]:"payment_type_Zelle",[us.DEBIT]:"payment_type_Debit",[us.GOOGLE_WALLET]:"payment_type_Google Wallet",[us.MONEY_ORDER]:"payment_type_Money Order",[us.SWISH]:"payment_type_Swish"};function Dnt(n){const[e]=xe();return h.jsx("span",{className:$t({"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 Xgn=Ls(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 Zgn=Ls(void 0);function Jgn(n){const[e]=xe(),{invoice_id:t,should_be_invoiced:i,payment_date:r,payment_type_id:s,transaction_reference:o,archived_at:a,is_deleted:l}=n.entity,c=Um(),u=!!t,d=r||s||o;return l?h.jsx(as,{variant:"red",children:e("deleted")}):a?h.jsx(as,{variant:"orange",children:e("archived")}):u?h.jsx(as,{variant:"dark-blue",style:{backgroundColor:c.$3},children:e("invoiced")}):i?h.jsx(as,{variant:"light-blue",children:e("pending")}):d?h.jsx(as,{variant:"green",style:{backgroundColor:c.$1},children:e("paid")}):h.jsx(as,{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 Sg(n){const[e]=xe(),t=zi(),i=t==null?void 0:t.custom_fields,{entity:r}=n,s=[];if(i)for(let o=1;o<5;o++){const a=i[r+o.toString()]?Xq(i[r+o.toString()]).label():e(`custom${o.toString()}`);s.push(a)}return 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 s5r(n){const e=jo();return lr(Ut("/api/v1/expenses/create"),()=>Je("GET",ze("/api/v1/expenses/create")).then(t=>t.data.data),{enabled:e("create_expense")?n.enabled??!0:!1,staleTime:1/0})}function o5r(n){return lr(["/api/v1/expenses",n.id],()=>Je("GET",ze("/api/v1/expenses/:id?include=category",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function a5r(n){return lr(["/api/v1/expenses",n],()=>Je("GET",ze("/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})}const emn={bulk_update:"updated_records"};function Rnt(){const n=Vs(),e=ji(wu);return(t,i,r)=>(pe.processing(),Je("POST",ze("/api/v1/expenses/bulk"),{action:i,ids:t,...r}).then(()=>{const s=emn[i]||`${i}d_expense`;pe.success(s),e&&n.invalidateQueries([e]),ii(["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 tmn(n){const{includeIsLocked:e}=n,t=e?"&is_locked=true":"";return lr(["/api/v1/invoices",n.id],()=>Je("GET",ze(`/api/v1/invoices/:id?include=payments,client.group_settings&show_schedule=true${t}`,{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:!!n.id})}function bEe(n){const e=jo();return lr(["/api/v1/invoices/create"],()=>Je("GET",ze("/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 nmn={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 l5r(n){const e=Vs(),t=ji(wu);return(i,r,s)=>{pe.processing(),Je("POST",ze("/api/v1/invoices/bulk"),{action:r,ids:i,...s&&{email_type:s}}).then(()=>{var a;const o=nmn[r]||`${r}d_invoice`;pe.success(o),(a=n==null?void 0:n.onSuccess)==null||a.call(n),r!=="auto_bill"&&ii(["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 Gw=Ls(void 0),c5r=Ls(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 Uy=(n=>(n.Product="1",n.Task="2",n.UnpaidFee="3",n.PaidFee="4",n.LateFee="5",n.Expense="6",n))(Uy||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 Tk=()=>({_id:MJ(),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:Uy.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 Pnt(n){const e=Yi(),{data:t}=bEe(),i=ts(Gw),{onlyAddToInvoice:r}=n||{},s=(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,f;if(t){const p={...t};r||(p.date=(l=a[0])==null?void 0:l.date,p.client_id=(c=a[0])==null?void 0:c.client_id),p.uses_inclusive_taxes=(u=a[0])==null?void 0:u.uses_inclusive_taxes,p.project_id=(d=a[0])==null?void 0:d.project_id,p.vendor_id=(f=a[0])==null?void 0:f.vendor_id;const g=a.map(m=>{var _;return{...Tk(),type_id:Uy.Product,cost:(m==null?void 0:m.foreign_amount)>0?m.foreign_amount:m.amount,quantity:1,product_key:((_=m==null?void 0:m.category)==null?void 0:_.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:s(m,m.tax_amount1,m.tax_rate1),tax_name2:m.tax_name2,tax_rate2:s(m,m.tax_amount2,m.tax_rate2),tax_name3:m.tax_name3,tax_rate3:s(m,m.tax_amount3,m.tax_rate3),custom_value1:m.custom_value1,custom_value2:m.custom_value2,custom_value3:m.custom_value3,custom_value4:m.custom_value4}});r?i(m=>m&&{...m,line_items:[...m.line_items,...g]}):(i({...p,line_items:g}),e(Ut("/invoices/create?table=products&action=invoice_expense",{})))}},calculatedTaxRate: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 Yw(n){const{entity:e,editPageTabs:t}=n,i=gc(),s=Yl().id||"",o=i.pathname.startsWith(`/${e}s`),a=s&&i.pathname.includes(s),l=i.pathname.endsWith("/edit"),c=t==null?void 0:t.some(p=>i.pathname.endsWith(`/${p}`)),u=o&&a&&(c||l),d=o&&a&&!l&&!c;return{isEditPage:u,isShowPage:d,isEditOrShowPage:u||d}}const imn=As.div` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function rmn(n){const[e]=xe(),{expenses:t,bulkAction:i}=n,r=Yi(),s=vf(),o=jo(),a=wee(),{calculatedTaxRate:l}=Pnt(),c=xt(),u=Vs(),d=ts(Gw),[f,p]=x.useState([]),[g,m]=x.useState(!1),[_,v]=x.useState(!1),b=()=>{if(i&&ql(t).pluck("client_id").unique().toArray().length>1)return pe.error("multiple_client_error");v(!0)},y=C=>{d(()=>C&&{...C,line_items:[...C.line_items,...t.map(S=>{var k;return{...Tk(),type_id:Uy.Product,cost:S.amount,quantity:1,product_key:((k=S==null?void 0:S.category)==null?void 0:k.name)??"",notes:S.public_notes,line_total:Number((S.amount*1).toPrecision(2)),expense_id:S.id,tax_name1:S.tax_name1,tax_rate1:l(S,S.tax_amount1,S.tax_rate1),tax_name2:S.tax_name2,tax_rate2:l(S,S.tax_amount2,S.tax_rate2),tax_name3:S.tax_name3,tax_rate3:l(S,S.tax_amount3,S.tax_rate3),custom_value1:S.custom_value1,custom_value2:S.custom_value2,custom_value3:S.custom_value3,custom_value4:S.custom_value4}})]}),r(Ut("/invoices/:id/edit?action=invoice_expense",{id:C.id}))};return x.useEffect(()=>{var C;_&&(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 S;return Je("GET",ze("/api/v1/invoices?include=client.group_settings&status_id=1,2,3&is_deleted=true&filter_deleted_clients=true&client_id=:clientId",{clientId:((S=t[0])==null?void 0:S.client_id)||""}))},{staleTime:1/0}).then(S=>{o("edit_invoice")?p(S.data.data):p(S.data.data.filter(k=>a(k)))}).finally(()=>m(!1))),_||p([])},[_]),h.jsxs(h.Fragment,{children:[h.jsxs(pr,{title:e("action_add_to_invoice"),onClose:()=>v(!1),visible:_,children:[h.jsx("div",{className:"flex flex-col space-y-1",children:f.map(C=>{var S,k;return h.jsxs(imn,{theme:{hoverColor:c.$5},onClick:()=>y(C),className:"flex items-center justify-between cursor-pointer rounded py-1 px-2",children:[h.jsx("p",{children:C==null?void 0:C.number}),h.jsx("p",{children:s(C.amount,(S=C.client)==null?void 0:S.country_id,(k=C.client)==null?void 0:k.settings.currency_id)})]},C.id)})}),g&&h.jsx("div",{className:"flex justify-center",children:h.jsx(yo,{})}),!g&&!f.length&&h.jsx("div",{className:"flex justify-center font-medium text-lg",children:e("no_invoices_found")})]}),h.jsx($n,{onClick:b,icon:h.jsx(an,{element:hA}),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 smn(n){const{setErrors:e,isFormBusy:t,setIsFormBusy:i}=n;return r=>{t||(pe.processing(),e==null||e(void 0),i(!0),Je("PUT",ze("/api/v1/expenses/:id",{id:r.id}),r).then(()=>{pe.success("updated_expense"),ii(["expenses"])}).catch(s=>{var o;((o=s.response)==null?void 0:o.status)===422&&(e==null||e(s.response.data),pe.dismiss())}).finally(()=>i(!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 Ont({size:n="1.2rem",filledColor:e="#000",borderColor:t="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:n,height:n},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M9.00009 17C13.4184 17 17.0001 13.4183 17.0001 9C17.0001 4.58172 13.4184 1 9.00009 1C4.58181 1 1.00009 4.58172 1.00009 9C1.00009 13.4183 4.58181 17 9.00009 17Z",fill:t}),h.jsx("path",{d:"M9.00009 13C11.2092 13 13.0001 11.2091 13.0001 9C13.0001 6.79086 11.2092 5 9.00009 5C6.79095 5 5.00009 6.79086 5.00009 9C5.00009 11.2091 6.79095 13 9.00009 13Z",fill: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 Mnt({color:n="#000",size:e="1.2rem"}){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:h.jsx("path",{d:"M9,17c-4.411,0-8-3.589-8-8S4.589,1,9,1s8,3.589,8,8-3.589,8-8,8Zm0-14.5c-3.584,0-6.5,2.916-6.5,6.5s2.916,6.5,6.5,6.5,6.5-2.916,6.5-6.5-2.916-6.5-6.5-6.5Z",fill:n})})}const Pje=As.div` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function omn(n){var y,C,S,k,I,L;const[e]=xe(),t=xt(),i=jo(),r=g4(),{visible:s,isFormBusy:o,setIsFormBusy:a,expense:l,setVisible:c}=n,[u,d]=x.useState(!1),{data:f}=hEe({status:["active"]}),p=smn({isFormBusy:o,setIsFormBusy:a}),{red:g,green:m,blue:_,hex:v}=f4(((y=l.category)==null?void 0:y.color)||""),b=p4(g,m,_)?-220:220;return h.jsxs("div",{onClick:N=>N.stopPropagation(),children:[h.jsx(o9,{placement:"bottom",interactive:!0,render:()=>h.jsxs("div",{className:"border box rounded-md shadow-lg focus:outline-none p-1",style:{backgroundColor:t.$1,borderColor:t.$4,minWidth:"15rem",maxWidth:"20rem"},onClick:N=>N.stopPropagation(),children:[h.jsx("div",{className:"flex flex-col max-h-80 overflow-y-auto",children:f==null?void 0:f.map((N,P)=>h.jsxs(Pje,{className:"flex items-center p-2 space-x-2 rounded-sm cursor-pointer",onClick:()=>{c(!1),p({...l,category_id:N.id})},theme:{hoverColor:t.$7},children:[h.jsx("div",{children:N.id===l.category_id?h.jsx(Ont,{size:"1.2rem",filledColor:t.$1,borderColor:t.$3}):h.jsx(Mnt,{size:"1.2rem",color:t.$17})}),h.jsx("span",{className:"truncate",children:N.name})]},P))}),!(f!=null&&f.length)&&h.jsx("div",{className:"font-medium text-center py-2 text-xs",children:e("no_records_found")}),i("create_expense")&&h.jsx(Pje,{className:"flex items-center font-medium text-center p-2 rounded-sm cursor-pointer",onClick:()=>{d(!0),c(!1)},theme:{hoverColor:t.$7},children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(nc,{color:t.$17,size:"1.2rem"}),h.jsx("span",{children:e("create_new")})]})})]}),visible:s,children:h.jsxs("div",{className:"flex items-center cursor-pointer","data-cy":"expenseCategoryBadge",children:[h.jsx("div",{className:"text-xs rounded-l px-2 py-1 border-r border-white font-medium",style:{color:(C=l.category)!=null&&C.color?r(v,b):"#1f2937",backgroundColor:((S=l.category)==null?void 0:S.color)||"#f3f4f6"},children:((k=l.category)==null?void 0:k.name)||e("uncategorized")}),h.jsx("div",{className:"flex items-center justify-center rounded-r py-1 h-full",style:{backgroundColor:((I=l.category)==null?void 0:I.color)||"#f3f4f6",width:"1.5rem"},onClick:()=>!o&&c(N=>!N),children:h.jsx($y,{color:(L=l.category)!=null&&L.color?r(v,b):"#1f2937",size:"1rem"})})]})}),h.jsx(gnt,{visible:u,setVisible:d,onCreatedCategory:N=>p({...l,category_id:N.id})})]})}function amn(n){const e=x.useRef(null),{expense:t}=n,[i,r]=x.useState(!1),[s,o]=x.useState(!1);return Uw(e,()=>{i&&r(!1)}),h.jsx("div",{ref:e,children:h.jsx(omn,{visible:i,isFormBusy:s,setIsFormBusy:o,expense:t,setVisible:r})})}function yEe({apiEndpoint:n,entityId:e,cacheEndpoint:t,component:i,preCheck:r,componentCallbackFn:s}){const o=Ml(),a=Vs(),[l,c]=x.useState(r??!1),[u,d]=x.useState();return x.useEffect(()=>{o&&e&&!l&&(async()=>{const f=await a.fetchQuery([t,e],()=>Je("GET",ze(n,{id:e})).then(p=>p.data.data),{staleTime:1/0});f&&(f.user_id===o.id||f.assigned_user_id===o.id)&&(s&&d(f),c(!0))})()},[]),s&&l&&u?h.jsx(h.Fragment,{children:s(u)}):l?h.jsx(h.Fragment,{children:i}):h.jsx(h.Fragment,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ik(){const n=jo(),e=wee();return(t,i)=>!n(`view_${t}`)&&!n(`edit_${t}`)&&!e(i)}function eg(n){const e=Lo(),{renderSpan:t}=n;return t?h.jsx("span",{className:n.className,children:n.children}):h.jsx(r1,{className:`text-sm hover:underline ${n.className}`,style:{color:e},to:n.to,onClick:i=>i.stopPropagation(),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 RA(){const[n]=xe(),e=zi(),{dateFormat:t}=Zc(),i=e==null?void 0:e.custom_fields;return(r,s)=>{if(i&&i[r]){const o=i[r];if((o==null?void 0:o.split("|")[1])===bS.Date&&s)return so(s,t);if((o==null?void 0:o.split("|")[1])===bS.Switch)return s=="yes"||s=="true"||s=="1"?n("yes"):n("no")}return 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 lmn(){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}}function cmn(){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_rate1>0||n.tax_rate1<0)&&(e=e/(1+n.tax_rate1/100)),(n.tax_rate2>0||n.tax_rate2<0)&&(e=e/(1+n.tax_rate2/100)),(n.tax_rate3>0||n.tax_rate3<0)&&(e=e/(1+n.tax_rate3/100)),e}}/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:jnt,setPrototypeOf:Oje,isFrozen:umn,getPrototypeOf:dmn,getOwnPropertyDescriptor:hmn}=Object;let{freeze:rp,seal:tv,create:Fnt}=Object,{apply:zpe,construct:Upe}=typeof Reflect<"u"&&Reflect;rp||(rp=function(e){return e});tv||(tv=function(e){return e});zpe||(zpe=function(e,t,i){return e.apply(t,i)});Upe||(Upe=function(e,t){return new e(...t)});const LV=sp(Array.prototype.forEach),fmn=sp(Array.prototype.lastIndexOf),Mje=sp(Array.prototype.pop),Y5=sp(Array.prototype.push),pmn=sp(Array.prototype.splice),Hz=sp(String.prototype.toLowerCase),Ale=sp(String.prototype.toString),jje=sp(String.prototype.match),Q5=sp(String.prototype.replace),gmn=sp(String.prototype.indexOf),mmn=sp(String.prototype.trim),Uv=sp(Object.prototype.hasOwnProperty),Of=sp(RegExp.prototype.test),X5=_mn(TypeError);function sp(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 zpe(n,e,i)}}function _mn(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Upe(n,t)}}function So(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hz;Oje&&Oje(n,null);let i=e.length;for(;i--;){let r=e[i];if(typeof r=="string"){const s=t(r);s!==r&&(umn(e)||(e[i]=s),r=s)}n[r]=!0}return n}function vmn(n){for(let e=0;e<n.length;e++)Uv(n,e)||(n[e]=null);return n}function e2(n){const e=Fnt(null);for(const[t,i]of jnt(n))Uv(n,t)&&(Array.isArray(i)?e[t]=vmn(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=e2(i):e[t]=i);return e}function Z5(n,e){for(;n!==null;){const i=hmn(n,e);if(i){if(i.get)return sp(i.get);if(typeof i.value=="function")return sp(i.value)}n=dmn(n)}function t(){return null}return t}const Fje=rp(["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"]),Nle=rp(["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"]),Dle=rp(["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"]),bmn=rp(["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"]),Rle=rp(["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"]),ymn=rp(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Bje=rp(["#text"]),$je=rp(["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","popover","popovertarget","popovertargetaction","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"]),Ple=rp(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","slope","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","tablevalues","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"]),Hje=rp(["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"]),AV=rp(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Cmn=tv(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wmn=tv(/<%[\w\W]*|[\w\W]*%>/gm),xmn=tv(/\$\{[\w\W]*/gm),Smn=tv(/^data-[\-\w.\u00B7-\uFFFF]+$/),Emn=tv(/^aria-[\-\w]+$/),Bnt=tv(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kmn=tv(/^(?:\w+script|data):/i),Tmn=tv(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$nt=tv(/^html$/i),Imn=tv(/^[a-z][.\w]*(-[.\w]+)+$/i);var Vje=Object.freeze({__proto__:null,ARIA_ATTR:Emn,ATTR_WHITESPACE:Tmn,CUSTOM_ELEMENT:Imn,DATA_ATTR:Smn,DOCTYPE_NAME:$nt,ERB_EXPR:wmn,IS_ALLOWED_URI:Bnt,IS_SCRIPT_OR_DATA:kmn,MUSTACHE_EXPR:Cmn,TMPLIT_EXPR:xmn});const J5={element:1,text:3,progressingInstruction:7,comment:8,document:9},Lmn=function(){return typeof window>"u"?null:window},Amn=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 s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Wje=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Hnt(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lmn();const e=Dt=>Hnt(Dt);if(e.version="3.2.4",e.removed=[],!n||!n.document||n.document.nodeType!==J5.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const i=t,r=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=n,g=l.prototype,m=Z5(g,"cloneNode"),_=Z5(g,"remove"),v=Z5(g,"nextSibling"),b=Z5(g,"childNodes"),y=Z5(g,"parentNode");if(typeof o=="function"){const Dt=t.createElement("template");Dt.content&&Dt.content.ownerDocument&&(t=Dt.content.ownerDocument)}let C,S="";const{implementation:k,createNodeIterator:I,createDocumentFragment:L,getElementsByTagName:N}=t,{importNode:P}=i;let O=Wje();e.isSupported=typeof jnt=="function"&&typeof y=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:V,TMPLIT_EXPR:M,DATA_ATTR:B,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:G}=Vje;let{IS_ALLOWED_URI:H}=Vje,z=null;const Z=So({},[...Fje,...Nle,...Dle,...Rle,...Bje]);let X=null;const oe=So({},[...$je,...Ple,...Hje,...AV]);let fe=Object.seal(Fnt(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}})),Se=null,Me=null,Ie=!0,ge=!0,ye=!1,Pe=!0,Be=!1,$e=!0,qe=!1,mt=!1,vt=!1,ft=!1,tt=!1,St=!1,Ft=!0,en=!1;const Ke="user-content-";let dt=!0,nt=!1,at={},Oe=null;const ce=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 Ne=null;const Xe=So({},["audio","video","img","source","image","track"]);let it=null;const Tt=So({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ct="http://www.w3.org/1998/Math/MathML",Rt="http://www.w3.org/2000/svg",se="http://www.w3.org/1999/xhtml";let ke=se,Ae=!1,je=null;const Ve=So({},[Ct,Rt,se],Ale);let Qt=So({},["mi","mo","mn","ms","mtext"]),rt=So({},["annotation-xml"]);const Cn=So({},["title","style","font","a","script"]);let Rn=null;const li=["application/xhtml+xml","text/html"],Mi="text/html";let si=null,oi=null;const _n=t.createElement("form"),de=function(le){return le instanceof RegExp||le instanceof Function},_e=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(oi&&oi===le)){if((!le||typeof le!="object")&&(le={}),le=e2(le),Rn=li.indexOf(le.PARSER_MEDIA_TYPE)===-1?Mi:le.PARSER_MEDIA_TYPE,si=Rn==="application/xhtml+xml"?Ale:Hz,z=Uv(le,"ALLOWED_TAGS")?So({},le.ALLOWED_TAGS,si):Z,X=Uv(le,"ALLOWED_ATTR")?So({},le.ALLOWED_ATTR,si):oe,je=Uv(le,"ALLOWED_NAMESPACES")?So({},le.ALLOWED_NAMESPACES,Ale):Ve,it=Uv(le,"ADD_URI_SAFE_ATTR")?So(e2(Tt),le.ADD_URI_SAFE_ATTR,si):Tt,Ne=Uv(le,"ADD_DATA_URI_TAGS")?So(e2(Xe),le.ADD_DATA_URI_TAGS,si):Xe,Oe=Uv(le,"FORBID_CONTENTS")?So({},le.FORBID_CONTENTS,si):ce,Se=Uv(le,"FORBID_TAGS")?So({},le.FORBID_TAGS,si):{},Me=Uv(le,"FORBID_ATTR")?So({},le.FORBID_ATTR,si):{},at=Uv(le,"USE_PROFILES")?le.USE_PROFILES:!1,Ie=le.ALLOW_ARIA_ATTR!==!1,ge=le.ALLOW_DATA_ATTR!==!1,ye=le.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Be=le.SAFE_FOR_TEMPLATES||!1,$e=le.SAFE_FOR_XML!==!1,qe=le.WHOLE_DOCUMENT||!1,ft=le.RETURN_DOM||!1,tt=le.RETURN_DOM_FRAGMENT||!1,St=le.RETURN_TRUSTED_TYPE||!1,vt=le.FORCE_BODY||!1,Ft=le.SANITIZE_DOM!==!1,en=le.SANITIZE_NAMED_PROPS||!1,dt=le.KEEP_CONTENT!==!1,nt=le.IN_PLACE||!1,H=le.ALLOWED_URI_REGEXP||Bnt,ke=le.NAMESPACE||se,Qt=le.MATHML_TEXT_INTEGRATION_POINTS||Qt,rt=le.HTML_INTEGRATION_POINTS||rt,fe=le.CUSTOM_ELEMENT_HANDLING||{},le.CUSTOM_ELEMENT_HANDLING&&de(le.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(fe.tagNameCheck=le.CUSTOM_ELEMENT_HANDLING.tagNameCheck),le.CUSTOM_ELEMENT_HANDLING&&de(le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(fe.attributeNameCheck=le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),le.CUSTOM_ELEMENT_HANDLING&&typeof le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Be&&(ge=!1),tt&&(ft=!0),at&&(z=So({},Bje),X=[],at.html===!0&&(So(z,Fje),So(X,$je)),at.svg===!0&&(So(z,Nle),So(X,Ple),So(X,AV)),at.svgFilters===!0&&(So(z,Dle),So(X,Ple),So(X,AV)),at.mathMl===!0&&(So(z,Rle),So(X,Hje),So(X,AV))),le.ADD_TAGS&&(z===Z&&(z=e2(z)),So(z,le.ADD_TAGS,si)),le.ADD_ATTR&&(X===oe&&(X=e2(X)),So(X,le.ADD_ATTR,si)),le.ADD_URI_SAFE_ATTR&&So(it,le.ADD_URI_SAFE_ATTR,si),le.FORBID_CONTENTS&&(Oe===ce&&(Oe=e2(Oe)),So(Oe,le.FORBID_CONTENTS,si)),dt&&(z["#text"]=!0),qe&&So(z,["html","head","body"]),z.table&&(So(z,["tbody"]),delete Se.tbody),le.TRUSTED_TYPES_POLICY){if(typeof le.TRUSTED_TYPES_POLICY.createHTML!="function")throw X5('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw X5('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=le.TRUSTED_TYPES_POLICY,S=C.createHTML("")}else C===void 0&&(C=Amn(p,r)),C!==null&&typeof S=="string"&&(S=C.createHTML(""));rp&&rp(le),oi=le}},Le=So({},[...Nle,...Dle,...bmn]),Ge=So({},[...Rle,...ymn]),gt=function(le){let Qe=y(le);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:ke,tagName:"template"});const ht=Hz(le.tagName),Bt=Hz(Qe.tagName);return je[le.namespaceURI]?le.namespaceURI===Rt?Qe.namespaceURI===se?ht==="svg":Qe.namespaceURI===Ct?ht==="svg"&&(Bt==="annotation-xml"||Qt[Bt]):!!Le[ht]:le.namespaceURI===Ct?Qe.namespaceURI===se?ht==="math":Qe.namespaceURI===Rt?ht==="math"&&rt[Bt]:!!Ge[ht]:le.namespaceURI===se?Qe.namespaceURI===Rt&&!rt[Bt]||Qe.namespaceURI===Ct&&!Qt[Bt]?!1:!Ge[ht]&&(Cn[ht]||!Le[ht]):!!(Rn==="application/xhtml+xml"&&je[le.namespaceURI]):!1},pt=function(le){Y5(e.removed,{element:le});try{y(le).removeChild(le)}catch{_(le)}},Vt=function(le,Qe){try{Y5(e.removed,{attribute:Qe.getAttributeNode(le),from:Qe})}catch{Y5(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(le),le==="is")if(ft||tt)try{pt(Qe)}catch{}else try{Qe.setAttribute(le,"")}catch{}},Pn=function(le){let Qe=null,ht=null;if(vt)le="<remove></remove>"+le;else{const mn=jje(le,/^[\r\n\t ]+/);ht=mn&&mn[0]}Rn==="application/xhtml+xml"&&ke===se&&(le='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+le+"</body></html>");const Bt=C?C.createHTML(le):le;if(ke===se)try{Qe=new f().parseFromString(Bt,Rn)}catch{}if(!Qe||!Qe.documentElement){Qe=k.createDocument(ke,"template",null);try{Qe.documentElement.innerHTML=Ae?S:Bt}catch{}}const An=Qe.body||Qe.documentElement;return le&&ht&&An.insertBefore(t.createTextNode(ht),An.childNodes[0]||null),ke===se?N.call(Qe,qe?"html":"body")[0]:qe?Qe.documentElement:An},Ln=function(le){return I.call(le.ownerDocument||le,le,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},bi=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")},et=function(le){return typeof a=="function"&&le instanceof a};function Lt(Dt,le,Qe){LV(Dt,ht=>{ht.call(e,le,Qe,oi)})}const qt=function(le){let Qe=null;if(Lt(O.beforeSanitizeElements,le,null),bi(le))return pt(le),!0;const ht=si(le.nodeName);if(Lt(O.uponSanitizeElement,le,{tagName:ht,allowedTags:z}),le.hasChildNodes()&&!et(le.firstElementChild)&&Of(/<[/\w]/g,le.innerHTML)&&Of(/<[/\w]/g,le.textContent)||le.nodeType===J5.progressingInstruction||$e&&le.nodeType===J5.comment&&Of(/<[/\w]/g,le.data))return pt(le),!0;if(!z[ht]||Se[ht]){if(!Se[ht]&&ln(ht)&&(fe.tagNameCheck instanceof RegExp&&Of(fe.tagNameCheck,ht)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ht)))return!1;if(dt&&!Oe[ht]){const Bt=y(le)||le.parentNode,An=b(le)||le.childNodes;if(An&&Bt){const mn=An.length;for(let hi=mn-1;hi>=0;--hi){const Di=m(An[hi],!0);Di.__removalCount=(le.__removalCount||0)+1,Bt.insertBefore(Di,v(le))}}}return pt(le),!0}return le instanceof l&&!gt(le)||(ht==="noscript"||ht==="noembed"||ht==="noframes")&&Of(/<\/no(script|embed|frames)/i,le.innerHTML)?(pt(le),!0):(Be&&le.nodeType===J5.text&&(Qe=le.textContent,LV([F,V,M],Bt=>{Qe=Q5(Qe,Bt," ")}),le.textContent!==Qe&&(Y5(e.removed,{element:le.cloneNode()}),le.textContent=Qe)),Lt(O.afterSanitizeElements,le,null),!1)},sn=function(le,Qe,ht){if(Ft&&(Qe==="id"||Qe==="name")&&(ht in t||ht in _n))return!1;if(!(ge&&!Me[Qe]&&Of(B,Qe))){if(!(Ie&&Of(W,Qe))){if(!X[Qe]||Me[Qe]){if(!(ln(le)&&(fe.tagNameCheck instanceof RegExp&&Of(fe.tagNameCheck,le)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(le))&&(fe.attributeNameCheck instanceof RegExp&&Of(fe.attributeNameCheck,Qe)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(Qe))||Qe==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&Of(fe.tagNameCheck,ht)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ht))))return!1}else if(!it[Qe]){if(!Of(H,Q5(ht,U,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&le!=="script"&&gmn(ht,"data:")===0&&Ne[le])){if(!(ye&&!Of(q,Q5(ht,U,"")))){if(ht)return!1}}}}}}return!0},ln=function(le){return le!=="annotation-xml"&&jje(le,G)},ti=function(le){Lt(O.beforeSanitizeAttributes,le,null);const{attributes:Qe}=le;if(!Qe||bi(le))return;const ht={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Bt=Qe.length;for(;Bt--;){const An=Qe[Bt],{name:mn,namespaceURI:hi,value:Di}=An,cr=si(mn);let Li=mn==="value"?Di:mmn(Di);if(ht.attrName=cr,ht.attrValue=Li,ht.keepAttr=!0,ht.forceKeepAttr=void 0,Lt(O.uponSanitizeAttribute,le,ht),Li=ht.attrValue,en&&(cr==="id"||cr==="name")&&(Vt(mn,le),Li=Ke+Li),$e&&Of(/((--!?|])>)|<\/(style|title)/i,Li)){Vt(mn,le);continue}if(ht.forceKeepAttr||(Vt(mn,le),!ht.keepAttr))continue;if(!Pe&&Of(/\/>/i,Li)){Vt(mn,le);continue}Be&&LV([F,V,M],rr=>{Li=Q5(Li,rr," ")});const Sr=si(le.nodeName);if(sn(Sr,cr,Li)){if(C&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!hi)switch(p.getAttributeType(Sr,cr)){case"TrustedHTML":{Li=C.createHTML(Li);break}case"TrustedScriptURL":{Li=C.createScriptURL(Li);break}}try{hi?le.setAttributeNS(hi,mn,Li):le.setAttribute(mn,Li),bi(le)?pt(le):Mje(e.removed)}catch{}}}Lt(O.afterSanitizeAttributes,le,null)},di=function Dt(le){let Qe=null;const ht=Ln(le);for(Lt(O.beforeSanitizeShadowDOM,le,null);Qe=ht.nextNode();)Lt(O.uponSanitizeShadowNode,Qe,null),qt(Qe),ti(Qe),Qe.content instanceof s&&Dt(Qe.content);Lt(O.afterSanitizeShadowDOM,le,null)};return e.sanitize=function(Dt){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,ht=null,Bt=null,An=null;if(Ae=!Dt,Ae&&(Dt="<!-->"),typeof Dt!="string"&&!et(Dt))if(typeof Dt.toString=="function"){if(Dt=Dt.toString(),typeof Dt!="string")throw X5("dirty is not a string, aborting")}else throw X5("toString is not a function");if(!e.isSupported)return Dt;if(mt||_e(le),e.removed=[],typeof Dt=="string"&&(nt=!1),nt){if(Dt.nodeName){const Di=si(Dt.nodeName);if(!z[Di]||Se[Di])throw X5("root node is forbidden and cannot be sanitized in-place")}}else if(Dt instanceof a)Qe=Pn("<!---->"),ht=Qe.ownerDocument.importNode(Dt,!0),ht.nodeType===J5.element&&ht.nodeName==="BODY"||ht.nodeName==="HTML"?Qe=ht:Qe.appendChild(ht);else{if(!ft&&!Be&&!qe&&Dt.indexOf("<")===-1)return C&&St?C.createHTML(Dt):Dt;if(Qe=Pn(Dt),!Qe)return ft?null:St?S:""}Qe&&vt&&pt(Qe.firstChild);const mn=Ln(nt?Dt:Qe);for(;Bt=mn.nextNode();)qt(Bt),ti(Bt),Bt.content instanceof s&&di(Bt.content);if(nt)return Dt;if(ft){if(tt)for(An=L.call(Qe.ownerDocument);Qe.firstChild;)An.appendChild(Qe.firstChild);else An=Qe;return(X.shadowroot||X.shadowrootmode)&&(An=P.call(i,An,!0)),An}let hi=qe?Qe.outerHTML:Qe.innerHTML;return qe&&z["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Of($nt,Qe.ownerDocument.doctype.name)&&(hi="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`> `+hi),Be&&LV([F,V,M],Di=>{hi=Q5(hi,Di," ")}),C&&St?C.createHTML(hi):hi},e.setConfig=function(){let Dt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_e(Dt),mt=!0},e.clearConfig=function(){oi=null,mt=!1},e.isValidAttribute=function(Dt,le,Qe){oi||_e({});const ht=si(Dt),Bt=si(le);return sn(ht,Bt,Qe)},e.addHook=function(Dt,le){typeof le=="function"&&Y5(O[Dt],le)},e.removeHook=function(Dt,le){if(le!==void 0){const Qe=fmn(O[Dt],le);return Qe===-1?void 0:pmn(O[Dt],Qe,1)[0]}return Mje(O[Dt])},e.removeHooks=function(Dt){O[Dt]=[]},e.removeAllHooks=function(){O=Wje()},e}var Nmn=Hnt();/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Mb(n){return new DOMParser().parseFromString(n,"text/html").documentElement.textContent||""}function gu(n){return Nmn.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 L9(){const n=Sk(),e=zi();return t=>{const i=n(e==null?void 0:e.settings.currency_id);return i?CSe.formatValue(isNaN(Number(t))?0:t,i):t}}function u5r(){const[n]=xe(),e=jo(),t=Yi(),i=Rnt(),r=ts(Zgn),s=ts(Xgn),{isEditPage:o}=Yw({entity:"expense",editPageTabs:["documents"]}),{create:a}=Pnt(),l=d=>{r({...d,id:"",documents:[],number:"",invoice_id:"",date:Jn().format("YYYY-MM-DD")}),t("/expenses/create?action=clone")},c=d=>{s({...d,id:"",documents:[],number:"",date:Jn().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")&&h.jsx($n,{onClick:()=>a([d]),icon:h.jsx(an,{element:hA}),children:n("invoice_expense")}),d=>d.should_be_invoiced===!0&&d.invoice_id.length===0&&h.jsx(rmn,{expenses:[d]}),d=>e("create_expense")&&h.jsx($n,{onClick:()=>l(d),icon:h.jsx(an,{element:Pb}),children:n("clone")}),d=>e("create_recurring_expense")&&h.jsx($n,{onClick:()=>c(d),icon:h.jsx(an,{element:Pb}),children:n("clone_to_recurring")}),()=>o&&h.jsx(Ki,{withoutPadding:!0}),d=>hs(d)===Vr.Active&&o&&h.jsx($n,{onClick:()=>i([d.id],"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),d=>(hs(d)===Vr.Archived||hs(d)===Vr.Deleted)&&o&&h.jsx($n,{onClick:()=>i([d.id],"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),d=>(hs(d)===Vr.Active||hs(d)===Vr.Archived)&&o&&h.jsx($n,{onClick:()=>i([d.id],"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}const Dmn=["status","number","client","vendor","date","amount","public_notes"];function Rmn(){const[n,e,t,i]=Sg({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","project","should_be_invoiced","tax_name1","tax_name2","tax_name3","tax_rate1","tax_rate2","tax_rate3","transaction_reference","updated_at"]}function d5r(){var v;const{t:n}=xe(),{dateFormat:e}=Zc(),t=L9(),i=jo(),r=Ik(),s=Yi(),o=vf(),a=Qo(),l=RA(),c=lmn(),u=cmn();Rmn();const[d,f,p,g]=Sg({entity:"expense"}),m=[{column:"category",id:"category_id",label:n("category"),format:(b,y)=>y&&h.jsx(amn,{expense:y})},{column:"status",id:"id",label:n("status"),format:(b,y)=>h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(eg,{to:Ut("/expenses/:id/edit",{id:y.id}),renderSpan:r("expense",y),children:h.jsx("span",{className:"inline-flex items-center space-x-4",children:h.jsx(Jgn,{entity:y})})}),y.invoice_id&&h.jsx(yEe,{entityId:y.invoice_id,cacheEndpoint:"/api/v1/invoices",apiEndpoint:"/api/v1/invoices/:id?include=client.group_settings",preCheck:i("view_invoice")||i("edit_invoice"),component:h.jsx(an,{element:hA,size:19,onClick:()=>s(Ut("/invoices/:id/edit",{id:y.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(b,y)=>h.jsx(eg,{to:Ut("/expenses/:id/edit",{id:y.id}),renderSpan:r("expense",y),children:b})},{column:"vendor",id:"vendor_id",label:n("vendor"),format:(b,y)=>y.vendor&&h.jsx(eg,{to:Ut("/vendors/:id",{id:b.toString()}),renderSpan:r("vendor",y.vendor),children:y.vendor.name})},{column:"client",id:"client_id",label:n("client"),format:(b,y)=>y.client&&h.jsx(eg,{to:Ut("/clients/:id",{id:b.toString()}),renderSpan:r("client",y.client),children:y.client.display_name})},{column:"date",id:"date",label:n("date"),format:b=>so(b,e)},{column:"amount",id:"amount",label:n("amount"),format:(b,y)=>{var C,S;return o(c(y),(C=y.client)==null?void 0:C.country_id,y.currency_id||((S=y.client)==null?void 0:S.settings.currency_id))}},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:b=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(a!=null&&a.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(b)}})}),children:h.jsx("span",{children:Mb(gu(b)).slice(0,50)})})},{column:"entity_state",id:"id",label:n("entity_state"),format:(b,y)=>h.jsx(ev,{entity:y})},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:b=>so(b,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:b=>so(b,e)},{column:d,id:"custom_value1",label:d,format:b=>l("expense1",b==null?void 0:b.toString())},{column:f,id:"custom_value2",label:f,format:b=>l("expense2",b==null?void 0:b.toString())},{column:p,id:"custom_value3",label:p,format:b=>l("expense3",b==null?void 0:b.toString())},{column:g,id:"custom_value4",label:g,format:b=>l("expense4",b==null?void 0:b.toString())},{column:"documents",id:"documents",label:n("documents"),format:(b,y)=>y.documents.length},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:b=>t(b)},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(b,y)=>y.is_deleted?n("yes"):n("no")},{column:"net_amount",id:"amount",label:n("net_amount"),format:(b,y)=>{var C,S;return o(u(y),(C=y.client)==null?void 0:C.country_id,y.currency_id||((S=y.client)==null?void 0:S.settings.currency_id))}},{column:"payment_date",id:"payment_date",label:n("payment_date"),format:b=>so(b,e)},{column:"payment_type",id:"payment_type_id",label:n("payment_type"),format:b=>h.jsx(Dnt,{for:Qgn,code:b,headless:!0})},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:b=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(a!=null&&a.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(b)}})}),children:h.jsx("span",{children:Mb(gu(b)).slice(0,50)})})},{column:"should_be_invoiced",id:"should_be_invoiced",label:n("should_be_invoiced"),format:(b,y)=>y.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:b=>t(b)},{column:"tax_rate2",id:"tax_rate2",label:n("tax_rate2"),format:b=>t(b)},{column:"tax_rate3",id:"tax_rate3",label:n("tax_rate3"),format:b=>t(b)},{column:"transaction_reference",id:"transaction_reference",label:n("transaction_reference")},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:b=>so(b,e)},{column:"project",id:"project",label:n("project"),format:(b,y)=>{var C,S;return h.jsx(Ji,{to:Ut("/projects/:id",{id:(C=y==null?void 0:y.project)==null?void 0:C.id}),children:(S=y==null?void 0:y.project)==null?void 0:S.name})}}],_=((v=a==null?void 0:a.react_table_columns)==null?void 0:v.expense)||Dmn;return m.filter(b=>_.includes(b.column)).sort((b,y)=>_.indexOf(b.column)-_.indexOf(y.column))}function h5r(n){const{setExpense:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(s=>s&&{...s,[i]:r})}}function Pmn(){const[n]=xe(),e=Um(),t=g4(),{data:i}=hEe({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(s=>{const{red:o,green:a,blue:l,hex:c}=f4(s.color||""),u=p4(o,a,l)?-220:220;r.push({value:s.id,label:s.name,color:t(c,u),backgroundColor:s.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 OS=(n=>(n.Viewed="-1",n.Draft="1",n.Sent="2",n.Accepted="3",n.Received="4",n.Cancelled="5",n))(OS||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Omn(n){return(e,t)=>{if(e.invitations.length!==0){if(t)return ze("/api/v1/:resource/:id/delivery_note",{resource:`${n.resourceType}s`,id:e.id});if(e.invitations.length>0&&n.resourceType==="purchase_order")return ze("/vendor/purchase_order/:invitation/download",{resource:n.resourceType,invitation:e.invitations[0].key});if(e.invitations.length>0)return ze("/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 Vnt(n){const e=Vs(),t=Omn({resourceType:n.resource});return(i,r)=>{const s=t(i,r);s&&(pe.processing(),e.fetchQuery(s,()=>Je("GET",s,{},{responseType:"arraybuffer"}).then(o=>{const a=new Blob([o.data],{type:"application/pdf"}),l=URL.createObjectURL(a),[,c]=o.headers["content-disposition"].split("filename="),u=document.createElement("a");u.download=c,u.href=l,u.target="_blank",document.body.appendChild(u),u.click(),document.body.removeChild(u),pe.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 See=Ls(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 Mmn(n){if(n.invitations.length>0){const e=n.client?n.client:"";return`${n.invitations[0].link}?silent=true${e?`&client_hash=${e.client_hash}`:""}`}return null}function Wnt(n){var t;const e=Mmn(n);e&&((t=window.open(e,"_blank"))==null||t.focus())}function jmn(n){const[e]=xe(),{status_id:t,archived_at:i,is_deleted:r,invitations:s}=n.entity,o=Um(),a=()=>s.some(p=>p.viewed_date),l=t===OS.Draft,c=!l,u=a(),d=t===OS.Cancelled,f=t===OS.Accepted;return r?h.jsx(as,{variant:"red",children:e("deleted")}):i?h.jsx(as,{variant:"orange",children:e("archived")}):d?h.jsx(as,{variant:"black",style:{backgroundColor:o.$5},children:e("cancelled")}):t===OS.Received?h.jsx(as,{variant:"green",style:{backgroundColor:o.$3},children:e("received")}):f?h.jsx(as,{variant:"dark-blue",style:{backgroundColor:o.$2},children:e("accepted")}):c?h.jsx(as,{variant:"light-blue",style:{backgroundColor:o.$1},children:e("sent")}):l?h.jsx(as,{variant:"generic",children:e("draft")}):u&&!d&&!f?h.jsx(as,{variant:"yellow",style:{backgroundColor:o.$4},children:e("viewed")}):h.jsx(h.Fragment,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function znt(){const{isAdmin:n,isOwner:e}=go();return lr(["/api/v1/task_schedulers","create"],()=>Je("GET",ze("/api/v1/task_schedulers/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}function Fmn(n){const{isAdmin:e,isOwner:t}=go();return lr(["/api/v1/task_schedulers",n.id],()=>Je("GET",ze("/api/v1/task_schedulers/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function Bmn(){return(n,e)=>{pe.processing(),Je("POST",ze("/api/v1/task_schedulers/bulk"),{action:e,ids:n}).then(()=>{pe.success(`${e}d_schedule`),ii(["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 q8={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:[],pdf_email_attachment:!1,auto_send:!1,include_project_tasks:!1};function Unt(n){const{data:e}=znt();return(t,i)=>{const{setErrors:r,setSchedule:s}=n;r(void 0);const o=pn.cloneDeep(n.schedule);t==="template"&&e?s(()=>({...e,template:i,frequency_id:Qh.Monthly,remaining_cycles:-1,parameters:{...q8}})):t==="parameters.report_name"&&e?s(a=>a&&{...a,parameters:{...q8,report_name:i}}):(t==="parameters.entity"&&s(pn.set(o,"parameters.entity_id","")),s(pn.set(o,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 qnt({entity:n}){const e=Yi(),t=ts(xee);return i=>{t({...q8,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 Knt=({entity:n})=>{const e=Vs(),t=i=>new Promise(r=>{const s=()=>{i.removeEventListener("load",s),r()};document.body.appendChild(i),i.addEventListener("load",s)});return i=>{i.length&&(pe.processing(),e.fetchQuery([`/api/v1/${n}s/bulk`],()=>Je("POST",ze(`/api/v1/${n}s/bulk`),{action:"bulk_print",ids:i},{responseType:"arraybuffer"}).then(async r=>{const s=new Blob([r.data],{type:"application/pdf"}),o=URL.createObjectURL(s),a=document.createElement("iframe");a.style.display="none",a.src=o,await t(a),a&&a.contentWindow&&(a.contentWindow.focus(),a.contentWindow.print()),pe.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 $mn={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 Gnt(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 Ynt(n){const{property:e}=Gnt(n);return $mn[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 A9(){const n=Vs();return{find:t=>n.fetchQuery({queryKey:["/api/v1/clients",t],queryFn:()=>Je("GET",ze("/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 Hmn(n){const e=zi(),t=Sk(),i=A9(),r=n.resource;return async(s,o,a)=>{const l={...r.line_items[s]};if(l.product_key=(a==null?void 0:a.product_key)||o,!a)return n.onChange(s,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 f=t(d),p=t(e.settings.currency_id);f&&p&&(l.cost=c*(f.exchange_rate/p.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(s,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 Qnt(){const n=Vs();return{find:t=>n.fetchQuery(["/api/v1/vendors",t],()=>Je("GET",ze("/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 Xnt(){const n=Zd();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 Vmn(){const n=Zd();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 Wmn(n){const e=zi(),t=Xnt(),i=Vmn(),r=Qnt(),s=A9(),[o,a]=x.useState(""),[l,c]=x.useState(""),{resource:u,relationType:d}=n,[f,p]=x.useState(),[g,m]=x.useState(),[_,v]=x.useState();return x.useEffect(()=>{o&&d==="client_id"&&s.find(o).then(b=>v(b)),l&&d==="vendor_id"&&r.find(l).then(b=>v(b))},[o,l]),x.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]),x.useEffect(()=>{if(d==="client_id"){const b=_;t.find((b==null?void 0:b.settings.currency_id)||(e==null?void 0:e.settings.currency_id)).then(y=>m(y)),i.find((b==null?void 0:b.country_id)||(e==null?void 0:e.settings.country_id)).then(y=>p(y))}if(d==="vendor_id"){const b=_;t.find((b==null?void 0:b.currency_id)||(e==null?void 0:e.settings.currency_id)).then(y=>m(y)),i.find((b==null?void 0:b.country_id)||(e==null?void 0:e.settings.country_id)).then(y=>p(y))}},[_]),b=>g&&f?CSe.formatMoney(isNaN(Number(b))?0:b,g,f):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 CEe(n){const e=zi(),t=A9(),i=Qnt(),r=Xnt(),s=xk();return async(o,a)=>{var c;let l;return o.length>=1&&a==="client_id"?await t.find(o).then(async u=>{var d;await r.find(u.settings.currency_id||((d=e.settings)==null?void 0:d.currency_id)).then(f=>{const p=s(e.settings.country_id),g={thousandSeparator:(p==null?void 0:p.thousand_separator)||(f==null?void 0:f.thousand_separator)||",",decimalSeparator:(p==null?void 0:p.decimal_separator)||(f==null?void 0:f.decimal_separator)||".",precision:(f==null?void 0:f.precision)||2};n?n(g):l=g})}):o.length>=1&&a==="vendor_id"?await i.find(o).then(async u=>{var d;await r.find(u.currency_id||((d=e.settings)==null?void 0:d.currency_id)).then(f=>{const p=s(e.settings.country_id),g={thousandSeparator:(p==null?void 0:p.thousand_separator)||(f==null?void 0:f.thousand_separator)||",",decimalSeparator:(p==null?void 0:p.decimal_separator)||(f==null?void 0:f.decimal_separator)||".",precision:(f==null?void 0:f.precision)||2};n?n(g):l=g})}):await r.find((c=e.settings)==null?void 0:c.currency_id).then(u=>{const d=s(e.settings.country_id),f={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(f):l=f}),l}}function zmn(n){var s,o;const[e,t]=x.useState(),[i]=xe(),r=fd({initialValues:{name:"",rate:""},onSubmit:a=>{t(void 0),Je("POST",ze("/api/v1/tax_rates"),a).then(l=>{pe.success("created_tax_rate"),n.onClose(!1),ii(["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),pe.dismiss())}).finally(()=>r.setSubmitting(!1))}});return h.jsxs(pr,{title:i("create_tax_rate"),visible:n.isVisible,onClose:n.onClose,children:[h.jsx(lt,{type:"text",id:"name",label:i("name"),errorMessage:(s=e==null?void 0:e.errors)==null?void 0:s.name,onChange:r.handleChange,required:!0}),h.jsx(lt,{type:"text",id:"rate",label:i("tax_rate"),errorMessage:(o=e==null?void 0:e.errors)==null?void 0:o.rate,onChange:r.handleChange,required:!0}),h.jsx(dn,{behavior:"button",type:"primary",onClick:()=>{r.submitForm()},children:i("save")})]})}function lw(n){const[e]=xe(),[t,i]=x.useState(!1),{isAdmin:r,isOwner:s}=go(),{resourceTaxName:o,resourceTaxRate:a}=n;return h.jsxs(h.Fragment,{children:[h.jsx(qd,{inputOptions:{value:n.defaultValue??null},endpoint:ze("/api/v1/tax_rates?status=active"),onChange:l=>n.onChange&&n.onChange(l),action:{label:e("create_tax_rate"),onClick:()=>i(!0),visible:r||s},entryOptions:{id:"id",value:"name",label:"name",customValue:l=>`${l.name}||${l.rate}`,inputLabelFn:l=>l?o===l.name?`${l.name} ${a}%`:`${l.name} ${l.rate}%`:"",dropdownLabelFn:l=>o===l.name?`${l.name} ${a}%`:`${l.name} ${l.rate}%`},sortBy:"name|asc",onDismiss:n.onClearButtonClick,compareOnlyByValue:!0}),h.jsx(zmn,{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 Umn=Ls(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 N9(){const n=Qo();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 qmn=n=>{const{onlyAddToInvoice:e}=n||{},t=Yi(),i=zi(),r=N9(),{data:s}=bEe(),o=ts(Gw);return a=>{if(s){const l=a.map(c=>({...Tk(),type_id:Uy.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?o(c=>c&&{...c,line_items:[...c.line_items,...l]}):(o({...s,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 Kmn(n){const e=jo();return lr(["/api/v1/purchase_orders","create"],()=>Je("GET",ze("/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 f5r(n){return lr(["/api/v1/purchase_orders",n.id],()=>Je("GET",ze("/api/v1/purchase_orders/:id?include=vendor",{id:n.id})).then(e=>e.data.data),{staleTime:1/0})}const Gmn={expense:"converted_to_expense",email:"emailed_purchase_orders",mark_sent:"marked_purchase_orders_as_sent",add_to_inventory:"added_purchase_orders_to_inventory"};function Ymn(){const n=Vs(),e=ji(wu);return(t,i)=>{pe.processing(),Je("POST",ze("/api/v1/purchase_orders/bulk"),{action:i,ids:t}).then(()=>{const r=Gmn[i]||`${i}d_purchase_order`;pe.success(r),ii(["purchase_orders"]),i==="expense"&&ii(["expenses"]),e&&n.invalidateQueries([e])})}}function Qmn(){const n=Vs(),e=ji(wu);return t=>{pe.processing(),Je("PUT",ze("/api/v1/purchase_orders/:id?mark_sent=true",{id:t.id}),t).then(()=>{pe.success("marked_purchase_order_as_sent"),ii(["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 Xmn=()=>{const n=Yi(),e=zi(),t=N9(),{data:i}=Kmn(),r=ts(See);return s=>{if(i){const o=s.map(a=>({...Tk(),type_id:Uy.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:o}),n("/purchase_orders/create?action=purchase_order_product")}}},Zmn=["product_key","description","price","quantity"];function Jmn(){const[n,e,t,i]=Sg({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 p5r(){var p;const{t:n}=xe();Jmn();const{dateFormat:e}=Zc(),t=vf(),i=L9(),r=Qo(),s=Ik(),o=RA(),[a,l,c,u]=Sg({entity:"product"}),d=[{column:"product_key",id:"product_key",label:n("product"),format:(g,m)=>h.jsxs("span",{className:"inline-flex items-center space-x-4",children:[h.jsx(ev,{entity:m}),h.jsx(eg,{to:Ut("/products/:id/edit",{id:m.id}),renderSpan:s("product",m),children:g})]})},{column:"description",id:"notes",label:n("notes"),format:g=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(r!=null&&r.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(g)}})}),children:h.jsx("span",{children:Mb(gu(g)).slice(0,50)})})},{column:"price",id:"price",label:n("price"),format:(g,m)=>{var _,v;return t(g,(_=m.company)==null?void 0:_.settings.country_id,(v=m.company)==null?void 0:v.settings.currency_id)}},{column:"quantity",id:"quantity",label:n("default_quantity"),format:g=>i(g)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:g=>so(g,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:g=>so(g,e)},{column:a,id:"custom_value1",label:a,format:g=>o("product1",g==null?void 0:g.toString())},{column:l,id:"custom_value2",label:l,format:g=>o("product2",g==null?void 0:g.toString())},{column:c,id:"custom_value3",label:c,format:g=>o("product3",g==null?void 0:g.toString())},{column:u,id:"custom_value4",label:u,format:g=>o("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)=>h.jsx(ev,{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=>so(g,e)}],f=((p=r==null?void 0:r.react_table_columns)==null?void 0:p.product)||Zmn;return d.filter(g=>f.includes(g.column)).sort((g,m)=>f.indexOf(g.column)-f.indexOf(m.column))}function g5r(){const[n]=xe(),e=Yi(),t=jo(),i=ts(Umn),r=qmn(),s=Xmn(),{isEditPage:o}=Yw({entity:"product",editPageTabs:["documents","product_fields"]}),a=u=>{i({...u,id:"",documents:[]}),e("/products/create?action=clone")},l=(u,d)=>{pe.processing(),tgn([d],u).then(()=>{pe.success(`${u}d_product`),ii(["products"])})};return[u=>!u.is_deleted&&t("create_invoice")&&h.jsx($n,{onClick:()=>r([u]),icon:h.jsx(an,{element:mb}),children:n("new_invoice")}),u=>!u.is_deleted&&t("create_purchase_order")&&h.jsx($n,{onClick:()=>s([u]),icon:h.jsx(an,{element:mb}),children:n("new_purchase_order")}),u=>!u.is_deleted&&t("create_product")&&h.jsx($n,{onClick:()=>a(u),icon:h.jsx(an,{element:Pb}),children:n("clone")}),()=>o&&h.jsx(Ki,{withoutPadding:!0}),u=>hs(u)===Vr.Active&&o&&h.jsx($n,{onClick:()=>l("archive",u.id),icon:h.jsx(an,{element:yu}),children:n("archive")}),u=>(hs(u)===Vr.Archived||hs(u)===Vr.Deleted)&&o&&h.jsx($n,{onClick:()=>l("restore",u.id),icon:h.jsx(an,{element:bu}),children:n("restore")}),u=>(hs(u)===Vr.Active||hs(u)===Vr.Archived)&&o&&h.jsx($n,{onClick:()=>l("delete",u.id),icon:h.jsx(an,{element:fc}),children:n("delete")})]}function e_n(n){const{setErrors:e,setProduct:t}=n;return(i,r)=>{e(void 0),t(s=>s&&{...s,[i]:r})}}function wEe(){const[n]=xe();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 t_n({value:n,label:e,onChange:t}){const i=wEe();return h.jsx(fnt,{inputOptions:{value:n,label:e},entries:i,entryOptions:{id:"id",value:"id",label:"label"},onChange:t,onEmptyValues:()=>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 rE(n,e){if(!e)return"";const t=e.replace("name","rate");return n&&n[t]!==void 0?`${n[e]}||${n[t]}`:""}function n_n(n){var c,u,d,f;const[e]=xe(),[,t]=qB(),i=zi(),r=wEe(),{errors:s,handleChange:o,type:a,product:l}=n;return h.jsxs(h.Fragment,{children:[a==="edit"&&h.jsx(ne,{leftSide:e("status"),children:h.jsx(ev,{entity:l})}),h.jsx(ne,{leftSide:e("item"),required:!0,children:h.jsx(lt,{required:!0,value:l.product_key,onValueChange:p=>o("product_key",p),errorMessage:s==null?void 0:s.errors.product_key})}),h.jsx(ne,{leftSide:e("description"),children:h.jsx(lt,{element:"textarea",value:l.notes,onValueChange:p=>o("notes",p),errorMessage:s==null?void 0:s.errors.notes})}),h.jsx(ne,{leftSide:e("price"),children:h.jsx(Qs,{value:l.price||"",onValueChange:p=>o("price",parseFloat(p)),errorMessage:s==null?void 0:s.errors.price})}),(i==null?void 0:i.enable_product_cost)&&h.jsx(ne,{leftSide:e("cost"),children:h.jsx(Qs,{value:l.cost||"",onValueChange:p=>o("cost",parseFloat(p)),errorMessage:s==null?void 0:s.errors.cost})}),(i==null?void 0:i.enable_product_quantity)&&h.jsx(ne,{leftSide:e("default_quantity"),children:h.jsx(Qs,{value:l.quantity||"",onValueChange:p=>o("quantity",parseFloat(p)),errorMessage:s==null?void 0:s.errors.quantity})}),h.jsx(ne,{leftSide:e("max_quantity"),children:h.jsx(Qs,{value:l.max_quantity||"",onValueChange:p=>o("max_quantity",parseFloat(p)),errorMessage:s==null?void 0:s.errors.max_quantity})}),h.jsxs(ne,{leftSide:e("tax_category"),children:[h.jsx(Dn,{value:l.tax_id,onValueChange:p=>o("tax_id",p),customSelector:!0,dismissable:!1,children:r.map((p,g)=>h.jsx("option",{value:p.value,children:p.label},g))}),h.jsx(Kl,{className:"mt-2",children:s==null?void 0:s.errors.tax_id})]}),h.jsx(ne,{leftSide:e("image_url"),children:h.jsx(lt,{value:l.product_image,onValueChange:p=>o("product_image",p),errorMessage:s==null?void 0:s.errors.product_image})}),(i==null?void 0:i.track_inventory)&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("stock_quantity"),children:h.jsx(Qs,{value:l.in_stock_quantity||"",onValueChange:p=>{o("in_stock_quantity",Number(p)),a==="edit"&&t(g=>({...g,update_in_stock_quantity:"true"}))},errorMessage:s==null?void 0:s.errors.in_stock_quantity})}),h.jsx(ne,{leftSide:e("stock_notifications"),children:h.jsx(jt,{checked:l.stock_notification,onValueChange:p=>o("stock_notification",p)})}),h.jsx(ne,{leftSide:e("notification_threshold"),children:h.jsx(Qs,{value:l.stock_notification_threshold||"",onValueChange:p=>o("stock_notification_threshold",parseFloat(p)),errorMessage:s==null?void 0:s.errors.stock_notification_threshold})})]}),i&&i.enabled_item_tax_rates>0&&h.jsx(ne,{leftSide:e("tax"),children:h.jsx(lw,{onChange:p=>{var g,m;o("tax_rate1",(g=p.resource)==null?void 0:g.rate),o("tax_name1",(m=p.resource)==null?void 0:m.name)},defaultValue:rE(l,"tax_name1"),onClearButtonClick:()=>{o("tax_rate1",0),o("tax_name1","")},onTaxCreated:p=>{o("tax_rate1",p.rate),o("tax_name1",p.name)}})}),i&&i.enabled_item_tax_rates>1&&h.jsx(ne,{leftSide:e("tax"),children:h.jsx(lw,{onChange:p=>{var g,m;o("tax_rate2",(g=p.resource)==null?void 0:g.rate),o("tax_name2",(m=p.resource)==null?void 0:m.name)},defaultValue:rE(l,"tax_name2"),onClearButtonClick:()=>{o("tax_rate2",0),o("tax_name2","")},onTaxCreated:p=>{o("tax_rate2",p.rate),o("tax_name2",p.name)}})}),i&&i.enabled_item_tax_rates>2&&h.jsx(ne,{leftSide:e("tax"),children:h.jsx(lw,{onChange:p=>{var g,m;o("tax_rate3",(g=p.resource)==null?void 0:g.rate),o("tax_name3",(m=p.resource)==null?void 0:m.name)},defaultValue:rE(l,"tax_name3"),onClearButtonClick:()=>{o("tax_rate3",0),o("tax_name3","")},onTaxCreated:p=>{o("tax_rate3",p.rate),o("tax_name3",p.name)}})}),((c=i==null?void 0:i.custom_fields)==null?void 0:c.product1)&&h.jsx(qo,{field:"custom_value1",defaultValue:l.custom_value1,value:i.custom_fields.product1,onValueChange:p=>o("custom_value1",p)}),((u=i==null?void 0:i.custom_fields)==null?void 0:u.product2)&&h.jsx(qo,{field:"custom_value2",defaultValue:l.custom_value2,value:i.custom_fields.product2,onValueChange:p=>o("custom_value2",p)}),((d=i==null?void 0:i.custom_fields)==null?void 0:d.product3)&&h.jsx(qo,{field:"custom_value3",defaultValue:l.custom_value3,value:i.custom_fields.product3,onValueChange:p=>o("custom_value3",p)}),((f=i==null?void 0:i.custom_fields)==null?void 0:f.product4)&&h.jsx(qo,{field:"custom_value4",defaultValue:l.custom_value4,value:i.custom_fields.product4,onValueChange:p=>o("custom_value4",p)})]})}function i_n(n){const[e]=xe(),{data:t}=egn(),[i,r]=x.useState(),[s,o]=x.useState(!1),[a,l]=x.useState(),c=e_n({setErrors:r,setProduct:l}),u=()=>{s||(o(!0),Je("POST",ze("/api/v1/products"),a).then(d=>{pe.success("created_product"),ii(["products"]),setTimeout(()=>{var f;(f=n.onProductCreated)==null||f.call(n,d.data.data)},200),n.setIsModalOpen(!1)}).catch(d=>{var f;((f=d.response)==null?void 0:f.status)===422&&(r(d.response.data),pe.dismiss())}).finally(()=>o(!1)))};return x.useEffect(()=>{t&&l(t)},[t]),h.jsxs(pr,{title:e("new_product"),visible:n.isModalOpen,onClose:n.setIsModalOpen,backgroundColor:"gray",size:"small",children:[a&&h.jsx(n_n,{product:a,errors:i,handleChange:c}),h.jsx(dn,{type:"primary",behavior:"button",onClick:u,children:e("save")})]})}function r_n(n){const[e]=xe(),[t,i]=x.useState(!1),r=xt(),s=zi(),o=jo();return h.jsxs(h.Fragment,{children:[h.jsx(i_n,{setIsModalOpen:i,isModalOpen:t,onProductCreated:n.onProductCreated}),h.jsx(qd,{endpoint:ze("/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:a=>h.jsxs("div",{className:"flex flex-col flex-1 max-w-[33rem]",children:[h.jsxs("div",{className:"flex space-x-1",children:[h.jsx("p",{className:"font-medium truncate",children:a.product_key}),(s==null?void 0:s.track_inventory)&&n.displayStockQuantity&&h.jsxs("p",{className:$t({"text-red-700":a.in_stock_quantity<=0}),children:["(",Ua("stock_quantity_number",{quantity:a.in_stock_quantity}),")"]})]}),h.jsx("p",{className:"text-xs font-medium truncate",style:{color:r.$22},children:a.notes})]})},onChange:a=>n.onChange&&n.onChange(a),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,withShadow:n.withShadow},"product_selector"),h.jsx(Kl,{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 s_n(n){const e=n.resource,t=ts(Lk);return(i,r,s)=>{t(!1);const o={...e.line_items[r]};return o[i]=(s==null?void 0:s.rate)??0,o[i.replace("rate","name")]=(s==null?void 0:s.name)||"",n.onChange(r,o)}}function o_n(n){return Ui({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)}const a_n=["discount","cost","unit_cost","quantity","rate","hours"],l_n=["tax_rate1","tax_rate2","tax_rate3"],c_n={decimalSeparator:".",precision:2,thousandSeparator:","},Vz=n=>!Object.keys(n).some(t=>t!=="_id"&&t!=="type_id"&&t!=="is_amount_discount"&&n[t]);function u_n(n){const e=gc(),t=zi(),i=Qo(),{resource:r}=n,[s,o]=x.useState(),[a,l]=oo(Lk),c=y=>y.filter((S,k)=>k!==y.length-1).some(S=>Vz(S));x.useCallback(y=>{let C=Uy.Product;n.type==="task"&&(C=Uy.Task);const S=y.filter(({type_id:L})=>L===C),k=S.length,I=S[k-1];if(k>0&&(!c(S)&&!Vz(I)&&n.createItem(),c(S)&&Vz(I))){const L=y.indexOf(S[k-1]);L>-1&&n.deleteLineItem(L)}},[n.resource.line_items]);const u=Hmn({relationType:n.relationType,resource:n.resource,type:n.type,onChange:n.onLineItemChange}),d=s_n({resource:n.resource,type:n.type,onChange:n.onLineItemChange}),f=async(y,C,S)=>{l(!1),await n.onLineItemPropertyChange(y,C,S)},p=async(y,C,S)=>{var I,L,N;l(!1);const k=pn.cloneDeep(S);S&&t&&t.enabled_item_tax_rates===0&&(k.tax_name1="",k.tax_rate1=0,k.tax_name2="",k.tax_rate2=0,k.tax_name3="",k.tax_rate3=0),S&&t&&t.enabled_item_tax_rates===1&&((I=t.settings)!=null&&I.tax_name1&&!S.tax_name1&&!Number(t.enabled_tax_rates)&&(k.tax_name1=t.settings.tax_name1,k.tax_rate1=t.settings.tax_rate1),k.tax_name2="",k.tax_rate2=0,k.tax_name3="",k.tax_rate3=0),S&&t&&t.enabled_item_tax_rates===2&&((L=t.settings)!=null&&L.tax_name2&&!S.tax_name2&&!Number(t.enabled_tax_rates)&&(k.tax_name2=t.settings.tax_name2,k.tax_rate2=t.settings.tax_rate2),k.tax_name3="",k.tax_rate3=0),S&&t&&t.enabled_item_tax_rates===3&&(N=t.settings)!=null&&N.tax_name3&&!S.tax_name3&&!Number(t.enabled_tax_rates)&&(k.tax_name3=t.settings.tax_name3,k.tax_rate3=t.settings.tax_rate3),await u(y,C,k)},g=Wmn({resource:n.resource,relationType:n.relationType}),m=CEe(o);x.useEffect(()=>{r[n.relationType]?m(r[n.relationType],n.relationType):o(c_n)},[r==null?void 0:r[n.relationType]]),x.useEffect(()=>{},[r==null?void 0:r.line_items,a]);const _=wEe(),{preferences:v}=qw(),b=(y,C)=>{if(t.calculate_taxes){const S=r==null?void 0:r.line_items[C];return S.tax_id==="7"||S.tax_id===""?h.jsxs(L8,{children:[h.jsx(lw,{onChange:I=>I.resource&&d(y,C,I.resource),onTaxCreated:I=>d(y,C,I),defaultValue:rE(r==null?void 0:r.line_items[C],y.replace("rate","name")),onClearButtonClick:()=>d(y,C)},`${y}${r==null?void 0:r.line_items[C][y]}`),y==="tax_rate1"?h.jsx("button",{type:"button",onClick:()=>f("tax_id","1",C),children:h.jsx(o_n,{})}):null]}):ql(_).pluck("value").filter(I=>I!=="7").toArray().includes(S.tax_id)&&y==="tax_rate1"?h.jsx(L8,{children:h.jsx(t_n,{value:S.tax_id,onChange:I=>f("tax_id",I.value,C)})}):null}return h.jsx(lw,{onChange:S=>S.resource&&d(y,C,S.resource),onTaxCreated:S=>d(y,C,S),defaultValue:rE(r==null?void 0:r.line_items[C],y.replace("rate","name")),onClearButtonClick:()=>d(y,C)},`${y}${r==null?void 0:r.line_items[C][y]}`)};return(y,C)=>{var k,I,L,N;const S=Ynt(y);if(S==="product_key")return h.jsx(r_n,{onChange:P=>p(C,P.label,P.resource),className:"w-auto",defaultValue:r==null?void 0:r.line_items[C][S],onProductCreated:P=>P&&p(C,P.product_key,P),clearButton:!0,onInputValueChange:P=>f("product_key",P,C),onClearButtonClick:()=>u(C,"",null),displayStockQuantity:e.pathname.startsWith("/invoices")},`${S}${r==null?void 0:r.line_items[C][S]}`);if(S==="notes")return h.jsx(lt,{id:S,element:"textarea",value:r==null?void 0:r.line_items[C][S],onChange:P=>f(S,P.target.value,C),style:{marginTop:"4px"},textareaRows:v.auto_expand_product_table_notes?1:3},`${S}${C}`);if(a_n.includes(S))return s&&h.jsx(Qs,{precision:S==="quantity"?6:i!=null&&i.number_precision&&(i==null?void 0:i.number_precision)>0&&(i==null?void 0:i.number_precision)<=100?i.number_precision:(s==null?void 0:s.precision)||2,id:S,value:(r==null?void 0:r.line_items[C][S])||"",className:"auto",onValueChange:P=>{f(S,isNaN(parseFloat(P))?0:parseFloat(P),C)}});if(S==="gross_line_total"||S==="tax_amount")return g((r==null?void 0:r.line_items[C][S])??0);if(l_n.includes(S))return b(S,C);if(["line_total"].includes(S))return g(r==null?void 0:r.line_items[C][S]);if(["product1","product2","product3","product4"].includes(S)){const P=S.replace("product","custom_value");return(k=t.custom_fields)!=null&&k[S]?h.jsx(qo,{field:S,defaultValue:r==null?void 0:r.line_items[C][P],value:(I=t.custom_fields)==null?void 0:I[S],onValueChange:O=>f(P,O,C),fieldOnly:!0,selectMenuPosition:"fixed"}):h.jsx(lt,{id:S,value:r==null?void 0:r.line_items[C][S],onChange:O=>f(S,O.target.value,C)})}if(["task1","task2","task3","task4"].includes(S)){const P=S.replace("task","custom_value");return(L=t.custom_fields)!=null&&L[S]?h.jsx(qo,{field:S,defaultValue:r==null?void 0:r.line_items[C][P],value:(N=t.custom_fields)==null?void 0:N[S],onValueChange:O=>f(P,O,C),fieldOnly:!0,selectMenuPosition:"fixed"}):h.jsx(lt,{id:S,value:r==null?void 0:r.line_items[C][S],onChange:O=>f(S,O.target.value,C)})}return h.jsx(lt,{id:S,value:r==null?void 0:r.line_items[C][S],onChange:P=>f(S,P.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 d_n(n){const[e]=xe(),t=zi(),{type:i}=n||{},r=i==="product"||!i?["product1","product2","product3","product4"]:["task1","task2","task3","task4"],s={"$product.tax_rate1":e("tax_rate1"),"$product.tax_rate2":e("tax_rate2"),"$product.tax_rate3":e("tax_rate3")};return(o,a=".")=>{var c;if(Object.prototype.hasOwnProperty.call(s,o))return s[o];const{property:l}=Gnt(o,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||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 h_n(n){const e=n.resource;return t=>{var r,s;if(t.source.index===((r=t.destination)==null?void 0:r.index))return;const i=e?VSe(e.line_items,t.source.index,(s=t.destination)==null?void 0:s.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 f_n(n){const e=Ynt(n);return{product_key:"15%",notes:"30%",cost:"10%",quantity:"10%",line_total:"5%",discount:"10%",tax_rate1:"12%",tax_rate2:"12%",tax_rate3:"12%",tax_amount:"5%",gross_line_total:"10%",product1:"10%",product2:"10%",product3:"10%",product4:"10%",task1:"10%",task2:"10%",task3:"10%",task4:"10%"}[e]||""}const Lk=Ls(void 0);function m5r(n){const[e]=xe(),t=xt(),i=KKe(),{resource:r,items:s,columns:o,relationType:a}=n,l=ts(Lk),c=d_n({type:n.type}),u=u_n({type:n.type,resource:n.resource,onLineItemChange:n.onLineItemChange,onLineItemPropertyChange:n.onLineItemPropertyChange,relationType:a,createItem:n.onCreateItemClick,deleteLineItem:n.onDeleteRowClick}),d=h_n({resource:n.resource,onSort:n.onSort}),f=()=>s.some(g=>Vz(g)),p=g=>r.line_items.indexOf(g);return h.jsxs(h1,{children:[h.jsx(p1,{backgroundColor:i.$5,children:o.map((g,m)=>h.jsx(_a,{textColor:i.$6,children:c(g)},m))}),h.jsx(lee,{onDragEnd:d,children:h.jsx(uee,{droppableId:"product-table",children:g=>h.jsxs(f1,{...g.droppableProps,innerRef:g.innerRef,children:[s.map((m,_)=>h.jsx(cee,{draggableId:p(m).toString(),index:p(m),children:v=>h.jsx(hc,{innerRef:v.innerRef,tabIndex:_+1,...v.draggableProps,children:o.map((b,y,{length:C})=>h.jsxs(bs,{width:f_n(b),children:[C-1!==y&&h.jsxs("div",{className:$t({"flex justify-between items-center space-x-3":y===0}),children:[y===0?h.jsx("button",{...v.dragHandleProps,onMouseEnter:S=>S.currentTarget.focus(),children:h.jsx(CCe,{size:18})}):null,u(b,p(m))]}),C-1===y&&h.jsxs("div",{className:"flex justify-between items-center",children:[u(b,p(m)),r&&h.jsx("button",{style:{color:t.$3},className:"ml-2 text-gray-600 hover:text-red-600",onClick:()=>{l(!0),n.onDeleteRowClick(p(m))},children:h.jsx(jCe,{size:18})})]})]},y))},p(m))},p(m))),g.placeholder,h.jsx(hc,{className:"bg-slate-100 hover:bg-slate-200",children:h.jsx(bs,{colSpan:100,children:h.jsxs("button",{onClick:()=>!f()&&n.onCreateItemClick(),className:"w-full py-2 inline-flex justify-center items-center space-x-2",children:[h.jsx(PCe,{size:18}),h.jsx("span",{children:n.type==="product"?e("add_item"):e("add_line")})]})})})]})})})]})}function F_(n){const{onClick:e,icon:t,label:i}=n;return h.jsxs(dn,{behavior:"button",type:"secondary",className:"w-3/4",onClick:e,children:[h.jsx(an,{element:t,style:{width:"1.1rem",height:"1.1rem"}}),h.jsx("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 */function p_n(n){const e=Ml(),{commonActionsSection:t,entity:i}=n,{isEditPage:r}=Yw({entity:i});return s=>{var a,l,c;if(!r)return!0;const o=(a=e==null?void 0:e.company_user)==null?void 0:a.react_settings.common_actions;return!t&&!(o!=null&&o[i])||!t&&(o!=null&&o[i])&&!((l=o[i])!=null&&l.includes(s))?!0:o!=null&&o[i]&&t?(c=o[i])==null?void 0:c.includes(s):!1}}function Is(n){const e=xt(),t=Yi(),i=Vw({disablePrevention:n.disablePreventNavigation}),{isCommonActionSection:r,onClick:s,to:o,icon:a,tooltipText:l,entity:c,actionKey:u,excludePreferences:d,setVisible:f}=n;return!p_n({commonActionsSection:r,entity:c})(u)&&!d?h.jsx(h.Fragment,{}):r?h.jsx(Ah,{width:"auto",placement:"bottom",message:l,withoutArrow:!0,children:h.jsx("div",{onClick:()=>i({fn:()=>o?t(o):s==null?void 0:s()}),children:h.jsx(an,{element:a,size:23.5,color:e.$3})})}):h.jsx($n,{to:o,icon:h.jsx(an,{element:n.icon}),onClick:s,setVisible:f,disablePreventNavigation:n.disablePreventNavigation,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 xEe=Ls(void 0),_5r=Ls(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 Eee=Ls(void 0),g_n=Ls(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 kee=Ls(void 0),m_n=Ls(void 0);function __n(n){const[e]=xe(),t=Yi(),{purchaseOrder:i,dropdown:r}=n,s=jo(),o=ts(Eee),a=ts(xEe),l=ts(Gw),c=ts(kee),u=Nr(),[d,f]=x.useState(!1),p=()=>{l({...i,id:"",number:"",documents:[],due_date:"",partial_due_date:"",date:Jn().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:u.settings.invoice_design_id}),t("/invoices/create?action=clone")},g=()=>{o({...i,id:"",number:"",documents:[],date:Jn().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:u.settings.quote_design_id}),t("/quotes/create?action=clone")},m=()=>{c({...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:u.settings.invoice_design_id}),t("/recurring_invoices/create?action=clone")},_=()=>{a({...i,id:"",number:"",documents:[],date:Jn().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:u.settings.credit_design_id}),t("/credits/create?action=clone")};return h.jsxs(h.Fragment,{children:[(s("create_invoice")||s("create_quote")||s("create_recurring_invoice")||s("create_credit"))&&h.jsx(Is,{entity:"purchase_order",actionKey:"clone_to_other",isCommonActionSection:!r,tooltipText:e("clone_to_other"),onClick:()=>f(!0),icon:Pb,children:e("clone_to_other")}),h.jsx(pr,{title:e("clone_to"),visible:d,onClose:()=>f(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:h.jsx("div",{className:"flex justify-center",children:h.jsxs("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[s("create_invoice")&&h.jsx(F_,{label:e("invoice"),icon:jE,onClick:p}),s("create_quote")&&h.jsx(F_,{label:e("quote"),icon:IZ,onClick:g}),s("create_recurring_invoice")&&h.jsx(F_,{label:e("recurring_invoice"),icon:LZ,onClick:m}),s("create_credit")&&h.jsx(F_,{label:e("credit"),icon:jE,onClick:_})]})})})]})}Ls(!1);const v_n=Ls(null),b_n=Ls(!1),y_n=Ls([]),C_n=Ls(null);function v5r({entity:n,entities:e,visible:t,bulkUrl:i,setVisible:r,labelFn:s,bulkLabelFn:o}){const[a]=xe(),[l,c]=x.useState(null),[u,d]=x.useState(!1),[f,p]=oo(v_n),g=xt(),m=Vs(),_=x.useRef(null),v=()=>{const y=ql(e).pluck("id").toArray();p(null),pe.processing(),Je("POST",ze(i),{ids:y,entity:n,template_id:l,send_email:u,action:"template"}).then(C=>{const S=C.data.message;if(B1e.emit("bulk.completed"),u){r(!1),pe.success();return}_.current&&(_.current.disabled=!0),m.fetchQuery({queryKey:["reports",S],queryFn:()=>Je("POST",ze(`/api/v1/templates/preview/${S}`),{},{responseType:"arraybuffer"}).then(k=>k.data),retry:10,retryDelay:5e3}).then(k=>{const I=new Blob([k],{type:"application/pdf"}),L=URL.createObjectURL(I);p(L),pe.success(),B1e.emit("bulk.completed")}).finally(()=>{_.current&&(_.current.disabled=!1)})})},b=y=>{const C=document.createElement("a");C.download="template.pdf",C.href=y,C.target="_blank",document.body.appendChild(C),C.click(),document.body.removeChild(C)};return h.jsxs(pr,{title:a("load_template"),visible:t,onClose:r,size:"extraSmall",children:[h.jsx(qd,{endpoint:ze(`/api/v1/designs?template=true&entities=${n}`),inputOptions:{value:l??"",label:a("design")},entryOptions:{id:"id",label:"name",value:"id"},onChange:y=>y.resource?c(y.resource.id):null}),h.jsx("div",{className:"flex flex-col space-y-2",children:e.map((y,C)=>h.jsx("div",{children:e.length>1&&o?o(y):s(y)},C))}),h.jsxs("div",{className:"flex items-center pb-1",children:[h.jsx(Vd,{checked:u,onValueChange:(y,C)=>d(!!C)}),h.jsx("span",{className:"font-medium",style:{color:g.$3},children:a("send_email")})]}),h.jsx(dn,{innerRef:_,behavior:"button",onClick:v,disabled:!l,disableWithoutIcon:!0,children:a("run_template")}),f?h.jsx(dn,{type:"secondary",behavior:"button",onClick:()=>b(f),children:a("download_pdf")}):null]})}function N4(){const[n,e]=oo(b_n),[t,i]=oo(y_n),[r,s]=oo(C_n);return{changeTemplateVisible:n,changeTemplateResources:t,changeTemplateEntityContext:r,setChangeTemplateVisible:e,setChangeTemplateResources:i,setChangeTemplateEntityContext: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 w_n(n){return e=>{if(e.invitations.length!==0&&e.invitations.length>0)return ze("/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 Znt(n){const e=Vs(),t=w_n({resourceType:n.resource,downloadType:n.downloadType});return i=>{const r=t(i);r&&(pe.processing(),e.fetchQuery(r,()=>Je("GET",r,{},{responseType:"arraybuffer"}).then(s=>{const o=new Blob([s.data],{type:"application/xml"}),a=URL.createObjectURL(o),[,l]=s.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),pe.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 */function x_n({color:n="#000",size:e="1.2rem",filledColor:t="#000"}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:e,height:e},viewBox:"0 0 18 18",children:[h.jsx("path",{d:"M13.25 2.75H4.75C3.64543 2.75 2.75 3.64543 2.75 4.75V13.25C2.75 14.3546 3.64543 15.25 4.75 15.25H13.25C14.3546 15.25 15.25 14.3546 15.25 13.25V4.75C15.25 3.64543 14.3546 2.75 13.25 2.75Z",fill:t,"fill-opacity":"0.3","data-color":"color-2","data-stroke":"none"}),h.jsx("path",{d:"M13 9H11.5L10.25 12.25L7.75 5.75L6.5 9H5",stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),h.jsx("path",{d:"M13.25 2.75H4.75C3.64543 2.75 2.75 3.64543 2.75 4.75V13.25C2.75 14.3546 3.64543 15.25 4.75 15.25H13.25C14.3546 15.25 15.25 14.3546 15.25 13.25V4.75C15.25 3.64543 14.3546 2.75 13.25 2.75Z",stroke:n,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"})]})}const S_n=As.div` background-color: ${n=>n.theme.backgroundColor}; &:hover { background-color: ${n=>n.theme.hoverBackgroundColor}; } `;function b5r(){const[n]=xe(),e=xt(),{timeFormat:t}=m4(),{dateFormat:i}=Zc(),r=o=>{var f,p,g,m,_,v,b,y,C,S,k,I,L,N,P,O,F,V,M,B,W,q,U,G,H,z,Z,X,oe,fe;let a=Ua(`activity_${o.activity_type_id}`,{});o.activity_type_id===10&&o.contact&&(a=Ua("activity_10_online",{})),o.activity_type_id===54&&o.contact&&(a=a.replace(":user",":contact"));const l=["invoice","quote","recurring_invoice","vendor","credit","payment","project","task","expense","recurring_expense","bank_transaction","purchase_order"],u=(()=>{const Se=Object.keys(o||{}).find(Me=>l.includes(Me));return!Se&&(o!=null&&o.client)?"client":Se||""})(),d={client:h.jsx(Ji,{to:Ut("/clients/:id",{id:(f=o.client)==null?void 0:f.hashed_id}),children:(p=o.client)==null?void 0:p.label}),contact:h.jsx(Ji,{to:Ut(`/${(g=o==null?void 0:o.contact)==null?void 0:g.contact_entity}/:id`,{id:(m=o.contact)==null?void 0:m.hashed_id}),children:(_=o.contact)==null?void 0:_.label}),quote:h.jsx(Ji,{to:Ut("/quotes/:id/edit",{id:(v=o.quote)==null?void 0:v.hashed_id}),children:(b=o.quote)==null?void 0:b.label}),user:((y=o.user)==null?void 0:y.label)??n("system"),expense:h.jsx(Ji,{to:Ut("/expenses/:id/edit",{id:(C=o.expense)==null?void 0:C.hashed_id}),children:(S=o==null?void 0:o.expense)==null?void 0:S.label}),recurring_invoice:h.jsx(Ji,{to:Ut("/recurring_invoices/:id/edit",{id:(k=o.recurring_invoice)==null?void 0:k.hashed_id}),children:(I=o==null?void 0:o.recurring_invoice)==null?void 0:I.label}),recurring_expense:h.jsx(Ji,{to:Ut("/recurring_expenses/:id/edit",{id:(L=o.recurring_expense)==null?void 0:L.hashed_id}),children:(N=o==null?void 0:o.recurring_expense)==null?void 0:N.label}),purchase_order:h.jsx(Ji,{to:Ut("/purchase_orders/:id/edit",{id:(P=o.purchase_order)==null?void 0:P.hashed_id}),children:(O=o==null?void 0:o.purchase_order)==null?void 0:O.label}),invoice:h.jsx(Ji,{to:Ut("/invoices/:id/edit",{id:(F=o.invoice)==null?void 0:F.hashed_id}),children:(V=o==null?void 0:o.invoice)==null?void 0:V.label}),payment_amount:(M=o==null?void 0:o.payment_amount)==null?void 0:M.label,payment:h.jsx(Ji,{to:Ut("/payments/:id/edit",{id:(B=o.payment)==null?void 0:B.hashed_id}),children:(W=o==null?void 0:o.payment)==null?void 0:W.label}),credit:h.jsx(Ji,{to:Ut("/credits/:id/edit",{id:(q=o.credit)==null?void 0:q.hashed_id}),children:(U=o==null?void 0:o.credit)==null?void 0:U.label}),task:h.jsx(Ji,{to:Ut("/tasks/:id/edit",{id:(G=o.task)==null?void 0:G.hashed_id}),children:(H=o==null?void 0:o.task)==null?void 0:H.label}),vendor:h.jsx(Ji,{to:Ut("/vendors/:id/edit",{id:(z=o.vendor)==null?void 0:z.hashed_id}),children:(Z=o==null?void 0:o.vendor)==null?void 0:Z.label}),subscription:h.jsx(Ji,{to:Ut("/settings/subscriptions/:id/edit",{id:(X=o.subscription)==null?void 0:X.hashed_id}),children:(oe=o==null?void 0:o.subscription)==null?void 0:oe.label}),adjustment:(fe=o==null?void 0:o.adjustment)==null?void 0:fe.label,notes:o!=null&&o.notes&&[151,152,153].includes(o.activity_type_id)?h.jsx(h.Fragment,{children:(o==null?void 0:o.notes)??""}):u&&o[u]?h.jsxs(h.Fragment,{children:[h.jsx("br",{}),h.jsx(Ji,{to:Ut(`/${u}s/${o[u].hashed_id}/edit`),children:o==null?void 0:o.notes})]}):null};for(const[Se,Me]of Object.entries(d))a=_9(a,`:${Se}`,()=>Me);return a},s=o=>{const a=Jn(),l=Jn.unix(o),c=a.diff(l,"day");return a.diff(l,"minute")<=1?n("just_now"):c===1?n("yesterday"):so(o,`${i} ${t.replace(":ss","")}`)};return o=>h.jsxs(S_n,{className:"flex space-x-3 p-4 rounded-md flex-1 min-w-0 w-full",theme:{backgroundColor:e.$1,hoverBackgroundColor:e.$25},children:[h.jsx("div",{className:"flex items-center justify-center",children:h.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:e.$20},children:h.jsx(x_n,{size:"1.3rem",color:e.$16,filledColor:e.$16})})}),h.jsxs("div",{className:"flex flex-col space-y-0.5 flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm",style:{color:e.$3},children:r(o)}),h.jsxs("div",{className:"flex w-full items-center space-x-1 text-xs truncate",style:{color:e.$17},children:[h.jsx("span",{className:"whitespace-nowrap",children:s(o.created_at)}),h.jsx("span",{children:"-"}),h.jsx("span",{children:o.ip})]})]})]},o.id)}function Tee(n){const[e]=xe(),t=xt(),{entity:i,entityId:r,label:s,labelElement:o}=n,[a,l]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(""),p=()=>{u(!1),f("")},g=()=>{a||(l(!0),pe.processing(),Je("POST",ze("/api/v1/activities/notes"),{entity:`${i}s`,entity_id:r,notes:d}).then(()=>{pe.success("saved_comment"),ii(["activities"])}).finally(()=>{l(!1),p()}))};return h.jsxs(h.Fragment,{children:[r&&h.jsx("div",{className:"cursor-pointer",onClick:()=>u(!0),children:o||h.jsx(dn,{behavior:"button",type:"secondary",onClick:()=>{},children:e("add_comment")})}),h.jsxs(pr,{size:"regular",title:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("span",{children:e("comment")}),h.jsx("div",{children:h.jsx(vS,{color:t.$17})}),h.jsxs("span",{children:[e(i)," ",s]})]}),visible:c,onClose:p,children:[h.jsx(lt,{element:"textarea",value:d,onValueChange:m=>f(m),changeOverride:!0}),h.jsx("div",{className:"flex self-end",children:h.jsx(dn,{behavior:"button",onClick:g,disabled:a||!d,disableWithoutIcon:!0,children:e("add")})})]})]})}function y5r(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i,isFormBusy:r,setIsFormBusy:s}=n,o=Yi(),a=u1(),l=ts(Lk);return c=>{if(r)return;pe.processing(),e(void 0),s(!0);let u="/api/v1/purchase_orders?";t?(u+="save_default_terms=true",i&&(u+="&save_default_footer=true")):i&&(u+="save_default_footer=true"),Je("POST",ze(u),c).then(async d=>{(t||i)&&await a(),pe.success("created_purchase_order"),ii(["purchase_orders"]),o(Ut("/purchase_orders/:id/edit",{id:d.data.data.id}))}).catch(d=>{var f;if(((f=d.response)==null?void 0:f.status)===422){const p=d.response.data;p.errors.amount?pe.error(p.errors.amount[0]):pe.dismiss(),e(p)}}).finally(()=>{l(void 0),s(!1)})}}const E_n=["status","number","vendor","expense","amount","date","due_date"];function k_n(){const[n,e,t,i]=Sg({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 C5r(){var p;const{t:n}=xe(),{dateFormat:e}=Zc(),t=vf(),i=L9(),r=Qo(),s=Ik(),o=RA();k_n();const[a,l,c,u]=Sg({entity:"invoice"}),d=[{column:"status",id:"status_id",label:n("status"),format:(g,m)=>h.jsx(Ji,{to:Ut("/purchase_orders/:id/edit",{id:m.id}),children:h.jsx(jmn,{entity:m})})},{column:"number",id:"number",label:n("number"),format:(g,m)=>h.jsxs("div",{className:"flex space-x-2",children:[h.jsx(eg,{to:Ut("/purchase_orders/:id/edit",{id:m.id}),renderSpan:s("purchase_order",m),children:g}),h.jsx(gEe,{text:m.number})]})},{column:"vendor",id:"vendor_id",label:n("vendor"),format:(g,m)=>m.vendor&&h.jsx(Ji,{to:Ut("/vendors/:id",{id:m.vendor.id}),children:m.vendor.name})},{column:"expense",id:"expense_id",label:n("expense"),format:(g,m)=>m.expense&&h.jsx(Ji,{to:Ut("/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,(_=m.vendor)==null?void 0:_.country_id,(v=m.vendor)==null?void 0:v.currency_id)}},{column:"date",id:"date",label:n("date"),format:g=>so(g,e)},{column:"due_date",id:"due_date",label:n("due_date"),format:g=>so(g,e)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:g=>so(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:_.contacts)==null?void 0:v.length)>0&&h.jsxs(Ji,{to:Ut("/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&&h.jsx(Tc,{text:m.vendor.contacts[0].email})},{column:"created_at",id:"created_at",label:n("created_at"),format:g=>so(g,e)},{column:a,id:"custom_value1",label:a,format:g=>o("invoice1",g==null?void 0:g.toString())},{column:l,id:"custom_value2",label:l,format:g=>o("invoice2",g==null?void 0:g.toString())},{column:c,id:"custom_value3",label:c,format:g=>o("invoice3",g==null?void 0:g.toString())},{column:u,id:"custom_value4",label:u,format:g=>o("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,(_=m.vendor)==null?void 0:_.country_id,(v=m.vendor)==null?void 0:v.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)=>h.jsx(ev,{entity:m})},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:g=>i(g)}],f=((p=r==null?void 0:r.react_table_columns)==null?void 0:p.purchaseOrder)||E_n;return d.filter(g=>f.includes(g.column)).sort((g,m)=>f.indexOf(g.column)-f.indexOf(m.column))}function T_n(){const[n]=xe(),e=Um();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 w5r(n={}){const{dropdown:e=!0}=n,[t]=xe(),i=zi(),{isAdmin:r,isOwner:s}=go(),{isEditPage:o}=Yw({entity:"purchase_order"}),[,a]=oo(See),l=Ymn(),c=Yi(),u=Qmn(),d=jo(),f=Ik(),p=Knt({entity:"purchase_order"}),g=Vnt({resource:"purchase_order"}),m=qnt({entity:"purchase_order"}),_=Znt({resource:"purchase_order",downloadType:"download_e_purchase_order"}),{setChangeTemplateResources:v,setChangeTemplateVisible:b,setChangeTemplateEntityContext:y}=N4(),C=k=>{a({...k,id:"",number:"",documents:[],date:Jn().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}),c("/purchase_orders/create?action=clone")};return[k=>h.jsx(Is,{...!e&&{key:"send_email"},entity:"purchase_order",actionKey:"send_email",isCommonActionSection:!e,tooltipText:t("send_email"),to:Ut("/purchase_orders/:id/email",{id:k.id}),icon:BZ,children:t("send_email")}),k=>h.jsx(Is,{...!e&&{key:"view_pdf"},entity:"purchase_order",actionKey:"view_pdf",isCommonActionSection:!e,tooltipText:t("view_pdf"),to:Ut("/purchase_orders/:id/pdf",{id:k.id}),icon:HZ,children:t("view_pdf")}),k=>hs(k)!==Vr.Deleted&&h.jsx(Is,{...!e&&{key:"print_pdf"},entity:"purchase_order",actionKey:"print_pdf",isCommonActionSection:!e,tooltipText:t("print_pdf"),onClick:()=>p([k.id]),icon:_Ue,disablePreventNavigation:!0,children:t("print_pdf")}),k=>k.status_id!==OS.Accepted&&(r||s)&&h.jsx(Is,{...!e&&{key:"schedule"},entity:"purchase_order",actionKey:"schedule",isCommonActionSection:!e,tooltipText:t("schedule"),onClick:()=>m(k.id),icon:iwe,children:t("schedule")}),k=>h.jsx(Tee,{...!e&&{key:"add_comment"},entity:"purchase_order",entityId:k.id,label:k.number,labelElement:h.jsx(Is,{entity:"purchase_order",actionKey:"add_comment",isCommonActionSection:!e,tooltipText:t("add_comment"),icon:FZ,disablePreventNavigation:!0,children:t("add_comment")})}),k=>h.jsx(Is,{...!e&&{key:"download"},entity:"purchase_order",actionKey:"download",isCommonActionSection:!e,tooltipText:t("download"),onClick:()=>g(k),icon:FE,disablePreventNavigation:!0,children:t("download")}),k=>!!(i!=null&&i.settings.enable_e_invoice)&&h.jsx(Is,{...!e&&{key:"download_e_purchase_order"},entity:"purchase_order",actionKey:"download_e_purchase_order",isCommonActionSection:!e,tooltipText:t("download_e_purchase_order"),onClick:()=>_(k),icon:FE,disablePreventNavigation:!0,children:t("download_e_purchase_order")}),k=>k.status_id<OS.Sent&&h.jsx(Is,{...!e&&{key:"mark_sent"},entity:"purchase_order",actionKey:"mark_sent",isCommonActionSection:!e,tooltipText:t("mark_sent"),onClick:()=>u(k),icon:vUe,disablePreventNavigation:!0,children:t("mark_sent")}),k=>!k.expense_id.length&&h.jsx(Is,{...!e&&{key:"convert_to_expense"},entity:"purchase_order",actionKey:"convert_to_expense",isCommonActionSection:!e,tooltipText:t("convert_to_expense"),onClick:()=>l([k.id],"expense"),icon:oTt,disablePreventNavigation:!0,children:t("convert_to_expense")}),k=>k.status_id===OS.Accepted&&h.jsx(Is,{...!e&&{key:"add_to_inventory"},entity:"purchase_order",actionKey:"add_to_inventory",isCommonActionSection:!e,tooltipText:t("add_to_inventory"),onClick:()=>l([k.id],"add_to_inventory"),icon:tTt,disablePreventNavigation:!0,children:t("add_to_inventory")}),k=>!!k.expense_id.length&&!f("expense",k.expense)&&h.jsx(Is,{...!e&&{key:"view_expense"},entity:"purchase_order",actionKey:"view_expense",isCommonActionSection:!e,tooltipText:`${t("view")} ${t("expense")}`,onClick:()=>c(Ut("/expenses/:id/edit",{id:k.expense_id})),icon:nwe,children:`${t("view")} ${t("expense")}`}),k=>h.jsx(Is,{...!e&&{key:"vendor_portal"},entity:"purchase_order",actionKey:"vendor_portal",isCommonActionSection:!e,tooltipText:t("vendor_portal"),onClick:()=>Wnt(k),icon:swe,disablePreventNavigation:!0,children:t("vendor_portal")}),()=>h.jsx(Ki,{withoutPadding:!0}),k=>d("create_purchase_order")&&h.jsx(Is,{...!e&&{key:"clone_to_purchase_order"},entity:"purchase_order",actionKey:"clone_to_purchase_order",isCommonActionSection:!e,tooltipText:t("clone_to_purchase_order"),onClick:()=>C(k),icon:Pb,children:t("clone_to_purchase_order")}),k=>h.jsx(__n,{...!e&&{key:"clone_to_other"},purchaseOrder:k,dropdown:e}),k=>h.jsx(Is,{...!e&&{key:"run_template"},entity:"purchase_order",actionKey:"run_template",isCommonActionSection:!e,tooltipText:t("run_template"),onClick:()=>{b(!0),v([k]),y({endpoint:"/api/v1/purchase_orders/bulk",entity:"purchase_order"})},icon:t4,children:t("run_template")}),()=>o&&h.jsx(Ki,{withoutPadding:!0}),k=>!k.archived_at&&o&&h.jsx(Is,{...!e&&{key:"archive"},entity:"purchase_order",actionKey:"archive",isCommonActionSection:!e,tooltipText:t("archive"),onClick:()=>l([k.id],"archive"),icon:yu,excludePreferences:!0,disablePreventNavigation:!0,children:t("archive")}),k=>!!k.archived_at&&o&&h.jsx(Is,{...!e&&{key:"restore"},entity:"purchase_order",actionKey:"restore",isCommonActionSection:!e,tooltipText:t("restore"),onClick:()=>l([k.id],"restore"),icon:bu,disablePreventNavigation:!0,excludePreferences:!0,children:t("restore")}),k=>!k.is_deleted&&o&&h.jsx(Is,{...!e&&{key:"delete"},entity:"purchase_order",actionKey:"delete",isCommonActionSection:!e,tooltipText:t("delete"),onClick:()=>l([k.id],"delete"),icon:fc,disablePreventNavigation:!0,excludePreferences:!0,children:t("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 Wp=(n=>(n.Viewed="-2",n.Expired="-1",n.Draft="1",n.Sent="2",n.Approved="3",n.Converted="4",n))(Wp||{});/** * 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 I_n{constructor(e,t){Xr(this,"taxCollection",ql());Xr(this,"lineItems",[]);Xr(this,"items",new Map);Xr(this,"item");Xr(this,"subTotal",0);Xr(this,"grossSubTotal",0);Xr(this,"totalTaxes",0);this.invoice=e,this.currency=t}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=parseFloat((this.item.line_total-this.item.discount).toFixed(2));else{const e=this.item.line_total*(this.item.discount/100);this.item.line_total=parseFloat((this.item.line_total-e).toFixed(2))}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 s=this.calculateAmountLineTax(this.item.tax_rate3,t);return e+=s,this.item.tax_name3.length>=1&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,s),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(ql(r))}calculateAmountLineTax(e,t){const i=t*e/100;return i>0?Math.round(i*1e3/10)/100:Math.floor(i*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=ql(),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),s=this.calculateAmountLineTax(this.item.tax_rate1,r);i+=s,s!==0&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,s);const o=this.calculateAmountLineTax(this.item.tax_rate2,r);i+=o,o!==0&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,o);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 hK{static formatValue(e,t){return _pe(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 Jnt{constructor(e,t){Xr(this,"taxMap",ql());Xr(this,"totalTaxMap",[]);Xr(this,"totalDiscount",0);Xr(this,"total",0);Xr(this,"totalTaxes",0);Xr(this,"totalCustomValues",0);Xr(this,"subTotal",0);this.invoice=e,this.currency=t,this.invoiceItems=new I_n(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}peppolSurchargeTaxes(){const e=this.invoice.line_items[0],t=e==null?void 0:e.tax_name1,i=(e==null?void 0:e.tax_rate1)??0,r=this.invoice.custom_surcharge1+this.invoice.custom_surcharge2+this.invoice.custom_surcharge3+this.invoice.custom_surcharge4;if(i>0&&r!=0){const s=Math.round(r*i/100*1e3/10)/100;let o={};o={key:t+i.toString().replace(" ",""),total:s,name:`${t} ${parseFloat(i.toString())} %`},this.invoiceItems.taxCollection.push(ql(o))}return this}calculateInvoiceTaxes(){var t,i,r,s;let e=0;if(this.invoice.tax_name1.length>=1){let o=this.taxer(this.total,this.invoice.tax_rate1);o+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name1,this.invoice.tax_rate1),e+=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_name2.length>=1){let o=this.taxer(this.total,this.invoice.tax_rate2);o+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name2,this.invoice.tax_rate2),e+=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_name3.length>=1){let o=this.taxer(this.total,this.invoice.tax_rate3);o+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name3,this.invoice.tax_rate3),e+=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.totalTaxes=parseFloat(e.toFixed(((s=this.currency)==null?void 0:s.precision)||2)),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,s,o,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(((s=this.currency)==null?void 0:s.precision)||2))),this.invoice.custom_surcharge_tax3&&(i+=parseFloat((this.invoice.custom_surcharge3*(t/100)).toFixed(((o=this.currency)==null?void 0:o.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.invoice.tax_name1.length==0&&this.invoice.custom_surcharge1!=0&&this.invoice.custom_surcharge_tax1&&this.peppolSurchargeTaxes(),this.taxMap=ql();let e=ql();return e=this.invoiceItems.taxCollection.pluck("items"),e.pluck("key").unique().map(i=>{const r=e.filter(o=>o.key===i).pluck("name").first(),s=e.filter(o=>o.key===i).sum("total");this.taxMap.push({name:r,total:s})}),console.log(this.taxMap),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(hK.formatValue(this.total,((e=this.currency)==null?void 0:e.precision)||2)),this.invoice.balance=parseFloat(hK.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){const i=e*((t??0)/100);return this.roundToPrecision(i)}roundToPrecision(e){var r;const t=e<0,i=((r=this.currency)==null?void 0:r.precision)||2;return t&&(e=e*-1),e=+(Math.round(+(e+`e+${i}`))+`e-${i}`),t&&(e=e*-1),e}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 L_n(){const n=Vs(),e=ji(wu);return t=>{pe.processing(),Je("PUT",ze("/api/v1/quotes/:id?approve=true",{id:t.id}),t).then(()=>{pe.success("approved_quote"),ii(["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 A_n={convert_to_invoice:"converted_quote",convert_to_project:"converted_quote",email:"emailed_quotes",mark_sent:"marked_quote_as_sent"},eit=n=>{const{onSuccess:e}=n||{},t=Yi(),i=Vs(),r=ji(wu);return(s,o,a)=>{pe.processing(),Je("POST",ze("/api/v1/quotes/bulk"),{action:o,ids:s,...a}).then(l=>{const c=A_n[o]||`${o}d_quote`;o==="approve"?pe.success(Ua("approved_quotes",{value:s.length})):pe.success(c),ii(["quotes"]),r&&i.invalidateQueries([r]),o==="convert_to_invoice"&&ii(["invoices"]),o==="convert_to_project"&&(ii(["projects"]),t(Ut("/projects/:id",{id:l.data.data[0].project_id}))),e==null||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 N_n(){const n=Vs(),e=ji(wu);return t=>{pe.processing(),Je("PUT",ze("/api/v1/quotes/:id?mark_sent=true",{id:t.id}),t).then(()=>{pe.success("quote_sent"),ii(["quotes"]),e&&n.invalidateQueries([e])})}}function D_n(n){const[e]=xe(),{status_id:t,is_deleted:i,archived_at:r,invoice_id:s,invitations:o}=n.entity,a=Um(),l=()=>o==null?void 0:o.some(p=>p.viewed_date),c=t===Wp.Approved||t===Wp.Converted,u=!c,d=l(),f=t===Wp.Expired;return i?h.jsx(as,{variant:"red",children:e("deleted")}):r?h.jsx(as,{variant:"orange",children:e("archived")}):s?h.jsx(as,{variant:"green",style:{backgroundColor:a.$3},children:e("converted")}):f?h.jsx(as,{variant:"red",style:{backgroundColor:a.$5},children:e("expired")}):d&&u&&!c?h.jsx(as,{variant:"yellow",children:e("viewed")}):t===Wp.Draft?h.jsx(as,{variant:"generic",children:e("draft")}):t===Wp.Sent?h.jsx(as,{variant:"light-blue",style:{backgroundColor:a.$1},children:e("sent")}):t===Wp.Approved?h.jsx(as,{variant:"dark-blue",style:{backgroundColor:a.$2},children:e("approved")}):h.jsx(h.Fragment,{})}/** * 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 R_n{constructor(e){Xr(this,"taxCollection",ql());Xr(this,"lineItems",[]);Xr(this,"items",new Map);Xr(this,"item");Xr(this,"subTotal",0);Xr(this,"grossSubTotal",0);Xr(this,"totalTaxes",0);this.invoice=e}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=parseFloat((this.item.line_total-this.item.discount).toFixed(2)):this.item.line_total=parseFloat((this.item.line_total-this.item.line_total*(this.item.discount/100)).toFixed(2)),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 s=this.calcInclusiveLineTax(this.item.tax_rate3,t);return e+=s,this.item.tax_name3.length>=1&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,s),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(ql(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=ql(),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,s=this.calcInclusiveLineTax(this.item.tax_rate1,r);i+=s,s!==0&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,s);const o=this.calcInclusiveLineTax(this.item.tax_rate2,r);i+=o,o!==0&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,o);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 tit{constructor(e,t){Xr(this,"taxMap",ql());Xr(this,"totalTaxMap",[]);Xr(this,"totalDiscount",0);Xr(this,"total",0);Xr(this,"totalTaxes",0);Xr(this,"totalCustomValues",0);Xr(this,"subTotal",0);this.invoice=e,this.currency=t,this.invoiceItems=new R_n(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 s=this.calcInclusiveLineTax(e,this.invoice.tax_rate1);this.totalTaxes+=s,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 s=this.calcInclusiveLineTax(e,this.invoice.tax_rate2);this.totalTaxes+=s,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 s=this.calcInclusiveLineTax(e,this.invoice.tax_rate3);this.totalTaxes+=s,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,s,o,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(((s=this.currency)==null?void 0:s.precision)||2))),this.invoice.custom_surcharge_tax3&&(i+=parseFloat((this.invoice.custom_surcharge3*(t/100)).toFixed(((o=this.currency)==null?void 0:o.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=ql();let e=ql();return e=this.invoiceItems.taxCollection.pluck("items"),e.pluck("key").unique().map(i=>{const r=e.filter(o=>o.key===i).pluck("name").first(),s=e.filter(o=>o.key===i).sum("total");this.taxMap.push({name:r,total:s}),this.totalTaxes+=s}),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(hK.formatValue(this.total,((e=this.currency)==null?void 0:e.precision)||2)),this.invoice.balance=parseFloat(hK.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 P_n=n=>{const[e]=xe(),[t,i]=x.useState(!1),{selectedIds:r,setSelected:s,dropdown:o}=n,a=xt(),l=eit();return h.jsxs(h.Fragment,{children:[h.jsx(Is,{entity:"quote",actionKey:"convert_to_project",isCommonActionSection:!o,tooltipText:e("convert_to_project"),onClick:()=>i(!0),icon:dTt,disablePreventNavigation:n.disablePreventNavigation,children:e("convert_to_project")}),h.jsxs(pr,{title:e("convert_to_project"),visible:t,onClose:()=>i(!1),children:[h.jsx("span",{className:"text-lg",style:{backgroundColor:a.$2,color:a.$3,colorScheme:a.$0},children:e("are_you_sure")}),h.jsx("div",{className:"flex justify-end space-x-4 mt-5",children:h.jsx(dn,{behavior:"button",onClick:()=>{l(r,"convert_to_project"),s==null||s([]),i(!1)},children:h.jsx("span",{className:"text-base mx-3",children:e("yes")})})})]})]})};function O_n(n){const[e]=xe(),t=Yi(),{quote:i,dropdown:r}=n,s=jo(),o=ts(Gw),a=ts(xEe),l=ts(kee),c=ts(See),u=Nr(),[d,f]=x.useState(!1),p=()=>{a({...i,id:"",number:"",documents:[],date:Jn().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:u.settings.credit_design_id}),t("/credits/create?action=clone")},g=()=>{l({...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:u.settings.invoice_design_id}),t("/recurring_invoices/create?action=clone")},m=()=>{c({...i,id:"",number:"",documents:[],date:Jn().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:u.settings.purchase_order_design_id}),t("/purchase_orders/create?action=clone")},_=()=>{o({...i,id:"",number:"",documents:[],date:Jn().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:u.settings.invoice_design_id}),t("/invoices/create?action=clone")};return h.jsxs(h.Fragment,{children:[(s("create_invoice")||s("create_credit")||s("create_recurring_invoice")||s("create_purchase_order"))&&h.jsx(Is,{entity:"quote",actionKey:"clone_to_other",isCommonActionSection:!r,tooltipText:e("clone_to_other"),onClick:()=>f(!0),icon:Pb,children:e("clone_to_other")}),h.jsx(pr,{title:e("clone_to"),visible:d,onClose:()=>f(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:h.jsx("div",{className:"flex justify-center",children:h.jsxs("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[s("create_invoice")&&h.jsx(F_,{label:e("invoice"),icon:jE,onClick:_}),s("create_credit")&&h.jsx(F_,{label:e("credit"),icon:jE,onClick:p}),s("create_recurring_invoice")&&h.jsx(F_,{label:e("recurring_invoice"),icon:LZ,onClick:g}),s("create_purchase_order")&&h.jsx(F_,{label:e("purchase_order"),icon:PQe,onClick:m})]})})})]})}function x5r(n){const e=Sk(),t=zi(),[i,r]=oo(Eee),[,s]=oo(g_n),o=(p,g)=>{r(m=>m&&{...m,[p]:g})};return{handleChange:o,handleInvitationChange:(p,g)=>{let m=[...i.invitations];const _=(m==null?void 0:m.find(v=>v.client_contact_id===p))||-1;if(_!==-1&&g===!1&&(m=m.filter(v=>v.client_contact_id!==p)),_===-1){const v={client_contact_id:p};m.push(v)}o("invitations",m)},handleLineItemChange:(p,g)=>{const m=(i==null?void 0:i.line_items)||[];m[p]=g,r(_=>_&&{..._,line_items:m})},handleLineItemPropertyChange:(p,g,m)=>{const _=(i==null?void 0:i.line_items)||[];_[m][p]!==g&&(_[m][p]=g,r(v=>v&&{...v,line_items:_}))},handleCreateLineItem:p=>{r(g=>g&&{...g,line_items:[...g.line_items,{...Tk(),type_id:p,quantity:1}]})},handleDeleteLineItem:p=>{const g=(i==null?void 0:i.line_items)||[];g.splice(p,1),r(m=>m&&{...m,line_items:g})},calculateInvoiceSum:p=>{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&&p){const _=p.uses_inclusive_taxes?new tit(p,g).build():new Jnt(p,g).build();s(_)}}}}function S5r(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i,isFormBusy:r,setIsFormBusy:s}=n,o=u1(),a=Yi(),l=pd(),c=ts(Lk);return async u=>{if(r)return;pe.processing(),e(void 0),s(!0),await l({excludeToasters:!0});let d="/api/v1/quotes?";t?(d+="save_default_terms=true",i&&(d+="&save_default_footer=true")):i&&(d+="save_default_footer=true"),Je("POST",ze(d),u).then(async f=>{(t||i)&&await o(),pe.success("created_quote"),ii(["quotes"]),a(Ut("/quotes/:id/edit",{id:f.data.data.id}))}).catch(f=>{var p;if(((p=f.response)==null?void 0:p.status)===422){const g=f.response.data;g.errors.amount?pe.error(g.errors.amount[0]):pe.dismiss(),e(g)}}).finally(()=>{c(void 0),s(!1)})}}function E5r(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i,isFormBusy:r,setIsFormBusy:s}=n,o=u1(),a=ts(Lk),l=pd();return async c=>{if(r)return;pe.processing(),e(void 0),s(!0),await l({excludeToasters:!0});let u="/api/v1/quotes/:id?";t?(u+="save_default_terms=true",i&&(u+="&save_default_footer=true")):i&&(u+="save_default_footer=true"),Je("PUT",ze(u,{id:c.id}),c).then(async()=>{(t||i)&&await o(),pe.success("updated_quote"),ii(["quotes"])}).catch(d=>{var f;if(((f=d.response)==null?void 0:f.status)===422){const p=d.response.data;p.errors.amount?pe.error(p.errors.amount[0]):pe.dismiss(),e(p)}}).finally(()=>{a(void 0),s(!1)})}}function k5r(n){const[e]=xe(),{showCommonBulkAction:t,showEditAction:i,dropdown:r=!0}=n||{},s=ts(Eee),o=zi(),{isAdmin:a,isOwner:l}=go(),{isEditPage:c}=Yw({entity:"quote",editPageTabs:["documents","settings","activity","history","email_history"]}),u=L_n(),d=eit(),f=Yi(),p=N_n(),g=jo(),m=Knt({entity:"quote"}),_=Vnt({resource:"quote"}),v=Znt({resource:"quote",downloadType:"download_e_quote"}),b=qnt({entity:"quote"}),{setChangeTemplateResources:y,setChangeTemplateVisible:C,setChangeTemplateEntityContext:S}=N4(),k=L=>{s({...L,id:"",number:"",documents:[],date:Jn().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}),f("/quotes/create?action=clone")};return[L=>!!i&&h.jsx($n,{to:Ut("/quotes/:id/edit",{id:L.id}),icon:h.jsx(an,{element:$Z}),children:e("edit")}),()=>!!i&&h.jsx(Ki,{withoutPadding:!0}),L=>h.jsx(Is,{...!r&&{key:"view_pdf"},entity:"quote",actionKey:"view_pdf",isCommonActionSection:!r,tooltipText:e("view_pdf"),to:Ut("/quotes/:id/pdf",{id:L.id}),icon:HZ,children:e("view_pdf")}),L=>hs(L)!==Vr.Deleted&&h.jsx(Is,{...!r&&{key:"print_pdf"},entity:"quote",actionKey:"print_pdf",isCommonActionSection:!r,tooltipText:e("print_pdf"),onClick:()=>m([L.id]),icon:_Ue,disablePreventNavigation:!0,children:e("print_pdf")}),L=>h.jsx(Is,{...!r&&{key:"download_pdf"},entity:"quote",actionKey:"download_pdf",isCommonActionSection:!r,tooltipText:e("download_pdf"),onClick:()=>_(L),icon:FE,disablePreventNavigation:!0,children:e("download_pdf")}),L=>!!(o!=null&&o.settings.enable_e_invoice)&&h.jsx(Is,{...!r&&{key:"download_e_quote"},entity:"quote",actionKey:"download_e_quote",isCommonActionSection:!r,tooltipText:e("download_e_quote"),onClick:()=>v(L),icon:FE,disablePreventNavigation:!0,children:e("download_e_quote")}),L=>L.status_id!==Wp.Converted&&L.status_id!==Wp.Approved&&(a||l)&&h.jsx(Is,{...!r&&{key:"schedule"},entity:"quote",actionKey:"schedule",isCommonActionSection:!r,tooltipText:e("schedule"),onClick:()=>b(L.id),icon:iwe,children:e("schedule")}),L=>h.jsx(Tee,{...!r&&{key:"add_comment"},entity:"quote",entityId:L.id,label:L.number,labelElement:h.jsx(Is,{entity:"quote",actionKey:"add_comment",isCommonActionSection:!r,tooltipText:e("add_comment"),icon:FZ,disablePreventNavigation:!0,children:e("add_comment")})}),L=>h.jsx(Is,{...!r&&{key:"email_quote"},entity:"quote",actionKey:"email_quote",isCommonActionSection:!r,tooltipText:e("email_quote"),to:Ut("/quotes/:id/email",{id:L.id}),icon:BZ,children:e("email_quote")}),L=>h.jsx(Is,{...!r&&{key:"client_portal"},entity:"quote",actionKey:"client_portal",isCommonActionSection:!r,tooltipText:e("client_portal"),onClick:()=>L&&Wnt(L),icon:swe,disablePreventNavigation:!0,children:e("client_portal")}),L=>L.status_id===Wp.Draft&&h.jsx(Is,{...!r&&{key:"mark_sent"},entity:"quote",actionKey:"mark_sent",isCommonActionSection:!r,tooltipText:e("mark_sent"),onClick:()=>p(L),icon:vUe,disablePreventNavigation:!0,children:e("mark_sent")}),L=>(L.status_id===Wp.Draft||L.status_id===Wp.Sent)&&h.jsx(Is,{...!r&&{key:"approve"},entity:"quote",actionKey:"approve",isCommonActionSection:!r,tooltipText:e("approve"),onClick:()=>u(L),icon:ewe,disablePreventNavigation:!0,children:e("approve")}),L=>L.status_id!==Wp.Converted&&g("create_invoice")&&h.jsx(Is,{...!r&&{key:"convert_to_invoice"},entity:"quote",actionKey:"convert_to_invoice",isCommonActionSection:!r,tooltipText:e("convert_to_invoice"),onClick:()=>d([L.id],"convert_to_invoice"),icon:WLt,disablePreventNavigation:!0,children:e("convert_to_invoice")}),L=>!L.project_id&&g("create_project")&&h.jsx(P_n,{...!r&&{key:"convert_to_project"},selectedIds:[L.id],disablePreventNavigation:!0,dropdown:r}),L=>h.jsx(Is,{...!r&&{key:"run_template"},entity:"quote",actionKey:"run_template",isCommonActionSection:!r,tooltipText:e("run_template"),onClick:()=>{C(!0),y([L]),S({endpoint:"/api/v1/quotes/bulk",entity:"quote"})},icon:t4,children:e("run_template")}),()=>h.jsx(Ki,{withoutPadding:!0}),L=>g("create_quote")&&h.jsx(Is,{...!r&&{key:"clone_to_quote"},entity:"quote",actionKey:"clone_to_quote",isCommonActionSection:!r,tooltipText:e("clone_to_quote"),onClick:()=>k(L),icon:Pb,children:e("clone_to_quote")}),L=>h.jsx(O_n,{...!r&&{key:"clone_to_other"},dropdown:r,quote:L}),()=>(c||!!t)&&h.jsx(Ki,{withoutPadding:!0}),L=>(c||!!t)&&L.archived_at===0&&h.jsx(Is,{...!r&&{key:"archive"},entity:"quote",actionKey:"archive",isCommonActionSection:!r,tooltipText:e("archive"),onClick:()=>d([L.id],"archive"),icon:yu,excludePreferences:!0,disablePreventNavigation:!0,children:e("archive")}),L=>(c||!!t)&&L.archived_at>0&&h.jsx(Is,{...!r&&{key:"restore"},entity:"quote",actionKey:"restore",isCommonActionSection:!r,tooltipText:e("restore"),onClick:()=>d([L.id],"restore"),icon:bu,excludePreferences:!0,disablePreventNavigation:!0,children:e("restore")}),L=>(c||!!t)&&!(L!=null&&L.is_deleted)&&h.jsx(Is,{...!r&&{key:"delete"},entity:"quote",actionKey:"delete",isCommonActionSection:!r,tooltipText:e("delete"),onClick:()=>d([L.id],"delete"),icon:fc,excludePreferences:!0,disablePreventNavigation:!0,children:e("delete")})]}const M_n=["status","number","client","amount","net_amount","date","valid_until"];function j_n(){const[n,e,t,i]=Sg({entity:"invoice"});return["status","number","client","amount","net_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 T5r(){var b;const{t:n}=xe(),{dateFormat:e}=Zc();j_n();const t=Lo(),i=Yi(),r=L9(),s=jo(),o=Ik(),a=vf(),l=Qo(),c=xk(),u=RA(),d=x.useCallback(y=>{let C="";return y.invitations.map(S=>{S.viewed_date&&(C=S.viewed_date)}),C},[]),[f,p,g,m]=Sg({entity:"invoice"}),_=[{column:"status",id:"status_id",label:n("status"),format:(y,C)=>h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(D_n,{entity:C}),C.status_id===Wp.Converted&&C.invoice_id&&h.jsx(yEe,{entityId:C.invoice_id,cacheEndpoint:"/api/v1/invoices",apiEndpoint:"/api/v1/invoices/:id?include=client.group_settings",preCheck:s("view_invoice")||s("edit_invoice"),component:h.jsx(hA,{className:"cursor-pointer",fontSize:19,color:t,onClick:()=>i(Ut("/invoices/:id/edit",{id:C.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(y,C)=>h.jsxs("div",{className:"flex space-x-2",children:[h.jsx(eg,{to:Ut("/quotes/:id/edit",{id:C.id}),renderSpan:o("quote",C),children:y}),h.jsx(gEe,{text:C.number})]})},{column:"client",id:"client_id",label:n("client"),format:(y,C)=>{var S;return h.jsx(eg,{to:Ut("/clients/:id",{id:C.client_id}),renderSpan:o("client",C.client),children:(S=C.client)==null?void 0:S.display_name})}},{column:"amount",id:"amount",label:n("amount"),format:(y,C)=>{var S,k;return a(y,(S=C.client)==null?void 0:S.country_id,(k=C.client)==null?void 0:k.settings.currency_id)}},{column:"net_amount",id:"amount",label:n("net_amount"),format:(y,C)=>{var S,k;return a(Number(y)-Number(C.total_taxes||0),(S=C.client)==null?void 0:S.country_id,(k=C.client)==null?void 0:k.settings.currency_id)}},{column:"date",id:"date",label:n("date"),format:y=>so(y,e)},{column:"valid_until",id:"due_date",label:n("valid_until"),format:(y,C)=>so(C.due_date,e)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:y=>so(y,e)},{column:"client_city",id:"client_id",label:n("client_city"),format:(y,C)=>{var S;return(S=C.client)==null?void 0:S.city}},{column:"client_country",id:"client_id",label:n("client_country"),format:(y,C)=>{var S,k,I;return((S=C.client)==null?void 0:S.country_id)&&((I=c((k=C.client)==null?void 0:k.country_id))==null?void 0:I.name)}},{column:"client_postal_code",id:"client_id",label:n("client_postal_code"),format:(y,C)=>{var S;return(S=C.client)==null?void 0:S.postal_code}},{column:"client_state",id:"client_id",label:n("client_state"),format:(y,C)=>{var S;return(S=C.client)==null?void 0:S.state}},{column:"contact_email",id:"client_id",label:n("contact_email"),format:(y,C)=>{var S;return C.client&&C.client.contacts.length>0&&h.jsx(Tc,{text:(S=C.client)==null?void 0:S.contacts[0].email})}},{column:"contact_name",id:"client_id",label:n("contact_name"),format:(y,C)=>{var S,k;return C.client&&C.client.contacts.length>0&&`${(S=C.client)==null?void 0:S.contacts[0].first_name} ${(k=C.client)==null?void 0:k.contacts[0].last_name}`}},{column:"created_at",id:"created_at",label:n("created_at"),format:y=>so(y,e)},{column:f,id:"custom_value1",label:f,format:y=>u("invoice1",y==null?void 0:y.toString())},{column:p,id:"custom_value2",label:p,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 S,k;return C.is_amount_discount?a(y,(S=C.client)==null?void 0:S.country_id,(k=C.client)==null?void 0:k.settings.currency_id):`${r(y)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(y,C)=>C.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(y,C)=>h.jsx(ev,{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?so(d(C),e):n("no")},{column:"last_sent_date",id:"last_sent_date",label:n("last_sent_date"),format:y=>so(y,e)},{column:"partial",id:"partial",label:n("partial"),format:(y,C)=>{var S,k;return a(y,(S=C.client)==null?void 0:S.country_id,(k=C.client)==null?void 0:k.settings.currency_id)}},{column:"partial_due_date",id:"partial_due_date",label:n("partial_due_date"),format:y=>so(y,e)},{column:"po_number",id:"po_number",label:n("po_number")},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:y=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(l!=null&&l.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(y)}})}),children:h.jsx("span",{children:Mb(gu(y)).slice(0,50)})})},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:y=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(l!=null&&l.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(y)}})}),children:h.jsx("span",{children:Mb(gu(y)).slice(0,50)})})},{column:"tax_amount",id:"total_taxes",label:n("total_taxes"),format:(y,C)=>{var S,k;return a(y,(S=C.client)==null?void 0:S.country_id,(k=C.client)==null?void 0:k.settings.currency_id)}},{column:"updated_at",id:"updated_at",label:n("last_updated"),format:y=>so(y,e)}],v=((b=l==null?void 0:l.react_table_columns)==null?void 0:b.quote)||M_n;return _.filter(y=>v.includes(y.column)).sort((y,C)=>v.indexOf(y.column)-v.indexOf(C.column))}function F_n(){const[n]=xe(),e=Um();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 $C=(n=>(n.DRAFT="1",n.ACTIVE="2",n.PAUSED="3",n.COMPLETED="4",n.PENDING="-1",n))($C||{});function B_n(n){const[e]=xe(),t=Um(),{status_id:i,is_deleted:r,archived_at:s,last_sent_date:o,remaining_cycles:a}=n.entity,l=i===$C.DRAFT,c=!!r,u=!!s,d=i===$C.ACTIVE&&!o,f=a===-1?"endless":a;return c?h.jsx(as,{variant:"red",children:e("deleted")}):u?h.jsx(as,{variant:"orange",children:e("archived")}):!l&&f===0?h.jsx(as,{variant:"light-blue",style:{backgroundColor:t.$1},children:e("completed")}):d?h.jsx(as,{variant:"dark-blue",style:{backgroundColor:t.$2},children:e("pending")}):l?h.jsx(as,{variant:"generic",children:e("draft")}):i===$C.ACTIVE?h.jsx(as,{variant:"green",style:{backgroundColor:t.$3},children:e("active")}):i===$C.PAUSED?h.jsx(as,{variant:"orange",style:{backgroundColor:t.$4},children:e("paused")}):h.jsx(h.Fragment,{})}/** * 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 Mp=(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))(Mp||{});/** * 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 $_n={[Mp.FREQUENCY_ANNUALLY]:"freq_annually",[Mp.FREQUENCY_DAILY]:"freq_daily",[Mp.FREQUENCY_FOUR_MONTHS]:"freq_four_months",[Mp.FREQUENCY_FOUR_WEEKS]:"freq_four_weeks",[Mp.FREQUENCY_MONTHLY]:"freq_monthly",[Mp.FREQUENCY_SIX_MONTHS]:"freq_six_months",[Mp.FREQUENCY_THREE_MONTHS]:"freq_three_months",[Mp.FREQUENCY_THREE_YEARS]:"freq_three_years",[Mp.FREQUENCY_TWO_MONTHS]:"freq_two_months",[Mp.FREQUENCY_TWO_WEEKS]:"freq_two_weeks",[Mp.FREQUENCY_TWO_YEARS]:"freq_two_years",[Mp.FREQUENCY_WEEKLY]:"freq_weekly",[Mp.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 I5r(n){return lr(["/api/v1/recurring_invoices",n.id],()=>Je("GET",ze("/api/v1/recurring_invoices/:id?include=client",{id:n.id})).then(e=>e.data.data),{staleTime:1/0,enabled:!!n.id})}function L5r(n){const e=jo();return lr(["/api/v1/recurring_invoices","create"],()=>Je("GET",ze("/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 H_n={start:"started_recurring_invoice",stop:"stopped_recurring_invoice",update_prices:"updated_prices",increase_prices:"updated_prices",bulk_update:"updated_records"};function Iee(n){const e=Vs(),t=ji(wu),{onSuccess:i,setErrors:r}=n||{};return async(s,o,a)=>(pe.processing(),Je("POST",ze("/api/v1/recurring_invoices/bulk"),{action:o,ids:s,...a}).then(()=>{const l=H_n[o]||`${o}d_recurring_invoice`;pe.success(l),i==null||i(),t&&e.invalidateQueries([t]),ii(["recurring_invoices"])}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(r==null||r(l.response.data),pe.dismiss())}))}const V_n=n=>{const[e]=xe(),[t,i]=x.useState(!1),s=Iee({onSuccess:()=>{i(!1)}}),{selectedIds:o,setSelected:a,dropdown:l}=n,c=()=>{s(o,"update_prices"),a==null||a([])};return h.jsxs(h.Fragment,{children:[h.jsx(Is,{entity:"recurring_invoice",actionKey:"update_prices",isCommonActionSection:!l,tooltipText:e("update_prices"),onClick:()=>i(!0),icon:aTt,children:e("update_prices")}),h.jsxs(pr,{title:e("update_prices"),visible:t,onClose:()=>i(!1),children:[h.jsx("span",{className:"text-lg",children:e("are_you_sure")}),h.jsx(dn,{className:"self-end",onClick:c,children:e("yes")})]})]})},W_n=n=>{const[e]=xe(),[t,i]=x.useState(!1),[r,s]=x.useState(0),[o,a]=x.useState(),l=()=>{i(!1),s(0)},c=Iee({onSuccess:l,setErrors:a}),{selectedIds:u,setSelected:d,dropdown:f}=n,p=()=>{c(u,"increase_prices",{percentage_increase:r}),d==null||d([])};return h.jsxs(h.Fragment,{children:[h.jsx(Is,{entity:"recurring_invoice",actionKey:"increase_prices",isCommonActionSection:!f,tooltipText:e("increase_prices"),onClick:()=>i(!0),icon:Wzt,children:e("increase_prices")}),h.jsxs(pr,{title:e("increase_prices"),visible:t,onClose:l,children:[h.jsx(Qs,{label:e("percent"),value:r||"",onValueChange:g=>{s(parseFloat(g)),o&&a(void 0)},errorMessage:o==null?void 0:o.errors.percentage_increase}),h.jsx(dn,{className:"self-end",onClick:p,children:e("submit")})]})]})};function z_n(n){const[e]=xe(),t=Yi(),{recurringInvoice:i,dropdown:r}=n,s=jo(),o=ts(Eee),a=ts(xEe),l=ts(Gw),c=ts(See),u=Nr(),[d,f]=x.useState(!1),p=()=>{l({...i,id:"",documents:[],number:"",due_date:"",partial_due_date:"",date:Jn().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",design_id:u.settings.invoice_design_id}),t("/invoices/create?action=clone")},g=()=>{o({...i,id:"",number:"",documents:[],date:Jn().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:u.settings.quote_design_id}),t("/quotes/create?action=clone")},m=()=>{a({...i,id:"",number:"",documents:[],date:Jn().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:u.settings.credit_design_id}),t("/credits/create?action=clone")},_=()=>{c({...i,id:"",number:"",documents:[],date:Jn().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:u.settings.purchase_order_design_id}),t("/purchase_orders/create?action=clone")};return h.jsxs(h.Fragment,{children:[(s("create_invoice")||s("create_quote")||s("create_credit")||s("create_purchase_order"))&&h.jsx(Is,{entity:"recurring_invoice",actionKey:"clone_to_other",isCommonActionSection:!r,tooltipText:e("clone_to_other"),onClick:()=>f(!0),icon:Pb,children:e("clone_to_other")}),h.jsx(pr,{title:e("clone_to"),visible:d,onClose:()=>f(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:h.jsx("div",{className:"flex justify-center",children:h.jsxs("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[s("create_invoice")&&h.jsx(F_,{label:e("invoice"),icon:jE,onClick:p}),s("create_quote")&&h.jsx(F_,{label:e("quote"),icon:IZ,onClick:g}),s("create_credit")&&h.jsx(F_,{label:e("credit"),icon:jE,onClick:m}),s("create_purchase_order")&&h.jsx(F_,{label:e("purchase_order"),icon:PQe,onClick:_})]})})})]})}var Wz={exports:{}},U_n=Wz.exports,zje;function q_n(){return zje||(zje=1,function(n,e){(function(t,i){n.exports=i()})(U_n,function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(s,o,a){var l=o.prototype;a.utc=function(m){var _={date:m,utc:!0,args:arguments};return new o(_)},l.utc=function(m){var _=a(this.toDate(),{locale:this.$L,utc:!0});return m?_.add(this.utcOffset(),t):_},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),c.call(this,m)};var u=l.init;l.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else u.call(this)};var d=l.utcOffset;l.utcOffset=function(m,_){var v=this.$utils().u;if(v(m))return this.$u?0:v(this.$offset)?d.call(this):this.$offset;if(typeof m=="string"&&(m=function(S){S===void 0&&(S="");var k=S.match(i);if(!k)return null;var I=(""+k[0]).match(r)||["-",0,0],L=I[0],N=60*+I[1]+ +I[2];return N===0?0:L==="+"?N:-N}(m),m===null))return this;var b=Math.abs(m)<=16?60*m:m,y=this;if(_)return y.$offset=b,y.$u=m===0,y;if(m!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(y=this.local().add(b+C,t)).$offset=b,y.$x.$localOffset=C}else y=this.utc();return y};var f=l.format;l.format=function(m){var _=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,_)},l.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var p=l.toDate;l.toDate=function(m){return m==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.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)}}})}(Wz)),Wz.exports}var K_n=q_n();const G_n=Cl(K_n);var zz={exports:{}},Y_n=zz.exports,Uje;function Q_n(){return Uje||(Uje=1,function(n,e){(function(t,i){n.exports=i()})(Y_n,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},i={};return function(r,s,o){var a,l=function(f,p,g){g===void 0&&(g={});var m=new Date(f),_=function(v,b){b===void 0&&(b={});var y=b.timeZoneName||"short",C=v+"|"+y,S=i[C];return S||(S=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:v,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:y}),i[C]=S),S}(p,g);return _.formatToParts(m)},c=function(f,p){for(var g=l(f,p),m=[],_=0;_<g.length;_+=1){var v=g[_],b=v.type,y=v.value,C=t[b];C>=0&&(m[C]=parseInt(y,10))}var S=m[3],k=S===24?0:S,I=m[0]+"-"+m[1]+"-"+m[2]+" "+k+":"+m[4]+":"+m[5]+":000",L=+f;return(o.utc(I).valueOf()-(L-=L%1e3))/6e4},u=s.prototype;u.tz=function(f,p){f===void 0&&(f=a);var g,m=this.utcOffset(),_=this.toDate(),v=_.toLocaleString("en-US",{timeZone:f}),b=Math.round((_-new Date(v))/1e3/60),y=15*-Math.round(_.getTimezoneOffset()/15)-b;if(!Number(y))g=this.utcOffset(0,p);else if(g=o(v,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(y,!0),p){var C=g.utcOffset();g=g.add(m-C,"minute")}return g.$x.$timezone=f,g},u.offsetName=function(f){var p=this.$x.$timezone||o.tz.guess(),g=l(this.valueOf(),p,{timeZoneName:f}).find(function(m){return m.type.toLowerCase()==="timezonename"});return g&&g.value};var d=u.startOf;u.startOf=function(f,p){if(!this.$x||!this.$x.$timezone)return d.call(this,f,p);var g=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(g,f,p).tz(this.$x.$timezone,!0)},o.tz=function(f,p,g){var m=g&&p,_=g||p||a,v=c(+o(),_);if(typeof f!="string")return o(f).tz(_);var b=function(k,I,L){var N=k-60*I*1e3,P=c(N,L);if(I===P)return[N,I];var O=c(N-=60*(P-I)*1e3,L);return P===O?[N,P]:[k-60*Math.min(P,O)*1e3,Math.max(P,O)]}(o.utc(f,m).valueOf(),v,_),y=b[0],C=b[1],S=o(y).utcOffset(C);return S.$x.$timezone=_,S},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(f){a=f}}})}(zz)),zz.exports}var X_n=Q_n();const Z_n=Cl(X_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 J_n(){const n=zi(),{data:e}=Zd(),[t,i]=x.useState("1"),[r,s]=x.useState("America/Tijuana");return x.useEffect(()=>{if(e!=null&&e.timezones){const o=e.timezones.find(a=>{var l;return a.id===(((l=n==null?void 0:n.settings)==null?void 0:l.timezone_id)??"1")});o&&(s(o.name),i(o.id))}},[n,e]),{timeZoneId:t,timeZone: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 */Jn.extend(G_n);Jn.extend(Z_n);function evn(n){const{formatOnlyTime:e=!1,withTimezone:t=!1,formatOnlyDate:i=!1}=n||{},{timeZone:r}=J_n(),{timeFormat:s}=m4(),{dateFormat:o}=Zc();return(a,l,c,u)=>{if(a===0||a===""||a===void 0)return"";let d=`${l||o} ${c||s}`;return i&&(d=l||o),e&&(d=c||s),typeof a=="number"&&!t?Jn.unix(a).format(d):typeof a!="number"&&!t?Jn(a).format(d):Jn.utc(a).tz(u||r).format(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 tvn(){const n=zi(),{data:e}=Snt({perPage:1e3});return(t,i)=>{if(e&&t){if(t.settings[i]!==void 0)return t.settings[i];if(t.group_settings&&t.group_settings.settings[i]!==void 0)return t.group_settings.settings[i];if(t.group_settings_id&&!t.group_settings){const r=e.find(({id:s})=>s===t.group_settings_id);if(r&&r.settings[i]!==void 0)return r.settings[i]}return n.settings[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 nvn(){const{data:n}=Zd();return e=>{if(n!=null&&n.timezones&&e){const t=n.timezones.find(i=>i.id===e);if(t)return{timeZoneId:t.id,timeZone:t.name}}return{timeZoneId:"32",timeZone:"Europe/Lisbon"}}}const nit=Ls(!1);function A5r({onClick:n,onClose:e,disabledButton:t,title:i,message:r,disableButtonWithoutLoadingIcon:s}){const[o]=xe(),[a,l]=oo(nit);return x.useEffect(()=>()=>{l(!1)},[]),h.jsx(pr,{title:i??o("are_you_sure"),visible:a,onClose:()=>{l(!1),e==null||e()},children:h.jsxs("div",{className:"flex flex-col space-y-6",children:[!!r&&h.jsx("span",{className:"font-medium text-sm",children:r}),h.jsx(dn,{behavior:"button",onClick:()=>n(),disabled:t,disableWithoutIcon:s,children:o("continue")})]})})}function N5r(n){const e=Sk(),t=zi(),[i,r]=oo(kee),[,s]=oo(m_n),o=(p,g)=>{r(m=>m&&{...m,[p]:g})};return{handleChange:o,handleInvitationChange:(p,g)=>{let m=[...i.invitations];const _=(m==null?void 0:m.find(v=>v.client_contact_id===p))||-1;if(_!==-1&&g===!1&&(m=m.filter(v=>v.client_contact_id!==p)),_===-1){const v={client_contact_id:p};m.push(v)}o("invitations",m)},handleLineItemChange:(p,g)=>{const m=(i==null?void 0:i.line_items)||[];m[p]=g,r(_=>_&&{..._,line_items:m})},handleLineItemPropertyChange:(p,g,m)=>{const _=(i==null?void 0:i.line_items)||[];_[m][p]!==g&&(_[m][p]=g,r(v=>v&&{...v,line_items:_}))},handleCreateLineItem:p=>{r(g=>g&&{...g,line_items:[...g.line_items,{...Tk(),type_id:p,quantity:1}]})},handleDeleteLineItem:p=>{const g=(i==null?void 0:i.line_items)||[];g.splice(p,1),r(m=>m&&{...m,line_items:g})},calculateInvoiceSum:p=>{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&&p){const _=p.uses_inclusive_taxes?new tit(p,g).build():new Jnt(p,g).build();s(_)}}}}function D5r(n){const{setErrors:e,setIsFormBusy:t,isFormBusy:i}=n,r=ts(Lk);return(s,o)=>{if(i)return;pe.processing(),e(void 0),t(!0);const a=o?`/api/v1/recurring_invoices/:id?${o}=true`:"/api/v1/recurring_invoices/:id";Je("PUT",ze(a,{id:s.id}),s).then(()=>{ii(["recurring_invoices"]),pe.success("updated_recurring_invoice")}).catch(l=>{var c;if(((c=l.response)==null?void 0:c.status)===422){const u=l.response.data;u.errors.amount?pe.error(u.errors.amount[0]):pe.dismiss(),e(u)}}).finally(()=>{r(void 0),t(!1)})}}function ivn(){const n=Vs(),e=ji(wu);return(t,i)=>{pe.processing(),Je("PUT",ze(i==="start"?"/api/v1/recurring_invoices/:id?start=true":"/api/v1/recurring_invoices/:id?stop=true",{id:t.id}),t).then(()=>{ii(["recurring_invoices"]),e&&n.invalidateQueries([e]),pe.success(i==="start"?"started_recurring_invoice":"stopped_recurring_invoice")})}}function R5r(n){const[e]=xe(),t=Iee(),i=Yi(),r=jo(),s=ivn(),o=ts(nit),a=ts(kee),{showEditAction:l,showCommonBulkActions:c,dropdown:u=!0}=n||{},{isEditPage:d}=Yw({entity:"recurring_invoice",editPageTabs:["documents","settings","activity","history","schedule"]}),f=g=>{a({...g,id:"",documents:[],number:""}),i("/recurring_invoices/create?action=clone")};return[g=>!!l&&h.jsx($n,{to:Ut("/recurring_invoices/:id/edit",{id:g.id}),icon:h.jsx(an,{element:$Z}),children:e("edit")}),()=>!!l&&h.jsx(Ki,{withoutPadding:!0}),g=>(g.status_id===$C.DRAFT||g.status_id===$C.PAUSED)&&h.jsx(Is,{...!u&&{key:"start"},entity:"recurring_invoice",actionKey:"start",isCommonActionSection:!u,tooltipText:e("start"),onClick:()=>s(g,"start"),icon:twe,children:e("start")}),g=>g.status_id===$C.DRAFT&&h.jsx(Is,{...!u&&{key:"send_now"},entity:"recurring_invoice",actionKey:"send_now",isCommonActionSection:!u,tooltipText:e("start"),onClick:()=>o(!0),icon:BZ,children:e("send_now")}),g=>g.status_id===$C.ACTIVE&&h.jsx(Is,{...!u&&{key:"stop"},entity:"recurring_invoice",actionKey:"stop",isCommonActionSection:!u,tooltipText:e("stop"),onClick:()=>s(g,"stop"),icon:rwe,children:e("stop")}),g=>h.jsx(Is,{...!u&&{key:"view_pdf"},entity:"recurring_invoice",actionKey:"view_pdf",isCommonActionSection:!u,tooltipText:e("view_pdf"),to:Ut("/recurring_invoices/:id/pdf",{id:g.id}),icon:HZ,children:e("view_pdf")}),g=>!g.is_deleted&&h.jsx(V_n,{...!u&&{key:"update_prices"},selectedIds:[g.id],dropdown:u}),g=>!g.is_deleted&&h.jsx(W_n,{...!u&&{key:"increase_prices"},selectedIds:[g.id],dropdown:u}),g=>h.jsx(Tee,{...!u&&{key:"add_comment"},entity:"recurring_invoice",entityId:g.id,label:g.number,labelElement:h.jsx(Is,{entity:"recurring_invoice",actionKey:"add_comment",isCommonActionSection:!u,tooltipText:e("add_comment"),icon:FZ,children:e("add_comment")})}),()=>h.jsx(Ki,{withoutPadding:!0}),g=>r("create_recurring_invoice")&&h.jsx(Is,{...!u&&{key:"clone_to_recurring"},entity:"recurring_invoice",actionKey:"clone_to_recurring",isCommonActionSection:!u,tooltipText:e("clone_to_recurring"),onClick:()=>f(g),icon:Pb,children:e("clone_to_recurring")}),g=>h.jsx(z_n,{...!u&&{key:"clone_to_other"},recurringInvoice:g,dropdown:u}),()=>(d||!!c)&&h.jsx(Ki,{withoutPadding:!0}),g=>(d||!!c)&&hs(g)===Vr.Active&&h.jsx(Is,{...!u&&{key:"archive"},entity:"recurring_invoice",actionKey:"archive",isCommonActionSection:!u,tooltipText:e("archive"),onClick:()=>t([g.id],"archive"),icon:yu,excludePreferences:!0,disablePreventNavigation:!0,children:e("archive")}),g=>(d||!!c)&&(hs(g)===Vr.Archived||hs(g)===Vr.Deleted)&&h.jsx(Is,{...!u&&{key:"restore"},entity:"recurring_invoice",actionKey:"restore",isCommonActionSection:!u,tooltipText:e("restore"),onClick:()=>t([g.id],"restore"),icon:bu,excludePreferences:!0,disablePreventNavigation:!0,children:e("restore")}),g=>(d||!!c)&&(hs(g)===Vr.Active||hs(g)===Vr.Archived)&&h.jsx(Is,{...!u&&{key:"delete"},entity:"recurring_invoice",actionKey:"delete",isCommonActionSection:!u,tooltipText:e("delete"),onClick:()=>t([g.id],"delete"),icon:fc,excludePreferences:!0,disablePreventNavigation:!0,children:e("delete")})]}function P5r({setErrors:n,setIsFormBusy:e,isFormBusy:t}){const i=Yi(),r=ts(Lk);return(s,o)=>{if(t)return;n(void 0),pe.processing(),e(!0);const a=o?`/api/v1/recurring_invoices?${o}=true`:"/api/v1/recurring_invoices";Je("POST",ze(a),s).then(l=>{pe.success("created_recurring_invoice"),ii(["recurring_invoices"]),i(Ut("/recurring_invoices/:id/edit",{id:l.data.data.id}))}).catch(l=>{var c;if(((c=l.response)==null?void 0:c.status)===422){const u=l.response.data;u.errors.amount?pe.error(u.errors.amount[0]):pe.dismiss(),n(u)}}).finally(()=>{r(void 0),e(!1)})}}const rvn=["status","number","client","amount","remaining_cycles","next_send_date","frequency","due_date_days","auto_bill"];function svn(){const[n,e,t,i]=Sg({entity:"invoice"});return["status","number","client","amount","net_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 O5r(){var _;const{t:n}=xe(),{dateFormat:e}=Zc(),t=tvn(),i=nvn(),r=L9(),s=Ik(),o=evn({withTimezone:!0});svn();const a=vf(),l=Qo(),c=RA(),[u,d,f,p]=Sg({entity:"invoice"}),g=[{column:"status",id:"status_id",label:n("status"),format:(v,b)=>h.jsx(B_n,{entity:b})},{column:"number",id:"number",label:n("number"),format:(v,b)=>h.jsx(eg,{to:Ut("/recurring_invoices/:id/edit",{id:b.id}),renderSpan:s("recurring_invoice",b),children:v})},{column:"client",id:"client_id",label:n("client"),format:(v,b)=>{var y;return h.jsx(eg,{to:Ut("/clients/:id",{id:b.client_id}),renderSpan:s("client",b.client),children:(y=b.client)==null?void 0:y.display_name})}},{column:"amount",id:"amount",label:n("amount"),format:(v,b)=>{var y,C;return a(v,(y=b.client)==null?void 0:y.country_id,(C=b.client)==null?void 0:C.settings.currency_id)}},{column:"net_amount",id:"amount",label:n("net_amount"),format:(v,b)=>{var y,C;return a(Number(v)-Number(b.total_taxes||0),(y=b.client)==null?void 0:y.country_id,(C=b.client)==null?void 0:C.settings.currency_id)}},{column:"remaining_cycles",id:"remaining_cycles",label:n("remaining_cycles"),format:v=>Number(v)<0?n("endless"):v},{column:"next_send_date",id:"next_send_datetime",label:n("next_send_date"),format:(v,b)=>o(v,"","",i(t(b.client,"timezone_id")).timeZone)},{column:"frequency",id:"frequency_id",label:n("frequency"),format:v=>h.jsx(Dnt,{for:$_n,code:v,headless:!0})},{column:"due_date_days",id:"due_date_days",label:n("due_date"),format:v=>v==="terms"?n("use_payment_terms"):Number(v)===1?n("first_day_of_the_month"):v},{column:"auto_bill",id:"auto_bill",label:n("auto_bill"),format:v=>n(String(v))},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:v=>so(v,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:v=>so(v,e)},{column:u,id:"custom_value1",label:u,format:v=>c("invoice1",v==null?void 0:v.toString())},{column:d,id:"custom_value2",label:d,format:v=>c("invoice2",v==null?void 0:v.toString())},{column:f,id:"custom_value3",label:f,format:v=>c("invoice3",v==null?void 0:v.toString())},{column:p,id:"custom_value4",label:p,format:v=>c("invoice4",v==null?void 0:v.toString())},{column:"discount",id:"discount",label:n("discount"),format:(v,b)=>{var y,C;return b.is_amount_discount?a(v,(y=b.client)==null?void 0:y.country_id,(C=b.client)==null?void 0:C.settings.currency_id):`${r(v)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(v,b)=>b.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(v,b)=>h.jsx(ev,{entity:b})},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:v=>r(v)},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:v=>so(v,e)},{column:"po_number",id:"po_number",label:n("po_number")},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:v=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(l!=null&&l.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(v)}})}),children:h.jsx("span",{children:Mb(gu(v)).slice(0,50)})})},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:v=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(l!=null&&l.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(v)}})}),children:h.jsx("span",{children:Mb(gu(v)).slice(0,50)})})},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:v=>so(v,e)}],m=((_=l==null?void 0:l.react_table_columns)==null?void 0:_.recurringInvoice)||rvn;return g.filter(v=>m.includes(v.column)).sort((v,b)=>m.indexOf(v.column)-m.indexOf(b.column))}function ovn(){const[n]=xe(),e=Um();return[{label:n("draft"),value:"draft",color:"white",backgroundColor:"#6B7280"},{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 avn(){const[n]=xe(),e=Um();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 lvn=Ls(void 0);var Uz={exports:{}},cvn=Uz.exports,qje;function uvn(){return qje||(qje=1,function(n,e){(function(t,i){n.exports=i()})(cvn,function(){var t,i,r=1e3,s=6e4,o=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)?)?$/,f={years:c,months:u,days:a,hours:o,minutes:s,seconds:r,milliseconds:1,weeks:6048e5},p=function(k){return k instanceof C},g=function(k,I,L){return new C(k,L,I.$l)},m=function(k){return i.p(k)+"s"},_=function(k){return k<0},v=function(k){return _(k)?Math.ceil(k):Math.floor(k)},b=function(k){return Math.abs(k)},y=function(k,I){return k?_(k)?{negative:!0,format:""+b(k)+I}:{negative:!1,format:""+k+I}:{negative:!1,format:""}},C=function(){function k(L,N,P){var O=this;if(this.$d={},this.$l=P,L===void 0&&(this.$ms=0,this.parseFromMilliseconds()),N)return g(L*f[m(N)],this);if(typeof L=="number")return this.$ms=L,this.parseFromMilliseconds(),this;if(typeof L=="object")return Object.keys(L).forEach(function(M){O.$d[m(M)]=L[M]}),this.calMilliseconds(),this;if(typeof L=="string"){var F=L.match(d);if(F){var V=F.slice(2).map(function(M){return M!=null?Number(M):0});return this.$d.years=V[0],this.$d.months=V[1],this.$d.weeks=V[2],this.$d.days=V[3],this.$d.hours=V[4],this.$d.minutes=V[5],this.$d.seconds=V[6],this.calMilliseconds(),this}}return this}var I=k.prototype;return I.calMilliseconds=function(){var L=this;this.$ms=Object.keys(this.$d).reduce(function(N,P){return N+(L.$d[P]||0)*f[P]},0)},I.parseFromMilliseconds=function(){var L=this.$ms;this.$d.years=v(L/c),L%=c,this.$d.months=v(L/u),L%=u,this.$d.days=v(L/a),L%=a,this.$d.hours=v(L/o),L%=o,this.$d.minutes=v(L/s),L%=s,this.$d.seconds=v(L/r),L%=r,this.$d.milliseconds=L},I.toISOString=function(){var L=y(this.$d.years,"Y"),N=y(this.$d.months,"M"),P=+this.$d.days||0;this.$d.weeks&&(P+=7*this.$d.weeks);var O=y(P,"D"),F=y(this.$d.hours,"H"),V=y(this.$d.minutes,"M"),M=this.$d.seconds||0;this.$d.milliseconds&&(M+=this.$d.milliseconds/1e3,M=Math.round(1e3*M)/1e3);var B=y(M,"S"),W=L.negative||N.negative||O.negative||F.negative||V.negative||B.negative,q=F.format||V.format||B.format?"T":"",U=(W?"-":"")+"P"+L.format+N.format+O.format+q+F.format+V.format+B.format;return U==="P"||U==="-P"?"P0D":U},I.toJSON=function(){return this.toISOString()},I.format=function(L){var N=L||"YYYY-MM-DDTHH:mm:ss",P={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 N.replace(l,function(O,F){return F||String(P[O])})},I.as=function(L){return this.$ms/f[m(L)]},I.get=function(L){var N=this.$ms,P=m(L);return P==="milliseconds"?N%=1e3:N=P==="weeks"?v(N/f[P]):this.$d[P],N||0},I.add=function(L,N,P){var O;return O=N?L*f[m(N)]:p(L)?L.$ms:g(L,this).$ms,g(this.$ms+O*(P?-1:1),this)},I.subtract=function(L,N){return this.add(L,N,!0)},I.locale=function(L){var N=this.clone();return N.$l=L,N},I.clone=function(){return g(this.$ms,this)},I.humanize=function(L){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!L)},I.valueOf=function(){return this.asMilliseconds()},I.milliseconds=function(){return this.get("milliseconds")},I.asMilliseconds=function(){return this.as("milliseconds")},I.seconds=function(){return this.get("seconds")},I.asSeconds=function(){return this.as("seconds")},I.minutes=function(){return this.get("minutes")},I.asMinutes=function(){return this.as("minutes")},I.hours=function(){return this.get("hours")},I.asHours=function(){return this.as("hours")},I.days=function(){return this.get("days")},I.asDays=function(){return this.as("days")},I.weeks=function(){return this.get("weeks")},I.asWeeks=function(){return this.as("weeks")},I.months=function(){return this.get("months")},I.asMonths=function(){return this.as("months")},I.years=function(){return this.get("years")},I.asYears=function(){return this.as("years")},k}(),S=function(k,I,L){return k.add(I.years()*L,"y").add(I.months()*L,"M").add(I.days()*L,"d").add(I.hours()*L,"h").add(I.minutes()*L,"m").add(I.seconds()*L,"s").add(I.milliseconds()*L,"ms")};return function(k,I,L){t=L,i=L().$utils(),L.duration=function(O,F){var V=L.locale();return g(O,{$l:V},F)},L.isDuration=p;var N=I.prototype.add,P=I.prototype.subtract;I.prototype.add=function(O,F){return p(O)?S(this,O,1):N.bind(this)(O,F)},I.prototype.subtract=function(O,F){return p(O)?S(this,O,-1):P.bind(this)(O,F)}}})}(Uz)),Uz.exports}var dvn=uvn();const hvn=Cl(dvn);var qz={exports:{}},fvn=qz.exports,Kje;function pvn(){return Kje||(Kje=1,function(n,e){(function(t,i){n.exports=i()})(fvn,function(){return function(t,i,r){t=t||{};var s=i.prototype,o={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,f){return s.fromToBase(c,u,d,f)}r.en.relativeTime=o,s.fromToBase=function(c,u,d,f,p){for(var g,m,_,v=d.$locale().relativeTime||o,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 S=b[C];S.d&&(g=f?r(c).diff(d,S.d,!0):d.diff(c,S.d,!0));var k=(t.rounding||Math.round)(Math.abs(g));if(_=g>0,k<=S.r||!S.r){k<=1&&C>0&&(S=b[C-1]);var I=v[S.l];p&&(k=p(""+k)),m=typeof I=="string"?I.replace("%d",k):I(k,u,S.l,_);break}}if(u)return m;var L=_?v.future:v.past;return typeof L=="function"?L(m):L.replace("%s",m)},s.to=function(c,u){return a(c,u,this,!0)},s.from=function(c,u){return a(c,u,this)};var l=function(c){return c.$u?r.utc():r()};s.toNow=function(c){return this.to(l(this),c)},s.fromNow=function(c){return this.from(l(this),c)}}})}(qz)),qz.exports}var gvn=pvn();const mvn=Cl(gvn);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function jb(n){if(n===""||n==="[]")return[];const e=[[0,0,"",!0]],t=JSON.parse(n);return t.length?t:e}function _vn(n,e=!1){const t=jb(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),s=Math.floor(i%3600/60),o=i%60;return r<24?`${r}:${s.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${r}h`}function M5r(n,e){const t=jb(n);Jn.extend(hvn),Jn.extend(mvn);let i=0;if(e!=null&&e.calculateLastTimeLog){const r=t.length-1,s=t[r][0],o=s?Jn.unix(s):Jn();i+=Jn().diff(o,"seconds")}else t.map(([r,s])=>{const o=r?Jn.unix(r):Jn(),a=s?Jn.unix(s):Jn();i+=a.diff(o,"seconds")});return e!=null&&e.inSeconds?i.toString():i>86400?Jn.duration(i,"seconds").humanize():Jn.duration(i,"seconds").format("HH:mm:ss")}function j5r(n,e){const i=jb(n)[e],r=i?Jn.unix(i[0]):Jn(),o=(i?Jn.unix(i[1]):Jn()).diff(r,"seconds");return new Date(o*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 SEe(n){const{isAdmin:e}=go();return lr(["/api/v1/task_statuses","create"],()=>Je("GET",ze("/api/v1/task_statuses/create")).then(t=>t.data.data),{staleTime:1/0,enabled:e?(n==null?void 0:n.enabled)??!0:!1})}function iit(n){return lr(["/api/v1/task_statuses",n],()=>Je("GET",ze("/api/v1/task_statuses?status=:status",{status:(n==null?void 0:n.status)||"all"})).then(e=>e.data),{staleTime:1/0})}function vvn(n){return lr(["/api/v1/task_statuses",n.id],()=>Je("GET",ze("/api/v1/task_statuses/:id",{id:n.id})),{staleTime:1/0})}function bvn(){return(n,e)=>{pe.processing(),Je("POST",ze("/api/v1/task_statuses/bulk"),{action:e,ids:[n]}).then(()=>{pe.success(`${e}d_task_status`),ii(["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 rit(n){let e=!1;const i=jb(n.time_log).sort((s,o)=>s[0]-o[0]);let r=0;return i.forEach(([s,o],a)=>{const l=i[a+1];o==0&&l&&(e=!0),l&&o>l[0]&&(e=!0),o!==0&&s>o&&(e=!0),o===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 yvn(n){const{isFormBusy:e,setErrors:t,setIsFormBusy:i}=n;return r=>{if(!e){if(i(!0),pe.processing(),rit(r))return i(!1),pe.error("task_errors");Je("PUT",ze("/api/v1/tasks/:id",{id:r.id}),r).then(()=>{pe.success("updated_task"),ii(["tasks"])}).catch(s=>{var o;((o=s.response)==null?void 0:o.status)===422&&(pe.dismiss(),t==null||t(s.response.data))}).finally(()=>i(!1))}}}function EEe(n){return(e,t)=>{n.setErrors(void 0),n.setTaskStatus(i=>i&&{...i,[e]:t})}}function Cvn(){const[n]=xe(),e=bvn();return[i=>i.archived_at===0&&h.jsx($n,{onClick:()=>e(i.id,"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),i=>i.archived_at>0&&h.jsx($n,{onClick:()=>e(i.id,"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),i=>!i.is_deleted&&h.jsx($n,{onClick:()=>e(i.id,"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}function wvn(n){const[e]=xe(),t=Lo(),{data:i}=SEe(),[r,s]=x.useState(),[o,a]=x.useState(!1),[l,c]=x.useState(),u=EEe({setErrors:s,setTaskStatus:c}),d=()=>{o||(pe.processing(),s(void 0),a(!0),Je("POST",ze("/api/v1/task_statuses"),l).then(f=>{var p;pe.success("created_task_status"),ii(["task_statuses"]),c(i),(p=n.onCreatedTaskStatus)==null||p.call(n,f.data.data),n.setVisible(!1)}).catch(f=>{var p;((p=f.response)==null?void 0:p.status)===422&&(s(f.response.data),pe.dismiss())}).finally(()=>a(!1)))};return x.useEffect(()=>{i&&c(i)},[i]),h.jsxs(pr,{title:e("new_task_status"),visible:n.visible,onClose:()=>{n.setVisible(!1),c(i)},children:[h.jsx(lt,{required:!0,label:e("name"),value:l==null?void 0:l.name,onValueChange:f=>u("name",f),errorMessage:r==null?void 0:r.errors.name}),h.jsx(Lh,{children:e("color")}),h.jsx(xw,{value:(l==null?void 0:l.color)||t,onValueChange:f=>u("color",f)}),h.jsx(dn,{className:"self-end",behavior:"button",disabled:o,onClick:d,children:e("save")})]})}const Gje=As.div` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function Yje(n){const[e]=xe(),t=xt(),{isAdmin:i,isOwner:r}=go(),{visible:s,isFormBusy:o,setIsFormBusy:a,task:l,setVisible:c}=n,[u,d]=x.useState(!1),{data:f}=iit({status:"active"}),p=yvn({isFormBusy:o,setIsFormBusy:a});return h.jsxs(h.Fragment,{children:[h.jsx(o9,{placement:"bottom",interactive:!0,render:()=>h.jsxs("div",{className:"border box rounded-md shadow-lg focus:outline-none p-1",style:{backgroundColor:t.$1,borderColor:t.$4,minWidth:"13rem",maxWidth:"20rem"},children:[h.jsx("div",{className:"flex flex-col max-h-80 overflow-y-auto",children:f==null?void 0:f.data.map((g,m)=>h.jsxs(Gje,{className:"flex items-center p-2 space-x-2 rounded-sm",onClick:()=>{c(!1),p({...l,status_id:g.id})},theme:{hoverColor:t.$7},children:[h.jsx("div",{children:g.id===l.status_id?h.jsx(Ont,{size:"1.2rem",filledColor:t.$1,borderColor:t.$3}):h.jsx(Mnt,{size:"1.2rem",color:t.$17})}),h.jsx("span",{className:"truncate",children:g.name})]},m))}),!(f!=null&&f.data.length)&&h.jsx("div",{className:"font-medium text-center py-2 text-xs",children:e("no_records_found")}),(i||r)&&h.jsx(Gje,{className:"flex items-center font-medium text-center p-2 rounded-sm",onClick:()=>{d(!0),c(!1)},theme:{hoverColor:t.$7},children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(nc,{color:t.$17,size:"1.2rem"}),h.jsx("span",{children:e("create_new")})]})})]}),visible:s,children:h.jsx("div",{})}),h.jsx(wvn,{visible:u,setVisible:d,onCreatedTaskStatus:g=>p({...l,status_id:g.id})})]})}function xvn(n){const[e]=xe(),t=x.useRef(null);xt();const i=g4(),r=Um(),{invoice_id:s,archived_at:o,is_deleted:a,time_log:l,status:c}=n.entity,[u,d]=x.useState(!1),[f,p]=x.useState(!1);Uw(t,()=>{u&&d(!1)});const g=()=>{const m=jb(l),_=m.length;return _?m[_-1][1]===0:!1};if(a)return h.jsx(as,{variant:"red",children:e("deleted")});if(o)return h.jsx(as,{variant:"orange",children:e("archived")});if(s)return h.jsx(as,{variant:"green",style:{backgroundColor:r.$3},children:e("invoiced")});if(g())return h.jsx(as,{variant:"light-blue",style:{backgroundColor:r.$2},children:e("running")});if(c){const{red:m,green:_,blue:v,hex:b}=f4(c.color),y=p4(m,_,v)?-220:220;return h.jsxs("div",{ref:t,onClick:C=>C.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center",children:[h.jsx("div",{className:$t("text-xs rounded-l px-2 py-1 border-r border-white font-medium",{"rounded-r border-r-0":n.withoutDropdown}),style:{color:i(b,y),backgroundColor:c.color},children:c.name}),!n.withoutDropdown&&h.jsx("div",{className:"flex items-center justify-center rounded-r py-1 h-full",style:{color:i(b,y),backgroundColor:c.color,width:"1.5rem"},onClick:()=>!f&&d(C=>!C),children:h.jsx($y,{color:i(b,y),size:"1rem"})})]}),h.jsx(Yje,{visible:u,isFormBusy:f,setIsFormBusy:p,task:n.entity,setVisible:d})]})}return h.jsxs("div",{ref:t,onClick:m=>m.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center",children:[h.jsx("div",{className:$t("text-xs rounded-l px-2 py-1 border-r border-white font-medium bg-gray-100 text-gray-800",{"rounded-r border-r-0":n.withoutDropdown}),children:e("logged")}),!n.withoutDropdown&&h.jsx("div",{className:"flex items-center justify-center rounded-r py-1 h-full bg-gray-100",onClick:()=>!f&&d(m=>!m),style:{width:"1.5rem"},children:h.jsx($y,{color:"#1f2937",size:"1rem"})})]}),h.jsx(Yje,{visible:u,isFormBusy:f,setIsFormBusy:p,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 HC(n){let e=!1;return jb(n.time_log).forEach(([,t])=>{t===0&&(e=!0)}),e}function Svn(n){return n.invoice_id?"invoiced":HC(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 kEe(){const n=zi(),e=N9(),t=r=>r||(n!=null&&n.use_comma_as_decimal_place?".":","),i=r=>r||(n!=null&&n.use_comma_as_decimal_place?",":".");return(r,s,o,a)=>mpe(r.replaceAll(",",""),{thousandSeparator:t(s),decimalSeparator:i(o),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 Evn(){const n=Zd();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 sit(){const n=zi(),e=A9(),{timeFormat:t}=m4(),i=Evn();return async r=>{const o={dateFormat:i(n==null?void 0:n.settings.date_format_id),timeFormat:t};return r.length>=1&&await e.find(r).then(a=>{a.settings.date_format_id&&(o.dateFormat=i(a.settings.date_format_id)),o.timeFormat=t}),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 oit(n){const[e]=xe(),{onlyAddToInvoice:t}=n||{},i=Yi(),r=kEe(),s=CEe(),o=zi(),{data:a}=bEe(),{timeFormat:l}=m4(),c=N9(),{dateFormat:u}=Zc(),d=ts(Gw),f=sit(),p=(g,m)=>{const _=jb(g);let v=0;return _.length&&_.forEach(([b,y,,C])=>{if(C||!(o!=null&&o.settings.allow_billable_task_items)||typeof C>"u"){const S=Jn.unix(b),k=Jn.unix(y);v+=k.diff(S,"seconds")}}),Number((v/3600).toFixed(3))};return async g=>{var m,_,v,b,y,C,S,k,I,L,N;if(a){const P={...a};if(o&&o.enabled_tax_rates>0&&(P.tax_name1=(m=o.settings)==null?void 0:m.tax_name1,P.tax_rate1=(_=o.settings)==null?void 0:_.tax_rate1),o&&o.enabled_tax_rates>1&&(P.tax_name2=(v=o.settings)==null?void 0:v.tax_name2,P.tax_rate2=(b=o.settings)==null?void 0:b.tax_rate2),o&&o.enabled_tax_rates>2&&(P.tax_name3=(y=o.settings)==null?void 0:y.tax_name3,P.tax_rate3=(C=o.settings)==null?void 0:C.tax_rate3),P.uses_inclusive_taxes=((S=o==null?void 0:o.settings)==null?void 0:S.inclusive_taxes)??!1,ql(g).pluck("client_id").unique().toArray().length>1)return pe.error("multiple_client_error");P.client_id=g[0].client_id,(k=g[0])!=null&&k.project_id&&(P.project_id=(I=g[0])==null?void 0:I.project_id);const F=await s((L=g[0])==null?void 0:L.client_id,"client_id"),{dateFormat:V,timeFormat:M}=await f((N=g[0])==null?void 0:N.client_id);g.forEach(B=>{var z,Z;const W=jb(B.time_log),q=[];W.forEach(([X,oe,fe,Se])=>{if(Se||!(o!=null&&o.settings.allow_billable_task_items)||typeof Se>"u"){let Me="";if(o.invoice_task_hours){const ge=Jn.unix(X),ye=Jn.unix(oe);Me=`• ${r((ye.diff(ge,"seconds")/3600).toString(),F==null?void 0:F.thousandSeparator,F==null?void 0:F.decimalSeparator,F==null?void 0:F.precision)} ${e("hours")}`}const Ie=[];(o.invoice_task_datelog||o.invoice_task_timelog)&&Ie.push('<div class="task-time-details">'),o.invoice_task_datelog&&Ie.push(Jn.unix(X).format(V!=null&&V.format_moment?V.format_moment:u)),o.invoice_task_timelog&&Ie.push(Jn.unix(X).format(M||l)+" - "),o.invoice_task_timelog&&Ie.push(Jn.unix(oe).format(M||l)),o.invoice_task_hours&&Ie.push(Me),o.invoice_task_item_description&&fe&&Ie.push(` ${fe}`),(o.invoice_task_datelog||o.invoice_task_timelog)&&(Ie.push(` `),Ie.push("</div>")),q.push(Ie.join(" "))}});const U=p(B.time_log),G={...Tk(),type_id:Uy.Task,cost:B.rate,quantity:U,line_total:Number((B.rate*U).toFixed(c)),task_id:B.id,tax_id:"",custom_value1:B.custom_value1,custom_value2:B.custom_value2,custom_value3:B.custom_value3,custom_value4:B.custom_value4},H=o.invoice_task_project&&((z=B==null?void 0:B.project)!=null&&z.name)?"## "+((Z=B.project)==null?void 0:Z.name)+` `:"";q.length&&(G.notes=H+(B==null?void 0:B.description)+" "+q.join(" ")),typeof P.line_items=="string"&&(P.line_items=[]),P.line_items.push(G)}),t?d(B=>B&&{...B,line_items:[...B.line_items,...P.line_items]}):(d(P),i(Ut("/invoices/create?table=tasks&project=:projectAssigned&action=invoice_task",{projectAssigned:!!g[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 kvn(){const n=Vs(),e=ji(wu),t=gc();return i=>{pe.processing(),Je("PUT",ze("/api/v1/tasks/:id?start=true",{id:i.id}),i).then(()=>{t.pathname.endsWith("/create")?pe.dismiss():pe.success("started_task"),ii(["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 Tvn(){const n=Vs(),e=ji(wu);return t=>{pe.processing();const i=jb(t.time_log),r=i[i.length-1][0],s=Jn().unix();if(r&&r>s)i[i.length-1][1]=r+1,t.time_log=JSON.stringify(i);else if(rit(t))return pe.error("task_errors");Je("PUT",ze("/api/v1/tasks/:id?stop=true",{id:t.id}),t).then(()=>{pe.success("stopped_task"),ii(["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 F5r(n){return lr(["/api/v1/tasks",n.id],()=>Je("GET",ze("/api/v1/tasks/:id?include=status",{id:n.id})).then(e=>e.data.data),{staleTime:1/0,enabled:n.enabled??!0})}function B5r(n){const e=jo();return lr(["/api/v1/tasks/create"],()=>Je("GET",ze("/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 $5r(n){return lr(["/api/v1/tasks",n],()=>Je("GET",ze(":endpoint",{endpoint:n.endpoint||"/api/v1/tasks"})).then(e=>e.data),{staleTime:1/0})}const TEe=()=>{const n=Vs(),e=ji(wu);return(t,i,r)=>{const{column:s,new_value:o}=r||{};return pe.processing(),Je("POST",ze("/api/v1/tasks/bulk"),{action:i,ids:t,...s&&{column:s},...i==="bulk_update"&&{new_value:o}}).then(()=>{i!=="start"&&i!=="stop"&&pe.success(`${i}d_task`),i==="start"&&pe.success(Ua("started_tasks",{value:t.length})),i==="stop"&&pe.success(Ua("stopped_tasks",{value:t.length})),e&&n.invalidateQueries([e]),ii(["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 */function Ivn(){const n=Vs(),e=ji(wu);return async(t,i)=>(pe.processing(),Je("POST",ze("/api/v1/projects/bulk"),{action:i,ids:t}).then(r=>(i!=="invoice"&&pe.success(`${i}d_project`),r)).finally(()=>{ii(["projects"]),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 Lvn=(n,e)=>{const t=jb(n);let i=0;return t.length&&t.forEach(([r,s])=>{if(r&&s){const o=Jn.unix(r),a=Jn.unix(s);i+=a.diff(o,"seconds")}}),Number((i/3600).toFixed(3))};function H5r(){const n=Yi(),e=Ivn(),t=ts(Gw);return i=>{pe.processing(),e(i,"invoice").then(r=>{t(r.data.data),n(Ut("/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 Avn(n){const[e]=xe(),{tasks:t}=n,i=Yi(),r=kEe(),s=CEe(),o=sit(),a=zi(),{timeFormat:l}=m4(),c=N9(),{dateFormat:u}=Zc(),d=ts(Gw);return async f=>{var g,m;const p=pn.cloneDeep(f);if(t){const _=await s((g=t[0])==null?void 0:g.client_id,"client_id"),{dateFormat:v,timeFormat:b}=await o((m=t[0])==null?void 0:m.client_id);t.forEach(y=>{var N,P;const C=jb(y.time_log),S=[];C.forEach(([O,F,V,M])=>{if(M||!(a!=null&&a.settings.allow_billable_task_items)||typeof M>"u"){let B="";if(a.invoice_task_hours){const q=Jn.unix(O),U=Jn.unix(F);B=`• ${r((U.diff(q,"seconds")/3600).toString(),_==null?void 0:_.thousandSeparator,_==null?void 0:_.decimalSeparator,_==null?void 0:_.precision)} ${e("hours")}`}const W=[];(a.invoice_task_datelog||a.invoice_task_timelog)&&W.push(`<div class="task-time-details"> `),a.invoice_task_datelog&&W.push(Jn.unix(O).format(v!=null&&v.format_moment?v.format_moment:u)),a.invoice_task_timelog&&W.push(Jn.unix(O).format(b||l)+" - "),a.invoice_task_timelog&&W.push(Jn.unix(F).format(b||l)),a.invoice_task_hours&&W.push(B),a.invoice_task_item_description&&V&&W.push(` ${V}`),(a.invoice_task_datelog||a.invoice_task_timelog)&&(W.push(` `),W.push(`</div> `)),S.push(W.join(" "))}});const k=Lvn(y.time_log),I={...Tk(),type_id:Uy.Task,cost:y.rate,quantity:k,line_total:Number((y.rate*k).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&&((N=y==null?void 0:y.project)!=null&&N.name)?"## "+((P=y.project)==null?void 0:P.name)+` `:"";S.length&&(I.notes=L+(y==null?void 0:y.description)+" "+S.join(" ")),typeof p.line_items=="string"&&(p.line_items=[]),p.line_items.push(I)}),d(p),i(Ut("/invoices/:id/edit?action=add_tasks&table=tasks",{id:p.id}))}}}function Nvn(n){const{visible:e,setVisible:t,tasks:i,invoices:r}=n,s=vf(),o=Avn({tasks:i});return h.jsx(pr,{title:Ua("add_to_invoice",{invoice:""}),visible:e,onClose:()=>t(!1),children:h.jsx("div",{className:"flex flex-col overflow-y-auto max-h-96",children:r==null?void 0:r.map((a,l)=>{var c,u;return h.jsxs("div",{className:"flex justify-between py-2 cursor-pointer hover:bg-gray-100 px-3",onClick:()=>o(a),children:[h.jsx("span",{children:a.number}),h.jsx("span",{children:s(a.amount,(c=a.client)==null?void 0:c.country_id,(u=a.client)==null?void 0:u.settings.currency_id)})]},l)})})})}function ait(n){const{tasks:e,isBulkAction:t}=n,i=Vs(),r=jo(),s=wee(),[o,a]=x.useState(!1),[l,c]=x.useState([]),u=()=>{if(!e.length)return pe.error("no_invoices_found");const d=e.map(p=>p.client_id);if(d.some(p=>!p))return pe.error("no_invoices_found");if(d.length){const p=d[0];if(d.some(m=>m!==p))return pe.error("multiple_client_error")}pe.processing(),i.fetchQuery(["/api/v1/invoices","client_id",e[0].client_id],()=>Je("GET",ze("/api/v1/invoices?client_id=:clientId&include=client&status=active&per_page=100",{clientId:e[0].client_id})),{staleTime:1/0}).then(p=>{if(pe.dismiss(),!p.data.data.length)return pe.error("no_invoices_found");r("edit_invoice")?c(p.data.data):c(p.data.data.filter(g=>s(g))),a(!0)})};return(e.length&&e[0].client_id&&!e[0].invoice_id||t)&&(r("create_invoice")||r("edit_invoice"))?h.jsxs(h.Fragment,{children:[h.jsx(Nvn,{visible:o,setVisible:a,tasks:e,invoices:l}),h.jsx($n,{onClick:u,icon:h.jsx(an,{element:eTt}),children:Ua("add_to_invoice",{invoice:""})})]}):h.jsx(h.Fragment,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Dvn(){const{data:n}=Zd(),[e,t]=x.useState();return x.useEffect(()=>{n!=null&&n.bulk_updates&&t(n.bulk_updates)},[n]),e}function Rvn(n){var m;const[e]=xe(),t=Lo(),{isAdmin:i,isOwner:r}=go(),[s,o]=x.useState(!1),[a,l]=x.useState(!1),[c,u]=x.useState(),[d,f]=x.useState(),{data:p}=SEe({enabled:s}),g=()=>{a||(pe.processing(),f(void 0),l(!0),Je("POST",ze("/api/v1/task_statuses"),c).then(_=>{pe.success("created_task_status"),ii(["task_statuses"]),u(p),n.onChange(_.data.data),o(!1)}).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===422&&(f(_.response.data),pe.dismiss())}).finally(()=>l(!1)))};return x.useEffect(()=>{p&&u(p)},[p]),h.jsxs(h.Fragment,{children:[h.jsxs(pr,{title:e("new_task_status"),visible:s,onClose:()=>{o(!1),u(p)},children:[h.jsx(lt,{required:!0,label:e("name"),value:c==null?void 0:c.name,onValueChange:_=>u(v=>v&&{...v,name:_}),errorMessage:d==null?void 0:d.errors.name}),h.jsx(Lh,{children:e("color")}),h.jsx(xw,{value:(c==null?void 0:c.color)||t,onValueChange:_=>u(v=>v&&{...v,color:_})}),h.jsx(dn,{className:"self-end",behavior:"button",onClick:g,children:e("save")})]}),h.jsx(qd,{endpoint:ze("/api/v1/task_statuses?status=active"),onChange:_=>_.resource&&n.onChange(_.resource),inputOptions:{label:(m=n.inputLabel)==null?void 0:m.toString(),value:n.value||null},entryOptions:{id:"id",label:"name",value:"id"},action:{label:e("new_task_status"),onClick:()=>o(!0),visible:(i||r)&&!n.withoutAction},onDismiss:n.onClearButtonClick,readonly:n.readonly,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 Pvn(n){const e=jo();return lr(["/api/v1/projects/create"],()=>Je("GET",ze("/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 V5r(n){return lr(["/api/v1/projects",n.id],()=>Je("GET",ze("/api/v1/projects/:id?include=client",{id:n.id})).then(e=>e.data.data),{staleTime:1/0})}function Ovn(n){return lr(["/api/v1/projects",n],()=>{var e;return Je("GET",ze("/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 Mvn(n){const[e]=xe(),{data:t}=Pvn(),[i,r]=x.useState(),[s,o]=x.useState(),[a,l]=x.useState(!1),c=zi(),u=A9(),d=(p,g)=>{o(void 0),r(m=>m&&{...m,[p]:g})};x.useEffect(()=>{t&&r({...t,task_rate:(c==null?void 0:c.settings.default_task_rate)||0})},[t]),x.useEffect(()=>{i!=null&&i.client_id&&i.client_id.length>1&&u.find(i.client_id).then(p=>{p.settings.default_task_rate&&d("task_rate",p.settings.default_task_rate)})},[i==null?void 0:i.client_id]);const f=p=>{p.preventDefault(),a||(pe.processing(),o(void 0),l(!0),Je("POST",ze("/api/v1/projects"),i).then(g=>{pe.success("created_project"),ii(["projects"]),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:ze("/api/v1/projects")}})),n.onProjectCreated(g.data.data),r(t),n.setVisible(!1)}).catch(g=>{var m;((m=g.response)==null?void 0:m.status)===422&&(pe.dismiss(),o(g.response.data))}).finally(()=>l(!1)))};return h.jsx(pr,{title:e("new_project"),size:"regular",visible:n.visible,onClose:()=>{r(t),n.setVisible(!1)},children:i?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grid grid-cols-2 gap-x-5 gap-y-3",children:[h.jsx(lt,{label:e("project_name"),value:i.name,onValueChange:p=>d("name",p),errorMessage:s==null?void 0:s.errors.name}),h.jsx(DA,{inputLabel:e("client"),value:i.client_id,onChange:p=>d("client_id",p.id),clearButton:!0,onClearButtonClick:()=>d("client_id",""),errorMessage:s==null?void 0:s.errors.client_id}),h.jsx(Cee,{inputLabel:e("assigned_user"),value:i.assigned_user_id,onChange:p=>d("assigned_user_id",p.id),onClearButtonClick:()=>d("assigned_user_id",""),errorMessage:s==null?void 0:s.errors.assigned_user_id}),h.jsx(lt,{label:e("due_date"),type:"date",value:i.due_date,onValueChange:p=>d("due_date",p),errorMessage:s==null?void 0:s.errors.due_date}),h.jsx(lt,{label:e("budgeted_hours"),value:i.budgeted_hours,onValueChange:p=>d("budgeted_hours",p),errorMessage:s==null?void 0:s.errors.budgeted_hours}),h.jsx(lt,{label:e("task_rate"),value:i.task_rate,onValueChange:p=>d("task_rate",p),errorMessage:s==null?void 0:s.errors.task_rate}),h.jsx(lt,{label:e("public_notes"),element:"textarea",value:i.public_notes,onValueChange:p=>d("public_notes",p),errorMessage:s==null?void 0:s.errors.public_notes}),h.jsx(lt,{label:e("private_notes"),element:"textarea",value:i.private_notes,onValueChange:p=>d("private_notes",p),errorMessage:s==null?void 0:s.errors.private_notes})]}),h.jsx(dn,{className:"flex self-end",disableWithoutIcon:!0,disabled:!i||a,onClick:f,children:e("save")})]}):h.jsx(yo,{})})}function jvn(n){var o;const[e]=xe(),t=jo(),[i,r]=x.useState(!1),s=n.clientId?`&client_id=${n.clientId}`:"";return h.jsxs(h.Fragment,{children:[h.jsx(Mvn,{visible:i,setVisible:r,onProjectCreated:a=>n.onChange(a)}),h.jsx(qd,{inputOptions:{label:(o=n.inputLabel)==null?void 0:o.toString(),value:n.value??null},endpoint:ze(`/api/v1/projects?status=active&filter_deleted_clients=true${s}`),entryOptions:{id:"id",label:"name",value:"id"},onChange:a=>a.resource?n.onChange(a.resource):null,readonly:n.readonly,onDismiss:n.onClearButtonClick,action:{label:e("new_project"),onClick:()=>r(!0),visible:t("create_project")&&!n.withoutAction}}),h.jsx(Kl,{className:"mt-2",children:n.errorMessage})]})}const Fvn=[{key:"private_notes",type:"markdownEditor"},{key:"public_notes",type:"markdownEditor"},{key:"terms",type:"markdownEditor"},{key:"footer",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"},{key:"tax1",type:"taxSelector"},{key:"tax2",type:"taxSelector"},{key:"tax3",type:"taxSelector"},{key:"should_be_invoiced",type:"toggle"},{key:"uses_inclusive_taxes",type:"toggle"},{key:"remaining_cycles",type:"remainingCyclesSelector"},{key:"status_id",type:"statusSelector"},{key:"assigned_user_id",type:"userSelector"},{key:"project_id",type:"projectSelector"},{key:"client_id",type:"clientSelector"}];function lit(n){var I;const[e]=xe(),{setSelected:t,resourceIds:i}=n,r=TEe(),s=_Ee(),o=Rnt(),a=Iee(),{data:l}=Zd(),c=zi(),u=Dvn(),[d,f]=x.useState(""),[p,g]=x.useState(""),[m,_]=x.useState(!1),v=()=>{_(!1),f("")},b=()=>{var L;return n.entity==="expense"&&d.includes("notes")?"textarea":((L=Fvn.find(({key:N})=>N===d))==null?void 0:L.type)||""};x.useEffect(()=>{g(d==="remaining_cycles"?"-1":d==="uses_inclusive_taxes"?!1:"")},[d]);const y=L=>{if(L.includes("rate"))return!1;if(L.startsWith("custom_value"))return!!c.custom_fields[L.replace("custom_value",n.entity)];if(L.startsWith("tax")){const N=Number(L.split("tax")[1]),P=n.entity==="expense"?c.enabled_expense_tax_rates:c.enabled_tax_rates;return N===1?P>0:N===2?P>1:P>2}return!0},C=L=>L.startsWith("custom_value")?c.custom_fields[L.replace("custom_value",n.entity)].split("|")[0]:e(L==="status_id"?"status":L==="assigned_user_id"?"assigned_user":L==="client_id"?"client":L==="project_id"?"project":L),S=()=>d.replace("custom_value",n.entity),k=()=>{n.entity==="client"&&s(i,"bulk_update",{column:d,newValue:p}).then(()=>v()),n.entity==="expense"&&o(i,"bulk_update",{column:d,new_value:p}).then(()=>v()),n.entity==="recurring_invoice"&&a(i,"bulk_update",{column:d,new_value:p}).then(()=>v()),n.entity==="task"&&r(i,"bulk_update",{column:d,new_value:p}).then(()=>v()),t([])};return h.jsxs(h.Fragment,{children:[h.jsx($n,{onClick:()=>_(!0),icon:h.jsx(an,{element:Qkt}),children:e("bulk_update")}),h.jsx(pr,{title:e("bulk_update"),size:"regular",visible:m,onClose:v,overflowVisible:!0,children:h.jsxs("div",{className:"flex flex-col space-y-5",children:[h.jsx(Dn,{label:e("column"),value:d,onValueChange:L=>{f(L)},withBlank:!0,customSelector:!0,children:u==null?void 0:u[n.entity].filter(L=>y(L)).map(L=>h.jsx("option",{value:L,children:C(L)},L))}),h.jsxs("div",{className:"flex flex-col",children:[!!b()&&h.jsx(Lh,{className:"mb-2",children:e("value")}),b()==="taxSelector"&&h.jsx(lw,{defaultValue:p,onChange:L=>(L==null?void 0:L.resource)&&g(`${L.resource.name}||${L.resource.rate}`),onTaxCreated:L=>g(`${L.name}||${L.rate}`),onClearButtonClick:()=>g("")}),b()==="markdownEditor"&&h.jsx(dh,{value:p,onChange:L=>g(L)}),b()==="industrySelector"&&h.jsx(Dn,{value:p,onValueChange:L=>g(L),withBlank:!0,children:l==null?void 0:l.industries.map(L=>h.jsx("option",{value:L.id,children:L.name},L.id))}),b()==="sizeSelector"&&h.jsx(Dn,{value:p,onValueChange:L=>g(L),withBlank:!0,children:l==null?void 0:l.sizes.map((L,N)=>h.jsx("option",{value:L.id,children:L.name},N))}),b()==="remainingCyclesSelector"&&h.jsxs(Dn,{value:p,onValueChange:L=>g(L),children:[h.jsx("option",{value:"-1",children:e("endless")}),[...Array(37).keys()].map((L,N)=>h.jsx("option",{value:L,children:L},N))]}),b()==="countrySelector"&&h.jsx(_4,{value:p,onChange:L=>g(L),dismissable:!0}),b()==="customField"&&((I=c==null?void 0:c.custom_fields)==null?void 0:I[S()])&&h.jsx(qo,{field:S(),defaultValue:p,value:c.custom_fields[S()],onValueChange:L=>g(L),fieldOnly:!0}),b()==="toggle"&&h.jsx(jt,{checked:p,onChange:L=>g(L)}),b()==="textarea"&&h.jsx(lt,{element:"textarea",value:p,onValueChange:L=>g(L)}),b()==="statusSelector"&&h.jsx(Rvn,{value:p,onChange:L=>g(L.id),onClearButtonClick:()=>g(""),withoutAction:!0}),b()==="userSelector"&&h.jsx(Cee,{value:p,onChange:L=>g(L.id),onClearButtonClick:()=>g(""),withoutAction:!0}),b()==="projectSelector"&&h.jsx(jvn,{value:p,onChange:L=>g(L.id),onClearButtonClick:()=>g(""),withoutAction:!0}),b()==="clientSelector"&&h.jsx(DA,{value:p,onChange:L=>g(L.id),onClearButtonClick:()=>g(""),withoutAction:!0})]}),h.jsx("div",{className:"flex self-end",children:h.jsx(dn,{behavior:"button",onClick:k,disabled:!d,disableWithoutIcon:!0,children:e("update")})})]})})]})}const Bvn=["status","number","client","description","duration","entity_state"];function $vn(){const[n,e,t,i]=Sg({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 W5r(){var v;const{t:n}=xe(),{dateFormat:e}=Zc(),t=Lo(),i=jo(),r=Ik(),s=RA(),o=zi(),a=Qo(),l=Yi(),c=vf();$vn();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,f,p,g]=Sg({entity:"task"}),m=[{column:"project",id:"project_id",label:n("project"),format:(b,y)=>{var C,S;return h.jsx(yEe,{entityId:y.project_id,cacheEndpoint:"/api/v1/projects",apiEndpoint:"/api/v1/projects/:id?include=client",preCheck:i("view_project")||i("edit_project"),component:h.jsx(Ji,{to:Ut("/projects/:id",{id:(C=y==null?void 0:y.project)==null?void 0:C.id}),children:(S=y==null?void 0:y.project)==null?void 0:S.name})})}},{column:"status",id:"status_id",label:n("status"),format:(b,y)=>h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(xvn,{entity:y}),y.invoice_id&&h.jsx(Ah,{width:"auto",message:n("view_invoice"),withoutArrow:!0,placement:"bottom",children:h.jsx(hA,{className:"cursor-pointer",fontSize:19,color:t,onClick:()=>l(Ut("/invoices/:id/edit",{id:y.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(b,y)=>h.jsx(eg,{to:Ut("/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&&h.jsx(eg,{to:Ut("/clients/:id",{id:b.toString()}),renderSpan:r("client",y.client),children:y.client.display_name})},{column:"description",id:"description",label:n("description"),format:b=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(a!=null&&a.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(b)}})}),children:h.jsx("span",{children:Mb(gu(b)).slice(0,50)})})},{column:"duration",id:"time_log",label:n("duration"),format:b=>_vn(b.toString(),!0)},{column:"entity_state",id:"id",label:n("entity_state"),format:(b,y)=>n(Svn(y))},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:b=>so(b,e)},{column:"calculated_rate",id:"rate",label:n("calculated_rate"),format:(b,y)=>{var C,S;return c(y.rate||o.settings.default_task_rate,(C=y.client)==null?void 0:C.country_id,(S=y.client)==null?void 0:S.settings.currency_id)}},{column:"created_at",id:"created_at",label:n("created_at"),format:b=>so(b,e)},{column:d,id:"custom_value1",label:d,format:b=>s("task1",b==null?void 0:b.toString())},{column:f,id:"custom_value2",label:f,format:b=>s("task2",b==null?void 0:b.toString())},{column:p,id:"custom_value3",label:p,format:b=>s("task3",b==null?void 0:b.toString())},{column:g,id:"custom_value4",label:g,format:b=>s("task4",b==null?void 0:b.toString())},{column:"date",id:"calculated_start_date",label:n("date"),format:(b,y)=>so(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)=>HC(y)?n("yes"):n("no")},{column:"rate",id:"rate",label:n("rate"),format:(b,y)=>{var C,S;return c(b,(C=y.client)==null?void 0:C.country_id,(S=y.client)==null?void 0:S.settings.currency_id)}},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:b=>so(b,e)},{column:"user",id:"user_id",label:n("creator"),format:(b,y)=>u(y==null?void 0:y.user)},{column:"assigned_user",id:"assigned_user_id",label:n("assigned_user"),format:(b,y)=>y!=null&&y.assigned_user?u(y==null?void 0:y.assigned_user):""}],_=((v=a==null?void 0:a.react_table_columns)==null?void 0:v.task)||Bvn;return m.filter(b=>_.includes(b.column)).sort((b,y)=>_.indexOf(b.column)-_.indexOf(y.column))}function z5r(){return n=>{Je("PUT",ze("/api/v1/tasks/:id",{id:n.id}),n).then(()=>{pe.success("updated_task"),ii(["tasks"])})}}function Hvn(){const[n]=xe(),e=g4(),t=Um(),{data:i}=iit({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(s=>{const{red:o,green:a,blue:l,hex:c}=f4(s.color),u=p4(o,a,l)?-220:220;r.push({label:s.name,value:s.id,color:e(c,u),backgroundColor:s.color,queryKey:"task_status"})}),r}function U5r(n){const[e]=xe(),t=Yi(),i=jo(),{showCommonBulkAction:r,showEditAction:s}=n||{},{isEditPage:o}=Yw({entity:"task",editPageTabs:["documents"]}),a=kvn(),l=Tvn(),c=TEe(),u=oit(),d=ts(lvn),f=v=>{d({...v,id:"",documents:[],number:"",invoice_id:""}),t("/tasks/create?action=clone")},{setChangeTemplateResources:p,setChangeTemplateVisible:g,setChangeTemplateEntityContext:m}=N4();return[v=>!!s&&h.jsx($n,{to:Ut("/tasks/:id/edit",{id:v.id}),icon:h.jsx(an,{element:$Z}),children:e("edit")}),()=>!!s&&h.jsx(Ki,{withoutPadding:!0}),v=>!HC(v)&&!v.invoice_id&&h.jsx($n,{onClick:()=>a(v),icon:h.jsx(an,{element:twe}),children:e("start")}),v=>HC(v)&&!v.invoice_id&&h.jsx($n,{onClick:()=>l(v),icon:h.jsx(an,{element:rwe}),children:e("stop")}),v=>!HC(v)&&!v.invoice_id&&i("create_invoice")&&h.jsx($n,{onClick:()=>u([v]),icon:h.jsx(an,{element:hA}),children:e("invoice_task")}),v=>h.jsx(ait,{tasks:[v]}),v=>i("create_task")&&h.jsx($n,{onClick:()=>f(v),icon:h.jsx(an,{element:Pb}),children:e("clone")}),v=>h.jsx($n,{onClick:()=>{g(!0),p([v]),m({endpoint:"/api/v1/tasks/bulk",entity:"task"})},icon:h.jsx(an,{element:t4}),children:e("run_template")}),()=>(o||!!r)&&h.jsx(Ki,{withoutPadding:!0}),v=>(o||!!r)&&hs(v)===Vr.Active&&h.jsx($n,{onClick:()=>c([v.id],"archive"),icon:h.jsx(an,{element:yu}),children:e("archive")}),v=>(o||!!r)&&(hs(v)===Vr.Archived||hs(v)===Vr.Deleted)&&h.jsx($n,{onClick:()=>c([v.id],"restore"),icon:h.jsx(an,{element:bu}),children:e("restore")}),v=>(o||!!r)&&(hs(v)===Vr.Active||hs(v)===Vr.Archived)&&h.jsx($n,{onClick:()=>c([v.id],"delete"),icon:h.jsx(an,{element:fc}),children:e("delete")})]}const q5r=()=>{const[n]=xe(),e=oit(),t=TEe(),i=jo(),r=QQe(),s=_=>_.some(({documents:v})=>v.length),o=_=>_.flatMap(({documents:v})=>v.map(({id:b})=>b)),a=_=>_.every(v=>!HC(v)&&!v.invoice_id),l=_=>_.every(v=>HC(v)&&!v.invoice_id),c=_=>_.every(v=>!HC(v)&&!v.invoice_id),u=_=>_.every(v=>!HC(v)&&!v.invoice_id&&v.client_id),d=(_,v)=>{const b=o(_);r(b,"download"),v==null||v([])},{setChangeTemplateVisible:f,setChangeTemplateResources:p,setChangeTemplateEntityContext:g}=N4();return[({selectedIds:_,setSelected:v})=>h.jsx(lit,{entity:"task",resourceIds:_,setSelected:v}),({selectedIds:_,selectedResources:v,setSelected:b})=>v&&a(v)&&h.jsx($n,{onClick:()=>{t(_,"start"),b([])},icon:h.jsx(an,{element:twe}),children:n("start")}),({selectedIds:_,selectedResources:v,setSelected:b})=>v&&l(v)&&h.jsx($n,{onClick:()=>{t(_,"stop"),b([])},icon:h.jsx(an,{element:rwe}),children:n("stop")}),({selectedResources:_,setSelected:v})=>_&&u(_)&&h.jsx(ait,{tasks:_,isBulkAction:!0,setSelected:v}),({selectedResources:_,setSelected:v})=>_&&c(_)&&i("create_invoice")?h.jsx($n,{onClick:()=>{e(_),v([])},icon:h.jsx(an,{element:hA}),children:n("invoice_task")}):null,({selectedResources:_,setSelected:v})=>h.jsx($n,{onClick:()=>_&&s(_)?d(_,v):pe.error("no_documents_to_download"),icon:h.jsx(an,{element:FE}),children:n("documents")}),({selectedResources:_})=>h.jsx($n,{onClick:()=>{f(!0),p(_),g({endpoint:"/api/v1/tasks/bulk",entity:"task"})},icon:h.jsx(an,{element:t4}),children:n("run_template")})]};function cit(n){const[e]=xe(),{value:t,onValueChange:i,errorMessage:r,report:s}=n,o=Hvn(),a=F_n(),l=Ygn(),c=avn(),u=Ggn(),d=Pmn(),f=T_n(),p=ovn(),[g,m]=x.useState([]),_=v=>v.map(b=>b.value).join(",");return x.useEffect(()=>{(s==="invoice"||s==="invoice_item")&&m(u),s==="credit"&&m(l),s==="expense"&&m(d),(s==="purchase_order"||s==="purchase_order_item")&&m(f),(s==="quote"||s==="quote_item")&&m(a),(s==="recurring_invoice"||s==="recurring_invoice_item")&&m(p),s==="payment"&&m(c),s==="task"&&m(o)},[s]),h.jsxs(h.Fragment,{children:[h.jsx(A4,{id:"statusSelector",...t&&{value:g.filter(v=>t.split(",").find(b=>v.value===b))},onValueChange:v=>i(_(v)),options:g}),h.jsx(Kl,{className:"mt-2",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 uit(){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,activity_type_id:""},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:[],product_key:"",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",product_key:"",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,product_key:"",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:"recurring_invoice_item",label:"recurring_invoice_item",endpoint:"/api/v1/reports/recurring_invoice_items",allow_custom_column:!0,custom_columns:["client","recurring_invoice","item"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],product_key:"",send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/recurring_invoice_items?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},{identifier:"project",label:"project",schedule_identifier:"project",endpoint:"/api/v1/reports/projects",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,clients:"",projects:""},preview:"/api/v1/reports/project?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 Vvn=[{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 Wvn=[{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 Qje=[{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 Xje=[{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 ej=[{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 zvn=[{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 Zje=[{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 Uvn=[{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 qvn=[{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 Jje=[{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:"remaining_cycles",value:"recurring_invoice.remaining_cycles",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 Kvn=[{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 eFe=[{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"}],sy=11;function Gvn(){const[n]=xe(),e=zi(),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=(s,o)=>{const a=s.includes("custom_value")?s.replace("custom_value","custom"):s;return t[a]?Xq(t[a]).label():`${o?"contact_custom_value":"custom"}${a.charAt(a.length-1)}`};return(s,o)=>{const a=i[o]||o;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)}[s]||n(s)}}function b_({title:n,droppableId:e,isDropDisabled:t,data:i,onRemove:r}){const[s]=xe(),o=xt(),a=Gvn(),l=c=>{const u=c.value.split(".");return`${s(`${u[0]}`)} - ${a(c.trans,u[0])}`};return h.jsxs("div",{children:[h.jsx("h2",{className:"font-medium",style:{color:o.$17},children:typeof n=="string"?h.jsx("p",{children:n}):n()}),h.jsx(uee,{droppableId:e,isDropDisabled:t,renderClone:(c,u,d)=>{const f=i[d.source.index];return h.jsx("div",{ref:c.innerRef,...c.draggableProps,...c.dragHandleProps,children:h.jsx("div",{className:"p-2 flex border justify-between items-center cursor-grab text-sm shadow-sm",style:{color:o.$3,backgroundColor:o.$1,borderColor:o.$24},children:l(f)})})},children:c=>h.jsxs("div",{className:"w-80 flex-column",ref:c.innerRef,...c.droppableProps,children:[h.jsx("div",{className:"overflow-y-scroll h-96 mt-2 border rounded-md",style:{borderColor:o.$24},children:i&&i.map((u,d)=>h.jsx(cee,{index:d,draggableId:`left-word-${u.value}`,children:f=>h.jsx("div",{ref:f.innerRef,...f.draggableProps,...f.dragHandleProps,children:h.jsxs("div",{className:"border-b p-2 flex justify-between items-center cursor-grab text-sm",style:{color:o.$3,borderColor:o.$24,backgroundColor:o.$1},children:[l(u),e===sy.toString()&&h.jsx("button",{style:{color:o.$3,colorScheme:o.$0,backgroundColor:o.$1,borderColor:o.$4},type:"button",onClick:()=>r?r(u):null,children:h.jsx(gA,{size:"0.85rem",color:o.$3})})]},d)})},u.value))}),c.placeholder]})})]})}const Yvn=["client","invoice","credit","quote","payment","vendor","purchase_order","task","expense","recurring_invoice","contact"];function Qvn({report:n,columns:e}){const{preferences:t}=qw(),i=[e.includes("client")?Vvn:[],e.includes("invoice")?e.includes("item")?eFe.concat(ej.map(s=>({...s,origin:"invoice"}))):eFe:[],e.includes("credit")?e.includes("item")?Xje.concat(ej.map(s=>({...s,origin:"credit"}))):Xje:[],e.includes("quote")?e.includes("item")?Qje.concat(ej.map(s=>({...s,origin:"quote"}))):Qje:[],e.includes("payment")?Wvn:[],e.includes("vendor")?zvn:[],e.includes("purchase_order")?e.includes("item")?Zje.concat(ej.map(s=>({...s,origin:"purchase_order"}))):Zje:[],e.includes("task")?Uvn:[],e.includes("expense")?qvn:[],e.includes("recurring_invoice")?e.includes("item")?Jje.concat(ej.map(s=>({...s,origin:"recurring_invoice"}))):Jje:[],e.includes("contact")?Kvn:[],[]];return{data:n in t.reports.columns&&t.reports.columns[n].length!==0?t.reports.columns[n]:i,defaultColumns:i}}function Xvn({report:n,columns:e}){const[t]=xe(),i=xt(),{update:r}=qw(),{data:s,defaultColumns:o}=Qvn({report:n,columns:e}),a=d=>{if(d.destination)try{const f=pn.cloneDeep(s),p=parseInt(d.source.droppableId),g=f[p][d.source.index];f[p].splice(d.source.index,1);const m=parseInt(d.destination.droppableId);f[m].splice(d.destination.index,0,g),r(`preferences.reports.columns.${n}`,[...f])}catch{r(`preferences.reports.columns.${n}`,o)}},l=d=>{const f=Yvn.indexOf(d.map),p=pn.cloneDeep(s);p[sy]=p[sy].filter(g=>g.value!==d.value),p[f].push(d),r(`preferences.reports.columns.${n}`,[...p])},c=()=>{r(`preferences.reports.columns.${n}`,o)},u=d=>{const f=pn.cloneDeep(s);f[sy]=[...f[sy],...f[d]],f[d]=[],r(`preferences.reports.columns.${n}`,[...f])};return h.jsx("div",{className:"overflow-x-auto border rounded-md w-full my-6 shadow-sm",style:{borderColor:i.$24},children:h.jsx("div",{style:{minWidth:"min-content"},children:h.jsx("div",{className:"py-4",style:{backgroundColor:i.$1},children:h.jsx(lee,{onDragEnd:a,children:h.jsxs("div",{className:"flex w-full py-2 px-6 space-x-4",children:[e.includes("client")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("client")}),h.jsx("button",{type:"button",onClick:()=>u(0),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[0],droppableId:"0",isDropDisabled:!0}),e.includes("invoice")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("invoice")}),h.jsx("button",{type:"button",onClick:()=>u(1),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[1],droppableId:"1",isDropDisabled:!0}),e.includes("credit")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("credit")}),h.jsx("button",{type:"button",onClick:()=>u(2),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[2],droppableId:"2",isDropDisabled:!0}),e.includes("quote")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("quote")}),h.jsx("button",{type:"button",onClick:()=>u(3),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[3],droppableId:"3",isDropDisabled:!0}),e.includes("payment")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("payment")}),h.jsx("button",{type:"button",onClick:()=>u(4),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[4],droppableId:"4",isDropDisabled:!0}),e.includes("vendor")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("vendor")}),h.jsx("button",{type:"button",onClick:()=>u(5),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[5],droppableId:"5",isDropDisabled:!0}),e.includes("purchase_order")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("purchase_order")}),h.jsx("button",{type:"button",onClick:()=>u(6),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[6],droppableId:"6",isDropDisabled:!0}),e.includes("task")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("task")}),h.jsx("button",{type:"button",onClick:()=>u(7),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[7],droppableId:"7",isDropDisabled:!0}),e.includes("expense")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("expense")}),h.jsx("button",{type:"button",onClick:()=>u(8),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[8],droppableId:"8",isDropDisabled:!0}),e.includes("recurring_invoice")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("recurring_invoice")}),h.jsx("button",{type:"button",onClick:()=>u(9),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[9],droppableId:"9",isDropDisabled:!0}),e.includes("contact")&&h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{style:{color:i.$3},children:t("contact")}),h.jsx("button",{type:"button",onClick:()=>u(10),children:h.jsx(w_,{size:"0.85rem",color:i.$3})})]}),data:s[10],droppableId:"10",isDropDisabled:!0}),h.jsx(b_,{title:()=>h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("span",{style:{color:i.$3},children:[t("report")," ",t("columns")]}),h.jsxs("div",{className:"flex items-center space-x-1 cursor-pointer",onClick:c,children:[h.jsx("div",{children:h.jsx(gA,{size:"0.85rem",color:i.$3})}),h.jsxs("span",{className:"text-xs",style:{color:i.$3},children:["(",t("reset"),")"]})]})]}),data:s[sy],droppableId:sy.toString(),isDropDisabled:!1,onRemove:l})]})})})})})}const dit=Ls(null);function Zvn(){const[n]=oo(dit),[e,t]=x.useState(null),i=[{identifier:"credit.number",format:r=>h.jsx(Ji,{to:`/credits/${r.value}`,children:r.display_value})}];return x.useEffect(()=>{if(!n)return;const r=pn.cloneDeep(n);r.rows.map(s=>{s.map(o=>{const a=i.find(l=>l.identifier===o.identifier);a&&(o.display_value=a.format(o))})}),t(r)},[n]),e}function Jvn(){const[n]=xe(),e=Zvn(),t=xt(),[i,r]=x.useState(),[s,o]=x.useState(null);if(!e)return null;const a=(d,f)=>{const p=pn.cloneDeep(e);p.rows=p.rows.filter(g=>g.some(m=>{if(m.identifier!==d)return!1;if(typeof m.display_value=="number")return m.display_value.toString().toLowerCase().includes(f.toLowerCase());if(typeof m.display_value=="string")return m.display_value.toLowerCase().includes(f.toLowerCase());if(typeof m.display_value=="object")return m.display_value.props.children.toLowerCase().includes(f.toLowerCase())})),o(p)},l=d=>{const f=(i==null?void 0:i[d])==="asc"?"desc":"asc";r(g=>({...g,[d]:f}));const p=pn.cloneDeep(e);p.rows=p.rows.sort((g,m)=>{const _=g.find(b=>b.identifier===d),v=m.find(b=>b.identifier===d);if(_&&v)return f==="asc"?_.display_value>v.display_value?1:-1:_.display_value<v.display_value?1:-1}),o(p)},c=(s==null?void 0:s.rows)||e.rows,u=()=>{const d=[e.columns.map(v=>v.display_value).join(",")];(s?s.rows:e.rows).map(v=>{d.push(v.map(b=>b.display_value.toString()==="true"?"Yes":b.display_value.toString()==="false"?"No":`"${b.display_value}"`).join(","))});const p=d.join(` `),g=new Blob([p],{type:"text/csv;charset=utf-8;"}),m=document.createElement("a"),_=URL.createObjectURL(g);m.setAttribute("href",_),m.setAttribute("download","example.csv"),m.click()};return e?h.jsxs("div",{id:"preview-table my-4",children:[h.jsx("div",{className:"flex justify-end",children:h.jsxs(dn,{behavior:"button",onClick:u,children:[n("download")," ",n("csv_file")]})}),h.jsxs(h1,{children:[h.jsx(p1,{children:e.columns.map((d,f)=>h.jsx(_a,{style:{borderBottom:`1px solid ${t.$20}`},isCurrentlyUsed:!!(i!=null&&i[d.identifier]),onColumnClick:()=>l(d.identifier),children:d.display_value},f))}),h.jsxs(f1,{children:[h.jsx(hc,{className:"border-b",style:{borderColor:t.$20},children:e.columns.map((d,f)=>h.jsx(bs,{children:h.jsx(lt,{onValueChange:p=>a(d.identifier,p),changeOverride:!0})},f))}),c.map((d,f)=>h.jsx(hc,{className:"border-b",style:{borderColor:t.$20},children:d.map((p,g)=>h.jsx(bs,{children:p.display_value},g))},f))]})]})]}):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 ebn={last7:"last7_days",last30:"last30_days"};function tbn(){const n=Yi(),{preferences:e}=qw(),t=ts(xee);return(i,r)=>{let s=[];i.identifier in e.reports.columns&&r&&(s=ql(e.reports.columns[i.identifier][sy]).pluck("value").toArray()),t({...q8,report_name:i.identifier,start_date:i.payload.start_date,end_date:i.payload.end_date,client_id:i.payload.client_id||"",date_range:ebn[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:s,include_deleted:i.payload.include_deleted??!1,pdf_email_attachment:i.payload.pdf_email_attachment??!1}),n("/settings/schedules/create?template=email_report")}}function hit(n){const[e]=xe(),t=xt(),{value:i,onValueChange:r,errorMessage:s}=n,[o,a]=x.useState(),{data:l}=mEe({status:["active"]});x.useEffect(()=>{l&&a(l.map(u=>({value:u.id,label:u.display_name,color:t.$3,backgroundColor:t.$1})))},[l]);const c=u=>u.map(d=>d.value).join(",");return h.jsxs(h.Fragment,{children:[o?h.jsx(ne,{leftSide:e("clients"),children:h.jsx(A4,{id:"clientItemSelector",...i&&{value:o==null?void 0:o.filter(u=>i.split(",").find(d=>d===u.value))},onValueChange:u=>r(c(u)),options:o,isSearchable:!0})}):h.jsx("div",{className:"flex justify-center items-center",children:h.jsx(yo,{})}),h.jsx(Kl,{className:"mt-2",children:s})]})}function fit(n){const[e]=xe(),t=xt();WSe();const{value:i,onValueChange:r,errorMessage:s}=n,[o,a]=x.useState(),{data:l}=hEe({status:["active"]});x.useEffect(()=>{l&&a(l.map(u=>({value:u.id,label:u.name,color:t.$3,backgroundColor:t.$1})))},[l]);const c=u=>u.map(d=>d.value).join(",");return h.jsxs(h.Fragment,{children:[o?h.jsx(ne,{leftSide:e("expense_categories"),children:h.jsx(A4,{id:"expenseCategoryItemSelector",...i&&{value:o==null?void 0:o.filter(u=>i.split(",").find(d=>d===u.value))},onValueChange:u=>r(c(u)),options:o,isSearchable:!0})}):h.jsx("div",{className:"flex justify-center items-center",children:h.jsx(yo,{})}),h.jsx(Kl,{className:"mt-2",children:s})]})}function pit(n){const[e]=xe(),t=xt();WSe();const{value:i,onValueChange:r,errorMessage:s}=n,[o,a]=x.useState(),{data:l}=Ovn({status:["active"]});x.useEffect(()=>{l&&a(l.map(u=>({value:u.id,label:u.name,color:t.$3,backgroundColor:t.$1})))},[l]);const c=u=>u.map(d=>d.value).join(",");return h.jsxs(h.Fragment,{children:[o?h.jsx(ne,{leftSide:e("projects"),children:h.jsx(A4,{id:"projectItemSelector",...i&&{value:o==null?void 0:o.filter(u=>i.split(",").find(d=>d===u.value))},onValueChange:u=>r(c(u)),options:o,isSearchable:!0})}):h.jsx("div",{className:"flex justify-center items-center",children:h.jsx(yo,{})}),h.jsx(Kl,{className:"mt-2",children:s})]})}function git(n){const[e]=xe(),t=xt(),{value:i,onValueChange:r,errorMessage:s}=n,[o,a]=x.useState(),{data:l}=Bpn({});x.useEffect(()=>{l&&a(l.map(u=>({value:u.id,label:u.name,color:t.$3,backgroundColor:t.$1})))},[l]);const c=u=>u.map(d=>d.value).join(",");return h.jsxs(h.Fragment,{children:[o?h.jsx(ne,{leftSide:e("vendors"),children:h.jsx(A4,{id:"vendorItemSelector",...i&&{value:o==null?void 0:o.filter(u=>i.split(",").find(d=>d===u.value))},onValueChange:u=>r(c(u)),options:o,isSearchable:!0})}):h.jsx("div",{className:"flex justify-center items-center",children:h.jsx(yo,{})}),h.jsx(Kl,{className:"mt-2",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 nbn={client:["document_email_attachment","include_deleted"],invoice:["document_email_attachment","status","include_deleted","client","pdf_email_attachment"],invoice_item:["document_email_attachment","product_key","include_deleted","status","client"],quote:["document_email_attachment","include_deleted","status","client","pdf_email_attachment"],quote_item:["document_email_attachment","include_deleted","status","client","product_key"],credit:["document_email_attachment","include_deleted","status","client","pdf_email_attachment"],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","pdf_email_attachment"],purchase_order_item:["document_email_attachment","include_deleted","status","product_key"],project:["clients","projects"],activity:["activity_type_id"],contact:[],recurring_invoice:["include_deleted","status","client"],recurring_invoice_item:["document_email_attachment","product_key","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 ibn(n){const{report:e}=n;return t=>!!nbn[e].includes(t)}function rbn(n){const[e]=xe(),t=Ml();return h.jsx(h.Fragment,{children:!Vy()&&!$u()&&h.jsx("div",{className:n==null?void 0:n.className,children:h.jsx(KZ,{className:"mb-4",type:"warning",disableClosing:!0,children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"inline-flex items-center space-x-1",children:[h.jsx(gUe,{fontSize:18}),h.jsxs("span",{children:[e("start_free_trial_message"),"."]})]}),(t==null?void 0:t.company_user)&&h.jsx(Ji,{to:"/settings/account_management",className:"ml-10",external:!0,withoutAdjustedHref:!0,children:e("plan_change")})]})})})})}const sbn=n=>we.isValidElement(n)&&n.type==="option";function obn({children:n,value:e,errorMessage:t,disabled:i,onValueChange:r,label:s,dismissable:o,clearAfterSelection:a}){if(we.Children.toArray(n).every(sbn)===!1)throw new Error("SearchableSelect must have only <option> elements as children.");const c=we.Children.map(n,g=>x.isValidElement(g)&&{id:MJ(),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=we.Children.map(n,g=>x.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),f=xt(),p={input:g=>pn.merge(g,{color:f.$3}),singleValue:g=>pn.merge(g,{color:f.$3}),menu:g=>pn.merge(g,{width:"max-content",minWidth:"100%",backgroundColor:f.$4,borderColor:f.$4,zIndex:50}),control:(g,{isDisabled:m})=>pn.merge(g,{borderRadius:"3px",backgroundColor:f.$1,color:f.$3,borderColor:f.$5,cursor:m?"not-allowed":"pointer",pointerEvents:m?"auto":"unset"}),option:(g,{isSelected:m,isFocused:_})=>pn.merge(g,{color:f.$3,backgroundColor:m||_?f.$7:f.$1,":hover":{backgroundColor:f.$7}})};return h.jsxs("div",{className:"space-y-2",children:[s?h.jsx(Lh,{children:s}):null,h.jsx(qZ,{options:u,value:d,onChange:g=>r(g===null?"":g.value),isDisabled:i,isClearable:o,styles:p}),h.jsx(Kl,{className:"mt-2",children:t})]})}const Zn={CREATE_CLIENT:1,ARCHIVE_CLIENT:2,DELETE_CLIENT:3,CREATE_INVOICE:4,UPDATE_INVOICE:5,EMAIL_INVOICE:6,VIEW_INVOICE:7,ARCHIVE_INVOICE:8,DELETE_INVOICE:9,CREATE_PAYMENT:10,UPDATE_PAYMENT:11,ARCHIVE_PAYMENT:12,DELETE_PAYMENT:13,CREATE_CREDIT:14,UPDATE_CREDIT:15,ARCHIVE_CREDIT:16,DELETE_CREDIT:17,CREATE_QUOTE:18,UPDATE_QUOTE:19,EMAIL_QUOTE:20,VIEW_QUOTE:21,ARCHIVE_QUOTE:22,DELETE_QUOTE:23,RESTORE_QUOTE:24,RESTORE_INVOICE:25,RESTORE_CLIENT:26,RESTORE_PAYMENT:27,RESTORE_CREDIT:28,APPROVE_QUOTE:29,CREATE_VENDOR:30,ARCHIVE_VENDOR:31,DELETE_VENDOR:32,RESTORE_VENDOR:33,CREATE_EXPENSE:34,ARCHIVE_EXPENSE:35,DELETE_EXPENSE:36,RESTORE_EXPENSE:37,VOIDED_PAYMENT:39,REFUNDED_PAYMENT:40,FAILED_PAYMENT:41,CREATE_TASK:42,UPDATE_TASK:43,ARCHIVE_TASK:44,DELETE_TASK:45,RESTORE_TASK:46,UPDATE_EXPENSE:47,CREATE_USER:48,UPDATE_USER:49,ARCHIVE_USER:50,DELETE_USER:51,RESTORE_USER:52,MARK_SENT_INVOICE:53,PAID_INVOICE:54,EMAIL_INVOICE_FAILED:57,REVERSED_INVOICE:58,CANCELLED_INVOICE:59,VIEW_CREDIT:60,UPDATE_CLIENT:61,UPDATE_VENDOR:62,INVOICE_REMINDER1_SENT:63,INVOICE_REMINDER2_SENT:64,INVOICE_REMINDER3_SENT:65,INVOICE_REMINDER_ENDLESS_SENT:66,CREATE_SUBSCRIPTION:80,UPDATE_SUBSCRIPTION:81,ARCHIVE_SUBSCRIPTION:82,DELETE_SUBSCRIPTION:83,RESTORE_SUBSCRIPTION:84,CREATE_RECURRING_INVOICE:100,UPDATE_RECURRING_INVOICE:101,ARCHIVE_RECURRING_INVOICE:102,DELETE_RECURRING_INVOICE:103,RESTORE_RECURRING_INVOICE:104,CREATE_RECURRING_QUOTE:110,UPDATE_RECURRING_QUOTE:111,ARCHIVE_RECURRING_QUOTE:112,DELETE_RECURRING_QUOTE:113,RESTORE_RECURRING_QUOTE:114,CREATE_RECURRING_EXPENSE:120,UPDATE_RECURRING_EXPENSE:121,ARCHIVE_RECURRING_EXPENSE:122,DELETE_RECURRING_EXPENSE:123,RESTORE_RECURRING_EXPENSE:124,CREATE_PURCHASE_ORDER:130,UPDATE_PURCHASE_ORDER:131,ARCHIVE_PURCHASE_ORDER:132,DELETE_PURCHASE_ORDER:133,RESTORE_PURCHASE_ORDER:134,EMAIL_PURCHASE_ORDER:135,VIEW_PURCHASE_ORDER:136,ACCEPT_PURCHASE_ORDER:137,PAYMENT_EMAILED:138,VENDOR_NOTIFICATION_EMAIL:139,EMAIL_STATEMENT:140,USER_NOTE:141,QUOTE_REMINDER1_SENT:142,AUTOBILL_SUCCESS:143,AUTOBILL_FAILURE:144,EINVOICE_SENT:145,EINVOICE_DELIVERY_SUCCESS:146,EINVOICE_DELIVERY_FAILURE:147,E_EXPENSE_CREATED:148,EMAIL_CREDIT:149};function abn(){const[n]=xe();return{[Zn.CREATE_CLIENT]:n("create_client"),[Zn.ARCHIVE_CLIENT]:n("archive_client"),[Zn.DELETE_CLIENT]:n("delete_client"),[Zn.CREATE_INVOICE]:n("create_invoice"),[Zn.UPDATE_INVOICE]:n("update_invoice"),[Zn.EMAIL_INVOICE]:n("sent_invoice"),[Zn.VIEW_INVOICE]:n("view_invoice"),[Zn.ARCHIVE_INVOICE]:n("archive_invoice"),[Zn.DELETE_INVOICE]:n("delete_invoice"),[Zn.CREATE_PAYMENT]:n("create_payment"),[Zn.UPDATE_PAYMENT]:n("update_payment"),[Zn.ARCHIVE_PAYMENT]:n("archive_payment"),[Zn.DELETE_PAYMENT]:n("delete_payment"),[Zn.CREATE_CREDIT]:n("create_credit"),[Zn.UPDATE_CREDIT]:n("update_credit"),[Zn.ARCHIVE_CREDIT]:n("archive_credit"),[Zn.DELETE_CREDIT]:n("delete_credit"),[Zn.CREATE_QUOTE]:n("create_quote"),[Zn.UPDATE_QUOTE]:n("update_quote"),[Zn.EMAIL_QUOTE]:n("sent_quote"),[Zn.VIEW_QUOTE]:n("view_quote"),[Zn.ARCHIVE_QUOTE]:n("archive_quote"),[Zn.DELETE_QUOTE]:n("delete_quote"),[Zn.RESTORE_QUOTE]:n("restore_quote"),[Zn.RESTORE_INVOICE]:n("restore_invoice"),[Zn.RESTORE_CLIENT]:n("restore_client"),[Zn.RESTORE_PAYMENT]:n("restore_payment"),[Zn.RESTORE_CREDIT]:n("restore_credit"),[Zn.APPROVE_QUOTE]:n("approve_quote"),[Zn.CREATE_VENDOR]:n("create_vendor"),[Zn.ARCHIVE_VENDOR]:n("archive_vendor"),[Zn.DELETE_VENDOR]:n("delete_vendor"),[Zn.RESTORE_VENDOR]:n("restore_vendor"),[Zn.CREATE_EXPENSE]:n("create_expense"),[Zn.ARCHIVE_EXPENSE]:n("archive_expense"),[Zn.DELETE_EXPENSE]:n("delete_expense"),[Zn.RESTORE_EXPENSE]:n("restore_expense"),[Zn.VOIDED_PAYMENT]:n("voided_payment"),[Zn.REFUNDED_PAYMENT]:n("refunded_payment"),[Zn.FAILED_PAYMENT]:n("failed_payment"),[Zn.CREATE_TASK]:n("create_task"),[Zn.UPDATE_TASK]:n("update_task"),[Zn.ARCHIVE_TASK]:n("archive_task"),[Zn.DELETE_TASK]:n("delete_task"),[Zn.RESTORE_TASK]:n("restore_task"),[Zn.UPDATE_EXPENSE]:n("update_expense"),[Zn.CREATE_USER]:n("create_user"),[Zn.UPDATE_USER]:n("update_user"),[Zn.ARCHIVE_USER]:n("archive_user"),[Zn.DELETE_USER]:n("delete_user"),[Zn.RESTORE_USER]:n("restore_user"),[Zn.MARK_SENT_INVOICE]:n("sent_invoice"),[Zn.PAID_INVOICE]:n("paid_invoice"),[Zn.EMAIL_INVOICE_FAILED]:n("email_invoice_failed"),[Zn.REVERSED_INVOICE]:n("reversed_invoice"),[Zn.CANCELLED_INVOICE]:n("cancelled_invoice"),[Zn.VIEW_CREDIT]:n("view_credit"),[Zn.UPDATE_CLIENT]:n("update_client"),[Zn.UPDATE_VENDOR]:n("update_vendor"),[Zn.INVOICE_REMINDER1_SENT]:n("remind_invoice"),[Zn.INVOICE_REMINDER2_SENT]:n("remind_invoice"),[Zn.INVOICE_REMINDER3_SENT]:n("remind_invoice"),[Zn.INVOICE_REMINDER_ENDLESS_SENT]:n("remind_invoice"),[Zn.CREATE_SUBSCRIPTION]:n("create_subscription"),[Zn.UPDATE_SUBSCRIPTION]:n("update_subscription"),[Zn.ARCHIVE_SUBSCRIPTION]:n("archive_subscription"),[Zn.DELETE_SUBSCRIPTION]:n("delete_subscription"),[Zn.RESTORE_SUBSCRIPTION]:n("restore_subscription"),[Zn.CREATE_RECURRING_INVOICE]:n("create_recurring_invoice"),[Zn.UPDATE_RECURRING_INVOICE]:n("update_recurring_invoice"),[Zn.ARCHIVE_RECURRING_INVOICE]:n("archive_recurring_invoice"),[Zn.DELETE_RECURRING_INVOICE]:n("delete_recurring_invoice"),[Zn.RESTORE_RECURRING_INVOICE]:n("restore_recurring_invoice"),[Zn.CREATE_RECURRING_QUOTE]:n("create_recurring_quote"),[Zn.UPDATE_RECURRING_QUOTE]:n("update_recurring_quote"),[Zn.ARCHIVE_RECURRING_QUOTE]:n("archive_recurring_quote"),[Zn.DELETE_RECURRING_QUOTE]:n("delete_recurring_quote"),[Zn.RESTORE_RECURRING_QUOTE]:n("restore_recurring_quote"),[Zn.CREATE_RECURRING_EXPENSE]:n("create_recurring_expense"),[Zn.UPDATE_RECURRING_EXPENSE]:n("update_recurring_expense"),[Zn.ARCHIVE_RECURRING_EXPENSE]:n("archive_recurring_expense"),[Zn.DELETE_RECURRING_EXPENSE]:n("delete_recurring_expense"),[Zn.RESTORE_RECURRING_EXPENSE]:n("restore_recurring_expense"),[Zn.CREATE_PURCHASE_ORDER]:n("create_purchase_order"),[Zn.UPDATE_PURCHASE_ORDER]:n("update_purchase_order"),[Zn.ARCHIVE_PURCHASE_ORDER]:n("archive_purchase_order"),[Zn.DELETE_PURCHASE_ORDER]:n("delete_purchase_order"),[Zn.RESTORE_PURCHASE_ORDER]:n("restore_purchase_order"),[Zn.EMAIL_PURCHASE_ORDER]:n("sent_purchase_order"),[Zn.VIEW_PURCHASE_ORDER]:n("view_purchase_order"),[Zn.ACCEPT_PURCHASE_ORDER]:n("accept_purchase_order"),[Zn.PAYMENT_EMAILED]:n("payment_emailed"),[Zn.VENDOR_NOTIFICATION_EMAIL]:n("vendor_notification_email"),[Zn.EMAIL_STATEMENT]:n("email_statement"),[Zn.USER_NOTE]:n("user_note"),[Zn.QUOTE_REMINDER1_SENT]:n("remind_quote"),[Zn.AUTOBILL_SUCCESS]:n("autobill_success"),[Zn.AUTOBILL_FAILURE]:n("autobill_failure"),[Zn.EINVOICE_SENT]:n("einvoice_sent"),[Zn.EINVOICE_DELIVERY_SUCCESS]:n("einvoice_delivery_success"),[Zn.EINVOICE_DELIVERY_FAILURE]:n("einvoice_delivery_failure"),[Zn.E_EXPENSE_CREATED]:n("e_expense_created"),[Zn.EMAIL_CREDIT]:n("sent_credit")}}function lbn(n){const e=abn();return h.jsx(obn,{onValueChange:n.onChange,value:n.value,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,disabled:n.disabled,children:Object.entries(Zn).map(([t,i])=>h.jsx("option",{value:i,children:e[i]},i))})}const fK=[{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:"last_year",label:"last_year",scheduleIdentifier:"last_year"},{identifier:"custom",label:"custom",scheduleIdentifier:"custom"}],cbn=(n,e)=>{let t=!1;if(n instanceof ArrayBuffer||n instanceof Uint8Array){const l=new Uint8Array((n instanceof ArrayBuffer,n));t=l.length>4&&l[0]===37&&l[1]===80&&l[2]===68&&l[3]===70}else typeof n=="string"&&(t=n.startsWith("%PDF"));const i=t?"pdf":"csv",r=t?"application/pdf":"text/csv",s=new Blob([n],{type:r}),o=URL.createObjectURL(s),a=document.createElement("a");a.download=`${e}.${i}`,a.href=o,a.click(),URL.revokeObjectURL(o)};function ubn(){var F,V;const{documentTitle:n}=vr("reports"),{t:e}=xe(),t=[{name:e("reports"),href:"/reports"}],i=uit(),r=xt(),s=Vs(),o=tbn(),{save:a,preferences:l}=qw();kEe();const[c,u]=x.useState(i[0]),[d,f]=x.useState(!1),[p,g]=x.useState(),[m,_]=x.useState(!1),[v,b]=oo(dit),y=ibn({report:c.identifier}),C=M=>{const B=i.find(W=>W.identifier===M);_(!1),B&&u(pn.cloneDeep(B))},S=(M,B)=>{u(W=>({...W,payload:{...W.payload,[M]:B}}))},k=M=>{const B=fK.find(W=>W.identifier===M);B&&u(W=>({...W,payload:{...W.payload,date_range:B.identifier}}))},I=(M,B)=>{u(W=>({...W,payload:{...W.payload,[M]:B}}))},L=M=>{u(B=>({...B,payload:{...B.payload,send_email:M}}))},N=()=>{pe.processing(),f(!0),g(void 0);const{client_id:M}=c.payload;let B=c.identifier==="product_sales"?{...c.payload,client_id:M||null}:c.payload,W=[];c.identifier in l.reports.columns&&m&&(W=ql(l.reports.columns[c.identifier][sy]).pluck("value").toArray()),B={...B,report_keys:W},Je("POST",ze(c.endpoint),B,{}).then(q=>{if(c.payload.send_email)return f(!1),pe.success();const U=q.data.message;s.fetchQuery({queryKey:["exports",U],queryFn:()=>Je("POST",ze(`/api/v1/exports/preview/${U}`),null,{responseType:"arraybuffer"}).then(G=>G.data),retry:50,retryDelay:2e3}).then(G=>{cbn(G,c.identifier),pe.success()}).catch(G=>{console.error(G),pe.error()}).finally(()=>{f(!1)})}).catch(q=>{var U;((U=q.response)==null?void 0:U.status)===422&&g(q.response.data),f(!1)}).finally(()=>{m&&a({silent:!0})})},P=M=>{var B;return M.identifier.endsWith("_notes")||M.identifier.endsWith("description")||M.identifier.endsWith("terms")||M.identifier.endsWith("footer")||M.identifier.endsWith("reminder_schedule")||M.identifier.endsWith("notes")?Mb(gu((B=M.display_value)==null?void 0:B.toString())):M.display_value},O=async()=>{g(void 0),b(null);const{client_id:M}=c.payload;let B=c.identifier==="product_sales"?{...c.payload,client_id:M||null}:c.payload,W=[];c.identifier in l.reports.columns&&m&&(W=ql(l.reports.columns[c.identifier][sy]).pluck("value").toArray()),B={...B,report_keys:W},Je("POST",ze(c.preview),B,{}).then(q=>{const U=q.data.message;s.fetchQuery({queryKey:["reports",U],queryFn:()=>Je("POST",ze(`/api/v1/reports/preview/${U}`)).then(G=>G.data),retry:10,retryDelay:5e3}).then(G=>{const{columns:H,...z}=G;b({columns:H,rows:Object.values(z).map(Z=>Z.map(X=>({...X,display_value:P(X)})))}),pe.success()})})};return x.useEffect(()=>()=>{s.cancelQueries(["reports"]),pe.dismiss(),b(null)},[]),h.jsxs(v4,{title:n,breadcrumbs:t,onSaveClick:N,saveButtonLabel:e("export"),disableSaveButton:d||!Vy()&&!$u(),navigationTopRight:h.jsxs(Z_,{label:e("actions"),disabled:!Vy()&&!$u(),children:[c.supports_previews&&h.jsx($n,{icon:h.jsx(an,{element:lTt}),onClick:O,children:e("preview")}),h.jsx($n,{icon:h.jsx(an,{element:iwe}),onClick:()=>o(c,m),children:e("schedule")})]}),children:[h.jsx(rbn,{}),h.jsxs("div",{className:"grid grid-cols-12 gap-4",style:{borderColor:r.$4},children:[h.jsxs(er,{className:"col-span-12 lg:col-span-6 h-max shadow-sm",style:{borderColor:r.$24},children:[h.jsx(ne,{leftSide:e("report"),children:h.jsx(Dn,{onValueChange:M=>{C(M),b(null)},value:c.identifier,cypressRef:"reportNameSelector",customSelector:!0,dismissable:!1,children:i.map((M,B)=>h.jsx("option",{value:M.identifier,children:e(M.label)},B))})}),h.jsx(ne,{leftSide:e("send_email"),children:h.jsx(jt,{checked:c.payload.send_email,onValueChange:L})}),y("document_email_attachment")&&h.jsx(ne,{leftSide:e("document_email_attachment"),children:h.jsx(jt,{checked:c.payload.document_email_attachment,onValueChange:M=>S("document_email_attachment",M),cypressRef:"scheduleDocumentEmailAttachment"})}),y("pdf_email_attachment")&&h.jsx(ne,{leftSide:e("attach_pdf"),children:h.jsx(jt,{checked:c.payload.pdf_email_attachment,onValueChange:M=>S("pdf_email_attachment",M)})}),y("is_expense_billed")&&h.jsx(ne,{leftSide:e("expense_paid_report"),children:h.jsx(jt,{checked:c.payload.is_expense_billed,onValueChange:M=>S("is_expense_billed",M),cypressRef:"expenseBilled"})}),y("is_income_billed")&&h.jsx(ne,{leftSide:e("cash_vs_accrual"),children:h.jsx(jt,{checked:c.payload.is_income_billed,onValueChange:M=>S("is_income_billed",M),cypressRef:"incomeBilled"})}),y("include_tax")&&h.jsx(ne,{leftSide:e("include_tax"),children:h.jsx(jt,{checked:c.payload.include_tax,onValueChange:M=>S("include_tax",M),cypressRef:"includeTax"})}),y("include_deleted")&&h.jsx(ne,{leftSide:e("include_deleted"),leftSideHelp:e("include_deleted_help"),children:h.jsx(jt,{checked:c.payload.include_deleted,onValueChange:M=>S("include_deleted",M),cypressRef:"includeDeleted"})}),y("status")&&h.jsx(ne,{leftSide:e("status"),className:"mb-50 py-50",children:h.jsx(cit,{report:c.identifier,onValueChange:M=>S("status",M)})}),y("product_key")&&h.jsx(Nnt,{value:c.payload.product_key,onValueChange:M=>S("product_key",M)}),y("clients")&&h.jsx(hit,{value:c.payload.clients,onValueChange:M=>S("clients",M)}),y("vendors")&&h.jsx(git,{value:c.payload.vendors,onValueChange:M=>S("vendors",M)}),y("projects")&&h.jsx(pit,{value:c.payload.projects,onValueChange:M=>S("projects",M)}),y("categories")&&h.jsx(fit,{value:c.payload.categories,onValueChange:M=>S("categories",M)}),y("activity_type_id")&&h.jsx(ne,{leftSide:e("activity"),className:"mb-50 py-50",children:h.jsx(lbn,{value:c.payload.activity_type_id||"",onChange:M=>S("activity_type_id",M)})})]}),h.jsxs(er,{className:"col-span-12 lg:col-span-6 h-max shadow-sm",style:{borderColor:r.$24},children:[h.jsx(ne,{leftSide:e("range"),children:h.jsx(Dn,{value:c.payload.date_range,onValueChange:M=>k(M),cypressRef:"reportDateRange",customSelector:!0,dismissable:!1,children:fK.map((M,B)=>h.jsx("option",{value:M.identifier,children:e(M.label)},B))})}),c.payload.date_range==="custom"&&h.jsx(ne,{leftSide:e("start_date"),children:h.jsx(lt,{type:"date",value:c.payload.start_date,onValueChange:M=>I("start_date",M),errorMessage:(F=p==null?void 0:p.errors)==null?void 0:F.start_date,cypressRef:"reportStartDate"})}),c.payload.date_range==="custom"&&h.jsx(ne,{leftSide:e("end_date"),children:h.jsx(lt,{type:"date",value:c.payload.end_date,onValueChange:M=>I("end_date",M),errorMessage:(V=p==null?void 0:p.errors)==null?void 0:V.end_date,cypressRef:"reportEndDate"})}),y("client")&&h.jsx(ne,{leftSide:e("client"),children:h.jsx(DA,{value:c.payload.client_id,onChange:M=>S("client_id",M.id),clearButton:!0,onClearButtonClick:()=>S("client_id",""),withoutAction:!0})}),c.allow_custom_column&&h.jsx(ne,{leftSide:`${e("customize")} ${e("columns")}`,children:h.jsx(jt,{checked:m,onValueChange:M=>_(!!M)})})]})]}),m&&h.jsx(Xvn,{report:c.identifier,columns:c.custom_columns}),v&&h.jsx(Jvn,{})]})}const dbn=Object.freeze(Object.defineProperty({__proto__:null,default:ubn,ranges:fK},Symbol.toStringTag,{value:"Module"})),Lu=["send_email","range","start_date","end_date"],mit={invoice:[...Lu,"status","document_email_attachment","report_keys","include_deleted","client","pdf_email_attachment"],invoice_item:[...Lu,"products","document_email_attachment","report_keys","status","include_deleted","client"],product_sales:[...Lu,"products","client"],profitloss:[...Lu,"expense_billed","income_billed","include_tax"],client:[...Lu,"document_email_attachment","report_keys","include_deleted"],contact:[...Lu,"report_keys"],recurring_invoice:[...Lu,"report_keys","status","include_deleted","client"],quote:[...Lu,"document_email_attachment","report_keys","status","include_deleted","client","pdf_email_attachment"],quote_item:[...Lu,"document_email_attachment","report_keys","status","include_deleted","client"],credit:[...Lu,"document_email_attachment","report_keys","include_deleted","status","client","pdf_email_attachment"],document:[...Lu,"document_email_attachment"],payment:[...Lu,"document_email_attachment","report_keys","status","client"],expense:[...Lu,"document_email_attachment","clients","vendors","projects","categories","report_keys","status","include_deleted"],task:[...Lu,"document_email_attachment","report_keys","status","include_deleted","client"],product:[...Lu,"document_email_attachment"],vendor:[...Lu,"document_email_attachment","report_keys"],purchase_order:[...Lu,"document_email_attachment","report_keys","status","include_deleted","pdf_email_attachment"],purchase_order_item:[...Lu,"document_email_attachment","report_keys","status","include_deleted"]};function hbn(n){const[e]=xe(),t=uit(),{schedule:i,handleChange:r,errors:s}=n,o=a=>(mit[i.parameters.report_name]||Lu).includes(a);return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("report"),children:h.jsx(Dn,{value:i.parameters.report_name,onValueChange:a=>r("parameters.report_name",a),errorMessage:s==null?void 0:s.errors["parameters.report_name"],cypressRef:"scheduleReportName",customSelector:!0,dismissable:!1,children:t.map((a,l)=>h.jsx("option",{value:a.schedule_identifier||a.identifier,children:e(a.label)},l))})}),o("send_email")&&h.jsx(ne,{leftSide:e("send_email"),children:h.jsx(jt,{checked:i.parameters.send_email,onValueChange:a=>r("parameters.send_email",a),disabled:!0,cypressRef:"scheduleSendEmail"})}),o("document_email_attachment")&&h.jsx(ne,{leftSide:e("document_email_attachment"),children:h.jsx(jt,{checked:i.parameters.document_email_attachment,onValueChange:a=>r("parameters.document_email_attachment",a),cypressRef:"scheduleDocumentEmailAttachment"})}),o("pdf_email_attachment")&&h.jsx(ne,{leftSide:e("attach_pdf"),children:h.jsx(jt,{checked:i.parameters.pdf_email_attachment,onValueChange:a=>r("parameters.pdf_email_attachment",a)})}),o("expense_billed")&&h.jsx(ne,{leftSide:e("expense_paid_report"),children:h.jsx(jt,{checked:i.parameters.is_expense_billed,onValueChange:a=>r("parameters.is_expense_billed",a),cypressRef:"expenseBilled"})}),o("income_billed")&&h.jsx(ne,{leftSide:e("cash_vs_accrual"),children:h.jsx(jt,{checked:i.parameters.is_income_billed,onValueChange:a=>r("parameters.is_income_billed",a),cypressRef:"incomeBilled"})}),o("include_tax")&&h.jsx(ne,{leftSide:e("include_tax"),children:h.jsx(jt,{checked:i.parameters.include_tax,onValueChange:a=>r("parameters.include_tax",a),cypressRef:"includeTax"})}),o("include_deleted")&&h.jsx(ne,{leftSide:e("include_deleted"),leftSideHelp:e("include_deleted_help"),children:h.jsx(jt,{checked:i.parameters.include_deleted,onValueChange:a=>r("parameters.include_deleted",a),cypressRef:"includeDeleted"})}),o("status")&&h.jsx(ne,{leftSide:e("status"),children:h.jsx(cit,{report:i.parameters.report_name,value:i.parameters.status,onValueChange:a=>r("parameters.status",a),errorMessage:s==null?void 0:s.errors["parameters.status"]})}),o("products")&&h.jsx(Nnt,{value:i.parameters.product_key,onValueChange:a=>r("parameters.product_key",a),errorMessage:s==null?void 0:s.errors["parameters.product_key"]}),o("range")&&h.jsx(ne,{leftSide:e("range"),children:h.jsx(Dn,{value:i.parameters.date_range,onValueChange:a=>r("parameters.date_range",a),errorMessage:s==null?void 0:s.errors["parameters.date_range"],cypressRef:"scheduleDateRange",customSelector:!0,dismissable:!1,children:fK.map((a,l)=>h.jsx("option",{value:a.scheduleIdentifier,children:e(a.label)},l))})}),o("range")&&i.parameters.date_range==="custom"&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("start_date"),children:h.jsx(lt,{type:"date",value:i.parameters.start_date,onValueChange:a=>r("parameters.start_date",a),errorMessage:s==null?void 0:s.errors["parameters.start_date"],cypressRef:"scheduleStartDate"})}),h.jsx(ne,{leftSide:e("end_date"),children:h.jsx(lt,{type:"date",value:i.parameters.end_date,onValueChange:a=>r("parameters.end_date",a),errorMessage:s==null?void 0:s.errors["parameters.end_date"],cypressRef:"scheduleEndDate"})})]}),o("client")&&h.jsx(ne,{leftSide:e("client"),children:h.jsx(DA,{value:i.parameters.client_id,onChange:a=>r("parameters.client_id",a.id),clearButton:!0,onClearButtonClick:()=>r("parameters.client_id",""),withoutAction:!0,errorMessage:s==null?void 0:s.errors["parameters.client_id"]})}),o("clients")&&h.jsx(hit,{value:i.parameters.clients.join(","),onValueChange:a=>{const l={...i.parameters};l.clients=a?[...a.split(",")]:[],r("parameters",l)},errorMessage:s==null?void 0:s.errors["parameters.clients"]}),o("vendors")&&h.jsx(git,{value:i.parameters.vendors,onValueChange:a=>r("parameters.vendors",a),errorMessage:s==null?void 0:s.errors["parameters.vendors"]}),o("projects")&&h.jsx(pit,{value:i.parameters.projects,onValueChange:a=>r("parameters.projects",a),errorMessage:s==null?void 0:s.errors["parameters.projects"]}),o("categories")&&h.jsx(fit,{value:i.parameters.categories,onValueChange:a=>r("parameters.categories",a),errorMessage:s==null?void 0:s.errors["parameters.categories"]})]})}const fbn=Ls(void 0);function pbn(n){const[e]=xe(),t=xt();Lo();const i=ji(fbn),{schedule:r,handleChange:s,errors:o,page:a}=n,{data:l}=mEe({enabled:a==="edit"||!!i}),[c,u]=x.useState([]),d=p=>{var m,_;const g={...r.parameters,clients:[],auto_send:((m=r.parameters)==null?void 0:m.auto_send)??!1,include_project_tasks:((_=r.parameters)==null?void 0:_.include_project_tasks)??!1};g.clients=p.map(({id:v})=>v),s("parameters",g)},f=p=>{const g=c.filter((m,_)=>_!==p);d(g),u(g)};return x.useEffect(()=>{if((a==="edit"||i)&&l){const p=l==null?void 0:l.filter(g=>{var m,_;return(_=(m=r.parameters)==null?void 0:m.clients)==null?void 0:_.includes(g.id)});u(p||[])}},[l]),h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("date_range"),children:h.jsxs(Dn,{value:r.parameters.date_range,onValueChange:p=>s("parameters.date_range",p),errorMessage:o==null?void 0:o.errors["parameters.date_range"],customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"last7_days",children:e("last7_days")}),h.jsx("option",{value:"last30_days",children:e("last30_days")}),h.jsx("option",{value:"last365_days",children:e("last365_days")}),h.jsx("option",{value:"this_month",children:e("this_month")}),h.jsx("option",{value:"last_month",children:e("last_month")}),h.jsx("option",{value:"this_quarter",children:e("this_quarter")}),h.jsx("option",{value:"last_quarter",children:e("last_quarter")}),h.jsx("option",{value:"this_year",children:e("this_year")}),h.jsx("option",{value:"last_year",children:e("last_year")}),h.jsx("option",{value:"all_time",children:e("all_time")})]})}),h.jsx(ne,{leftSide:e("auto_send"),leftSideHelp:e("auto_send_help"),children:h.jsx(jt,{checked:r.parameters.auto_send,onValueChange:p=>s("parameters.auto_send",p)})}),h.jsx(ne,{leftSide:e("include_project_tasks"),leftSideHelp:e("include_project_tasks_help"),children:h.jsx(jt,{checked:r.parameters.include_project_tasks,onValueChange:p=>s("parameters.include_project_tasks",p)})}),h.jsxs(ne,{leftSide:e("client"),children:[h.jsx(DA,{onChange:p=>{u(g=>{const m=[...g,p];return d(m),m})},withoutAction:!0,clearInputAfterSelection:!0,exclude:r.parameters.clients}),h.jsxs("div",{className:"flex justify-center",children:[h.jsx("div",{className:"flex flex-col space-y-2 pt-3",children:c==null?void 0:c.map((p,g)=>h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{children:p.display_name}),h.jsx("div",{className:"cursor-pointer ml-16",onClick:()=>f(g),children:h.jsx(c1,{color:t.$16,hoverColor:t.$3,borderColor:t.$5,hoverBorderColor:t.$17,size:"1.6rem"})})]},p.id))}),!(c!=null&&c.length)&&h.jsx("span",{className:"self-center text-xl mt-4",style:{color:t.$17},children:e("all_clients")})]})]})]})}const tFe={id:0,date:"",amount:0,is_amount:!0};function gbn(n){const[e]=xe(),{visible:t,setVisible:i,schedule:r,onSave:s,scheduleIndex:o,errors:a,setErrors:l,remainingAmount:c,isFirstSchedule:u,isAmountMode:d,minDate:f,selectedInvoice:p}=n,g=I=>{const L=new Date(I);return L.setDate(L.getDate()+1),L.toISOString().split("T")[0]},m=I=>{var O;if(!p)return c;console.log("isAmountMode",I);const L=p.amount,N=((O=r.parameters.schedule)==null?void 0:O.reduce((F,V,M)=>M===o?F:V.is_amount!==I?F+(I?V.amount*L/100:V.amount/L*100):F+V.amount,0))||0;return Number(I?(L-N).toFixed(2):(100-N).toFixed(0))},_=I=>{var N,P,O,F;if(o>-1&&((N=r.parameters.schedule)!=null&&N[o]))return r.parameters.schedule[o].amount;const L=m(((F=(O=(P=r.parameters)==null?void 0:P.schedule)==null?void 0:O[0])==null?void 0:F.is_amount)??!0);return Number(I?L.toFixed(2):L.toFixed(0))},[v,b]=x.useState(tFe);x.useEffect(()=>{t&&l(void 0)},[t]),x.useEffect(()=>{var I,L,N,P,O;if(t)if(o>-1&&((I=r.parameters.schedule)!=null&&I[o]))b(r.parameters.schedule[o]);else{const F=((N=(L=r.parameters.schedule)==null?void 0:L[0])==null?void 0:N.is_amount)??d;b({...tFe,id:(((O=(P=r.parameters)==null?void 0:P.schedule)==null?void 0:O.length)??0)+1,date:g(f),amount:_(F),is_amount:F})}},[t,o,f,d,p==null?void 0:p.amount,r]);const y=I=>{p!=null&&p.amount;const L=m(I);let N;if(I)N=Number(L.toFixed(2));else{const P=Math.min(L,100);N=Number(P.toFixed(0))}b(P=>{var O,F;return{...P,id:(((F=(O=r.parameters)==null?void 0:O.schedule)==null?void 0:F.length)??0)+1,is_amount:I,amount:N}})},C=(I,L)=>{b(N=>({...N,[I]:L}))},S=()=>{const I={};if(v.date?v.date<=f&&(I.date=[e("date_must_be_after_previous_schedule")]):I.date=[e("field_is_required")],v.amount<=0)I.amount=[e("amount_must_be_greater_than_zero")];else{const L=m(v.is_amount);v.amount>L&&(I.amount=[v.is_amount?e("max_amount")+" "+L:e("max_amount")+" "+L+"%"])}return I},k=()=>{const I=S();if(Object.keys(I).length>0){l({message:"",errors:I});return}const L=m(v.is_amount),N=Math.min(v.amount,L),P={...v,amount:v.is_amount?Number(N.toFixed(2)):Number(N.toFixed(0))};l(void 0),s(P,o)};return h.jsxs(pr,{title:o>-1?e("edit_schedule"):e("new_schedule"),visible:t,onClose:()=>i(!1),overflowVisible:!0,children:[h.jsx(lt,{label:e("payment_date"),type:"date",min:f,value:v.date,onValueChange:I=>C("date",I),errorMessage:a==null?void 0:a.errors.date}),h.jsxs("div",{className:"flex flex-col space-y-2",children:[h.jsxs("div",{children:[h.jsx(Qs,{label:v.is_amount?e("payment_amount"):e("percent"),value:v.amount,onValueChange:I=>{const L=parseFloat(I);isNaN(L)||C("amount",L)},precision:v.is_amount?2:0,errorMessage:a==null?void 0:a.errors.amount}),h.jsx("div",{className:"text-sm text-gray-600 mt-1",children:v.is_amount?`Remaining: $${m(v.is_amount)} of ${(p==null?void 0:p.amount)||0}`:`Remaining: ${m(v.is_amount)}% of invoice`})]}),u&&h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(jt,{checked:v.is_amount,onValueChange:y}),h.jsx("span",{children:v.is_amount?e("amount"):e("percent")})]})]}),h.jsx(dn,{behavior:"button",className:"self-end",onClick:k,children:e("save")})]})}Ls(void 0);function mbn(n){var q,U,G;const[e]=xe(),t=vf(),[i,r]=x.useState(!1),[s,o]=x.useState(-1),[a,l]=x.useState(null),{schedule:c,handleChange:u,errors:d,setErrors:f,page:p,disableInvoiceSelection:g}=n,{data:m}=tmn({id:((q=c==null?void 0:c.parameters)==null?void 0:q.invoice_id)||"",includeIsLocked:!1}),[_,v]=x.useState([]),[b,y]=x.useState(!0),[C,S]=x.useState(0),[k,I]=x.useState(void 0);x.useEffect(()=>{var H;(H=c==null?void 0:c.parameters)!=null&&H.schedule?v(c.parameters.schedule):v([]),m&&l(m)},[(U=c==null?void 0:c.parameters)==null?void 0:U.schedule,m]),x.useEffect(()=>{var oe,fe;if(_.length===0){y(!1),S(0);return}if(!a){if(((oe=_[0])==null?void 0:oe.is_amount)??!0){const Me=_.reduce((ye,Pe)=>ye+Pe.amount,0),Ie=Me/.9,ge=Math.max(0,Ie-Me);y(ge<=0),S(ge)}else{const Me=_.reduce((ge,ye)=>ge+ye.amount,0),Ie=Math.max(0,100-Me);y(Ie<=0),S(Ie)}return}const H=((fe=_[0])==null?void 0:fe.is_amount)??!0,z=a.amount,Z=_.reduce((Se,Me)=>Me.is_amount!==H?Se+(H?Me.amount*z/100:Me.amount/z*100):Se+Me.amount,0),X=Number(H?(z-Z).toFixed(2):(100-Z).toFixed(0));y(X<=0),S(X)},[_,a]);const L={...c,parameters:{...c.parameters,schedule:_}},N=H=>{var z,Z;return`${H.number} (${t(H.amount,(z=H==null?void 0:H.client)==null?void 0:z.country_id,(Z=H==null?void 0:H.client)==null?void 0:Z.settings.currency_id)})`},P=()=>{o(-1),r(!0)},O=H=>H.is_amount?t(H.amount,"",""):H.amount+" %",F=H=>{var X,oe,fe;const z=_.filter((Se,Me)=>Me!==H);if(v(z),z.length===0)y(!1),S(0);else if(a){const Se=((oe=z[0])==null?void 0:oe.is_amount)??!0,Me=a.amount,Ie=z.reduce((ye,Pe)=>Pe.is_amount!==Se?ye+(Se?Pe.amount*Me/100:Pe.amount/Me*100):ye+Pe.amount,0),ge=Number(Se?(Me-Ie).toFixed(2):(100-Ie).toFixed(0));y(ge<=0),S(ge)}else if(((X=z[0])==null?void 0:X.is_amount)??!0){const Me=z.reduce((ye,Pe)=>ye+Pe.amount,0),Ie=Me/.9,ge=Math.max(0,Ie-Me);y(ge<=0),S(ge)}else{const Me=z.reduce((ge,ye)=>ge+ye.amount,0),Ie=Math.max(0,100-Me);y(Ie<=0),S(Ie)}const Z={...c.parameters,schedule:z,auto_bill:((fe=c.parameters)==null?void 0:fe.auto_bill)??!1};u("parameters",Z),d!=null&&d.errors["parameters.schedule"]&&f(void 0)},V=()=>_.length===0?new Date().toISOString().split("T")[0]:_[_.length-1].date,M=H=>{const z=new Date;return z.setHours(0,0,0,0),new Date(H)<z},B=(H,z)=>{var oe,fe,Se;let Z;if(z>=0&&z<_.length?Z=_.map((Me,Ie)=>Ie===z?H:Me):Z=[..._,H],v(Z),Z.length===0)y(!1),S(0);else if(a){const Me=((fe=Z[0])==null?void 0:fe.is_amount)??!0,Ie=a.amount,ge=Z.reduce((Pe,Be)=>Be.is_amount!==Me?Pe+(Me?Be.amount*Ie/100:Be.amount/Ie*100):Pe+Be.amount,0),ye=Number(Me?(Ie-ge).toFixed(2):(100-ge).toFixed(0));y(ye<=0),S(ye)}else if(((oe=Z[0])==null?void 0:oe.is_amount)??!0){const Ie=Z.reduce((Pe,Be)=>Pe+Be.amount,0),ge=Ie/.9,ye=Math.max(0,ge-Ie);y(ye<=0),S(ye)}else{const Ie=Z.reduce((ye,Pe)=>ye+Pe.amount,0),ge=Math.max(0,100-Ie);y(ge<=0),S(ge)}const X={...c.parameters,schedule:Z,auto_bill:((Se=c.parameters)==null?void 0:Se.auto_bill)??!1};u("parameters",X),d!=null&&d.errors["parameters.schedule"]&&f(void 0),r(!1)};function W(){var z;return((z=_[0])==null?void 0:z.is_amount)??!0?t(C,"","")+" "+e("remaining"):C+" % "+e("remaining")}return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("invoice"),children:g&&a?h.jsxs("div",{children:[h.jsx("div",{className:"flex items-center px-3 py-2 border border-gray-300 rounded-md bg-gray-50",children:h.jsx("span",{className:"text-sm text-gray-700",children:N(a)})}),(d==null?void 0:d.errors["parameters.invoice_id"])&&h.jsx("div",{className:"mt-2 p-2 bg-red-50 text-red-700 rounded-md text-sm",children:d.errors["parameters.invoice_id"].map((H,z)=>h.jsx("div",{children:H},z))})]}):h.jsx(qd,{endpoint:ze("/api/v1/invoices?include=client.group_settings&filter_deleted_clients=true&status=active&show_schedule=true"),onChange:H=>{H.resource&&(l(H.resource),u("parameters.invoice_id",H.resource.id))},inputOptions:{value:c.parameters.invoice_id||""},readonly:p==="edit",entryOptions:{id:"id",label:"number",value:"id",dropdownLabelFn:H=>N(H),inputLabelFn:H=>H?N(H):""},onDismiss:()=>u("parameters.invoice_id",""),errorMessage:d==null?void 0:d.errors["parameters.invoice_id"]})}),h.jsx(ne,{leftSide:e("auto_bill"),leftSideHelp:e("auto_bill_help"),children:h.jsx(jt,{checked:c.parameters.auto_bill,onValueChange:H=>u("parameters.auto_bill",H)})}),(a||_.length>0)&&h.jsxs("div",{children:[_.length>0&&h.jsxs(h.Fragment,{children:[h.jsxs(h1,{children:[h.jsxs(p1,{children:[h.jsx(_a,{children:e("date")},"date"),h.jsx(_a,{children:e("amount")},"amount"),h.jsx(_a,{children:e("action")},"action")]}),h.jsxs(f1,{children:[_.map((H,z)=>h.jsxs(hc,{className:`border-b ${M(H.date)?"opacity-60":""}`,children:[h.jsx(bs,{width:"30%",children:H.date}),h.jsx(bs,{children:O(H)}),h.jsx(bs,{children:h.jsx("div",{className:"",children:h.jsx(dn,{behavior:"button",onClick:()=>F(z),disabled:M(H.date),disableWithoutIcon:!0,children:e("remove")})})})]},z)),!b&&h.jsx(hc,{children:h.jsxs(bs,{colSpan:3,className:"text-center py-3",children:[h.jsx(dn,{behavior:"button",onClick:P,disableWithoutIcon:!0,children:e("add")}),(d==null?void 0:d.errors["parameters.schedule"][0])&&h.jsx("div",{className:"text-red-500 text-sm mt-1",children:d.errors["parameters.schedule"][0]})]})})]})]}),b&&h.jsxs("div",{className:"mb-4 p-4 bg-green-50 text-green-700 rounded-md flex justify-center",children:[e("complete")," ",W()]}),!b&&h.jsx("div",{className:"mb-4 p-4 bg-orange-50 text-red-700 rounded-md flex justify-center",children:W()})]}),_.length===0&&a&&h.jsx("div",{className:"mb-4 flex justify-center",children:h.jsx(dn,{behavior:"button",onClick:P,children:e("schedule")})}),(d==null?void 0:d.errors["parameters.schedule"])&&h.jsx("div",{className:"mb-4 p-4 bg-red-50 text-red-700 rounded-md flex justify-center",children:d.errors["parameters.schedule"][0]})]}),h.jsx(gbn,{visible:i,setVisible:r,schedule:L,onSave:B,scheduleIndex:s,errors:k,setErrors:I,remainingAmount:C,isFirstSchedule:_.length===0,isAmountMode:((G=_[0])==null?void 0:G.is_amount)??!0,minDate:V(),selectedInvoice:a})]})}var zj=(n=>(n.EMAIL_STATEMENT="email_statement",n.EMAIL_RECORD="email_record",n.EMAIL_REPORT="email_report",n.INVOICE_OUTSTANDING_TASKS="invoice_outstanding_tasks",n.PAYMENT_SCHEDULE="payment_schedule",n))(zj||{});function _it(n){var c,u;const[e]=xe(),t=xt(),{schedule:i,handleChange:r,errors:s,setErrors:o,page:a}=n,l=jgn({template:i.template});return h.jsxs(er,{title:e(a==="edit"?"edit_schedule":"new_schedule"),className:"shadow-sm pb-6",childrenClassName:"pt-4",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},withoutBodyPadding:!0,children:[l("template")&&h.jsx(ne,{leftSide:e("template"),required:!0,children:h.jsxs(Dn,{value:i.template,onValueChange:d=>r("template",d),errorMessage:s==null?void 0:s.errors.template,customSelector:!0,dismissable:!1,disabled:a==="edit",children:[h.jsx("option",{value:"email_statement",children:e("email_statement")}),h.jsx("option",{value:"email_record",children:e("email_record")}),h.jsx("option",{value:"email_report",children:e("email_report")}),h.jsx("option",{value:"invoice_outstanding_tasks",children:e("invoice_outstanding_tasks")}),h.jsx("option",{value:"payment_schedule",children:e("payment_schedule")})]})}),l("next_run")&&h.jsx(ne,{leftSide:e("next_run"),required:!0,children:h.jsx(lt,{type:"date",value:i.next_run,onValueChange:d=>r("next_run",d),errorMessage:s==null?void 0:s.errors.next_run})}),l("frequency")&&h.jsx(ne,{leftSide:e("frequency"),children:h.jsx(Dn,{value:(c=i.frequency_id)==null?void 0:c.toString(),onValueChange:d=>r("frequency_id",d),errorMessage:s==null?void 0:s.errors.frequency_id,customSelector:!0,dismissable:!1,children:Object.keys(NL).map((d,f)=>h.jsx("option",{value:d,children:e(NL[d])},f))})}),l("remaining_cycles")&&h.jsx(ne,{leftSide:e("remaining_cycles"),children:h.jsxs(Dn,{value:(u=i.remaining_cycles)==null?void 0:u.toString(),onValueChange:d=>r("remaining_cycles",parseInt(d)),errorMessage:s==null?void 0:s.errors.remaining_cycles,customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"-1",children:e("endless")}),[...Array(60).keys()].map((d,f)=>h.jsx("option",{value:d.toString(),children:d},f))]})}),i.template&&h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:t.$20})}),i.template==="email_statement"&&h.jsx(Pgn,{schedule:i,handleChange:r,errors:s,page:a}),i.template==="email_record"&&h.jsx(Ogn,{schedule:i,handleChange:r,errors:s}),i.template==="email_report"&&h.jsx(hbn,{schedule:i,handleChange:r,errors:s}),i.template==="invoice_outstanding_tasks"&&h.jsx(pbn,{schedule:i,handleChange:r,errors:s}),i.template==="payment_schedule"&&h.jsx(mbn,{schedule:i,handleChange:r,errors:s,setErrors:o,page: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 _bn(){const[n]=xe();return[{id:"name",label:n("name"),format:(t,i)=>i.template===zj.EMAIL_RECORD?`${n(i.template)}: ${n(i.parameters.entity)}`:i.template===zj.EMAIL_REPORT?`${n(i.template)}: ${n(i.parameters.report_name)} | ${n(i.parameters.date_range)}`:i.template===zj.PAYMENT_SCHEDULE||i.template===zj.INVOICE_OUTSTANDING_TASKS?i.name:`${n(i.template)}: ${n(i.parameters.date_range)}`},{id:"next_run",label:n("next_run")},{id:"frequency_id",label:n("frequency"),format:t=>n(NL[t])}]}function vbn(){const{documentTitle:n}=vr("schedules"),[e]=xe(),t=_bn(),i=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"}];return h.jsx(Kr,{title:n,docsLink:"en/advanced-settings/#schedules",breadcrumbs:i,children:h.jsx(qm,{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,enableSavingFilterPreference:!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 bbn={range:"date_range",expense_billed:"is_expense_billed",income_billed:"is_income_billed",products:"product_key",client:"client_id"};function ybn(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=(mit[e.parameters.report_name]||Lu).map(s=>bbn[s]||s);return e.parameters.date_range!=="custom"&&(r=r.filter(s=>s!=="start_date"&&s!=="end_date")),r}return[]})()],invoice_outstanding_tasks:["date_range","clients","auto_send","include_project_tasks"],payment_schedule:["template","next_run","schedule","auto_bill","invoice_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 Cbn={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"],invoice_outstanding_tasks:["template","next_run","parameters"],payment_schedule:["template","next_run","parameters"]},wbn=["vendors","projects","categories"];function vit(n){const{schedule:e}=n,t=ybn({schedule:e});return()=>{if(e){let i={};const r=Cbn[e.template],s=t[e.template];return Object.entries(e.parameters).forEach(([o])=>{s.includes(o)||delete e.parameters[o]}),Object.entries(e).forEach(([o,a])=>{r.includes(o)&&(i={...i,[o]:a})}),Object.entries(e.parameters).forEach(([o,a])=>{wbn.includes(o)&&(i={...i,parameters:{...i.parameters,[o]:a||""}})}),i}}}function xbn(){const{documentTitle:n}=vr("new_schedule"),[e]=xe(),t=Yi(),[i]=qB(),r=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"},{name:e("new_schedule"),href:"/settings/schedules/create"}],{data:s}=znt(),[o,a]=x.useState(),[l,c]=x.useState(),[u,d]=oo(xee),[f,p]=x.useState(!1),g=Unt({setErrors:c,setSchedule:a,schedule:o}),m=vit({schedule:o});x.useEffect(()=>{s&&a(()=>{let v=u;return i.get("template")||(v=void 0,d(void 0)),{...s,template:i.get("template")||"email_statement",frequency_id:Qh.Monthly,remaining_cycles:-1,parameters:v||{...q8}}})},[s]);const _=()=>{!f&&o&&(p(!0),c(void 0),pe.processing(),Je("POST",ze("/api/v1/task_schedulers"),m()).then(v=>{pe.success("created_schedule"),ii(["task_schedulers"]),t(Ut("/settings/schedules/:id/edit",{id:v.data.data.id}))}).catch(v=>{var b;((b=v.response)==null?void 0:b.status)===422&&(c(v.response.data),pe.dismiss())}).finally(()=>p(!1)))};return h.jsx(Kr,{title:n,breadcrumbs:r,disableSaveButton:f||!o,onSaveClick:_,children:o?h.jsx(_it,{schedule:o,handleChange:g,errors:l,setErrors:c}):h.jsx(yo,{})})}function Sbn(){const[n]=xe(),e=Bmn();return[i=>hs(i)===Vr.Active&&h.jsx($n,{onClick:()=>e([i.id],"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),i=>(hs(i)===Vr.Archived||hs(i)===Vr.Deleted)&&h.jsx($n,{onClick:()=>e([i.id],"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),i=>(hs(i)===Vr.Active||hs(i)===Vr.Archived)&&h.jsx($n,{onClick:()=>e([i.id],"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}function Ebn(){const{documentTitle:n}=vr("edit_schedule"),[e]=xe(),{id:t}=Yl(),i=Sbn(),r=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"},{name:e("edit_schedule"),href:Ut("/settings/schedules/:id/edit")}],{data:s}=Fmn({id:t}),[o,a]=x.useState(),[l,c]=x.useState(),[u,d]=x.useState(!1),f=Unt({setErrors:c,setSchedule:a,schedule:o}),p=vit({schedule:o}),g=()=>{!u&&o&&(d(!0),c(void 0),pe.processing(),Je("PUT",ze("/api/v1/task_schedulers/:id",{id:t}),p()).then(()=>{pe.success("updated_schedule"),ii(["task_schedulers"])}).catch(m=>{var _;((_=m.response)==null?void 0:_.status)===422&&(c(m.response.data),pe.dismiss())}).finally(()=>d(!1)))};return x.useEffect(()=>{s&&a(s)},[s]),h.jsx(Kr,{title:n,breadcrumbs:r,navigationTopRight:o&&h.jsx(Kw,{resource:o,onSaveClick:g,actions:i,disableSaveButton:u||!o}),children:o?h.jsx(_it,{schedule:o,handleChange:f,errors:l,setErrors:c,page:"edit"}):h.jsx(yo,{})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function kbn(){const{t:n}=xe();return[{name:n("backup"),href:"/settings/backup_restore"},{name:n("restore"),href:"/settings/backup_restore/restore"}]}function Tbn(){const[n]=xe(),e=xt(),t=kbn(),i=[{name:n("settings"),href:"/settings"},{name:n("backup_restore"),href:"/settings/backup_restore"}];return h.jsx(Kr,{title:n("backup_restore"),breadcrumbs:i,children:h.jsxs(er,{className:"shadow-sm",title:n("backup_restore"),withoutBodyPadding:!0,withoutHeaderBorder:!0,style:{borderColor:e.$24},children:[h.jsx(wk,{tabs:t,horizontalPaddingWidth:"1.5rem",withHorizontalPadding:!0,fullRightPadding:!0,withHorizontalPaddingOnSmallScreen:!0}),h.jsx("div",{className:"pt-4 pb-6",children:h.jsx(Hm,{})})]})})}function Ibn(n){const[e]=xe(),{data:t}=jQe(),[i,r]=x.useState(!1),[s,o]=x.useState(),[a,l]=x.useState(),c=pnt(a,o,r,i,n.setIsModalOpen,n.onCreatedBankAccount),u=(p,g)=>{l(m=>m&&{...m,[p]:g})},d=()=>{i||n.setIsModalOpen(!1)};x.useEffect(()=>{t&&l(t)},[t]);const f=xt();return h.jsxs(pr,{title:e("new_bank_account"),visible:n.isModalOpen,onClose:d,children:[h.jsx(lt,{style:{color:f.$3,colorScheme:f.$0},label:e("name"),value:a==null?void 0:a.bank_account_name,onValueChange:p=>u("bank_account_name",p),errorMessage:s==null?void 0:s.errors.bank_account_name}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{onClick:c,style:{color:f.$3,colorScheme:f.$0},children:e("save")})})]})}function bit(n){var o;const[e]=xe(),[t,i]=x.useState(!1),{isAdmin:r,isOwner:s}=go();return h.jsxs(h.Fragment,{children:[h.jsx(Ibn,{isModalOpen:t,setIsModalOpen:i,onCreatedBankAccount:a=>n.onChange(a)}),h.jsx(qd,{endpoint:ze("/api/v1/bank_integrations?status=active"),onChange:a=>a.resource&&n.onChange(a.resource),inputOptions:{label:(o=n.inputLabel)==null?void 0:o.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||s},readonly:n.readonly,onDismiss:n.onClearButtonClick,sortBy:"bank_account_name|desc",staleTime:n.staleTime,errorMessage:n.errorMessage})]})}function yit(n){const[e]=xe(),t=Fr(),i=Yi(),{onImport:r,importMap:s,entity:o}=n,a=bZ(),l=Qo(),[c,u]=x.useState(!1),[d,f]=x.useState(!1),[p,g]=x.useState(!1),[m,_]=x.useState(""),v=()=>{_(""),u(!1),i(`/${o}s`)},b=()=>{var I,L;if(!((I=l==null?void 0:l.import_templates)!=null&&I[o]))return!0;if(!Object.keys(s.column_map).length)return!1;let k=!1;return Object.values((L=l==null?void 0:l.import_templates)==null?void 0:L[o]).forEach(N=>{var P,O;pn.isEqual(Object.values(N).map(F=>F||""),Object.values((O=(P=s.column_map)==null?void 0:P[o])==null?void 0:O.mapping).map(F=>F||""))&&(k=!0)}),!k},y=()=>{var I,L;if(!((I=l==null?void 0:l.import_templates)!=null&&I[o]))return!1;let k=!1;return Object.keys((L=l==null?void 0:l.import_templates)==null?void 0:L[o]).forEach(N=>{N===m&&(k=!0)}),k},C=()=>{var k,I,L,N;if(!p&&m){pe.processing(),g(!0);const P=pn.cloneDeep(a);if(P){const O=pn.cloneDeep((I=(k=P.company_user)==null?void 0:k.react_settings.import_templates)==null?void 0:I[n.entity])||{},F={};Array.isArray(O)||Object.entries(O).forEach(([V,M])=>{!V||!M||!Array.isArray(M)||(F[V]=M)}),F[m]=Object.values((N=(L=s.column_map)==null?void 0:L[n.entity])==null?void 0:N.mapping).map(V=>V||""),pn.set(P,`company_user.react_settings.import_templates.${n.entity}`,F),Je("PUT",ze("/api/v1/company_users/:id",{id:P.id}),P).then(V=>{pe.success("updated_settings"),pn.set(P,"company_user",V.data.data),ii(["company_users"]),t(iw(P)),t(rw()),v(),i(`/${o}s`)}).finally(()=>g(!1))}}},S=()=>{var k;(k=r())==null||k.then(()=>b()?f(!0):i(`/${o}s`))};return h.jsxs(h.Fragment,{children:[h.jsx(dn,{className:"flex float-right",behavior:"button",onClick:S,children:e("import")}),h.jsxs(pr,{title:e("save_as_template"),visible:c,onClose:v,children:[h.jsx(lt,{label:e("name"),value:m,onValueChange:k=>_(k),changeOverride:!0}),h.jsx(dn,{behavior:"button",onClick:C,disabled:!m||y()||p,disableWithoutIcon:!0,children:e("save")})]}),h.jsxs(pr,{title:e("save_as_template"),visible:d,onClose:()=>{f(!1),i(`/${o}s`)},children:[h.jsx("span",{className:"font-medium text-base",children:e("save_template_body")}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx(dn,{behavior:"button",type:"secondary",onClick:()=>{f(!1),i(`/${o}s`)},children:e("no")}),h.jsx(dn,{behavior:"button",onClick:()=>{f(!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 Cit(n){var s,o;const e=Qo(),{entity:t}=n,i=Object.keys(((s=e==null?void 0:e.import_templates)==null?void 0:s[t])||{}).length,r=Object.keys(((o=e==null?void 0:e.import_templates)==null?void 0:o[t])||{});return{numberOfTemplates:i,templates:r}}function wit(n){const e=Fr(),{name:t,entity:i,onDeletedTemplate:r}=n,s=bZ(),[o,a]=x.useState(!1),l=()=>{var c,u,d,f,p,g,m,_,v,b,y,C,S;if(!o){pe.processing(),a(!0);const k=pn.cloneDeep(s);k&&(Object.keys(((d=(u=(c=k==null?void 0:k.company_user)==null?void 0:c.react_settings)==null?void 0:u.import_templates)==null?void 0:d[i])||{}).length>1?(g=(p=(f=k==null?void 0:k.company_user)==null?void 0:f.react_settings)==null?void 0:p.import_templates)==null||delete g[i][t]:Object.keys(((_=(m=k==null?void 0:k.company_user)==null?void 0:m.react_settings)==null?void 0:_.import_templates)||{}).length>1?(y=(b=(v=k==null?void 0:k.company_user)==null?void 0:v.react_settings)==null?void 0:b.import_templates)==null||delete y[i]:(S=(C=k==null?void 0:k.company_user)==null?void 0:C.react_settings)==null||delete S.import_templates,Je("PUT",ze("/api/v1/company_users/:id",{id:k.id}),k).then(L=>{pe.success("updated_settings"),pn.set(k,"company_user",L.data.data),ii(["company_users"]),e(iw(k)),e(rw()),r()}).finally(()=>a(!1)))}};return h.jsx(ne,{children:h.jsxs("div",{className:"flex items-center space-x-10",children:[h.jsx("span",{className:"font-medium",children:t}),h.jsx("div",{className:$t({"cursor-pointer":!o,"cursor-not-allowed":o}),onClick:()=>!o&&l(),children:h.jsx(an,{element:fc,size:22})})]})})}var Ole={exports:{}};const Lbn={},Abn=Object.freeze(Object.defineProperty({__proto__:null,default:Lbn},Symbol.toStringTag,{value:"Module"})),nFe=$1e(Abn);/** * [js-sha256]{@link https://github.com/emn178/js-sha256} * * @version 0.11.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2014-2024 * @license MIT */var iFe;function Nbn(){return iFe||(iFe=1,function(n){(function(){var e="input is invalid type",t=typeof window=="object",i=t?window:{};i.JS_SHA256_NO_WINDOW&&(t=!1);var r=!t&&typeof self=="object",s=!i.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?i=hb:r&&(i=self);var o=!i.JS_SHA256_NO_COMMON_JS&&!0&&n.exports,a=!i.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],u=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],p=[];(i.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),a&&(i.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(k){return typeof k=="object"&&k.buffer&&k.buffer.constructor===ArrayBuffer});var g=function(k,I){return function(L){return new y(I,!0).update(L)[k]()}},m=function(k){var I=g("hex",k);s&&(I=_(I,k)),I.create=function(){return new y(k)},I.update=function(P){return I.create().update(P)};for(var L=0;L<f.length;++L){var N=f[L];I[N]=g(N,k)}return I},_=function(k,I){var L=nFe,N=nFe.Buffer,P=I?"sha224":"sha256",O;N.from&&!i.JS_SHA256_NO_BUFFER_FROM?O=N.from:O=function(V){return new N(V)};var F=function(V){if(typeof V=="string")return L.createHash(P).update(V,"utf8").digest("hex");if(V==null)throw new Error(e);return V.constructor===ArrayBuffer&&(V=new Uint8Array(V)),Array.isArray(V)||ArrayBuffer.isView(V)||V.constructor===N?L.createHash(P).update(O(V)).digest("hex"):k(V)};return F},v=function(k,I){return function(L,N){return new C(L,I,!0).update(N)[k]()}},b=function(k){var I=v("hex",k);I.create=function(P){return new C(P,k)},I.update=function(P,O){return I.create(P).update(O)};for(var L=0;L<f.length;++L){var N=f[L];I[N]=v(N,k)}return I};function y(k,I){I?(p[0]=p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0,this.blocks=p):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],k?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=k}y.prototype.update=function(k){if(!this.finalized){var I,L=typeof k;if(L!=="string"){if(L==="object"){if(k===null)throw new Error(e);if(a&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!a||!ArrayBuffer.isView(k)))throw new Error(e)}else throw new Error(e);I=!0}for(var N,P=0,O,F=k.length,V=this.blocks;P<F;){if(this.hashed&&(this.hashed=!1,V[0]=this.block,this.block=V[16]=V[1]=V[2]=V[3]=V[4]=V[5]=V[6]=V[7]=V[8]=V[9]=V[10]=V[11]=V[12]=V[13]=V[14]=V[15]=0),I)for(O=this.start;P<F&&O<64;++P)V[O>>>2]|=k[P]<<u[O++&3];else for(O=this.start;P<F&&O<64;++P)N=k.charCodeAt(P),N<128?V[O>>>2]|=N<<u[O++&3]:N<2048?(V[O>>>2]|=(192|N>>>6)<<u[O++&3],V[O>>>2]|=(128|N&63)<<u[O++&3]):N<55296||N>=57344?(V[O>>>2]|=(224|N>>>12)<<u[O++&3],V[O>>>2]|=(128|N>>>6&63)<<u[O++&3],V[O>>>2]|=(128|N&63)<<u[O++&3]):(N=65536+((N&1023)<<10|k.charCodeAt(++P)&1023),V[O>>>2]|=(240|N>>>18)<<u[O++&3],V[O>>>2]|=(128|N>>>12&63)<<u[O++&3],V[O>>>2]|=(128|N>>>6&63)<<u[O++&3],V[O>>>2]|=(128|N&63)<<u[O++&3]);this.lastByteIndex=O,this.bytes+=O-this.start,O>=64?(this.block=V[16],this.start=O-64,this.hash(),this.hashed=!0):this.start=O}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var k=this.blocks,I=this.lastByteIndex;k[16]=this.block,k[I>>>2]|=c[I&3],this.block=k[16],I>=56&&(this.hashed||this.hash(),k[0]=this.block,k[16]=k[1]=k[2]=k[3]=k[4]=k[5]=k[6]=k[7]=k[8]=k[9]=k[10]=k[11]=k[12]=k[13]=k[14]=k[15]=0),k[14]=this.hBytes<<3|this.bytes>>>29,k[15]=this.bytes<<3,this.hash()}},y.prototype.hash=function(){var k=this.h0,I=this.h1,L=this.h2,N=this.h3,P=this.h4,O=this.h5,F=this.h6,V=this.h7,M=this.blocks,B,W,q,U,G,H,z,Z,X,oe,fe;for(B=16;B<64;++B)G=M[B-15],W=(G>>>7|G<<25)^(G>>>18|G<<14)^G>>>3,G=M[B-2],q=(G>>>17|G<<15)^(G>>>19|G<<13)^G>>>10,M[B]=M[B-16]+W+M[B-7]+q<<0;for(fe=I&L,B=0;B<64;B+=4)this.first?(this.is224?(Z=300032,G=M[0]-1413257819,V=G-150054599<<0,N=G+24177077<<0):(Z=704751109,G=M[0]-210244248,V=G-1521486534<<0,N=G+143694565<<0),this.first=!1):(W=(k>>>2|k<<30)^(k>>>13|k<<19)^(k>>>22|k<<10),q=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),Z=k&I,U=Z^k&L^fe,z=P&O^~P&F,G=V+q+z+d[B]+M[B],H=W+U,V=N+G<<0,N=G+H<<0),W=(N>>>2|N<<30)^(N>>>13|N<<19)^(N>>>22|N<<10),q=(V>>>6|V<<26)^(V>>>11|V<<21)^(V>>>25|V<<7),X=N&k,U=X^N&I^Z,z=V&P^~V&O,G=F+q+z+d[B+1]+M[B+1],H=W+U,F=L+G<<0,L=G+H<<0,W=(L>>>2|L<<30)^(L>>>13|L<<19)^(L>>>22|L<<10),q=(F>>>6|F<<26)^(F>>>11|F<<21)^(F>>>25|F<<7),oe=L&N,U=oe^L&k^X,z=F&V^~F&P,G=O+q+z+d[B+2]+M[B+2],H=W+U,O=I+G<<0,I=G+H<<0,W=(I>>>2|I<<30)^(I>>>13|I<<19)^(I>>>22|I<<10),q=(O>>>6|O<<26)^(O>>>11|O<<21)^(O>>>25|O<<7),fe=I&L,U=fe^I&N^oe,z=O&F^~O&V,G=P+q+z+d[B+3]+M[B+3],H=W+U,P=k+G<<0,k=G+H<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+k<<0,this.h1=this.h1+I<<0,this.h2=this.h2+L<<0,this.h3=this.h3+N<<0,this.h4=this.h4+P<<0,this.h5=this.h5+O<<0,this.h6=this.h6+F<<0,this.h7=this.h7+V<<0},y.prototype.hex=function(){this.finalize();var k=this.h0,I=this.h1,L=this.h2,N=this.h3,P=this.h4,O=this.h5,F=this.h6,V=this.h7,M=l[k>>>28&15]+l[k>>>24&15]+l[k>>>20&15]+l[k>>>16&15]+l[k>>>12&15]+l[k>>>8&15]+l[k>>>4&15]+l[k&15]+l[I>>>28&15]+l[I>>>24&15]+l[I>>>20&15]+l[I>>>16&15]+l[I>>>12&15]+l[I>>>8&15]+l[I>>>4&15]+l[I&15]+l[L>>>28&15]+l[L>>>24&15]+l[L>>>20&15]+l[L>>>16&15]+l[L>>>12&15]+l[L>>>8&15]+l[L>>>4&15]+l[L&15]+l[N>>>28&15]+l[N>>>24&15]+l[N>>>20&15]+l[N>>>16&15]+l[N>>>12&15]+l[N>>>8&15]+l[N>>>4&15]+l[N&15]+l[P>>>28&15]+l[P>>>24&15]+l[P>>>20&15]+l[P>>>16&15]+l[P>>>12&15]+l[P>>>8&15]+l[P>>>4&15]+l[P&15]+l[O>>>28&15]+l[O>>>24&15]+l[O>>>20&15]+l[O>>>16&15]+l[O>>>12&15]+l[O>>>8&15]+l[O>>>4&15]+l[O&15]+l[F>>>28&15]+l[F>>>24&15]+l[F>>>20&15]+l[F>>>16&15]+l[F>>>12&15]+l[F>>>8&15]+l[F>>>4&15]+l[F&15];return this.is224||(M+=l[V>>>28&15]+l[V>>>24&15]+l[V>>>20&15]+l[V>>>16&15]+l[V>>>12&15]+l[V>>>8&15]+l[V>>>4&15]+l[V&15]),M},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var k=this.h0,I=this.h1,L=this.h2,N=this.h3,P=this.h4,O=this.h5,F=this.h6,V=this.h7,M=[k>>>24&255,k>>>16&255,k>>>8&255,k&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255,N>>>24&255,N>>>16&255,N>>>8&255,N&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255,F>>>24&255,F>>>16&255,F>>>8&255,F&255];return this.is224||M.push(V>>>24&255,V>>>16&255,V>>>8&255,V&255),M},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var k=new ArrayBuffer(this.is224?28:32),I=new DataView(k);return I.setUint32(0,this.h0),I.setUint32(4,this.h1),I.setUint32(8,this.h2),I.setUint32(12,this.h3),I.setUint32(16,this.h4),I.setUint32(20,this.h5),I.setUint32(24,this.h6),this.is224||I.setUint32(28,this.h7),k};function C(k,I,L){var N,P=typeof k;if(P==="string"){var O=[],F=k.length,V=0,M;for(N=0;N<F;++N)M=k.charCodeAt(N),M<128?O[V++]=M:M<2048?(O[V++]=192|M>>>6,O[V++]=128|M&63):M<55296||M>=57344?(O[V++]=224|M>>>12,O[V++]=128|M>>>6&63,O[V++]=128|M&63):(M=65536+((M&1023)<<10|k.charCodeAt(++N)&1023),O[V++]=240|M>>>18,O[V++]=128|M>>>12&63,O[V++]=128|M>>>6&63,O[V++]=128|M&63);k=O}else if(P==="object"){if(k===null)throw new Error(e);if(a&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!a||!ArrayBuffer.isView(k)))throw new Error(e)}else throw new Error(e);k.length>64&&(k=new y(I,!0).update(k).array());var B=[],W=[];for(N=0;N<64;++N){var q=k[N]||0;B[N]=92^q,W[N]=54^q}y.call(this,I,L),this.update(W),this.oKeyPad=B,this.inner=!0,this.sharedMemory=L}C.prototype=new y,C.prototype.finalize=function(){if(y.prototype.finalize.call(this),this.inner){this.inner=!1;var k=this.array();y.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(k),y.prototype.finalize.call(this)}};var S=m();S.sha256=S,S.sha224=m(!0),S.sha256.hmac=b(),S.sha224.hmac=b(!0),o?n.exports=S:(i.sha256=S.sha256,i.sha224=S.sha224)})()}(Ole)),Ole.exports}var Dbn=Nbn();const Rbn=As.div` border-color: ${n=>n.theme.borderColor}; &:hover { border-color: ${n=>n.theme.hoverBorderColor}; } `;function Pbn(n){return n.fragmentWrapper?h.jsx(h.Fragment,{children:n.children}):h.jsx(er,{title:n.title,children:n.children})}function Obn(n){const[e]=xe(),t=n.type==="zip",i={...!t&&{"text/*":[".csv"]},...t&&{"application/zip":[".zip"]}},r=xt(),s=Qo(),{numberOfTemplates:o,templates:a}=Cit({entity:n.entity}),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[f,p]=x.useState(new FormData),[g,m]=x.useState([]),[_,v]=x.useState(),[b,y]=x.useState({hash:"",import_type:n.type,skip_header:!0,column_map:{[n.entity]:{mapping:{}}}}),[C,S]=x.useState(),[k,I]=x.useState(""),[L,N]=x.useState({}),[P,O]=x.useState(0),F=1024*1024*2,V=$e=>{b.column_map[n.entity].mapping[$e.target.id]=$e.target.value,y({...b}),I("")},M=()=>{var qe,mt;const $e={};Object.entries(((mt=(qe=s==null?void 0:s.import_templates)==null?void 0:qe[n.entity])==null?void 0:mt[k])||{}).forEach(([vt,ft])=>{$e[vt]=ft||""}),y(vt=>({...vt,column_map:{[n.entity]:{mapping:$e}}}))},B=()=>{I(""),y($e=>({...$e,column_map:{[n.entity]:{mapping:{...L}}}}))},W=$e=>{const qe=$e.split(".");let mt=qe[1];return qe[1]=="user_id"&&(mt="user"),qe[1]=="shipping_country_id"&&(mt="shipping_country"),`${e(qe[0])} - ${e(mt)}`},q=async()=>{var $e,qe,mt;if(!g.length&&t){pe.error("select_file");return}if(t&&!l&&!u){pe.error("settings_or_data");return}pe.processing(),S(void 0);try{if(t)await Me(g[0],l,u)&&(pe.success("import_complete"),($e=n.onFileImported)==null||$e.call(n),n.onSuccess);else{b.hash=_.hash;const vt=await Je("POST",ze("/api/v1/import"),b);(qe=vt.data)!=null&&qe.success?(pe.success(vt.data.message??"error_title"),(mt=n.onFileImported)==null||mt.call(n),n.onSuccess):(pe.dismiss(),S(vt.data))}}catch(vt){pe.dismiss(),S(vt)}},U=$e=>{b.column_map[n.entity].mapping[$e]&&(b.column_map[n.entity].mapping[$e]="",I(""),y({...b}))},G=fd({enableReinitialize:!0,initialValues:{},onSubmit:()=>{pe.processing(),S(void 0),Je("POST",ze("/api/v1/preimport"),f).then($e=>{var qe,mt,vt,ft;v($e.data),n.onSuccess,pe.dismiss(),(mt=(qe=$e.data)==null?void 0:qe.mappings[n.entity])!=null&&mt.hints&&((ft=(vt=$e.data)==null?void 0:vt.mappings[n.entity])==null||ft.hints.forEach((tt,St)=>{var Ft,en,Ke;b.column_map[n.entity].mapping[St]=((Ft=$e.data)==null?void 0:Ft.mappings[n.entity].available[tt])??"",y(b),N({...(Ke=(en=b==null?void 0:b.column_map)==null?void 0:en[n.entity])==null?void 0:Ke.mapping})})),I("")}).catch($e=>{var qe;((qe=$e.response)==null?void 0:qe.status)===422&&(pe.dismiss(),S($e.response.data))})}}),H=()=>{const $e=new FormData;t?g.forEach(qe=>{$e.append("files",qe)}):g.forEach(qe=>{$e.append(`files[${n.entity}]`,qe)}),p($e)},z=$e=>{var qe,mt;return Object.keys((qe=b==null?void 0:b.column_map[n.entity])==null?void 0:qe.mapping).length?((mt=b==null?void 0:b.column_map[n.entity])==null?void 0:mt.mapping[$e])??null:null},Z=$e=>{const qe=g.filter((vt,ft)=>$e!==ft),mt=new FormData;t?qe.forEach(vt=>{mt.append("files",vt)}):qe.forEach(vt=>{mt.append(`files[${n.entity}]`,vt)}),m(qe),p(mt)},X=$e=>new Promise(qe=>{try{const mt=new FileReader;mt.onload=vt=>{var St;const tt=(((St=vt.target)==null?void 0:St.result)||"").split(` `);!tt.length||tt.length===1||tt.length===2&&!tt[1]?qe(!1):qe(!0)},mt.readAsText($e)}catch{qe(!1)}}),oe=async $e=>{for(let qe=0;qe<$e.length;qe++)if(!await X($e[qe]))return!1;return!0},fe=async $e=>new Promise((qe,mt)=>{const ft=new FileReader,tt=Dbn.sha256.create();ft.onload=()=>{tt.update(ft.result),qe(tt.hex())},ft.onerror=St=>mt(St),ft.readAsArrayBuffer($e.slice(0,2097152))}),Se=async($e,qe,mt,vt)=>{var Ke;const ft=new FormData,tt=new File([$e],qe.fileName,{type:"application/octet-stream",lastModified:new Date().getTime()});ft.append("file",tt),ft.append("metadata",JSON.stringify({...qe,chunkSize:$e.size})),ft.append("import_settings",String(mt)),ft.append("import_data",String(vt));const St="/api/v1/import_json",Ft={chunk_number:qe.currentChunk,total_chunks:qe.totalChunks};mt&&(Ft.import_settings=!0),vt&&(Ft.import_data=!0);const en=await Je("POST",ze(St,Ft),ft,{headers:{}});if(!((Ke=en.data)!=null&&Ke.success))throw console.error("Chunk upload failed:",en.data),new Error(`Chunk upload failed: ${qe.currentChunk+1}`)},Me=async($e,qe,mt)=>{if(!["application/zip","application/x-zip-compressed"].includes($e.type)&&!$e.name.endsWith(".zip"))return pe.error("invalid_zip_file"),null;try{const ft=await fe($e),tt=Math.ceil($e.size/F);for(let St=0;St<tt;St++){const Ft=St*F,en=Math.min(Ft+F,$e.size),Ke=$e.slice(Ft,en),dt={totalChunks:tt,currentChunk:St,fileHash:ft,fileName:$e.name};await Se(Ke,dt,qe,mt),O((St+1)/tt*100)}return ft}catch(ft){throw console.log("Chunk upload failed:",ft),pe.error("chunk_upload_failed"),O(0),ft}},{getRootProps:Ie,getInputProps:ge,isDragActive:ye}=NA({accept:i,onDrop:async $e=>{try{t?(m($e),O(0)):await oe($e)?$e.every(({type:vt})=>vt.includes(n.type))?(m($e),G.submitForm()):pe.error("wrong_file_extension"):pe.error("csv_rows_length")}catch(qe){console.error("Upload error:",qe),pe.error("upload_failed"),O(0)}}});x.useEffect(()=>{g.length>0&&H()},[g]),x.useEffect(()=>{k&&M()},[k]),x.useEffect(()=>()=>I(""),[]);const Pe=Lo(),Be=()=>{n.exampleUrl&&window.open(n.exampleUrl,"_blank")};return h.jsxs(h.Fragment,{children:[h.jsxs(Pbn,{title:e(n.entity),fragmentWrapper:t,children:[h.jsxs(ne,{leftSide:e(t?"company_backup_file":"csv_file"),leftSideHelp:t&&e("company_backup_file_help"),children:[n.exampleUrl?h.jsx("button",{type:"button",style:{color:Pe},className:"inline-flex items-center space-x-1 mb-4",onClick:Be,children:h.jsx("span",{children:e("download_example_file")})}):null,g.length?h.jsx("ul",{className:"grid xs:grid-rows-6 lg:grid-cols-2",children:g.map(($e,qe)=>h.jsxs("li",{className:"flex items-center hover:bg-gray-50 cursor-pointer p-2",children:[$e.name," - ",($e.size/1024).toPrecision(2)," KB"," ",h.jsx(SO,{fontSize:15,className:"cursor-pointer ml-3",onClick:()=>Z(qe)})]},qe))}):h.jsxs("div",{...Ie(),className:"flex flex-col md:flex-row md:items-center",children:[h.jsxs(Rbn,{className:"relative block w-full border-2 border-dashed rounded-lg p-12 text-center",theme:{borderColor:r.$21,hoverBorderColor:r.$17},children:[h.jsx("input",{...ge()}),h.jsx("div",{className:"flex justify-center",children:h.jsx(AL,{size:"2.3rem",color:r.$3})}),h.jsx("span",{className:"mt-2 block text-sm font-medium",style:{color:r.$3,colorScheme:r.$0},children:e(ye?"drop_file_here":"dropzone_default_message")})]}),C&&Object.keys(C.errors).map(($e,qe)=>h.jsx(Kl,{children:C.errors[$e]},qe))]}),n.postWidgetSlot??null]}),t&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("import_settings"),children:h.jsx(jt,{checked:l,onValueChange:$e=>c($e)})}),h.jsx(ne,{leftSide:e("import_data"),children:h.jsx(jt,{checked:u,onValueChange:$e=>d($e)})}),h.jsx("div",{className:"flex justify-end pr-5",children:h.jsx(dn,{behavior:"button",onClick:q,disableWithoutIcon:!0,disabled:!l&&!u||!g.length,children:e("import")})})]})]}),_&&!t&&!!o&&h.jsxs(er,{className:"mt-4",children:[h.jsx(ne,{leftSide:e("template"),children:h.jsx(Dn,{value:k,onValueChange:$e=>{I($e),$e||y(qe=>({...qe,column_map:{[n.entity]:{mapping:{...L}}}}))},withBlank:!0,children:a.filter($e=>$e).map(($e,qe)=>h.jsx("option",{value:$e,children:$e},qe))})}),k&&h.jsx(wit,{name:k,entity:n.entity,onDeletedTemplate:B})]}),_&&!t&&h.jsxs(h1,{children:[h.jsxs(p1,{children:[h.jsx(_a,{children:e("header")}),h.jsx(_a,{children:e("columns")})]}),h.jsxs(f1,{children:[_.mappings[n.entity].headers[0].map(($e,qe)=>h.jsxs(hc,{children:[h.jsxs(bs,{className:"space-x-2",children:[h.jsx("span",{children:$e}),h.jsx("span",{className:"text-gray-400",children:_.mappings[n.entity].headers[1][qe].substring(0,20)})]}),h.jsx(bs,{children:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:"flex-1",children:h.jsx(Dn,{id:qe,value:z(qe),onChange:V,withBlank:!0,children:_.mappings[n.entity].available.map((mt,vt)=>h.jsx("option",{value:mt,children:W(mt)},vt))})}),h.jsx(an,{className:"cursor-pointer",element:SO,size:24,onClick:()=>U(qe)})]})})]},qe)),n.entity==="bank_transaction"&&h.jsxs(hc,{children:[h.jsx(bs,{className:"space-x-2",children:h.jsx("span",{children:e("bank_account")})}),h.jsx(bs,{colSpan:2,children:h.jsx(bit,{value:b.bank_integration_id,onChange:$e=>y(qe=>({...qe,bank_integration_id:$e==null?void 0:$e.id})),onClearButtonClick:()=>y($e=>({...$e,bank_integration_id:""})),errorMessage:C==null?void 0:C.errors.bank_integration_id})})]}),h.jsx(hc,{children:h.jsx(bs,{colSpan:2,children:h.jsx(yit,{entity:n.entity,importMap:b,onImport:q})})})]})]}),P>0&&P<100&&h.jsxs("div",{className:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700 mt-4",children:[h.jsx("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${P}%`}}),h.jsxs("div",{className:"text-sm text-gray-500 mt-1",children:[Math.round(P),"% uploaded"]})]})]})}function Mbn(){const[n]=xe(),e=xt(),[t,i]=x.useState(!1);return h.jsx("div",{className:"grid grid-cols-12",children:h.jsx("div",{className:"col-span-12",children:t?h.jsx("div",{className:"px-4 sm:px-6 text-sm pt-2",style:{color:e.$3},children:n("import_started")}):h.jsx(Obn,{entity:"company",onSuccess:!1,type:"zip",onFileImported:()=>i(!0)})})})}function jbn(){const[n]=xe(),e=t=>{t.preventDefault(),pe.processing(),Je("POST",ze("/api/v1/export"),{send_email:!0,report_keys:[]}).then(i=>{pe.success(i.data.message)})};return h.jsx(ne,{leftSide:n("export_company"),leftSideHelp:n("exported_data"),children:h.jsx(dn,{behavior:"button",onClick:e,children:n("export")})})}var Mle={exports:{}},jle,rFe;function xit(){return rFe||(rFe=1,jle={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]}),jle}var Fle={exports:{}},Ble,sFe;function Fbn(){return sFe||(sFe=1,Ble=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")}),Ble}var oFe;function Bbn(){if(oFe)return Fle.exports;oFe=1;var n=Fbn(),e=Array.prototype.concat,t=Array.prototype.slice,i=Fle.exports=function(s){for(var o=[],a=0,l=s.length;a<l;a++){var c=s[a];n(c)?o=e.call(o,t.call(c)):o.push(c)}return o};return i.wrap=function(r){return function(){return r(i(arguments))}},Fle.exports}var aFe;function $bn(){if(aFe)return Mle.exports;aFe=1;var n=xit(),e=Bbn(),t=Object.hasOwnProperty,i=Object.create(null);for(var r in n)t.call(n,r)&&(i[n[r]]=r);var s=Mle.exports={to:{},get:{}};s.get=function(l){var c=l.substring(0,3).toLowerCase(),u,d;switch(c){case"hsl":u=s.get.hsl(l),d="hsl";break;case"hwb":u=s.get.hwb(l),d="hwb";break;default:u=s.get.rgb(l),d="rgb";break}return u?{model:d,value:u}:null},s.get.rgb=function(l){if(!l)return null;var c=/^#([a-f0-9]{3,4})$/i,u=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,d=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,f=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,p=/^(\w+)$/,g=[0,0,0,1],m,_,v;if(m=l.match(u)){for(v=m[2],m=m[1],_=0;_<3;_++){var b=_*2;g[_]=parseInt(m.slice(b,b+2),16)}v&&(g[3]=parseInt(v,16)/255)}else if(m=l.match(c)){for(m=m[1],v=m[3],_=0;_<3;_++)g[_]=parseInt(m[_]+m[_],16);v&&(g[3]=parseInt(v+v,16)/255)}else if(m=l.match(d)){for(_=0;_<3;_++)g[_]=parseInt(m[_+1],0);m[4]&&(m[5]?g[3]=parseFloat(m[4])*.01:g[3]=parseFloat(m[4]))}else if(m=l.match(f)){for(_=0;_<3;_++)g[_]=Math.round(parseFloat(m[_+1])*2.55);m[4]&&(m[5]?g[3]=parseFloat(m[4])*.01:g[3]=parseFloat(m[4]))}else return(m=l.match(p))?m[1]==="transparent"?[0,0,0,0]:t.call(n,m[1])?(g=n[m[1]],g[3]=1,g):null:null;for(_=0;_<3;_++)g[_]=o(g[_],0,255);return g[3]=o(g[3],0,1),g},s.get.hsl=function(l){if(!l)return null;var c=/^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*)?\)$/,u=l.match(c);if(u){var d=parseFloat(u[4]),f=(parseFloat(u[1])%360+360)%360,p=o(parseFloat(u[2]),0,100),g=o(parseFloat(u[3]),0,100),m=o(isNaN(d)?1:d,0,1);return[f,p,g,m]}return null},s.get.hwb=function(l){if(!l)return null;var c=/^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*)?\)$/,u=l.match(c);if(u){var d=parseFloat(u[4]),f=(parseFloat(u[1])%360+360)%360,p=o(parseFloat(u[2]),0,100),g=o(parseFloat(u[3]),0,100),m=o(isNaN(d)?1:d,0,1);return[f,p,g,m]}return null},s.to.hex=function(){var l=e(arguments);return"#"+a(l[0])+a(l[1])+a(l[2])+(l[3]<1?a(Math.round(l[3]*255)):"")},s.to.rgb=function(){var l=e(arguments);return l.length<4||l[3]===1?"rgb("+Math.round(l[0])+", "+Math.round(l[1])+", "+Math.round(l[2])+")":"rgba("+Math.round(l[0])+", "+Math.round(l[1])+", "+Math.round(l[2])+", "+l[3]+")"},s.to.rgb.percent=function(){var l=e(arguments),c=Math.round(l[0]/255*100),u=Math.round(l[1]/255*100),d=Math.round(l[2]/255*100);return l.length<4||l[3]===1?"rgb("+c+"%, "+u+"%, "+d+"%)":"rgba("+c+"%, "+u+"%, "+d+"%, "+l[3]+")"},s.to.hsl=function(){var l=e(arguments);return l.length<4||l[3]===1?"hsl("+l[0]+", "+l[1]+"%, "+l[2]+"%)":"hsla("+l[0]+", "+l[1]+"%, "+l[2]+"%, "+l[3]+")"},s.to.hwb=function(){var l=e(arguments),c="";return l.length>=4&&l[3]!==1&&(c=", "+l[3]),"hwb("+l[0]+", "+l[1]+"%, "+l[2]+"%"+c+")"},s.to.keyword=function(l){return i[l.slice(0,3)]};function o(l,c,u){return Math.min(Math.max(c,l),u)}function a(l){var c=Math.round(l).toString(16).toUpperCase();return c.length<2?"0"+c:c}return Mle.exports}var $le,lFe;function Sit(){if(lFe)return $le;lFe=1;const n=xit(),e={};for(const r of Object.keys(n))e[n[r]]=r;const t={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"]}};$le=t;for(const r of Object.keys(t)){if(!("channels"in t[r]))throw new Error("missing channels property: "+r);if(!("labels"in t[r]))throw new Error("missing channel labels property: "+r);if(t[r].labels.length!==t[r].channels)throw new Error("channel and label counts mismatch: "+r);const{channels:s,labels:o}=t[r];delete t[r].channels,delete t[r].labels,Object.defineProperty(t[r],"channels",{value:s}),Object.defineProperty(t[r],"labels",{value:o})}t.rgb.hsl=function(r){const s=r[0]/255,o=r[1]/255,a=r[2]/255,l=Math.min(s,o,a),c=Math.max(s,o,a),u=c-l;let d,f;c===l?d=0:s===c?d=(o-a)/u:o===c?d=2+(a-s)/u:a===c&&(d=4+(s-o)/u),d=Math.min(d*60,360),d<0&&(d+=360);const p=(l+c)/2;return c===l?f=0:p<=.5?f=u/(c+l):f=u/(2-c-l),[d,f*100,p*100]},t.rgb.hsv=function(r){let s,o,a,l,c;const u=r[0]/255,d=r[1]/255,f=r[2]/255,p=Math.max(u,d,f),g=p-Math.min(u,d,f),m=function(_){return(p-_)/6/g+1/2};return g===0?(l=0,c=0):(c=g/p,s=m(u),o=m(d),a=m(f),u===p?l=a-o:d===p?l=1/3+s-a:f===p&&(l=2/3+o-s),l<0?l+=1:l>1&&(l-=1)),[l*360,c*100,p*100]},t.rgb.hwb=function(r){const s=r[0],o=r[1];let a=r[2];const l=t.rgb.hsl(r)[0],c=1/255*Math.min(s,Math.min(o,a));return a=1-1/255*Math.max(s,Math.max(o,a)),[l,c*100,a*100]},t.rgb.cmyk=function(r){const s=r[0]/255,o=r[1]/255,a=r[2]/255,l=Math.min(1-s,1-o,1-a),c=(1-s-l)/(1-l)||0,u=(1-o-l)/(1-l)||0,d=(1-a-l)/(1-l)||0;return[c*100,u*100,d*100,l*100]};function i(r,s){return(r[0]-s[0])**2+(r[1]-s[1])**2+(r[2]-s[2])**2}return t.rgb.keyword=function(r){const s=e[r];if(s)return s;let o=1/0,a;for(const l of Object.keys(n)){const c=n[l],u=i(r,c);u<o&&(o=u,a=l)}return a},t.keyword.rgb=function(r){return n[r]},t.rgb.xyz=function(r){let s=r[0]/255,o=r[1]/255,a=r[2]/255;s=s>.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;const l=s*.4124+o*.3576+a*.1805,c=s*.2126+o*.7152+a*.0722,u=s*.0193+o*.1192+a*.9505;return[l*100,c*100,u*100]},t.rgb.lab=function(r){const s=t.rgb.xyz(r);let o=s[0],a=s[1],l=s[2];o/=95.047,a/=100,l/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116;const c=116*a-16,u=500*(o-a),d=200*(a-l);return[c,u,d]},t.hsl.rgb=function(r){const s=r[0]/360,o=r[1]/100,a=r[2]/100;let l,c,u;if(o===0)return u=a*255,[u,u,u];a<.5?l=a*(1+o):l=a+o-a*o;const d=2*a-l,f=[0,0,0];for(let p=0;p<3;p++)c=s+1/3*-(p-1),c<0&&c++,c>1&&c--,6*c<1?u=d+(l-d)*6*c:2*c<1?u=l:3*c<2?u=d+(l-d)*(2/3-c)*6:u=d,f[p]=u*255;return f},t.hsl.hsv=function(r){const s=r[0];let o=r[1]/100,a=r[2]/100,l=o;const c=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,l*=c<=1?c:2-c;const u=(a+o)/2,d=a===0?2*l/(c+l):2*o/(a+o);return[s,d*100,u*100]},t.hsv.rgb=function(r){const s=r[0]/60,o=r[1]/100;let a=r[2]/100;const l=Math.floor(s)%6,c=s-Math.floor(s),u=255*a*(1-o),d=255*a*(1-o*c),f=255*a*(1-o*(1-c));switch(a*=255,l){case 0:return[a,f,u];case 1:return[d,a,u];case 2:return[u,a,f];case 3:return[u,d,a];case 4:return[f,u,a];case 5:return[a,u,d]}},t.hsv.hsl=function(r){const s=r[0],o=r[1]/100,a=r[2]/100,l=Math.max(a,.01);let c,u;u=(2-o)*a;const d=(2-o)*l;return c=o*l,c/=d<=1?d:2-d,c=c||0,u/=2,[s,c*100,u*100]},t.hwb.rgb=function(r){const s=r[0]/360;let o=r[1]/100,a=r[2]/100;const l=o+a;let c;l>1&&(o/=l,a/=l);const u=Math.floor(6*s),d=1-a;c=6*s-u,(u&1)!==0&&(c=1-c);const f=o+c*(d-o);let p,g,m;switch(u){default:case 6:case 0:p=d,g=f,m=o;break;case 1:p=f,g=d,m=o;break;case 2:p=o,g=d,m=f;break;case 3:p=o,g=f,m=d;break;case 4:p=f,g=o,m=d;break;case 5:p=d,g=o,m=f;break}return[p*255,g*255,m*255]},t.cmyk.rgb=function(r){const s=r[0]/100,o=r[1]/100,a=r[2]/100,l=r[3]/100,c=1-Math.min(1,s*(1-l)+l),u=1-Math.min(1,o*(1-l)+l),d=1-Math.min(1,a*(1-l)+l);return[c*255,u*255,d*255]},t.xyz.rgb=function(r){const s=r[0]/100,o=r[1]/100,a=r[2]/100;let l,c,u;return l=s*3.2406+o*-1.5372+a*-.4986,c=s*-.9689+o*1.8758+a*.0415,u=s*.0557+o*-.204+a*1.057,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,l=Math.min(Math.max(0,l),1),c=Math.min(Math.max(0,c),1),u=Math.min(Math.max(0,u),1),[l*255,c*255,u*255]},t.xyz.lab=function(r){let s=r[0],o=r[1],a=r[2];s/=95.047,o/=100,a/=108.883,s=s>.008856?s**(1/3):7.787*s+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const l=116*o-16,c=500*(s-o),u=200*(o-a);return[l,c,u]},t.lab.xyz=function(r){const s=r[0],o=r[1],a=r[2];let l,c,u;c=(s+16)/116,l=o/500+c,u=c-a/200;const d=c**3,f=l**3,p=u**3;return c=d>.008856?d:(c-16/116)/7.787,l=f>.008856?f:(l-16/116)/7.787,u=p>.008856?p:(u-16/116)/7.787,l*=95.047,c*=100,u*=108.883,[l,c,u]},t.lab.lch=function(r){const s=r[0],o=r[1],a=r[2];let l;l=Math.atan2(a,o)*360/2/Math.PI,l<0&&(l+=360);const u=Math.sqrt(o*o+a*a);return[s,u,l]},t.lch.lab=function(r){const s=r[0],o=r[1],l=r[2]/360*2*Math.PI,c=o*Math.cos(l),u=o*Math.sin(l);return[s,c,u]},t.rgb.ansi16=function(r,s=null){const[o,a,l]=r;let c=s===null?t.rgb.hsv(r)[2]:s;if(c=Math.round(c/50),c===0)return 30;let u=30+(Math.round(l/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return c===2&&(u+=60),u},t.hsv.ansi16=function(r){return t.rgb.ansi16(t.hsv.rgb(r),r[2])},t.rgb.ansi256=function(r){const s=r[0],o=r[1],a=r[2];return s===o&&o===a?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)},t.ansi16.rgb=function(r){let s=r%10;if(s===0||s===7)return r>50&&(s+=3.5),s=s/10.5*255,[s,s,s];const o=(~~(r>50)+1)*.5,a=(s&1)*o*255,l=(s>>1&1)*o*255,c=(s>>2&1)*o*255;return[a,l,c]},t.ansi256.rgb=function(r){if(r>=232){const c=(r-232)*10+8;return[c,c,c]}r-=16;let s;const o=Math.floor(r/36)/5*255,a=Math.floor((s=r%36)/6)/5*255,l=s%6/5*255;return[o,a,l]},t.rgb.hex=function(r){const o=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},t.hex.rgb=function(r){const s=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!s)return[0,0,0];let o=s[0];s[0].length===3&&(o=o.split("").map(d=>d+d).join(""));const a=parseInt(o,16),l=a>>16&255,c=a>>8&255,u=a&255;return[l,c,u]},t.rgb.hcg=function(r){const s=r[0]/255,o=r[1]/255,a=r[2]/255,l=Math.max(Math.max(s,o),a),c=Math.min(Math.min(s,o),a),u=l-c;let d,f;return u<1?d=c/(1-u):d=0,u<=0?f=0:l===s?f=(o-a)/u%6:l===o?f=2+(a-s)/u:f=4+(s-o)/u,f/=6,f%=1,[f*360,u*100,d*100]},t.hsl.hcg=function(r){const s=r[1]/100,o=r[2]/100,a=o<.5?2*s*o:2*s*(1-o);let l=0;return a<1&&(l=(o-.5*a)/(1-a)),[r[0],a*100,l*100]},t.hsv.hcg=function(r){const s=r[1]/100,o=r[2]/100,a=s*o;let l=0;return a<1&&(l=(o-a)/(1-a)),[r[0],a*100,l*100]},t.hcg.rgb=function(r){const s=r[0]/360,o=r[1]/100,a=r[2]/100;if(o===0)return[a*255,a*255,a*255];const l=[0,0,0],c=s%1*6,u=c%1,d=1-u;let f=0;switch(Math.floor(c)){case 0:l[0]=1,l[1]=u,l[2]=0;break;case 1:l[0]=d,l[1]=1,l[2]=0;break;case 2:l[0]=0,l[1]=1,l[2]=u;break;case 3:l[0]=0,l[1]=d,l[2]=1;break;case 4:l[0]=u,l[1]=0,l[2]=1;break;default:l[0]=1,l[1]=0,l[2]=d}return f=(1-o)*a,[(o*l[0]+f)*255,(o*l[1]+f)*255,(o*l[2]+f)*255]},t.hcg.hsv=function(r){const s=r[1]/100,o=r[2]/100,a=s+o*(1-s);let l=0;return a>0&&(l=s/a),[r[0],l*100,a*100]},t.hcg.hsl=function(r){const s=r[1]/100,a=r[2]/100*(1-s)+.5*s;let l=0;return a>0&&a<.5?l=s/(2*a):a>=.5&&a<1&&(l=s/(2*(1-a))),[r[0],l*100,a*100]},t.hcg.hwb=function(r){const s=r[1]/100,o=r[2]/100,a=s+o*(1-s);return[r[0],(a-s)*100,(1-a)*100]},t.hwb.hcg=function(r){const s=r[1]/100,a=1-r[2]/100,l=a-s;let c=0;return l<1&&(c=(a-l)/(1-l)),[r[0],l*100,c*100]},t.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]},t.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]},t.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]},t.gray.hsl=function(r){return[0,0,r[0]]},t.gray.hsv=t.gray.hsl,t.gray.hwb=function(r){return[0,100,r[0]]},t.gray.cmyk=function(r){return[0,0,0,r[0]]},t.gray.lab=function(r){return[r[0],0,0]},t.gray.hex=function(r){const s=Math.round(r[0]/100*255)&255,a=((s<<16)+(s<<8)+s).toString(16).toUpperCase();return"000000".substring(a.length)+a},t.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]},$le}var Hle,cFe;function Hbn(){if(cFe)return Hle;cFe=1;const n=Sit();function e(){const s={},o=Object.keys(n);for(let a=o.length,l=0;l<a;l++)s[o[l]]={distance:-1,parent:null};return s}function t(s){const o=e(),a=[s];for(o[s].distance=0;a.length;){const l=a.pop(),c=Object.keys(n[l]);for(let u=c.length,d=0;d<u;d++){const f=c[d],p=o[f];p.distance===-1&&(p.distance=o[l].distance+1,p.parent=l,a.unshift(f))}}return o}function i(s,o){return function(a){return o(s(a))}}function r(s,o){const a=[o[s].parent,s];let l=n[o[s].parent][s],c=o[s].parent;for(;o[c].parent;)a.unshift(o[c].parent),l=i(n[o[c].parent][c],l),c=o[c].parent;return l.conversion=a,l}return Hle=function(s){const o=t(s),a={},l=Object.keys(o);for(let c=l.length,u=0;u<c;u++){const d=l[u];o[d].parent!==null&&(a[d]=r(d,o))}return a},Hle}var Vle,uFe;function Vbn(){if(uFe)return Vle;uFe=1;const n=Sit(),e=Hbn(),t={},i=Object.keys(n);function r(o){const a=function(...l){const c=l[0];return c==null?c:(c.length>1&&(l=c),o(l))};return"conversion"in o&&(a.conversion=o.conversion),a}function s(o){const a=function(...l){const c=l[0];if(c==null)return c;c.length>1&&(l=c);const u=o(l);if(typeof u=="object")for(let d=u.length,f=0;f<d;f++)u[f]=Math.round(u[f]);return u};return"conversion"in o&&(a.conversion=o.conversion),a}return i.forEach(o=>{t[o]={},Object.defineProperty(t[o],"channels",{value:n[o].channels}),Object.defineProperty(t[o],"labels",{value:n[o].labels});const a=e(o);Object.keys(a).forEach(c=>{const u=a[c];t[o][c]=s(u),t[o][c].raw=r(u)})}),Vle=t,Vle}var Wle,dFe;function Wbn(){if(dFe)return Wle;dFe=1;const n=$bn(),e=Vbn(),t=["keyword","gray","hex"],i={};for(const f of Object.keys(e))i[[...e[f].labels].sort().join("")]=f;const r={};function s(f,p){if(!(this instanceof s))return new s(f,p);if(p&&p in t&&(p=null),p&&!(p in e))throw new Error("Unknown model: "+p);let g,m;if(f==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(f instanceof s)this.model=f.model,this.color=[...f.color],this.valpha=f.valpha;else if(typeof f=="string"){const _=n.get(f);if(_===null)throw new Error("Unable to parse color from string: "+f);this.model=_.model,m=e[this.model].channels,this.color=_.value.slice(0,m),this.valpha=typeof _.value[m]=="number"?_.value[m]:1}else if(f.length>0){this.model=p||"rgb",m=e[this.model].channels;const _=Array.prototype.slice.call(f,0,m);this.color=d(_,m),this.valpha=typeof f[m]=="number"?f[m]:1}else if(typeof f=="number")this.model="rgb",this.color=[f>>16&255,f>>8&255,f&255],this.valpha=1;else{this.valpha=1;const _=Object.keys(f);"alpha"in f&&(_.splice(_.indexOf("alpha"),1),this.valpha=typeof f.alpha=="number"?f.alpha:0);const v=_.sort().join("");if(!(v in i))throw new Error("Unable to parse color from object: "+JSON.stringify(f));this.model=i[v];const{labels:b}=e[this.model],y=[];for(g=0;g<b.length;g++)y.push(f[b[g]]);this.color=d(y)}if(r[this.model])for(m=e[this.model].channels,g=0;g<m;g++){const _=r[this.model][g];_&&(this.color[g]=_(this.color[g]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}s.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(f){let p=this.model in n.to?this:this.rgb();p=p.round(typeof f=="number"?f:1);const g=p.valpha===1?p.color:[...p.color,this.valpha];return n.to[p.model](g)},percentString(f){const p=this.rgb().round(typeof f=="number"?f:1),g=p.valpha===1?p.color:[...p.color,this.valpha];return n.to.rgb.percent(g)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const f={},{channels:p}=e[this.model],{labels:g}=e[this.model];for(let m=0;m<p;m++)f[g[m]]=this.color[m];return this.valpha!==1&&(f.alpha=this.valpha),f},unitArray(){const f=this.rgb().color;return f[0]/=255,f[1]/=255,f[2]/=255,this.valpha!==1&&f.push(this.valpha),f},unitObject(){const f=this.rgb().object();return f.r/=255,f.g/=255,f.b/=255,this.valpha!==1&&(f.alpha=this.valpha),f},round(f){return f=Math.max(f||0,0),new s([...this.color.map(a(f)),this.valpha],this.model)},alpha(f){return f!==void 0?new s([...this.color,Math.max(0,Math.min(1,f))],this.model):this.valpha},red:l("rgb",0,c(255)),green:l("rgb",1,c(255)),blue:l("rgb",2,c(255)),hue:l(["hsl","hsv","hsl","hwb","hcg"],0,f=>(f%360+360)%360),saturationl:l("hsl",1,c(100)),lightness:l("hsl",2,c(100)),saturationv:l("hsv",1,c(100)),value:l("hsv",2,c(100)),chroma:l("hcg",1,c(100)),gray:l("hcg",2,c(100)),white:l("hwb",1,c(100)),wblack:l("hwb",2,c(100)),cyan:l("cmyk",0,c(100)),magenta:l("cmyk",1,c(100)),yellow:l("cmyk",2,c(100)),black:l("cmyk",3,c(100)),x:l("xyz",0,c(95.047)),y:l("xyz",1,c(100)),z:l("xyz",2,c(108.833)),l:l("lab",0,c(100)),a:l("lab",1),b:l("lab",2),keyword(f){return f!==void 0?new s(f):e[this.model].keyword(this.color)},hex(f){return f!==void 0?new s(f):n.to.hex(this.rgb().round().color)},hexa(f){if(f!==void 0)return new s(f);const p=this.rgb().round().color;let g=Math.round(this.valpha*255).toString(16).toUpperCase();return g.length===1&&(g="0"+g),n.to.hex(p)+g},rgbNumber(){const f=this.rgb().color;return(f[0]&255)<<16|(f[1]&255)<<8|f[2]&255},luminosity(){const f=this.rgb().color,p=[];for(const[g,m]of f.entries()){const _=m/255;p[g]=_<=.04045?_/12.92:((_+.055)/1.055)**2.4}return .2126*p[0]+.7152*p[1]+.0722*p[2]},contrast(f){const p=this.luminosity(),g=f.luminosity();return p>g?(p+.05)/(g+.05):(g+.05)/(p+.05)},level(f){const p=this.contrast(f);return p>=7?"AAA":p>=4.5?"AA":""},isDark(){const f=this.rgb().color;return(f[0]*2126+f[1]*7152+f[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const f=this.rgb();for(let p=0;p<3;p++)f.color[p]=255-f.color[p];return f},lighten(f){const p=this.hsl();return p.color[2]+=p.color[2]*f,p},darken(f){const p=this.hsl();return p.color[2]-=p.color[2]*f,p},saturate(f){const p=this.hsl();return p.color[1]+=p.color[1]*f,p},desaturate(f){const p=this.hsl();return p.color[1]-=p.color[1]*f,p},whiten(f){const p=this.hwb();return p.color[1]+=p.color[1]*f,p},blacken(f){const p=this.hwb();return p.color[2]+=p.color[2]*f,p},grayscale(){const f=this.rgb().color,p=f[0]*.3+f[1]*.59+f[2]*.11;return s.rgb(p,p,p)},fade(f){return this.alpha(this.valpha-this.valpha*f)},opaquer(f){return this.alpha(this.valpha+this.valpha*f)},rotate(f){const p=this.hsl();let g=p.color[0];return g=(g+f)%360,g=g<0?360+g:g,p.color[0]=g,p},mix(f,p){if(!f||!f.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof f);const g=f.rgb(),m=this.rgb(),_=p===void 0?.5:p,v=2*_-1,b=g.alpha()-m.alpha(),y=((v*b===-1?v:(v+b)/(1+v*b))+1)/2,C=1-y;return s.rgb(y*g.red()+C*m.red(),y*g.green()+C*m.green(),y*g.blue()+C*m.blue(),g.alpha()*_+m.alpha()*(1-_))}};for(const f of Object.keys(e)){if(t.includes(f))continue;const{channels:p}=e[f];s.prototype[f]=function(...g){return this.model===f?new s(this):g.length>0?new s(g,f):new s([...u(e[this.model][f].raw(this.color)),this.valpha],f)},s[f]=function(...g){let m=g[0];return typeof m=="number"&&(m=d(g,p)),new s(m,f)}}function o(f,p){return Number(f.toFixed(p))}function a(f){return function(p){return o(p,f)}}function l(f,p,g){f=Array.isArray(f)?f:[f];for(const m of f)(r[m]||(r[m]=[]))[p]=g;return f=f[0],function(m){let _;return m!==void 0?(g&&(m=g(m)),_=this[f](),_.color[p]=m,_):(_=this[f]().color[p],g&&(_=g(_)),_)}}function c(f){return function(p){return Math.max(0,Math.min(f,p))}}function u(f){return Array.isArray(f)?f:[f]}function d(f,p){for(let g=0;g<p;g++)typeof f[g]!="number"&&(f[g]=0);return f}return Wle=s,Wle}var zbn=Wbn();const hFe=Cl(zbn);var Ubn=/\s/;function qbn(n){for(var e=n.length;e--&&Ubn.test(n.charAt(e)););return e}var Kbn=/^\s+/;function Gbn(n){return n&&n.slice(0,qbn(n)+1).replace(Kbn,"")}var fFe=NaN,Ybn=/^[-+]0x[0-9a-f]+$/i,Qbn=/^0b[01]+$/i,Xbn=/^0o[0-7]+$/i,Zbn=parseInt;function Jbn(n){if(typeof n=="number")return n;if(fJ(n))return fFe;if($E(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=$E(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Gbn(n);var t=Qbn.test(n);return t||Xbn.test(n)?Zbn(n.slice(2),t?2:8):Ybn.test(n)?fFe:+n}var e0n=1/0,t0n=17976931348623157e292;function n0n(n){if(!n)return n===0?n:0;if(n=Jbn(n),n===e0n||n===-1/0){var e=n<0?-1:1;return e*t0n}return n===n?n:0}function pFe(n){var e=n0n(n),t=e%1;return e===e?t?e-t:e:0}function Eit(n){return n}var pK=v8&&new v8,kit=pK?function(n,e){return pK.set(n,e),n}:Eit;function K8(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=hJ(n.prototype),i=n.apply(t,e);return $E(i)?i:t}}var i0n=1;function r0n(n,e,t){var i=e&i0n,r=K8(n);function s(){var o=this&&this!==Cg&&this instanceof s?r:n;return o.apply(i?t:this,arguments)}return s}function Tit(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)}var s0n=Math.max;function Iit(n,e,t,i){for(var r=-1,s=n.length,o=t.length,a=-1,l=e.length,c=s0n(s-o,0),u=Array(l+c),d=!i;++a<l;)u[a]=e[a];for(;++r<o;)(d||r<s)&&(u[t[r]]=n[r]);for(;c--;)u[a++]=n[r++];return u}var o0n=Math.max;function Lit(n,e,t,i){for(var r=-1,s=n.length,o=-1,a=t.length,l=-1,c=e.length,u=o0n(s-a,0),d=Array(u+c),f=!i;++r<u;)d[r]=n[r];for(var p=r;++l<c;)d[p+l]=e[l];for(;++o<a;)(f||r<s)&&(d[p+t[o]]=n[r++]);return d}function a0n(n,e){for(var t=n.length,i=0;t--;)n[t]===e&&++i;return i}function IEe(){}var l0n=4294967295;function YO(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=l0n,this.__views__=[]}YO.prototype=hJ(IEe.prototype);YO.prototype.constructor=YO;function c0n(){}var Ait=pK?function(n){return pK.get(n)}:c0n,gFe={},u0n=Object.prototype,d0n=u0n.hasOwnProperty;function h0n(n){for(var e=n.name+"",t=gFe[e],i=d0n.call(gFe,e)?t.length:0;i--;){var r=t[i],s=r.func;if(s==null||s==n)return r.name}return e}function QO(n,e){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}QO.prototype=hJ(IEe.prototype);QO.prototype.constructor=QO;function f0n(n){if(n instanceof YO)return n.clone();var e=new QO(n.__wrapped__,n.__chain__);return e.__actions__=dJ(n.__actions__),e.__index__=n.__index__,e.__values__=n.__values__,e}var p0n=Object.prototype,g0n=p0n.hasOwnProperty;function gK(n){if(_k(n)&&!a4(n)&&!(n instanceof YO)){if(n instanceof QO)return n;if(g0n.call(n,"__wrapped__"))return f0n(n)}return new QO(n)}gK.prototype=IEe.prototype;gK.prototype.constructor=gK;function m0n(n){var e=h0n(n),t=gK[e];if(typeof t!="function"||!(e in YO.prototype))return!1;if(n===t)return!0;var i=Ait(t);return!!i&&n===i[0]}var _0n=800,v0n=16,b0n=Date.now;function Nit(n){var e=0,t=0;return function(){var i=b0n(),r=v0n-(i-t);if(t=i,r>0){if(++e>=_0n)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}var Dit=Nit(kit),y0n=/\{\n\/\* \[wrapped with (.+)\] \*/,C0n=/,? & /;function w0n(n){var e=n.match(y0n);return e?e[1].split(C0n):[]}var x0n=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function S0n(n,e){var t=e.length;if(!t)return n;var i=t-1;return e[i]=(t>1?"& ":"")+e[i],e=e.join(t>2?", ":" "),n.replace(x0n,`{ /* [wrapped with `+e+`] */ `)}function E0n(n){return function(){return n}}var k0n=Eq?function(n,e){return Eq(n,"toString",{configurable:!0,enumerable:!1,value:E0n(e),writable:!0})}:Eit,T0n=Nit(k0n);function I0n(n,e,t,i){for(var r=n.length,s=t+-1;++s<r;)if(e(n[s],s,n))return s;return-1}function L0n(n){return n!==n}function A0n(n,e,t){for(var i=t-1,r=n.length;++i<r;)if(n[i]===e)return i;return-1}function N0n(n,e,t){return e===e?A0n(n,e,t):I0n(n,L0n,t)}function D0n(n,e){var t=n==null?0:n.length;return!!t&&N0n(n,e,0)>-1}var R0n=1,P0n=2,O0n=8,M0n=16,j0n=32,F0n=64,B0n=128,$0n=256,H0n=512,V0n=[["ary",B0n],["bind",R0n],["bindKey",P0n],["curry",O0n],["curryRight",M0n],["flip",H0n],["partial",j0n],["partialRight",F0n],["rearg",$0n]];function W0n(n,e){return fKe(V0n,function(t){var i="_."+t[0];e&t[1]&&!D0n(n,i)&&n.push(i)}),n.sort()}function Rit(n,e,t){var i=e+"";return T0n(n,S0n(i,W0n(w0n(i),t)))}var z0n=4,U0n=8,mFe=32,_Fe=64;function Pit(n,e,t,i,r,s,o,a,l,c){var u=e&U0n,d=u?o:void 0,f=u?void 0:o,p=u?s:void 0,g=u?void 0:s;e|=u?mFe:_Fe,e&=~(u?_Fe:mFe),e&z0n||(e&=-4);var m=[n,e,r,p,d,g,f,a,l,c],_=t.apply(void 0,m);return m0n(n)&&Dit(_,m),_.placeholder=i,Rit(_,n,e)}function Oit(n){var e=n;return e.placeholder}var q0n=Math.min;function K0n(n,e){for(var t=n.length,i=q0n(e.length,t),r=dJ(n);i--;){var s=e[i];n[i]=bKe(s,t)?r[s]:void 0}return n}var vFe="__lodash_placeholder__";function mK(n,e){for(var t=-1,i=n.length,r=0,s=[];++t<i;){var o=n[t];(o===e||o===vFe)&&(n[t]=vFe,s[r++]=t)}return s}var G0n=1,Y0n=2,Q0n=8,X0n=16,Z0n=128,J0n=512;function LEe(n,e,t,i,r,s,o,a,l,c){var u=e&Z0n,d=e&G0n,f=e&Y0n,p=e&(Q0n|X0n),g=e&J0n,m=f?void 0:K8(n);function _(){for(var v=arguments.length,b=Array(v),y=v;y--;)b[y]=arguments[y];if(p)var C=Oit(_),S=a0n(b,C);if(i&&(b=Iit(b,i,r,p)),s&&(b=Lit(b,s,o,p)),v-=S,p&&v<c){var k=mK(b,C);return Pit(n,e,LEe,_.placeholder,t,b,k,a,l,c-v)}var I=d?t:this,L=f?I[n]:n;return v=b.length,a?b=K0n(b,a):g&&v>1&&b.reverse(),u&&l<v&&(b.length=l),this&&this!==Cg&&this instanceof _&&(L=m||K8(L)),L.apply(I,b)}return _}function eyn(n,e,t){var i=K8(n);function r(){for(var s=arguments.length,o=Array(s),a=s,l=Oit(r);a--;)o[a]=arguments[a];var c=s<3&&o[0]!==l&&o[s-1]!==l?[]:mK(o,l);if(s-=c.length,s<t)return Pit(n,e,LEe,r.placeholder,void 0,o,c,void 0,void 0,t-s);var u=this&&this!==Cg&&this instanceof r?i:n;return Tit(u,this,o)}return r}var tyn=1;function nyn(n,e,t,i){var r=e&tyn,s=K8(n);function o(){for(var a=-1,l=arguments.length,c=-1,u=i.length,d=Array(u+l),f=this&&this!==Cg&&this instanceof o?s:n;++c<u;)d[c]=i[c];for(;l--;)d[c++]=arguments[++a];return Tit(f,r?t:this,d)}return o}var bFe="__lodash_placeholder__",zle=1,iyn=2,ryn=4,yFe=8,tj=128,CFe=256,syn=Math.min;function oyn(n,e){var t=n[1],i=e[1],r=t|i,s=r<(zle|iyn|tj),o=i==tj&&t==yFe||i==tj&&t==CFe&&n[7].length<=e[8]||i==(tj|CFe)&&e[7].length<=e[8]&&t==yFe;if(!(s||o))return n;i&zle&&(n[2]=e[2],r|=t&zle?0:ryn);var a=e[3];if(a){var l=n[3];n[3]=l?Iit(l,a,e[4]):a,n[4]=l?mK(n[3],bFe):e[4]}return a=e[5],a&&(l=n[5],n[5]=l?Lit(l,a,e[6]):a,n[6]=l?mK(n[5],bFe):e[6]),a=e[7],a&&(n[7]=a),i&tj&&(n[8]=n[8]==null?e[8]:syn(n[8],e[8])),n[9]==null&&(n[9]=e[9]),n[0]=e[0],n[1]=r,n}var ayn="Expected a function",wFe=1,lyn=2,xFe=8,SFe=16,EFe=32,cyn=64,kFe=Math.max;function uyn(n,e,t,i,r,s,o,a){var l=e&lyn;if(!l&&typeof n!="function")throw new TypeError(ayn);var c=i?i.length:0;if(c||(e&=-97,i=r=void 0),o=o===void 0?o:kFe(pFe(o),0),a=a===void 0?a:pFe(a),c-=r?r.length:0,e&cyn){var u=i,d=r;i=r=void 0}var f=l?void 0:Ait(n),p=[n,e,t,i,r,u,d,s,o,a];if(f&&oyn(p,f),n=p[0],e=p[1],t=p[2],i=p[3],r=p[4],a=p[9]=p[9]===void 0?l?0:n.length:kFe(p[9]-c,0),!a&&e&(xFe|SFe)&&(e&=-25),!e||e==wFe)var g=r0n(n,e,t);else e==xFe||e==SFe?g=eyn(n,e,a):(e==EFe||e==(wFe|EFe))&&!r.length?g=nyn(n,e,t,i):g=LEe.apply(void 0,p);var m=f?kit:Dit;return Rit(m(g,p),n,e)}var dyn=8;function _K(n,e,t){e=t?void 0:e;var i=uyn(n,dyn,void 0,void 0,void 0,void 0,void 0,e);return i.placeholder=_K.placeholder,i}_K.placeholder={};function hyn(n){const e=n[0],t=n[1],i=n[2];let r,s,o;return r=e*1+t*0+i*1.13983,s=e*1+t*-.39465+i*-.5806,o=e*1+t*2.02311+i*0,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[r*255,s*255,o*255]}function fyn(n){const e=n[0]/255,t=n[1]/255,i=n[2]/255,r=e*.299+t*.587+i*.114,s=e*-.14713+t*-.28886+i*.436,o=e*.615+t*-.51499+i*-.10001;return[r,s,o]}const pyn={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"},gyn={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"},myn={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"},_yn={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"},vyn={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"},byn={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"},yyn={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"},Cyn={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"},wyn={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"},xyn={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"},Syn={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"},Eyn={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"},kyn={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"},Tyn={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"},Iyn={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"},Lyn={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"},Ayn={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"},Nyn={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"},Dyn={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"},Ryn={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"},Pyn={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"},Oyn={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"},Myn={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"},jyn={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"},Fyn={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"},Byn={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"},$yn={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"},Hyn={scheme:"nicinabox",author:"nicinabox (http://github.com/nicinabox)",base00:"#2A2F3A",base01:"#3C444F",base02:"#4F5A65",base03:"#BEBEBE",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#FFFFFF",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#FC6D24",base0A:"#ddb26f",base0B:"#A1C659",base0C:"#12cfc0",base0D:"#6FB3D2",base0E:"#D381C3",base0F:"#deaf8f"},Vyn={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"},Wyn={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"},zyn={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"},Uyn={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"},qyn={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"},Kyn={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"},Gyn={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"},Yyn={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"},Qyn={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"},Xyn={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"},Mit={threezerotwofour:pyn,apathy:gyn,ashes:myn,atelierDune:_yn,atelierForest:vyn,atelierHeath:byn,atelierLakeside:yyn,atelierSeaside:Cyn,bespin:wyn,brewer:xyn,bright:Syn,chalk:Eyn,codeschool:kyn,colors:Tyn,default:Iyn,eighties:Lyn,embers:Ayn,flat:Nyn,google:Dyn,grayscale:Ryn,greenscreen:Pyn,harmonic:Oyn,hopscotch:Myn,isotope:jyn,marrakesh:Fyn,mocha:Byn,monokai:$yn,nicinabox:Hyn,ocean:Vyn,paraiso:Wyn,pop:zyn,railscasts:Uyn,shapeshifter:qyn,solarized:Kyn,summerfruit:Gyn,tomorrow:Yyn,tube:Qyn,twilight:Xyn},jit=Mit.default,TFe=Object.keys(jit),Zyn=n=>n<.25?1:n<.5?.9-n:1.1-n,Jyn=n=>{const e=hFe(n),[t,i,r]=fyn(e.array()),s=[Zyn(t),i,r],o=hyn(s);return hFe.rgb(o).hex()},kD=n=>e=>({className:[e.className,n.className].filter(Boolean).join(" "),style:{...e.style||{},...n.style||{}}}),e1n=(n,e)=>{if(n===void 0)return e;if(e===void 0)return n;const t=typeof n,i=typeof e;switch(t){case"string":switch(i){case"string":return[e,n].filter(Boolean).join(" ");case"object":return kD({className:n,style:e});case"function":return(r,...s)=>kD({className:n})(e(r,...s))}break;case"object":switch(i){case"string":return kD({className:e,style:n});case"object":return{...e,...n};case"function":return(r,...s)=>kD({style:n})(e(r,...s))}break;case"function":switch(i){case"string":return(r,...s)=>n(kD(r)({className:e}),...s);case"object":return(r,...s)=>n(kD(r)({style:e}),...s);case"function":return(r,...s)=>n(e(r,...s),...s)}}},t1n=(n,e)=>{const t=Object.keys(e);for(const i in n)t.indexOf(i)===-1&&t.push(i);return t.reduce((i,r)=>(i[r]=e1n(n[r],e[r]),i),{})},n1n=(n,e,...t)=>{if(e===null)return n;Array.isArray(e)||(e=[e]);const r=e.map(s=>n[s]).filter(Boolean).reduce((s,o)=>(typeof o=="string"?s.className=[s.className,o].filter(Boolean).join(" "):typeof o=="object"?s.style={...s.style,...o}:typeof o=="function"&&(s={...s,...o(s,...t)}),s),{className:"",style:{}});return r.className||delete r.className,Object.keys(r.style).length===0&&delete r.style,r},qpe=n=>Object.keys(n).reduce((e,t)=>(e[t]=/^base/.test(t)?Jyn(n[t]):t==="scheme"?n[t]+":inverted":n[t],e),{}),i1n=_K((n,e={},t={},...i)=>{const{defaultBase16:r=jit,base16Themes:s=null}=e,o=r1n(t,s);o&&(t={...o,...t});const a=TFe.reduce((d,f)=>(d[f]=t[f]||r[f],d),{}),l=Object.keys(t).reduce((d,f)=>(TFe.indexOf(f)===-1&&(d[f]=t[f]),d),{}),c=n(a),u=t1n(l,c);return _K(n1n,2)(u,...i)},3),Fit=n=>!!n.extend,r1n=(n,e)=>{if(n&&Fit(n)&&n.extend&&(n=n.extend),typeof n=="string"){const[t,i]=n.split(":");e?n=e[t]:n=Mit[t],i==="inverted"&&(n=qpe(n))}return n&&Object.prototype.hasOwnProperty.call(n,"base00")?n:void 0},s1n=n=>typeof n=="string"?`${n}:inverted`:n&&Fit(n)&&n.extend?typeof n.extend=="string"?{...n,extend:`${n.extend}:inverted`}:{...n,extend:qpe(n.extend)}:n&&qpe(n);function o1n(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 Bit({styling:n,arrowStyle:e="single",expanded:t,nodeType:i,onClick:r}){return we.createElement("div",{...n("arrowContainer",e),onClick:r},we.createElement("div",{...n(["arrow","arrowSign"],i,t,e)},"▶",e==="double"&&we.createElement("div",{...n(["arrowSign","arrowSignInner"])},"▶")))}function a1n(n,e){return n==="Object"?Object.keys(e).length:n==="Array"?e.length:1/0}function l1n(n){return typeof n.set=="function"}function c1n(n,e,t,i=0,r=1/0){let s;if(n==="Object"){let o=Object.getOwnPropertyNames(e);t&&o.sort(t===!0?void 0:t),o=o.slice(i,r+1),s={entries:o.map(a=>({key:a,value:e[a]}))}}else if(n==="Array")s={entries:e.slice(i,r+1).map((o,a)=>({key:a+i,value:o}))};else{let o=0;const a=[];let l=!0;const c=l1n(e);for(const u of e){if(o>r){l=!1;break}i<=o&&(c&&Array.isArray(u)?typeof u[0]=="string"||typeof u[0]=="number"?a.push({key:u[0],value:u[1]}):a.push({key:`[entry ${o}]`,value:{"[key]":u[0],"[value]":u[1]}}):a.push({key:o,value:u})),o++}s={hasMore:!l,entries:a}}return s}function Ule(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 u1n(n,e,t,i,r=0,s=1/0){const o=c1n.bind(null,n,e,t);if(!i)return o().entries;const a=s<1/0,l=Math.min(s-r,a1n(n,e));if(n!=="Iterable"){if(l<=i||i<7)return o(r,s).entries}else if(l<=i&&!a)return o(r,s).entries;let c;if(n==="Iterable"){const{hasMore:u,entries:d}=o(r,r+i-1);c=u?[...d,...Ule(r+i,r+2*i-1,i)]:d}else c=a?Ule(r,s,i):[...o(0,i-5).entries,...Ule(i-4,l-5,i),...o(l-4,l-1).entries];return c}function d1n(n){const{styling:e,from:t,to:i,renderChildNodes:r,nodeType:s}=n,[o,a]=x.useState(!1),l=x.useCallback(()=>{a(!o)},[o]);return o?we.createElement("div",{...e("itemRange",o)},r(n,t,i)):we.createElement("div",{...e("itemRange",o),onClick:l},we.createElement(Bit,{nodeType:s,styling:e,expanded:!1,onClick:l,arrowStyle:"double"}),`${t} ... ${i}`)}function h1n(n){return n.to!==void 0}function $it(n,e,t){const{nodeType:i,data:r,collectionLimit:s,circularCache:o,keyPath:a,postprocessValue:l,sortObjectKeys:c}=n,u=[];return u1n(i,r,c,s,e,t).forEach(d=>{if(h1n(d))u.push(we.createElement(d1n,{...n,key:`ItemRange--${d.from}-${d.to}`,from:d.from,to:d.to,renderChildNodes:$it}));else{const{key:f,value:p}=d,g=o.includes(p);u.push(we.createElement(Hit,{...n,postprocessValue:l,collectionLimit:s,key:`Node--${f}`,keyPath:[f,...a],value:l(p),circularCache:[...o,p],isCircular:g,hideRoot:!1}))}}),u}function AEe(n){const{circularCache:e=[],collectionLimit:t,createItemString:i,data:r,expandable:s,getItemString:o,hideRoot:a,isCircular:l,keyPath:c,labelRenderer:u,level:d=0,nodeType:f,nodeTypeIndicator:p,shouldExpandNodeInitially:g,styling:m}=n,[_,v]=x.useState(l?!1:g(c,r,d)),b=x.useCallback(()=>{s&&v(!_)},[s,_]),y=_||a&&d===0?$it({...n,circularCache:e,level:d+1}):null,C=we.createElement("span",{...m("nestedNodeItemType",_)},p),S=o(f,r,C,i(r,t),c),k=[c,f,_,s];return a?we.createElement("li",{...m("rootNode",...k)},we.createElement("ul",{...m("rootNodeChildren",...k)},y)):we.createElement("li",{...m("nestedNode",...k)},s&&we.createElement(Bit,{styling:m,nodeType:f,expanded:_,onClick:b}),we.createElement("label",{...m(["label","nestedNodeLabel"],...k),onClick:b},u(...k)),we.createElement("span",{...m("nestedNodeItemString",...k),onClick:b},S),we.createElement("ul",{...m("nestedNodeChildren",...k)},y))}function f1n(n){const e=Object.getOwnPropertyNames(n).length;return`${e} ${e!==1?"keys":"key"}`}function p1n({data:n,...e}){return we.createElement(AEe,{...e,data:n,nodeType:"Object",nodeTypeIndicator:e.nodeType==="Error"?"Error()":"{}",createItemString:f1n,expandable:Object.getOwnPropertyNames(n).length>0})}function g1n(n){return`${n.length} ${n.length!==1?"items":"item"}`}function m1n({data:n,...e}){return we.createElement(AEe,{...e,data:n,nodeType:"Array",nodeTypeIndicator:"[]",createItemString:g1n,expandable:n.length>0})}function _1n(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 v1n(n){return we.createElement(AEe,{...n,nodeType:"Iterable",nodeTypeIndicator:"()",createItemString:_1n,expandable:!0})}function iC({nodeType:n,styling:e,labelRenderer:t,keyPath:i,valueRenderer:r,value:s,valueGetter:o=a=>a}){return we.createElement("li",{...e("value",n,i)},we.createElement("label",{...e(["label","valueLabel"],n,i)},t(i,n,!1,!1)),we.createElement("span",{...e("valueText",n,i)},r(o(s),s,...i)))}function Hit({getItemString:n,keyPath:e,labelRenderer:t,styling:i,value:r,valueRenderer:s,isCustomNode:o,...a}){const l=o(r)?"Custom":o1n(r),c={getItemString:n,key:e[0],keyPath:e,labelRenderer:t,nodeType:l,styling:i,value:r,valueRenderer:s},u={...a,...c,data:r,isCustomNode:o};switch(l){case"Object":case"Error":case"WeakMap":case"WeakSet":return we.createElement(p1n,{...u});case"Array":return we.createElement(m1n,{...u});case"Iterable":case"Map":case"Set":return we.createElement(v1n,{...u});case"String":return we.createElement(iC,{...c,valueGetter:d=>`"${d}"`});case"Number":return we.createElement(iC,{...c});case"Boolean":return we.createElement(iC,{...c,valueGetter:d=>d?"true":"false"});case"Date":return we.createElement(iC,{...c,valueGetter:d=>d.toISOString()});case"Null":return we.createElement(iC,{...c,valueGetter:()=>"null"});case"Undefined":return we.createElement(iC,{...c,valueGetter:()=>"undefined"});case"Function":case"Symbol":return we.createElement(iC,{...c,valueGetter:d=>d.toString()});case"Custom":return we.createElement(iC,{...c});default:return we.createElement(iC,{...c,valueGetter:()=>`<${l}>`})}}const b1n={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"},y1n=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}),C1n=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}),w1n=n=>{const e=y1n(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:({style:t},i,r)=>({style:{...t,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:({style:t},i)=>({style:{...t,color:C1n(e)[i]}}),itemRange:(t,i)=>({style:{paddingTop:i?0:"0.25em",cursor:"pointer",color:e.LABEL_COLOR}}),arrow:({style:t},i,r)=>({style:{...t,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:({style:t},i)=>({style:{...t,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:({style:t},i,r,s,o)=>({style:{...t,position:"relative",paddingTop:"0.25em",marginLeft:i.length>1?"0.875em":0,paddingLeft:o?0:"1.125em"}}),rootNode:{padding:0,margin:0},nestedNodeLabel:({style:t},i,r,s,o)=>({style:{...t,margin:0,padding:0,WebkitUserSelect:o?"inherit":"text",MozUserSelect:o?"inherit":"text",cursor:o?"pointer":"default"}}),nestedNodeItemString:({style:t},i,r,s)=>({style:{...t,paddingLeft:"0.5em",cursor:"default",color:s?e.ITEM_STRING_EXPANDED_COLOR:e.ITEM_STRING_COLOR}}),nestedNodeItemType:{marginLeft:"0.3em",marginRight:"0.3em"},nestedNodeChildren:({style:t},i,r)=>({style:{...t,padding:0,margin:0,listStyle:"none",display:r?"block":"none"}}),rootNodeChildren:{padding:0,margin:0,listStyle:"none"}}},x1n=i1n(w1n,{defaultBase16:b1n}),IFe=n=>n,S1n=(n,e,t)=>t===0,E1n=(n,e,t,i)=>we.createElement("span",null,t," ",i),k1n=([n])=>we.createElement("span",null,n,":"),T1n=()=>!1;function I1n({data:n,theme:e,invertTheme:t,keyPath:i=["root"],labelRenderer:r=k1n,valueRenderer:s=IFe,shouldExpandNodeInitially:o=S1n,hideRoot:a=!1,getItemString:l=E1n,postprocessValue:c=IFe,isCustomNode:u=T1n,collectionLimit:d=50,sortObjectKeys:f=!1}){const p=x.useMemo(()=>x1n(t?s1n(e):e),[e,t]);return we.createElement("ul",{...p("tree")},we.createElement(Hit,{keyPath:a?[]:i,value:c(n),isCustomNode:u,styling:p,labelRenderer:r,valueRenderer:s,shouldExpandNodeInitially:o,hideRoot:a,getItemString:l,postprocessValue:c,collectionLimit:d,sortObjectKeys:f}))}const L1n={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 A1n(){const[n]=xe(),e=xt(),t=[{name:n("settings"),href:"/settings"},{name:n("system_logs"),href:"/settings/system_logs"}],{dateFormat:i}=Zc(),{data:r,isLoading:s}=lr(["/api/v1/system_logs","per_page=200","sort=created_at|DESC"],()=>Je("GET",ze("/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")}],a=[{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")}],l=[{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"}],c=p=>{const g=o.find(m=>m.id===p);return g?g.name:"Undefined Category"},u=p=>{const g=a.find(m=>m.id===p);return g?g.name:"Undefined Event"},d=p=>{const g=l.find(m=>m.id===p);return g?g.name:"Undefined Type"},f=p=>h.jsx(I1n,{data:JSON.parse(p),theme:L1n});return h.jsxs(Kr,{title:n("system_logs"),breadcrumbs:t,children:[s&&h.jsx(LQe,{children:h.jsx(yo,{})}),h.jsx(er,{title:n("system_logs"),className:"shadow-sm pb-6",style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},withoutBodyPadding:!0,children:r==null?void 0:r.data.data.map((p,g,{length:m})=>h.jsx("div",{className:"px-4 sm:px-6",children:h.jsx("div",{className:$t("pt-4",{"border-b border-dashed pb-4":g!==m-1}),style:{borderColor:e.$20},children:h.jsx(ne,{leftSide:c(p.category_id),leftSideHelp:`${d(p.type_id)} ${so(p.created_at,i)}`,noExternalPadding:!0,children:h.jsxs("div",{className:"flex flex-col space-y-2",children:[h.jsx("div",{children:h.jsx(as,{children:u(p.event_id)})}),h.jsx("div",{children:f(p.log)})]})},g)},g)}))})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Lee(n){const e=Yi(),t=Fr(),{withoutNavigation:i}=n||{},r=ts(EA);return s=>{r(s),t(Uo({object:"company",property:"settings",value:s.settings})),t(n9({status:{name:s.name,level:"group"}})),!i&&e("/settings/company_details")}}function Vit(){const[n]=xe(),e=gc(),t=Yi(),i=Vs(),r=Lee(),{id:s}=Yl(),o=_gn(),a=e.pathname.includes(s),l=async u=>{const d=await i.fetchQuery(["/api/v1/group_settings",u],()=>Je("GET",ze("/api/v1/group_settings/:id",{id:u})).then(f=>f.data.data),{staleTime:1/0});r(d)};return[u=>!a&&h.jsx($n,{onClick:()=>l(u.id),icon:h.jsx(an,{className:"h-4 w-4",element:AZ}),children:n("configure_settings")}),u=>hs(u)===Vr.Active&&h.jsx($n,{onClick:()=>t(Ut("/clients/create?group=:groupId",{groupId:u.id})),icon:h.jsx(an,{element:mb}),children:n("new_client")}),()=>a&&h.jsx(Ki,{withoutPadding:!0}),u=>a&&hs(u)===Vr.Active&&h.jsx($n,{onClick:()=>o([u.id],"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),u=>a&&(hs(u)===Vr.Archived||hs(u)===Vr.Deleted)&&h.jsx($n,{onClick:()=>o([u.id],"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),u=>a&&(hs(u)===Vr.Active||hs(u)===Vr.Archived)&&h.jsx($n,{onClick:()=>o([u.id],"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}function N1n(){const{documentTitle:n}=vr("online_payments"),[e]=xe(),t=Vit(),i=[{name:e("settings"),href:"/settings"},{name:e("group_settings"),href:"/settings/group_settings"}],r=[{id:"status_id",label:e("status"),format:(s,o)=>h.jsx(ev,{entity:o})},{id:"name",label:e("name"),format:(s,o)=>h.jsx(Ji,{to:Ut("/settings/group_settings/:id/edit",{id:o.id}),children:s})}];return h.jsxs(Kr,{title:n,breadcrumbs:i,docsLink:"en/advanced-settings/#group_settings",children:[h.jsx(Gb,{}),h.jsx(qm,{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,enableSavingFilterPreference:!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 Wit={id:"",name:"",settings:{},created_at:0,updated_at:0,archived_at:0,is_deleted:!1,documents:[]};function zit(n){const{setGroupSettings:e,setErrors:t,isCreatePage:i}=n;return(r,s)=>{t(void 0),e(i?{...Wit,[r]:s}:o=>o&&{...o,[r]:s})}}function Uit(n){const[e]=xe(),{groupSettings:t,handleChange:i,errors:r}=n;return h.jsx(ne,{leftSide:e("name"),children:h.jsx(lt,{value:t.name,onValueChange:s=>i("name",s),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 D1n(n){const e=Yi(),t=Vs(),i=ji(wu),{groupSettings:r,setErrors:s,setIsFormBusy:o,isFormBusy:a}=n;return()=>{a||(pe.processing(),s(void 0),o(!0),Je("POST",ze("/api/v1/group_settings"),r).then(l=>{pe.success("created_group"),ii(["group_settings"]),i&&t.invalidateQueries([i]),e(Ut("/settings/group_settings/:id/edit",{id:l.data.data.id}))}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(pe.dismiss(),s(l.response.data))}).finally(()=>o(!1)))}}function R1n(){const[n]=xe(),{documentTitle:e}=vr("new_group"),t=xt(),i=_Se(),r=[{name:n("settings"),href:"/settings"},{name:n("group_settings"),href:"/settings/group_settings"},{name:n("new_group"),href:"/settings/group_settings/create"}],[s,o]=x.useState(),[a,l]=x.useState(),[c,u]=x.useState(!1),d=zit({setGroupSettings:o,setErrors:l,isCreatePage:!0}),f=D1n({groupSettings:s,setErrors:l,isFormBusy:c,setIsFormBusy:u});return x.useEffect(()=>{o(Wit)},[]),h.jsxs(Kr,{title:e,breadcrumbs:r,onSaveClick:f,disableSaveButton:c||!s||i,children:[h.jsx(Gb,{}),s&&h.jsx(er,{title:n("new_group"),className:"shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:h.jsx(Uit,{groupSettings:s,handleChange:d,errors: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 NEe(n){const e=Yi(),t=Fr(),i=zi(),r=Nr(),{withoutNavigation:s}=n||{},o=ts(EA);return a=>{o(a),t(ME(r?{object:"company",data:{...r,settings:{id:a.id,...a.settings},e_invoice:a.e_invoice||{}}}:{object:"company",data:{...i,settings:{id:a.id,...a.settings},e_invoice:a.e_invoice||{}}})),t(n9({status:{name:a.display_name,level:"client"}})),!s&&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 P1n(n){const e=Yi(),t=Vs(),{setIsPurgeOrMergeActionCalled:i,setPasswordConfirmModalOpen:r}=n,s=Wm();return(o,a,l)=>{pe.processing(),i==null||i(!0),Je("POST",ze("/api/v1/clients/:id/purge",{id:a}),{},{headers:{"X-Api-Password":o}}).then(()=>{pe.success("purged_client"),t.invalidateQueries(),e("/clients")}).catch(c=>{var u;((u=c.response)==null?void 0:u.status)===412&&(s(l),r(!0)),i==null||i(!1)})}}function O1n(n){const[e]=xe(),{client:t,setIsPurgeOrMergeActionCalled:i}=n,[r,s]=x.useState(!1),[o,a]=x.useState(!1),l=P1n({setIsPurgeOrMergeActionCalled:i,setPasswordConfirmModalOpen:s});return h.jsxs(h.Fragment,{children:[h.jsx(pr,{title:e("purge_client"),visible:o,onClose:a,children:h.jsxs("div",{className:"flex flex-col space-y-6",children:[h.jsx("span",{className:"text-left font-medium",children:e("purge_client_warning")}),h.jsx(dn,{onClick:()=>{a(!1),setTimeout(()=>{s(!0)},310)},children:e("continue")})]})}),h.jsx($n,{onClick:()=>a(!0),icon:h.jsx(an,{element:Xkt}),children:e("purge")}),h.jsx(wg,{show:r,onClose:s,onSave:(c,u)=>l(c,t.id,u)})]})}function M1n(n){const[e]=xe(),t=Fr(),i=Yi(),{isEditOrShowPage:r}=Yw({entity:"client"}),{setIsPurgeOrMergeActionCalled:s}=n,o=Wm(),[a,l]=x.useState(""),[c,u]=x.useState(!1),[d,f]=x.useState(!1),p=(g,m)=>{d||(pe.processing(),f(!0),s==null||s(!0),Je("POST",ze("/api/v1/clients/:mergeIntoClientId/:mergeFromClientId/merge",{mergeIntoClientId:a,mergeFromClientId:n.mergeFromClientId}),{},{headers:{"X-Api-Password":g}}).then(()=>{ii(["clients"]),Je("POST",ze("/api/v1/refresh?updated_at=:updatedAt",{updatedAt:Jn().unix()})).then(_=>{pe.success("merged_clients"),t(s1(_.data.data)),t(zu("company")),l(""),n.setVisible(!1),r&&i("/clients")}).catch(()=>s==null?void 0:s(!1))}).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===412&&(o(m),u(!0)),s==null||s(!1)}).finally(()=>f(!1)))};return h.jsxs(pr,{title:e("merge_into"),visible:n.visible,onClose:()=>{l(""),n.setVisible(!1)},overflowVisible:!0,children:[h.jsx(DA,{inputLabel:e("client"),onChange:g=>l(g.id),value:a,clearButton:!0,onClearButtonClick:()=>l(""),withoutAction:!0,exclude:[n.mergeFromClientId],dropdownLabelFn:g=>{var m;return h.jsxs("div",{className:"flex items-center space-x-1",children:[h.jsx("span",{children:g.display_name}),((m=g.contacts[0])==null?void 0:m.email)&&h.jsxs("span",{className:"text-xs",children:["(",g.contacts[0].email,")"]})]})},initiallyVisible:!0}),h.jsx("div",{className:"self-end pt-2",children:h.jsx(dn,{disableWithoutIcon:!0,disabled:!a,onClick:()=>u(!0),children:e("merge")})}),h.jsx(wg,{show:c,onClose:u,onSave:p})]})}function j1n(n){const[e]=xe(),{client:t,setIsPurgeOrMergeActionCalled:i}=n,[r,s]=x.useState(!1);return h.jsxs(h.Fragment,{children:[h.jsx($n,{onClick:()=>s(!0),icon:h.jsx(an,{element:zzt}),children:e("merge")}),h.jsx(M1n,{visible:r,setVisible:s,mergeFromClientId:t.id,setIsPurgeOrMergeActionCalled:i})]})}function F1n(n){const[e]=xe(),t=_Ee(),{setIsPurgeOrMergeActionCalled:i}=n||{},r=jo(),{isAdmin:s,isOwner:o}=go(),{isEditOrShowPage:a,isShowPage:l}=Yw({entity:"client"}),c=NEe(),{setChangeTemplateVisible:u,setChangeTemplateResources:d,setChangeTemplateEntityContext:f}=N4();return[g=>!g.is_deleted&&h.jsx($n,{to:Ut("/clients/:id/statement",{id:g.id}),icon:h.jsx(an,{element:HZ}),children:e("view_statement")}),g=>!g.is_deleted&&!l&&h.jsx($n,{onClick:()=>window.open(Ut(`${g.contacts[0].link}?silent=true&client_hash=:clientHash`,{clientHash:g.client_hash}),"__blank"),icon:h.jsx(an,{element:swe}),children:e("client_portal")}),g=>h.jsx(Tee,{entity:"client",entityId:g.id,label:g.display_name,labelElement:h.jsx($n,{icon:h.jsx(an,{element:FZ}),children:e("add_comment")})}),g=>!g.is_deleted&&(s||o)&&h.jsx($n,{onClick:()=>c(g),icon:h.jsx(an,{element:Zkt}),children:e("settings")}),g=>!g.is_deleted&&r("create_invoice")&&h.jsx($n,{to:Ut("/invoices/create?client=:id",{id:g.id}),icon:h.jsx(an,{element:mb}),children:e("new_invoice")}),g=>!g.is_deleted&&r("create_payment")&&h.jsx($n,{to:Ut("/payments/create?client=:id",{id:g.id}),icon:h.jsx(an,{element:mb}),children:e("new_payment")}),g=>!g.is_deleted&&r("create_quote")&&h.jsx($n,{to:Ut("/quotes/create?client=:id",{id:g.id}),icon:h.jsx(an,{element:mb}),children:e("new_quote")}),g=>!g.is_deleted&&r("create_credit")&&h.jsx($n,{to:Ut("/credits/create?client=:id",{id:g.id}),icon:h.jsx(an,{element:mb}),children:e("new_credit")}),g=>!g.is_deleted&&(s||o)&&g&&h.jsx(j1n,{client:g,setIsPurgeOrMergeActionCalled:i}),g=>h.jsx($n,{onClick:()=>{u(!0),d([g]),f({endpoint:"/api/v1/clients/bulk",entity:"clients"})},icon:h.jsx(an,{element:t4}),children:e("run_template")}),g=>a&&!g.is_deleted&&h.jsx(Ki,{withoutPadding:!0}),g=>a&&hs(g)===Vr.Active&&h.jsx($n,{onClick:()=>t([g.id],"archive"),icon:h.jsx(an,{element:yu}),children:e("archive")}),g=>a&&(hs(g)===Vr.Archived||hs(g)===Vr.Deleted)&&h.jsx($n,{onClick:()=>t([g.id],"restore"),icon:h.jsx(an,{element:bu}),children:e("restore")}),g=>a&&(hs(g)===Vr.Active||hs(g)===Vr.Archived)&&h.jsx($n,{onClick:()=>t([g.id],"delete"),icon:h.jsx(an,{element:fc}),children:e("delete")}),g=>(s||o)&&g&&h.jsx(O1n,{client:g,setIsPurgeOrMergeActionCalled:i},"purge")]}const B1n=["name","contact_email","id_number","balance","paid_to_date","created_at","last_login_at","website"];function $1n(){const[n,e,t,i]=Sg({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 H1n(){var v;const{t:n}=xe(),{dateFormat:e}=Zc(),t=Ik(),i=zi(),r=Qo(),s=vf(),o=xk(),a=Sk(),l=gze(),c=RA(),u=x.useCallback(b=>{const y=[];return b.contacts.map(C=>y.push(`${C.first_name} ${C.last_name}`)),y.join("<br />")},[]);$1n();const[d,f,p,g]=Sg({entity:"client"}),m=[{column:"number",id:"number",label:n("number")},{column:"name",id:"display_name",label:n("name"),format:(b,y)=>h.jsx(eg,{to:Ut("/clients/:id",{id:y.id}),renderSpan:t("client",y),children:b})},{column:"balance",id:"balance",label:n("balance"),format:(b,y)=>s(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)=>s(b,y==null?void 0:y.country_id,y==null?void 0:y.settings.currency_id)},{column:"contact_name",id:"contacts",label:n("contact_name"),format:(b,y)=>y.contacts.length>0&&h.jsx(eg,{to:Ut("/clients/:id",{id:y.id}),renderSpan:t("client",y),children:(()=>{const C=y.contacts[0].first_name||"",S=y.contacts[0].last_name||"",k=y.contacts[0].email||"";return`${C} ${S}`.trim()||k})()})},{column:"contact_email",id:"id",label:n("contact_email"),format:(b,y)=>y.contacts.length>0&&h.jsx(Tc,{text:y.contacts[0].email})},{column:"last_login_at",id:"last_login",label:n("last_login"),format:b=>so(b,e)},{column:"address2",id:"address2",label:n("address2")},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:b=>so(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)=>h.jsx("span",{dangerouslySetInnerHTML:{__html:u(y)}})},{column:"country",id:"country_id",label:n("country"),format:b=>{var y;return b&&((y=o(b))==null?void 0:y.name)}},{column:"created_at",id:"created_at",label:n("created_at"),format:b=>so(b,e)},{column:"credit_balance",id:"credit_balance",label:n("credit_balance"),format:(b,y)=>s(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,S;return((C=y.settings)==null?void 0:C.currency_id)&&((S=a(y.settings.currency_id))==null?void 0:S.code)}},{column:d,id:"custom_value1",label:d,format:b=>c("client1",b==null?void 0:b.toString())},{column:f,id:"custom_value2",label:f,format:b=>c("client2",b==null?void 0:b.toString())},{column:p,id:"custom_value3",label:p,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)=>h.jsx(ev,{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=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(r!=null&&r.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(b)}})}),children:h.jsx("span",{children:Mb(gu(b)).slice(0,50)})})},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:b=>h.jsx(Ah,{width:"auto",tooltipElement:h.jsx("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:h.jsx("article",{className:$t("prose prose-sm",{"prose-invert":!(r!=null&&r.dark_mode)}),dangerouslySetInnerHTML:{__html:gu(b)}})}),children:h.jsx("span",{children:Mb(gu(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)=>s(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=>so(b,e)},{column:"vat_number",id:"vat_number",label:n("vat_number")},{column:"website",id:"website",label:n("website"),format:b=>h.jsx(Ji,{to:b.toString(),external:!0,children:h.jsxs(L8,{children:[h.jsx("span",{children:b}),b.toString().length>0&&h.jsx(TZ,{size:14})]})})},{column:"group",id:"group_settings_id",label:n("group"),format:(b,y)=>{var C;return!!b&&h.jsx(Ji,{to:Ut("/settings/group_settings/:id/edit",{id:b}),children:(C=y.group_settings)==null?void 0:C.name})}},{column:"city",id:"city",label:n("city")}],_=((v=r==null?void 0:r.react_table_columns)==null?void 0:v.client)||B1n;return m.filter(b=>_.includes(b.column)).sort((b,y)=>_.indexOf(b.column)-_.indexOf(y.column))}function V1n(n){var t;const[e]=xe();return h.jsx(qd,{endpoint:ze("/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 W1n(n){const[e]=xe(),{clients:t,setSelected:i}=n,r=_Ee(),[s,o]=x.useState(!1),[a,l]=x.useState(""),c=()=>{o(!1),l("")};return h.jsxs(h.Fragment,{children:[h.jsx($n,{onClick:()=>o(!0),icon:h.jsx(an,{element:bUe}),children:e("assign_group")}),h.jsxs(pr,{title:e("group"),visible:s,onClose:c,overflowVisible:!0,children:[h.jsx(V1n,{value:a,onChange:u=>l(u.id),onClearButtonClick:()=>l("")}),h.jsx(dn,{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")})]})]})}const z1n=()=>{const[n]=xe(),e=QQe(),t=d=>d.flatMap(({documents:f})=>f.map(({id:p})=>p)),i=d=>d.some(({documents:f})=>f.length),r=d=>d.every(({is_deleted:f})=>!f),s=d=>d.every(({is_deleted:f})=>!f),o=(d,f)=>{const p=t(d);e(p,"download"),f([])},{setChangeTemplateVisible:a,setChangeTemplateResources:l,setChangeTemplateEntityContext:c}=N4();return[({selectedResources:d,setSelected:f})=>r(d)&&h.jsx($n,{onClick:()=>i(d)?o(d,f):pe.error("no_documents_to_download"),icon:h.jsx(an,{element:FE}),children:n("documents")}),({selectedResources:d})=>h.jsx($n,{onClick:()=>{a(!0),l(d),c({endpoint:"/api/v1/clients/bulk",entity:"client"})},icon:h.jsx(an,{element:t4}),children:n("run_template")}),({selectedResources:d,setSelected:f})=>s(d)&&h.jsx(W1n,{clients:d,setSelected:f}),({selectedIds:d,setSelected:f})=>h.jsx(lit,{entity:"client",resourceIds:d,setSelected:f})]};function U1n(){const{id:n}=Yl(),e=F1n(),t=H1n(),i=z1n();return h.jsx("div",{className:"px-4 sm:px-6 pt-3",children:h.jsx(qm,{resource:"client",endpoint:Ut("/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:Ut("/clients/create?group=:groupId",{groupId:n})})})}function q1n(){const[n]=xe(),{id:e}=Yl(),{documentTitle:t}=vr("edit_group"),{data:i}=mgn({id:e}),r=Vit(),s=xt(),o=Lee(),a=[{name:n("settings"),href:"/settings"},{name:n("group_settings"),href:"/settings/group_settings"},{name:n("edit_group"),href:Ut("/settings/group_settings/:id/edit",{id:e})}],[l,c]=x.useState(),[u,d]=x.useState(!1),[f,p]=x.useState(0),[g,m]=x.useState(),_=zit({setGroupSettings:m,setErrors:c}),v=GQe({groupSettings:g,setErrors:c,isFormBusy:u,setIsFormBusy:d});x.useEffect(()=>{i&&m(i)},[i]);const b=()=>{ii(["group_settings"])};return h.jsx(Kr,{title:t,breadcrumbs:a,navigationTopRight:g&&h.jsx(Kw,{onSaveClick:v,label:n("actions"),resource:g,actions:r,disableSaveButton:u||!g}),children:h.jsx(er,{title:n("edit_group"),className:"shadow-sm",style:{borderColor:s.$24},headerStyle:{borderColor:s.$20},headerClassName:$t("px-4 sm:px-6",{"pt-4":f===0,"pt-[1.45rem] pb-[0.46rem]":f!==0}),topRight:h.jsx(h.Fragment,{children:i&&f===0&&h.jsxs(dn,{behavior:"button",onClick:()=>o(i),children:[h.jsx(an,{className:"h-4 w-4",element:AZ,color:"white"}),h.jsx("span",{children:n("configure_settings")})]})}),withoutHeaderBorder:!0,withoutHeaderPadding:!0,children:h.jsxs(Qb,{tabs:[n("overview"),n("clients"),n("documents")],formatTabLabel:y=>{if(y===2)return h.jsx(Ixe,{numberOfDocuments:g==null?void 0:g.documents.length})},onTabChange:y=>p(y),withHorizontalPadding:!0,fullRightPadding:!0,horizontalPaddingWidth:"1.5rem",children:[h.jsx("div",{children:g&&i&&h.jsx(Uit,{groupSettings:g,handleChange:_,errors:l})}),h.jsx("div",{children:h.jsx(U1n,{})}),h.jsxs("div",{className:"px-4 sm:px-6 pt-3",children:[h.jsx(vEe,{endpoint:ze("/api/v1/group_settings/:id/upload",{id:e}),onSuccess:b,widgetOnly:!0}),h.jsx(Lnt,{documents:(g==null?void 0:g.documents)||[],onDocumentDelete:b})]})]})})})}function K1n(){vr("user_management");const n=Ml(),[e]=xe(),[t,i]=x.useState(!1),[r,s]=x.useState(),[o,a]=x.useState([]),l=Cgn({setIsPasswordConfirmModalOpen:i}),c=[{name:e("settings"),href:"/settings"},{name:e("user_management"),href:"/settings/users"}],u=[{id:"name",label:"name",format:(d,f)=>h.jsxs(Ji,{to:Ut("/settings/users/:id/edit",{id:f.id}),children:[f.first_name," ",f.last_name]})},{id:"email",label:"email"}];return h.jsxs(h.Fragment,{children:[h.jsxs(Kr,{title:e("user_details"),breadcrumbs:c,docsLink:"/docs/advanced-settings/#user_management",children:[!$u()&&To(),h.jsx(qm,{resource:"user",columns:u,endpoint:Ut("/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,f)=>{a(d),s(f),i(!0)},styleOptions:{tdClassName:"py-4",withoutTdPadding:!0},enableSavingFilterPreference:!0})]}),h.jsx(wg,{show:t,onClose:i,onSave:(d,f)=>r&&l(o,r,d,f),tableActions:!0})]})}function G1n(n){const[e]=xe(),[t,i]=x.useState(!1),[r,s]=x.useState(),{user:o}=n,{id:a}=Yl(),l=Yi(),c=()=>{pe.processing(),Je("POST",ze("/api/v1/users/:id/invite",{id:a})).then(()=>{ii(["users"]),pe.success("email_sent_to_confirm_email")})},u=()=>{pe.processing(),Je("DELETE",ze("/api/v1/users/:id/detach_from_company",{id:a})).then(()=>{pe.success("removed_user"),ii(["users"]),l("/settings/users")}).catch(f=>{var p;((p=f.response)==null?void 0:p.status)===412&&pe.error("password_error_incorrect")})},d=()=>{if(r==="remove")return u();const f={archive:"archived_user",restore:"restored_user",delete:"deleted_user",remove:"removed_user"};pe.processing(),Je("POST",ze("/api/v1/users/bulk"),{action:r,ids:[a]}).then(()=>{const p=f[r]||`${r}d_user`;pe.success(p),ii(["users"])}).catch(p=>{var g;((g=p.response)==null?void 0:g.status)===412&&pe.error("password_error_incorrect")})};return h.jsxs(h.Fragment,{children:[h.jsx(wg,{show:t,onClose:i,onSave:d}),h.jsxs(Z_,{label:e("actions"),children:[h.jsxs("div",{children:[h.jsx($n,{onClick:()=>c(),icon:h.jsx(an,{element:BZ}),children:e("resend_email")}),h.jsx($n,{onClick:()=>{s("remove"),i(!0)},icon:h.jsx(an,{element:iTt}),children:e("remove")})]}),h.jsxs("div",{children:[o.archived_at===0&&h.jsx($n,{onClick:()=>{s("archive"),i(!0)},icon:h.jsx(an,{element:yu}),children:e("archive")}),o.archived_at>0&&h.jsx($n,{onClick:()=>{s("restore"),i(!0)},icon:h.jsx(an,{element:bu}),children:e("restore")}),!o.is_deleted&&h.jsx($n,{onClick:()=>{s("delete"),i(!0)},icon:h.jsx(an,{element:fc}),children:e("delete")})]})]})]})}function qit(n){var o,a,l,c,u,d,f,p;const[e]=xe(),{user:t,setUser:i}=n,r=(g,m)=>{i(_=>_&&{..._,[g]:m})},s=zi();return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("first_name"),required:!0,children:h.jsx(lt,{value:t==null?void 0:t.first_name,onValueChange:g=>r("first_name",g),errorMessage:(o=n.errors)==null?void 0:o.errors.first_name})}),h.jsx(ne,{leftSide:e("last_name"),required:!0,children:h.jsx(lt,{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})}),h.jsx(ne,{leftSide:e("email"),children:h.jsx(lt,{type:"email",value:t==null?void 0:t.email,onValueChange:g=>r("email",g),errorMessage:(l=n.errors)==null?void 0:l.errors.email})}),h.jsx(ne,{leftSide:e("phone"),children:h.jsx(lt,{value:t==null?void 0:t.phone,onValueChange:g=>r("phone",g),errorMessage:(c=n.errors)==null?void 0:c.errors.phone})}),h.jsx(ne,{leftSide:e("login_notification"),leftSideHelp:e("login_notification_help"),children:h.jsx(jt,{checked:t==null?void 0:t.user_logged_in_notification,onChange:g=>r("user_logged_in_notification",g)})}),((u=s==null?void 0:s.custom_fields)==null?void 0:u.user1)&&h.jsx(qo,{field:"user1",defaultValue:t.custom_value1,value:s.custom_fields.user1,onValueChange:g=>r("custom_value1",String(g))}),((d=s==null?void 0:s.custom_fields)==null?void 0:d.user2)&&h.jsx(qo,{field:"user2",defaultValue:t.custom_value2,value:s.custom_fields.user2,onValueChange:g=>r("custom_value2",String(g))}),((f=s==null?void 0:s.custom_fields)==null?void 0:f.user3)&&h.jsx(qo,{field:"user3",defaultValue:t.custom_value3,value:s.custom_fields.user3,onValueChange:g=>r("custom_value3",String(g))}),((p=s==null?void 0:s.custom_fields)==null?void 0:p.user4)&&h.jsx(qo,{field:"user4",defaultValue:t.custom_value4,value:s.custom_fields.user4,onValueChange:g=>r("custom_value4",String(g))})]})}function Kit(n){const[e]=xe(),{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"}],s=()=>{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":""},o=(c,u)=>{var f,p;const d=pn.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=(f=d.company_user)==null?void 0:f.notifications.email.filter(m=>!m.startsWith(c));d.company_user.notifications.email=g}else{const g=((p=d.company_user)==null?void 0:p.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 h.jsxs(h.Fragment,{children:[h.jsx(ne,{children:e("email")}),h.jsx(ne,{leftSide:e("all_events"),children:h.jsxs(Dn,{value:s(),onValueChange:c=>o("all_events",c),customSelector:!0,withBlank:!0,children:[h.jsx("option",{value:"all_notifications",children:e("all_records")}),h.jsx("option",{value:"all_user_notifications",children:e("owned_by_user")}),h.jsx("option",{value:"",children:e("custom")})]})}),r.map((c,u)=>h.jsx(ne,{leftSide:e(c.label),children:h.jsxs(Dn,{value:a(c.id),disabled:l(),onValueChange:d=>o(c.id,d),customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:`${c.id}_all`,children:e("all_records")}),h.jsx("option",{value:`${c.id}_user`,children:e("owned_by_user")}),h.jsx("option",{value:`${c.id}_none`,children:e("none")})]})},u))]})}const NV=["view_reports","view_dashboard","disable_emails"];function Git(n){var u;const[e]=xe(),{user:t,setUser:i}=n,r=xt(),s=["client","product","invoice","payment","recurring_invoice","quote","credit","project","task","vendor","expense","bank_transaction","purchase_order","recurring_expense"],o=()=>{var d;return!!((d=t==null?void 0:t.company_user)!=null&&d.is_admin)},a=d=>{i(f=>f&&{...f,company_user:f.company_user&&{...f.company_user,is_admin:d,permissions:d?"":f.company_user.permissions}})},l=d=>{var g,m;if((g=t==null?void 0:t.company_user)!=null&&g.is_admin)return!0;const f=(m=t==null?void 0:t.company_user)==null?void 0:m.permissions,[p]=d.split("_");return!!(f&&f.includes(`${p}_all`)&&d!=="view_reports"&&d!=="view_dashboard"&&d!=="disable_emails"||f&&f.includes(d))},c=(d,f)=>{var _;let p=pn.clone(((_=t==null?void 0:t.company_user)==null?void 0:_.permissions)??"").split(",").filter(v=>v!==d);const[g,m]=d.split("_");if(m==="all")p=p.filter(v=>!v.startsWith(g)||NV.includes(v));else if(p.includes(`${g}_all`)&&!NV.includes(d)){const v=s.map(b=>`${g}_${b}`).filter(b=>b!==d);p=p.filter(b=>b!==`${g}_all`),p=[...p,...v]}f&&p.push(d),p.includes(`${g}_all`)||p.filter(b=>b.startsWith(g)&&!NV.includes(b)).length===s.length&&(p=p.filter(b=>!b.startsWith(g)||NV.includes(b)),p.push(`${g}_all`)),p[0]===""&&p.shift(),i(v=>v&&{...v,company_user:v.company_user&&{...v.company_user,permissions:p.join(",")}})};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("administrator"),leftSideHelp:e("administrator_help"),children:h.jsx(jt,{checked:(u=t==null?void 0:t.company_user)==null?void 0:u.is_admin,onChange:d=>a(d),cypressRef:"admin"})}),h.jsx(ne,{leftSide:e("view_dashboard"),children:h.jsx(jt,{checked:l("view_dashboard"),onValueChange:d=>c("view_dashboard",d),cypressRef:"viewDashboard",disabled:o()})}),h.jsx(ne,{leftSide:e("reports"),leftSideHelp:e("view_report_permission"),children:h.jsx(jt,{checked:l("view_reports"),onValueChange:d=>c("view_reports",d),cypressRef:"viewReports",disabled:o()})}),h.jsx(ne,{leftSide:e("disable_emails"),leftSideHelp:e("disable_emails_help"),children:h.jsx(jt,{checked:l("disable_emails"),onValueChange:d=>c("disable_emails",d),disabled:o()})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:r.$20})}),h.jsx(ne,{children:h.jsxs("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[h.jsx("div",{className:"col-1",style:{color:r.$22},children:e("create")}),h.jsx("div",{className:"col-1",style:{color:r.$22},children:e("view")}),h.jsx("div",{className:"col-1",style:{color:r.$22},children:e("edit")})]})}),h.jsx(ne,{leftSide:e("all"),children:h.jsxs("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[h.jsx("div",{className:"col-1",children:h.jsx(Vd,{checked:l("create_all"),onChange:d=>c("create_all",d.target.checked),cypressRef:"create_all",disabled:o()})}),h.jsx("div",{className:"col-1",children:h.jsx(Vd,{checked:l("view_all"),onChange:d=>c("view_all",d.target.checked),cypressRef:"view_all",disabled:o()})}),h.jsx("div",{className:"col-1",children:h.jsx(Vd,{checked:l("edit_all"),onChange:d=>c("edit_all",d.target.checked),cypressRef:"edit_all",disabled:o()})})]})}),s.map((d,f)=>h.jsx(ne,{leftSide:e(d),children:h.jsxs("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[h.jsx("div",{className:"col-1",children:h.jsx(Vd,{checked:l(`create_${d}`),onValueChange:(p,g)=>c(`create_${d}`,!!g),cypressRef:`create_${d}`,disabled:o()})}),h.jsx("div",{className:"col-1",children:h.jsx(Vd,{checked:l(`view_${d}`),onValueChange:(p,g)=>c(`view_${d}`,!!g),cypressRef:`view_${d}`,disabled:o()})}),h.jsx("div",{className:"col-1",children:h.jsx(Vd,{checked:l(`edit_${d}`),onValueChange:(p,g)=>c(`edit_${d}`,!!g),cypressRef:`edit_${d}`,disabled:o()})})]})},f))]})}function Y1n(){const[n,e]=x.useState(!1),{id:t}=Yl(),{data:i}=bgn({id:t,enabled:n}),[r,s]=x.useState(),[o]=xe(),a=[o("details"),o("notifications"),o("permissions")],l=[{name:o("settings"),href:"/settings"},{name:o("user_management"),href:"/settings/users"},{name:o("edit_user"),href:Ut("/settings/users/:id/edit",{id:t})}],c=Yi(),u=xt(),d=Ml(),f=Vs(),[p,g]=x.useState(),[m,_]=x.useState(!1),v=Wm();x.useEffect(()=>{i!=null&&i.data.data&&i.data.data.email===(d==null?void 0:d.email)?c("/settings/user_details"):s(i==null?void 0:i.data.data)},[i==null?void 0:i.data.data]);const b=()=>{m||(_(!0),pe.processing(),Je("PUT",ze("/api/v1/users/:id?include=company_user",{id:t}),r).then(()=>{pe.success("updated_user"),ii(["users"])}).catch(C=>{var S;((S=C.response)==null?void 0:S.status)===422&&(g(C.response.data),pe.dismiss())}).finally(()=>_(!1)))},y=(C,S)=>{pe.processing(),f.fetchQuery(["/api/v1/users",t],()=>Je("GET",ze("/api/v1/users/:id?include=company_user",{id:t}),{},{headers:{"X-Api-Password":C}}),{staleTime:1/0}).then(()=>{e(!0),pe.dismiss()}).catch(k=>{var I;((I=k.response)==null?void 0:I.status)===412&&(v(S),e(!1))})};return h.jsxs(Kr,{breadcrumbs:l,title:o("edit_user"),onSaveClick:b,navigationTopRight:r&&h.jsx(G1n,{user:r}),disableSaveButton:m,children:[h.jsx(wg,{show:!n,onSave:y,onClose:e}),r&&r.email_verified_at===null&&h.jsxs(KZ,{type:"warning",children:[o("email_sent_to_confirm_email"),"."]}),h.jsx(er,{title:o("edit_user"),className:"shadow-sm pb-6",style:{borderColor:u.$24},headerStyle:{borderColor:u.$20},withoutBodyPadding:!0,withoutHeaderBorder:!0,children:h.jsxs(Qb,{tabs:a,horizontalPaddingWidth:"1.5rem",withHorizontalPadding:!0,fullRightPadding:!0,withoutVerticalMargin:!0,children:[h.jsx("div",{className:"pt-4",children:r&&h.jsx(qit,{user:r,setUser:s,errors:p})}),h.jsx("div",{className:"pt-4",children:r&&h.jsx(Kit,{user:r,setUser:s})}),h.jsx("div",{className:"pt-4",children:r&&h.jsx(Git,{user:r,setUser:s})})]})})]})}function Q1n(){vr("new_user");const[n]=xe(),e=xt(),t=[{name:n("settings"),href:"/settings"},{name:n("user_management"),href:"/settings/users"},{name:n("new_user"),href:"/settings/users/create"}],i=[n("details"),n("notifications"),n("permissions")],r=Wm(),{data:s}=ygn(),[o,a]=x.useState(),[l,c]=x.useState(),[u,d]=x.useState(!1),[f,p]=x.useState(!1),g=Yi();x.useEffect(()=>{a({...s==null?void 0:s.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:""}})},[s==null?void 0:s.data.data]);const m=(_,v)=>{u||(d(!0),pe.processing(),p(!1),Je("POST",ze("/api/v1/users?include=company_user"),o,{headers:{"X-Api-Password":_,...PE()}}).then(b=>{pe.success("created_user"),ii(["users"]),g(Ut("/settings/users/:id/edit",{id:b.data.data.id}))}).catch(b=>{var y,C;if(((y=b.response)==null?void 0:y.status)===412)r(v),p(!0);else if(((C=b.response)==null?void 0:C.status)===422){const S=b.response.data;S.errors.id?pe.error(S.errors.id):pe.dismiss(),c(S)}}).finally(()=>d(!1)))};return h.jsxs(Kr,{title:n("new_user"),breadcrumbs:t,onSaveClick:()=>p(!0),disableSaveButton:u,children:[!$u()&&To(),h.jsx(wg,{show:f,onSave:m,onClose:p}),h.jsx(er,{title:n("new_user"),className:"shadow-sm pb-6",style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},withoutBodyPadding:!0,withoutHeaderBorder:!0,children:h.jsxs(Qb,{tabs:i,horizontalPaddingWidth:"1.5rem",withHorizontalPadding:!0,fullRightPadding:!0,withoutVerticalMargin:!0,children:[h.jsx("div",{className:"pt-4",children:o&&h.jsx(qit,{user:o,setUser:a,errors:l})}),h.jsx("div",{className:"pt-4",children:o&&h.jsx(Kit,{user:o,setUser:a})}),h.jsx("div",{className:"pt-4",children:o&&h.jsx(Git,{user:o,setUser:a})})]})})]})}function Yit(n){return h.jsxs("div",{className:"flex justify-center",children:[h.jsx(Awe,{pages:n.breadcrumbs}),h.jsx("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 X1n(n){const{setPaymentTerm:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(s=>s&&{...s,[i]:r})}}function Z1n(){const{documentTitle:n}=vr("create_payment_term"),[e]=xe(),t=Yi(),{data:i}=irn(),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"}],[s,o]=x.useState(),[a,l]=x.useState(!1),[c,u]=x.useState(),d=X1n({setErrors:o,setPaymentTerm:u}),f=(g,m)=>{g.preventDefault(),a||(pe.processing(),l(!0),Je("POST",ze("/api/v1/payment_terms"),c).then(_=>{pe.success("created_payment_term"),ii(["payment_terms"]),m==="save"?t(Ut("/settings/payment_terms/:id/edit",{id:_.data.data.id})):i&&u(i)}).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===422&&(pe.dismiss(),o(_.response.data))}).finally(()=>l(!1)))},p=[{onClick:g=>f(g,"create"),text:`${e("save")} / ${e("create")}`,icon:h.jsx(an,{element:mb})}];return x.useEffect(()=>{i&&u(i)},[i]),h.jsx(Kr,{title:e("payment_terms"),breadcrumbs:r,children:h.jsx(Yit,{breadcrumbs:[],children:h.jsx(er,{title:n,withSaveButton:!0,disableSubmitButton:a,onFormSubmit:g=>f(g,"save"),onSaveClick:g=>f(g,"save"),additionalSaveOptions:p,children:h.jsx(l1,{children:h.jsx(Qs,{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:s==null?void 0:s.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 J1n(){return n=>{pe.processing(),zSe([n],"archive").then(()=>pe.success("archived_payment_term")).finally(()=>ii(["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 eCn(){return n=>{pe.processing(),zSe([n],"delete").then(()=>pe.success("deleted_payment_term")).finally(()=>ii(["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 tCn(){return n=>{pe.processing(),zSe([n],"restore").then(()=>pe.success("restored_payment_term")).finally(()=>ii(["payment_terms"]))}}function nCn(n){const[e]=xe(),t=J1n(),i=tCn(),r=eCn();return h.jsxs(Z_,{label:e("more_actions"),children:[!n.paymentTerm.archived_at&&!n.paymentTerm.is_deleted&&h.jsx($n,{onClick:()=>t(n.paymentTerm.id),icon:h.jsx(an,{element:yu}),children:e("archive")}),(n.paymentTerm.archived_at||n.paymentTerm.is_deleted)&&h.jsx($n,{onClick:()=>i(n.paymentTerm.id),icon:h.jsx(an,{element:bu}),children:e("restore")}),!n.paymentTerm.is_deleted&&h.jsx($n,{onClick:()=>r(n.paymentTerm.id),icon:h.jsx(an,{element:fc}),children:e("delete")})]})}function iCn(){vr("payment_terms");const[n]=xe(),{id:e}=Yl(),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:Ut("/settings/payment_terms/:id/edit",{id:e})}],{data:i}=nrn({id:e}),r=()=>{ii(["payment_terms"])},s=fd({enableReinitialize:!0,initialValues:{num_days:(i==null?void 0:i.data.data.num_days)||0},onSubmit:o=>{pe.processing(),Je("PUT",ze("/api/v1/payment_terms/:id",{id:i==null?void 0:i.data.data.id}),o).then(()=>pe.success("updated_payment_term")).finally(()=>{s.setSubmitting(!1),r()})}});return h.jsxs(Kr,{title:n("payment_terms"),breadcrumbs:t,navigationTopRight:i&&h.jsx(nCn,{paymentTerm:i.data.data}),children:[!i&&h.jsx("div",{className:"flex justify-center",children:h.jsx(yo,{})}),i&&h.jsx(Yit,{breadcrumbs:[],children:h.jsxs(er,{title:i.data.data.name,disableSubmitButton:s.isSubmitting,onFormSubmit:s.handleSubmit,withSaveButton:!0,children:[h.jsxs(ne,{leftSide:"Status",children:[!i.data.data.is_deleted&&!i.data.data.archived_at&&h.jsx(as,{variant:"primary",children:n("active")}),i.data.data.archived_at&&!i.data.data.is_deleted?h.jsx(as,{variant:"yellow",children:n("archived")}):null,i.data.data.is_deleted&&h.jsx(as,{variant:"red",children:n("deleted")})]}),h.jsx(l1,{children:h.jsx(Qs,{precision:0,value:s.values.num_days||"",label:n("number_of_days"),onValueChange:o=>s.setFieldValue("num_days",o),disablePrecision:!0})})]})})]})}function rCn(){const{documentTitle:n}=vr("payment_terms"),[e]=xe(),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,s)=>h.jsx(Ji,{to:Ut("/settings/payment_terms/:id/edit",{id:s.id}),children:r})}];return h.jsx(Kr,{breadcrumbs:t,title:n,children:h.jsx(qm,{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,enableSavingFilterPreference:!0})})}const sCn=()=>{const[n]=xe();return[{id:"name",label:n("name"),format:(t,i)=>h.jsx(Ji,{to:Ut("/settings/tax_rates/:id/edit",{id:i.id}),children:i==null?void 0:i.name})},{id:"rate",label:n("tax_rate"),format:t=>h.jsxs("span",{children:[t,"%"]})}]};function oCn(){const n=Fr(),e=sCn(),t=i=>{(i==="archive"||i==="delete")&&Je("POST",ze("/api/v1/refresh?updated_at=:updatedAt",{updatedAt:Jn().unix()})).then(r=>{n(s1(r.data.data)),n(zu("company"))})};return h.jsx(qm,{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),enableSavingFilterPreference:!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 aCn(n){const{setTaxRate:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(s=>s&&{...s,[i]:r})}}function lCn(){const{documentTitle:n}=vr("create_tax_rate"),[e]=xe(),t=Yi(),i=xt(),{data:r}=eUt(),s=[{name:e("settings"),href:"/settings"},{name:e("tax_settings"),href:"/settings/tax_settings"},{name:e("create_tax_rate"),href:"/settings/tax_rates/create"}],[o,a]=x.useState(),[l,c]=x.useState(),[u,d]=x.useState(!1),f=aCn({setErrors:a,setTaxRate:c}),p=(m,_)=>{m.preventDefault(),u||(pe.processing(),d(!0),Je("POST",ze("/api/v1/tax_rates"),l).then(v=>{pe.success("created_tax_rate"),ii(["tax_rates"]),_==="save"?t(Ut("/settings/tax_rates/:id/edit",{id:v.data.data.id})):r&&c(r)}).catch(v=>{var b;((b=v.response)==null?void 0:b.status)===422&&(pe.dismiss(),a(v.response.data))}).finally(()=>d(!1)))},g=[{onClick:m=>p(m,"create"),text:`${e("save")} / ${e("create")}`,icon:h.jsx(an,{element:mb})}];return x.useEffect(()=>{r&&c(r)},[r]),h.jsx(Kr,{title:e("tax_rates"),breadcrumbs:s,disableSaveButton:u,children:h.jsx("div",{className:"max-w-3xl",children:h.jsx(er,{title:n,className:"shadow-sm",style:{borderColor:i.$24},headerStyle:{borderColor:i.$20},disableSubmitButton:u,onFormSubmit:m=>p(m,"save"),onSaveClick:m=>p(m,"save"),additionalSaveOptions:g,withSaveButton:!0,children:h.jsxs(l1,{children:[h.jsx(lt,{required:!0,type:"text",label:e("name"),value:l==null?void 0:l.name,onValueChange:m=>f("name",m),errorMessage:o==null?void 0:o.errors.name}),h.jsx(Qs,{required:!0,label:e("tax_rate"),value:(l==null?void 0:l.rate)||"",onValueChange:m=>f("rate",Number(m)),errorMessage:o==null?void 0:o.errors.rate})]})})})})}function cCn(){const[n]=xe(),e=tUt();return[i=>i.archived_at===0&&h.jsx($n,{onClick:()=>e(i.id,"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),i=>i.archived_at>0&&h.jsx($n,{onClick:()=>e(i.id,"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),i=>!i.is_deleted&&h.jsx($n,{onClick:()=>e(i.id,"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}function uCn(){var d,f;const{setDocumentTitle:n}=vr("edit_tax_rate"),[e]=xe(),{id:t}=Yl(),i=[{name:e("settings"),href:"/settings"},{name:e("tax_settings"),href:"/settings/tax_settings"},{name:e("edit_tax_rate"),href:Ut("/settings/tax_rates/:id/edit",{id:t})}],{data:r}=Jzt({id:t}),[s,o]=x.useState({}),a=cCn(),l=xt();x.useEffect(()=>{n(r==null?void 0:r.data.data.name)},[r]);const c=()=>{ii(["tax_rates"])},u=fd({enableReinitialize:!0,initialValues:{name:(r==null?void 0:r.data.data.name)||"",rate:(r==null?void 0:r.data.data.rate)||0},onSubmit:p=>{o({}),pe.processing(),Je("PUT",ze("/api/v1/tax_rates/:id",{id:t}),p).then(()=>pe.success("updated_tax_rate")).catch(g=>{var m;((m=g.response)==null?void 0:m.status)===422&&(pe.dismiss(),o(g.response.data))}).finally(()=>{u.setSubmitting(!1),c()})}});return h.jsxs(Kr,{title:e("tax_rates"),navigationTopRight:r&&h.jsx(Kw,{label:e("actions"),resource:r.data.data,actions:a}),breadcrumbs:i,children:[!r&&h.jsx("div",{className:"flex justify-center",children:h.jsx(yo,{})}),r&&h.jsx("div",{className:"max-w-3xl",children:h.jsxs(er,{title:r.data.data.name,className:"shadow-sm",style:{borderColor:l.$24},headerStyle:{borderColor:l.$20},disableSubmitButton:u.isSubmitting,disableWithoutIcon:!0,onFormSubmit:u.handleSubmit,withSaveButton:!0,children:[h.jsxs(ne,{leftSide:e("status"),children:[!r.data.data.is_deleted&&!r.data.data.archived_at&&h.jsx(as,{variant:"primary",children:e("active")}),r.data.data.archived_at&&!r.data.data.is_deleted?h.jsx(as,{variant:"yellow",children:e("archived")}):null,r.data.data.is_deleted&&h.jsx(as,{variant:"red",children:e("deleted")})]}),h.jsxs(l1,{children:[h.jsx(lt,{type:"text",id:"name",label:e("name"),onChange:u.handleChange,errorMessage:(d=s==null?void 0:s.errors)==null?void 0:d.name,value:u.values.name}),h.jsx(Qs,{value:u.values.rate||"",label:e("tax_rate"),onValueChange:p=>u.setFieldValue("rate",p),errorMessage:(f=s==null?void 0:s.errors)==null?void 0:f.rate})]})]})})]})}function dCn(){const n=()=>{ii(["documents"])},e=zi();return h.jsxs("div",{className:"px-6 pt-3",children:[e&&h.jsx(vEe,{endpoint:ze("/api/v1/companies/:id/upload",{id:e.id}),onSuccess:n,widgetOnly:!0}),h.jsx(Dgn,{})]})}function hCn(){var a,l,c,u,d,f;const[n]=xe(),e=Fr(),t=cl(),i=Xs(),r=Nr(),s=ji(ya),o=p=>e(Uo({object:"company",property:p.target.id,value:p.target.value}));return h.jsx(h.Fragment,{children:(r==null?void 0:r.settings)&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"address1",labelElement:h.jsx(un,{label:n("address1")})}),children:h.jsx(lt,{value:((a=r==null?void 0:r.settings)==null?void 0:a.address1)||"",onChange:o,id:"settings.address1",disabled:t("address1"),errorMessage:s==null?void 0:s.errors["settings.address1"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"address2",labelElement:h.jsx(un,{label:n("address2")})}),children:h.jsx(lt,{value:((l=r==null?void 0:r.settings)==null?void 0:l.address2)||"",onChange:o,id:"settings.address2",disabled:t("address2"),errorMessage:s==null?void 0:s.errors["settings.address2"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"city",labelElement:h.jsx(un,{label:n("city")})}),children:h.jsx(lt,{value:((c=r==null?void 0:r.settings)==null?void 0:c.city)||"",onChange:o,id:"settings.city",disabled:t("city"),errorMessage:s==null?void 0:s.errors["settings.city"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"state",labelElement:h.jsx(un,{label:n("state")})}),children:h.jsx(lt,{value:((u=r==null?void 0:r.settings)==null?void 0:u.state)||"",onChange:o,id:"settings.state",disabled:t("state"),errorMessage:s==null?void 0:s.errors["settings.state"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"postal_code",labelElement:h.jsx(un,{label:n("postal_code")})}),children:h.jsx(lt,{value:((d=r==null?void 0:r.settings)==null?void 0:d.postal_code)||"",onChange:o,id:"settings.postal_code",disabled:t("postal_code"),errorMessage:s==null?void 0:s.errors["settings.postal_code"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"country_id",labelElement:h.jsx(un,{label:n("country")})}),children:h.jsx(_4,{value:((f=r==null?void 0:r.settings)==null?void 0:f.country_id)||"",onChange:p=>i("settings.country_id",p),disabled:t("country_id"),dismissable:!0,errorMessage:s==null?void 0:s.errors["settings.country_id"]})})]})})}function fCn(){var r,s,o,a,l,c,u,d;const[n]=xe(),e=Fr(),t=cl(),i=Cu(f=>f.companyUsers.changes.company);return h.jsx(h.Fragment,{children:(i==null?void 0:i.settings)&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"invoice_terms",labelElement:h.jsx(un,{label:n("invoice_terms")})}),children:h.jsx(dh,{value:((r=i==null?void 0:i.settings)==null?void 0:r.invoice_terms)||"",onChange:f=>e(Uo({object:"company",property:"settings.invoice_terms",value:f})),disabled:t("invoice_terms")})}),h.jsx(ne,{className:"mt-4",leftSide:h.jsx(cn,{propertyKey:"invoice_footer",labelElement:h.jsx(un,{label:n("invoice_footer")})}),children:h.jsx(dh,{value:((s=i==null?void 0:i.settings)==null?void 0:s.invoice_footer)||"",onChange:f=>e(Uo({object:"company",property:"settings.invoice_footer",value:f})),disabled:t("invoice_footer")})}),h.jsx(ne,{className:"mt-4",leftSide:h.jsx(cn,{propertyKey:"quote_terms",labelElement:h.jsx(un,{label:n("quote_terms")})}),children:h.jsx(dh,{value:((o=i==null?void 0:i.settings)==null?void 0:o.quote_terms)||"",onChange:f=>e(Uo({object:"company",property:"settings.quote_terms",value:f})),disabled:t("quote_terms")})}),h.jsx(ne,{className:"mt-4",leftSide:h.jsx(cn,{propertyKey:"quote_footer",labelElement:h.jsx(un,{label:n("quote_footer")})}),children:h.jsx(dh,{value:((a=i==null?void 0:i.settings)==null?void 0:a.quote_footer)||"",onChange:f=>e(Uo({object:"company",property:"settings.quote_footer",value:f})),disabled:t("quote_footer")})}),h.jsx(ne,{className:"mt-4",leftSide:h.jsx(cn,{propertyKey:"credit_terms",labelElement:h.jsx(un,{label:n("credit_terms")})}),children:h.jsx(dh,{value:((l=i==null?void 0:i.settings)==null?void 0:l.credit_terms)||"",onChange:f=>e(Uo({object:"company",property:"settings.credit_terms",value:f})),disabled:t("credit_terms")})}),h.jsx(ne,{className:"mt-4",leftSide:h.jsx(cn,{propertyKey:"credit_footer",labelElement:h.jsx(un,{label:n("credit_footer")})}),children:h.jsx(dh,{value:((c=i==null?void 0:i.settings)==null?void 0:c.credit_footer)||"",onChange:f=>e(Uo({object:"company",property:"settings.credit_footer",value:f})),disabled:t("credit_footer")})}),h.jsx(ne,{className:"mt-4",leftSide:h.jsx(cn,{propertyKey:"purchase_order_terms",labelElement:h.jsx(un,{label:n("purchase_order_terms")})}),children:h.jsx(dh,{value:((u=i==null?void 0:i.settings)==null?void 0:u.purchase_order_terms)||"",onChange:f=>e(Uo({object:"company",property:"settings.purchase_order_terms",value:f})),disabled:t("purchase_order_terms")})}),h.jsx(ne,{className:"mt-4",leftSide:h.jsx(cn,{propertyKey:"purchase_order_footer",labelElement:h.jsx(un,{label:n("purchase_order_footer")})}),children:h.jsx(dh,{value:((d=i==null?void 0:i.settings)==null?void 0:d.purchase_order_footer)||"",onChange:f=>e(Uo({object:"company",property:"settings.purchase_order_footer",value:f})),disabled:t("purchase_order_footer")})})]})})}function pCn(){var l,c,u,d,f,p,g,m,_,v,b,y,C;const[n]=xe(),e=Fr(),t=cl(),{isCompanySettingsActive:i}=el(),{data:r}=Zd(),s=ji(ya),o=Cu(S=>S.companyUsers.changes.company),a=(S,k)=>e(Uo({object:"company",property:S,value:k}));return h.jsx(h.Fragment,{children:(o==null?void 0:o.settings)&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"name",labelElement:h.jsx(un,{label:n("company_name")})}),children:h.jsx(lt,{value:((l=o==null?void 0:o.settings)==null?void 0:l.name)||"",onValueChange:S=>a("settings.name",S.toString()),disabled:t("name"),errorMessage:s==null?void 0:s.errors["settings.name"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"id_number",labelElement:h.jsx(un,{label:n("id_number")})}),children:h.jsx(lt,{value:((c=o==null?void 0:o.settings)==null?void 0:c.id_number)||"",onValueChange:S=>a("settings.id_number",S.toString()),disabled:t("id_number")||(o==null?void 0:o.legal_entity_id)!==null,errorMessage:s==null?void 0:s.errors["settings.id_number"]})}),h.jsxs(ne,{leftSide:h.jsx(cn,{propertyKey:"vat_number",labelElement:h.jsx(un,{label:n("vat_number")})}),children:[h.jsx(lt,{value:((u=o==null?void 0:o.settings)==null?void 0:u.vat_number)||"",onValueChange:S=>a("settings.vat_number",S.toString()),disabled:t("vat_number")||(o==null?void 0:o.legal_entity_id)!==null,errorMessage:s==null?void 0:s.errors["settings.vat_number"]}),o!=null&&o.legal_entity_id?h.jsx("p",{className:"mt-2",children:n("changing_vat_and_id_number_note")}):null]}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"website",labelElement:h.jsx(un,{label:n("website")})}),children:h.jsx(lt,{value:((d=o==null?void 0:o.settings)==null?void 0:d.website)||"",onValueChange:S=>a("settings.website",S.toString()),disabled:t("website"),errorMessage:s==null?void 0:s.errors["settings.website"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"email",labelElement:h.jsx(un,{label:n("email")})}),children:h.jsx(lt,{value:((f=o==null?void 0:o.settings)==null?void 0:f.email)||"",onValueChange:S=>a("settings.email",S.toString()),disabled:t("email"),errorMessage:s==null?void 0:s.errors["settings.email"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"phone",labelElement:h.jsx(un,{label:`${n("company")} ${n("phone")}`})}),children:h.jsx(lt,{value:((p=o==null?void 0:o.settings)==null?void 0:p.phone)||"",onValueChange:S=>a("settings.phone",S.toString()),disabled:t("phone"),errorMessage:s==null?void 0:s.errors["settings.phone"]})}),(o==null?void 0:o.settings.country_id)=="756"?h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"qr_iban",labelElement:h.jsx(un,{label:n("qr_iban")})}),children:h.jsx(lt,{value:((g=o==null?void 0:o.settings)==null?void 0:g.qr_iban)||"",onValueChange:S=>a("settings.qr_iban",S.toString()),disabled:t("qr_iban"),errorMessage:s==null?void 0:s.errors["settings.qr_iban"]})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"besr_id",labelElement:h.jsx(un,{label:n("besr_id")})}),children:h.jsx(lt,{value:((m=o==null?void 0:o.settings)==null?void 0:m.besr_id)||"",onValueChange:S=>a("settings.besr_id",S.toString()),disabled:t("besr_id"),errorMessage:s==null?void 0:s.errors["settings.besr_id"]})})]}):"",i&&h.jsx(ne,{leftSide:n("size_id"),children:h.jsx(Dn,{value:(o==null?void 0:o.size_id)||"1",onValueChange:S=>a("size_id",S.toString()),errorMessage:s==null?void 0:s.errors.size_id,customSelector:!0,dismissable:!1,children:r==null?void 0:r.sizes.map(S=>h.jsx("option",{value:S.id,children:S.name},S.id))})}),i&&h.jsx(ne,{leftSide:n("industry_id"),children:h.jsx(Dn,{value:(o==null?void 0:o.industry_id)||"1",onValueChange:S=>a("industry_id",S.toString()),errorMessage:s==null?void 0:s.errors.industry_id,customSelector:!0,dismissable:!1,children:r==null?void 0:r.industries.map(S=>h.jsx("option",{value:S.id,children:S.name},S.id))})}),h.jsx(ne,{leftSide:h.jsx(cn,{propertyKey:"classification",labelElement:h.jsx(un,{label:n("classification")})}),children:h.jsxs(Dn,{value:((_=o==null?void 0:o.settings)==null?void 0:_.classification)??"",onValueChange:S=>a("settings.classification",S.toString()),disabled:t("classification"),withBlank:!0,customSelector:!0,children:[h.jsx("option",{value:"individual",children:n("individual")}),h.jsx("option",{value:"business",children:n("business")}),h.jsx("option",{value:"company",children:n("company")}),h.jsx("option",{value:"partnership",children:n("partnership")}),h.jsx("option",{value:"trust",children:n("trust")}),h.jsx("option",{value:"charity",children:n("charity")}),h.jsx("option",{value:"government",children:n("government")}),h.jsx("option",{value:"other",children:n("other")})]})}),((v=o==null?void 0:o.custom_fields)==null?void 0:v.company1)&&h.jsx(qo,{field:"company1",defaultValue:o.settings.custom_value1||"",value:o.custom_fields.company1,onValueChange:S=>a("settings.custom_value1",S.toString())}),((b=o==null?void 0:o.custom_fields)==null?void 0:b.company2)&&h.jsx(qo,{field:"company2",defaultValue:o.settings.custom_value2||"",value:o.custom_fields.company2,onValueChange:S=>a("settings.custom_value2",S.toString())}),((y=o==null?void 0:o.custom_fields)==null?void 0:y.company3)&&h.jsx(qo,{field:"company3",defaultValue:o.settings.custom_value3||"",value:o.custom_fields.company3,onValueChange:S=>a("settings.custom_value3",S.toString())}),((C=o==null?void 0:o.custom_fields)==null?void 0:C.company4)&&h.jsx(qo,{field:"company4",defaultValue:o.settings.custom_value4||"",value:o.custom_fields.company4,onValueChange:S=>a("settings.custom_value4",S.toString())})]})})}function LFe({isSettingsPage:n=!0}){const[e]=xe(),t=Nr(),i=zi(),r=Fr(),{isGroupSettingsActive:s,isCompanySettingsActive:o,isClientSettingsActive:a}=el(),l=ji(EA),c=Lee({withoutNavigation:!0}),u=NEe({withoutNavigation:!0}),d=fd({enableReinitialize:!0,initialValues:t,onSubmit:()=>{pe.processing();let p="/api/v1/companies/:id",g=i.id;l&&(s&&(p="/api/v1/group_settings/:id",g=l.id),a&&(p="/api/v1/clients/:id",g=l.id)),Je("PUT",ze(p,{id:g}),d.values).then(m=>{o&&(r(gk({object:"company",data:m.data.data})),r(zu("company"))),s&&(ii(["group_settings"]),c(m.data.data)),a&&(ii(["clients"]),u(m.data.data)),pe.success("removed_logo")})}}),f=()=>{d.setFieldValue("settings.company_logo",""),d.submitForm()};return n?h.jsx(ne,{className:"pb-3",pushContentToRight:!0,noVerticalPadding:!0,children:h.jsx(dn,{behavior:"button",type:"secondary",onClick:()=>f(),children:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{children:h.jsx(MO,{size:"1rem",color:"#ef4444"})}),h.jsx("span",{className:"text-sm text-red-500",children:e("remove_logo")})]})})}):h.jsx(dn,{behavior:"button",type:"secondary",onClick:()=>f(),children:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{children:h.jsx(MO,{size:"1rem",color:"#ef4444"})}),h.jsx("span",{className:"text-sm text-red-500",children:e("remove_logo")})]})})}function Qit({isSettingsPage:n=!0}){const[e]=xe(),t=Fr(),i=Uqe(),r=xt(),s=zi(),[o,a]=x.useState(new FormData),{isGroupSettingsActive:l,isCompanySettingsActive:c,isClientSettingsActive:u}=el(),d=ji(EA),f=Lee({withoutNavigation:!0}),p=NEe({withoutNavigation:!0}),g=fd({enableReinitialize:!0,initialValues:o,onSubmit:()=>{pe.processing();let y="/api/v1/companies/:id",C=s.id;d&&(l&&(y="/api/v1/group_settings/:id",C=d.id),u&&(y="/api/v1/clients/:id",C=d.id)),Je("POST",ze(y,{id:C}),o,{headers:{"Content-Type":"multipart/form-data"}}).then(S=>{c&&(t(gk({object:"company",data:S.data.data})),t(zu("company"))),l&&(ii(["group_settings"]),f(S.data.data)),u&&(ii(["clients"]),p(S.data.data)),pe.success("uploaded_logo")}).finally(()=>a(new FormData))}}),m=x.useCallback(y=>{o.append("company_logo",y[0]),o.append("_method","PUT"),a(o),g.submitForm()},[o]),{getRootProps:_,getInputProps:v,isDragActive:b}=NA({onDrop:m,multiple:!1,maxFiles:1,accept:{"image/*":[".jpeg",".png"]}});return n?h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("logo"),children:h.jsxs("div",{className:"grid grid-cols-12 lg:gap-4 space-y-4 lg:space-y-0",children:[h.jsx("div",{className:"bg-gray-200 col-span-12 lg:col-span-5 rounded-lg p-6",children:h.jsx("img",{src:i,alt:e("company_logo")??"Company logo"})}),h.jsx("div",{className:"col-span-12 lg:col-span-5 bg-gray-900 rounded-lg p-6",children:h.jsx("img",{src:i,alt:e("company_logo")??"Company logo"})})]})}),h.jsx(ne,{leftSide:e("upload_logo"),children:h.jsx("div",{..._(),className:"flex flex-col md:flex-row md:items-center",children:h.jsxs("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:[h.jsx("input",{...v()}),h.jsx("div",{className:"flex justify-center",children:h.jsx(AL,{size:"2.3rem",color:r.$3})}),h.jsx("span",{className:"mt-2 block text-sm font-medium",children:b?"drop_your_logo_here":e("dropzone_default_message")})]})})}),h.jsx(LFe,{})]}):h.jsxs("div",{className:"flex flex-col space-y-5",children:[h.jsx("span",{className:"text-lg font-medium",children:e("upload_logo")}),h.jsxs("div",{className:"grid grid-cols-12 gap-x-4",children:[h.jsx("div",{className:"bg-gray-200 col-span-6 rounded-lg p-6",children:h.jsx("img",{src:i,alt:e("company_logo")??"Company logo"})}),h.jsx("div",{className:"col-span-6 bg-gray-900 rounded-lg p-6",children:h.jsx("img",{src:i,alt:e("company_logo")??"Company logo"})})]}),h.jsxs("div",{className:"flex flex-col space-y-3",children:[h.jsx("div",{..._(),className:"flex flex-col md:flex-row md:items-center",children:h.jsxs("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:[h.jsx("input",{...v()}),h.jsx("div",{className:"flex justify-center",children:h.jsx(AL,{size:"2.3rem",color:r.$3})}),h.jsx("span",{className:"mt-2 block text-sm font-medium",children:b?"drop_your_logo_here":e("dropzone_default_message")})]})}),h.jsx("div",{className:"self-start",children:h.jsx(LFe,{isSettingsPage:!1})})]})]})}function gCn(){const[n]=xe(),e=zi(),t=pv();return h.jsxs(h.Fragment,{children:[h.jsx(Gb,{}),h.jsx(h.Fragment,{children:h.jsx("div",{className:"px-4 sm:px-6",children:e&&["company1","company2","company3","company4"].map(i=>h.jsx(Qf,{initialValue:e.custom_fields[i]||"",field:i,placeholder:n("company_field"),onChange:r=>t(i,r),noExternalPadding:!0,withArrowAsSeparator:!0},i))})})]})}function mCn(){const[n]=xe(),e=[{id:"name",label:n("name"),format:(t,i)=>h.jsx(Ji,{to:Ut("/settings/task_statuses/:id/edit",{id:i.id}),children:t})},{id:"color",label:n("color"),format:t=>h.jsx("div",{className:"w-10 h-4 border border-gray-300 rounded-sm",style:{backgroundColor:t.toString()}})}];return h.jsx(qm,{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,enableSavingFilterPreference:!0})}function _Cn(){const{documentTitle:n}=vr("new_task_status"),[e]=xe(),t=Yi(),i=xt(),r=Lo(),s=[{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}=SEe(),[a,l]=x.useState(),[c,u]=x.useState(!1),[d,f]=x.useState(),p=EEe({setErrors:l,setTaskStatus:f}),g=(_,v)=>{_.preventDefault(),c||(pe.processing(),l(void 0),u(!0),Je("POST",ze("/api/v1/task_statuses"),d).then(b=>{pe.success("created_task_status"),ii(["task_statuses"]),v==="save"?t(Ut("/settings/task_statuses/:id/edit",{id:b.data.data.id})):f(o)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(l(b.response.data),pe.dismiss())}).finally(()=>u(!1)))};x.useEffect(()=>{o&&f(o)},[o]);const m=[{onClick:_=>g(_,"create"),text:`${e("save")} / ${e("create")}`,icon:h.jsx(an,{element:mb})}];return h.jsx(Kr,{title:e("task_statuses"),breadcrumbs:s,children:h.jsx(er,{title:n,className:"shadow-sm",childrenClassName:"pt-4",style:{borderColor:i.$24},headerStyle:{borderColor:i.$20},withoutBodyPadding:!0,withSaveButton:!0,disableSubmitButton:c,onSaveClick:_=>g(_,"save"),additionalSaveOptions:m,children:h.jsxs(l1,{children:[h.jsx(lt,{required:!0,label:e("name"),value:d==null?void 0:d.name,onValueChange:_=>p("name",_),errorMessage:a==null?void 0:a.errors.name}),h.jsxs("div",{children:[h.jsx(Lh,{className:"mb-1",children:e("color")}),h.jsx(xw,{value:(d==null?void 0:d.color)||r,onValueChange:_=>p("color",_)})]})]})})})}function vCn(){var b;const[n]=xe(),{id:e}=Yl(),t=Cvn(),i=xt(),r=[{name:n("settings"),href:"/settings"},{name:n("task_settings"),href:"/settings/task_settings"},{name:n("edit_task_status"),href:Ut("/settings/task_statuses/:id/edit",{id:e})}],{data:s}=vvn({id:e}),[o,a]=x.useState(),{documentTitle:l,setDocumentTitle:c}=vr(""),[u,d]=x.useState(),[f,p]=x.useState(!1),[g,m]=x.useState(!1),_=EEe({setErrors:a,setTaskStatus:d}),v=y=>{y.preventDefault(),f||(pe.processing(),a(void 0),p(!0),Je("PUT",ze("/api/v1/task_statuses/:id",{id:e}),u).then(()=>{pe.success("updated_task_status"),ii(["task_statuses"]),m(!1)}).catch(C=>{var S;((S=C.response)==null?void 0:S.status)===422&&(a(C.response.data),pe.dismiss())}).finally(()=>p(!1)))};return x.useEffect(()=>{s&&d(s.data.data)},[s]),x.useEffect(()=>{u&&!g&&(c(u.name),m(!0))},[u]),h.jsxs(Kr,{title:n("task_statuses"),navigationTopRight:u&&h.jsx(Kw,{label:n("actions"),resource:u,actions:t}),breadcrumbs:r,children:[!u&&h.jsx("div",{className:"flex justify-center",children:h.jsx(yo,{})}),u&&h.jsxs(er,{title:l,className:"shadow-sm",childrenClassName:"pt-4",style:{borderColor:i.$24},headerStyle:{borderColor:i.$20},withoutBodyPadding:!0,withSaveButton:!0,disableSubmitButton:f,onSaveClick:y=>v(y),onFormSubmit:y=>v(y),children:[h.jsxs(ne,{leftSide:n("status"),children:[!u.is_deleted&&!u.archived_at&&h.jsx(as,{variant:"primary",children:n("active")}),u.archived_at&&!u.is_deleted?h.jsx(as,{variant:"yellow",children:n("archived")}):null,u.is_deleted&&h.jsx(as,{variant:"red",children:n("deleted")})]}),h.jsxs(l1,{children:[h.jsx(lt,{required:!0,label:n("name"),value:u.name,onValueChange:y=>_("name",y),errorMessage:(b=o==null?void 0:o.errors)==null?void 0:b.name}),h.jsxs("div",{children:[h.jsx(Lh,{className:"mb-1",children:n("color")}),h.jsx(xw,{value:u.color,onValueChange:y=>_("color",y)})]})]})]})]})}function bCn(){const[n]=xe(),{documentTitle:e}=vr("api_tokens"),{dateFormat:t}=Zc(),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:(s,o)=>h.jsx(Ji,{to:Ut("/settings/integrations/api_tokens/:id/edit",{id:o==null?void 0:o.id}),children:o==null?void 0:o.name})},{id:"created_at",label:n("created_on"),format:(s,o)=>so(o.created_at,t)}];return h.jsx(Kr,{title:e,breadcrumbs:i,children:h.jsx(qm,{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,enableSavingFilterPreference:!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 yCn(n){const{isOwner:e,isAdmin:t}=go();return lr(["/api/v1/tokens",n.id],()=>Je("GET",ze("/api/v1/tokens/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function CCn(){return(n,e)=>{pe.processing(),Je("POST",ze("/api/v1/tokens/bulk"),{action:e,ids:[n]}).then(()=>{pe.success(`${e}d_token`),ii(["tokens"])})}}function wCn(){const{isAdmin:n}=go();return lr("/api/v1/tokens/create",()=>Je("GET",ze("/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 Xit(n){const{setApiToken:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(s=>s&&{...s,[i]:r})}}function xCn(){const[n]=xe(),{documentTitle:e}=vr("new_token"),t=Yi(),i=xt(),r=[{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:s}=wCn(),o=Wm(),[a,l]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(),[p,g]=x.useState(),m=Xit({setApiToken:f,setErrors:g}),_=(v,b)=>{c||(g(void 0),pe.processing(),u(!0),Je("POST",ze("/api/v1/tokens"),d,{headers:{"X-Api-Password":v}}).then(y=>{pe.success("created_token"),ii(["tokens"]),t(Ut("/settings/integrations/api_tokens/:id/edit",{id:y.data.data.id}))}).catch(y=>{var C,S;((C=y.response)==null?void 0:C.status)===422&&(pe.dismiss(),g(y.response.data)),((S=y.response)==null?void 0:S.status)===412&&(o(b),l(!0))}).finally(()=>u(!1)))};return x.useEffect(()=>{s&&f(s)},[s]),h.jsxs(h.Fragment,{children:[h.jsx(wg,{show:a,onClose:l,onSave:_}),h.jsx(Kr,{title:e,breadcrumbs:r,onSaveClick:()=>l(!0),disableSaveButton:!d||c,children:h.jsx(er,{title:n("new_token"),className:"shadow-sm",style:{borderColor:i.$24},headerStyle:{borderColor:i.$20},children:h.jsx(ne,{leftSide:n("name"),required:!0,children:h.jsx(lt,{required:!0,onValueChange:v=>m("name",v),errorMessage:p==null?void 0:p.errors.name})})})})]})}function SCn(){const[n]=xe(),e=CCn();return[i=>i.archived_at===0&&h.jsx($n,{onClick:()=>e(i.id,"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),i=>i.archived_at>0&&h.jsx($n,{onClick:()=>e(i.id,"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),i=>!i.is_deleted&&h.jsx($n,{onClick:()=>e(i.id,"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}function ECn(){const[n]=xe(),{id:e}=Yl(),{data:t}=yCn({id:e}),i=xt(),r=Yi(),{documentTitle:s}=vr("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:Ut("/settings/integrations/api_tokens/:id/edit",{id:e})}],a=SCn(),{dateFormat:l}=Zc(),c=Wm(),[u,d]=x.useState(!1),[f,p]=x.useState(!1),[g,m]=x.useState(),[_,v]=x.useState(),b=Xit({setApiToken:m,setErrors:v}),y=(C,S)=>{f||(v(void 0),pe.processing(),p(!0),Je("PUT",ze("/api/v1/tokens/:id",{id:e}),g,{headers:{"X-Api-Password":C}}).then(()=>{pe.success("updated_token"),ii(["tokens"]),r(Ut("/settings/integrations/api_tokens"))}).catch(k=>{var I,L;((I=k.response)==null?void 0:I.status)===422&&(pe.dismiss(),v(k.response.data)),((L=k.response)==null?void 0:L.status)===412&&(c(S),d(!0))}).finally(()=>p(!1)))};return x.useEffect(()=>{t&&m(t)},[t]),h.jsxs(h.Fragment,{children:[h.jsx(wg,{show:u,onClose:d,onSave:y}),h.jsx(Kr,{title:s,breadcrumbs:o,disableSaveButton:!g||f,onSaveClick:()=>d(!0),navigationTopRight:g&&h.jsx(Kw,{resource:g,label:n("more_actions"),actions:a}),children:t&&g&&h.jsxs(er,{title:t.name,className:"shadow-sm",style:{borderColor:i.$24},headerStyle:{borderColor:i.$20},children:[h.jsxs(ne,{leftSide:"Status",children:[!g.is_deleted&&!g.archived_at&&h.jsx(as,{variant:"primary",children:n("active")}),g.archived_at&&!g.is_deleted?h.jsx(as,{variant:"yellow",children:n("archived")}):null,g.is_deleted&&h.jsx(as,{variant:"red",children:n("deleted")})]}),h.jsx(ne,{leftSide:n("name"),required:!0,children:h.jsx(lt,{value:g.name,onValueChange:C=>b("name",C),errorMessage:_==null?void 0:_.errors.name})}),h.jsx(ne,{leftSide:n("token"),children:h.jsx(Tc,{secure:!0,className:"break-all",text:g.token})}),h.jsx(ne,{leftSide:n("created_on"),children:so(g.created_at,l)}),To()]})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function DEe(){const[n]=xe();return[{event:"1",label:n("create_client")},{event:"10",label:n("update_client")},{event:"37",label:n("archive_client")},{event:"45",label:n("restore_client")},{event:"11",label:n("delete_client")},{event:"2",label:n("create_invoice")},{event:"60",label:n("sent_invoice")},{event:"8",label:n("update_invoice")},{event:"22",label:n("late_invoice")},{event:"24",label:n("remind_invoice")},{event:"33",label:n("archive_invoice")},{event:"41",label:n("restore_invoice")},{event:"9",label:n("delete_invoice")},{event:"3",label:n("create_quote")},{event:"61",label:n("sent_quote")},{event:"6",label:n("update_quote")},{event:"21",label:n("approve_quote")},{event:"23",label:n("expired_quote")},{event:"34",label:n("archive_quote")},{event:"42",label:n("restore_quote")},{event:"7",label:n("delete_quote")},{event:"64",label:n("remind_quote")},{event:"27",label:n("create_credit")},{event:"62",label:n("sent_credit")},{event:"28",label:n("update_credit")},{event:"35",label:n("archive_credit")},{event:"43",label:n("restore_credit")},{event:"29",label:n("delete_credit")},{event:"4",label:n("create_payment")},{event:"31",label:n("update_payment")},{event:"32",label:n("archive_payment")},{event:"40",label:n("restore_payment")},{event:"12",label:n("delete_payment")},{event:"5",label:n("create_vendor")},{event:"13",label:n("update_vendor")},{event:"48",label:n("archive_vendor")},{event:"49",label:n("restore_vendor")},{event:"14",label:n("delete_vendor")},{event:"15",label:n("create_expense")},{event:"16",label:n("update_expense")},{event:"39",label:n("archive_expense")},{event:"47",label:n("restore_expense")},{event:"17",label:n("delete_expense")},{event:"18",label:n("create_task")},{event:"19",label:n("update_task")},{event:"36",label:n("archive_task")},{event:"44",label:n("restore_task")},{event:"20",label:n("delete_task")},{event:"25",label:n("create_project")},{event:"26",label:n("update_project")},{event:"38",label:n("archive_project")},{event:"46",label:n("restore_project")},{event:"30",label:n("delete_project")},{event:"50",label:n("create_product")},{event:"51",label:n("update_product")},{event:"52",label:n("delete_product")},{event:"53",label:n("restore_product")},{event:"54",label:n("archive_product")},{event:"55",label:n("create_purchase_order")},{event:"63",label:n("sent_purchase_order")},{event:"56",label:n("update_purchase_order")},{event:"57",label:n("delete_purchase_order")},{event:"58",label:n("restore_purchase_order")},{event:"59",label:n("archive_purchase_order")},{event:"65",label:n("accept_purchase_order")}]}function kCn(){const[n]=xe(),e=DEe();return[{id:"endpoint",label:n("endpoint"),format:(i,r)=>h.jsx(Ji,{to:Ut("/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 s;return((s=e.find(({event:o})=>o===r.event_id))==null?void 0:s.label)||""}}]}function TCn(){vr("api_webhooks");const[n]=xe(),e=kCn(),t=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_webhooks"),href:"/settings/integrations/api_webhooks"}];return h.jsx(Kr,{title:n("api_webhooks"),breadcrumbs:t,children:h.jsx(qm,{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,enableSavingFilterPreference:!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 ICn(n){const{isAdmin:e}=go();return lr(["/api/v1/webhooks",n.id],()=>Je("GET",ze("/api/v1/webhooks/:id",{id:n.id})).then(t=>t.data.data),{staleTime:1/0,enabled:e})}function LCn(){const{isAdmin:n}=go();return lr("/api/v1/webhooks/create",()=>Je("GET",ze("/api/v1/webhooks/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function ACn(){return(n,e)=>{pe.processing(),Je("POST",ze("/api/v1/webhooks/bulk"),{action:e,ids:[n]}).then(()=>{pe.success(`${e}d_webhook`),ii(["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 Zit(n){const{setApiWebHook:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(s=>s&&{...s,[i]:r})}}const NCn=As.div` background-color: ${({theme:n})=>n.backgroundColor}; &:hover { background-color: ${({theme:n})=>n.hoverBackgroundColor}; } `;function DCn(){const[n]=xe(),{documentTitle:e}=vr("new_webhook"),t=xt(),{data:i}=LCn(),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("new_webhook"),href:"/settings/integrations/api_webhooks/create"}],s=DEe(),[o,a]=x.useState({}),[l,c]=x.useState({}),[u,d]=x.useState(),[f,p]=x.useState(),[g,m]=x.useState(!1),_=Zit({setApiWebHook:p,setErrors:d}),v=C=>{if(Object.hasOwn(o,C)){const S={...o};delete S[C],a(S)}},b=Yi(),y=()=>{f&&!g&&(pe.processing(),m(!0),d(void 0),f.headers=o,Je("POST",ze("/api/v1/webhooks"),f).then(C=>{pe.success("created_webhook"),ii(["webhooks"]),b(Ut("/settings/integrations/api_webhooks/:id/edit",{id:C.data.data.id}))}).catch(C=>{var S;((S=C.response)==null?void 0:S.status)===422&&(pe.dismiss(),d(C.response.data))}).finally(()=>m(!1)))};return x.useEffect(()=>{i&&p({...i,headers:{}})},[i]),h.jsx(Kr,{title:n("api_webhooks"),breadcrumbs:r,disableSaveButton:!f||g,onSaveClick:y,children:h.jsxs(er,{title:e,className:"shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:[h.jsx(ne,{leftSide:n("target_url"),required:!0,children:h.jsx(lt,{required:!0,value:f==null?void 0:f.target_url,onValueChange:C=>_("target_url",C),errorMessage:u==null?void 0:u.errors.target_url})}),h.jsx(ne,{leftSide:n("event_type"),children:h.jsx(Dn,{value:f==null?void 0:f.event_id,onValueChange:C=>_("event_id",C),errorMessage:u==null?void 0:u.errors.event_id,customSelector:!0,dismissable:!1,children:s.map(C=>h.jsx("option",{value:C.event,children:C.label},C.event))})}),h.jsx(ne,{leftSide:n("method"),children:h.jsxs(Dn,{value:f==null?void 0:f.rest_method,onValueChange:C=>_("rest_method",C),errorMessage:u==null?void 0:u.errors.method,customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"post",children:"POST"}),h.jsx("option",{value:"put",children:"PUT"})]})}),h.jsx(ne,{leftSide:n("add_header"),children:h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("div",{className:"flex flex-1 justify-between items-center space-x-6",children:[h.jsx("div",{className:"flex-1",children:h.jsx(lt,{debounceTimeout:0,id:"header_key",placeholder:n("header_key"),value:l.key||"",onValueChange:C=>c({...l,key:C})})}),h.jsx("div",{className:"flex-1",children:h.jsx(lt,{className:"flex-1",debounceTimeout:0,id:"header_value",value:l.value||"",placeholder:n("header_value"),onValueChange:C=>c({...l,value:C})})}),h.jsx(NCn,{className:$t("focus:outline-none focus:ring-0 p-1.5 border rounded-md",{"cursor-pointer":!!l.key&&!!l.value,"cursor-not-allowed opacity-75":!l.key||!l.value}),onClick:()=>{!l.key||!l.value||(a(C=>({...C,[l.key]:l.value})),c({}))},style:{borderColor:t.$21},theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},children:h.jsx(nc,{size:"1.1rem",color:t.$3})})]}),h.jsxs("div",{className:"flex flex-col space-y-5 pt-5",children:[Object.entries(o).map(([C,S],k)=>h.jsxs("div",{className:"flex justify-between items-center space-x-4",children:[h.jsx("span",{className:"flex-1 text-start",children:C}),h.jsx("span",{className:"flex-1 text-start",children:S}),h.jsx("div",{className:"cursor-pointer",onClick:()=>v(C),children:h.jsx(c1,{color:t.$16,hoverColor:t.$3,borderColor:t.$5,hoverBorderColor:t.$17,size:"1.6rem"})})]},k)),!Object.entries(o).length&&h.jsx("span",{className:"text-gray-500 self-center text-xl",children:n("no_headers")})]})]})})]})})}function RCn(){const[n]=xe(),e=ACn();return[i=>i.archived_at===0&&h.jsx($n,{onClick:()=>e(i.id,"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),i=>i.archived_at>0&&h.jsx($n,{onClick:()=>e(i.id,"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),i=>!i.is_deleted&&h.jsx($n,{onClick:()=>e(i.id,"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}const PCn=As.div` background-color: ${({theme:n})=>n.backgroundColor}; &:hover { background-color: ${({theme:n})=>n.hoverBackgroundColor}; } `;function OCn(){const[n]=xe(),{id:e}=Yl(),t=xt();vr("edit_webhook");const i=Yi(),r=RCn(),s=[{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:Ut("/settings/integrations/api_webhooks/:id/edit",{id:e})}],o=DEe(),[a,l]=x.useState({}),[c,u]=x.useState({}),[d,f]=x.useState(),[p,g]=x.useState(!1),[m,_]=x.useState(),v=Zit({setApiWebHook:_,setErrors:f}),{data:b}=ICn({id:e}),y=S=>{if(Object.hasOwn(a,S)){const k={...a};delete k[S],l(k)}},C=()=>{m&&!p&&(pe.processing(),g(!0),f(void 0),m.headers=a,Je("PUT",ze("/api/v1/webhooks/:id",{id:e}),m).then(()=>{pe.success("created_webhook"),ii(["webhooks"]),i("/settings/integrations/api_webhooks")}).catch(S=>{var k;((k=S.response)==null?void 0:k.status)===422&&(pe.dismiss(),f(S.response.data))}).finally(()=>g(!1)))};return x.useEffect(()=>{b&&(_(b),l(b.headers))},[b]),h.jsx(Kr,{title:n("api_webhooks"),breadcrumbs:s,disableSaveButton:!m||p,onSaveClick:C,navigationTopRight:m&&h.jsx(Kw,{label:n("more_actions"),resource:m,actions:r}),children:h.jsxs(er,{title:b==null?void 0:b.target_url,className:"shadow-sm",style:{borderColor:t.$24},headerStyle:{borderColor:t.$20},children:[h.jsx(ne,{leftSide:n("target_url"),required:!0,children:h.jsx(lt,{required:!0,value:m==null?void 0:m.target_url,onValueChange:S=>v("target_url",S),errorMessage:d==null?void 0:d.errors.target_url})}),h.jsx(ne,{leftSide:n("event_type"),children:h.jsx(Dn,{value:m==null?void 0:m.event_id,onValueChange:S=>v("event_id",S),errorMessage:d==null?void 0:d.errors.event_id,customSelector:!0,children:o.map(S=>h.jsx("option",{value:S.event,children:S.label},S.event))})}),h.jsx(ne,{leftSide:n("method"),children:h.jsxs(Dn,{value:m==null?void 0:m.rest_method,onValueChange:S=>v("rest_method",S),errorMessage:d==null?void 0:d.errors.rest_method,children:[h.jsx("option",{value:"post",children:"POST"}),h.jsx("option",{value:"put",children:"PUT"})]})}),h.jsx(ne,{leftSide:n("add_header"),children:h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("div",{className:"flex flex-1 justify-between items-center space-x-6",children:[h.jsx("div",{className:"flex-1",children:h.jsx(lt,{debounceTimeout:0,id:"header_key",placeholder:n("header_key"),value:c.key||"",onValueChange:S=>u({...c,key:S})})}),h.jsx("div",{className:"flex-1",children:h.jsx(lt,{debounceTimeout:0,id:"header_value",value:c.value||"",placeholder:n("header_value"),onValueChange:S=>u({...c,value:S})})}),h.jsx(PCn,{className:$t("focus:outline-none focus:ring-0 p-1.5 border rounded-md",{"cursor-pointer":!!c.key&&!!c.value,"cursor-not-allowed opacity-75":!c.key||!c.value}),onClick:()=>{!c.key||!c.value||(l(S=>({...S,[c.key]:c.value})),u({}))},style:{borderColor:t.$21},theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},children:h.jsx(nc,{size:"1.1rem",color:t.$3})})]}),h.jsxs("div",{className:"flex flex-col space-y-5 pt-5",children:[Object.entries(a).map(([S,k],I)=>h.jsxs("div",{className:"flex justify-between items-center space-x-4",children:[h.jsx("span",{className:"flex-1 text-start",children:S}),h.jsx("span",{className:"flex-1 text-start",children:k}),h.jsx("div",{className:"cursor-pointer",onClick:()=>y(S),children:h.jsx(c1,{color:t.$16,hoverColor:t.$3,borderColor:t.$5,hoverBorderColor:t.$17,size:"1.6rem"})})]},I)),!Object.entries(a).length&&h.jsx("span",{className:"text-gray-500 self-center text-xl",children:n("no_headers")})]})]})})]})})}function MCn(){const[n]=xe(),e=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("analytics"),href:"/settings/integrations/analytics"}];vr("analytics");const t=Fr(),i=xt(),r=zi(),s=Nr(),[o,a]=x.useState(),[l,c]=x.useState(!1);x.useEffect(()=>{t(ME({object:"company",data:r}))},[r]);const u=f=>{a(void 0),t(Uo({object:"company",property:f.target.id,value:f.target.value}))},d=()=>{l||(pe.processing(),c(!0),a(void 0),Je("PUT",ze("/api/v1/companies/:id",{id:s.id}),s).then(f=>{t(gk({object:"company",data:f.data.data})),t(zu("company")),pe.success("updated_settings")}).catch(f=>{var p;((p=f.response)==null?void 0:p.status)===422&&(a(f.response.data),pe.dismiss())}).finally(()=>c(!1)))};return h.jsx(Kr,{title:n("analytics"),breadcrumbs:e,onSaveClick:d,disableSaveButton:l,children:h.jsxs(er,{title:n("analytics"),className:"shadow-sm",style:{borderColor:i.$24},headerStyle:{borderColor:i.$20},children:[h.jsx(ne,{leftSide:h.jsxs("div",{className:"flex space-x-1",children:[h.jsx("span",{children:n("google_analytics_tracking_id")}),h.jsxs("div",{className:"flex",children:[h.jsx("span",{children:"("}),h.jsx(Ji,{to:"https://support.google.com/analytics/answer/1037249?hl=en",external:!0,withoutExternalIcon:!0,children:n("learn_more")}),h.jsx("span",{children:")"})]})]}),children:h.jsx(lt,{id:"google_analytics_key",value:s==null?void 0:s.google_analytics_key,onChange:u,errorMessage:o==null?void 0:o.errors.google_analytics_key})}),h.jsx(ne,{leftSide:n("matomo_id"),children:h.jsx(lt,{id:"matomo_id",value:s==null?void 0:s.matomo_id,onChange:u,errorMessage:o==null?void 0:o.errors.matomo_id})}),h.jsx(ne,{leftSide:n("matomo_url"),children:h.jsx(lt,{id:"matomo_url",value:s==null?void 0:s.matomo_url,onChange:u,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 Jit(){const[n,e]=x.useState([]),{data:t}=Zd();return x.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 ert(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 jCn(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 REe(n){const e=JSON.parse(n.config);return t=>e[t]||""}function trt(n,e){const t=REe(n),i=jCn(e),r=Lo();return(s,o,a)=>{var l;if(s.toLowerCase().endsWith("color"))return h.jsx(xw,{value:t(s)||r,onValueChange:c=>i(s,c)});if(s==="text")return h.jsx(dh,{value:t(s),onChange:c=>i(s,c)});if(s==="appleDomainVerification")return h.jsx(lt,{element:"textarea",onChange:c=>i(s,c.target.value),value:t(s),errorMessage:a==null?void 0:a.errors.appleDomainVerification});if(typeof o=="string"){const c=s.toLowerCase().includes("key")||s.toLowerCase().includes("password")||s.toLowerCase().includes("secret")||s.toLowerCase().includes("id");return h.jsx(lt,{type:c?"password":"text",onChange:u=>i(s,u.target.value),value:t(s),errorMessage:a==null?void 0:a.errors[s]})}if(typeof o=="boolean")return h.jsx(jt,{checked:t(s),onChange:c=>i(s,c)});if(typeof o=="object")return h.jsx(Dn,{value:(l=t(s))==null?void 0:l.toString(),onValueChange:c=>i(s,c),errorMessage:a==null?void 0:a.errors[s],customSelector:!0,children:o.map((c,u)=>h.jsx("option",{value:c==null?void 0:c.toString(),children:c},u))})}}function FCn(){const[n]=xe(),e=()=>{Je("POST",ze("/api/v1/one_time_token"),{context:"stripe_connect"}).then(t=>{var i;return(i=window.open(Ut("https://invoicing.co/stripe/signup/:token",{token:t.data.hash}),"_blank"))==null?void 0:i.focus()})};return h.jsx(ne,{children:h.jsx(dn,{onClick:e,type:"secondary",behavior:"button",children:n("gateway_setup")})})}function BCn(){const[n]=xe(),e=()=>{Je("POST",ze("/api/v1/one_time_token"),{context:"wepay"}).then(t=>{var i;return(i=window.open(Ut("https://invoicing.co/wepay/signup/:token",{token:t.data.hash}),"_blank"))==null?void 0:i.focus()})};return h.jsx(ne,{children:h.jsx(dn,{onClick:e,type:"secondary",behavior:"button",children:n("gateway_setup")})})}function $Cn(n){const[e]=xe(),t=()=>{Je("POST",ze("/api/v1/one_time_token"),{context:"paypal_ppcp"}).then(a=>{var l;return(l=window.open(Ut("https://invoicing.co/paypal?hash=:hash",{hash:a.data.hash}),"_blank"))==null?void 0:l.focus()})},i=REe(n.companyGateway),r=trt(n.companyGateway,n.setCompanyGateway),s=()=>{const a=i("status"),l=i("merchantId");return a==="activated"&&l},o=()=>i("merchantId").length>0;return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("status"),children:h.jsxs("ul",{className:"list-none",children:[h.jsxs("li",{children:[h.jsx("b",{children:"Merchant id:"})," ",i("merchantId")]}),h.jsxs("li",{children:[h.jsxs("b",{children:[e("status"),":"]})," ",i("status")]}),h.jsxs("li",{children:[h.jsxs("b",{children:[e("email"),":"]})," ",i("emailVerified")]}),h.jsxs("li",{children:[h.jsxs("b",{children:[e("permissions"),":"]})," ",i("permissions")]}),h.jsxs("li",{children:[h.jsxs("b",{children:[e("notifications"),":"]})," ",i("returnMessage")]})]})}),n.companyGateway&&!s()&&h.jsx(ne,{children:h.jsx(dn,{onClick:t,type:"minimal",behavior:"button",children:e("gateway_setup")})}),n.gateway&&o()&&Object.keys(JSON.parse(n.gateway.fields)).map((a,l)=>h.jsx(ne,{leftSide:ert(a),children:r(a,JSON.parse(n.gateway.fields)[a],n.errors)},l))]})}function nrt(n){const[e]=xe(),t=gc(),i=xt();Lo();const r=trt(n.companyGateway,n.setCompanyGateway);REe(n.companyGateway);const s="d14dd26a47cecc30fdd65700bfb67b34",o="8fdeed552015b3c7b44ed6c8ebd9e992",a="80af24a6a691230bbec33e930ab40666",l="b9886f9257f0c6ee7c302f1c74475f6c",c=[s,o,a],[u,d]=x.useState(!1),[f,p]=x.useState(""),[g,m]=x.useState(!1),_=()=>{u||(pe.processing(),d(!0),Je("POST",ze("/api/v1/company_gateways/:id/test",{id:n.companyGateway.id})).then(v=>{m(!0),p(v.data.message)}).finally(()=>{pe.dismiss(),d(!1)}))};return h.jsxs(h.Fragment,{children:[n.gateway.site_url&&n.gateway.site_url.length>=1&&h.jsx(ne,{leftSide:e("help"),children:h.jsx(Ji,{external:!0,to:n.gateway.site_url,children:e("learn_more")})}),n.gateway&&n.gateway.key===s&&h.jsx(FCn,{}),n.gateway&&n.gateway.key===o&&h.jsx(BCn,{}),n.gateway&&n.gateway.key===a&&h.jsx($Cn,{gateway:n.gateway,companyGateway:n.companyGateway,setCompanyGateway:n.setCompanyGateway,errors:n.errors}),n.gateway&&n.gateway.key===l&&To(),n.gateway&&!c.includes(n.gateway.key)&&Object.keys(JSON.parse(n.gateway.fields)).map((v,b)=>h.jsx(ne,{leftSide:ert(v),children:r(v,JSON.parse(n.gateway.fields)[v],n.errors)},b)),n.gateway&&n.gateway.key===l&&To(),!t.pathname.includes("/create")&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-4 sm:px-6 pt-2 pb-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:i.$20})}),h.jsx("div",{className:"flex justify-end pr-6",children:h.jsx(dn,{behavior:"button",onClick:_,disableWithoutIcon:!0,disabled:u||!n.isGatewaySaved,children:e("health_check")})})]}),h.jsx(pr,{title:e("status"),visible:g,onClose:()=>m(!1),children:h.jsx("span",{className:"text-center font-medium text-base pb-3",children:e(f&&f!=="false"?f:"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 HCn(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 Wa=(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))(Wa||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 VCn={[Wa.CreditCard]:"credit_card",[Wa.BankTransfer]:"bank_transfer",[Wa.PayPal]:"paypal",[Wa.Crypto]:"crypto",[Wa.Custom]:"custom",[Wa.Alipay]:"alipay",[Wa.Sofort]:"sofort",[Wa.ApplePay]:"apple_pay",[Wa.SEPA]:"sepa",[Wa.Credit]:"credit",[Wa.KBC]:"kbc",[Wa.Bancontact]:"bancontact",[Wa.IDeal]:"ideal",[Wa.Hosted]:"hosted",[Wa.Giropay]:"giropay",[Wa.Przelewy24]:"przelewy24",[Wa.DirectDebit]:"direct_debit",[Wa.EPS]:"eps",[Wa.ACSS]:"acss",[Wa.BECS]:"becs",[Wa.InstantBankPay]:"instant_bank_pay",[Wa.KLARNA]:"klarna",[Wa.BACS]:"bacs",[Wa.FPX]:"fpx",[Wa.VENMO]:"venmo",[Wa.MERCADOPAGO]:"mercadopago",[Wa.MYBANK]:"mybank",[Wa.PAYLATER]:"paylater",[Wa.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 irt(){return n=>VCn[n]||"other"}const WCn=Ls(void 0);function rrt(n){var d,f,p,g,m,_,v,b,y,C,S,k,I,L,N,P,O,F,V,M,B,W,q,U,G,H,z,Z,X;const[e]=xe(),t=xt(),i=zi(),[r,s]=oo(WCn),o=irt(),a=HCn(n.setCompanyGateway);x.useEffect(()=>{const oe=Object.entries(n.companyGateway.fees_and_limits).filter(([,fe])=>fe.is_enabled);typeof r<"u"&&oe.length>0||(oe.length>0?s(oe[0][0]):s(void 0))},[n.companyGateway]);const l=oe=>{s(oe)},c=(oe,fe)=>{r&&a(r,oe,fe)},u=()=>{var oe,fe;if(r){const{fee_tax_name1:Se,fee_tax_name2:Me,fee_tax_name3:Ie}=((fe=(oe=n.companyGateway)==null?void 0:oe.fees_and_limits)==null?void 0:fe[r])||{};if(i.enabled_item_tax_rates===0&&(Se||Me||Ie))return!0}return!1};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("payment_type"),children:h.jsx(Dn,{value:r,onValueChange:oe=>l(oe),errorMessage:(d=n.errors)==null?void 0:d.errors.gatewayTypeId,customSelector:!0,dismissable:!1,children:Object.entries(n.companyGateway.fees_and_limits).filter(([,oe])=>oe.is_enabled).map(([oe],fe)=>h.jsx("option",{value:oe,children:e(o(oe))},fe))})}),r&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:t.$20})}),h.jsx(ne,{leftSide:`${e("min")} ${e("limit")}`,children:h.jsxs("div",{className:"space-y-4",children:[h.jsx(Qs,{value:((p=(f=n.companyGateway.fees_and_limits)==null?void 0:f[r])==null?void 0:p.min_limit)||"",onValueChange:oe=>c("min_limit",parseFloat(oe)||-1),disabled:((m=(g=n.companyGateway.fees_and_limits)==null?void 0:g[r])==null?void 0:m.min_limit)===-1,errorMessage:(_=n.errors)==null?void 0:_.errors.min_limit}),h.jsx(jt,{checked:((b=(v=n.companyGateway.fees_and_limits)==null?void 0:v[r])==null?void 0:b.min_limit)>=0,label:e("enable_min"),onValueChange:oe=>c("min_limit",oe?0:-1)})]})}),h.jsx(ne,{leftSide:`${e("max")} ${e("limit")}`,children:h.jsxs("div",{className:"space-y-4",children:[h.jsx(Qs,{value:((C=(y=n.companyGateway.fees_and_limits)==null?void 0:y[r])==null?void 0:C.max_limit)||"",onValueChange:oe=>c("max_limit",parseFloat(oe)||-1),disabled:((k=(S=n.companyGateway.fees_and_limits)==null?void 0:S[r])==null?void 0:k.max_limit)===-1,errorMessage:(I=n.errors)==null?void 0:I.errors.max_limit}),h.jsx(jt,{checked:((N=(L=n.companyGateway.fees_and_limits)==null?void 0:L[r])==null?void 0:N.max_limit)>=0,label:e("enable_max"),onValueChange:oe=>c("max_limit",oe?0:-1)})]})}),h.jsx("div",{className:"px-4 sm:px-6 py-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:t.$20})}),h.jsx(ne,{leftSide:e("fee_percent"),children:h.jsx(Qs,{value:((O=(P=n.companyGateway.fees_and_limits)==null?void 0:P[r])==null?void 0:O.fee_percent)||"",onValueChange:oe=>c("fee_percent",parseFloat(oe)),errorMessage:(F=n.errors)==null?void 0:F.errors.fee_percent})}),h.jsx(ne,{leftSide:e("fee_amount"),children:h.jsx(Qs,{value:((M=(V=n.companyGateway.fees_and_limits)==null?void 0:V[r])==null?void 0:M.fee_amount)||"",onValueChange:oe=>c("fee_amount",parseFloat(oe)),errorMessage:(B=n.errors)==null?void 0:B.errors.fee_amount})}),u()&&h.jsxs("div",{className:"flex items-center space-x-3 px-6 py-2",children:[h.jsx("div",{children:h.jsx(an,{element:jC,size:20,color:"orange"})}),h.jsx("div",{className:"text-sm font-medium",children:_9(e("hidden_taxes_warning"),":link",()=>h.jsx(Ji,{to:"/settings/tax_settings",children:e("settings")}))})]}),i&&i.enabled_item_tax_rates>0&&h.jsx(ne,{leftSide:e("tax"),children:h.jsx(lw,{defaultValue:rE((W=n.companyGateway)==null?void 0:W.fees_and_limits[r],"fee_tax_name1"),onChange:oe=>{var fe,Se;c("fee_tax_name1",((fe=oe.resource)==null?void 0:fe.name)||""),c("fee_tax_rate1",((Se=oe.resource)==null?void 0:Se.rate)||0)},onClearButtonClick:()=>{c("fee_tax_name1",""),c("fee_tax_rate1",0)},onTaxCreated:oe=>{c("fee_tax_name1",oe.name),c("fee_tax_rate1",oe.rate)}})}),i&&i.enabled_item_tax_rates>1&&h.jsx(ne,{leftSide:e("tax"),children:h.jsx(lw,{defaultValue:rE((q=n.companyGateway)==null?void 0:q.fees_and_limits[r],"fee_tax_name2"),onChange:oe=>{var fe,Se;c("fee_tax_name2",((fe=oe.resource)==null?void 0:fe.name)||""),c("fee_tax_rate2",((Se=oe.resource)==null?void 0:Se.rate)||0)},onClearButtonClick:()=>{c("fee_tax_name2",""),c("fee_tax_rate2",0)},onTaxCreated:oe=>{c("fee_tax_name2",oe.name),c("fee_tax_rate2",oe.rate)}})}),i&&i.enabled_item_tax_rates>2&&h.jsx(ne,{leftSide:e("tax"),children:h.jsx(lw,{defaultValue:rE((U=n.companyGateway)==null?void 0:U.fees_and_limits[r],"fee_tax_name3"),onChange:oe=>{var fe,Se;c("fee_tax_name3",((fe=oe.resource)==null?void 0:fe.name)||""),c("fee_tax_rate3",((Se=oe.resource)==null?void 0:Se.rate)||0)},onClearButtonClick:()=>{c("fee_tax_name3",""),c("fee_tax_rate3",0)},onTaxCreated:oe=>{c("fee_tax_name3",oe.name),c("fee_tax_rate3",oe.rate)}})}),h.jsx(ne,{leftSide:e("fee_cap"),children:h.jsx(Qs,{value:((H=(G=n.companyGateway.fees_and_limits)==null?void 0:G[r])==null?void 0:H.fee_cap)||"",onValueChange:oe=>c("fee_cap",parseFloat(oe)),errorMessage:(z=n.errors)==null?void 0:z.errors.fee_cap})}),h.jsx(ne,{leftSide:e("adjust_fee_percent"),children:h.jsx(jt,{checked:(X=(Z=n.companyGateway.fees_and_limits)==null?void 0:Z[r])==null?void 0:X.adjust_fee_percent,label:e("adjust_fee_percent_help"),onValueChange:oe=>c("adjust_fee_percent",oe)})})]})]})}function srt(n){const[e]=xe(),t=xt(),i=(r,s)=>{n.setCompanyGateway(o=>o&&{...o,[r]:s})};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("client_name"),children:h.jsx(jt,{checked:n.companyGateway.require_client_name,onChange:r=>i("require_client_name",r)})}),h.jsx(ne,{leftSide:e("client_phone"),children:h.jsx(jt,{checked:n.companyGateway.require_client_phone,onChange:r=>i("require_client_phone",r)})}),h.jsx(ne,{leftSide:e("contact_name"),children:h.jsx(jt,{checked:n.companyGateway.require_contact_name,onChange:r=>i("require_contact_name",r)})}),h.jsx(ne,{leftSide:e("contact_email"),children:h.jsx(jt,{checked:n.companyGateway.require_contact_email,onChange:r=>i("require_contact_email",r)})}),h.jsx(ne,{leftSide:e("postal_code"),children:h.jsx(jt,{checked:n.companyGateway.require_postal_code,onChange:r=>i("require_postal_code",r)})}),h.jsx(ne,{leftSide:e("cvv"),children:h.jsx(jt,{checked:n.companyGateway.require_cvv,onChange:r=>i("require_cvv",r)})}),h.jsx(ne,{leftSide:e("billing_address"),children:h.jsx(jt,{checked:n.companyGateway.require_billing_address,onChange:r=>i("require_billing_address",r)})}),h.jsx(ne,{leftSide:e("shipping_address"),children:h.jsx(jt,{checked:n.companyGateway.require_shipping_address,onChange:r=>i("require_shipping_address",r)})}),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:t.$20})}),h.jsx(ne,{leftSide:e("update_address"),children:h.jsx(jt,{label:e("update_address_help"),checked:n.companyGateway.update_details,onChange:r=>i("update_details",r)})}),h.jsx(ne,{leftSide:e("always_show_required_fields"),children:h.jsx(jt,{label:e("always_show_required_fields_help"),checked:n.companyGateway.always_show_required_fields??!0,onChange:r=>i("always_show_required_fields",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 ort={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 zCn(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]:ort}})}}function art(n){var d,f;const[e]=xe(),t=xt(),[i,r]=x.useState(n.gateway),[s,o]=x.useState([]);x.useEffect(()=>r(n.gateway),[n.gateway]),x.useEffect(()=>{const p=[];for(const g in i.options)p.push({gatewayTypeId:g,...i.options[g]});o([...p])},[i]);const a=irt(),l=(p,g)=>{n.setCompanyGateway(m=>m&&{...m,[p]:g})},c=zCn(n.companyGateway,n.setCompanyGateway),u=p=>{const g=Object.entries(n.companyGateway.fees_and_limits).find(([_])=>p===_);if(!g)return!1;const[,m]=g;return m.is_enabled};return h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("label"),children:h.jsx(lt,{value:n.companyGateway.label||i.name,onValueChange:p=>l("label",p),errorMessage:(d=n.errors)==null?void 0:d.errors.label})}),s.some(p=>p.token_billing==!0)&&h.jsx(ne,{leftSide:e("tokenize"),leftSideHelp:e("tokenize_help"),children:h.jsxs(Dn,{value:n.companyGateway.token_billing||"off",onValueChange:p=>l("token_billing",p),errorMessage:(f=n.errors)==null?void 0:f.errors.token_billing,customSelector:!0,dismissable:!1,children:[h.jsx("option",{value:"always",children:e("enabled")}),h.jsx("option",{value:"optout",children:e("auto_bill_help_optout")}),h.jsx("option",{value:"optin",children:e("auto_bill_help_optin")}),h.jsx("option",{value:"off",children:e("off")})]})}),h.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-4",children:h.jsx(Ki,{className:"border-dashed",withoutPadding:!0,borderColor:t.$20})}),s.map((p,g)=>h.jsx(ne,{leftSide:e(a(p.gatewayTypeId)),...((i==null?void 0:i.key)==="d14dd26a37cecc30fdd65700bfb55b23"||(i==null?void 0:i.key)==="d14dd26a47cecc30fdd65700bfb67b34")&&{leftSideHelp:e(`${a(p.gatewayTypeId)}_stripe_help`)},children:h.jsx(jt,{checked:u(p.gatewayTypeId),onChange:m=>c(p.gatewayTypeId,m)})},g))]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function UCn({companyGateway:n,setErrors:e,isFormBusy:t,setIsFormBusy:i}){const r=Yi(),s=Vs(),o=ji(wu);return a=>{t||(pe.processing(),i(!0),e(void 0),Je("POST",ze("/api/v1/company_gateways"),n).then(l=>{o&&s.invalidateQueries([o]),ii(["company_gateways"]),pe.success("created_company_gateway"),r(Ut("/settings/gateways/:id/edit?tab=:defaultTabIndex",{id:l.data.data.id,defaultTabIndex:a}))}).catch(l=>{var c;((c=l==null?void 0:l.response)==null?void 0:c.status)===422&&(pe.dismiss(),e(l.response.data))}).finally(()=>i(!1)))}}const qCn="/gateway-card-images/visa.png",KCn="/gateway-card-images/authorize-net.png",GCn="/gateway-card-images/american-express.png",YCn="/gateway-card-images/mastercard.png",qle="/gateway-card-images/paypal.png",QCn="/gateway-card-images/braintree.svg.png",XCn="/gateway-card-images/checkout.jpg",ZCn="/gateway-card-images/gocardless.png",JCn="/gateway-card-images/mollie.png",ewn="/gateway-card-images/payfast.png",twn="/gateway-card-images/paytrace.svg",nwn="/gateway-card-images/razorpay.png",iwn="/gateway-card-images/square.svg.png",rwn="/gateway-card-images/stripe.svg",swn="/gateway-card-images/eway.png",own="/gateway-card-images/forte.png",awn="/gateway-card-images/wepay.svg",lwn="/gateway-card-images/btcpay.png",cwn="/gateway-card-images/blockonomics.svg",uwn=["paypal_ppcp","visa","american_express","mastercard","paypal_platform","authorize","braintree","checkoutcom","gocardless","mollie","payfast","paytrace","razorpay","square","stripe","wepay","eway","forte","paypal_rest","btcpay","blockonomics"];function Kpe(n){switch(n.name){case"visa":return h.jsx("img",{src:qCn,alt:"Visa",style:n.style||{width:30,height:30}});case"american_express":return h.jsx("img",{src:GCn,alt:"American Express",style:n.style||{width:30,height:30}});case"mastercard":return h.jsx("img",{src:YCn,alt:"Mastercard",style:n.style||{width:30,height:30}});case"paypal_platform":return h.jsx("img",{src:qle,alt:"PayPal",style:n.style||{width:40,height:40}});case"paypal_rest":return h.jsx("img",{src:qle,alt:"PayPal Rest",style:n.style||{width:40,height:40}});case"paypal_ppcp":return h.jsx("img",{src:qle,alt:"PayPal",style:n.style||{width:40,height:40}});case"authorize":return h.jsx("img",{src:KCn,alt:"AuthorizeNet",style:n.style||{width:40,height:40}});case"braintree":return h.jsx("img",{src:QCn,alt:"Braintree",style:n.style||{width:40,height:40}});case"checkoutcom":return h.jsx("img",{src:XCn,alt:"Checkoutcom",style:n.style||{width:40,height:40}});case"gocardless":return h.jsx("img",{src:ZCn,alt:"GoCardless",style:n.style||{width:40,height:40}});case"mollie":return h.jsx("img",{src:JCn,alt:"Mollie",style:n.style||{width:40,height:40}});case"payfast":return h.jsx("img",{src:ewn,alt:"Payfast",style:n.style||{width:40,height:40}});case"paytrace":return h.jsx("img",{src:twn,alt:"Paytrace",style:n.style||{width:40,height:40}});case"razorpay":return h.jsx("img",{src:nwn,alt:"Razorpay",style:n.style||{width:40,height:40}});case"square":return h.jsx("img",{src:iwn,alt:"Square",style:n.style||{width:40,height:40}});case"stripe":return h.jsx("img",{src:rwn,alt:"Stripe",style:n.style||{width:40,height:40}});case"eway":return h.jsx("img",{src:swn,alt:"Eway",style:n.style||{width:40,height:40}});case"forte":return h.jsx("img",{src:own,alt:"Forte",style:n.style||{width:40,height:40}});case"wepay":return h.jsx("img",{src:awn,alt:"Wepay",style:n.style||{width:30,height:30}});case"btcpay":return h.jsx("img",{src:lwn,alt:"BTCPay",style:n.style||{width:30,height:30}});case"blockonomics":return h.jsx("img",{src:cwn,alt:"Blockonomics",style:n.style||{width:30,height:30}});default:return h.jsx(h.Fragment,{})}}function dwn(n){const{t:e}=xe(),{visible:t,onConfirm:i,onCancel:r}=n;return h.jsx(pr,{title:e("existing_gateway"),visible:t,onClose:r,children:h.jsxs("div",{className:"flex flex-col space-y-5",children:[h.jsxs("div",{className:"flex items-center space-x-4",children:[h.jsx("div",{children:h.jsx(an,{element:Ihe,size:24})}),h.jsx("span",{className:"font-medium text-center",children:e("confirm_duplicate_gateway")})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx(dn,{behavior:"button",type:"secondary",onClick:r,children:e("no")}),h.jsx(dn,{onClick:i,children:e("yes")})]})]})})}const hwn=[{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},{name:"blockonomics",width:180}],fwn=[{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"},{name:"blockonomics",key:"wbhf02us6owgo7p4nfjd0ymssdshks4d"}];function pwn(){const[n]=xe(),{documentTitle:e}=vr("add_gateway"),t=[{name:n("settings"),href:"/settings"},{name:n("online_payments"),href:"/settings/online_payments"},{name:n("add_gateway"),href:"/settings/gateways/create"}],i=[n("payment_provider")],r=[n("credentials"),n("settings"),n("required_fields"),n("limits_and_fees")],s=Jit(),o=xt();Lo();const{data:a}=Xzt(),{data:l}=wxe({status:"active",perPage:"1000"}),[c,u]=x.useState(),[d,f]=x.useState(0),[p,g]=x.useState(),[m,_]=x.useState(i),[v,b]=x.useState(!1),[y,C]=x.useState(!1),[S,k]=x.useState(),[I,L]=x.useState([]),[N,P]=x.useState(!1),O=UCn({companyGateway:S,setErrors:g,setIsFormBusy:b,isFormBusy:v}),F=(G,H)=>{const z=s.find(X=>X.id===G),Z=z&&(l==null?void 0:l.data.data.some(X=>X.gateway_key===(z==null?void 0:z.key)));if(Z&&P(!0),u(z),(z==null?void 0:z.key)==="80af24a6a691230bbec33e930ab40666"&&!Z)return B();if((z==null?void 0:z.key)==="d14dd26a47cecc30fdd65700bfb67b34"&&!Z)return W();(z==null?void 0:z.key)==="b9886f9257f0c6ee7c302f1c74475f6c"&&To(),H&&G&&!Z&&f(1)},V=()=>{if((c==null?void 0:c.key)==="80af24a6a691230bbec33e930ab40666")return B();if((c==null?void 0:c.key)==="d14dd26a47cecc30fdd65700bfb67b34")return W();(c==null?void 0:c.key)==="b9886f9257f0c6ee7c302f1c74475f6c"&&To(),c&&!y&&f(1),P(!1)},M=()=>{u(void 0),P(!1),f(0),y&&C(!1)},B=()=>{Je("POST",ze("/api/v1/one_time_token"),{context:"paypal_ppcp"}).then(G=>{var H;return(H=window.open(Ut("https://invoicing.co/paypal?hash=:hash",{hash:G.data.hash}),"_blank"))==null?void 0:H.focus()})},W=()=>{Je("POST",ze("/api/v1/one_time_token"),{context:"stripe_connect"}).then(G=>{var H;return(H=window.open(Ut("https://invoicing.co/stripe/signup/:token",{token:G.data.hash}),"_blank"))==null?void 0:H.focus()})},q=G=>{const H=fwn.find(z=>z.key===G);return(H==null?void 0:H.name)||""},U=G=>{const H=hwn.find(z=>z.name===G);return H?H.width:void 0};return x.useEffect(()=>{if(s){const G=s.findIndex(({key:H})=>H==="80af24a6a691230bbec33e930ab40665");if(G>=0){const H=VSe(s,G,1);L(H)}else L(s)}},[s]),x.useEffect(()=>{a!=null&&a.data.data&&S===void 0&&k(a.data.data)},[a,c]),x.useEffect(()=>{k(z=>z&&c&&{...z,gateway_key:c.key,token_billing:"always"}),(c?Object.entries(c.options):[]).find(([z])=>z==="1")&&k(z=>z&&{...z,fees_and_limits:{...z.fees_and_limits,1:ort}})},[c]),x.useEffect(()=>{_(c?[...i,...r]:[...i])},[c]),x.useEffect(()=>{y&&!N&&(O(1),C(!1))},[S,N]),x.useEffect(()=>{if(!I.length)return;const G=I.findIndex(Z=>{var X;return(X=Z.name)==null?void 0:X.toLowerCase().includes("paypal")});if(G===-1||G===1)return;const H=[...I],[z]=H.splice(G,1);H.splice(1,0,z),L(H)},[I]),h.jsxs(Kr,{title:e,breadcrumbs:t,onSaveClick:()=>O(1),disableSaveButton:!c||v,children:[h.jsx(uEe,{id:"gateways",url:"https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source/en/gateways.md"}),h.jsx(dwn,{visible:N,onConfirm:V,onCancel:M}),h.jsx(er,{title:n("add_gateway"),className:"shadow-sm",style:{borderColor:o.$24},withoutBodyPadding:!0,withoutHeaderBorder:!0,topRight:h.jsxs(h.Fragment,{children:[d===1&&h.jsxs("button",{style:{color:"#0062FF"},type:"button",onClick:()=>KO("gateways",{moveToHeading:"Credentials"}),className:"inline-flex items-center space-x-1 text-sm",children:[h.jsx(aq,{size:18}),h.jsx("span",{children:n("documentation")})]}),d===3&&h.jsxs("button",{style:{color:"#0062FF"},type:"button",onClick:()=>KO("gateways",{moveToHeading:"Limits/Fees"}),className:"inline-flex items-center space-x-1 text-sm",children:[h.jsx(aq,{size:18}),h.jsx("span",{children:n("documentation")})]})]}),children:h.jsxs(Qb,{tabs:m,defaultTabIndex:d,withHorizontalPadding:!0,fullRightPadding:!0,horizontalPaddingWidth:"1.5rem",onTabChange:G=>f(G),children:[h.jsx("div",{children:h.jsx(ne,{leftSide:n("payment_provider"),children:h.jsx(Dn,{value:(c==null?void 0:c.id)||"",onValueChange:G=>F(G,!0),errorMessage:p==null?void 0:p.errors.gateway_key,customSelector:!0,withBlank:!0,children:I.map((G,H)=>h.jsx("option",{value:G.id,children:G.name},H))})})}),h.jsx("div",{children:c&&S&&h.jsx(nrt,{gateway:c,companyGateway:S,setCompanyGateway:k,errors:p})}),h.jsx("div",{children:c&&S&&h.jsx(art,{gateway:c,companyGateway:S,setCompanyGateway:k,errors:p})}),h.jsx("div",{children:c&&S&&h.jsx(srt,{gateway:c,companyGateway:S,setCompanyGateway:k})}),h.jsx("div",{children:c&&S&&h.jsx(rrt,{gateway:c,companyGateway:S,setCompanyGateway:k,errors:p})})]})}),!d&&h.jsx("div",{className:"flex flex-wrap gap-4",children:I.map((G,H)=>uwn.includes(q(G.key))&&h.jsx(er,{className:"w-52 shadow-sm",style:{borderColor:o.$24},children:h.jsxs("div",{className:"flex flex-col items-center justify-between h-52",children:[h.jsx("div",{className:"flex justify-center items-center border-b w-full h-28",style:{borderColor:o.$20},children:h.jsx(Kpe,{name:q(G.key),style:{width:U(q(G.key))||150}})}),h.jsxs("div",{className:$t("flex flex-col pt-4 flex-1",{"justify-between":G.site_url,"justify-end":!G.site_url}),children:[G.site_url&&h.jsx(Ji,{external:!0,to:G.site_url,children:n("website")}),h.jsx(dn,{behavior:"button",onClick:()=>{G.key!=="80af24a6a691230bbec33e930ab40666"&&C(!0),F(G.id)},children:n("setup")})]})]})},H))})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function gwn({companyGateway:n,setErrors:e,setIsFormBusy:t,isFormBusy:i}){return()=>{!n||i||(e(void 0),pe.processing(),t(!0),Je("PUT",ze("/api/v1/company_gateways/:id",{id:n==null?void 0:n.id}),n).then(()=>{pe.success("updated_company_gateway"),ii(["company_gateways"])}).catch(r=>{var s;((s=r==null?void 0:r.response)==null?void 0:s.status)===422&&(pe.dismiss(),e(r.response.data))}).finally(()=>t(!1)))}}function mwn(){const[n]=xe(),[e,t]=x.useState(!1),i=Wm(),r=(s,o)=>{pe.processing(),Je("post",ze("/api/v1/stripe/import_customers"),{},{headers:{"X-Api-Password":s}}).then(()=>pe.success("imported_customers")).catch(a=>{var l;((l=a.response)==null?void 0:l.status)===412&&(i(o),t(!0))})};return h.jsxs(h.Fragment,{children:[h.jsx(er,{title:n("import_customers"),children:h.jsx(zm,{onClick:()=>t(!0),children:n("click_to_continue")})}),h.jsx(wg,{onSave:r,show:e,onClose:t})]})}function _wn(n){const[e]=xe(),t=zi(),{companyGateway:i}=n;return i.gateway_key===xet&&To(),h.jsxs(er,{title:e("webhooks"),children:[h.jsx(ne,{leftSide:e("webhook_url"),children:h.jsx(Tc,{className:"break-all",text:`${YM()}/payment_webhook/${t.company_key}/${n.companyGateway.id}`})}),h.jsx(ne,{leftSide:e("supported_events"),children:h.jsx("ul",{className:"list-disc",children:ql(Object.values(n.gateway.options)).pluck("webhooks").flatten().unique().whereNotNull().all().sort().map((r,s)=>h.jsx("li",{children:r},s))})})]})}function vwn(){const[n]=xe(),e=OQe(),t=s=>{pe.processing(),Je("POST",ze("/api/v1/company_gateways/:id/import_customers",{id:s})).then(o=>pe.success(o.data.message))},i=s=>{pe.processing(),Je("POST",ze("/api/v1/company_gateways/:id/clone",{id:s})).then(o=>{pe.success(o.data.message),ii(["company_gateways"]);const a=Vs(),l=ji(wu);l&&a.invalidateQueries([l])})};return[s=>h.jsx($n,{onClick:()=>t(s.id),icon:h.jsx(an,{element:rTt}),children:n("import_customers")}),s=>h.jsx($n,{onClick:()=>i(s.id),icon:h.jsx(an,{element:Pb}),children:n("clone")}),()=>h.jsx(Ki,{withoutPadding:!0}),s=>hs(s)===Vr.Active&&h.jsx($n,{onClick:()=>e([s.id],"archive"),icon:h.jsx(an,{element:yu}),children:n("archive")}),s=>(hs(s)===Vr.Archived||hs(s)===Vr.Deleted)&&h.jsx($n,{onClick:()=>e([s.id],"restore"),icon:h.jsx(an,{element:bu}),children:n("restore")}),s=>(hs(s)===Vr.Active||hs(s)===Vr.Archived)&&h.jsx($n,{onClick:()=>e([s.id],"delete"),icon:h.jsx(an,{element:fc}),children:n("delete")})]}function bwn(){const{documentTitle:n}=vr("edit_gateway"),[e]=xe(),[t]=qB(),{id:i}=Yl(),r=vwn(),s=Jit(),o=xt(),a=Lo(),{data:l}=Qzt({id:i}),c=[e("payment_provider")],[u,d]=x.useState(),[f,p]=x.useState(Number(t.get("tab"))??0),[g,m]=x.useState(),[_,v]=x.useState(c),[b,y]=x.useState(!1),[C,S]=x.useState(),k=[e("credentials"),e("settings"),e("required_fields"),e("limits_and_fees")],I=[{name:e("settings"),href:"/settings"},{name:e("online_payments"),href:"/settings/online_payments"},{name:(C==null?void 0:C.label)??"",href:Ut("/settings/gateways/:id/edit",{id:i})}],L=gwn({companyGateway:C,setErrors:m,setIsFormBusy:y,isFormBusy:b});return x.useEffect(()=>{C&&d(s.find(N=>N.key==C.gateway_key))},[C,s]),x.useEffect(()=>{l!=null&&l.data.data&&S(l.data.data)},[l]),x.useEffect(()=>()=>{S(void 0)},[]),x.useEffect(()=>{v(u?[...c,...k]:[...c])},[u]),h.jsxs(Kr,{title:n,breadcrumbs:I,navigationTopRight:C&&h.jsx(Kw,{resource:C,onSaveClick:L,actions:r}),children:[h.jsx(uEe,{id:"gateways",url:"https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source/en/gateways.md"}),h.jsx(er,{title:e("edit_gateway"),className:"shadow-sm",style:{borderColor:o.$24},withoutBodyPadding:!0,withoutHeaderBorder:!0,topRight:h.jsxs(h.Fragment,{children:[f===1&&h.jsxs("button",{style:{color:a},type:"button",onClick:()=>KO("gateways",{moveToHeading:"Credentials"}),className:"inline-flex items-center space-x-1 text-sm",children:[h.jsx(kq,{color:a,size:"1.3rem"}),h.jsx("span",{children:e("documentation")})]}),f===3&&h.jsxs("button",{style:{color:a},type:"button",onClick:()=>KO("gateways",{moveToHeading:"Limits/Fees"}),className:"inline-flex items-center space-x-1 text-sm",children:[h.jsx(kq,{color:a,size:"1.3rem"}),h.jsx("span",{children:e("documentation")})]})]}),children:h.jsxs(Qb,{tabs:_,defaultTabIndex:f,withHorizontalPadding:!0,fullRightPadding:!0,horizontalPaddingWidth:"1.5rem",onTabChange:N=>p(N),children:[h.jsx("div",{children:C&&h.jsxs("div",{className:"space-y-4",children:[h.jsx(ne,{leftSide:e("payment_provider"),children:C.label}),(u==null?void 0:u.key)==="d14dd26a37cecc30fdd65700bfb55b23"?h.jsx(mwn,{}):null,u&&ql(Object.values(u.options)).pluck("webhooks").flatten().unique().whereNotNull().count()>=1&&h.jsx(_wn,{companyGateway:C,gateway:u})]})}),h.jsx("div",{children:u&&C&&h.jsx(nrt,{gateway:u,companyGateway:C,setCompanyGateway:S,errors:g,isGatewaySaved:!!(l&&pn.isEqual(C,l.data.data))})}),h.jsx("div",{children:u&&C&&h.jsx(art,{gateway:u,companyGateway:C,setCompanyGateway:S,errors:g})}),h.jsx("div",{children:u&&C&&h.jsx(srt,{gateway:u,companyGateway:C,setCompanyGateway:S})}),h.jsx("div",{children:u&&C&&h.jsx(rrt,{gateway:u,companyGateway:C,setCompanyGateway:S,errors:g})})]})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function qg(){return({settingsLevel:n})=>Promise.resolve(n===NF.Company)}const ywn=x.lazy(()=>ue(()=>import("./InvoiceDesign-Co2ip6ft.js"),__vite__mapDeps([97,98,35]))),Cwn=x.lazy(()=>ue(()=>import("./GeneralSettings-BYdlonyH.js"),__vite__mapDeps([99,45,98,100]))),wwn=x.lazy(()=>ue(()=>import("./CustomDesigns-MoPfdA66.js"),[])),xwn=x.lazy(()=>ue(()=>import("./Create-CV9qh_Sx.js"),__vite__mapDeps([101,44,45]))),Swn=x.lazy(()=>ue(()=>import("./ClientDetails-GW1y93bc.js"),__vite__mapDeps([102,103]))),Ewn=x.lazy(()=>ue(()=>import("./CompanyDetails-CmJclcbm.js"),__vite__mapDeps([104,103]))),kwn=x.lazy(()=>ue(()=>import("./CompanyAddress-s1CM1mZr.js"),__vite__mapDeps([105,103]))),Twn=x.lazy(()=>ue(()=>import("./InvoiceDetails-Bo2ITW3D.js"),__vite__mapDeps([106,103]))),Iwn=x.lazy(()=>ue(()=>import("./QuoteDetails-2N8o-obg.js"),__vite__mapDeps([107,103]))),Lwn=x.lazy(()=>ue(()=>import("./CreditDetails-Br-cOJhr.js"),__vite__mapDeps([108,103]))),Awn=x.lazy(()=>ue(()=>import("./VendorDetails-CPbVKkGI.js"),__vite__mapDeps([109,103]))),Nwn=x.lazy(()=>ue(()=>import("./PurchaseOrderDetails-D4y37R3k.js"),__vite__mapDeps([110,103]))),Dwn=x.lazy(()=>ue(()=>import("./ProductColumns-CibzypHy.js"),__vite__mapDeps([111,103,100]))),Rwn=x.lazy(()=>ue(()=>import("./ProductQuoteColumns-B6NOeImC.js"),__vite__mapDeps([112,103]))),Pwn=x.lazy(()=>ue(()=>import("./TaskColumns-Dv9wbx98.js"),__vite__mapDeps([113,103]))),Own=x.lazy(()=>ue(()=>import("./TotalFields-ux6Q4zY5.js"),__vite__mapDeps([114,103]))),Mwn=x.lazy(()=>ue(()=>import("./CustomDesign-CMRjO40Q.js"),__vite__mapDeps([115,45,35,116,117]))),jwn=x.lazy(()=>ue(()=>import("./Settings-5d6Om5mh.js"),__vite__mapDeps([118,44,45,119,101,7]))),Fwn=x.lazy(()=>ue(()=>import("./Body-BVOOYmAn.js"),__vite__mapDeps([120,119]))),Bwn=x.lazy(()=>ue(()=>import("./Headers-Bkv7zEGp.js"),__vite__mapDeps([121,119]))),$wn=x.lazy(()=>ue(()=>import("./Footer-ogxSWwfe.js"),__vite__mapDeps([122,119]))),Hwn=x.lazy(()=>ue(()=>import("./Includes-CSmiLJ7k.js"),__vite__mapDeps([123,119]))),Vwn=x.lazy(()=>ue(()=>import("./Variables-BpQhQFgU.js"),[])),Wwn=h.jsxs(Ee,{path:"invoice_design",element:h.jsx(ywn,{}),children:[h.jsx(Ee,{path:"",element:h.jsx(Cwn,{})}),h.jsx(Ee,{path:"custom_designs",element:h.jsx(wwn,{})}),h.jsxs(Ee,{path:"custom_designs/:id/edit",element:h.jsx(Si,{guards:[qg()],component:h.jsx(Mwn,{}),type:"subPage"}),children:[h.jsx(Ee,{path:"",element:h.jsx(jwn,{})}),h.jsx(Ee,{path:"body",element:h.jsx(Fwn,{})}),h.jsx(Ee,{path:"header",element:h.jsx(Bwn,{})}),h.jsx(Ee,{path:"footer",element:h.jsx($wn,{})}),h.jsx(Ee,{path:"includes",element:h.jsx(Hwn,{})}),h.jsx(Ee,{path:"variables",element:h.jsx(Vwn,{})})]}),h.jsx(Ee,{path:"custom_designs/create",element:h.jsx(xwn,{})}),h.jsx(Ee,{path:"client_details",element:h.jsx(Si,{guards:[qg()],component:h.jsx(Swn,{}),type:"subPage"})}),h.jsx(Ee,{path:"company_details",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Ewn,{}),type:"subPage"})}),h.jsx(Ee,{path:"company_address",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(kwn,{}),type:"subPage"})}),h.jsx(Ee,{path:"invoice_details",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Twn,{}),type:"subPage"})}),h.jsx(Ee,{path:"quote_details",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Iwn,{}),type:"subPage"})}),h.jsx(Ee,{path:"credit_details",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Lwn,{}),type:"subPage"})}),h.jsx(Ee,{path:"vendor_details",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Awn,{}),type:"subPage"})}),h.jsx(Ee,{path:"purchase_order_details",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Nwn,{}),type:"subPage"})}),h.jsx(Ee,{path:"product_columns",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Dwn,{}),type:"subPage"})}),h.jsx(Ee,{path:"quote_product_columns",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Rwn,{}),type:"subPage"})}),h.jsx(Ee,{path:"task_columns",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Pwn,{}),type:"subPage"})}),h.jsx(Ee,{path:"total_fields",element:h.jsx(Si,{guards:[qg(),dr(il(),il())],component:h.jsx(Own,{}),type:"subPage"})})]}),zwn=h.jsxs(Ee,{path:"/settings",children:[h.jsxs(Ee,{path:"user_details",element:h.jsx(tJt,{}),children:[h.jsx(Ee,{path:"",element:h.jsx(lZt,{})}),h.jsx(Ee,{path:"password",element:h.jsx(dZt,{})}),h.jsx(Ee,{path:"connect",element:h.jsx(GXt,{})}),h.jsx(Ee,{path:"accent_color",element:h.jsx(lGt,{})}),h.jsx(Ee,{path:"notifications",element:h.jsx(uZt,{})}),h.jsx(Ee,{path:"enable_two_factor",element:h.jsx(wZt,{})}),h.jsx(Ee,{path:"custom_fields",element:h.jsx(xZt,{})}),h.jsx(Ee,{path:"preferences",element:h.jsx(JZt,{})})]}),h.jsxs(Ee,{element:h.jsx(Si,{guards:[mR()],component:h.jsx(Hm,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(PKt,{})}),h.jsxs(Ee,{path:"company_details",element:h.jsx(HKt,{}),children:[h.jsx(Ee,{path:"",element:h.jsx(pCn,{})}),h.jsx(Ee,{path:"address",element:h.jsx(hCn,{})}),h.jsx(Ee,{path:"logo",element:h.jsx(Qit,{})}),h.jsx(Ee,{path:"defaults",element:h.jsx(fCn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(dCn,{})}),h.jsx(Ee,{path:"custom_fields",element:h.jsx(gCn,{})})]}),h.jsxs(Ee,{path:"localization",element:h.jsx(sJt,{}),children:[h.jsx(Ee,{path:"",element:h.jsx(iJt,{})}),h.jsx(Ee,{path:"custom_labels",element:h.jsx(nJt,{})})]}),h.jsx(Ee,{path:"online_payments",element:h.jsx(rrn,{})}),h.jsx(Ee,{path:"tax_settings",element:h.jsx(Gdn,{})}),h.jsx(Ee,{path:"product_settings",element:h.jsx(Ydn,{})}),h.jsx(Ee,{path:"task_settings",element:h.jsx(Qdn,{})}),h.jsx(Ee,{path:"expense_settings",element:h.jsx(hhn,{})}),h.jsx(Ee,{path:"workflow_settings",element:h.jsx(mhn,{})}),h.jsx(Ee,{path:"import_export",element:h.jsx(vfn,{})}),h.jsxs(Ee,{path:"account_management",element:h.jsx(yfn,{}),children:[h.jsx(Ee,{path:"",element:h.jsx(SVt,{})}),h.jsx(Ee,{path:"overview",element:h.jsx(xVt,{})}),h.jsx(Ee,{path:"enabled_modules",element:h.jsx(M5t,{})}),h.jsx(Ee,{path:"integrations",element:h.jsx(H5t,{})}),h.jsx(Ee,{path:"security_settings",element:h.jsx(EVt,{})}),h.jsx(Ee,{path:"referral_program",element:h.jsx(IVt,{})}),!bw()&&h.jsx(Ee,{path:"danger_zone",element:h.jsx(TVt,{})})]}),h.jsxs(Ee,{path:"backup_restore",element:h.jsx(Tbn,{}),children:[h.jsx(Ee,{path:"",element:h.jsx(jbn,{})}),h.jsx(Ee,{path:"restore",element:h.jsx(Mbn,{})})]}),h.jsxs(Ee,{path:"custom_fields",element:h.jsx(Cfn,{}),children:[h.jsx(Ee,{path:"company",element:h.jsx(wfn,{})}),h.jsx(Ee,{path:"clients",element:h.jsx(xfn,{})}),h.jsx(Ee,{path:"products",element:h.jsx(Sfn,{})}),h.jsx(Ee,{path:"invoices",element:h.jsx(Tfn,{})}),h.jsx(Ee,{path:"payments",element:h.jsx(Ifn,{})}),h.jsx(Ee,{path:"projects",element:h.jsx(Lfn,{})}),h.jsx(Ee,{path:"tasks",element:h.jsx(Afn,{})}),h.jsx(Ee,{path:"vendors",element:h.jsx(Nfn,{})}),h.jsx(Ee,{path:"expenses",element:h.jsx(Dfn,{})}),h.jsx(Ee,{path:"users",element:h.jsx(Rfn,{})})]}),h.jsxs(Ee,{path:"generated_numbers",element:h.jsx(Ofn,{}),children:[h.jsx(Ee,{path:"",element:h.jsx(Qfn,{})}),h.jsx(Ee,{path:"clients",element:h.jsx(Mfn,{})}),h.jsx(Ee,{path:"invoices",element:h.jsx(jfn,{})}),h.jsx(Ee,{path:"recurring_invoices",element:h.jsx(Ffn,{})}),h.jsx(Ee,{path:"payments",element:h.jsx(Bfn,{})}),h.jsx(Ee,{path:"quotes",element:h.jsx($fn,{})}),h.jsx(Ee,{path:"credits",element:h.jsx(Hfn,{})}),h.jsx(Ee,{path:"projects",element:h.jsx(Vfn,{})}),h.jsx(Ee,{path:"tasks",element:h.jsx(Wfn,{})}),h.jsx(Ee,{path:"vendors",element:h.jsx(zfn,{})}),h.jsx(Ee,{path:"purchase_orders",element:h.jsx(Ufn,{})}),h.jsx(Ee,{path:"expenses",element:h.jsx(qfn,{})}),h.jsx(Ee,{path:"recurring_expenses",element:h.jsx(Kfn,{})})]}),h.jsxs(Ee,{path:"client_portal",element:h.jsx(bpn,{}),children:[h.jsx(Ee,{path:"",element:h.jsx(fpn,{})}),h.jsx(Ee,{path:"authorization",element:h.jsx(ppn,{})}),h.jsx(Ee,{path:"registration",element:h.jsx(_pn,{})}),h.jsx(Ee,{path:"messages",element:h.jsx(mpn,{})}),h.jsx(Ee,{path:"customize",element:h.jsx(gpn,{})})]}),h.jsx(Ee,{path:"e_invoice",element:h.jsx(opn,{})}),h.jsx(Ee,{path:"email_settings",element:h.jsx(hpn,{})}),h.jsx(Ee,{path:"templates_and_reminders",element:h.jsx(xpn,{})}),h.jsxs(Ee,{path:"bank_accounts",children:[h.jsx(Ee,{path:"",element:h.jsx(Ipn,{})}),h.jsx(Ee,{path:":id/details",element:h.jsx(Dpn,{})}),h.jsx(Ee,{path:"create",element:h.jsx(Apn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(Lpn,{})})]}),h.jsxs(Ee,{path:"group_settings",children:[h.jsx(Ee,{path:"",element:h.jsx(N1n,{})}),h.jsx(Ee,{path:"create",element:h.jsx(R1n,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(q1n,{})})]}),h.jsxs(Ee,{path:"subscriptions",children:[h.jsx(Ee,{path:"",element:h.jsx(Jpn,{})}),h.jsx(Ee,{path:"create",element:h.jsx(ogn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(lgn,{})})]}),h.jsxs(Ee,{path:"schedules",children:[h.jsx(Ee,{path:"",element:h.jsx(vbn,{})}),h.jsx(Ee,{path:"create",element:h.jsx(xbn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(Ebn,{})})]}),h.jsxs(Ee,{path:"users",children:[h.jsx(Ee,{path:"",element:h.jsx(K1n,{})}),h.jsx(Ee,{path:"create",element:h.jsx(Q1n,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(Si,{guards:[il()],component:h.jsx(Y1n,{})})})]}),h.jsx(Ee,{path:"/settings/system_logs",children:h.jsx(Ee,{path:"",element:h.jsx(A1n,{})})}),h.jsxs(Ee,{path:"payment_terms",children:[h.jsx(Ee,{path:"",element:h.jsx(rCn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(iCn,{})}),h.jsx(Ee,{path:"create",element:h.jsx(Z1n,{})})]}),h.jsxs(Ee,{path:"tax_rates",children:[h.jsx(Ee,{path:"create",element:h.jsx(lCn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(uCn,{})})]}),h.jsxs(Ee,{path:"task_statuses",children:[h.jsx(Ee,{path:"create",element:h.jsx(_Cn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(vCn,{})})]}),h.jsxs(Ee,{path:"expense_categories",children:[h.jsx(Ee,{path:"create",element:h.jsx(chn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(dhn,{})})]}),h.jsxs(Ee,{path:"integrations",children:[h.jsxs(Ee,{path:"api_tokens",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[dr(il(),il()),mR()],component:h.jsx(bCn,{})})}),h.jsx(Ee,{path:"create",element:h.jsx(Si,{guards:[dr(il(),il()),mR()],component:h.jsx(xCn,{})})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(Si,{guards:[dr(il(),il()),mR()],component:h.jsx(ECn,{})})})]}),h.jsxs(Ee,{path:"api_webhooks",children:[h.jsx(Ee,{path:"",element:h.jsx(TCn,{})}),h.jsx(Ee,{path:"create",element:h.jsx(DCn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(OCn,{})})]}),h.jsx(Ee,{path:"analytics",element:h.jsx(MCn,{})})]}),h.jsxs(Ee,{path:"gateways",children:[h.jsx(Ee,{path:"create",element:h.jsx(pwn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(bwn,{})})]}),h.jsxs(Ee,{path:"bank_accounts/transaction_rules",children:[h.jsx(Ee,{path:"",element:h.jsx(Ppn,{})}),h.jsx(Ee,{path:"create",element:h.jsx(Ypn,{})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(Qpn,{})})]}),Wwn]})]});function Uwn(){return h.jsx(OE,{to:"/"})}function qwn(){return vCe()?h.jsx(OE,{to:"/dashboard"}):h.jsx(Hm,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function lrt(){const n=Fr();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(s=>s.company.id===r),t===-1&&(t=0),n(HB({type:ZM.TOKEN,user:e.data.data[t].user,token:e.data.data[t].token.token})),n(s1(e.data.data)),n(zu("company")),n(SZ(t))}}const Kwn="",Gwn="";function Ywn(){const n=Yi(),e=lrt();return x.useEffect(()=>{if(!bw())return n("/login");Je("POST",ze("/api/v1/login"),{email:Kwn,password:Gwn}).then(t=>e(t)).catch(()=>n("/login"))},[]),h.jsx("div",{})}const Kle=As.a` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function Qwn(){const n=xt();return h.jsxs("div",{className:"grid grid-cols-3 text-sm border rounded",style:{backgroundColor:n.$1,borderColor:n.$5,color:n.$3},children:[h.jsx("div",{className:"col-span-3 md:col-span-1",children:h.jsxs(Kle,{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:[h.jsx(DCe,{size:15}),h.jsx("span",{className:"m-1",children:"Check status"})]})}),h.jsx("div",{className:"col-span-3 md:col-span-1",children:h.jsxs(Kle,{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:[h.jsx(MCe,{size:15}),h.jsx("span",{className:"m-1",children:"Applications"})]})}),h.jsx("div",{className:"col-span-3 md:col-span-1",children:h.jsxs(Kle,{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:[h.jsx(xCe,{size:15}),h.jsx("span",{className:"m-1",children:"Documentation"})]})})]})}const Xwn="/invoiceninja-logo@dark-NBnSUBp5.png";function PEe(){return h.jsx(h.Fragment,{children:h.jsx("div",{className:"flex justify-center py-8",children:h.jsx(Ji,{to:"/",children:h.jsx("img",{src:Xwn,alt:"Invoice Ninja Logo",className:"h-12"})})})})}function Zwn(n){const[e]=xe(),{visible:t,setVisible:i}=n,[r,s]=x.useState(""),[o,a]=x.useState(""),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[f,p]=x.useState(),[g,m]=x.useState(!1),_=()=>{pe.processing(),c(!0),Je("POST",ze("/api/v1/sms_reset"),{email:r}).then(b=>{pe.success(b.data.message),i(!1),m(!0)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(p(b.response.data),pe.dismiss())}).finally(()=>c(!1))},v=()=>{pe.processing(),d(!0),Je("POST",ze("/api/v1/sms_reset/confirm"),{email:r,code:o}).then(b=>{pe.success(b.data.message),a(""),s(""),m(!1)}).finally(()=>d(!1))};return h.jsxs(h.Fragment,{children:[h.jsx(pr,{title:e("disable_2fa"),visible:t,onClose:()=>{i(!1),s("")},children:h.jsxs("div",{className:"flex flex-col space-y-6",children:[h.jsx(lt,{label:e("email"),value:r,onValueChange:b=>{s(b),f&&p(void 0)},errorMessage:f==null?void 0:f.errors.email}),h.jsx(dn,{className:"self-end",onClick:_,disableWithoutIcon:!0,disabled:!r||l,children:e("send_code")})]})}),h.jsx(pr,{title:e("disable_two_factor"),visible:g,onClose:()=>{m(!1),a(""),s("")},children:h.jsxs("div",{className:"flex flex-col space-y-7 items-center",children:[h.jsx($Qe,{onComplete:a}),h.jsxs("div",{className:"flex self-end space-x-5",children:[h.jsx(dn,{type:"minimal",onClick:_,disableWithoutIcon:!0,disabled:l||u,children:e("resend_code")}),h.jsx(dn,{onClick:v,disableWithoutIcon:!0,disabled:l||u||o.length!==6,children:e("verify")})]})]})})]})}const Jwn=" Latest Build - 2025-09-29";/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 exn=`v${Jwn}`;function txn(){vr("login"),Lo();const[n,e]=x.useState(void 0),[t,i]=x.useState(void 0),[r,s]=x.useState(!1),[o]=xe(),[a,l]=x.useState(!1),c=lrt();function u(f){const p=new FormData(f);e(void 0),i(void 0),s(!0);const g=p.get("secret");Je("POST",ze("/api/v1/login"),Object.fromEntries(p),{...g&&{headers:{"X-API-SECRET":g}}}).then(m=>c(m)).catch(m=>{var _,v,b;((_=m.response)==null?void 0:_.status)===422?i(m.response.data.errors):((v=m.response)==null?void 0:v.status)===503?pe.error("app_maintenance"):e(((b=m.response)==null?void 0:b.data.message)??o("invalid_credentials"))}).finally(()=>s(!1))}const d=xt();return h.jsxs("div",{className:"h-screen",children:[h.jsx(PEe,{}),h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:d.$1,borderColor:d.$5},children:[h.jsx("h2",{className:"text-2xl",style:{color:d.$3},children:o("login")}),h.jsxs("form",{onSubmit:f=>{f.preventDefault(),u(f.currentTarget)},className:"my-6 space-y-4",children:[h.jsx(lt,{type:"email",autoComplete:"username",label:o("email_address"),errorMessage:t==null?void 0:t.email,name:"email"}),h.jsx(lt,{type:"password",autoComplete:"current-password",label:o("password"),id:"password",errorMessage:t==null?void 0:t.password,name:"password"}),h.jsx("div",{className:"space-y-2",children:h.jsxs("div",{className:"flex flex-col lg:flex-row items-center justify-between",children:[h.jsx(Lh,{children:`2FA - ${o("one_time_password")}`}),h.jsx(Ji,{to:"/recover_password",children:o("forgot_password")})]})}),h.jsx(lt,{type:"text",autoComplete:"one-time-code",id:"one_time_password",placeholder:o("plaid_optional"),errorMessage:t==null?void 0:t.one_time_password,name:"one_time_password"}),h.jsx("div",{className:"space-y-2",children:h.jsxs("div",{className:$t("flex flex-col lg:flex-row items-center",{"justify-between":UB(),"justify-end":To()}),children:[h.jsx(Lh,{children:o("secret")}),To()]})}),h.jsx(lt,{type:"password",autoComplete:"on",placeholder:o("plaid_optional"),name:"secret"}),h.jsx(Kl,{className:"mt-4",children:n}),h.jsx(dn,{disabled:r,className:"mt-4",variant:"block",children:o("login")})]}),h.jsx("div",{className:"flex justify-center",children:To()})]}),To(),h.jsx("p",{className:"mt-4 text-xs",children:exn})]}),h.jsx(Zwn,{visible:a,setVisible:l})]})}function nxn(){const n=Vs();return x.useEffect(()=>{hCe(),sessionStorage.clear(),n.invalidateQueries(),n.removeQueries(),window.location.href="/"},[]),h.jsx(h.Fragment,{})}function ixn(){var c;vr("recover_password");const[n]=xe(),[e,t]=x.useState(!1),[i,r]=x.useState(void 0),[s,o]=x.useState(void 0),a=fd({initialValues:{email:""},onSubmit:u=>{t(!0),o(void 0),r(void 0),Je("POST",ze("/api/v1/reset_password"),u).then(d=>r(d.data)).catch(d=>{var f,p,g;return((f=d.response)==null?void 0:f.status)===422?o((p=d.response)==null?void 0:p.data.errors):r((g=d.response)==null?void 0:g.data)}).finally(()=>t(!1))}}),l=xt();return h.jsxs("div",{className:"h-screen",children:[h.jsx(PEe,{}),h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:l.$1,borderColor:l.$5},children:[h.jsx("h2",{className:"text-2xl",style:{color:l.$3},children:n("recover_password")}),h.jsxs("form",{onSubmit:a.handleSubmit,className:"my-6",children:[h.jsx(lt,{type:"email",label:n("email_address"),id:"email",onChange:a.handleChange}),h.jsx(Kl,{className:"mt-2",children:(c=s==null?void 0:s.errors)==null?void 0:c.email}),h.jsx(Kl,{className:"mt-4",children:i==null?void 0:i.message}),h.jsx(dn,{disabled:e,className:"mt-4",variant:"block",children:n("send_email")})]}),h.jsx("div",{className:"flex justify-center",children:To()})]}),To()]})]})}var y_={},AFe;function rxn(){if(AFe)return y_;AFe=1;var n=y_&&y_.__createBinding||(Object.create?function(f,p,g,m){m===void 0&&(m=g);var _=Object.getOwnPropertyDescriptor(p,g);(!_||("get"in _?!p.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return p[g]}}),Object.defineProperty(f,m,_)}:function(f,p,g,m){m===void 0&&(m=g),f[m]=p[g]}),e=y_&&y_.__setModuleDefault||(Object.create?function(f,p){Object.defineProperty(f,"default",{enumerable:!0,value:p})}:function(f,p){f.default=p}),t=y_&&y_.__importStar||function(f){if(f&&f.__esModule)return f;var p={};if(f!=null)for(var g in f)g!=="default"&&Object.prototype.hasOwnProperty.call(f,g)&&n(p,f,g);return e(p,f),p};Object.defineProperty(y_,"__esModule",{value:!0}),y_.useTurnstile=void 0;const i=t(dv()),r=typeof globalThis<"u"?globalThis:window;let s=typeof r.turnstile<"u"?"ready":"unloaded",o,a;const l=new Promise((f,p)=>{a={resolve:f,reject:p},s==="ready"&&f(void 0)});{const f="cf__reactTurnstileOnLoad",p="https://challenges.cloudflare.com/turnstile/v0/api.js";o=()=>{if(s==="unloaded"){s="loading",r[f]=()=>{a.resolve(),s="ready",delete r[f]};const g=`${p}?onload=${f}&render=explicit`,m=document.createElement("script");m.src=g,m.async=!0,m.addEventListener("error",()=>{a.reject("Failed to load Turnstile."),delete r[f]}),document.head.appendChild(m)}return l}}function c({id:f,className:p,style:g,sitekey:m,action:_,cData:v,theme:b,language:y,tabIndex:C,responseField:S,responseFieldName:k,size:I,fixedSize:L,retry:N,retryInterval:P,refreshExpired:O,appearance:F,execution:V,userRef:M,onVerify:B,onSuccess:W,onLoad:q,onError:U,onExpire:G,onTimeout:H,onAfterInteractive:z,onBeforeInteractive:Z,onUnsupported:X}){const oe=(0,i.useRef)(null),fe=(0,i.useState)({onVerify:B,onSuccess:W,onLoad:q,onError:U,onExpire:G,onTimeout:H,onAfterInteractive:z,onBeforeInteractive:Z,onUnsupported:X})[0],Se=M??oe,Me=L?{width:I==="compact"?"130px":I==="flexible"?"100%":"300px",height:I==="compact"?"120px":"65px",...g}:g;return(0,i.useEffect)(()=>{if(!Se.current)return;let Ie=!1,ge="";return(async()=>{var ye,Pe;if(s!=="ready")try{await o()}catch(qe){(ye=fe.onError)===null||ye===void 0||ye.call(fe,qe);return}if(Ie||!Se.current)return;let Be;const $e={sitekey:m,action:_,cData:v,theme:b,language:y,tabindex:C,"response-field":S,"response-field-name":k,size:I,retry:N,"retry-interval":P,"refresh-expired":O,appearance:F,execution:V,callback:(qe,mt)=>{var vt,ft;(vt=fe.onVerify)===null||vt===void 0||vt.call(fe,qe,Be),(ft=fe.onSuccess)===null||ft===void 0||ft.call(fe,qe,mt,Be)},"error-callback":qe=>{var mt;return(mt=fe.onError)===null||mt===void 0?void 0:mt.call(fe,qe,Be)},"expired-callback":qe=>{var mt;return(mt=fe.onExpire)===null||mt===void 0?void 0:mt.call(fe,qe,Be)},"timeout-callback":()=>{var qe;return(qe=fe.onTimeout)===null||qe===void 0?void 0:qe.call(fe,Be)},"after-interactive-callback":()=>{var qe;return(qe=fe.onAfterInteractive)===null||qe===void 0?void 0:qe.call(fe,Be)},"before-interactive-callback":()=>{var qe;return(qe=fe.onBeforeInteractive)===null||qe===void 0?void 0:qe.call(fe,Be)},"unsupported-callback":()=>{var qe;return(qe=fe.onUnsupported)===null||qe===void 0?void 0:qe.call(fe,Be)}};ge=window.turnstile.render(Se.current,$e),Be=u(ge),(Pe=fe.onLoad)===null||Pe===void 0||Pe.call(fe,ge,Be)})(),()=>{Ie=!0,ge&&window.turnstile.remove(ge)}},[m,_,v,b,y,C,S,k,I,N,P,O,F,V]),(0,i.useEffect)(()=>{fe.onVerify=B,fe.onSuccess=W,fe.onLoad=q,fe.onError=U,fe.onExpire=G,fe.onTimeout=H,fe.onAfterInteractive=z,fe.onBeforeInteractive=Z,fe.onUnsupported=X},[B,W,q,U,G,H,z,Z,X]),i.default.createElement("div",{ref:Se,id:f,className:p,style:Me})}y_.default=c;function u(f){return{execute:p=>window.turnstile.execute(f,p),reset:()=>window.turnstile.reset(f),getResponse:()=>window.turnstile.getResponse(f),isExpired:()=>window.turnstile.isExpired(f)}}function d(){const[f,p]=(0,i.useState)(s);return(0,i.useEffect)(()=>{s!=="ready"&&l.then(()=>p(s))},[]),r.turnstile}return y_.useTurnstile=d,y_}var crt=rxn();const sxn=Cl(crt);function oxn(n){const{onVerified:e}=n;return h.jsx(sxn,{appearance:"interaction-only",sitekey:"",onVerify:i=>e(i)})}function axn(){vr("register");const[n]=xe(),e=crt.useTurnstile(),[t,i]=x.useState(void 0),[r,s]=x.useState(""),[o,a]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState(""),f=Fr(),[p]=qB(),g=fd({initialValues:{email:"",password:"",password_confirmation:"",terms_of_service:!1,privacy_policy:!1},onSubmit(_){if(d(""),i(void 0),c(!0),_.password!==_.password_confirmation){c(!1),i({password_confirmation:["Password confirmation does not match."]});return}const v=new URL("/api/v1/signup?include=token,user.company_user,company,account",YM());["utm_source","utm_medium","utm_campaign","utm_content","utm_term"].forEach(y=>{p.has(y)&&v.searchParams.append(y,p.get(y))});const b=p.get("rc");b&&v.searchParams.append("rc",b),Je("POST",v.href,{..._,"cf-turnstile":r}).then(y=>{f(T1t({token:y.data.data[0].token.token,user:y.data.data[0].user})),f(s1(y.data.data)),f(zu("company")),f(SZ(0))}).catch(y=>{var C,S;((C=y.response)==null?void 0:C.status)===422&&i(y.response.data.errors),d((S=y.response)==null?void 0:S.data.message),c(!1)}).finally(()=>{e.reset(),a(!1),s("")})}}),m=xt();return x.useEffect(()=>{r&&g.handleSubmit()},[r]),h.jsx(h.Fragment,{children:h.jsxs("div",{className:"h-screen",children:[h.jsx(PEe,{}),h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:m.$1,borderColor:m.$5},children:[h.jsx("h2",{className:"text-2xl",style:{color:m.$3},children:n("register_label")}),h.jsxs("div",{className:"space-y-5 my-6",children:[h.jsx(lt,{type:"email",autoComplete:"on",label:n("email_address"),id:"email",onChange:g.handleChange,errorMessage:t==null?void 0:t.email}),h.jsx(lt,{type:"password",autoComplete:"on",label:n("password"),id:"password",onChange:g.handleChange,errorMessage:t==null?void 0:t.password}),h.jsx(lt,{type:"password",autoComplete:"on",label:n("password_confirmation"),id:"password_confirmation",onChange:g.handleChange,errorMessage:t==null?void 0:t.password_confirmation}),h.jsx(Kl,{className:"mt-4",children:u}),o&&h.jsx("div",{className:"flex justify-center",children:h.jsx(oxn,{onVerified:_=>s(_)})}),h.jsx(dn,{disabled:l,className:"mt-4",variant:"block",onClick:()=>a(!0),children:n("register")})]}),h.jsx("div",{className:"flex justify-center",children:To()})]}),h.jsxs(h.Fragment,{children:[h.jsx(qXt,{}),h.jsx("div",{className:"mx-4 max-w-md w-full rounded md:shadow-lg mt-4",children:h.jsx(Qwn,{})})]})]})]})})}const lxn=h.jsxs(h.Fragment,{children:[h.jsxs(Ee,{element:h.jsx(qwn,{}),children:[h.jsx(Ee,{path:"/login",element:h.jsx(txn,{})}),h.jsx(Ee,{path:"/recover_password",element:h.jsx(ixn,{})}),h.jsx(Ee,{element:h.jsx(Uwn,{}),children:h.jsx(Ee,{path:"/register",element:h.jsx(axn,{})})}),h.jsx(Ee,{path:"/demo",element:h.jsx(Ywn,{})})]}),h.jsx(Ee,{element:h.jsx(UQe,{}),children:h.jsx(Ee,{path:"/logout",element:h.jsx(nxn,{})})})]}),cxn=x.lazy(()=>ue(()=>import("./Quotes-DQ_Gl7fq.js"),__vite__mapDeps([124,5,6,7,56,9,12,125,16,4,2,17,18,126,19]))),uxn=x.lazy(()=>ue(()=>import("./Import-BOHh3Vgu.js"),[])),dxn=x.lazy(()=>ue(()=>import("./Quote-DxxAxeIu.js"),__vite__mapDeps([127,126,21,1,2,22,23,3,4,27]))),hxn=x.lazy(()=>ue(()=>import("./Edit-D5ioH2mG.js"),__vite__mapDeps([128,31,32,34,35,129,36]))),fxn=x.lazy(()=>ue(()=>import("./Create-D0uIYbj-.js"),__vite__mapDeps([130,29,126]))),pxn=x.lazy(()=>ue(()=>import("./CreatePage-1PDJaG-E.js"),__vite__mapDeps([131,31,32,34,35,36,129]))),NFe=x.lazy(()=>ue(()=>import("./Documents-CetYeaFd.js"),[])),DFe=x.lazy(()=>ue(()=>import("./Settings-1Ay9aNbP.js"),__vite__mapDeps([132,44,45]))),gxn=x.lazy(()=>ue(()=>import("./Pdf-Cy0XAetx.js"),__vite__mapDeps([133,35,126]))),mxn=x.lazy(()=>ue(()=>import("./Email-DPDlkcuH.js"),__vite__mapDeps([134,39,35,126]))),_xn=x.lazy(()=>ue(()=>import("./Activities-jydPDPFe.js"),__vite__mapDeps([135,125,16,4,2,17,18]))),vxn=x.lazy(()=>ue(()=>import("./History-B2Dyc6R5.js"),__vite__mapDeps([136,18]))),bxn=x.lazy(()=>ue(()=>import("./EmailHistory-DdhcEylc.js"),__vite__mapDeps([137,16]))),yxn=h.jsxs(Ee,{path:"/quotes",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.Quotes),dr(Tn("view_quote"),Tn("create_quote"),Tn("edit_quote"))],component:h.jsx(cxn,{})})}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[fs(nr.Quotes),dr(Tn("create_quote"),Tn("edit_quote"))],component:h.jsx(uxn,{})})}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.Quotes),dr(Tn("view_quote"),Tn("edit_quote"),bl("/api/v1/quotes/:id"))],component:h.jsx(dxn,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx(hxn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(NFe,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(DFe,{})}),h.jsx(Ee,{path:"activity",element:h.jsx(_xn,{})}),h.jsx(Ee,{path:"history",element:h.jsx(vxn,{})}),h.jsx(Ee,{path:"email_history",element:h.jsx(bxn,{})})]}),h.jsxs(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.Quotes),Tn("create_quote")],component:h.jsx(fxn,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(pxn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(NFe,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(DFe,{})})]}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.Quotes),dr(Tn("edit_quote"),bl("/api/v1/quotes/:id"))],component:h.jsx(Hm,{})}),children:[h.jsx(Ee,{path:"pdf",element:h.jsx(gxn,{})}),h.jsx(Ee,{path:"email",element:h.jsx(mxn,{})})]})]}),Cxn=x.lazy(()=>ue(()=>import("./Credits-C5JMn-cJ.js"),__vite__mapDeps([138,5,22,23,3,4,2,63,9,10,11]))),wxn=x.lazy(()=>ue(()=>import("./Create-09EHeIs2.js"),__vite__mapDeps([139,29,22,23,3,4,2,140]))),xxn=x.lazy(()=>ue(()=>import("./CreatePage-s96wMJ-f.js"),__vite__mapDeps([141,31,32,34,35,22,23,3,4,2,142]))),Sxn=x.lazy(()=>ue(()=>import("./Credit-BdymPEOW.js"),__vite__mapDeps([143,140,22,23,3,4,2,26,21,1,27]))),Exn=x.lazy(()=>ue(()=>import("./Edit-CAlVheER.js"),__vite__mapDeps([144,31,32,34,35,142,22,23,3,4,2]))),kxn=x.lazy(()=>ue(()=>import("./Pdf-DW7FFV44.js"),__vite__mapDeps([145,35,140]))),Txn=x.lazy(()=>ue(()=>import("./Email-D6QHSuWJ.js"),__vite__mapDeps([146,39,35,140]))),RFe=x.lazy(()=>ue(()=>import("./Documents-Crx5jlp4.js"),[])),PFe=x.lazy(()=>ue(()=>import("./Settings-OlnotiSt.js"),__vite__mapDeps([147,22,23,3,4,2,44,45]))),Ixn=x.lazy(()=>ue(()=>import("./Activities-NtaFtimP.js"),[])),Lxn=x.lazy(()=>ue(()=>import("./History-Bzr58LOL.js"),__vite__mapDeps([148,18]))),Axn=h.jsxs(Ee,{path:"/credits",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.Credits),dr(Tn("view_credit"),Tn("create_credit"),Tn("edit_credit"))],component:h.jsx(Cxn,{})})}),h.jsxs(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.Credits),Tn("create_credit")],component:h.jsx(wxn,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(xxn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(RFe,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(PFe,{})})]}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.Credits),dr(Tn("edit_credit"),Tn("view_credit"),bl("/api/v1/credits/:id"))],component:h.jsx(Sxn,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx(Exn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(RFe,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(PFe,{})}),h.jsx(Ee,{path:"activity",element:h.jsx(Ixn,{})}),h.jsx(Ee,{path:"history",element:h.jsx(Lxn,{})})]}),h.jsx(Ee,{path:":id/pdf",element:h.jsx(Si,{guards:[fs(nr.Credits),dr(Tn("edit_credit"),bl("/api/v1/credits/:id"))],component:h.jsx(kxn,{})})}),h.jsx(Ee,{path:":id/email",element:h.jsx(Si,{guards:[fs(nr.Credits),dr(Tn("edit_credit"),bl("/api/v1/credits/:id"))],component:h.jsx(Txn,{})})})]}),Nxn=x.lazy(()=>ue(()=>import("./Projects-BIRKYSm_.js"),__vite__mapDeps([149,65,66,5]))),Dxn=x.lazy(()=>ue(()=>import("./Create-D0AqRvEB.js"),__vite__mapDeps([150,66]))),OFe=x.lazy(()=>ue(()=>import("./Project-D3ynNitG.js"),__vite__mapDeps([151,65,66,27]))),Rxn=x.lazy(()=>ue(()=>import("./Edit-Dmi-Z8QS.js"),__vite__mapDeps([152,32]))),Pxn=x.lazy(()=>ue(()=>import("./Show-0pn6Bxo1.js"),__vite__mapDeps([153,53,65,66,5,68,32,27]))),Oxn=x.lazy(()=>ue(()=>import("./Documents-DNKzsxRM.js"),[])),Mxn=h.jsxs(Ee,{children:[h.jsx(Ee,{path:"/projects",element:h.jsx(Si,{guards:[fs(nr.Projects),dr(Tn("view_project"),Tn("create_project"),Tn("edit_project"))],component:h.jsx(Nxn,{})})}),h.jsx(Ee,{path:"/projects/create",element:h.jsx(Si,{guards:[fs(nr.Projects),Tn("create_project")],component:h.jsx(Dxn,{})})}),h.jsx(Ee,{path:"/projects/:id",element:h.jsx(Si,{guards:[fs(nr.Projects),dr(Tn("view_project"),Tn("edit_project"),bl("/api/v1/projects/:id"))],component:h.jsx(Pxn,{})})}),h.jsx(Ee,{path:"/projects/:id",element:h.jsx(Si,{guards:[fs(nr.Projects),dr(Tn("view_project"),Tn("edit_project"),bl("/api/v1/projects/:id"))],component:h.jsx(OFe,{})}),children:h.jsx(Ee,{path:"documents",element:h.jsx(Oxn,{})})}),h.jsx(Ee,{path:"/projects/:id/edit",element:h.jsx(Si,{guards:[fs(nr.Projects),dr(Tn("edit_project"),bl("/api/v1/projects/:id"))],component:h.jsx(OFe,{})}),children:h.jsx(Ee,{path:"",element:h.jsx(Rxn,{})})})]});var Kz={exports:{}};/* @license Papa Parse v5.5.2 https://github.com/mholt/PapaParse License: MIT */var jxn=Kz.exports,MFe;function Fxn(){return MFe||(MFe=1,function(n,e){((t,i)=>{n.exports=i()})(jxn,function t(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r,s=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(L){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(N){var P=S(N);P.chunkSize=parseInt(P.chunkSize),N.step||N.chunk||(P.chunkSize=null),this._handle=new m(P),(this._handle.streamer=this)._config=P}).call(this,L),this.parseChunk=function(N,P){var O=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<O){let V=this._config.newline;V||(F=this._config.quoteChar||'"',V=this._handle.guessLineEndings(N,F)),N=[...N.split(V).slice(O)].join(V)}this.isFirstChunk&&I(this._config.beforeFirstChunk)&&(F=this._config.beforeFirstChunk(N))!==void 0&&(N=F),this.isFirstChunk=!1,this._halted=!1;var O=this._partialLine+N,F=(this._partialLine="",this._handle.parse(O,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(N=F.meta.cursor,O=(this._finished||(this._partialLine=O.substring(N-this._baseIndex),this._baseIndex=N),F&&F.data&&(this._rowCount+=F.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)i.postMessage({results:F,workerId:c.WORKER_ID,finished:O});else if(I(this._config.chunk)&&!P){if(this._config.chunk(F,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=F=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(F.data),this._completeResults.errors=this._completeResults.errors.concat(F.errors),this._completeResults.meta=F.meta),this._completed||!O||!I(this._config.complete)||F&&F.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),O||F&&F.meta.paused||this._nextChunk(),F}this._halted=!0},this._sendError=function(N){I(this._config.error)?this._config.error(N):o&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:N,finished:!1})}}function d(L){var N;(L=L||{}).chunkSize||(L.chunkSize=c.RemoteChunkSize),u.call(this,L),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(P){this._input=P,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(N=new XMLHttpRequest,this._config.withCredentials&&(N.withCredentials=this._config.withCredentials),s||(N.onload=k(this._chunkLoaded,this),N.onerror=k(this._chunkError,this)),N.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var P,O=this._config.downloadRequestHeaders;for(P in O)N.setRequestHeader(P,O[P])}var F;this._config.chunkSize&&(F=this._start+this._config.chunkSize-1,N.setRequestHeader("Range","bytes="+this._start+"-"+F));try{N.send(this._config.downloadRequestBody)}catch(V){this._chunkError(V.message)}s&&N.status===0&&this._chunkError()}},this._chunkLoaded=function(){N.readyState===4&&(N.status<200||400<=N.status?this._chunkError():(this._start+=this._config.chunkSize||N.responseText.length,this._finished=!this._config.chunkSize||this._start>=(P=>(P=P.getResponseHeader("Content-Range"))!==null?parseInt(P.substring(P.lastIndexOf("/")+1)):-1)(N),this.parseChunk(N.responseText)))},this._chunkError=function(P){P=N.statusText||P,this._sendError(new Error(P))}}function f(L){(L=L||{}).chunkSize||(L.chunkSize=c.LocalChunkSize),u.call(this,L);var N,P,O=typeof FileReader<"u";this.stream=function(F){this._input=F,P=F.slice||F.webkitSlice||F.mozSlice,O?((N=new FileReader).onload=k(this._chunkLoaded,this),N.onerror=k(this._chunkError,this)):N=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var F=this._input,V=(this._config.chunkSize&&(V=Math.min(this._start+this._config.chunkSize,this._input.size),F=P.call(F,this._start,V)),N.readAsText(F,this._config.encoding));O||this._chunkLoaded({target:{result:V}})},this._chunkLoaded=function(F){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(F.target.result)},this._chunkError=function(){this._sendError(N.error)}}function p(L){var N;u.call(this,L=L||{}),this.stream=function(P){return N=P,this._nextChunk()},this._nextChunk=function(){var P,O;if(!this._finished)return P=this._config.chunkSize,N=P?(O=N.substring(0,P),N.substring(P)):(O=N,""),this._finished=!N,this.parseChunk(O)}}function g(L){u.call(this,L=L||{});var N=[],P=!0,O=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(F){this._input=F,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){O&&N.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),N.length?this.parseChunk(N.shift()):P=!0},this._streamData=k(function(F){try{N.push(typeof F=="string"?F:F.toString(this._config.encoding)),P&&(P=!1,this._checkIsFinished(),this.parseChunk(N.shift()))}catch(V){this._streamError(V)}},this),this._streamError=k(function(F){this._streamCleanUp(),this._sendError(F)},this),this._streamEnd=k(function(){this._streamCleanUp(),O=!0,this._streamData("")},this),this._streamCleanUp=k(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function m(L){var N,P,O,F,V=Math.pow(2,53),M=-V,B=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,W=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,q=this,U=0,G=0,H=!1,z=!1,Z=[],X={data:[],errors:[],meta:{}};function oe(Ie){return L.skipEmptyLines==="greedy"?Ie.join("").trim()==="":Ie.length===1&&Ie[0].length===0}function fe(){if(X&&O&&(Me("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),O=!1),L.skipEmptyLines&&(X.data=X.data.filter(function(Pe){return!oe(Pe)})),Se()){let Pe=function(Be,$e){I(L.transformHeader)&&(Be=L.transformHeader(Be,$e)),Z.push(Be)};if(X)if(Array.isArray(X.data[0])){for(var Ie=0;Se()&&Ie<X.data.length;Ie++)X.data[Ie].forEach(Pe);X.data.splice(0,1)}else X.data.forEach(Pe)}function ge(Pe,Be){for(var $e=L.header?{}:[],qe=0;qe<Pe.length;qe++){var mt=qe,vt=Pe[qe],vt=((ft,tt)=>(St=>(L.dynamicTypingFunction&&L.dynamicTyping[St]===void 0&&(L.dynamicTyping[St]=L.dynamicTypingFunction(St)),(L.dynamicTyping[St]||L.dynamicTyping)===!0))(ft)?tt==="true"||tt==="TRUE"||tt!=="false"&&tt!=="FALSE"&&((St=>{if(B.test(St)&&(St=parseFloat(St),M<St&&St<V))return 1})(tt)?parseFloat(tt):W.test(tt)?new Date(tt):tt===""?null:tt):tt)(mt=L.header?qe>=Z.length?"__parsed_extra":Z[qe]:mt,vt=L.transform?L.transform(vt,mt):vt);mt==="__parsed_extra"?($e[mt]=$e[mt]||[],$e[mt].push(vt)):$e[mt]=vt}return L.header&&(qe>Z.length?Me("FieldMismatch","TooManyFields","Too many fields: expected "+Z.length+" fields but parsed "+qe,G+Be):qe<Z.length&&Me("FieldMismatch","TooFewFields","Too few fields: expected "+Z.length+" fields but parsed "+qe,G+Be)),$e}var ye;X&&(L.header||L.dynamicTyping||L.transform)&&(ye=1,!X.data.length||Array.isArray(X.data[0])?(X.data=X.data.map(ge),ye=X.data.length):X.data=ge(X.data,0),L.header&&X.meta&&(X.meta.fields=Z),G+=ye)}function Se(){return L.header&&Z.length===0}function Me(Ie,ge,ye,Pe){Ie={type:Ie,code:ge,message:ye},Pe!==void 0&&(Ie.row=Pe),X.errors.push(Ie)}I(L.step)&&(F=L.step,L.step=function(Ie){X=Ie,Se()?fe():(fe(),X.data.length!==0&&(U+=Ie.data.length,L.preview&&U>L.preview?P.abort():(X.data=X.data[0],F(X,q))))}),this.parse=function(Ie,ge,ye){var Pe=L.quoteChar||'"',Pe=(L.newline||(L.newline=this.guessLineEndings(Ie,Pe)),O=!1,L.delimiter?I(L.delimiter)&&(L.delimiter=L.delimiter(Ie),X.meta.delimiter=L.delimiter):((Pe=((Be,$e,qe,mt,vt)=>{var ft,tt,St,Ft;vt=vt||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var en=0;en<vt.length;en++){for(var Ke,dt=vt[en],nt=0,at=0,Oe=0,ce=(St=void 0,new v({comments:mt,delimiter:dt,newline:$e,preview:10}).parse(Be)),Ne=0;Ne<ce.data.length;Ne++)qe&&oe(ce.data[Ne])?Oe++:(Ke=ce.data[Ne].length,at+=Ke,St===void 0?St=Ke:0<Ke&&(nt+=Math.abs(Ke-St),St=Ke));0<ce.data.length&&(at/=ce.data.length-Oe),(tt===void 0||nt<=tt)&&(Ft===void 0||Ft<at)&&1.99<at&&(tt=nt,ft=dt,Ft=at)}return{successful:!!(L.delimiter=ft),bestDelimiter:ft}})(Ie,L.newline,L.skipEmptyLines,L.comments,L.delimitersToGuess)).successful?L.delimiter=Pe.bestDelimiter:(O=!0,L.delimiter=c.DefaultDelimiter),X.meta.delimiter=L.delimiter),S(L));return L.preview&&L.header&&Pe.preview++,N=Ie,P=new v(Pe),X=P.parse(N,ge,ye),fe(),H?{meta:{paused:!0}}:X||{meta:{paused:!1}}},this.paused=function(){return H},this.pause=function(){H=!0,P.abort(),N=I(L.chunk)?"":N.substring(P.getCharIndex())},this.resume=function(){q.streamer._halted?(H=!1,q.streamer.parseChunk(N,!0)):setTimeout(q.resume,3)},this.aborted=function(){return z},this.abort=function(){z=!0,P.abort(),X.meta.aborted=!0,I(L.complete)&&L.complete(X),N=""},this.guessLineEndings=function(Be,Pe){Be=Be.substring(0,1048576);var Pe=new RegExp(_(Pe)+"([^]*?)"+_(Pe),"gm"),ye=(Be=Be.replace(Pe,"")).split("\r"),Pe=Be.split(` `),Be=1<Pe.length&&Pe[0].length<ye[0].length;if(ye.length===1||Be)return` `;for(var $e=0,qe=0;qe<ye.length;qe++)ye[qe][0]===` `&&$e++;return $e>=ye.length/2?`\r `:"\r"}}function _(L){return L.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(L){var N=(L=L||{}).delimiter,P=L.newline,O=L.comments,F=L.step,V=L.preview,M=L.fastMode,B=null,W=!1,q=L.quoteChar==null?'"':L.quoteChar,U=q;if(L.escapeChar!==void 0&&(U=L.escapeChar),(typeof N!="string"||-1<c.BAD_DELIMITERS.indexOf(N))&&(N=","),O===N)throw new Error("Comment character same as delimiter");O===!0?O="#":(typeof O!="string"||-1<c.BAD_DELIMITERS.indexOf(O))&&(O=!1),P!==` `&&P!=="\r"&&P!==`\r `&&(P=` `);var G=0,H=!1;this.parse=function(z,Z,X){if(typeof z!="string")throw new Error("Input must be a string");var oe=z.length,fe=N.length,Se=P.length,Me=O.length,Ie=I(F),ge=[],ye=[],Pe=[],Be=G=0;if(!z)return nt();if(M||M!==!1&&z.indexOf(q)===-1){for(var $e=z.split(P),qe=0;qe<$e.length;qe++){if(Pe=$e[qe],G+=Pe.length,qe!==$e.length-1)G+=P.length;else if(X)return nt();if(!O||Pe.substring(0,Me)!==O){if(Ie){if(ge=[],Ft(Pe.split(N)),at(),H)return nt()}else Ft(Pe.split(N));if(V&&V<=qe)return ge=ge.slice(0,V),nt(!0)}}return nt()}for(var mt=z.indexOf(N,G),vt=z.indexOf(P,G),ft=new RegExp(_(U)+_(q),"g"),tt=z.indexOf(q,G);;)if(z[G]===q)for(tt=G,G++;;){if((tt=z.indexOf(q,tt+1))===-1)return X||ye.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ge.length,index:G}),Ke();if(tt===oe-1)return Ke(z.substring(G,tt).replace(ft,q));if(q===U&&z[tt+1]===U)tt++;else if(q===U||tt===0||z[tt-1]!==U){mt!==-1&&mt<tt+1&&(mt=z.indexOf(N,tt+1));var St=en((vt=vt!==-1&&vt<tt+1?z.indexOf(P,tt+1):vt)===-1?mt:Math.min(mt,vt));if(z.substr(tt+1+St,fe)===N){Pe.push(z.substring(G,tt).replace(ft,q)),z[G=tt+1+St+fe]!==q&&(tt=z.indexOf(q,G)),mt=z.indexOf(N,G),vt=z.indexOf(P,G);break}if(St=en(vt),z.substring(tt+1+St,tt+1+St+Se)===P){if(Pe.push(z.substring(G,tt).replace(ft,q)),dt(tt+1+St+Se),mt=z.indexOf(N,G),tt=z.indexOf(q,G),Ie&&(at(),H))return nt();if(V&&ge.length>=V)return nt(!0);break}ye.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ge.length,index:G}),tt++}}else if(O&&Pe.length===0&&z.substring(G,G+Me)===O){if(vt===-1)return nt();G=vt+Se,vt=z.indexOf(P,G),mt=z.indexOf(N,G)}else if(mt!==-1&&(mt<vt||vt===-1))Pe.push(z.substring(G,mt)),G=mt+fe,mt=z.indexOf(N,G);else{if(vt===-1)break;if(Pe.push(z.substring(G,vt)),dt(vt+Se),Ie&&(at(),H))return nt();if(V&&ge.length>=V)return nt(!0)}return Ke();function Ft(Oe){ge.push(Oe),Be=G}function en(Oe){var ce=0;return ce=Oe!==-1&&(Oe=z.substring(tt+1,Oe))&&Oe.trim()===""?Oe.length:ce}function Ke(Oe){return X||(Oe===void 0&&(Oe=z.substring(G)),Pe.push(Oe),G=oe,Ft(Pe),Ie&&at()),nt()}function dt(Oe){G=Oe,Ft(Pe),Pe=[],vt=z.indexOf(P,G)}function nt(Oe){if(L.header&&!Z&&ge.length&&!W){var ce=ge[0],Ne={},Xe=new Set(ce);let it=!1;for(let Tt=0;Tt<ce.length;Tt++){let Ct=ce[Tt];if(Ne[Ct=I(L.transformHeader)?L.transformHeader(Ct,Tt):Ct]){let Rt,se=Ne[Ct];for(;Rt=Ct+"_"+se,se++,Xe.has(Rt););Xe.add(Rt),ce[Tt]=Rt,Ne[Ct]++,it=!0,(B=B===null?{}:B)[Rt]=Ct}else Ne[Ct]=1,ce[Tt]=Ct;Xe.add(Ct)}it&&console.warn("Duplicate headers found and renamed."),W=!0}return{data:ge,errors:ye,meta:{delimiter:N,linebreak:P,aborted:H,truncated:!!Oe,cursor:Be+(Z||0),renamedHeaders:B}}}function at(){F(nt()),ge=[],ye=[]}},this.abort=function(){H=!0},this.getCharIndex=function(){return G}}function b(L){var N=L.data,P=a[N.workerId],O=!1;if(N.error)P.userError(N.error,N.file);else if(N.results&&N.results.data){var F={abort:function(){O=!0,y(N.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:C,resume:C};if(I(P.userStep)){for(var V=0;V<N.results.data.length&&(P.userStep({data:N.results.data[V],errors:N.results.errors,meta:N.results.meta},F),!O);V++);delete N.results}else I(P.userChunk)&&(P.userChunk(N.results,F,N.file),delete N.results)}N.finished&&!O&&y(N.workerId,N.results)}function y(L,N){var P=a[L];I(P.userComplete)&&P.userComplete(N),P.terminate(),delete a[L]}function C(){throw new Error("Not implemented.")}function S(L){if(typeof L!="object"||L===null)return L;var N,P=Array.isArray(L)?[]:{};for(N in L)P[N]=S(L[N]);return P}function k(L,N){return function(){L.apply(N,arguments)}}function I(L){return typeof L=="function"}return c.parse=function(L,N){var P=(N=N||{}).dynamicTyping||!1;if(I(P)&&(N.dynamicTypingFunction=P,P={}),N.dynamicTyping=P,N.transform=!!I(N.transform)&&N.transform,!N.worker||!c.WORKERS_SUPPORTED)return P=null,c.NODE_STREAM_INPUT,typeof L=="string"?(L=(O=>O.charCodeAt(0)!==65279?O:O.slice(1))(L),P=new(N.download?d:p)(N)):L.readable===!0&&I(L.read)&&I(L.on)?P=new g(N):(i.File&&L instanceof File||L instanceof Object)&&(P=new f(N)),P.stream(L);(P=(()=>{var O;return!!c.WORKERS_SUPPORTED&&(O=(()=>{var F=i.URL||i.webkitURL||null,V=t.toString();return c.BLOB_URL||(c.BLOB_URL=F.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",V,")();"],{type:"text/javascript"})))})(),(O=new i.Worker(O)).onmessage=b,O.id=l++,a[O.id]=O)})()).userStep=N.step,P.userChunk=N.chunk,P.userComplete=N.complete,P.userError=N.error,N.step=I(N.step),N.chunk=I(N.chunk),N.complete=I(N.complete),N.error=I(N.error),delete N.worker,P.postMessage({input:L,config:N,workerId:P.id})},c.unparse=function(L,N){var P=!1,O=!0,F=",",V=`\r `,M='"',B=M+M,W=!1,q=null,U=!1,G=((()=>{if(typeof N=="object"){if(typeof N.delimiter!="string"||c.BAD_DELIMITERS.filter(function(Z){return N.delimiter.indexOf(Z)!==-1}).length||(F=N.delimiter),typeof N.quotes!="boolean"&&typeof N.quotes!="function"&&!Array.isArray(N.quotes)||(P=N.quotes),typeof N.skipEmptyLines!="boolean"&&typeof N.skipEmptyLines!="string"||(W=N.skipEmptyLines),typeof N.newline=="string"&&(V=N.newline),typeof N.quoteChar=="string"&&(M=N.quoteChar),typeof N.header=="boolean"&&(O=N.header),Array.isArray(N.columns)){if(N.columns.length===0)throw new Error("Option columns is empty");q=N.columns}N.escapeChar!==void 0&&(B=N.escapeChar+M),N.escapeFormulae instanceof RegExp?U=N.escapeFormulae:typeof N.escapeFormulae=="boolean"&&N.escapeFormulae&&(U=/^[=+\-@\t\r].*$/)}})(),new RegExp(_(M),"g"));if(typeof L=="string"&&(L=JSON.parse(L)),Array.isArray(L)){if(!L.length||Array.isArray(L[0]))return H(null,L,W);if(typeof L[0]=="object")return H(q||Object.keys(L[0]),L,W)}else if(typeof L=="object")return typeof L.data=="string"&&(L.data=JSON.parse(L.data)),Array.isArray(L.data)&&(L.fields||(L.fields=L.meta&&L.meta.fields||q),L.fields||(L.fields=Array.isArray(L.data[0])?L.fields:typeof L.data[0]=="object"?Object.keys(L.data[0]):[]),Array.isArray(L.data[0])||typeof L.data[0]=="object"||(L.data=[L.data])),H(L.fields||[],L.data||[],W);throw new Error("Unable to serialize unrecognized input");function H(Z,X,oe){var fe="",Se=(typeof Z=="string"&&(Z=JSON.parse(Z)),typeof X=="string"&&(X=JSON.parse(X)),Array.isArray(Z)&&0<Z.length),Me=!Array.isArray(X[0]);if(Se&&O){for(var Ie=0;Ie<Z.length;Ie++)0<Ie&&(fe+=F),fe+=z(Z[Ie],Ie);0<X.length&&(fe+=V)}for(var ge=0;ge<X.length;ge++){var ye=(Se?Z:X[ge]).length,Pe=!1,Be=Se?Object.keys(X[ge]).length===0:X[ge].length===0;if(oe&&!Se&&(Pe=oe==="greedy"?X[ge].join("").trim()==="":X[ge].length===1&&X[ge][0].length===0),oe==="greedy"&&Se){for(var $e=[],qe=0;qe<ye;qe++){var mt=Me?Z[qe]:qe;$e.push(X[ge][mt])}Pe=$e.join("").trim()===""}if(!Pe){for(var vt=0;vt<ye;vt++){0<vt&&!Be&&(fe+=F);var ft=Se&&Me?Z[vt]:vt;fe+=z(X[ge][ft],vt)}ge<X.length-1&&(!oe||0<ye&&!Be)&&(fe+=V)}}return fe}function z(Z,X){var oe,fe;return Z==null?"":Z.constructor===Date?JSON.stringify(Z).slice(1,25):(fe=!1,U&&typeof Z=="string"&&U.test(Z)&&(Z="'"+Z,fe=!0),oe=Z.toString().replace(G,B),(fe=fe||P===!0||typeof P=="function"&&P(Z,X)||Array.isArray(P)&&P[X]||((Se,Me)=>{for(var Ie=0;Ie<Me.length;Ie++)if(-1<Se.indexOf(Me[Ie]))return!0;return!1})(oe,c.BAD_DELIMITERS)||-1<oe.indexOf(F)||oe.charAt(0)===" "||oe.charAt(oe.length-1)===" ")?M+oe+M:oe)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",` `,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!s&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=m,c.NetworkStreamer=d,c.FileStreamer=f,c.StringStreamer=p,c.ReadableStreamStreamer=g,i.jQuery&&((r=i.jQuery).fn.parse=function(L){var N=L.config||{},P=[];return this.each(function(V){if(!(r(this).prop("tagName").toUpperCase()==="INPUT"&&r(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var M=0;M<this.files.length;M++)P.push({file:this.files[M],inputElem:this,instanceConfig:r.extend({},N)})}),O(),this;function O(){if(P.length===0)I(L.complete)&&L.complete();else{var V,M,B,W,q=P[0];if(I(L.before)){var U=L.before(q.file,q.inputElem);if(typeof U=="object"){if(U.action==="abort")return V="AbortError",M=q.file,B=q.inputElem,W=U.reason,void(I(L.error)&&L.error({name:V},M,B,W));if(U.action==="skip")return void F();typeof U.config=="object"&&(q.instanceConfig=r.extend(q.instanceConfig,U.config))}else if(U==="skip")return void F()}var G=q.instanceConfig.complete;q.instanceConfig.complete=function(H){I(G)&&G(H,q.file,q.inputElem),F()},c.parse(q.file,q.instanceConfig)}}function F(){P.splice(0,1),O()}}),o&&(i.onmessage=function(L){L=L.data,c.WORKER_ID===void 0&&L&&(c.WORKER_ID=L.workerId),typeof L.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(L.input,L.config),finished:!0}):(i.File&&L.input instanceof File||L.input instanceof Object)&&(L=c.parse(L.input,L.config))&&i.postMessage({workerId:c.WORKER_ID,results:L,finished:!0})}),(d.prototype=Object.create(u.prototype)).constructor=d,(f.prototype=Object.create(u.prototype)).constructor=f,(p.prototype=Object.create(p.prototype)).constructor=p,(g.prototype=Object.create(u.prototype)).constructor=g,c})}(Kz)),Kz.exports}var Bxn=Fxn();const $xn=As.div` border-color: ${n=>n.theme.borderColor}; &:hover { border-color: ${n=>n.theme.hoverBorderColor}; } `;function Hxn(n){const[e]=xe(),t=n.type==="zip",i={...!t&&{"text/*":[".csv"],"application/vnd.ms-excel":[".csv"],"application/csv":[".csv"]},...t&&{"application/zip":[".zip"]}},r=xt(),s=Qo(),{numberOfTemplates:o,templates:a}=Cit({entity:n.entity}),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[f,p]=x.useState(new FormData),[g,m]=x.useState([]),[_,v]=x.useState(),[b,y]=x.useState({hash:"",import_type:n.type,skip_header:!0,column_map:{[n.entity]:{mapping:{}}}}),[C,S]=x.useState(),[k,I]=x.useState(""),[L,N]=x.useState({}),P=ge=>{b.column_map[n.entity].mapping[ge.target.id]=ge.target.value,y({...b}),I("")},O=()=>{var ye,Pe;const ge={};Object.entries(((Pe=(ye=s==null?void 0:s.import_templates)==null?void 0:ye[n.entity])==null?void 0:Pe[k])||{}).forEach(([Be,$e])=>{ge[Be]=$e||""}),y(Be=>({...Be,column_map:{[n.entity]:{mapping:ge}}}))},F=()=>{I(""),y(ge=>({...ge,column_map:{[n.entity]:{mapping:{...L}}}}))},V=ge=>{const ye=ge.split(".");let Pe=ye[1];return ye[1]=="user_id"&&(Pe="user"),ye[1]=="shipping_country_id"&&(Pe="shipping_country"),`${e(ye[0])} - ${e(Pe)}`},M=()=>{if(!g.length&&t){pe.error("select_file");return}pe.processing(),S(void 0);let ge="/api/v1/import",ye={};if(t)if(!l&&!u){pe.error("settings_or_data");return}else ge="/api/v1/import_json?",l&&(ge+="&import_settings=:import_settings",ye={import_settings:!0}),u&&(ge+="&import_data=:import_data",ye={...ye,import_data:!0});else b.hash=_.hash;const Pe=t?f:b;return Je("POST",ze(ge,ye),Pe).then(Be=>{var $e,qe;pe.success((($e=Be==null?void 0:Be.data)==null?void 0:$e.message)??"error_title"),(qe=n.onFileImported)==null||qe.call(n),n.onSuccess}).catch(Be=>{var $e;(($e=Be.response)==null?void 0:$e.status)===422&&(pe.dismiss(),S(Be.response.data))})},B=ge=>{b.column_map[n.entity].mapping[ge]&&(b.column_map[n.entity].mapping[ge]="",I(""),y({...b}))},W=fd({enableReinitialize:!0,initialValues:{},onSubmit:()=>{pe.processing(),S(void 0),Je("POST",ze("/api/v1/preimport"),f).then(ge=>{var ye,Pe,Be,$e;v(ge.data),n.onSuccess,pe.dismiss(),(Pe=(ye=ge.data)==null?void 0:ye.mappings[n.entity])!=null&&Pe.hints&&(($e=(Be=ge.data)==null?void 0:Be.mappings[n.entity])==null||$e.hints.forEach((qe,mt)=>{var vt,ft,tt;b.column_map[n.entity].mapping[mt]=((vt=ge.data)==null?void 0:vt.mappings[n.entity].available[qe])??"",y(b),N({...(tt=(ft=b==null?void 0:b.column_map)==null?void 0:ft[n.entity])==null?void 0:tt.mapping})})),I("")}).catch(ge=>{var ye;((ye=ge.response)==null?void 0:ye.status)===422&&(pe.dismiss(),S(ge.response.data))})}}),q=()=>{g.forEach(ge=>{f.append("files",ge)}),p(f)},U=ge=>{var ye,Pe;return Object.keys((ye=b==null?void 0:b.column_map[n.entity])==null?void 0:ye.mapping).length?((Pe=b==null?void 0:b.column_map[n.entity])==null?void 0:Pe.mapping[ge])??null:null},G=ge=>{const ye=g.filter((Be,$e)=>ge!==$e),Pe=new FormData;ye.forEach(Be=>{Pe.append("files",Be)}),m(ye),p(Pe)},H=ge=>new Promise(ye=>{try{const Pe=new FileReader;Pe.onload=Be=>{var mt;const qe=(((mt=Be.target)==null?void 0:mt.result)||"").split(` `);!qe.length||qe.length===1||qe.length===2&&!qe[1]?ye(!1):ye(!0)},Pe.readAsText(ge)}catch{ye(!1)}}),z=ge=>new Promise(ye=>{Bxn.parse(ge,{header:!1,skipEmptyLines:!0,dynamicTyping:!0,complete:Pe=>{if(Pe.errors&&Pe.errors.length>0){ye(!1);return}if(!Pe.data||Pe.data.length===0){ye(!1);return}ye(!0)},error:()=>{ye(!1)}})}),Z=async ge=>{for(let ye=0;ye<ge.length;ye++)if(!await H(ge[ye]))return!1;return!0},X=async ge=>{for(let ye=0;ye<ge.length;ye++)if(!await z(ge[ye]))return!1;return!0},{getRootProps:oe,getInputProps:fe,isDragActive:Se}=NA({accept:i,onDrop:async ge=>{if(ge.every(({type:Pe})=>Pe.includes("csv"))&&!await X(ge)){pe.error("invalid_csv_data");return}await Z(ge)?ge.every(({type:Be})=>Be.includes(n.type))?(await Promise.all(ge.map(async Be=>{if(t)m($e=>[...$e,Be]);else{const $e=await Be.arrayBuffer(),mt=new TextDecoder().decode($e),ft=new TextEncoder().encode(mt),tt=new File([ft],Be.name,{type:Be.type});Be.path&&Object.defineProperty(tt,"path",{value:Be.path,writable:!1,enumerable:!0,configurable:!0}),f.append(`files[${n.entity}]`,tt)}})),t||(f.append("import_type",n.entity),W.submitForm(),p(f))):pe.error("wrong_file_extension"):pe.error("csv_rows_length")}});x.useEffect(()=>{q()},[g]),x.useEffect(()=>{k&&O()},[k]),x.useEffect(()=>()=>I(""),[]);const Me=Lo(),Ie=()=>{n.exampleUrl&&window.open(n.exampleUrl,"_blank")};return h.jsxs(h.Fragment,{children:[h.jsxs(er,{title:e(n.entity),children:[h.jsxs(ne,{leftSide:e(t?"company_backup_file":"csv_file"),leftSideHelp:t&&e("company_backup_file_help"),children:[n.exampleUrl?h.jsx("button",{type:"button",style:{color:Me},className:"inline-flex items-center space-x-1 mb-4",onClick:Ie,children:h.jsx("span",{children:e("download_example_file")})}):null,g.length?h.jsx("ul",{className:"grid xs:grid-rows-6 lg:grid-cols-2",children:g.map((ge,ye)=>h.jsxs("li",{className:"flex items-center hover:bg-gray-50 cursor-pointer p-2",children:[ge.name," - ",(ge.size/1024).toPrecision(2)," KB"," ",h.jsx(SO,{fontSize:15,className:"cursor-pointer ml-3",onClick:()=>G(ye)})]},ye))}):h.jsxs("div",{...oe(),className:"flex flex-col md:flex-row md:items-center",children:[h.jsxs($xn,{className:"relative block w-full border-2 border-dashed rounded-lg p-12 text-center",theme:{borderColor:r.$21,hoverBorderColor:r.$17},children:[h.jsx("input",{...fe()}),h.jsx("div",{className:"flex justify-center",children:h.jsx(AL,{size:"2.3rem",color:r.$3})}),h.jsx("span",{className:"mt-2 block text-sm font-medium",style:{color:r.$3,colorScheme:r.$0},children:e(Se?"drop_file_here":"dropzone_default_message")})]}),C&&Object.keys(C.errors).map((ge,ye)=>h.jsx(Kl,{children:C.errors[ge]},ye))]}),n.postWidgetSlot??null]}),t&&h.jsxs(h.Fragment,{children:[h.jsx(ne,{leftSide:e("import_settings"),children:h.jsx(jt,{checked:l,onValueChange:ge=>c(ge)})}),h.jsx(ne,{leftSide:e("import_data"),children:h.jsx(jt,{checked:u,onValueChange:ge=>d(ge)})}),h.jsx("div",{className:"flex justify-end pr-5",children:h.jsx(dn,{behavior:"button",onClick:M,disableWithoutIcon:!0,disabled:!l&&!u||!g.length,children:e("import")})})]})]}),_&&!t&&!!o&&h.jsxs(er,{className:"mt-4",children:[h.jsx(ne,{leftSide:e("template"),children:h.jsx(Dn,{value:k,onValueChange:ge=>{I(ge),ge||y(ye=>({...ye,column_map:{[n.entity]:{mapping:{...L}}}}))},withBlank:!0,children:a.filter(ge=>ge).map((ge,ye)=>h.jsx("option",{value:ge,children:ge},ye))})}),k&&h.jsx(wit,{name:k,entity:n.entity,onDeletedTemplate:F})]}),_&&!t&&h.jsxs(h1,{children:[h.jsxs(p1,{children:[h.jsx(_a,{children:e("header")}),h.jsx(_a,{children:e("columns")})]}),h.jsxs(f1,{children:[_.mappings[n.entity].headers[0].map((ge,ye)=>h.jsxs(hc,{children:[h.jsxs(bs,{className:"space-x-2",children:[h.jsx("span",{children:ge}),h.jsx("span",{className:"text-gray-400",children:_.mappings[n.entity].headers[1][ye].substring(0,20)})]}),h.jsx(bs,{children:h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:"flex-1",children:h.jsx(Dn,{id:ye,value:U(ye),onChange:P,withBlank:!0,children:_.mappings[n.entity].available.map((Pe,Be)=>h.jsx("option",{value:Pe,children:V(Pe)},Be))})}),h.jsx(an,{className:"cursor-pointer",element:SO,size:24,onClick:()=>B(ye)})]})})]},ye)),n.entity==="bank_transaction"&&h.jsxs(hc,{children:[h.jsx(bs,{className:"space-x-2",children:h.jsx("span",{children:e("bank_account")})}),h.jsx(bs,{colSpan:2,children:h.jsx(bit,{value:b.bank_integration_id,onChange:ge=>y(ye=>({...ye,bank_integration_id:ge==null?void 0:ge.id})),onClearButtonClick:()=>y(ge=>({...ge,bank_integration_id:""})),errorMessage:C==null?void 0:C.errors.bank_integration_id})})]}),h.jsx(hc,{children:h.jsx(bs,{colSpan:2,children:h.jsx(yit,{entity:n.entity,importMap:b,onImport:M})})})]})]})]})}function Vxn(){const{t:n}=xe(),{documentTitle:e}=vr("import"),t=[{name:n("tasks"),href:"/tasks"},{name:n("import"),href:"/tasks/import"}];return h.jsx(v4,{title:e,breadcrumbs:t,children:h.jsx("div",{className:"grid grid-cols-12",children:h.jsx("div",{className:"col-span-12 xl:col-span-8",children:h.jsx(Hxn,{entity:"task",onSuccess:!1,type:"csv"})})})})}const Wxn=x.lazy(()=>ue(()=>import("./Tasks-BsV6YmvZ.js"),__vite__mapDeps([154,5,68,6,7,155,156,26]))),zxn=x.lazy(()=>ue(()=>import("./Kanban-Bcat7y23.js"),__vite__mapDeps([157,155,156,158,32,117]))),Uxn=x.lazy(()=>ue(()=>import("./Create-D67Si1nl.js"),__vite__mapDeps([159,158,156,32,117]))),qxn=x.lazy(()=>ue(()=>import("./Task-7PYsblHO.js"),__vite__mapDeps([160,27]))),Kxn=x.lazy(()=>ue(()=>import("./Edit-D_rqClT3.js"),__vite__mapDeps([161,158,156,32,117]))),Gxn=x.lazy(()=>ue(()=>import("./Documents-B_m-SHmI.js"),[])),Yxn=h.jsxs(Ee,{path:"/tasks",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.Tasks),dr(Tn("view_task"),Tn("create_task"),Tn("edit_task"))],component:h.jsx(Wxn,{})})}),h.jsx(Ee,{path:"kanban",element:h.jsx(Si,{guards:[fs(nr.Tasks),dr(Tn("view_task"),Tn("edit_task"))],component:h.jsx(zxn,{})})}),h.jsx(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.Tasks),Tn("create_task")],component:h.jsx(Uxn,{})})}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.Tasks),dr(Tn("view_task"),Tn("edit_task"),bl("/api/v1/tasks/:id"))],component:h.jsx(qxn,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx(Kxn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(Gxn,{})})]}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[fs(nr.Tasks),dr(Tn("create_task"),Tn("edit_task"))],component:h.jsx(Vxn,{})})})]}),Qxn=x.lazy(()=>ue(()=>import("./Vendors-C-AtIx4i.js"),__vite__mapDeps([162,5,6,7,163]))),Xxn=x.lazy(()=>ue(()=>import("./Import-DR2yaNl5.js"),[])),Zxn=x.lazy(()=>ue(()=>import("./Vendor-R3X2jQm6.js"),__vite__mapDeps([164,53,163,27]))),jFe=x.lazy(()=>ue(()=>import("./PurchaseOrders-DOAskBTi.js"),__vite__mapDeps([165,166,9]))),Jxn=x.lazy(()=>ue(()=>import("./Expenses-BD5w4PKF.js"),[])),eSn=x.lazy(()=>ue(()=>import("./RecurringExpenses-D2N8qefm.js"),__vite__mapDeps([167,70]))),tSn=x.lazy(()=>ue(()=>import("./Documents-p1cyjnsr.js"),[])),nSn=x.lazy(()=>ue(()=>import("./Edit-Cm1CNDgF.js"),__vite__mapDeps([168,163,27]))),iSn=x.lazy(()=>ue(()=>import("./Create-B7ZAJRca.js"),[])),rSn=x.lazy(()=>ue(()=>import("./Activities-RV3UJK3i.js"),[])),sSn=h.jsxs(Ee,{path:"vendors",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.Vendors),dr(Tn("view_vendor"),Tn("create_vendor"),Tn("edit_vendor"))],component:h.jsx(Qxn,{})})}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[fs(nr.Vendors),dr(Tn("create_vendor"),Tn("edit_vendor"))],component:h.jsx(Xxn,{})})}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.Vendors),dr(Tn("view_vendor"),Tn("edit_vendor"),bl("/api/v1/vendors/:id"))],component:h.jsx(Zxn,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(jFe,{})})}),h.jsx(Ee,{path:"purchase_orders",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(jFe,{})})}),h.jsx(Ee,{path:"expenses",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(Jxn,{})})}),h.jsx(Ee,{path:"recurring_expenses",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(eSn,{})})}),h.jsx(Ee,{path:"activities",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(rSn,{})})}),h.jsx(Ee,{path:"documents",element:h.jsx(x.Suspense,{fallback:h.jsx(Md,{}),children:h.jsx(tSn,{})})})]}),h.jsx(Ee,{path:":id/edit",element:h.jsx(Si,{guards:[fs(nr.Vendors),dr(Tn("edit_vendor"),bl("/api/v1/vendors/:id"))],component:h.jsx(nSn,{})})}),h.jsx(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.Vendors),Tn("create_vendor")],component:h.jsx(iSn,{})})})]}),oSn=x.lazy(()=>ue(()=>import("./Expenses-B_vOVEX8.js"),__vite__mapDeps([169,5,6,7]))),aSn=x.lazy(()=>ue(()=>import("./Import-BX9PEpNz.js"),[])),lSn=x.lazy(()=>ue(()=>import("./Create-BWVPzaC4.js"),__vite__mapDeps([170,171,32,172,173]))),cSn=x.lazy(()=>ue(()=>import("./Expense-CXyEITL2.js"),__vite__mapDeps([174,116,35,117,27]))),uSn=x.lazy(()=>ue(()=>import("./Edit-C7p-wAJx.js"),__vite__mapDeps([175,171,32,172,173]))),dSn=x.lazy(()=>ue(()=>import("./Documents-DHD-_QD2.js"),[])),hSn=h.jsxs(Ee,{path:"expenses",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.Expenses),dr(Tn("view_expense"),Tn("create_expense"),Tn("edit_expense"))],component:h.jsx(oSn,{})})}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[fs(nr.Expenses),dr(Tn("create_expense"),Tn("edit_expense"))],component:h.jsx(aSn,{})})}),h.jsx(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.Expenses),Tn("create_expense")],component:h.jsx(lSn,{})})}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.Expenses),dr(Tn("view_expense"),Tn("edit_expense"),bl("/api/v1/expenses/:id"))],component:h.jsx(cSn,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx(uSn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(dSn,{})})]})]}),fSn=x.lazy(()=>ue(()=>import("./PurchaseOrders-DPz8OA_x.js"),__vite__mapDeps([176,5,166,9]))),pSn=x.lazy(()=>ue(()=>import("./Edit-D5FK2Qrk.js"),__vite__mapDeps([177,34,35,178]))),gSn=x.lazy(()=>ue(()=>import("./Email-O27V-Vmh.js"),__vite__mapDeps([179,39,35]))),mSn=x.lazy(()=>ue(()=>import("./Pdf-C7c6ktvc.js"),__vite__mapDeps([180,35]))),_Sn=x.lazy(()=>ue(()=>import("./Create-Dftjwb5U.js"),__vite__mapDeps([181,29,182]))),vSn=x.lazy(()=>ue(()=>import("./PurchaseOrder-B0x-V3rH.js"),__vite__mapDeps([183,182,21,1,2,22,23,3,4,27]))),bSn=x.lazy(()=>ue(()=>import("./CreatePage-D3okxjPm.js"),__vite__mapDeps([184,34,35,178]))),FFe=x.lazy(()=>ue(()=>import("./Documents-B13P_uI5.js"),[])),BFe=x.lazy(()=>ue(()=>import("./Settings-D-nOCXBv.js"),__vite__mapDeps([185,44,45]))),ySn=x.lazy(()=>ue(()=>import("./Activities-Cch-PWQS.js"),[])),CSn=x.lazy(()=>ue(()=>import("./History-D3RadbwT.js"),__vite__mapDeps([186,18]))),wSn=x.lazy(()=>ue(()=>import("./EmailHistory-BeZt3ONR.js"),__vite__mapDeps([187,16]))),xSn=h.jsxs(Ee,{path:"/purchase_orders",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.PurchaseOrders),dr(Tn("view_purchase_order"),Tn("create_purchase_order"),Tn("edit_purchase_order"))],component:h.jsx(fSn,{})})}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.PurchaseOrders),dr(Tn("view_purchase_order"),Tn("edit_purchase_order"),bl("/api/v1/purchase_orders/:id"))],component:h.jsx(vSn,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx(pSn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(FFe,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(BFe,{})}),h.jsx(Ee,{path:"activity",element:h.jsx(ySn,{})}),h.jsx(Ee,{path:"history",element:h.jsx(CSn,{})}),h.jsx(Ee,{path:"email_history",element:h.jsx(wSn,{})})]}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.PurchaseOrders),dr(Tn("edit_purchase_order"),bl("/api/v1/purchase_orders/:id"))],component:h.jsx(Hm,{})}),children:[h.jsx(Ee,{path:"email",element:h.jsx(gSn,{})}),h.jsx(Ee,{path:"pdf",element:h.jsx(mSn,{})})]}),h.jsxs(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.PurchaseOrders),Tn("create_purchase_order")],component:h.jsx(_Sn,{})}),children:[h.jsx(Ee,{path:"",element:h.jsx(bSn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(FFe,{})}),h.jsx(Ee,{path:"settings",element:h.jsx(BFe,{})})]})]}),SSn=x.lazy(()=>ue(()=>Promise.resolve().then(()=>dbn),void 0)),ESn=h.jsx(Ee,{path:"/reports",element:h.jsx(Si,{guards:[Tn("view_reports")],component:h.jsx(SSn,{})})}),kSn=x.lazy(()=>ue(()=>import("./Transactions-CBVXBvEO.js"),__vite__mapDeps([188,189,190,6,7,10,2,15,5]))),TSn=x.lazy(()=>ue(()=>import("./Create-GSA3gFDe.js"),__vite__mapDeps([191,189,173,192]))),ISn=x.lazy(()=>ue(()=>import("./Import-Cf7vv6t5.js"),[])),LSn=x.lazy(()=>ue(()=>import("./Edit-_bQ8f5ua.js"),__vite__mapDeps([193,173,192,189,190,27]))),ASn=h.jsxs(h.Fragment,{children:[h.jsx(Ee,{path:"bank_transactions",element:h.jsx(OE,{to:"/transactions"})}),h.jsxs(Ee,{path:"transactions",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.Transactions),dr(Tn("view_bank_transaction"),Tn("create_bank_transaction"),Tn("edit_bank_transaction"))],component:h.jsx(kSn,{})})}),h.jsx(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.Transactions),dr(Tn("create_bank_transaction"))],component:h.jsx(TSn,{})})}),h.jsx(Ee,{path:"import",element:h.jsx(Si,{guards:[fs(nr.Transactions),dr(Tn("create_bank_transaction"),Tn("edit_bank_transaction"))],component:h.jsx(ISn,{})})}),h.jsx(Ee,{path:":id/edit",element:h.jsx(Si,{guards:[fs(nr.Transactions),dr(Tn("view_bank_transaction"),Tn("edit_bank_transaction"),bl("/api/v1/bank_transactions/:id"))],component:h.jsx(LSn,{})})})]})]}),NSn=x.lazy(()=>ue(()=>import("./RecurringExpense-CdnlwSSk.js"),__vite__mapDeps([194,70,27]))),DSn=x.lazy(()=>ue(()=>import("./RecurringExpenses-C8hTH3pR.js"),__vite__mapDeps([195,5,70]))),RSn=x.lazy(()=>ue(()=>import("./Create-DqQG7iLz.js"),__vite__mapDeps([196,197,70,32,172,173]))),PSn=x.lazy(()=>ue(()=>import("./Edit-CQ-G-xZd.js"),__vite__mapDeps([198,70,197,32,172,173]))),OSn=x.lazy(()=>ue(()=>import("./Documents-DaMaAs4x.js"),[])),MSn=h.jsxs(Ee,{path:"/recurring_expenses",children:[h.jsx(Ee,{path:"",element:h.jsx(Si,{guards:[fs(nr.RecurringExpenses),dr(Tn("view_recurring_expense"),Tn("create_recurring_expense"),Tn("edit_recurring_expense"))],component:h.jsx(DSn,{})})}),h.jsx(Ee,{path:"create",element:h.jsx(Si,{guards:[fs(nr.RecurringExpenses),Tn("create_recurring_expense")],component:h.jsx(RSn,{})})}),h.jsxs(Ee,{path:":id",element:h.jsx(Si,{guards:[fs(nr.RecurringExpenses),dr(Tn("view_recurring_expense"),Tn("edit_recurring_expense"),bl("/api/v1/recurring_expenses/:id"))],component:h.jsx(NSn,{})}),children:[h.jsx(Ee,{path:"edit",element:h.jsx(PSn,{})}),h.jsx(Ee,{path:"documents",element:h.jsx(OSn,{})})]})]});function jSn(){return vCe()?h.jsx(OE,{to:"/dashboard"}):h.jsx(OE,{to:"/login"})}function FSn(){return h.jsx(OE,{to:"/logout"})}function BSn(){const[n]=xe(),[e,t]=x.useState(!1),[i,r]=x.useState("");return h.jsx("div",{className:"flex items-center w-full h-full justify-center",children:h.jsxs("div",{className:"mt-96",children:[h.jsx(Ant,{isModalOpen:e,setIsModalOpen:t,onClientCreated:s=>r(s.id)}),h.jsx(qd,{inputOptions:{value:i??null},endpoint:ze("/api/v1/clients?status=active"),entryOptions:{id:"id",label:"name",value:"id"},onChange:s=>s.resource&&r(s.resource.id),onDismiss:()=>r(""),action:{label:n("new_client"),onClick:()=>t(!0),visible:!0}})]})})}const $Sn=x.lazy(()=>ue(()=>import("./Activity-n2nzd57b.js"),__vite__mapDeps([199,35]))),HSn=h.jsx(Ee,{children:h.jsx(Ee,{path:"/activities/:id",element:h.jsx($Sn,{})})}),VSn=x.lazy(()=>ue(()=>import("./Dashboard-Blut_U-P.js"),[])),WSn=x.lazy(()=>ue(()=>import("./NotFound-9JVKA17w.js"),[])),zSn=h.jsxs(dxt,{children:[h.jsx(Ee,{path:"/",element:h.jsx(jSn,{})}),lxn,h.jsxs(Ee,{element:h.jsx(UQe,{}),children:[h.jsx(Ee,{path:"/dashboard",element:h.jsx(Si,{guards:[Tn("view_dashboard")],component:h.jsx(VSn,{})})}),Mqt,iKt,dKt,xKt,RKt,yxn,Axn,Mxn,Yxn,sSn,xSn,hSn,MSn,ESn,ASn,zwn,HSn,h.jsx(Ee,{element:h.jsx(FSn,{}),children:h.jsx(Ee,{path:"/testing",element:h.jsx(BSn,{})})})]}),h.jsx(Ee,{path:"*",element:h.jsx(WSn,{})})]});function USn(){return n=>{switch(n.replace("_","-").toLowerCase()){case"af":return ue(()=>import("./af-CsN0ly29.js").then(t=>t.a),[]);case"am":return ue(()=>import("./am-3VeJST7y.js").then(t=>t.a),[]);case"ar-dz":return ue(()=>import("./ar-dz-BcefDS5u.js").then(t=>t.a),[]);case"ar-iq":return ue(()=>import("./ar-iq-Dc5riOO3.js").then(t=>t.a),[]);case"ar-kw":return ue(()=>import("./ar-kw-DFL4_41H.js").then(t=>t.a),[]);case"ar-ly":return ue(()=>import("./ar-ly-DiXxhoF4.js").then(t=>t.a),[]);case"ar-ma":return ue(()=>import("./ar-ma-CdZioTrl.js").then(t=>t.a),[]);case"ar-sa":return ue(()=>import("./ar-sa-CGcyxM8k.js").then(t=>t.a),[]);case"ar-tn":return ue(()=>import("./ar-tn-DKXus8kx.js").then(t=>t.a),[]);case"ar":return ue(()=>import("./ar-CXAnt4Ma.js").then(t=>t.a),[]);case"az":return ue(()=>import("./az-HpwV2S4R.js").then(t=>t.a),[]);case"be":return ue(()=>import("./be-CQkp8GG-.js").then(t=>t.b),[]);case"bg":return ue(()=>import("./bg-C_x6C9FM.js").then(t=>t.b),[]);case"bi":return ue(()=>import("./bi-B29usWm-.js").then(t=>t.b),[]);case"bm":return ue(()=>import("./bm-BimCDh8j.js").then(t=>t.b),[]);case"bn-bd":return ue(()=>import("./bn-bd-DO74g0rV.js").then(t=>t.b),[]);case"bn":return ue(()=>import("./bn-CBdEyNj_.js").then(t=>t.b),[]);case"bo":return ue(()=>import("./bo-Ctdl2Aaz.js").then(t=>t.b),[]);case"br":return ue(()=>import("./br-DHVA8-Uy.js").then(t=>t.b),[]);case"bs":return ue(()=>import("./bs-Dy2ZiCtp.js").then(t=>t.b),[]);case"ca":return ue(()=>import("./ca-BdmbY0A-.js").then(t=>t.c),[]);case"cs":return ue(()=>import("./cs-BxJEQjEP.js").then(t=>t.c),[]);case"cv":return ue(()=>import("./cv-C1Ik4Ib9.js").then(t=>t.c),[]);case"cy":return ue(()=>import("./cy-CmjoGX5N.js").then(t=>t.c),[]);case"da":return ue(()=>import("./da-Bv4mZmhK.js").then(t=>t.d),[]);case"de-at":return ue(()=>import("./de-at-TlTK15wz.js").then(t=>t.d),[]);case"de-ch":return ue(()=>import("./de-ch-RY7vLwDt.js").then(t=>t.d),[]);case"de":return ue(()=>import("./de-Dt5anUto.js").then(t=>t.d),[]);case"dv":return ue(()=>import("./dv-NnWHzEfl.js").then(t=>t.d),[]);case"el":return ue(()=>import("./el-BQLvdVDr.js").then(t=>t.e),[]);case"en-au":return ue(()=>import("./en-au-LyC3Rhf_.js").then(t=>t.e),[]);case"en-ca":return ue(()=>import("./en-ca-BCOa7G2U.js").then(t=>t.e),[]);case"en-gb":return ue(()=>import("./en-gb-D7HpO3hV.js").then(t=>t.e),[]);case"en-ie":return ue(()=>import("./en-ie-CxlCR7m7.js").then(t=>t.e),[]);case"en-il":return ue(()=>import("./en-il-BIamxW2s.js").then(t=>t.e),[]);case"en-in":return ue(()=>import("./en-in-Du29628I.js").then(t=>t.e),[]);case"en-nz":return ue(()=>import("./en-nz-DpNWcrC2.js").then(t=>t.e),[]);case"en-sg":return ue(()=>import("./en-sg-HS39UufX.js").then(t=>t.e),[]);case"en-tt":return ue(()=>import("./en-tt-BpN8fnnE.js").then(t=>t.e),[]);case"en":return ue(()=>import("./en-DgPnuRYH.js").then(t=>t.e),[]);case"eo":return ue(()=>import("./eo-CFLEVQcx.js").then(t=>t.e),[]);case"es-do":return ue(()=>import("./es-do-CGB-dblH.js").then(t=>t.e),[]);case"es-mx":return ue(()=>import("./es-mx-DMiFM_iP.js").then(t=>t.e),[]);case"es-pr":return ue(()=>import("./es-pr-BmERpjP9.js").then(t=>t.e),[]);case"es-us":return ue(()=>import("./es-us-BA0GelMY.js").then(t=>t.e),[]);case"es":return ue(()=>import("./es-B2wU7KKb.js").then(t=>t.e),[]);case"et":return ue(()=>import("./et-k1s67nvw.js").then(t=>t.e),[]);case"eu":return ue(()=>import("./eu-oIcvv0Rs.js").then(t=>t.e),[]);case"fa":return ue(()=>import("./fa-BZ6Vd3PV.js").then(t=>t.f),[]);case"fi":return ue(()=>import("./fi-076Afi0X.js").then(t=>t.f),[]);case"fo":return ue(()=>import("./fo-C74PjCM5.js").then(t=>t.f),[]);case"fr-ca":return ue(()=>import("./fr-ca-BatCik2l.js").then(t=>t.f),[]);case"fr-ch":return ue(()=>import("./fr-ch-BjeQYjKr.js").then(t=>t.f),[]);case"fr":return ue(()=>import("./fr-D7pkQbkV.js").then(t=>t.f),[]);case"fy":return ue(()=>import("./fy-6ZOQppeQ.js").then(t=>t.f),[]);case"ga":return ue(()=>import("./ga-uK_I0PzH.js").then(t=>t.g),[]);case"gd":return ue(()=>import("./gd-YQAsHADG.js").then(t=>t.g),[]);case"gl":return ue(()=>import("./gl-DN4gp_uQ.js").then(t=>t.g),[]);case"gom-latn":return ue(()=>import("./gom-latn-CCNJcd0m.js").then(t=>t.g),[]);case"gu":return ue(()=>import("./gu-BEph_WT7.js").then(t=>t.g),[]);case"he":return ue(()=>import("./he-CRVYwbC6.js").then(t=>t.h),[]);case"hi":return ue(()=>import("./hi-Bram66aV.js").then(t=>t.h),[]);case"hr":return ue(()=>import("./hr-CI6EsoxI.js").then(t=>t.h),[]);case"hu":return ue(()=>import("./hu-DL_-gK9s.js").then(t=>t.h),[]);case"hy-am":return ue(()=>import("./hy-am-08BkXEE3.js").then(t=>t.h),[]);case"id":return ue(()=>import("./id-DIqSrNXZ.js").then(t=>t.i),[]);case"is":return ue(()=>import("./is-CYEXF0jS.js").then(t=>t.i),[]);case"it":return ue(()=>import("./it-DGvRmz9B.js").then(t=>t.i),[]);case"ja":return ue(()=>import("./ja-LTmgjwzm.js").then(t=>t.j),[]);case"jv":return ue(()=>import("./jv-BnJLERXH.js").then(t=>t.j),[]);case"ka":return ue(()=>import("./ka-B552lGfZ.js").then(t=>t.k),[]);case"kk":return ue(()=>import("./kk-BhQhuCFT.js").then(t=>t.k),[]);case"km":return ue(()=>import("./km-CbQJEfnx.js").then(t=>t.k),[]);case"kn":return ue(()=>import("./kn-DhvElKN5.js").then(t=>t.k),[]);case"ko":return ue(()=>import("./ko-CHdkyfmi.js").then(t=>t.k),[]);case"ku":return ue(()=>import("./ku-BYTljtRG.js").then(t=>t.k),[]);case"ky":return ue(()=>import("./ky-D0cteAON.js").then(t=>t.k),[]);case"lb":return ue(()=>import("./lb-DRaG0h8E.js").then(t=>t.l),[]);case"lo":return ue(()=>import("./lo-C-bktTZ5.js").then(t=>t.l),[]);case"lt":return ue(()=>import("./lt-Cjfmwp_V.js").then(t=>t.l),[]);case"lv":return ue(()=>import("./lv-nLminS5s.js").then(t=>t.l),[]);case"me":return ue(()=>import("./me-Ctc5JnPl.js").then(t=>t.m),[]);case"mi":return ue(()=>import("./mi-DyeKzRfT.js").then(t=>t.m),[]);case"mk":return ue(()=>import("./mk-BEr3xQcm.js").then(t=>t.m),[]);case"ml":return ue(()=>import("./ml-DjtwA2Cj.js").then(t=>t.m),[]);case"mn":return ue(()=>import("./mn-DIufe3s5.js").then(t=>t.m),[]);case"mr":return ue(()=>import("./mr-BoziPlMk.js").then(t=>t.m),[]);case"ms-my":return ue(()=>import("./ms-my-D_Kszb8j.js").then(t=>t.m),[]);case"ms":return ue(()=>import("./ms-Do-RBt9o.js").then(t=>t.m),[]);case"mt":return ue(()=>import("./mt-B4Be5Spq.js").then(t=>t.m),[]);case"my":return ue(()=>import("./my-D9WjwNeD.js").then(t=>t.m),[]);case"nb":return ue(()=>import("./nb-L4gorKiy.js").then(t=>t.n),[]);case"ne":return ue(()=>import("./ne-vwPzDqya.js").then(t=>t.n),[]);case"nl-be":return ue(()=>import("./nl-be-C5NghHIy.js").then(t=>t.n),[]);case"nl":return ue(()=>import("./nl-u5gyc3R5.js").then(t=>t.n),[]);case"nn":return ue(()=>import("./nn-Dqqdpl8E.js").then(t=>t.n),[]);case"oc-lnc":return ue(()=>import("./oc-lnc-CMqsV5kn.js").then(t=>t.o),[]);case"pa-in":return ue(()=>import("./pa-in-Du71bNl9.js").then(t=>t.p),[]);case"pl":return ue(()=>import("./pl-DfuBo2do.js").then(t=>t.p),[]);case"pt-br":return ue(()=>import("./pt-br-7Dfrt3CO.js").then(t=>t.p),[]);case"pt":return ue(()=>import("./pt-BoGWzsSu.js").then(t=>t.p),[]);case"rn":return ue(()=>import("./rn-BRkzzZUG.js").then(t=>t.r),[]);case"ro":return ue(()=>import("./ro-C7Bo7JoK.js").then(t=>t.r),[]);case"ru":return ue(()=>import("./ru-Y8auHj7s.js").then(t=>t.r),[]);case"rw":return ue(()=>import("./rw-OupZoVcK.js").then(t=>t.r),[]);case"sd":return ue(()=>import("./sd-abr6WWBg.js").then(t=>t.s),[]);case"se":return ue(()=>import("./se-CLDNM-k6.js").then(t=>t.s),[]);case"si":return ue(()=>import("./si-xOu6-gKu.js").then(t=>t.s),[]);case"sk":return ue(()=>import("./sk-BdB2hCx3.js").then(t=>t.s),[]);case"sl":return ue(()=>import("./sl-Bd9HuVmv.js").then(t=>t.s),[]);case"sq":return ue(()=>import("./sq-wS8WBzRQ.js").then(t=>t.s),[]);case"sr-cyrl":return ue(()=>import("./sr-cyrl-BHkhJLT9.js").then(t=>t.s),[]);case"sr":return ue(()=>import("./sr-BUvt2Ekw.js").then(t=>t.s),[]);case"ss":return ue(()=>import("./ss-DlnuPHvd.js").then(t=>t.s),[]);case"sv-fi":return ue(()=>import("./sv-fi-Bu8-L0ii.js").then(t=>t.s),[]);case"sv":return ue(()=>import("./sv-UC4qdiU1.js").then(t=>t.s),[]);case"sw":return ue(()=>import("./sw-DJ9y3Kz5.js").then(t=>t.s),[]);case"ta":return ue(()=>import("./ta-3R8pakvB.js").then(t=>t.t),[]);case"te":return ue(()=>import("./te-DJF0J82o.js").then(t=>t.t),[]);case"tet":return ue(()=>import("./tet-B7NTNWbs.js").then(t=>t.t),[]);case"tg":return ue(()=>import("./tg-Dz8BaRCG.js").then(t=>t.t),[]);case"th":return ue(()=>import("./th-B12JxWiT.js").then(t=>t.t),[]);case"tk":return ue(()=>import("./tk-_lJc8LbU.js").then(t=>t.t),[]);case"tl-ph":return ue(()=>import("./tl-ph-BrF5AV7G.js").then(t=>t.t),[]);case"tlh":return ue(()=>import("./tlh-C3g53DIs.js").then(t=>t.t),[]);case"tr":return ue(()=>import("./tr-BFgJVhWE.js").then(t=>t.t),[]);case"tzl":return ue(()=>import("./tzl-BtQ8HG4V.js").then(t=>t.t),[]);case"tzm-latn":return ue(()=>import("./tzm-latn-Bw--04nM.js").then(t=>t.t),[]);case"tzm":return ue(()=>import("./tzm-AjaIIWZ5.js").then(t=>t.t),[]);case"ug-cn":return ue(()=>import("./ug-cn-uDhRTQm4.js").then(t=>t.u),[]);case"uk":return ue(()=>import("./uk-B-0T_ms1.js").then(t=>t.u),[]);case"ur":return ue(()=>import("./ur-DbS3MgpX.js").then(t=>t.u),[]);case"uz-latn":return ue(()=>import("./uz-latn-C-mAyERJ.js").then(t=>t.u),[]);case"uz":return ue(()=>import("./uz-BPV0995e.js").then(t=>t.u),[]);case"vi":return ue(()=>import("./vi-DpX_7IH7.js").then(t=>t.v),[]);case"x-pseudo":return ue(()=>import("./x-pseudo-xZIRAWxw.js").then(t=>t.x),[]);case"yo":return ue(()=>import("./yo-_lhmbC11.js").then(t=>t.y),[]);case"zh-cn":return ue(()=>import("./zh-cn-DoL_-ikT.js").then(t=>t.z),[]);case"zh-hk":return ue(()=>import("./zh-hk-CykwH_S-.js").then(t=>t.z),[]);case"zh-tw":return ue(()=>import("./zh-tw-Wfm5zMbt.js").then(t=>t.z),[]);case"zh":return ue(()=>import("./zh-B0CGfP9L.js").then(t=>t.z),[]);default:return ue(()=>import("./en-DgPnuRYH.js").then(t=>t.e),[])}}}function qSn(){return n=>{switch(n){case"en":return ue(()=>import("./en_US-Bu1-ttwh.js").then(e=>e.e),__vite__mapDeps([200,201,202]));case"it":return ue(()=>import("./it_IT-DvS6rGCq.js").then(e=>e.i),__vite__mapDeps([203,201,202]));case"de":return ue(()=>import("./de_DE-DdFweBhS.js").then(e=>e.d),__vite__mapDeps([204,201,202]));case"fr":return ue(()=>import("./fr_FR-Dy6owzIT.js").then(e=>e.f),__vite__mapDeps([205,201,202]));case"pt_BR":return ue(()=>import("./pt_BR-C9TsgmKN.js").then(e=>e.p),__vite__mapDeps([206,201,202]));case"nl":return ue(()=>import("./nl_NL-CX7d-5fc.js").then(e=>e.n),__vite__mapDeps([207,201,202]));case"es":return ue(()=>import("./es_ES-Bfjv5Ok-.js").then(e=>e.e),__vite__mapDeps([208,201,202]));case"nb_NO":return ue(()=>import("./nb_NO-DmxNxCwP.js").then(e=>e.n),__vite__mapDeps([209,201,202]));case"da":return ue(()=>import("./da_DK-zCv4o9u0.js").then(e=>e.d),__vite__mapDeps([210,201,202]));case"ja":return ue(()=>import("./ja_JP-D00qwTWa.js").then(e=>e.j),__vite__mapDeps([211,201,202]));case"sv":return ue(()=>import("./sv_SE-ChEtEsJQ.js").then(e=>e.s),__vite__mapDeps([212,201,202]));case"es_ES":return ue(()=>import("./es_ES-Bfjv5Ok-.js").then(e=>e.e),__vite__mapDeps([208,201,202]));case"fr_CA":return ue(()=>import("./fr_CA-DEb8R9oZ.js").then(e=>e.f),__vite__mapDeps([213,201,202]));case"lt":return ue(()=>import("./lt_LT-C3xS2hVI.js").then(e=>e.l),__vite__mapDeps([214,201,202]));case"pl":return ue(()=>import("./pl_PL-CGPHAKi7.js").then(e=>e.p),__vite__mapDeps([215,201,202]));case"cs":return ue(()=>import("./cs_CZ-Dwz6unpB.js").then(e=>e.c),__vite__mapDeps([216,201,202]));case"hr":return ue(()=>import("./hr_HR-DSFX2ChI.js").then(e=>e.h),__vite__mapDeps([217,201,202]));case"sq":return ue(()=>import("./en_US-Bu1-ttwh.js").then(e=>e.e),__vite__mapDeps([200,201,202]));case"el":return ue(()=>import("./el_GR-C--GkuXQ.js").then(e=>e.e),__vite__mapDeps([218,201,202]));case"en_GB":return ue(()=>import("./en_GB-CcU4vPfu.js").then(e=>e.e),__vite__mapDeps([219,201,202]));case"pt_PT":return ue(()=>import("./pt_PT-Cx4IQlhJ.js").then(e=>e.p),__vite__mapDeps([220,201,202]));case"sl":return ue(()=>import("./sl_SI-BPWKe95Z.js").then(e=>e.s),__vite__mapDeps([221,201]));case"fi":return ue(()=>import("./fi_FI-BbG369FV.js").then(e=>e.f),__vite__mapDeps([222,201,202]));case"ro":return ue(()=>import("./ro_RO-C-h-gwMb.js").then(e=>e.r),__vite__mapDeps([223,201,202]));case"tr_TR":return ue(()=>import("./tr_TR-DYnMuPT2.js").then(e=>e.t),__vite__mapDeps([224,201,202]));case"th":return ue(()=>import("./th_TH-fvI7rdhZ.js").then(e=>e.t),__vite__mapDeps([225,201,202]));case"mk_MK":return ue(()=>import("./mk_MK-DA4YMq95.js").then(e=>e.m),__vite__mapDeps([226,201,202]));case"zh_TW":return ue(()=>import("./zh_TW-C8OgIE63.js").then(e=>e.z),__vite__mapDeps([227,201,202]));case"ru_RU":return ue(()=>import("./ru_RU-5-Lg8K-z.js").then(e=>e.r),__vite__mapDeps([228,201,202]));case"ar":return ue(()=>import("./ar_EG-Bq1mY9oU.js").then(e=>e.a),__vite__mapDeps([229,201,202]));case"fa":return ue(()=>import("./fa_IR-DQWXhdUm.js").then(e=>e.f),__vite__mapDeps([230,201,202]));case"lv_LV":return ue(()=>import("./lv_LV-Dcs5Sm8e.js").then(e=>e.l),__vite__mapDeps([231,201,202]));case"sr":return ue(()=>import("./sr_RS-C7t8eZRa.js").then(e=>e.s),__vite__mapDeps([232,201,202]));case"sk":return ue(()=>import("./sk_SK-DxGGcu0I.js").then(e=>e.s),__vite__mapDeps([233,201,202]));case"et":return ue(()=>import("./et_EE-DbjN1_jc.js").then(e=>e.e),__vite__mapDeps([234,201,202]));case"bg":return ue(()=>import("./bg_BG-CliAXSn5.js").then(e=>e.b),__vite__mapDeps([235,201,202]));case"he":return ue(()=>import("./he_IL-9QRboGVg.js").then(e=>e.h),__vite__mapDeps([236,201,202]));case"km_KH":return ue(()=>import("./km_KH-B-zrXF72.js").then(e=>e.k),__vite__mapDeps([237,201,202]));case"hu":return ue(()=>import("./hu_HU-h6cX-ZPG.js").then(e=>e.h),__vite__mapDeps([238,201,202]));case"fr_CH":return ue(()=>import("./fr_FR-Dy6owzIT.js").then(e=>e.f),__vite__mapDeps([205,201,202]));default:return ue(()=>import("./en_US-Bu1-ttwh.js").then(e=>e.e),__vite__mapDeps([200,201,202]))}}}const $Fe=As.div` &:hover { background-color: ${n=>n.theme.hoverColor}; }: `;function KSn(n){var b,y,C,S,k;const[e]=xe(),t=Yi(),i=Fr(),r=xt(),s=zi(),o=xu(),[a,l]=x.useState(),[c,u]=x.useState(!1),[d,f]=x.useState(0),p=Xs(),g=I=>{p("settings.name",I);const L=I.split("").filter(N=>/[a-zA-Z]/.test(N)).join("").toLowerCase();p("subdomain",L)},m=I=>{Je("PUT",ze("/api/v1/companies/:id",{id:o==null?void 0:o.id}),o).then(L=>{pe.success("updated_company"),n.setIsModalOpen(!1),i(gk({object:"company",data:L.data.data})),i(zu("company"))}).catch(L=>{var N;((N=L.response)==null?void 0:N.status)===422&&(l(L.response.data),pe.dismiss())}).finally(()=>u(!1))},_=I=>{pe.processing(),Je("POST",ze("/api/v1/one_time_token"),{context:I}).then(L=>{var P;let N="stripe/signup/:token";I==="paypal_ppcp"&&(N="paypal?hash=:token"),(P=window.open(Ut(`https://invoicing.co/${N}`,{token:L.data.hash}),"_blank"))==null||P.focus(),pe.dismiss()})},v=async I=>{if(!c){if(pn.isEqual(s,o)){n.setIsModalOpen(!1);return}pe.processing(),l(void 0),u(!0),o!=null&&o.subdomain&&To()||m()}};return h.jsx(pr,{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:h.jsxs("div",{className:"flex flex-col space-y-6",children:[d===0&&h.jsxs("div",{className:"flex flex-col space-y-4",children:[h.jsx(lt,{label:e("company_name"),value:(b=o==null?void 0:o.settings)==null?void 0:b.name,onValueChange:I=>g(I),errorMessage:(y=a==null?void 0:a.errors)==null?void 0:y.name,changeOverride:!0}),To(),h.jsx(C9,{label:e("language"),value:((C=o==null?void 0:o.settings)==null?void 0:C.language_id)||"",onChange:I=>p("settings.language_id",I),errorMessage:(S=a==null?void 0:a.errors)==null?void 0:S.language_id}),h.jsx(HO,{label:e("currency"),value:((k=o==null?void 0:o.settings)==null?void 0:k.currency_id)||"",onChange:I=>p("settings.currency_id",I)})]}),d===1&&h.jsx(Qit,{isSettingsPage:!1}),d===2&&h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsx($Fe,{className:"flex w-full justify-center h-28 cursor-pointer",theme:{hoverColor:r.$5},onClick:()=>_("stripe_connect"),children:h.jsx(Kpe,{name:"stripe",style:{width:"64%"}})}),h.jsx($Fe,{className:"flex w-full justify-center h-28 cursor-pointer",theme:{hoverColor:r.$5},onClick:()=>_("paypal_ppcp"),children:h.jsx(Kpe,{name:"paypal_ppcp",style:{width:"38%",transform:"scale(1.7)",pointerEvents:"none"}})}),h.jsx(dn,{behavior:"button",className:"w-full mt-4",onClick:()=>{n.setIsModalOpen(!1),t("/settings/gateways/create")},children:e("all_payment_gateways")})]}),h.jsx("div",{className:"flex justify-end",children:h.jsx(dn,{behavior:"button",onClick:()=>{d===0&&v(),d!==0&&f(I=>I+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 urt=Ls(null);function K5r(n,e){const{id:t}=Yl(),{disableFunctionality:i=!1}=e||{};ts(urt);const[r,s]=oo(n),[o,a]=oo(i4),[l,c]=x.useState();return x.useEffect(()=>{r&&l&&(r.id,l.id)},[r]),xL(()=>{r&&r.id===t&&l&&(c(pn.cloneDeep(r)),a(u=>u&&{...u,prevent:!1}))},50,[r==null?void 0:r.updated_at]),xL(()=>{r&&(!t||r.id===t)&&!l&&c(pn.cloneDeep(r))},50,[r,l]),x.useEffect(()=>()=>{c(void 0),a(u=>u&&{...u,prevent:!1})},[]),[r,s]}function GSn(){const[n]=xe(),e=Yi(),t=gc(),i=!1,r=ji(urt),[s,o]=oo(aqe),a=ji(lqe),[l,c]=oo(i4),[u,d]=oo(GZ),[f,p]=x.useState(!1),{nonPreventedLocations:g}=s,m=()=>{const v=l.actionKey==="browserBack",{url:b,externalLink:y,fn:C}=a||{};y||(o(I=>({...I,lastLocation:""})),c({prevent:!1,actionKey:void 0}));const S=g.length;let k=g[S-1];k=k!==t.pathname?k:g[S-2],v&&k&&e(k),a&&(b&&(y?window.open(b,"_blank"):e(b)),C==null||C()),d(!1)},_=()=>{const v=l.actionKey==="browserBack";c(b=>b&&{...b,actionKey:b.actionKey!=="browserBack"?void 0:"browserBack"}),d(!1),v&&history.pushState(null,document.title,window.location.href)};return x.useEffect(()=>{p(u)},[u]),h.jsx(pr,{visible:f,onClose:()=>{},disableClosing:!0,children:h.jsxs("div",{className:"flex flex-col space-y-8",children:[h.jsx("span",{className:"font-medium text-lg text-center",children:n("error_unsaved_changes")}),r&&i,h.jsxs("div",{className:"flex justify-between",children:[h.jsx(dn,{type:"secondary",onClick:_,children:n("continue_editing")}),h.jsx(dn,{onClick:m,children:n("discard_changes")})]})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://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 Gle=["mousedown","mousemove","wheel","keydown","touchstart","scroll"];function YSn(){const n=zi(),e=x.useRef(null),t=()=>{hCe()},i=()=>{e.current&&clearTimeout(e.current),e.current=setTimeout(t,n==null?void 0:n.session_timeout)},r=()=>{i()};return x.useEffect(()=>(n!=null&&n.session_timeout?(Gle.forEach(s=>{window.addEventListener(s,r,{passive:!0})}),i()):(e.current&&clearTimeout(e.current),Gle.forEach(s=>window.removeEventListener(s,r))),()=>{e.current&&clearTimeout(e.current),Gle.forEach(s=>window.removeEventListener(s,r))}),[n==null?void 0:n.session_timeout]),null}/** * 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 QSn(){const{preferences:n}=qw();return x.useEffect(()=>{if(n.use_system_fonts){HFe("system-ui");return}HFe("Inter var")},[n.use_system_fonts]),null}function HFe(n){const e=window.getComputedStyle(document.body).fontFamily.split(",").map(i=>i.trim()),t=[n,...e].join(", ");document.body.style.fontFamily=t}const XSn=Ls({refetchEntityId:"",refetchEntity:"recurring_invoices",visible:!1});function ZSn(){const[n]=xe(),{isOwner:e}=go(),{i18n:t}=xe(),i=Cu(O=>O.settings.darkMode),r=Yi(),{id:s}=Yl(),o=Ml(),a=gc(),l=zi();YSn(),zLt();const c=fze(),u=jo(),d=gze(),f=qSn(),p=USn(),g=qQe(),m=Qo({overwrite:!1}),_=ts(Hwe),v=ts(XSn),b=ts(dEe),y=ts(FLt),{isCompanySettingsActive:C,isGroupSettingsActive:S}=el(),[k,I]=x.useState(!1),L=l?d(o!=null&&o.language_id&&o.language_id.length>0?o.language_id:l.settings.language_id):void 0,N=O=>{var F,V;if(!s&&!a.pathname.startsWith("/settings")){const{error:M}=O.detail;if(M.response.data.errors){const B=M.response.data.errors||{},W=(F=Object.keys(B))==null?void 0:F[0],q=(V=B==null?void 0:B[W])==null?void 0:V[0];q&&pe.error(q)}}};x.useEffect(()=>{if(m){const O=m.dark_mode?Aze:Nze;document.body.style.backgroundColor=O.$23,document.body.style.colorScheme=O.$0}},[m]),x.useEffect(()=>{L!=null&&L.locale&&(p(L.locale).then(O=>{y(O),Jn.locale(O)}),f(L.locale).then(O=>{b(O)}),t.hasResourceBundle(L.locale,"translation")?t.changeLanguage(L.locale):fetch(new URL(Object.assign({"/src/resources/lang/af_ZA/af_ZA.json":a_t,"/src/resources/lang/ar/ar.json":l_t,"/src/resources/lang/bg/bg.json":c_t,"/src/resources/lang/ca/ca.json":u_t,"/src/resources/lang/cs/cs.json":d_t,"/src/resources/lang/da/da.json":h_t,"/src/resources/lang/de/de.json":f_t,"/src/resources/lang/el/el.json":p_t,"/src/resources/lang/en/en.json":g_t,"/src/resources/lang/en_GB/en_GB.json":m_t,"/src/resources/lang/es/es.json":__t,"/src/resources/lang/es_ES/es_ES.json":v_t,"/src/resources/lang/et/et.json":b_t,"/src/resources/lang/fa/fa.json":y_t,"/src/resources/lang/fi/fi.json":C_t,"/src/resources/lang/fr/fr.json":w_t,"/src/resources/lang/fr_CA/fr_CA.json":x_t,"/src/resources/lang/fr_CH/fr_CH.json":S_t,"/src/resources/lang/he/he.json":E_t,"/src/resources/lang/hr/hr.json":k_t,"/src/resources/lang/hu/hu.json":T_t,"/src/resources/lang/id_ID/id_ID.json":I_t,"/src/resources/lang/it/it.json":L_t,"/src/resources/lang/ja/ja.json":A_t,"/src/resources/lang/km_KH/km_KH.json":N_t,"/src/resources/lang/lo_LA/lo_LA.json":D_t,"/src/resources/lang/lt/lt.json":R_t,"/src/resources/lang/lv_LV/lv_LV.json":P_t,"/src/resources/lang/mk_MK/mk_MK.json":O_t,"/src/resources/lang/nb_NO/nb_NO.json":M_t,"/src/resources/lang/nl/nl.json":j_t,"/src/resources/lang/pl/pl.json":F_t,"/src/resources/lang/pt_BR/pt_BR.json":B_t,"/src/resources/lang/pt_PT/pt_PT.json":$_t,"/src/resources/lang/ro/ro.json":H_t,"/src/resources/lang/ru_RU/ru_RU.json":V_t,"/src/resources/lang/sk/sk.json":W_t,"/src/resources/lang/sl/sl.json":z_t,"/src/resources/lang/sq/sq.json":U_t,"/src/resources/lang/sr/sr.json":q_t,"/src/resources/lang/sv/sv.json":K_t,"/src/resources/lang/th/th.json":G_t,"/src/resources/lang/tr_TR/tr_TR.json":Y_t,"/src/resources/lang/vi/vi.json":Q_t,"/src/resources/lang/zh_TW/zh_TW.json":X_t})[`/src/resources/lang/${L.locale}/${L.locale}.json`],import.meta.url).href).then(O=>O.json()).then(O=>{t.addResources(L.locale,"translation",O),t.changeLanguage(L.locale)}))},[i,L]),x.useEffect(()=>{window.addEventListener("navigate.invalid.page",()=>r("/not_found")),window.addEventListener("reset.password.required",()=>{_(!1)}),window.addEventListener("refetch",O=>{const{property:F}=O.detail;c(F)})},[]),x.useEffect(()=>(window.removeEventListener("display.error.toaster",N),window.addEventListener("display.error.toaster",N),()=>{window.removeEventListener("display.error.toaster",N)}),[s,a]),x.useEffect(()=>{var F;const O=(F=l==null?void 0:l.settings)==null?void 0:F.name;l&&(!O||O===n("untitled_company"))&&localStorage.getItem("COMPANY-EDIT-OPENED")!=="true"&&(localStorage.setItem("COMPANY-EDIT-OPENED","true"),I(!0))},[l]),x.useEffect(()=>{!a.pathname.startsWith("/settings")&&!C&&g(),a.pathname.startsWith("/settings/group_settings")&&S&&r("/settings/company_details")},[a]),x.useEffect(()=>{o&&Object.keys(o).length&&a.pathname.endsWith("/dashboard")&&!u("view_dashboard")&&r("/settings/user_details")},[a,o]);const P=lCe();return N1t(),x.useEffect(()=>(l&&P&&(P.connection.bind("disconnected",()=>{console.log("Disconnected from Pusher")}),P.connection.bind("error",()=>{console.error("Error from Pusher")}),P.connect()),()=>{P&&l&&P.disconnect()}),[l==null?void 0:l.company_key]),QSn(),cCe({on:"App\\Events\\Socket\\RefreshEntity",callback:({data:O})=>{const F=O;F.entity_id!==s?ii([F.entity]):v({visible:!0,refetchEntity:F.entity,refetchEntityId:F.entity_id||""})}}),h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"App",children:[h.jsx(wCt,{position:"top-center"}),zSn]}),h.jsx(KSn,{isModalOpen:k&&e,setIsModalOpen:I}),h.jsx(GSn,{})]})}const drt=Object.prototype.toString;function hrt(n){switch(drt.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return kw(n,Error)}}function D4(n,e){return drt.call(n)===`[object ${e}]`}function OEe(n){return D4(n,"ErrorEvent")}function VFe(n){return D4(n,"DOMError")}function JSn(n){return D4(n,"DOMException")}function Py(n){return D4(n,"String")}function MEe(n){return typeof n=="object"&&n!==null&&"__sentry_template_string__"in n&&"__sentry_template_values__"in n}function jEe(n){return n===null||MEe(n)||typeof n!="object"&&typeof n!="function"}function XO(n){return D4(n,"Object")}function Aee(n){return typeof Event<"u"&&kw(n,Event)}function eEn(n){return typeof Element<"u"&&kw(n,Element)}function tEn(n){return D4(n,"RegExp")}function Nee(n){return!!(n&&n.then&&typeof n.then=="function")}function nEn(n){return XO(n)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n}function frt(n){return typeof n=="number"&&n!==n}function kw(n,e){try{return n instanceof e}catch{return!1}}function prt(n){return!!(typeof n=="object"&&n!==null&&(n.__isVue||n._isVue))}function kP(n,e=0){return typeof n!="string"||e===0||n.length<=e?n:`${n.slice(0,e)}...`}function WFe(n,e){if(!Array.isArray(n))return"";const t=[];for(let i=0;i<n.length;i++){const r=n[i];try{prt(r)?t.push("[VueViewModel]"):t.push(String(r))}catch{t.push("[value cannot be serialized]")}}return t.join(e)}function iEn(n,e,t=!1){return Py(n)?tEn(e)?e.test(n):Py(e)?t?n===e:n.includes(e):!1:!1}function D9(n,e=[],t=!1){return e.some(i=>iEn(n,i,t))}function rEn(n,e,t=250,i,r,s,o){if(!s.exception||!s.exception.values||!o||!kw(o.originalException,Error))return;const a=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;a&&(s.exception.values=sEn(Gpe(n,e,r,o.originalException,i,s.exception.values,a,0),t))}function Gpe(n,e,t,i,r,s,o,a){if(s.length>=t+1)return s;let l=[...s];if(kw(i[r],Error)){zFe(o,a);const c=n(e,i[r]),u=l.length;UFe(c,r,u,a),l=Gpe(n,e,t,i[r],r,[c,...l],c,u)}return Array.isArray(i.errors)&&i.errors.forEach((c,u)=>{if(kw(c,Error)){zFe(o,a);const d=n(e,c),f=l.length;UFe(d,`errors[${u}]`,f,a),l=Gpe(n,e,t,c,r,[d,...l],d,f)}}),l}function zFe(n,e){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,...n.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function UFe(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 sEn(n,e){return n.map(t=>(t.value&&(t.value=kP(t.value,e)),t))}function DV(n){return n&&n.Math==Math?n:void 0}const Aa=typeof globalThis=="object"&&DV(globalThis)||typeof window=="object"&&DV(window)||typeof self=="object"&&DV(self)||typeof global=="object"&&DV(global)||function(){return this}()||{};function FEe(){return Aa}function grt(n,e,t){const i=t||Aa,r=i.__SENTRY__=i.__SENTRY__||{};return r[n]||(r[n]=e())}const TP=FEe(),oEn=80;function ZO(n,e={}){if(!n)return"<unknown>";try{let t=n;const i=5,r=[];let s=0,o=0;const a=" > ",l=a.length;let c;const u=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||oEn;for(;t&&s++<i&&(c=aEn(t,u),!(c==="html"||s>1&&o+r.length*l+c.length>=d));)r.push(c),o+=c.length,t=t.parentNode;return r.reverse().join(a)}catch{return"<unknown>"}}function aEn(n,e){const t=n,i=[];let r,s,o,a,l;if(!t||!t.tagName)return"";if(TP.HTMLElement&&t instanceof HTMLElement&&t.dataset&&t.dataset.sentryComponent)return t.dataset.sentryComponent;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&&Py(r))for(s=r.split(/\s+/),l=0;l<s.length;l++)i.push(`.${s[l]}`);const u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)o=u[l],a=t.getAttribute(o),a&&i.push(`[${o}="${a}"]`);return i.join("")}function lEn(){try{return TP.document.location.href}catch{return""}}function cEn(n){return TP.document&&TP.document.querySelector?TP.document.querySelector(n):null}function mrt(n){if(!TP.HTMLElement)return null;let e=n;const t=5;for(let i=0;i<t;i++){if(!e)return null;if(e instanceof HTMLElement&&e.dataset.sentryComponent)return e.dataset.sentryComponent;e=e.parentNode}return null}const R4=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,uEn="Sentry Logger ",Ype=["debug","info","warn","error","log","assert","trace"],vK={};function Dee(n){if(!("console"in Aa))return n();const e=Aa.console,t={},i=Object.keys(vK);i.forEach(r=>{const s=vK[r];t[r]=e[r],e[r]=s});try{return n()}finally{i.forEach(r=>{e[r]=t[r]})}}function dEn(){let n=!1;const e={enable:()=>{n=!0},disable:()=>{n=!1},isEnabled:()=>n};return R4?Ype.forEach(t=>{e[t]=(...i)=>{n&&Dee(()=>{Aa.console[t](`${uEn}[${t}]:`,...i)})}}):Ype.forEach(t=>{e[t]=()=>{}}),e}const ni=dEn(),hEn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function fEn(n){return n==="http"||n==="https"}function P4(n,e=!1){const{host:t,path:i,pass:r,port:s,projectId:o,protocol:a,publicKey:l}=n;return`${a}://${l}${e&&r?`:${r}`:""}@${t}${s?`:${s}`:""}/${i&&`${i}/`}${o}`}function pEn(n){const e=hEn.exec(n);if(!e){Dee(()=>{console.error(`Invalid Sentry Dsn: ${n}`)});return}const[t,i,r="",s,o="",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 _rt({host:s,pass:r,path:l,projectId:c,port:o,protocol:t,publicKey:i})}function _rt(n){return{protocol:n.protocol,publicKey:n.publicKey||"",pass:n.pass||"",host:n.host,port:n.port||"",path:n.path||"",projectId:n.projectId}}function gEn(n){if(!R4)return!0;const{port:e,projectId:t,protocol:i}=n;return["protocol","publicKey","host","projectId"].find(o=>n[o]?!1:(ni.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:t.match(/^\d+$/)?fEn(i)?e&&isNaN(parseInt(e,10))?(ni.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(ni.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(ni.error(`Invalid Sentry Dsn: Invalid projectId ${t}`),!1)}function mEn(n){const e=typeof n=="string"?pEn(n):_rt(n);if(!(!e||!gEn(e)))return e}class gy 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 yh(n,e,t){if(!(e in n))return;const i=n[e],r=t(i);typeof r=="function"&&vrt(r,i),n[e]=r}function DL(n,e,t){try{Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0})}catch{R4&&ni.log(`Failed to add non-enumerable property "${e}" to object`,n)}}function vrt(n,e){try{const t=e.prototype||{};n.prototype=e.prototype=t,DL(n,"__sentry_original__",e)}catch{}}function BEe(n){return n.__sentry_original__}function _En(n){return Object.keys(n).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`).join("&")}function brt(n){if(hrt(n))return{message:n.message,name:n.name,stack:n.stack,...KFe(n)};if(Aee(n)){const e={type:n.type,target:qFe(n.target),currentTarget:qFe(n.currentTarget),...KFe(n)};return typeof CustomEvent<"u"&&kw(n,CustomEvent)&&(e.detail=n.detail),e}else return n}function qFe(n){try{return eEn(n)?ZO(n):Object.prototype.toString.call(n)}catch{return"<unknown>"}}function KFe(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 vEn(n,e=40){const t=Object.keys(brt(n));if(t.sort(),!t.length)return"[object has no keys]";if(t[0].length>=e)return kP(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:kP(r,e)}return""}function mm(n){return Qpe(n,new Map)}function Qpe(n,e){if(bEn(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]=Qpe(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(Qpe(r,e))}),i}return n}function bEn(n){if(!XO(n))return!1;try{const e=Object.getPrototypeOf(n).constructor.name;return!e||e==="Object"}catch{return!0}}const yrt=50,GFe=/\(error: (.*)\)/,YFe=/captureMessage|captureException/;function Crt(...n){const e=n.sort((t,i)=>t[0]-i[0]).map(t=>t[1]);return(t,i=0)=>{const r=[],s=t.split(` `);for(let o=i;o<s.length;o++){const a=s[o];if(a.length>1024)continue;const l=GFe.test(a)?a.replace(GFe,"$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>=yrt)break}}return CEn(r)}}function yEn(n){return Array.isArray(n)?Crt(...n):n}function CEn(n){if(!n.length)return[];const e=Array.from(n);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),YFe.test(e[e.length-1].function||"")&&(e.pop(),YFe.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,yrt).map(t=>({...t,filename:t.filename||e[e.length-1].filename,function:t.function||"?"}))}const Yle="<anonymous>";function Tw(n){try{return!n||typeof n!="function"?Yle:n.name||Yle}catch{return Yle}}const Gz={},QFe={};function PA(n,e){Gz[n]=Gz[n]||[],Gz[n].push(e)}function OA(n,e){QFe[n]||(e(),QFe[n]=!0)}function kb(n,e){const t=n&&Gz[n];if(t)for(const i of t)try{i(e)}catch(r){R4&&ni.error(`Error while triggering instrumentation handler. Type: ${n} Name: ${Tw(i)} Error:`,r)}}function wEn(n){const e="console";PA(e,n),OA(e,xEn)}function xEn(){"console"in Aa&&Ype.forEach(function(n){n in Aa.console&&yh(Aa.console,n,function(e){return vK[n]=e,function(...t){kb("console",{args:t,level:n});const r=vK[n];r&&r.apply(Aa.console,t)}})})}function pu(){const n=Aa,e=n.crypto||n.msCrypto;let t=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(t=()=>{const i=new Uint8Array(1);return e.getRandomValues(i),i[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,i=>(i^(t()&15)>>i/4).toString(16))}function wrt(n){return n.exception&&n.exception.values?n.exception.values[0]:void 0}function CS(n){const{message:e,event_id:t}=n;if(e)return e;const i=wrt(n);return i?i.type&&i.value?`${i.type}: ${i.value}`:i.type||i.value||t||"<unknown>":t||"<unknown>"}function Xpe(n,e,t){const i=n.exception=n.exception||{},r=i.values=i.values||[],s=r[0]=r[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function G8(n,e){const t=wrt(n);if(!t)return;const i={type:"generic",handled:!0},r=t.mechanism;if(t.mechanism={...i,...r,...e},e&&"data"in e){const s={...r&&r.data,...e.data};t.mechanism.data=s}}function XFe(n){if(n&&n.__sentry_captured__)return!0;try{DL(n,"__sentry_captured__",!0)}catch{}return!1}function xrt(n){return Array.isArray(n)?n:[n]}const rR=Aa,SEn=1e3;let ZFe,Zpe,Jpe;function EEn(n){const e="dom";PA(e,n),OA(e,kEn)}function kEn(){if(!rR.document)return;const n=kb.bind(null,"dom"),e=JFe(n,!0);rR.document.addEventListener("click",e,!1),rR.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(t=>{const i=rR[t]&&rR[t].prototype;!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener")||(yh(i,"addEventListener",function(r){return function(s,o,a){if(s==="click"||s=="keypress")try{const l=this,c=l.__sentry_instrumentation_handlers__=l.__sentry_instrumentation_handlers__||{},u=c[s]=c[s]||{refCount:0};if(!u.handler){const d=JFe(n);u.handler=d,r.call(this,s,d,a)}u.refCount++}catch{}return r.call(this,s,o,a)}}),yh(i,"removeEventListener",function(r){return function(s,o,a){if(s==="click"||s=="keypress")try{const l=this,c=l.__sentry_instrumentation_handlers__||{},u=c[s];u&&(u.refCount--,u.refCount<=0&&(r.call(this,s,u.handler,a),u.handler=void 0,delete c[s]),Object.keys(c).length===0&&delete l.__sentry_instrumentation_handlers__)}catch{}return r.call(this,s,o,a)}}))})}function TEn(n){if(n.type!==Zpe)return!1;try{if(!n.target||n.target._sentryId!==Jpe)return!1}catch{}return!0}function IEn(n,e){return n!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function JFe(n,e=!1){return t=>{if(!t||t._sentryCaptured)return;const i=LEn(t);if(IEn(t.type,i))return;DL(t,"_sentryCaptured",!0),i&&!i._sentryId&&DL(i,"_sentryId",pu());const r=t.type==="keypress"?"input":t.type;TEn(t)||(n({event:t,name:r,global:e}),Zpe=t.type,Jpe=i?i._sentryId:void 0),clearTimeout(ZFe),ZFe=rR.setTimeout(()=>{Jpe=void 0,Zpe=void 0},SEn)}}function LEn(n){try{return n.target}catch{return null}}const ege=FEe();function Srt(){if(!("fetch"in ege))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function tge(n){return n&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(n.toString())}function AEn(){if(typeof EdgeRuntime=="string")return!0;if(!Srt())return!1;if(tge(ege.fetch))return!0;let n=!1;const e=ege.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=tge(t.contentWindow.fetch)),e.head.removeChild(t)}catch(t){R4&&ni.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return n}function Ert(n){const e="fetch";PA(e,n),OA(e,NEn)}function NEn(){AEn()&&yh(Aa,"fetch",function(n){return function(...e){const{method:t,url:i}=DEn(e),r={args:e,fetchData:{method:t,url:i},startTimestamp:Date.now()};return kb("fetch",{...r}),n.apply(Aa,e).then(s=>{const o={...r,endTimestamp:Date.now(),response:s};return kb("fetch",o),s},s=>{const o={...r,endTimestamp:Date.now(),error:s};throw kb("fetch",o),s})}})}function nge(n,e){return!!n&&typeof n=="object"&&!!n[e]}function e6e(n){return typeof n=="string"?n:n?nge(n,"url")?n.url:n.toString?n.toString():"":""}function DEn(n){if(n.length===0)return{method:"GET",url:""};if(n.length===2){const[t,i]=n;return{url:e6e(t),method:nge(i,"method")?String(i.method).toUpperCase():"GET"}}const e=n[0];return{url:e6e(e),method:nge(e,"method")?String(e.method).toUpperCase():"GET"}}let RV=null;function krt(n){const e="error";PA(e,n),OA(e,REn)}function REn(){RV=Aa.onerror,Aa.onerror=function(n,e,t,i,r){return kb("error",{column:i,error:r,line:t,msg:n,url:e}),RV&&!RV.__SENTRY_LOADER__?RV.apply(this,arguments):!1},Aa.onerror.__SENTRY_INSTRUMENTED__=!0}let PV=null;function Trt(n){const e="unhandledrejection";PA(e,n),OA(e,PEn)}function PEn(){PV=Aa.onunhandledrejection,Aa.onunhandledrejection=function(n){return kb("unhandledrejection",n),PV&&!PV.__SENTRY_LOADER__?PV.apply(this,arguments):!0},Aa.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const OV=FEe();function OEn(){const n=OV.chrome,e=n&&n.app&&n.app.runtime,t="history"in OV&&!!OV.history.pushState&&!!OV.history.replaceState;return!e&&t}const nj=Aa;let MV;function $Ee(n){const e="history";PA(e,n),OA(e,MEn)}function MEn(){if(!OEn())return;const n=nj.onpopstate;nj.onpopstate=function(...t){const i=nj.location.href,r=MV;if(MV=i,kb("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 s=MV,o=String(r);MV=o,kb("history",{from:s,to:o})}return t.apply(this,i)}}yh(nj.history,"pushState",e),yh(nj.history,"replaceState",e)}const jEn=Aa,wR="__sentry_xhr_v3__";function Irt(n){const e="xhr";PA(e,n),OA(e,FEn)}function FEn(){if(!jEn.XMLHttpRequest)return;const n=XMLHttpRequest.prototype;yh(n,"open",function(e){return function(...t){const i=Date.now(),r=Py(t[0])?t[0].toUpperCase():void 0,s=BEn(t[1]);if(!r||!s)return e.apply(this,t);this[wR]={method:r,url:s,request_headers:{}},r==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const a=this[wR];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}const l={args:[r,s],endTimestamp:Date.now(),startTimestamp:i,xhr:this};kb("xhr",l)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?yh(this,"onreadystatechange",function(a){return function(...l){return o(),a.apply(this,l)}}):this.addEventListener("readystatechange",o),yh(this,"setRequestHeader",function(a){return function(...l){const[c,u]=l,d=this[wR];return d&&Py(c)&&Py(u)&&(d.request_headers[c.toLowerCase()]=u),a.apply(this,l)}}),e.apply(this,t)}}),yh(n,"send",function(e){return function(...t){const i=this[wR];if(!i)return e.apply(this,t);t[0]!==void 0&&(i.body=t[0]);const r={args:[i.method,i.url],startTimestamp:Date.now(),xhr:this};return kb("xhr",r),e.apply(this,t)}})}function BEn(n){if(Py(n))return n;try{return n.toString()}catch{}}function $En(){return"npm"}function HEn(){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 s=0;s<e.length;s++)if(e[s]===r)return!0;return e.push(r),!1}function i(r){if(n)e.delete(r);else for(let s=0;s<e.length;s++)if(e[s]===r){e.splice(s,1);break}}return[t,i]}function aS(n,e=100,t=1/0){try{return ige("",n,e,t)}catch(i){return{ERROR:`**non-serializable** (${i})`}}}function Lrt(n,e=3,t=100*1024){const i=aS(n,e);return UEn(i)>t?Lrt(n,e-1,t):i}function ige(n,e,t=1/0,i=1/0,r=HEn()){const[s,o]=r;if(e==null||["number","boolean","string"].includes(typeof e)&&!frt(e))return e;const a=VEn(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(s(e))return"[Circular ~]";const c=e;if(c&&typeof c.toJSON=="function")try{const p=c.toJSON();return ige("",p,l-1,i,r)}catch{}const u=Array.isArray(e)?[]:{};let d=0;const f=brt(e);for(const p in f){if(!Object.prototype.hasOwnProperty.call(f,p))continue;if(d>=i){u[p]="[MaxProperties ~]";break}const g=f[p];u[p]=ige(p,g,l-1,i,r),d++}return o(e),u}function VEn(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(prt(e))return"[VueViewModel]";if(nEn(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${Tw(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const t=WEn(e);return/^HTML(\w*)Element$/.test(t)?`[HTMLElement: ${t}]`:`[object ${t}]`}catch(t){return`**non-serializable** (${t})`}}function WEn(n){const e=Object.getPrototypeOf(n);return e?e.constructor.name:"null prototype"}function zEn(n){return~-encodeURI(n).split(/%..|./).length}function UEn(n){return zEn(JSON.stringify(n))}var pC;(function(n){n[n.PENDING=0]="PENDING";const t=1;n[n.RESOLVED=t]="RESOLVED";const i=2;n[n.REJECTED=i]="REJECTED"})(pC||(pC={}));function JO(n){return new om(e=>{e(n)})}function HEe(n){return new om((e,t)=>{t(n)})}class om{constructor(e){om.prototype.__init.call(this),om.prototype.__init2.call(this),om.prototype.__init3.call(this),om.prototype.__init4.call(this),this._state=pC.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new om((i,r)=>{this._handlers.push([!1,s=>{if(!e)i(s);else try{i(e(s))}catch(o){r(o)}},s=>{if(!t)r(s);else try{i(t(s))}catch(o){r(o)}}]),this._executeHandlers()})}catch(e){return this.then(t=>t,e)}finally(e){return new om((t,i)=>{let r,s;return this.then(o=>{s=!1,r=o,e&&e()},o=>{s=!0,r=o,e&&e()}).then(()=>{if(s){i(r);return}t(r)})})}__init(){this._resolve=e=>{this._setResult(pC.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(pC.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===pC.PENDING){if(Nee(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===pC.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(t=>{t[0]||(this._state===pC.RESOLVED&&t[1](this._value),this._state===pC.REJECTED&&t[2](this._value),t[0]=!0)})}}}function qEn(n){const e=[];function t(){return n===void 0||e.length<n}function i(o){return e.splice(e.indexOf(o),1)[0]}function r(o){if(!t())return HEe(new gy("Not adding Promise because buffer limit was reached."));const a=o();return e.indexOf(a)===-1&&e.push(a),a.then(()=>i(a)).then(null,()=>i(a).then(null,()=>{})),a}function s(o){return new om((a,l)=>{let c=e.length;if(!c)return a(!0);const u=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(d=>{JO(d).then(()=>{--c||(clearTimeout(u),a(!0))},l)})})}return{$:e,add:r,drain:s}}function oI(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 KEn=["fatal","error","warning","log","info","debug"];function GEn(n){return n==="warn"?"warning":KEn.includes(n)?n:"log"}const Art=1e3;function R9(){return Date.now()/Art}function YEn(){const{performance:n}=Aa;if(!n||!n.now)return R9;const e=Date.now()-n.now(),t=n.timeOrigin==null?e:n.timeOrigin;return()=>(t+n.now())/Art}const P9=YEn(),nv=(()=>{const{performance:n}=Aa;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,s=r<e,o=n.timing&&n.timing.navigationStart,l=typeof o=="number"?Math.abs(o+t-i):e,c=l<e;return s||c?r<=l?n.timeOrigin:o:i})(),rge="baggage",Nrt="sentry-",QEn=/^sentry-/,XEn=8192;function ZEn(n){if(!Py(n)&&!Array.isArray(n))return;let e={};if(Array.isArray(n))e=n.reduce((i,r)=>{const s=t6e(r);for(const o of Object.keys(s))i[o]=s[o];return i},{});else{if(!n)return;e=t6e(n)}const t=Object.entries(e).reduce((i,[r,s])=>{if(r.match(QEn)){const o=r.slice(Nrt.length);i[o]=s}return i},{});if(Object.keys(t).length>0)return t}function Drt(n){if(!n)return;const e=Object.entries(n).reduce((t,[i,r])=>(r&&(t[`${Nrt}${i}`]=r),t),{});return JEn(e)}function t6e(n){return n.split(",").map(e=>e.split("=").map(t=>decodeURIComponent(t.trim()))).reduce((e,[t,i])=>(e[t]=i,e),{})}function JEn(n){if(Object.keys(n).length!==0)return Object.entries(n).reduce((e,[t,i],r)=>{const s=`${encodeURIComponent(t)}=${encodeURIComponent(i)}`,o=r===0?s:`${e},${s}`;return o.length>XEn?(R4&&ni.warn(`Not adding key: ${t} with val: ${i} to baggage header due to exceeding baggage size limits.`),e):o},"")}const ekn=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function tkn(n){if(!n)return;const e=n.match(ekn);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 nkn(n,e){const t=tkn(n),i=ZEn(e),{traceId:r,parentSpanId:s,parentSampled:o}=t||{};return t?{traceId:r||pu(),parentSpanId:s||pu().substring(16),spanId:pu().substring(16),sampled:o,dsc:i||{}}:{traceId:r||pu(),spanId:pu().substring(16)}}function VEe(n=pu(),e=pu().substring(16),t){let i="";return t!==void 0&&(i=t?"-1":"-0"),`${n}-${e}${i}`}function MA(n,e=[]){return[n,e]}function ikn(n,e){const[t,i]=n;return[t,[...i,e]]}function n6e(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 sge(n,e){return(e||new TextEncoder).encode(n)}function rkn(n,e){const[t,i]=n;let r=JSON.stringify(t);function s(o){typeof r=="string"?r=typeof o=="string"?r+o:[sge(r,e),o]:r.push(typeof o=="string"?sge(o,e):o)}for(const o of i){const[a,l]=o;if(s(` ${JSON.stringify(a)} `),typeof l=="string"||l instanceof Uint8Array)s(l);else{let c;try{c=JSON.stringify(l)}catch{c=JSON.stringify(aS(l))}s(c)}}return typeof r=="string"?r:skn(r)}function skn(n){const e=n.reduce((r,s)=>r+s.length,0),t=new Uint8Array(e);let i=0;for(const r of n)t.set(r,i),i+=r.length;return t}function okn(n,e){const t=typeof n.data=="string"?sge(n.data,e):n.data;return[mm({type:"attachment",length:t.length,filename:n.filename,content_type:n.contentType,attachment_type:n.attachmentType}),t]}const akn={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",feedback:"feedback",span:"span",statsd:"metric_bucket"};function i6e(n){return akn[n]}function Rrt(n){if(!n||!n.sdk)return;const{name:e,version:t}=n.sdk;return{name:e,version:t}}function lkn(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:P4(i)},...r&&{trace:mm({...r})}}}function ckn(n,e,t){const i=[{type:"client_report"},{timestamp:R9(),discarded_events:n}];return MA(e?{dsn:e}:{},[i])}const ukn=60*1e3;function dkn(n,e=Date.now()){const t=parseInt(`${n}`,10);if(!isNaN(t))return t*1e3;const i=Date.parse(`${n}`);return isNaN(i)?ukn:i-e}function hkn(n,e){return n[e]||n.all||0}function fkn(n,e,t=Date.now()){return hkn(n,e)>t}function pkn(n,{statusCode:e,headers:t},i=Date.now()){const r={...n},s=t&&t["x-sentry-rate-limits"],o=t&&t["retry-after"];if(s)for(const a of s.trim().split(",")){const[l,c,,,u]=a.split(":",5),d=parseInt(l,10),f=(isNaN(d)?60:d)*1e3;if(!c)r.all=i+f;else for(const p of c.split(";"))p==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(r[p]=i+f):r[p]=i+f}else o?r.all=i+dkn(o,i):e===429&&(r.all=i+60*1e3);return r}const es=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ree="production";function WEe(){return grt("globalEventProcessors",()=>[])}function gkn(n){WEe().push(n)}function bK(n,e,t,i=0){return new om((r,s)=>{const o=n[i];if(e===null||typeof o!="function")r(e);else{const a=o({...e},t);es&&o.id&&a===null&&ni.log(`Event processor "${o.id}" dropped event`),Nee(a)?a.then(l=>bK(n,l,t,i+1).then(r)).then(null,s):bK(n,a,t,i+1).then(r).then(null,s)}})}function Prt(n){const e=P9(),t={sid:pu(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>mkn(t)};return n&&RL(t,n),t}function RL(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||P9(),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:pu()),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 Ort(n,e){let t={};n.status==="ok"&&(t={status:"exited"}),RL(n,t)}function mkn(n){return mm({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 _kn=0,Mrt=1;function zEe(n){const{spanId:e,traceId:t}=n.spanContext(),{data:i,op:r,parent_span_id:s,status:o,tags:a,origin:l}=op(n);return mm({data:i,op:r,parent_span_id:s,span_id:e,status:o,tags:a,trace_id:t,origin:l})}function Pee(n){const{traceId:e,spanId:t}=n.spanContext(),i=UEe(n);return VEe(e,t,i)}function Oee(n){return typeof n=="number"?r6e(n):Array.isArray(n)?n[0]+n[1]/1e9:n instanceof Date?r6e(n.getTime()):P9()}function r6e(n){return n>9999999999?n/1e3:n}function op(n){return vkn(n)?n.getSpanJSON():typeof n.toJSON=="function"?n.toJSON():{}}function vkn(n){return typeof n.getSpanJSON=="function"}function UEe(n){const{traceFlags:e}=n.spanContext();return!!(e&Mrt)}function bkn(n,e,t,i,r,s){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=n,l={...e,event_id:e.event_id||t.event_id||pu(),timestamp:e.timestamp||R9()},c=t.integrations||n.integrations.map(_=>_.name);ykn(l,n),xkn(l,c),e.type===void 0&&Ckn(l,n.stackParser);const u=Ekn(i,t.captureContext);t.mechanism&&G8(l,t.mechanism);const d=r&&r.getEventProcessors?r.getEventProcessors():[],f=Pkn().getScopeData();if(s){const _=s.getScopeData();l6e(f,_)}if(u){const _=u.getScopeData();l6e(f,_)}const p=[...t.attachments||[],...f.attachments];p.length&&(t.attachments=p),$rt(l,f);const g=[...d,...WEe(),...f.eventProcessors];return bK(g,l,t).then(_=>(_&&wkn(_),typeof o=="number"&&o>0?Skn(_,o,a):_))}function ykn(n,e){const{environment:t,release:i,dist:r,maxValueLength:s=250}=e;"environment"in n||(n.environment="environment"in e?t:Ree),n.release===void 0&&i!==void 0&&(n.release=i),n.dist===void 0&&r!==void 0&&(n.dist=r),n.message&&(n.message=kP(n.message,s));const o=n.exception&&n.exception.values&&n.exception.values[0];o&&o.value&&(o.value=kP(o.value,s));const a=n.request;a&&a.url&&(a.url=kP(a.url,s))}const s6e=new WeakMap;function Ckn(n,e){const t=Aa._sentryDebugIds;if(!t)return;let i;const r=s6e.get(e);r?i=r:(i=new Map,s6e.set(e,i));const s=Object.keys(t).reduce((o,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){o[d.filename]=t[a];break}}return o},{});try{n.exception.values.forEach(o=>{o.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=s[a.filename])})})}catch{}}function wkn(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 xkn(n,e){e.length>0&&(n.sdk=n.sdk||{},n.sdk.integrations=[...n.sdk.integrations||[],...e])}function Skn(n,e,t){if(!n)return null;const i={...n,...n.breadcrumbs&&{breadcrumbs:n.breadcrumbs.map(r=>({...r,...r.data&&{data:aS(r.data,e,t)}}))},...n.user&&{user:aS(n.user,e,t)},...n.contexts&&{contexts:aS(n.contexts,e,t)},...n.extra&&{extra:aS(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=aS(n.contexts.trace.data,e,t))),n.spans&&(i.spans=n.spans.map(r=>{const s=op(r).data;return s&&(r.data=aS(s,e,t)),r})),i}function Ekn(n,e){if(!e)return n;const t=n?n.clone():new sE;return t.update(e),t}function kkn(n,e){return _v().captureException(n,void 0)}function jrt(n,e){return _v().captureEvent(n,e)}function PL(n,e){_v().addBreadcrumb(n,e)}function Tkn(...n){const e=_v();if(n.length===2){const[t,i]=n;return t?e.withScope(()=>(e.getStackTop().scope=t,i(t))):e.withScope(i)}return e.withScope(n[0])}function gd(){return _v().getClient()}function m1(){return _v().getScope()}function o6e(n){const e=gd(),t=jA(),i=m1(),{release:r,environment:s=Ree}=e&&e.getOptions()||{},{userAgent:o}=Aa.navigator||{},a=Prt({release:r,environment:s,user:i.getUser()||t.getUser(),...o&&{userAgent:o},...n}),l=t.getSession();return l&&l.status==="ok"&&RL(l,{status:"exited"}),Frt(),t.setSession(a),i.setSession(a),a}function Frt(){const n=jA(),e=m1(),t=e.getSession()||n.getSession();t&&Ort(t),Brt(),n.setSession(),e.setSession()}function Brt(){const n=jA(),e=m1(),t=gd(),i=e.getSession()||n.getSession();i&&t&&t.captureSession&&t.captureSession(i)}function a6e(n=!1){if(n){Frt();return}Brt()}function yK(n){return n.transaction}function Mee(n,e,t){const i=e.getOptions(),{publicKey:r}=e.getDsn()||{},{segment:s}=t&&t.getUser()||{},o=mm({environment:i.environment||Ree,release:i.release,user_segment:s,public_key:r,trace_id:n});return e.emit&&e.emit("createDsc",o),o}function eM(n){const e=gd();if(!e)return{};const t=Mee(op(n).trace_id||"",e,m1()),i=yK(n);if(!i)return t;const r=i&&i._frozenDynamicSamplingContext;if(r)return r;const{sampleRate:s,source:o}=i.metadata;s!=null&&(t.sample_rate=`${s}`);const a=op(i);return o&&o!=="url"&&(t.transaction=a.description),t.sampled=String(UEe(i)),e.emit&&e.emit("createDsc",t),t}function $rt(n,e){const{fingerprint:t,span:i,breadcrumbs:r,sdkProcessingMetadata:s}=e;Ikn(n,e),i&&Nkn(n,i),Dkn(n,t),Lkn(n,r),Akn(n,s)}function l6e(n,e){const{extra:t,tags:i,user:r,contexts:s,level:o,sdkProcessingMetadata:a,breadcrumbs:l,fingerprint:c,eventProcessors:u,attachments:d,propagationContext:f,transactionName:p,span:g}=e;ij(n,"extra",t),ij(n,"tags",i),ij(n,"user",r),ij(n,"contexts",s),ij(n,"sdkProcessingMetadata",a),o&&(n.level=o),p&&(n.transactionName=p),g&&(n.span=g),l.length&&(n.breadcrumbs=[...n.breadcrumbs,...l]),c.length&&(n.fingerprint=[...n.fingerprint,...c]),u.length&&(n.eventProcessors=[...n.eventProcessors,...u]),d.length&&(n.attachments=[...n.attachments,...d]),n.propagationContext={...n.propagationContext,...f}}function ij(n,e,t){if(t&&Object.keys(t).length){n[e]={...n[e]};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[e][i]=t[i])}}function Ikn(n,e){const{extra:t,tags:i,user:r,contexts:s,level:o,transactionName:a}=e,l=mm(t);l&&Object.keys(l).length&&(n.extra={...l,...n.extra});const c=mm(i);c&&Object.keys(c).length&&(n.tags={...c,...n.tags});const u=mm(r);u&&Object.keys(u).length&&(n.user={...u,...n.user});const d=mm(s);d&&Object.keys(d).length&&(n.contexts={...d,...n.contexts}),o&&(n.level=o),a&&(n.transaction=a)}function Lkn(n,e){const t=[...n.breadcrumbs||[],...e];n.breadcrumbs=t.length?t:void 0}function Akn(n,e){n.sdkProcessingMetadata={...n.sdkProcessingMetadata,...e}}function Nkn(n,e){n.contexts={trace:zEe(e),...n.contexts};const t=yK(e);if(t){n.sdkProcessingMetadata={dynamicSamplingContext:eM(e),...n.sdkProcessingMetadata};const i=op(t).description;i&&(n.tags={transaction:i,...n.tags})}}function Dkn(n,e){n.fingerprint=n.fingerprint?xrt(n.fingerprint):[],e&&(n.fingerprint=n.fingerprint.concat(e)),n.fingerprint&&!n.fingerprint.length&&delete n.fingerprint}const Rkn=100;let Qle;class sE{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=c6e()}static clone(e){return e?e.clone():new sE}clone(){const e=new sE;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&RL(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._span;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;const t=typeof e=="function"?e(this):e;if(t instanceof sE){const i=t.getScopeData();this._tags={...this._tags,...i.tags},this._extra={...this._extra,...i.extra},this._contexts={...this._contexts,...i.contexts},i.user&&Object.keys(i.user).length&&(this._user=i.user),i.level&&(this._level=i.level),i.fingerprint.length&&(this._fingerprint=i.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),i.propagationContext&&(this._propagationContext=i.propagationContext)}else if(XO(t)){const i=e;this._tags={...this._tags,...i.tags},this._extra={...this._extra,...i.extra},this._contexts={...this._contexts,...i.contexts},i.user&&(this._user=i.user),i.level&&(this._level=i.level),i.fingerprint&&(this._fingerprint=i.fingerprint),i.requestSession&&(this._requestSession=i.requestSession),i.propagationContext&&(this._propagationContext=i.propagationContext)}return 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=c6e(),this}addBreadcrumb(e,t){const i=typeof t=="number"?t:Rkn;if(i<=0)return this;const r={timestamp:R9(),...e},s=this._breadcrumbs;return s.push(r),this._breadcrumbs=s.length>i?s.slice(-i):s,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.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:i,_tags:r,_extra:s,_user:o,_level:a,_fingerprint:l,_eventProcessors:c,_propagationContext:u,_sdkProcessingMetadata:d,_transactionName:f,_span:p}=this;return{breadcrumbs:e,attachments:t,contexts:i,tags:r,extra:s,user:o,level:a,fingerprint:l||[],eventProcessors:c,propagationContext:u,sdkProcessingMetadata:d,transactionName:f,span:p}}applyToEvent(e,t={},i=[]){$rt(e,this.getScopeData());const r=[...i,...WEe(),...this._eventProcessors];return bK(r,e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const i=t&&t.event_id?t.event_id:pu();if(!this._client)return ni.warn("No client configured on scope - will not capture exception!"),i;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:i},this),i}captureMessage(e,t,i){const r=i&&i.event_id?i.event_id:pu();if(!this._client)return ni.warn("No client configured on scope - will not capture message!"),r;const s=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:s,...i,event_id:r},this),r}captureEvent(e,t){const i=t&&t.event_id?t.event_id:pu();return this._client?(this._client.captureEvent(e,{...t,event_id:i},this),i):(ni.warn("No client configured on scope - will not capture event!"),i)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Pkn(){return Qle||(Qle=new sE),Qle}function c6e(){return{traceId:pu(),spanId:pu().substring(16)}}const oge="7.120.3",Hrt=parseFloat(oge),Okn=100;class Vrt{constructor(e,t,i,r=Hrt){this._version=r;let s;t?s=t:(s=new sE,s.setClient(e));let o;i?o=i:(o=new sE,o.setClient(e)),this._stack=[{scope:s}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();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();let i;try{i=e(t)}catch(r){throw this.popScope(),r}return Nee(i)?i.then(r=>(this.popScope(),r),r=>{throw this.popScope(),r}):(this.popScope(),i)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}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:pu(),r=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:i}),i}captureMessage(e,t,i){const r=this._lastEventId=i&&i.event_id?i.event_id:pu(),s=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:s,...i,event_id:r}),r}captureEvent(e,t){const i=t&&t.event_id?t.event_id:pu();return e.type||(this._lastEventId=i),this.getScope().captureEvent(e,{...t,event_id:i}),i}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:i,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=Okn}=r.getOptions&&r.getOptions()||{};if(o<=0)return;const l={timestamp:R9(),...e},c=s?Dee(()=>s(l,t)):l;c!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",c,t),i.addBreadcrumb(c,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:i}=this.getStackTop();i&&e(t)}run(e){const t=u6e(this);try{e(this)}finally{u6e(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return es&&ni.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const i=this._callExtensionMethod("startTransaction",e,t);return es&&!i&&(this.getClient()?ni.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init': Sentry.addTracingExtensions(); Sentry.init({...}); `):ni.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),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&&Ort(i),this._sendSessionUpdate(),t.setSession()}startSession(e){const{scope:t,client:i}=this.getStackTop(),{release:r,environment:s=Ree}=i&&i.getOptions()||{},{userAgent:o}=Aa.navigator||{},a=Prt({release:r,environment:s,user:t.getUser(),...o&&{userAgent:o},...e}),l=t.getSession&&t.getSession();return l&&l.status==="ok"&&RL(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)}_callExtensionMethod(e,...t){const r=O9().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,t);es&&ni.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function O9(){return Aa.__SENTRY__=Aa.__SENTRY__||{extensions:{},hub:void 0},Aa}function u6e(n){const e=O9(),t=age(e);return Wrt(e,n),t}function _v(){const n=O9();if(n.__SENTRY__&&n.__SENTRY__.acs){const e=n.__SENTRY__.acs.getCurrentHub();if(e)return e}return Mkn(n)}function jA(){return _v().getIsolationScope()}function Mkn(n=O9()){return(!jkn(n)||age(n).isOlderThan(Hrt))&&Wrt(n,new Vrt),age(n)}function jkn(n){return!!(n&&n.__SENTRY__&&n.__SENTRY__.hub)}function age(n){return grt("hub",()=>new Vrt,n)}function Wrt(n,e){if(!n)return!1;const t=n.__SENTRY__=n.__SENTRY__||{};return t.hub=e,!0}function OL(n){return _v().getScope().getTransaction()}let d6e=!1;function Fkn(){d6e||(d6e=!0,krt(lge),Trt(lge))}function lge(){const n=OL();if(n){const e="internal_error";es&&ni.log(`[Tracing] Transaction: ${e} -> Global error occured`),n.setStatus(e)}}lge.tag="sentry_tracingErrorCallback";var h6e;(function(n){const e="ok";n.Ok=e;const t="deadline_exceeded";n.DeadlineExceeded=t;const i="unauthenticated";n.Unauthenticated=i;const r="permission_denied";n.PermissionDenied=r;const s="not_found";n.NotFound=s;const o="resource_exhausted";n.ResourceExhausted=o;const a="invalid_argument";n.InvalidArgument=a;const l="unimplemented";n.Unimplemented=l;const c="unavailable";n.Unavailable=c;const u="internal_error";n.InternalError=u;const d="unknown_error";n.UnknownError=d;const f="cancelled";n.Cancelled=f;const p="already_exists";n.AlreadyExists=p;const g="failed_precondition";n.FailedPrecondition=g;const m="aborted";n.Aborted=m;const _="out_of_range";n.OutOfRange=_;const v="data_loss";n.DataLoss=v})(h6e||(h6e={}));function Bkn(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 qEe(n,e){n.setTag("http.status_code",String(e)),n.setData("http.response.status_code",e);const t=Bkn(e);t!=="unknown_error"&&n.setStatus(t)}function O4(n){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=gd(),t=n||e&&e.getOptions();return!!t&&(t.enableTracing||"tracesSampleRate"in t||"tracesSampler"in t)}function zrt(n){if(!O4())return;const e=Vkn(n),t=_v(),i=n.scope?n.scope.getSpan():$kn();if(n.onlyIfParent&&!i)return;const o=(n.scope||m1()).clone();return Hkn(t,{parentSpan:i,spanContext:e,forceTransaction:n.forceTransaction,scope:o})}function $kn(){return m1().getSpan()}function Hkn(n,{parentSpan:e,spanContext:t,forceTransaction:i,scope:r}){if(!O4())return;const s=jA();let o;if(e&&!i)o=e.startChild(t);else if(e){const a=eM(e),{traceId:l,spanId:c}=e.spanContext(),u=UEe(e);o=n.startTransaction({traceId:l,parentSpanId:c,parentSampled:u,...t,metadata:{dynamicSamplingContext:a,...t.metadata}})}else{const{traceId:a,dsc:l,parentSpanId:c,sampled:u}={...s.getPropagationContext(),...r.getPropagationContext()};o=n.startTransaction({traceId:a,parentSpanId:c,parentSampled:u,...t,metadata:{dynamicSamplingContext:l,...t.metadata}})}return r.setSpan(o),Wkn(o,r,s),o}function Vkn(n){if(n.startTime){const e={...n};return e.startTimestamp=Oee(n.startTime),delete e.startTime,e}return n}const Urt="_sentryScope",qrt="_sentryIsolationScope";function Wkn(n,e,t){n&&(DL(n,qrt,t),DL(n,Urt,e))}function zkn(n){return{scope:n[Urt],isolationScope:n[qrt]}}const IP="sentry.source",xR="sentry.sample_rate",jV="sentry.op",SR="sentry.origin",Ukn="profile_id";class Krt{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class jee{constructor(e={}){this._traceId=e.traceId||pu(),this._spanId=e.spanId||pu().substring(16),this._startTime=e.startTimestamp||P9(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||"sentry",this._attributes={},this.setAttributes({[SR]:e.origin||"manual",[jV]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime!==void 0&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||""}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[jV]}set op(e){this.setAttribute(jV,e)}get origin(){return this._attributes[SR]}set origin(e){this.setAttribute(SR,e)}spanContext(){const{_spanId:e,_traceId:t,_sampled:i}=this;return{spanId:e,traceId:t,traceFlags:i?Mrt:_kn}}startChild(e){const t=new jee({...e,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t);const i=yK(this);if(t.transaction=i,es&&i){const r=e&&e.op||"< unknown op >",s=op(t).description||"< unknown name >",o=i.spanContext().spanId,a=`[Tracing] Starting '${r}' span on transaction '${s}' (${o}).`;ni.log(a),this._logMessage=a}return t}setTag(e,t){return this.tags={...this.tags,[e]:t},this}setData(e,t){return this.data={...this.data,[e]:t},this}setAttribute(e,t){t===void 0?delete this._attributes[e]:this._attributes[e]=t}setAttributes(e){Object.keys(e).forEach(t=>this.setAttribute(t,e[t]))}setStatus(e){return this._status=e,this}setHttpStatus(e){return qEe(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return this._status==="ok"}finish(e){return this.end(e)}end(e){if(this._endTime)return;const t=yK(this);if(es&&t&&t.spanContext().spanId!==this._spanId){const i=this._logMessage;i&&ni.log(i.replace("Starting","Finishing"))}this._endTime=Oee(e)}toTraceparent(){return Pee(this)}toContext(){return mm({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return zEe(this)}getSpanJSON(){return mm({data:this._getData(),description:this._name,op:this._attributes[jV],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[SR],_metrics_summary:void 0,profile_id:this._attributes[Ukn],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}toJSON(){return this.getSpanJSON()}_getData(){const{data:e,_attributes:t}=this,i=Object.keys(e).length>0,r=Object.keys(t).length>0;if(!(!i&&!r))return i&&r?{...e,...t}:i?e:t}}class Grt extends jee{constructor(e,t){super(e),this._contexts={},this._hub=t||_v(),this._name=e.name||"",this._metadata={...e.metadata},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)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[IP]&&{source:this._attributes[IP]},...this._attributes[xR]&&{sampleRate:this._attributes[xR]}}}set metadata(e){this._metadata=e}setName(e,t="custom"){this._name=e,this.setAttribute(IP,t)}updateName(e){return this._name=e,this}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Krt(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}}end(e){const t=Oee(e),i=this._finishTransaction(t);if(i)return this._hub.captureEvent(i)}toContext(){const e=super.toContext();return mm({...e,name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return eM(this)}setHub(e){this._hub=e}getProfileId(){if(this._contexts!==void 0&&this._contexts.profile!==void 0)return this._contexts.profile.profile_id}_finishTransaction(e){if(this._endTime!==void 0)return;this._name||(es&&ni.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(e);const t=this._hub.getClient();if(t&&t.emit&&t.emit("finishTransaction",this),this._sampled!==!0){es&&ni.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(u=>u!==this&&op(u).timestamp):[];if(this._trimEnd&&i.length>0){const u=i.map(d=>op(d).timestamp).filter(Boolean);this._endTime=u.reduce((d,f)=>d>f?d:f)}const{scope:r,isolationScope:s}=zkn(this),{metadata:o}=this,{source:a}=o,l={contexts:{...this._contexts,trace:zEe(this)},spans:i,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...o,capturedSpanScope:r,capturedSpanIsolationScope:s,...mm({dynamicSamplingContext:eM(this)})},_metrics_summary:void 0,...a&&{transaction_info:{source:a}}};return Object.keys(this._measurements).length>0&&(es&&ni.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),l.measurements=this._measurements),es&&ni.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),l}}const Yz={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},qkn="finishReason",TD=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class Kkn extends Krt{constructor(e,t,i,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=i}add(e){if(e.spanContext().spanId!==this.transactionSpanId){const t=e.end;e.end=(...i)=>(this._popActivity(e.spanContext().spanId),t.apply(e,i)),op(e).timestamp===void 0&&this._pushActivity(e.spanContext().spanId)}super.add(e)}}class Gkn extends Grt{constructor(e,t,i=Yz.idleTimeout,r=Yz.finalTimeout,s=Yz.heartbeatInterval,o=!1,a=!1){super(e,t),this._idleHub=t,this._idleTimeout=i,this._finalTimeout=r,this._heartbeatInterval=s,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=TD[4],this._autoFinishAllowed=!a,o&&(es&&ni.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),t.getScope().setSpan(this)),a||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=TD[3],this.end())},this._finalTimeout)}end(e){const t=Oee(e);if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setAttribute(qkn,this._finishReason),this.spanRecorder){es&&ni.log("[Tracing] finishing IdleTransaction",new Date(t*1e3).toISOString(),this.op);for(const i of this._beforeFinishCallbacks)i(this,t);this.spanRecorder.spans=this.spanRecorder.spans.filter(i=>{if(i.spanContext().spanId===this.spanContext().spanId)return!0;op(i).timestamp||(i.setStatus("cancelled"),i.end(t),es&&ni.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(i,void 0,2)));const{start_timestamp:r,timestamp:s}=op(i),o=r&&r<t,a=(this._finalTimeout+this._idleTimeout)/1e3,l=s&&r&&s-r<a;if(es){const c=JSON.stringify(i,void 0,2);o?l||ni.log("[Tracing] discarding Span since it finished after Transaction final timeout",c):ni.log("[Tracing] discarding Span since it happened after Transaction was finished",c)}return o&&l}),es&&ni.log("[Tracing] flushing IdleTransaction")}else es&&ni.log("[Tracing] No active IdleTransaction");if(this._onScope){const i=this._idleHub.getScope();i.getTransaction()===this&&i.setSpan(void 0)}return super.end(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 Kkn(t,i,this.spanContext().spanId,e),es&&ni.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=TD[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||(es&&ni.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=TD[1],this.end(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),es&&ni.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,es&&ni.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(es&&ni.log(`[Tracing] popActivity ${e}`),delete this.activities[e],es&&ni.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const t=P9();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=TD[5],this.end(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?this._autoFinishAllowed&&(es&&ni.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=TD[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){es&&ni.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function Yrt(n,e,t){if(!O4(e))return n.sampled=!1,n;if(n.sampled!==void 0)return n.setAttribute(xR,Number(n.sampled)),n;let i;return typeof e.tracesSampler=="function"?(i=e.tracesSampler(t),n.setAttribute(xR,Number(i))):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"?(i=e.tracesSampleRate,n.setAttribute(xR,Number(i))):(i=1,n.setAttribute(xR,i)),Qrt(i)?i?(n.sampled=Math.random()<i,n.sampled?(es&&ni.log(`[Tracing] starting ${n.op} transaction - ${op(n).description}`),n):(es&&ni.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),n)):(es&&ni.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):(es&&ni.warn("[Tracing] Discarding transaction because of invalid sample rate."),n.sampled=!1,n)}function Qrt(n){return frt(n)||!(typeof n=="number"||typeof n=="boolean")?(es&&ni.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?(es&&ni.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${n}.`),!1):!0}function Ykn(){const e=this.getScope().getSpan();return e?{"sentry-trace":Pee(e)}:{}}function Qkn(n,e){const t=this.getClient(),i=t&&t.getOptions()||{},r=i.instrumenter||"sentry",s=n.instrumenter||"sentry";r!==s&&(es&&ni.error(`A transaction was started with instrumenter=\`${s}\`, 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 o=new Grt(n,this);return o=Yrt(o,i,{name:n.name,parentSampled:n.parentSampled,transactionContext:n,attributes:{...n.data,...n.attributes},...e}),o.isRecording()&&o.initSpanRecorder(i._experiments&&i._experiments.maxSpans),t&&t.emit&&t.emit("startTransaction",o),o}function f6e(n,e,t,i,r,s,o,a=!1){const l=n.getClient(),c=l&&l.getOptions()||{};let u=new Gkn(e,n,t,i,o,r,a);return u=Yrt(u,c,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...s}),u.isRecording()&&u.initSpanRecorder(c._experiments&&c._experiments.maxSpans),l&&l.emit&&l.emit("startTransaction",u),u}function Xkn(){const n=O9();n.__SENTRY__&&(n.__SENTRY__.extensions=n.__SENTRY__.extensions||{},n.__SENTRY__.extensions.startTransaction||(n.__SENTRY__.extensions.startTransaction=Qkn),n.__SENTRY__.extensions.traceHeaders||(n.__SENTRY__.extensions.traceHeaders=Ykn),Fkn())}function Zkn(n,e,t){const i=OL();i&&i.setMeasurement(n,e,t)}function Jkn(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 eTn(n,e,t,i){const r=Rrt(t),s={sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&e&&{dsn:P4(e)}},o="aggregates"in n?[{type:"sessions"},n]:[{type:"session"},n.toJSON()];return MA(s,[o])}function tTn(n,e,t,i){const r=Rrt(t),s=n.type&&n.type!=="replay_event"?n.type:"event";Jkn(n,t&&t.sdk);const o=lkn(n,r,i,e);return delete n.sdkProcessingMetadata,MA(o,[[{type:s},n]])}const nTn="7";function iTn(n){const e=n.protocol?`${n.protocol}:`:"",t=n.port?`:${n.port}`:"";return`${e}//${n.host}${t}${n.path?`/${n.path}`:""}/api/`}function rTn(n){return`${iTn(n)}${n.projectId}/envelope/`}function sTn(n,e){return _En({sentry_key:n.publicKey,sentry_version:nTn,...e&&{sentry_client:`${e.name}/${e.version}`}})}function oTn(n,e={}){const t=typeof e=="string"?e:e.tunnel,i=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return t||`${rTn(n)}?${sTn(n,i)}`}const p6e=[];function aTn(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 lTn(n){const e=n.defaultIntegrations||[],t=n.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let i;Array.isArray(t)?i=[...e,...t]:typeof t=="function"?i=xrt(t(e)):i=e;const r=aTn(i),s=uTn(r,o=>o.name==="Debug");if(s!==-1){const[o]=r.splice(s,1);r.push(o)}return r}function cTn(n,e){const t={};return e.forEach(i=>{i&&Xrt(n,i,t)}),t}function g6e(n,e){for(const t of e)t&&t.afterAllSetup&&t.afterAllSetup(n)}function Xrt(n,e,t){if(t[e.name]){es&&ni.log(`Integration skipped because it was already installed: ${e.name}`);return}if(t[e.name]=e,p6e.indexOf(e.name)===-1&&(e.setupOnce(gkn,_v),p6e.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(n),n.on&&typeof e.preprocessEvent=="function"){const i=e.preprocessEvent.bind(e);n.on("preprocessEvent",(r,s)=>i(r,s,n))}if(n.addEventProcessor&&typeof e.processEvent=="function"){const i=e.processEvent.bind(e),r=Object.assign((s,o)=>i(s,o,n),{id:e.name});n.addEventProcessor(r)}es&&ni.log(`Integration installed: ${e.name}`)}function uTn(n,e){for(let t=0;t<n.length;t++)if(e(n[t])===!0)return t;return-1}function Ak(n,e){return Object.assign(function(...i){return e(...i)},{id:n})}function dTn(n){let e="";for(const t of n){const i=Object.entries(t.tags),r=i.length>0?`|#${i.map(([s,o])=>`${s}:${o}`).join(",")}`:"";e+=`${t.name}@${t.unit}:${t.metric}|${t.metricType}${r}|T${t.timestamp} `}return e}function hTn(n,e,t,i){const r={sent_at:new Date().toISOString()};t&&t.sdk&&(r.sdk={name:t.sdk.name,version:t.sdk.version}),i&&e&&(r.dsn=P4(e));const s=fTn(n);return MA(r,[s])}function fTn(n){const e=dTn(n);return[{type:"statsd",length:e.length},e]}const m6e="Not capturing exception because it's already been captured.";class pTn{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=mEn(e.dsn):es&&ni.warn("No DSN provided, client will not send events."),this._dsn){const t=oTn(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,i){if(XFe(e)){es&&ni.log(m6e);return}let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(s=>this._captureEvent(s,t,i)).then(s=>{r=s})),r}captureMessage(e,t,i,r){let s=i&&i.event_id;const o=MEe(e)?e:String(e),a=jEe(e)?this.eventFromMessage(o,t,i):this.eventFromException(e,i);return this._process(a.then(l=>this._captureEvent(l,i,r)).then(l=>{s=l})),s}captureEvent(e,t,i){if(t&&t.originalException&&XFe(t.originalException)){es&&ni.log(m6e);return}let r=t&&t.event_id;const o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,o||i).then(a=>{r=a})),r}captureSession(e){typeof e.release!="string"?es&&ni.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),RL(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.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(i=>t.flush(e).then(r=>i&&r))):JO(!0)}close(e){return this.flush(e).then(t=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),t))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return es&&ni.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];Xrt(this,e,this._integrations),t||g6e(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let i=tTn(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of t.attachments||[])i=ikn(i,okn(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(i);r&&r.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){const t=eTn(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,i){if(this._options.sendClientReports){const r=typeof i=="number"?i:1,s=`${e}:${t}`;es&&ni.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}captureAggregateMetrics(e){es&&ni.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=hTn(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}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))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=cTn(this,e),g6e(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let i=!1,r=!1;const s=t.exception&&t.exception.values;if(s){r=!0;for(const l of s){const c=l.mechanism;if(c&&c.handled===!1){i=!0;break}}}const o=e.status==="ok";(o&&e.errors===0||o&&i)&&(RL(e,{...i&&{status:"crashed"},errors:e.errors||Number(r||i)}),this.captureSession(e))}_isClientDoneProcessing(e){return new om(t=>{let i=0;const r=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),t(!0)):(i+=r,e&&i>=e&&(clearInterval(s),t(!1)))},r)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,i,r=jA()){const s=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),bkn(s,e,t,i,this,r).then(a=>{if(a===null)return a;const l={...r.getPropagationContext(),...i?i.getPropagationContext():void 0};if(!(a.contexts&&a.contexts.trace)&&l){const{traceId:u,spanId:d,parentSpanId:f,dsc:p}=l;a.contexts={trace:{trace_id:u,span_id:d,parent_span_id:f},...a.contexts};const g=p||Mee(u,this,i);a.sdkProcessingMetadata={dynamicSamplingContext:g,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,t={},i){return this._processEvent(e,t,i).then(r=>r.event_id,r=>{if(es){const s=r;s.logLevel==="log"?ni.log(s.message):ni.warn(s)}})}_processEvent(e,t,i){const r=this.getOptions(),{sampleRate:s}=r,o=Jrt(e),a=Zrt(e),l=e.type||"error",c=`before send for type \`${l}\``;if(a&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),HEe(new gy(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const u=l==="replay_event"?"replay":l,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,i,f).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",u,e),new gy("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return p;const m=mTn(r,p,t);return gTn(m,c)}).then(p=>{if(p===null){if(this.recordDroppedEvent("before_send",u,e),o){const v=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",v)}throw new gy(`${c} returned \`null\`, will not send event.`,"log")}const g=i&&i.getSession();if(!o&&g&&this._updateSessionFromEvent(g,p),o){const _=p.sdkProcessingMetadata&&p.sdkProcessingMetadata.spanCountBeforeProcessing||0,v=p.spans?p.spans.length:0,b=_-v;b>0&&this.recordDroppedEvent("before_send","span",b)}const m=p.transaction_info;if(o&&m&&p.transaction!==e.transaction){const _="custom";p.transaction_info={...m,source:_}}return this.sendEvent(p,t),p}).then(null,p=>{throw p instanceof gy?p:(this.captureException(p,{data:{__sentry__:!0},originalException:p}),new gy(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${p}`))})}_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=>{es&&ni.error("Error while sending event:",t)});es&&ni.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 gTn(n,e){const t=`${e} must return \`null\` or a valid event.`;if(Nee(n))return n.then(i=>{if(!XO(i)&&i!==null)throw new gy(t);return i},i=>{throw new gy(`${e} rejected with ${i}`)});if(!XO(n)&&n!==null)throw new gy(t);return n}function mTn(n,e,t){const{beforeSend:i,beforeSendTransaction:r}=n;if(Zrt(e)&&i)return i(e,t);if(Jrt(e)&&r){if(e.spans){const s=e.spans.length;e.sdkProcessingMetadata={...e.sdkProcessingMetadata,spanCountBeforeProcessing:s}}return r(e,t)}return e}function Zrt(n){return n.type===void 0}function Jrt(n){return n.type==="transaction"}function _Tn(n,e){e.debug===!0&&(es?ni.enable():Dee(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),m1().update(e.initialScope);const i=new n(e);vTn(i),bTn(i)}function vTn(n){const t=_v().getStackTop();t.client=n,t.scope.setClient(n)}function bTn(n){n.init?n.init():n.setupIntegrations&&n.setupIntegrations()}const yTn=30;function est(n,e,t=qEn(n.bufferSize||yTn)){let i={};const r=o=>t.drain(o);function s(o){const a=[];if(n6e(o,(d,f)=>{const p=i6e(f);if(fkn(i,p)){const g=_6e(d,f);n.recordDroppedEvent("ratelimit_backoff",p,g)}else a.push(d)}),a.length===0)return JO();const l=MA(o[0],a),c=d=>{n6e(l,(f,p)=>{const g=_6e(f,p);n.recordDroppedEvent(d,i6e(p),g)})},u=()=>e({body:rkn(l,n.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&es&&ni.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),i=pkn(i,d),d),d=>{throw c("network_error"),d});return t.add(u).then(d=>d,d=>{if(d instanceof gy)return es&&ni.error("Skipped sending event because buffer is full."),c("queue_overflow"),JO();throw d})}return s.__sentry__baseTransport__=!0,{send:s,flush:r}}function _6e(n,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(n)?n[1]:void 0}function CTn(n,e){const t={sent_at:new Date().toISOString()};e&&(t.dsn=P4(e));const i=n.map(wTn);return MA(t,i)}function wTn(n){return[{type:"span"},n]}function tst(n,e,t=[e],i="npm"){const r=n._metadata||{};r.sdk||(r.sdk={name:`sentry.javascript.${e}`,packages:t.map(s=>({name:`${i}:@sentry/${s}`,version:oge})),version:oge}),n._metadata=r}const xTn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],STn=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],nst="InboundFilters",ETn=(n={})=>({name:nst,setupOnce(){},processEvent(e,t,i){const r=i.getOptions(),s=kTn(n,r);return TTn(e,s)?null:e}}),ist=ETn;Ak(nst,ist);function kTn(n={},e={}){return{allowUrls:[...n.allowUrls||[],...e.allowUrls||[]],denyUrls:[...n.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...n.ignoreErrors||[],...e.ignoreErrors||[],...n.disableErrorDefaults?[]:xTn],ignoreTransactions:[...n.ignoreTransactions||[],...e.ignoreTransactions||[],...n.disableTransactionDefaults?[]:STn],ignoreInternal:n.ignoreInternal!==void 0?n.ignoreInternal:!0}}function TTn(n,e){return e.ignoreInternal&&RTn(n)?(es&&ni.warn(`Event dropped due to being internal Sentry Error. Event: ${CS(n)}`),!0):ITn(n,e.ignoreErrors)?(es&&ni.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${CS(n)}`),!0):LTn(n,e.ignoreTransactions)?(es&&ni.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${CS(n)}`),!0):ATn(n,e.denyUrls)?(es&&ni.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${CS(n)}. Url: ${CK(n)}`),!0):NTn(n,e.allowUrls)?!1:(es&&ni.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${CS(n)}. Url: ${CK(n)}`),!0)}function ITn(n,e){return n.type||!e||!e.length?!1:DTn(n).some(t=>D9(t,e))}function LTn(n,e){if(n.type!=="transaction"||!e||!e.length)return!1;const t=n.transaction;return t?D9(t,e):!1}function ATn(n,e){if(!e||!e.length)return!1;const t=CK(n);return t?D9(t,e):!1}function NTn(n,e){if(!e||!e.length)return!0;const t=CK(n);return t?D9(t,e):!0}function DTn(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}`)),es&&e.length===0&&ni.error(`Could not extract message for event ${CS(n)}`),e}function RTn(n){try{return n.exception.values[0].type==="SentryError"}catch{}return!1}function PTn(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 CK(n){try{let e;try{e=n.exception.values[0].stacktrace.frames}catch{}return e?PTn(e):null}catch{return es&&ni.error(`Cannot extract url for event ${CS(n)}`),null}}let v6e;const rst="FunctionToString",b6e=new WeakMap,OTn=()=>({name:rst,setupOnce(){v6e=Function.prototype.toString;try{Function.prototype.toString=function(...n){const e=BEe(this),t=b6e.has(gd())&&e!==void 0?e:this;return v6e.apply(t,n)}}catch{}},setup(n){b6e.set(n,!0)}}),sst=OTn;Ak(rst,sst);const Wl=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,to=Aa;function MTn(){to.document?to.document.addEventListener("visibilitychange",()=>{const n=OL();if(to.document.hidden&&n){const e="cancelled",{op:t,status:i}=op(n);Wl&&ni.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t}`),i||n.setStatus(e),n.setTag("visibilitychange","document.hidden"),n.end()}}):Wl&&ni.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const M9=(n,e,t)=>{let i,r;return s=>{e.value>=0&&(s||t)&&(r=e.value-(i||0),(r||i===void 0)&&(i=e.value,e.delta=r,n(e)))}},jTn=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,FTn=()=>{const n=to.performance.timing,e=to.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},Fee=()=>to.__WEB_VITALS_POLYFILL__?to.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||FTn()):to.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],KEe=()=>{const n=Fee();return n&&n.activationStart||0},j9=(n,e)=>{const t=Fee();let i="navigate";return t&&(to.document&&to.document.prerendering||KEe()>0?i="prerender":i=t.type.replace(/_/g,"-")),{name:n,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:jTn(),navigationType:i}},M4=(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{}},F9=(n,e)=>{const t=i=>{(i.type==="pagehide"||to.document.visibilityState==="hidden")&&(n(i),e&&(removeEventListener("visibilitychange",t,!0),removeEventListener("pagehide",t,!0)))};to.document&&(addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0))},BTn=(n,e={})=>{const t=j9("CLS",0);let i,r=0,s=[];const o=l=>{l.forEach(c=>{if(!c.hadRecentInput){const u=s[0],d=s[s.length-1];r&&s.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-u.startTime<5e3?(r+=c.value,s.push(c)):(r=c.value,s=[c]),r>t.value&&(t.value=r,t.entries=s,i&&i())}})},a=M4("layout-shift",o);if(a){i=M9(n,t,e.reportAllChanges);const l=()=>{o(a.takeRecords()),i(!0)};return F9(l),l}};let wK=-1;const $Tn=()=>{to.document&&to.document.visibilityState&&(wK=to.document.visibilityState==="hidden"&&!to.document.prerendering?0:1/0)},HTn=()=>{F9(({timeStamp:n})=>{wK=n},!0)},GEe=()=>(wK<0&&($Tn(),HTn()),{get firstHiddenTime(){return wK}}),VTn=n=>{const e=GEe(),t=j9("FID");let i;const r=a=>{a.startTime<e.firstHiddenTime&&(t.value=a.processingStart-a.startTime,t.entries.push(a),i(!0))},s=a=>{a.forEach(r)},o=M4("first-input",s);i=M9(n,t),o&&F9(()=>{s(o.takeRecords()),o.disconnect()},!0)};let ost=0,Xle=1/0,FV=0;const WTn=n=>{n.forEach(e=>{e.interactionId&&(Xle=Math.min(Xle,e.interactionId),FV=Math.max(FV,e.interactionId),ost=FV?(FV-Xle)/7+1:0)})};let cge;const zTn=()=>cge?ost:performance.interactionCount||0,UTn=()=>{"interactionCount"in performance||cge||(cge=M4("event",WTn,{type:"event",buffered:!0,durationThreshold:0}))},ast=()=>zTn(),y6e=10,kC=[],Zle={},C6e=n=>{const e=kC[kC.length-1],t=Zle[n.interactionId];if(t||kC.length<y6e||n.duration>e.latency){if(t)t.entries.push(n),t.latency=Math.max(t.latency,n.duration);else{const i={id:n.interactionId,latency:n.duration,entries:[n]};Zle[i.id]=i,kC.push(i)}kC.sort((i,r)=>r.latency-i.latency),kC.splice(y6e).forEach(i=>{delete Zle[i.id]})}},qTn=()=>{const n=Math.min(kC.length-1,Math.floor(ast()/50));return kC[n]},KTn=(n,e)=>{e=e||{},UTn();const t=j9("INP");let i;const r=o=>{o.forEach(l=>{l.interactionId&&C6e(l),l.entryType==="first-input"&&!kC.some(u=>u.entries.some(d=>l.duration===d.duration&&l.startTime===d.startTime))&&C6e(l)});const a=qTn();a&&a.latency!==t.value&&(t.value=a.latency,t.entries=a.entries,i())},s=M4("event",r,{durationThreshold:e.durationThreshold||40});i=M9(n,t,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),F9(()=>{r(s.takeRecords()),t.value<0&&ast()>0&&(t.value=0,t.entries=[]),i(!0)}))},w6e={},GTn=n=>{const e=GEe(),t=j9("LCP");let i;const r=o=>{const a=o[o.length-1];if(a){const l=Math.max(a.startTime-KEe(),0);l<e.firstHiddenTime&&(t.value=l,t.entries=[a],i())}},s=M4("largest-contentful-paint",r);if(s){i=M9(n,t);const o=()=>{w6e[t.id]||(r(s.takeRecords()),s.disconnect(),w6e[t.id]=!0,i(!0))};return["keydown","click"].forEach(a=>{to.document&&addEventListener(a,o,{once:!0,capture:!0})}),F9(o,!0),o}},uge=n=>{to.document&&(to.document.prerendering?addEventListener("prerenderingchange",()=>uge(n),!0):to.document.readyState!=="complete"?addEventListener("load",()=>uge(n),!0):setTimeout(n,0))},YTn=(n,e)=>{e=e||{};const t=j9("TTFB"),i=M9(n,t,e.reportAllChanges);uge(()=>{const r=Fee();if(r){if(t.value=Math.max(r.responseStart-KEe(),0),t.value<0||t.value>performance.now())return;t.entries=[r],i(!0)}})},qF={},xK={};let lst,cst,ust,dst,hst;function QTn(n,e=!1){return B9("cls",n,t2n,lst,e)}function XTn(n,e=!1){return B9("lcp",n,i2n,ust,e)}function ZTn(n){return B9("ttfb",n,r2n,dst)}function JTn(n){return B9("fid",n,n2n,cst)}function e2n(n){return B9("inp",n,s2n,hst)}function Y8(n,e){return fst(n,e),xK[n]||(o2n(n),xK[n]=!0),pst(n,e)}function j4(n,e){const t=qF[n];if(!(!t||!t.length))for(const i of t)try{i(e)}catch(r){Wl&&ni.error(`Error while triggering instrumentation handler. Type: ${n} Name: ${Tw(i)} Error:`,r)}}function t2n(){return BTn(n=>{j4("cls",{metric:n}),lst=n},{reportAllChanges:!0})}function n2n(){return VTn(n=>{j4("fid",{metric:n}),cst=n})}function i2n(){return GTn(n=>{j4("lcp",{metric:n}),ust=n})}function r2n(){return YTn(n=>{j4("ttfb",{metric:n}),dst=n})}function s2n(){return KTn(n=>{j4("inp",{metric:n}),hst=n})}function B9(n,e,t,i,r=!1){fst(n,e);let s;return xK[n]||(s=t(),xK[n]=!0),i&&e({metric:i}),pst(n,e,r?s:void 0)}function o2n(n){const e={};n==="event"&&(e.durationThreshold=0),M4(n,t=>{j4(n,{entries:t})},e)}function fst(n,e){qF[n]=qF[n]||[],qF[n].push(e)}function pst(n,e,t){return()=>{t&&t();const i=qF[n];if(!i)return;const r=i.indexOf(e);r!==-1&&i.splice(r,1)}}function Jle(n){return typeof n=="number"&&isFinite(n)}function tM(n,{startTimestamp:e,...t}){return e&&n.startTimestamp>e&&(n.startTimestamp=e),n.startChild({startTimestamp:e,...t})}const a2n=2147483647;function sd(n){return n/1e3}function YEe(){return to&&to.addEventListener&&to.performance}let x6e=0,Fc={},V0,KF;function l2n(){const n=YEe();if(n&&nv){n.mark&&to.performance.mark("sentry-tracing-init");const e=p2n(),t=h2n(),i=f2n(),r=g2n();return()=>{e(),t(),i(),r()}}return()=>{}}function c2n(){Y8("longtask",({entries:n})=>{for(const e of n){const t=OL();if(!t)return;const i=sd(nv+e.startTime),r=sd(e.duration);t.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:i,endTimestamp:i+r})}})}function u2n(){Y8("event",({entries:n})=>{for(const e of n){const t=OL();if(!t)return;if(e.name==="click"){const i=sd(nv+e.startTime),r=sd(e.duration),s={description:ZO(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:i,endTimestamp:i+r},o=mrt(e.target);o&&(s.attributes={"ui.component_name":o}),t.startChild(s)}}})}function d2n(n,e){if(YEe()&&nv){const i=m2n(n,e);return()=>{i()}}return()=>{}}function h2n(){return QTn(({metric:n})=>{const e=n.entries[n.entries.length-1];e&&(Wl&&ni.log("[Measurements] Adding CLS"),Fc.cls={value:n.value,unit:""},KF=e)},!0)}function f2n(){return XTn(({metric:n})=>{const e=n.entries[n.entries.length-1];e&&(Wl&&ni.log("[Measurements] Adding LCP"),Fc.lcp={value:n.value,unit:"millisecond"},V0=e)},!0)}function p2n(){return JTn(({metric:n})=>{const e=n.entries[n.entries.length-1];if(!e)return;const t=sd(nv),i=sd(e.startTime);Wl&&ni.log("[Measurements] Adding FID"),Fc.fid={value:n.value,unit:"millisecond"},Fc["mark.fid"]={value:t+i,unit:"second"}})}function g2n(){return ZTn(({metric:n})=>{n.entries[n.entries.length-1]&&(Wl&&ni.log("[Measurements] Adding TTFB"),Fc.ttfb={value:n.value,unit:"millisecond"})})}const S6e={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function m2n(n,e){return e2n(({metric:t})=>{if(t.value===void 0)return;const i=t.entries.find(y=>y.duration===t.value&&S6e[y.name]!==void 0),r=gd();if(!i||!r)return;const s=S6e[i.name],o=r.getOptions(),a=sd(nv+i.startTime),l=sd(t.value),c=i.interactionId!==void 0?n[i.interactionId]:void 0;if(c===void 0)return;const{routeName:u,parentContext:d,activeTransaction:f,user:p,replayId:g}=c,m=p!==void 0?p.email||p.id||p.ip_address:void 0,_=f!==void 0?f.getProfileId():void 0,v=new jee({startTimestamp:a,endTimestamp:a+l,op:`ui.interaction.${s}`,name:ZO(i.target),attributes:{release:o.release,environment:o.environment,transaction:u,...m!==void 0&&m!==""?{user:m}:{},..._!==void 0?{profile_id:_}:{},...g!==void 0?{replay_id:g}:{}},exclusiveTime:t.value,measurements:{inp:{value:t.value,unit:"millisecond"}}}),b=E2n(d,o,e);if(b&&Math.random()<b){const y=v?CTn([v],r.getDsn()):void 0,C=r&&r.getTransport();C&&y&&C.send(y).then(null,S=>{Wl&&ni.error("Error while sending interaction:",S)});return}})}function _2n(n){const e=YEe();if(!e||!to.performance.getEntries||!nv)return;Wl&&ni.log("[Tracing] Adding & adjusting spans using Performance API");const t=sd(nv),i=e.getEntries(),{op:r,start_timestamp:s}=op(n);if(i.slice(x6e).forEach(o=>{const a=sd(o.startTime),l=sd(o.duration);if(!(n.op==="navigation"&&s&&t+a<s))switch(o.entryType){case"navigation":{b2n(n,o,t);break}case"mark":case"paint":case"measure":{v2n(n,o,a,l,t);const c=GEe(),u=o.startTime<c.firstHiddenTime;o.name==="first-paint"&&u&&(Wl&&ni.log("[Measurements] Adding FP"),Fc.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&u&&(Wl&&ni.log("[Measurements] Adding FCP"),Fc.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{C2n(n,o,o.name,a,l,t);break}}}),x6e=Math.max(i.length-1,0),w2n(n),r==="pageload"){S2n(Fc),["fcp","fp","lcp"].forEach(a=>{if(!Fc[a]||!s||t>=s)return;const l=Fc[a].value,c=t+sd(l),u=Math.abs((c-s)*1e3),d=u-l;Wl&&ni.log(`[Measurements] Normalized ${a} from ${l} to ${u} (${d})`),Fc[a].value=u});const o=Fc["mark.fid"];o&&Fc.fid&&(tM(n,{description:"first input delay",endTimestamp:o.value+sd(Fc.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete Fc["mark.fid"]),"fcp"in Fc||delete Fc.cls,Object.keys(Fc).forEach(a=>{Zkn(a,Fc[a].value,Fc[a].unit)}),x2n(n)}V0=void 0,KF=void 0,Fc={}}function v2n(n,e,t,i,r){const s=r+t,o=s+i;return tM(n,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function b2n(n,e,t){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(i=>{BV(n,e,i,t)}),BV(n,e,"secureConnection",t,"TLS/SSL","connectEnd"),BV(n,e,"fetch",t,"cache","domainLookupStart"),BV(n,e,"domainLookup",t,"DNS"),y2n(n,e,t)}function BV(n,e,t,i,r,s){const o=s?e[s]:e[`${t}End`],a=e[`${t}Start`];!a||!o||tM(n,{op:"browser",origin:"auto.browser.browser.metrics",description:r||t,startTimestamp:i+sd(a),endTimestamp:i+sd(o)})}function y2n(n,e,t){e.responseEnd&&(tM(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:t+sd(e.requestStart),endTimestamp:t+sd(e.responseEnd)}),tM(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:t+sd(e.responseStart),endTimestamp:t+sd(e.responseEnd)}))}function C2n(n,e,t,i,r,s){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const o=oI(t),a={};ece(a,e,"transferSize","http.response_transfer_size"),ece(a,e,"encodedBodySize","http.response_content_length"),ece(a,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(a["resource.render_blocking_status"]=e.renderBlockingStatus),o.protocol&&(a["url.scheme"]=o.protocol.split(":").pop()),o.host&&(a["server.address"]=o.host),a["url.same_origin"]=t.includes(to.location.origin);const l=s+i,c=l+r;tM(n,{description:t.replace(to.location.origin,""),endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:l,data:a})}function w2n(n){const e=to.navigator;if(!e)return;const t=e.connection;t&&(t.effectiveType&&n.setTag("effectiveConnectionType",t.effectiveType),t.type&&n.setTag("connectionType",t.type),Jle(t.rtt)&&(Fc["connection.rtt"]={value:t.rtt,unit:"millisecond"})),Jle(e.deviceMemory)&&n.setTag("deviceMemory",`${e.deviceMemory} GB`),Jle(e.hardwareConcurrency)&&n.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function x2n(n){V0&&(Wl&&ni.log("[Measurements] Adding LCP Data"),V0.element&&n.setTag("lcp.element",ZO(V0.element)),V0.id&&n.setTag("lcp.id",V0.id),V0.url&&n.setTag("lcp.url",V0.url.trim().slice(0,200)),n.setTag("lcp.size",V0.size)),KF&&KF.sources&&(Wl&&ni.log("[Measurements] Adding CLS Data"),KF.sources.forEach((e,t)=>n.setTag(`cls.source.${t+1}`,ZO(e.node))))}function ece(n,e,t,i){const r=e[t];r!=null&&r<a2n&&(n[i]=r)}function S2n(n){const e=Fee();if(!e)return;const{responseStart:t,requestStart:i}=e;i<=t&&(Wl&&ni.log("[Measurements] Adding TTFB Request Time"),n["ttfb.requestTime"]={value:t-i,unit:"millisecond"})}function E2n(n,e,t){if(!O4(e))return!1;let i;return n!==void 0&&typeof e.tracesSampler=="function"?i=e.tracesSampler({transactionContext:n,name:n.name,parentSampled:n.parentSampled,attributes:{...n.data,...n.attributes},location:to.location}):n!==void 0&&n.sampled!==void 0?i=n.sampled:typeof e.tracesSampleRate<"u"?i=e.tracesSampleRate:i=1,Qrt(i)?i===!0?t:i===!1?0:i*t:(Wl&&ni.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1)}function k2n(n,e,t,i,r="auto.http.browser"){if(!O4()||!n.fetchData)return;const s=e(n.fetchData.url);if(n.endTimestamp&&s){const p=n.fetchData.__span;if(!p)return;const g=i[p];g&&(L2n(g,n),delete i[p]);return}const o=m1(),a=gd(),{method:l,url:c}=n.fetchData,u=I2n(c),d=u?oI(u).host:void 0,f=s?zrt({name:`${l} ${c}`,onlyIfParent:!0,attributes:{url:c,type:"fetch","http.method":l,"http.url":u,"server.address":d,[SR]:r},op:"http.client"}):void 0;if(f&&(n.fetchData.__span=f.spanContext().spanId,i[f.spanContext().spanId]=f),t(n.fetchData.url)&&a){const p=n.args[0];n.args[1]=n.args[1]||{};const g=n.args[1];g.headers=T2n(p,a,o,g,f)}return f}function T2n(n,e,t,i,r){const s=r||t.getSpan(),o=jA(),{traceId:a,spanId:l,sampled:c,dsc:u}={...o.getPropagationContext(),...t.getPropagationContext()},d=s?Pee(s):VEe(a,l,c),f=Drt(u||(s?eM(s):Mee(a,e,t))),p=i.headers||(typeof Request<"u"&&kw(n,Request)?n.headers:void 0);if(p)if(typeof Headers<"u"&&kw(p,Headers)){const g=new Headers(p);return g.append("sentry-trace",d),f&&g.append(rge,f),g}else if(Array.isArray(p)){const g=[...p,["sentry-trace",d]];return f&&g.push([rge,f]),g}else{const g="baggage"in p?p.baggage:void 0,m=[];return Array.isArray(g)?m.push(...g):g&&m.push(g),f&&m.push(f),{...p,"sentry-trace":d,baggage:m.length>0?m.join(","):void 0}}else return{"sentry-trace":d,baggage:f}}function I2n(n){try{return new URL(n).href}catch{return}}function L2n(n,e){if(e.response){qEe(n,e.response.status);const t=e.response&&e.response.headers&&e.response.headers.get("content-length");if(t){const i=parseInt(t);i>0&&n.setAttribute("http.response_content_length",i)}}else e.error&&n.setStatus("internal_error");n.end()}const dge=["localhost",/^\/(?!\/)/],hge={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:dge,tracePropagationTargets:dge};function A2n(n){const{traceFetch:e,traceXHR:t,tracePropagationTargets:i,tracingOrigins:r,shouldCreateSpanForRequest:s,enableHTTPTimings:o}={traceFetch:hge.traceFetch,traceXHR:hge.traceXHR,...n},a=typeof s=="function"?s:u=>!0,l=u=>P2n(u,i||r),c={};e&&Ert(u=>{const d=k2n(u,a,l,c);if(d){const f=gst(u.fetchData.url),p=f?oI(f).host:void 0;d.setAttributes({"http.url":f,"server.address":p})}o&&d&&E6e(d)}),t&&Irt(u=>{const d=O2n(u,a,l,c);o&&d&&E6e(d)})}function N2n(n){return n.entryType==="resource"&&"initiatorType"in n&&typeof n.nextHopProtocol=="string"&&(n.initiatorType==="fetch"||n.initiatorType==="xmlhttprequest")}function E6e(n){const{url:e}=op(n).data||{};if(!e||typeof e!="string")return;const t=Y8("resource",({entries:i})=>{i.forEach(r=>{N2n(r)&&r.name.endsWith(e)&&(R2n(r).forEach(o=>n.setAttribute(...o)),setTimeout(t))})})}function D2n(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 L0(n=0){return((nv||performance.timeOrigin)+n)/1e3}function R2n(n){const{name:e,version:t}=D2n(n.nextHopProtocol),i=[];return i.push(["network.protocol.version",t],["network.protocol.name",e]),nv?[...i,["http.request.redirect_start",L0(n.redirectStart)],["http.request.fetch_start",L0(n.fetchStart)],["http.request.domain_lookup_start",L0(n.domainLookupStart)],["http.request.domain_lookup_end",L0(n.domainLookupEnd)],["http.request.connect_start",L0(n.connectStart)],["http.request.secure_connection_start",L0(n.secureConnectionStart)],["http.request.connection_end",L0(n.connectEnd)],["http.request.request_start",L0(n.requestStart)],["http.request.response_start",L0(n.responseStart)],["http.request.response_end",L0(n.responseEnd)]]:i}function P2n(n,e){return D9(n,e||dge)}function O2n(n,e,t,i){const r=n.xhr,s=r&&r[wR];if(!O4()||!r||r.__sentry_own_request__||!s)return;const o=e(s.url);if(n.endTimestamp&&o){const p=r.__sentry_xhr_span_id__;if(!p)return;const g=i[p];g&&s.status_code!==void 0&&(qEe(g,s.status_code),g.end(),delete i[p]);return}const a=m1(),l=jA(),c=gst(s.url),u=c?oI(c).host:void 0,d=o?zrt({name:`${s.method} ${s.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":s.method,"http.url":c,url:s.url,"server.address":u,[SR]:"auto.http.browser"},op:"http.client"}):void 0;d&&(r.__sentry_xhr_span_id__=d.spanContext().spanId,i[r.__sentry_xhr_span_id__]=d);const f=gd();if(r.setRequestHeader&&t(s.url)&&f){const{traceId:p,spanId:g,sampled:m,dsc:_}={...l.getPropagationContext(),...a.getPropagationContext()},v=d?Pee(d):VEe(p,g,m),b=Drt(_||(d?eM(d):Mee(p,f,a)));M2n(r,v,b)}return d}function M2n(n,e,t){try{n.setRequestHeader("sentry-trace",e),t&&n.setRequestHeader(rge,t)}catch{}}function gst(n){try{return new URL(n,to.location.origin).href}catch{return}}function j2n(n,e=!0,t=!0){if(!to||!to.location){Wl&&ni.warn("Could not initialize routing instrumentation due to invalid location");return}let i=to.location.href,r;e&&(r=n({name:to.location.pathname,startTimestamp:nv?nv/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),t&&$Ee(({to:s,from:o})=>{if(o===void 0&&i&&i.indexOf(s)!==-1){i=void 0;return}o!==s&&(i=void 0,r&&(Wl&&ni.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.end()),r=n({name:to.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}const F2n="BrowserTracing",B2n={...Yz,markBackgroundTransactions:!0,routingInstrumentation:j2n,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...hge},k6e=10;class $2n{constructor(e){this.name=F2n,this._hasSetTracePropagationTargets=!1,Xkn(),Wl&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...B2n,...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=l2n(),this._interactionIdToRouteNameMapping={},this.options.enableInp&&d2n(this._interactionIdToRouteNameMapping,this.options.interactionsSampleRate),this.options.enableLongTask&&c2n(),this.options._experiments.enableInteractions&&u2n(),this._latestRoute={name:void 0,context:void 0}}setupOnce(e,t){this._getCurrentHub=t;const r=t().getClient(),s=r&&r.getOptions(),{routingInstrumentation:o,startTransactionOnLocationChange:a,startTransactionOnPageLoad:l,markBackgroundTransactions:c,traceFetch:u,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:p,_experiments:g}=this.options,m=s&&s.tracePropagationTargets,_=m||this.options.tracePropagationTargets;Wl&&this._hasSetTracePropagationTargets&&m&&ni.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."),o(v=>{const b=this._createRouteTransaction(v);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(b,v,t),b},l,a),c&&MTn(),g.enableInteractions&&this._registerInteractionListener(),this.options.enableInp&&this._registerInpInteractionListener(),A2n({traceFetch:u,traceXHR:d,tracePropagationTargets:_,shouldCreateSpanForRequest:f,enableHTTPTimings:p})}_createRouteTransaction(e){if(!this._getCurrentHub){Wl&&ni.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const t=this._getCurrentHub(),{beforeNavigate:i,idleTimeout:r,finalTimeout:s,heartbeatInterval:o}=this.options,a=e.op==="pageload";let l;if(a){const p=a?T6e("sentry-trace"):"",g=a?T6e("baggage"):void 0,{traceId:m,dsc:_,parentSpanId:v,sampled:b}=nkn(p,g);l={traceId:m,parentSpanId:v,parentSampled:b,...e,metadata:{...e.metadata,dynamicSamplingContext:_},trimEnd:!0}}else l={trimEnd:!0,...e};const c=typeof i=="function"?i(l):l,u=c===void 0?{...l,sampled:!1}:c;u.metadata=u.name!==l.name?{...u.metadata,source:"custom"}:u.metadata,this._latestRoute.name=u.name,this._latestRoute.context=u,u.sampled===!1&&Wl&&ni.log(`[Tracing] Will not send ${u.op} transaction because of beforeNavigate.`),Wl&&ni.log(`[Tracing] Starting ${u.op} transaction on scope`);const{location:d}=to,f=f6e(t,u,r,s,!0,{location:d},o,a);return a&&to.document&&(to.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(to.document.readyState)&&f.sendAutoFinishSignal()}),["interactive","complete"].includes(to.document.readyState)&&f.sendAutoFinishSignal()),f.registerBeforeFinishCallback(p=>{this._collectWebVitals(),_2n(p)}),f}_registerInteractionListener(){let e;const t=()=>{const{idleTimeout:i,finalTimeout:r,heartbeatInterval:s}=this.options,o="ui.action.click",a=OL();if(a&&a.op&&["navigation","pageload"].includes(a.op)){Wl&&ni.warn(`[Tracing] Did not create ${o} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.end(),e=void 0),!this._getCurrentHub){Wl&&ni.warn(`[Tracing] Did not create ${o} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRoute.name){Wl&&ni.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}const l=this._getCurrentHub(),{location:c}=to,u={name:this._latestRoute.name,op:o,trimEnd:!0,data:{[IP]:this._latestRoute.context?H2n(this._latestRoute.context):"url"}};e=f6e(l,u,i,r,!0,{location:c},s)};["click"].forEach(i=>{to.document&&addEventListener(i,t,{once:!1,capture:!0})})}_registerInpInteractionListener(){const e=({entries:t})=>{const i=gd(),r=i!==void 0&&i.getIntegrationByName!==void 0?i.getIntegrationByName("Replay"):void 0,s=r!==void 0?r.getReplayId():void 0,o=OL(),a=m1(),l=a!==void 0?a.getUser():void 0;t.forEach(c=>{if(V2n(c)){const u=c.interactionId;if(u===void 0)return;const d=this._interactionIdToRouteNameMapping[u],f=c.duration,p=c.startTime,g=Object.keys(this._interactionIdToRouteNameMapping),m=g.length>0?g.reduce((_,v)=>this._interactionIdToRouteNameMapping[_].duration<this._interactionIdToRouteNameMapping[v].duration?_:v):void 0;if(c.entryType==="first-input"&&g.map(v=>this._interactionIdToRouteNameMapping[v]).some(v=>v.duration===f&&v.startTime===p)||!u)return;if(d)d.duration=Math.max(d.duration,f);else if(g.length<k6e||m===void 0||f>this._interactionIdToRouteNameMapping[m].duration){const _=this._latestRoute.name,v=this._latestRoute.context;_&&v&&(m&&Object.keys(this._interactionIdToRouteNameMapping).length>=k6e&&delete this._interactionIdToRouteNameMapping[m],this._interactionIdToRouteNameMapping[u]={routeName:_,duration:f,parentContext:v,user:l,activeTransaction:o,replayId:s,startTime:p})}}})};Y8("event",e),Y8("first-input",e)}}function T6e(n){const e=cEn(`meta[name=${n}]`);return e?e.getAttribute("content"):void 0}function H2n(n){const e=n.attributes&&n.attributes[IP],t=n.data&&n.data[IP],i=n.metadata&&n.metadata.source;return e||t||i}function V2n(n){return"duration"in n}const Al=Aa;let fge=0;function mst(){return fge>0}function W2n(){fge++,setTimeout(()=>{fge--})}function nM(n,e={},t){if(typeof n!="function")return n;try{const r=n.__sentry_wrapped__;if(r)return typeof r=="function"?r:n;if(BEe(n))return n}catch{return n}const i=function(){const r=Array.prototype.slice.call(arguments);try{const s=r.map(o=>nM(o,e));return n.apply(this,s)}catch(s){throw W2n(),Tkn(o=>{o.addEventProcessor(a=>(e.mechanism&&(Xpe(a,void 0),G8(a,e.mechanism)),a.extra={...a.extra,arguments:r},a)),kkn(s)}),s}};try{for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}catch{}vrt(i,n),DL(n,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get(){return n.name}})}catch{}return i}const VC=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function _st(n,e){const t=QEe(n,e),i={type:e&&e.name,value:K2n(e)};return t.length&&(i.stacktrace={frames:t}),i.type===void 0&&i.value===""&&(i.value="Unrecoverable error caught"),i}function z2n(n,e,t,i){const r=gd(),s=r&&r.getOptions().normalizeDepth,o={exception:{values:[{type:Aee(e)?e.constructor.name:i?"UnhandledRejection":"Error",value:Q2n(e,{isUnhandledRejection:i})}]},extra:{__serialized__:Lrt(e,s)}};if(t){const a=QEe(n,t);a.length&&(o.exception.values[0].stacktrace={frames:a})}return o}function tce(n,e){return{exception:{values:[_st(n,e)]}}}function QEe(n,e){const t=e.stacktrace||e.stack||"",i=q2n(e);try{return n(t,i)}catch{}return[]}const U2n=/Minified React error #\d+;/i;function q2n(n){if(n){if(typeof n.framesToPop=="number")return n.framesToPop;if(U2n.test(n.message))return 1}return 0}function K2n(n){const e=n&&n.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function G2n(n,e,t,i){const r=t&&t.syntheticException||void 0,s=XEe(n,e,r,i);return G8(s),s.level="error",t&&t.event_id&&(s.event_id=t.event_id),JO(s)}function Y2n(n,e,t="info",i,r){const s=i&&i.syntheticException||void 0,o=pge(n,e,s,r);return o.level=t,i&&i.event_id&&(o.event_id=i.event_id),JO(o)}function XEe(n,e,t,i,r){let s;if(OEe(e)&&e.error)return tce(n,e.error);if(VFe(e)||JSn(e)){const o=e;if("stack"in e)s=tce(n,e);else{const a=o.name||(VFe(o)?"DOMError":"DOMException"),l=o.message?`${a}: ${o.message}`:a;s=pge(n,l,t,i),Xpe(s,l)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return hrt(e)?tce(n,e):XO(e)||Aee(e)?(s=z2n(n,e,t,r),G8(s,{synthetic:!0}),s):(s=pge(n,e,t,i),Xpe(s,`${e}`),G8(s,{synthetic:!0}),s)}function pge(n,e,t,i){const r={};if(i&&t){const s=QEe(n,t);s.length&&(r.exception={values:[{value:e,stacktrace:{frames:s}}]})}if(MEe(e)){const{__sentry_template_string__:s,__sentry_template_values__:o}=e;return r.logentry={message:s,params:o},r}return r.message=e,r}function Q2n(n,{isUnhandledRejection:e}){const t=vEn(n),i=e?"promise rejection":"exception";return OEe(n)?`Event \`ErrorEvent\` captured as ${i} with message \`${n.message}\``:Aee(n)?`Event \`${X2n(n)}\` (type=${n.type}) captured as ${i}`:`Object captured as ${i} with keys: ${t}`}function X2n(n){try{const e=Object.getPrototypeOf(n);return e?e.constructor.name:void 0}catch{}}function Z2n(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:P4(i)}},s=J2n(n);return MA(r,[s])}function J2n(n){return[{type:"user_report"},n]}class eIn extends pTn{constructor(e){const t=Al.SENTRY_SDK_SOURCE||$En();tst(e,"browser",["browser"],t),super(e),e.sendClientReports&&Al.document&&Al.document.addEventListener("visibilitychange",()=>{Al.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return G2n(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",i){return Y2n(this._options.stackParser,e,t,i,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){VC&&ni.warn("SDK not enabled, will not capture user feedback.");return}const t=Z2n(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){VC&&ni.log("No outcomes to send");return}if(!this._dsn){VC&&ni.log("No dsn provided, will not send outcomes");return}VC&&ni.log("Sending outcomes:",e);const t=ckn(e,this._options.tunnel&&P4(this._dsn));this._sendEnvelope(t)}}let Uj;function tIn(){if(Uj)return Uj;if(tge(Al.fetch))return Uj=Al.fetch.bind(Al);const n=Al.document;let e=Al.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){VC&&ni.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return Uj=e.bind(Al)}function nIn(){Uj=void 0}function iIn(n,e=tIn()){let t=0,i=0;function r(s){const o=s.body.length;t+=o,i++;const a={body:s.body,method:"POST",referrerPolicy:"origin",headers:n.headers,keepalive:t<=6e4&&i<15,...n.fetchOptions};try{return e(n.url,a).then(l=>(t-=o,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 nIn(),t-=o,i--,HEe(l)}}return est(n,r)}const rIn=4;function sIn(n){function e(t){return new om((i,r)=>{const s=new XMLHttpRequest;s.onerror=r,s.onreadystatechange=()=>{s.readyState===rIn&&i({statusCode:s.status,headers:{"x-sentry-rate-limits":s.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":s.getResponseHeader("Retry-After")}})},s.open("POST",n.url);for(const o in n.headers)Object.prototype.hasOwnProperty.call(n.headers,o)&&s.setRequestHeader(o,n.headers[o]);s.send(t.body)})}return est(n,e)}const Bee="?",oIn=30,aIn=40,lIn=50;function ZEe(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 cIn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,uIn=/\((\S*)(?::(\d+))(?::(\d+))\)/,dIn=n=>{const e=cIn.exec(n);if(e){if(e[2]&&e[2].indexOf("eval")===0){const s=uIn.exec(e[2]);s&&(e[2]=s[1],e[3]=s[2],e[4]=s[3])}const[i,r]=vst(e[1]||Bee,e[2]);return ZEe(r,i,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},hIn=[oIn,dIn],fIn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,pIn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gIn=n=>{const e=fIn.exec(n);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=pIn.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}let i=e[3],r=e[1]||Bee;return[r,i]=vst(r,i),ZEe(i,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},mIn=[lIn,gIn],_In=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,vIn=n=>{const e=_In.exec(n);return e?ZEe(e[2],e[1]||Bee,+e[3],e[4]?+e[4]:void 0):void 0},bIn=[aIn,vIn],yIn=[hIn,mIn,bIn],CIn=Crt(...yIn),vst=(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]:Bee,t?`safari-extension:${e}`:`safari-web-extension:${e}`]:[n,e]},$V=1024,bst="Breadcrumbs",wIn=(n={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...n};return{name:bst,setupOnce(){},setup(t){e.console&&wEn(EIn(t)),e.dom&&EEn(SIn(t,e.dom)),e.xhr&&Irt(kIn(t)),e.fetch&&Ert(TIn(t)),e.history&&$Ee(IIn(t)),e.sentry&&t.on&&t.on("beforeSendEvent",xIn(t))}}},yst=wIn;Ak(bst,yst);function xIn(n){return function(t){gd()===n&&PL({category:`sentry.${t.type==="transaction"?"transaction":"event"}`,event_id:t.event_id,level:t.level,message:CS(t)},{event:t})}}function SIn(n,e){return function(i){if(gd()!==n)return;let r,s,o=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>$V&&(VC&&ni.warn(`\`dom.maxStringLength\` cannot exceed ${$V}, but a value of ${a} was configured. Sentry will use ${$V} instead.`),a=$V),typeof o=="string"&&(o=[o]);try{const c=i.event,u=LIn(c)?c.target:c;r=ZO(u,{keyAttrs:o,maxStringLength:a}),s=mrt(u)}catch{r="<unknown>"}if(r.length===0)return;const l={category:`ui.${i.name}`,message:r};s&&(l.data={"ui.component_name":s}),PL(l,{event:i.event,name:i.name,global:i.global})}}function EIn(n){return function(t){if(gd()!==n)return;const i={category:"console",data:{arguments:t.args,logger:"console"},level:GEn(t.level),message:WFe(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)i.message=`Assertion failed: ${WFe(t.args.slice(1)," ")||"console.assert"}`,i.data.arguments=t.args.slice(1);else return;PL(i,{input:t.args,level:t.level})}}function kIn(n){return function(t){if(gd()!==n)return;const{startTimestamp:i,endTimestamp:r}=t,s=t.xhr[wR];if(!i||!r||!s)return;const{method:o,url:a,status_code:l,body:c}=s,u={method:o,url:a,status_code:l},d={xhr:t.xhr,input:c,startTimestamp:i,endTimestamp:r};PL({category:"xhr",data:u,type:"http"},d)}}function TIn(n){return function(t){if(gd()!==n)return;const{startTimestamp:i,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"))if(t.error){const s=t.fetchData,o={data:t.error,input:t.args,startTimestamp:i,endTimestamp:r};PL({category:"fetch",data:s,level:"error",type:"http"},o)}else{const s=t.response,o={...t.fetchData,status_code:s&&s.status},a={input:t.args,response:s,startTimestamp:i,endTimestamp:r};PL({category:"fetch",data:o,type:"http"},a)}}}function IIn(n){return function(t){if(gd()!==n)return;let i=t.from,r=t.to;const s=oI(Al.location.href);let o=i?oI(i):void 0;const a=oI(r);(!o||!o.path)&&(o=s),s.protocol===a.protocol&&s.host===a.host&&(r=a.relative),s.protocol===o.protocol&&s.host===o.host&&(i=o.relative),PL({category:"navigation",data:{from:i,to:r}})}}function LIn(n){return!!n&&!!n.target}const Cst="Dedupe",AIn=()=>{let n;return{name:Cst,setupOnce(){},processEvent(e){if(e.type)return e;try{if(NIn(e,n))return VC&&ni.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return n=e}}},wst=AIn;Ak(Cst,wst);function NIn(n,e){return e?!!(DIn(n,e)||RIn(n,e)):!1}function DIn(n,e){const t=n.message,i=e.message;return!(!t&&!i||t&&!i||!t&&i||t!==i||!Sst(n,e)||!xst(n,e))}function RIn(n,e){const t=I6e(e),i=I6e(n);return!(!t||!i||t.type!==i.type||t.value!==i.value||!Sst(n,e)||!xst(n,e))}function xst(n,e){let t=L6e(n),i=L6e(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 s=i[r],o=t[r];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function Sst(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 I6e(n){return n.exception&&n.exception.values&&n.exception.values[0]}function L6e(n){const e=n.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const Est="GlobalHandlers",PIn=(n={})=>{const e={onerror:!0,onunhandledrejection:!0,...n};return{name:Est,setupOnce(){Error.stackTraceLimit=50},setup(t){e.onerror&&(OIn(t),A6e("onerror")),e.onunhandledrejection&&(MIn(t),A6e("onunhandledrejection"))}}},kst=PIn;Ak(Est,kst);function OIn(n){krt(e=>{const{stackParser:t,attachStacktrace:i}=Ist();if(gd()!==n||mst())return;const{msg:r,url:s,line:o,column:a,error:l}=e,c=l===void 0&&Py(r)?BIn(r,s,o,a):Tst(XEe(t,l||r,void 0,i,!1),s,o,a);c.level="error",jrt(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}function MIn(n){Trt(e=>{const{stackParser:t,attachStacktrace:i}=Ist();if(gd()!==n||mst())return;const r=jIn(e),s=jEe(r)?FIn(r):XEe(t,r,void 0,i,!0);s.level="error",jrt(s,{originalException:r,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function jIn(n){if(jEe(n))return n;const e=n;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return n}function FIn(n){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`}]}}}function BIn(n,e,t,i){const r=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let s=OEe(n)?n.message:n,o="Error";const a=s.match(r);return a&&(o=a[1],s=a[2]),Tst({exception:{values:[{type:o,value:s}]}},e,t,i)}function Tst(n,e,t,i){const r=n.exception=n.exception||{},s=r.values=r.values||[],o=s[0]=s[0]||{},a=o.stacktrace=o.stacktrace||{},l=a.frames=a.frames||[],c=isNaN(parseInt(i,10))?void 0:i,u=isNaN(parseInt(t,10))?void 0:t,d=Py(e)&&e.length>0?e:lEn();return l.length===0&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),n}function A6e(n){VC&&ni.log(`Global Handler attached: ${n}`)}function Ist(){const n=gd();return n&&n.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const Lst="HttpContext",$In=()=>({name:Lst,setupOnce(){},preprocessEvent(n){if(!Al.navigator&&!Al.location&&!Al.document)return;const e=n.request&&n.request.url||Al.location&&Al.location.href,{referrer:t}=Al.document||{},{userAgent:i}=Al.navigator||{},r={...n.request&&n.request.headers,...t&&{Referer:t},...i&&{"User-Agent":i}},s={...n.request,...e&&{url:e},headers:r};n.request=s}}),Ast=$In;Ak(Lst,Ast);const HIn="cause",VIn=5,Nst="LinkedErrors",WIn=(n={})=>{const e=n.limit||VIn,t=n.key||HIn;return{name:Nst,setupOnce(){},preprocessEvent(i,r,s){const o=s.getOptions();rEn(_st,o.stackParser,o.maxValueLength,t,e,i,r)}}},Dst=WIn;Ak(Nst,Dst);const zIn=["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"],Rst="TryCatch",UIn=(n={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...n};return{name:Rst,setupOnce(){e.setTimeout&&yh(Al,"setTimeout",N6e),e.setInterval&&yh(Al,"setInterval",N6e),e.requestAnimationFrame&&yh(Al,"requestAnimationFrame",qIn),e.XMLHttpRequest&&"XMLHttpRequest"in Al&&yh(XMLHttpRequest.prototype,"send",KIn);const t=e.eventTarget;t&&(Array.isArray(t)?t:zIn).forEach(GIn)}}},Pst=UIn;Ak(Rst,Pst);function N6e(n){return function(...e){const t=e[0];return e[0]=nM(t,{mechanism:{data:{function:Tw(n)},handled:!1,type:"instrument"}}),n.apply(this,e)}}function qIn(n){return function(e){return n.apply(this,[nM(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Tw(n)},handled:!1,type:"instrument"}})])}}function KIn(n){return function(...e){const t=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in t&&typeof t[r]=="function"&&yh(t,r,function(s){const o={mechanism:{data:{function:r,handler:Tw(s)},handled:!1,type:"instrument"}},a=BEe(s);return a&&(o.mechanism.data.handler=Tw(a)),nM(s,o)})}),n.apply(this,e)}}function GIn(n){const e=Al,t=e[n]&&e[n].prototype;!t||!t.hasOwnProperty||!t.hasOwnProperty("addEventListener")||(yh(t,"addEventListener",function(i){return function(r,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=nM(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Tw(s),target:n},handled:!1,type:"instrument"}}))}catch{}return i.apply(this,[r,nM(s,{mechanism:{data:{function:"addEventListener",handler:Tw(s),target:n},handled:!1,type:"instrument"}}),o])}}),yh(t,"removeEventListener",function(i){return function(r,s,o){const a=s;try{const l=a&&a.__sentry_wrapped__;l&&i.call(this,r,l,o)}catch{}return i.call(this,r,a,o)}}))}const YIn=[ist(),sst(),Pst(),yst(),kst(),Dst(),wst(),Ast()];function QIn(n){return[...YIn]}function XIn(n={}){n.defaultIntegrations===void 0&&(n.defaultIntegrations=QIn()),n.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(n.release=__SENTRY_RELEASE__),Al.SENTRY_RELEASE&&Al.SENTRY_RELEASE.id&&(n.release=Al.SENTRY_RELEASE.id)),n.autoSessionTracking===void 0&&(n.autoSessionTracking=!0),n.sendClientReports===void 0&&(n.sendClientReports=!0);const e={...n,stackParser:yEn(n.stackParser||CIn),integrations:lTn(n),transport:n.transport||(Srt()?iIn:sIn)};_Tn(eIn,e),n.autoSessionTracking&&ZIn()}function ZIn(){if(typeof Al.document>"u"){VC&&ni.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}o6e({ignoreDuration:!0}),a6e(),$Ee(({from:n,to:e})=>{n!==void 0&&n!==e&&(o6e({ignoreDuration:!0}),a6e())})}function JIn(n){const e={...n};tst(e,"react"),XIn(e)}function eLn(n){const e=gc(),t=e.pathname.split("/"),i=(t==null?void 0:t[2])||"",r=i&&e.pathname.startsWith(`/clients/${i}`)&&!e.pathname.endsWith("/edit"),s=i&&e.pathname.startsWith(`/vendors/${i}`)&&!e.pathname.endsWith("/edit");return x.useEffect(()=>{r||s||window.scrollTo(0,0)},[e]),h.jsx(h.Fragment,{children:n.children})}var HV={},D6e;function tLn(){if(D6e)return HV;D6e=1;var n=gVe();return HV.createRoot=n.createRoot,HV.hydrateRoot=n.hydrateRoot,HV}var nLn=tLn();const iLn="Organization",rLn="Name",sLn="Website",oLn="Phone",aLn="Address",lLn="Street",cLn="Apt/Suite",uLn="City",dLn="State/Province",hLn="Postal Code",fLn="Country",pLn="Contacts",gLn="First Name",mLn="Last Name",_Ln="Phone",vLn="Email",bLn="Additional Info",yLn="Payment Terms",CLn="Currency",wLn="Company Size",xLn="Industry",SLn="Private Notes",ELn="Invoice Date",kLn="Due Date",TLn="Invoice",ILn="Client",LLn="Invoice Number",ALn="Invoice #",NLn="PO Number",DLn="PO #",RLn="How Often",PLn="Discount",OLn="Taxes",MLn="Tax",jLn="Item",FLn="Description",BLn="Unit Cost",$Ln="Quantity",HLn="Line Total",VLn="Subtotal",WLn="Net",zLn="Paid to Date",ULn="Balance Due",qLn="Design",KLn="Terms",GLn="Your Invoice",YLn="Remove contact",QLn="Add contact",XLn="Create new client",ZLn="Edit client details",JLn="Enable",eAn="Learn more",tAn="Manage rates",nAn="Note to Client",iAn="Invoice Terms",rAn="Save as default terms",sAn="Download PDF",oAn="Pay Now",aAn="Save Invoice",lAn="Clone To Invoice",cAn="Archive Invoice",uAn="Delete Invoice",dAn="Email Invoice",hAn="Enter Payment",fAn="Tax Rates",pAn="Rate",gAn="Settings",mAn="Enable specifying an <b>invoice tax</b>",_An="Enable specifying <b>line item taxes</b>",vAn="Dashboard",bAn='Note: add a :link named ":name" to show the totals using a single base currency.',yAn="Clients",CAn="Invoices",wAn="Payments",xAn="Credits",SAn="History",EAn="Search",kAn="Sign Up",TAn="Guest",IAn="Company Details",LAn="Online Payments",AAn="Notifications",NAn="Import | Export",DAn="Done",RAn="Save",PAn="Create",OAn="Upload",MAn="Download",jAn="Cancel",FAn="Close",BAn="Please provide a valid email address",$An="Powered by",HAn="No items",VAn="Recurring Invoices",WAn=`<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>`,zAn="Recurring Quotes",UAn="in total revenue",qAn="billed client",KAn="billed clients",GAn="active client",YAn="active clients",QAn="Invoices Past Due",XAn="Upcoming Invoices",ZAn="Average Invoice",JAn="Archive",eNn="Archive Client",tNn="Delete Client",nNn="Archive Payment",iNn="Delete Payment",rNn="Archive Credit",sNn="Delete Credit",oNn="Show archived/deleted",aNn="Filter",lNn="New Client",cNn="New Invoice",uNn="Enter Payment",dNn="Enter Credit",hNn="Contact",fNn="Date Created",pNn="Last Login",gNn="Balance",mNn="Action",_Nn="Status",vNn="Invoice Total",bNn="Frequency",yNn="Range",CNn="Start Date",wNn="End Date",xNn="Transaction Reference",SNn="Method",ENn="Payment Amount",kNn="Payment Date",TNn="Credit Amount",INn="Credit Balance",LNn="Credit Date",ANn="No data available in table",NNn="Select",DNn="Edit Client",RNn="Edit Invoice",PNn="Create Invoice",ONn="Enter Credit",MNn="Last logged in",jNn="Details",FNn="Standing",BNn="Credit",$Nn="Activity",HNn="Date",VNn="Message",WNn="Adjustment",zNn="Are you sure?",UNn="Payment Type",qNn="Amount",KNn="Email",GNn="Language",YNn="Timezone",QNn="Date Format",XNn="Date/Time Format",ZNn="Users",JNn="Localization",eDn="Remove logo",tDn="Supported: JPEG, GIF and PNG",nDn="Payment Gateway",iDn="Gateway",rDn="Email Notifications",sDn="Email me when an invoice is <b>viewed</b>",oDn="Email me when an invoice is <b>paid</b>",aDn="Site Updates",lDn="Custom Messages",cDn="Set default <b>email signature</b>",uDn="Please select a file",dDn="Use first row as headers",hDn="Column",fDn="Sample",pDn="Import to",gDn="client will be created",mDn="clients will be created",_Dn="Email Settings",vDn="Client View Styling",bDn="Attach PDF",yDn="Custom CSS",CDn="Import Client Data",wDn="CSV file",xDn="Export Client Data",SDn="Successfully created client",EDn="Successfully created :count client(s)",kDn="Successfully updated settings",TDn="Successfully removed logo",IDn="Successfully sent message",LDn="Please make sure to select a client and correct any errors",ADn="You've hit the :count client limit on Free accounts. Congrats on your success!",NDn="There was an error processing your payment. Please try again later.",DDn="Registration Required",RDn="Please confirm your email address, :link to resend the confirmation email.",PDn="Successfully updated client",ODn="Successfully archived client",MDn="Successfully archived :count clients",jDn="Successfully deleted client",FDn="Successfully deleted :count clients",BDn="Successfully updated invoice",$Dn="Successfully created invoice",HDn="Successfully cloned invoice",VDn="Successfully emailed invoice",WDn="and created client",zDn="Successfully archived invoice",UDn="Successfully archived :count invoices",qDn="Successfully deleted invoice",KDn="Successfully deleted :count invoices",GDn="Successfully created payment",YDn="Successfully created :count payment(s)",QDn="Successfully archived payment",XDn="Successfully archived :count payments",ZDn="Successfully deleted payment",JDn="Successfully deleted :count payments",eRn="Successfully applied payment",tRn="Successfully created credit",nRn="Successfully archived credit",iRn="Successfully archived :count credits",rRn="Successfully deleted credit",sRn="Successfully deleted :count credits",oRn="Successfully imported file",aRn="Successfully updated vendor",lRn="Successfully created vendor",cRn="Successfully archived vendor",uRn="Successfully archived :count vendors",dRn="Successfully deleted vendor",hRn="Successfully deleted :count vendors",fRn="Account Confirmation",pRn="Account Confirmation",gRn="Please access the link below to confirm your account.",mRn="New invoice :number from :account",_Rn="To view your invoice for :amount, click the link below.",vRn="Payment Received",bRn="Thank you for your payment of :amount.",yRn="Dear :name,",CRn="Regards,",wRn="The Invoice Ninja Team",xRn="To view the invoice click the link below:",SRn="Invoice :invoice was paid by :client",ERn="Invoice :invoice was sent to :client",kRn="Invoice :invoice was viewed by :client",TRn="A payment of :amount was made by client :client towards Invoice :invoice.",IRn="The following client :client was emailed Invoice :invoice for :amount.",LRn="The following client :client viewed Invoice :invoice for :amount.",ARn="Invoice :invoicenumber for :amount for client :client",NRn="Payment with no invoice for amount :amount for client :client",DRn="You can reset your account password by clicking the following button:",RRn="Secure Payment",PRn="Card Number",ORn="Expiration Month",MRn="Expiration Year",jRn="CVV",FRn="Log Out",BRn="Sign up to save your work",$Rn="I agree to the :terms",HRn="Terms of Service",VRn="The email address is already registered",WRn="Working",zRn="Success",URn="You have successfully registered! Please visit the link in the account confirmation email to verify your email address.",qRn="Your account is not registered, this will permanently erase your data.",KRn="Password",GRn="Pro Plan",YRn="You have unsaved changes",QRn="Custom Fields",XRn="Company Fields",ZRn="Client Fields",JRn="Field Label",ePn="Field Value",tPn="Edit",nPn="Set your company name",iPn="View as recipient",rPn="Product Library",sPn="Product",oPn="Products",aPn="Auto-fill products",lPn="Selecting a product will automatically <b>fill in the description and cost</b>",cPn="Auto-update products",uPn="Updating an invoice will automatically <b>update the product library</b>",dPn="Add Product",hPn="Edit Product",fPn="Archive Product",pPn="Successfully updated product",gPn="Successfully created product",mPn="Successfully archived product",_Pn=":link to enable custom fields by joining the Pro Plan",vPn="Advanced Settings",bPn=":link to enable the advanced settings by joining the Pro Plan",yPn="Invoice Design",CPn="Specify colors",wPn="Select the colors used in the invoice",xPn="Chart Builder",SPn="Created by :site | Create. Send. Get Paid.",EPn="Go Pro",kPn="Quote",TPn="Quotes",IPn="Quote Number",LPn="Quote #",APn="Quote Date",NPn="Quote Total",DPn="Your Quote",RPn="Total",PPn="Clone",OPn="New Quote",MPn="Create Quote",jPn="Edit Quote",FPn="Archive Quote",BPn="Delete Quote",$Pn="Save Quote",HPn="Email Quote",VPn="Clone To Quote",WPn="Convert to Invoice",zPn="View Invoice",UPn="View Client",qPn="View Quote",KPn="Successfully updated quote",GPn="Successfully created quote",YPn="Successfully cloned quote",QPn="Successfully emailed quote",XPn="Successfully archived quote",ZPn="Successfully archived :count quotes",JPn="Successfully deleted quote",eOn="Successfully deleted :count quotes",tOn="Successfully converted quote to invoice",nOn="New quote :number from :account",iOn="To view your quote for :amount, click the link below.",rOn="To view your client quote click the link below:",sOn="Quote :invoice was sent to :client",oOn="Quote :invoice was viewed by :client",aOn="The following client :client was emailed Quote :invoice for :amount.",lOn="The following client :client viewed Quote :invoice for :amount.",cOn="Your session has expired.",uOn="Invoice Fields",dOn="Invoice Options",hOn="Hide Paid to Date",fOn='Only display the "Paid to Date" area on your invoices once a payment has been received.',pOn="Charge taxes",gOn="User Management",mOn="Add User",_On="Send Invitation",vOn="Successfully sent invitation",bOn="Successfully updated user",yOn="You've been invited by :invitor. ",COn="Please sign up to add a user",wOn="State",xOn="Edit User",SOn="Delete User",EOn="Active",kOn="Pending",TOn="Successfully deleted user",IOn="Are you sure you want to email this invoice?",LOn="Are you sure you want to email this quote?",AOn="Are you sure you want this invoice emailed?",NOn="Are you sure you want to start the recurrence?",DOn="Delete Account",ROn="Warning: This will permanently delete your account, there is no undo.",POn="Go Back",OOn="Data Visualizations",MOn="Sample data shown",jOn="Hide",FOn="A new version of :releases_link is available. You're running v:user_version, the latest is v:latest_version",BOn="Invoice Settings",$On="Invoice Number Prefix",HOn="Invoice Number Counter",VOn="Quote Number Prefix",WOn="Quote Number Counter",zOn="Share invoice counter",UOn="Invoice issued to",qOn="To prevent a possible conflict please set either an invoice or quote number prefix",KOn="Mark Sent",GOn="More designs",YOn="Additional Invoice Designs",QOn="Go Pro for more invoice designs",XOn="",ZOn="",JOn="Buy",eMn="Successfully added additional invoice designs",tMn="Sent",nMn="VAT Number",iMn="Enter Your Billing Address and Credit Card information",rMn="*This is the 3-4 digit number on the back of your card",sMn="*Billing address must match address associated with credit card.",oMn='*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.',aMn="ID Number",lMn="White label",cMn="White Label",uMn="Successfully enabled white label license",dMn="White labeled",hMn="Restore",fMn="Restore Invoice",pMn="Restore Quote",gMn="Restore Client",mMn="Restore Credit",_Mn="Restore Payment",vMn="Successfully restored invoice",bMn="Successfully restored quote",yMn="Successfully restored client",CMn="Successfully restored payment",wMn="Successfully restored credit",xMn="Help us improve our site by telling us why you're leaving.",SMn="Percent",EMn="Amount",kMn="Invoice History",TMn="Quote History",IMn="Current version",LMn="Select version",AMn="View History",NMn="Edit Payment",DMn="Successfully updated payment",RMn="Deleted",PMn="Restore User",OMn="Successfully restored user",MMn="Show deleted users",jMn="Email Templates",FMn="Invoice Email",BMn="Payment Email",$Mn="Quote Email",HMn="Reset All",VMn="Approve",WMn="Token Billing",zMn="Disabled",UMn="Opt-in - checkbox is shown but not selected",qMn="Opt-out - checkbox is shown and selected",KMn="Always",GMn="Store credit card details",YMn="View in :gateway",QMn="Use Card on File",XMn="Edit payment details",ZMn="Save card details",JMn="The data is stored securely by :link",e4n="Support",t4n="Contact Information",n4n="Amount due",i4n="Billing Address",r4n="Billing Method",s4n="Order overview",o4n="*Address must match address associated with credit card.",a4n='*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.',l4n="Invoice Footer",c4n="Save as default footer",u4n="Token Management",d4n="Tokens",h4n="Add Token",f4n="Show deleted tokens",p4n="Successfully deleted token",g4n="Successfully created token",m4n="Successfully updated token",_4n="Edit Token",v4n="Delete Token",b4n="Token",y4n="Add Payment Gateway",C4n="Delete Payment Gateway",w4n="Edit Payment Gateway",x4n="Successfully updated gateway",S4n="Successfully created gateway",E4n="Successfully deleted gateway",k4n="PayPal",T4n="Credit Card",I4n="Change password",L4n="Current password",A4n="New password",N4n="Confirm password",D4n="The current password is incorrect.",R4n="The new password is invalid.",P4n="Successfully updated password",O4n="API Tokens",M4n="Users & Tokens",j4n="Account Login",F4n="Recover your password",B4n="Forgot your password?",$4n="Email address",H4n="Let's go",V4n="Password Recovery",W4n="Send Email",z4n="Set Password",U4n="Converted",q4n="Email me when a quote is <b>approved</b>",K4n="Quote :invoice was approved by :client",G4n="The following client :client approved Quote :invoice for :amount.",Y4n="Resend confirmation email",Q4n="The confirmation email was resent",X4n="Credit Card",Z4n="PayPal",J4n="Bitcoin",e3n="GoCardless",t3n="Knowledge Base",n3n="Partial/Deposit",i3n=":partial of :balance",r3n="More Fields",s3n="Less Fields",o3n="Client Name",a3n="PDF Settings",l3n="Product Settings",c3n="Auto Line Wrap",u3n="Warning: the previous page was submitted twice. The second submission had been ignored.",d3n="View Documentation",h3n="Free Online Invoicing",f3n="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.",p3n="rows",g3n="www",m3n="Logo",_3n="Subdomain",v3n="Please provide a name or email",b3n="Charts & Reports",y3n="Chart",C3n="Report",w3n="Group by",x3n="Paid",S3n="Report",E3n="Chart",k3n="Totals",T3n="Run",I3n="Documentation",L3n="Zapier",A3n="Recurring",N3n="Last invoice sent :date",D3n="Successfully completed update",R3n="Tasks",P3n="New Task",O3n="Start Time",M3n="Successfully created task",j3n="Successfully updated task",F3n="Edit Task",B3n="Clone Task",$3n="Archive Task",H3n="Restore Task",V3n="Delete Task",W3n="Stop Task",z3n="Time",U3n="Start",q3n="Stop",K3n="Now",G3n="Timer",Y3n="Manual",Q3n="Date & Time",X3n="Second",Z3n="Seconds",J3n="Minute",e5n="Minutes",t5n="Hour",n5n="Hours",i5n="Task Details",r5n="Duration",s5n="Time Log",o5n="End Time",a5n="End",l5n="Invoiced",c5n="Logged",u5n="Running",d5n="The tasks can't belong to different clients",h5n="Please stop running tasks first",f5n="Tasks have already been invoiced",p5n="Successfully restored task",g5n="Successfully archived task",m5n="Successfully archived :count tasks",_5n="Successfully deleted task",v5n="Successfully deleted :count tasks",b5n="Create Task",y5n="Successfully stopped task",C5n="Invoice Task",w5n="Invoice Labels",x5n="Prefix",S5n="Counter",E5n="Dwolla",k5n="Must be greater than zero and less than the total",T5n="More Actions",I5n="NINJA PRO",L5n="Upgrade Now!",A5n="Create Unlimited Clients",N5n="Access to 10 Beautiful Invoice Designs",D5n='Custom URLs - "YourBrand.InvoiceNinja.com"',R5n='Remove "Created by Invoice Ninja"',P5n="Multi-user Access & Activity Tracking",O5n="Create Quotes & Pro-forma Invoices",M5n="Customize Invoice Field Titles & Numbering",j5n="Option to attach PDFs to Client Emails",F5n="Resume",B5n="Break",$5n="Edit Details",H5n="Work",V5n="Please :link to set your timezone",W5n="click here",z5n="Email payment receipt to the client",U5n="Successfully created payment and emailed client",q5n="Add Company",K5n="Untitled",G5n="New Company",Y5n="Successfully linked accounts",Q5n="Successfully unlinked accounts",X5n="Login",Z5n="or",J5n="There was a problem sending the email",ejn="Note: emails are sent at the start of the hour.",tjn="Note: invoices are created at the start of the hour.",njn="Unlink Account",ijn="Unlink",rjn="Show Address",sjn="Require client to provide their billing address",ojn="Update Address",ajn="Update client's address with provided details",ljn="Times",cjn="Set to now",ujn="Dark Mode",djn="Use a dark background for the sidebars",hjn="Add to invoice :invoice",fjn="Create new invoice",pjn="Please correct any overlapping times",gjn="From",mjn="To",_jn="Font Size",vjn="Primary Color",bjn="Secondary Color",yjn="Customize Design",Cjn="Content",wjn="Styles",xjn="Defaults",Sjn="Margins",Ejn="Header",kjn="Footer",Tjn="Custom",Ijn="Invoice to",Ljn="Invoice No.",Ajn="Quote No.",Njn="Recent Payments",Djn="Outstanding",Rjn="Manage Companies",Pjn="Total Revenue",Ojn="Current User",Mjn="New Recurring Invoice",jjn="Recurring Invoice",Fjn="New Recurring Quote",Bjn="Recurring Quote",$jn="Created by :invoice",Hjn="Primary User",Vjn="Help",Wjn="playground",zjn="Support Forums",Ujn="Due Date",qjn="Valid Until",Kjn="Valid Until",Gjn="Reset terms",Yjn="Reset footer",Qjn=":count invoice sent",Xjn=":count invoices sent",Zjn="Draft",Jjn="Sent",eFn="Viewed",tFn="Partial",nFn="Paid",iFn="Unpaid",rFn="All",sFn="Display <b>line item taxes inline</b>",oFn="Auto Bill",aFn="24 Hour Time",lFn="Last Sent",cFn="Reminder Emails",uFn="Quote Reminder Emails",dFn="Templates & Reminders",hFn="Subject",fFn="Body",pFn="First Reminder",gFn="Second Reminder",mFn="Third Reminder",_Fn="Days after due date",vFn="Reminder: Invoice :invoice from :account",bFn="Reset",yFn="The requested invoice is not available",CFn="Referral Program",wFn="Referral URL",xFn="Sent Last: :date",SFn="This page will expire soon, :click_here to keep working",EFn="Upcoming Quotes",kFn="Expired Quotes",TFn="Sign up using",IFn="These credentials do not match our records",LFn="Show all options",AFn="User Details",NFn="Connected Account",DFn="Disable",RFn="Invoice and Quote Numbers",PFn="Invoice Surcharges",OFn="We were unable to deliver Invoice :invoice to :contact. <br><br> :error",MFn="Unable to deliver Invoice :invoice",jFn="We were unable to deliver Quote :invoice to :contact. <br><br> :error",FFn="Unable to deliver Quote :invoice",BFn="Custom Invoice Link",$Fn="Total Invoiced",HFn="Open Balance",VFn="Please visit the link in the account confirmation email to verify your email address.",WFn="Basic Settings",zFn="Pro",UFn="Payment Gateways",qFn="Send Next: :date",KFn="This invoice is not scheduled to run",GFn="General Settings",YFn="Customize",QFn="Connect an account to login without a password",XFn="Earn money by sharing our app online",ZFn="Enable | Requires Stripe",JFn="Tax Settings",e6n="Add Tax Rate",t6n="Successfully updated tax rate",n6n="Successfully created tax rate",i6n="Edit tax rate",r6n="Archive Tax Rate",s6n="Successfully archived the tax rate",o6n="Default Tax Rate",a6n="Tax Rate",l6n="Recurring Hour",c6n="Pattern",u6n="Pattern Help",d6n="Create custom numbers by specifying a pattern",h6n="Available variables:",f6n="For example, :example would be converted to :value",p6n="See options",g6n="Invoice Counter",m6n="Quote Counter",_6n="Type",v6n=":user created client :client",b6n=":user archived client :client",y6n=":user deleted client :client",C6n=":user created invoice :invoice",w6n=":user updated invoice :invoice",x6n=":user emailed invoice :invoice for :client to :contact",S6n=":contact viewed invoice :invoice for :client",E6n=":user archived invoice :invoice",k6n=":user deleted invoice :invoice",T6n=":user entered payment :payment for :payment_amount on invoice :invoice for :client",I6n=":user updated payment :payment",L6n=":user archived payment :payment",A6n=":user deleted payment :payment",N6n=":user entered :credit credit",D6n=":user updated :credit credit",R6n=":user archived :credit credit",P6n=":user deleted :credit credit",O6n=":user created quote :quote",M6n=":user updated quote :quote",j6n=":user emailed quote :quote for :client to :contact",F6n=":contact viewed quote :quote",B6n=":user archived quote :quote",$6n=":user deleted quote :quote",H6n=":user restored quote :quote",V6n=":user restored invoice :invoice",W6n=":user restored client :client",z6n=":user restored payment :payment",U6n=":user restored :credit credit",q6n=":contact approved quote :quote for :client",K6n=":user created vendor :vendor",G6n=":user archived vendor :vendor",Y6n=":user deleted vendor :vendor",Q6n=":user restored vendor :vendor",X6n=":user created expense :expense",Z6n=":user archived expense :expense",J6n=":user deleted expense :expense",e8n=":user restored expense :expense",t8n=":user created task :task",n8n=":user updated task :task",i8n=":user archived task :task",r8n=":user deleted task :task",s8n=":user restored task :task",o8n=":user updated expense :expense",a8n=":user created user :user",l8n=":user updated user :user",c8n=":user archived user :user",u8n=":user deleted user :user",d8n=":user restored user :user",h8n=":user marked sent :invoice",f8n=":user paid invoice :invoice",p8n=":contact replied ticket :ticket",g8n=":user viewed ticket :ticket",m8n="Payment",_8n="System",v8n="Email Signature",b8n="Default Messages",y8n="Quote Terms",C8n="Default Quote Terms",w8n="Default Invoice Terms",x8n="Default Invoice Footer",S8n="Quote Footer",E8n="Free",k8n="Successfully approved",T8n="Apply Credit",I8n="System Settings",L8n="Archive Token",A8n="Successfully archived token",N8n="Archive User",D8n="Successfully archived user",R8n="Delete Gateway",P8n="Successfully archived gateway",O8n="Archive Recurring Invoice",M8n="Successfully archived recurring invoice",j8n="Delete Recurring Invoice",F8n="Successfully deleted recurring invoice",B8n="Restore Recurring Invoice",$8n="Successfully restored recurring invoice",H8n="Archive Recurring Quote",V8n="Successfully archived recurring quote",W8n="Delete Recurring Quote",z8n="Successfully deleted recurring quote",U8n="Restore Recurring Quote",q8n="Successfully restored recurring quote",K8n="Archived",G8n="Untitled Company",Y8n="Before",Q8n="After",X8n="Reset to the default account terms",Z8n="Reset to the default account footer",J8n="Export Data",e7n="User",t7n="Country",n7n="Include",i7n="Your logo is :size, for better PDF performance we suggest uploading an image file less than 200KB",r7n="Import From FreshBooks",s7n="Import Data",o7n="Source",a7n="CSV",l7n="Client File",c7n="Invoice File",u7n="Task File",d7n="No valid mapping for file",h7n="Invalid CSV Header",f7n="Client Portal",p7n="Admin",g7n="Disabled",m7n="Show archived users",_7n="Notes",v7n="invoice will be created",b7n="invoices will be created",y7n="The following records failed to import, they either already exist or are missing required fields.",C7n="Publishable Key",w7n="Secret Key",x7n="Set your Stripe publishable key for an improved checkout process",S7n="Email Design",E7n="Due by :date",k7n="Enable Markup",T7n="Make it easier for your clients to pay you by adding schema.org markup to your emails.",I7n="Templates Help",L7n="Available variables:",A7n="Email Style",N7n="Make your emails look more professional with HTML layouts.",D7n="Plain",R7n="Light",P7n="Dark",O7n="Used to provide comparisons against the averages of companies of similar size and industry.",M7n="Set the subdomain or display the invoice on your own website.",j7n="Display the invoice in an iFrame on your own website",F7n="Specify a prefix or use a custom pattern to dynamically set the invoice number.",B7n="Specify a prefix or use a custom pattern to dynamically set the quote number.",$7n="Add a field when creating a client and optionally display the label and value on the PDF.",H7n="Add a label and value to the company details section of the PDF.",V7n="Add a field when creating an invoice and optionally display the label and value on the PDF.",W7n="Add a field when creating an invoice and include the charge in the invoice subtotals.",z7n="Validation token was expired. Please try again.",U7n="Invoice Link",q7n="Confirm your email.",K7n="Confirm",G7n="Email Preferences",Y7n="Successfully created :count invoice(s)",Q7n="The next invoice number is :number.",X7n="The next quote number is :number.",Z7n="days before the",J7n="days after the",eBn="due date",tBn="invoice date",nBn="Schedule",iBn="Email Designs",rBn="Assigned when sent",sBn="Purchase a white label license",oBn="Expense",aBn="Expenses",lBn="Enter Expense",cBn="New Vendor",uBn="Net",dBn="Vendor",hBn="Edit Vendor",fBn="Archive Vendor",pBn="Delete Vendor",gBn="View Vendor",mBn="Successfully deleted expense",_Bn="Successfully archived expense",vBn="Successfully deleted expenses",bBn="Successfully archived expenses",yBn="Expense Amount",CBn="Expense Balance",wBn="Expense Date",xBn="Should this expense be invoiced?",SBn="Public Notes",EBn="Invoice Amount",kBn="Exchange Rate",TBn="Yes",IBn="No",LBn="Should be invoiced",ABn="View expense # :expense",NBn="Edit Expense",DBn="Archive Expense",RBn="Delete Expense",PBn="Expense # :expense",OBn="Successfully updated expense",MBn="Successfully created expense",jBn="Enter Expense",FBn="View",BBn="Restore Expense",$Bn="Invoice Expense",HBn="The expenses can't belong to different clients",VBn="Expense has already been invoiced",WBn="Convert currency",zBn="Number of Days",UBn="Create Payment Term",qBn="Edit Payment Term",KBn="Edit Payment Term",GBn="Archive Payment Term",YBn="Recurring Invoice Due Dates",QBn=`<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>`,XBn="Due",ZBn="Due Next: :date",JBn="Use client terms",e9n=":ordinal day of month",t9n="Last day of month",n9n=":ordinal :day after",i9n="Sunday",r9n="Monday",s9n="Tuesday",o9n="Wednesday",a9n="Thursday",l9n="Friday",c9n="Saturday",u9n="Header Font",d9n="Body Font",h9n="Note: the primary color and fonts are also used in the client portal and custom email designs.",f9n="Live Preview",p9n="Unable to send email, please check that the mail settings are correct.",g9n="To view your invoice for :amount, click the button below.",m9n="To view your quote for :amount, click the button below.",_9n="Thank you for your payment of :amount.",v9n="Direct Debit",b9n="Credit Cards & Banks",y9n="Add Bank Account",C9n="Setup Account",w9n="Import Expenses",x9n="Bank",S9n="Integration Type",E9n="Successfully updated bank account",k9n="Edit Bank Account",T9n="Archive Bank Account",I9n="Successfully archived bank account",L9n="Successfully created bank account",A9n="Validate Bank Account",N9n="Note: your password is transmitted securely and never stored on our servers.",D9n="Warning: your password may be transmitted in plain text, consider enabling HTTPS.",R9n="Username",P9n="Account Number",O9n="Account Name",M9n="Failed to retrieve account details, please check your credentials.",j9n="Approved",F9n="Quote Settings",B9n="Auto Convert",$9n="Automatically convert a quote to an invoice when approved.",H9n="Validate",V9n="Info",W9n="Successfully created :count_vendors vendor(s) and :count_expenses expense(s)",z9n="Note: if you plan on accepting credit cards details we strongly recommend enabling HTTPS on your site.",U9n="The expenses can't have different currencies.",q9n="The client's currency does not match the expense currency.",K9n="Trello Roadmap",G9n="Header/Footer",Y9n="First page",Q9n="All pages",X9n="Last page",Z9n="Show Header on",J9n="Show Footer on",e$n="Invoice Currency",t$n="We strongly recommend using HTTPS to accept credit card details online.",n$n="Quote issued to",i$n="Currency Code",r$n="Your account has been upgraded to the pro plan for one year at no cost.",s$n="Your account will receive a free two week trial of our pro plan.",o$n="Your free pro plan trial lasts :count more days, :link to upgrade now.",a$n="This is the last day of your free pro plan trial, :link to upgrade now.",l$n="Start Free Trial",c$n="Successfully enabled two week free pro plan trial",u$n="Overdue",d$n="Purchase a ONE YEAR white label license for $:price to remove the Invoice Ninja branding from the invoice and client portal.",h$n="To adjust your email notification settings please visit :link",f$n="If you did not request this password reset please email our support: :email",p$n="Sorry, this will exceed the limit of :limit users",g$n="Get 6 more invoice designs for just $:price",m$n="Please use a :link",_$n="newer browser",v$n=":link for $:price to enable custom styling and help support our project.",b$n=":link to remove the Invoice Ninja logo by joining the Pro Plan",y$n="Click here",C$n="Sent",w$n="Opened",x$n="Viewed",S$n="Emails can not be sent to inactive clients",E$n="Emails can not be sent to inactive contacts",k$n="Emails can not be sent to inactive invoices",T$n="Emails can not be sent to inactive proposals",I$n="Please register your account to send emails",L$n="Please confirm your account to send emails",A$n="Invalid contact email",N$n="Navigation",D$n="List Invoices",R$n="List Clients",P$n="List Quotes",O$n="List Tasks",M$n="List Expenses",j$n="List Recurring Invoices",F$n="List Payments",B$n="List Credits",$$n="Tax Name",H$n="Report Settings",V$n="New User",W$n="New Product",z$n="New Tax Rate",U$n="Invoiced Amount",q$n="Invoice Item Fields",K$n="Add a field when creating an invoice item and display the label and value on the PDF.",G$n="Recurring Number",Y$n="Specify a prefix to be added to the invoice number for recurring invoices.",Q$n="Password Protect Invoices",X$n="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.",Z$n="Generate Automatically",J$n="If no password is set, one will be generated and sent with the first invoice.",eHn="Expired",tHn="The credit card number is not valid.",nHn="The expiration date is not valid.",iHn="The CVV is not valid.",rHn="Cost",sHn="Note: create your first invoice to see a preview here.",oHn="Owner",aHn="Administrator",lHn="Allow user to manage users, change settings and modify all records",cHn="Create clients, invoices, etc.",uHn="View all clients, invoices, etc.",dHn="Edit all clients, invoices, etc.",hHn="Partial Due",fHn="Restore Vendor",pHn="Successfully restored vendor",gHn="Successfully restored expense",mHn="Permissions",_Hn="Allow user to create and modify records",vHn="Allow user to view records they didn't create",bHn="Allow user to modify records they didn't create",yHn="View Payment",CHn="January",wHn="February",xHn="March",SHn="April",EHn="May",kHn="June",THn="July",IHn="August",LHn="September",AHn="October",NHn="November",DHn="December",RHn="Documents:",PHn="Documents:",OHn="Widgets Receipt.pdf",MHn="Final Deliverable.zip",jHn="Quote Documents",FHn="Invoice Documents",BHn="Expense Documents",$Hn="Embed Images/Documents",HHn="Include attached images/pdfs in the invoice.",VHn="Attach Documents",WHn="Attach UBL",zHn="Download Documents (:size)",UHn="From Expenses:",qHn="Drop files or click to upload",KHn="Uploads disabled",GHn="Your browser does not support drag'n'drop file uploads.",YHn="Please use the fallback form below to upload your files like in the olden days.",QHn="File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",XHn="You can't upload files of this type.",ZHn="Server responded with {{statusCode}} code.",JHn="Cancel upload",eVn="Are you sure you want to cancel this upload?",tVn="Remove file",nVn="Documents",iVn="Document Date",rVn="Size",sVn="Client Portal",oVn="Show/hide the client portal.",aVn="Dashboard",lVn="Show/hide the dashboard page in the client portal.",cVn="Account Management",uVn="Plan Status",dVn="Upgrade",hVn="Manage Plan",fVn="Changes To",pVn=":plan on :date",gVn=":plan (:term) on :date",mVn="Cancel Change",_Vn="Plan",vVn="Expires",bVn="Renews",yVn=":plan Plan Expired",CVn=":plan Plan Trial Ended",wVn="Never",xVn="Free",SVn="Pro",EVn="Enterprise",kVn="Self Hosted (White labeled)",TVn="Self Hosted (Free)",IVn="Trial",LVn="Term",AVn="Monthly",NVn="Yearly",DVn="Month",RVn="Year",PVn="$:price/Month",OVn="$:price/Year",MVn="Updated plan settings",jVn="Term Started",FVn="Plan Started",BVn="Plan Expires",$Vn="Purchase White Label",HVn="One year enrollment in the Invoice Ninja Pro Plan.",VVn="One month enrollment in the Invoice Ninja Pro Plan.",WVn="Enterprise Plan",zVn="One year enrollment in the Invoice Ninja Enterprise Plan.",UVn="One month enrollment in the Invoice Ninja Enterprise Plan.",qVn="Credit",KVn="Credit for unused time",GVn="Will switch to monthly on :date",YVn="A refund has been issued.",QVn="Page Size",XVn="Live preview has been disabled to support selected font",ZVn="Padding",JVn="Preview",eWn="List Vendors",tWn="Upgrade to the Enterprise Plan to add additional users to your account.",nWn="The Enterprise Plan adds support for multiple users and file attachments, :link to see the full list of features.",iWn="Return To App",rWn="Refund Payment",sWn="Max:",oWn="Refund",aWn="Refund selected payments?",lWn="Pending",cWn="Completed",uWn="Failed",dWn="Partially Refunded",hWn=":amount Refunded",fWn="Refunded",pWn="Cancelled",gWn="Refunded Payment",mWn=":user cancelled a :payment_amount payment :payment",_Wn=":user refunded :adjustment of a :payment_amount payment :payment",vWn="Exp: :expires",bWn="Unknown",yWn="American Express",CWn="Carte Blanche",wWn="UnionPay",xWn="Diners Club",SWn="Discover",EWn="JCB",kWn="Laser",TWn="Maestro",IWn="MasterCard",LWn="Solo",AWn="Switch",NWn="Visa",DWn="ACH",RWn="Stripe",PWn="ACH",OWn="Accept US bank transfers",MWn="ACH support must also be enabled in :link.",jWn="Another gateway is already configured for direct debit.",FWn="Plaid",BWn="Client Id",$Wn="Secret",HWn="Public Key",VWn="(optional)",WWn="When a Stripe test key is given, Plaid's development environment (tartan) will be used.",zWn="Other Providers",UWn="That country is not supported.",qWn="The routing number is not valid.",KWn="The account number is not valid.",GWn="The account numbers do not match.",YWn="Please select an individual or company account.",QWn="Please enter the account holder's name.",XWn="Routing Number",ZWn="Confirm Account Number",JWn="Individual Account",ezn="Company Account",tzn="Account Holder Name",nzn="Add Account",izn="Payment Methods",rzn="Complete Verification",szn="Amount 1",ozn="Amount 2",azn="Verification completed successfully",lzn="Verification Failed",czn="Remove Payment Method",uzn="Are you sure you want to remove this payment method?",dzn="Remove",hzn="Removed payment method.",fzn='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.',pzn=`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.`,gzn="Unknown Bank",mzn="You will be able to use the account after completing verification. Verification usually takes 1-2 business days.",_zn="Add Credit Card",vzn="Added payment method.",bzn="Use For Autobill",yzn="Autobill Payment Method",Czn="Set Autobill payment method.",wzn=":payment_amount payment (:payment) failed",xzn="Webhook URL",Szn="You must :link.",Ezn="add this URL as an endpoint at Stripe",kzn="add this URL as an endpoint in GoCardless",Tzn="There was an error adding your payment methd. Please try again later.",Izn="Payment failed for Invoice :invoice",Lzn="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.",Azn="Link Account Instantly with Plaid",Nzn="Link Manually",Dzn="Secured by Plaid",Rzn="Your bank account at :bank",Pzn="Add Payment Method",Ozn="Account Holder Type",Mzn="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.",jzn="You must consent to ACH transactions.",Fzn="Off",Bzn="Opt-in",$zn="Opt-out",Hzn="Always",Vzn="Opted out",Wzn="Opted in",zzn="Manage Auto-bill",Uzn="Enabled",qzn="PayPal",Kzn="Enable PayPal payments through BrainTree",Gzn="The PayPal gateway is processing PayPal payments",Yzn="You must also :link.",Qzn="link PayPal to your BrainTree account",Xzn="Save payment details",Zzn="Add PayPal Account",Jzn="No payment method specified",eUn="Chart Type",tUn="Format",nUn="Import OFX",iUn="OFX File",rUn="Failed to parse OFX file",sUn="WePay",oUn="Sign up with WePay",aUn="Use another provider",lUn="Company Name",cUn="This will appear on client's credit card statements.",uUn="The purpose of this account.",dUn="I agree to the :link.",hUn="WePay Terms of Service",fUn="Resend Confirmation Email",pUn="Manage Account",gUn="Action Required",mUn="Finish Setup",_Un="Please check your email and confirm your email address with WePay.",vUn="Switch to WePay",bUn="Restore Gateway",yUn="Successfully restored gateway",CUn="United States",wUn="Canada",xUn="Accept Debit Cards",SUn="Debit Cards",EUn="The next invoice will be sent on the new start date.",kUn="The next invoice will be created on the new start date.",TUn="Original start date",IUn="New start date",LUn="Security",AUn="See what's new in v:version",NUn="Please wait for the document upload to complete.",DUn="Upgrade to our Enterprise Plan to enable permissions.",RUn="Enable specifying a <b>second tax rate</b>",PUn="Payment File",OUn="Expense File",MUn="Product File",jUn="Import Products",FUn="products will be created",BUn="Product",$Un="Successfully created/updated :count product(s)",HUn="Use JSON if you plan to import the data into Invoice Ninja.<br/>The file includes clients, products, invoices, quotes and payments.",VUn="<br/>We recommend using mysqldump to create a full backup.",WUn="JSON File",zUn="View Dashboard",UUn="Session Expired",qUn="Your session has expired. Please click the link in your email again.",KUn="This invoice will automatically be billed to your :payment_method on file on :due_date.",GUn="bank account",YUn="credit card",QUn="PayPal account",XUn="This invoice will automatically be billed to your credit card on file on the due date.",ZUn="Payment Settings",JUn="On send date",eqn="On due date",tqn="ACH will always auto bill on the due date.",nqn="Due to NACHA rules, changes to this invoice may prevent ACH auto bill.",iqn="Bank Account",rqn="ACH payments will be processed using WePay.",sqn="Privacy Policy",oqn="Please enter your email address:",aqn="Verification Pending",lqn="Please force refresh the page to update the font cache.",cqn="More options",uqn="Credit Card",dqn="Bank Transfer",hqn="We did not receive a payment transaction reference from the gateway.",fqn="Use Bank on File",pqn="This invoice will automatically be billed to the payment method on file on the due date.",gqn="Bitcoin",mqn="GoCardless",_qn="Added :date",vqn="Failed to remove the payment method",bqn="This gateway already exists",yqn="Manual entry",Cqn="First Day of the Week",wqn="Inactive",xqn="Daily",Sqn="Weekly",Eqn="Biweekly",kqn="Two weeks",Tqn="Four weeks",Iqn="Monthly",Lqn="Three months",Aqn="Four months",Nqn="Six months",Dqn="Annually",Rqn="Two years",Pqn="Cash",Oqn="Debit",Mqn="ACH",jqn="MasterCard",Fqn="EuroCard",Bqn="Nova",$qn="PayPal",Hqn="Check",Vqn="UnionPay",Wqn="JCB",zqn="Laser",Uqn="Maestro",qqn="Solo",Kqn="Switch",Gqn="iZettle",Yqn="Swish",Qqn="Alipay",Xqn="Sofort",Zqn="SEPA Direct Debit",Jqn="Bitcoin",eKn="GoCardless",tKn="Zelle",nKn="Afghanistan",iKn="Albania",rKn="Antarctica",sKn="Algeria",oKn="Andorra",aKn="Angola",lKn="Azerbaijan",cKn="Argentina",uKn="Australia",dKn="Austria",hKn="Bahamas",fKn="Bahrain",pKn="Bangladesh",gKn="Armenia",mKn="Barbados",_Kn="Belgium",vKn="Bermuda",bKn="Bhutan",yKn="Botswana",CKn="Brazil",wKn="Belize",xKn="Bulgaria",SKn="Myanmar",EKn="Burundi",kKn="Belarus",TKn="Cambodia",IKn="Cameroon",LKn="Canada",AKn="Chad",NKn="Chile",DKn="China",RKn="Colombia",PKn="Comoros",OKn="Mayotte",MKn="Congo",jKn="Croatia",FKn="Cuba",BKn="Cyprus",$Kn="Benin",HKn="Denmark",VKn="Dominica",WKn="Ecuador",zKn="Ethiopia",UKn="Eritrea",qKn="Estonia",KKn="Fiji",GKn="Finland",YKn="France",QKn="Djibouti",XKn="Gabon",ZKn="Georgia",JKn="Gambia",eGn="Germany",tGn="Ghana",nGn="Gibraltar",iGn="Kiribati",rGn="Greece",sGn="Greenland",oGn="Grenada",aGn="Guadeloupe",lGn="Guam",cGn="Guatemala",uGn="Guinea",dGn="Guyana",hGn="Haiti",fGn="Honduras",pGn="Hungary",gGn="Iceland",mGn="India",_Gn="Indonesia",vGn="Iraq",bGn="Ireland",yGn="Israel",CGn="Italy",wGn="Jamaica",xGn="Japan",SGn="Kazakhstan",EGn="Jordan",kGn="Kenya",TGn="Kuwait",IGn="Kyrgyzstan",LGn="Lebanon",AGn="Lesotho",NGn="Latvia",DGn="Liberia",RGn="Libya",PGn="Liechtenstein",OGn="Lithuania",MGn="Luxembourg",jGn="Macao",FGn="Madagascar",BGn="Malawi",$Gn="Malaysia",HGn="Maldives",VGn="Mali",WGn="Malta",zGn="Martinique",UGn="Mauritania",qGn="Mauritius",KGn="Mexico",GGn="Monaco",YGn="Mongolia",QGn="Montenegro",XGn="Montserrat",ZGn="Morocco",JGn="Mozambique",eYn="Oman",tYn="Namibia",nYn="Nauru",iYn="Nepal",rYn="Netherlands",sYn="Aruba",oYn="Vanuatu",aYn="Nicaragua",lYn="Niger",cYn="Nigeria",uYn="Niue",dYn="Norway",hYn="Palau",fYn="Pakistan",pYn="Panama",gYn="Paraguay",mYn="Peru",_Yn="Philippines",vYn="Pitcairn",bYn="Poland",yYn="Portugal",CYn="Qatar",wYn="Romania",xYn="Rwanda",SYn="Anguilla",EYn="Senegal",kYn="Serbia",TYn="Seychelles",IYn="Singapore",LYn="Slovakia",AYn="Slovenia",NYn="Somalia",DYn="Zimbabwe",RYn="Spain",PYn="Sudan",OYn="Suriname",MYn="Swaziland",jYn="Sweden",FYn="Switzerland",BYn="Tajikistan",$Yn="Thailand",HYn="Togo",VYn="Tokelau",WYn="Tonga",zYn="Tunisia",UYn="Turkey",qYn="Turkmenistan",KYn="Tuvalu",GYn="Uganda",YYn="Ukraine",QYn="Egypt",XYn="Guernsey",ZYn="Jersey",JYn="Uruguay",eQn="Uzbekistan",tQn="Samoa",nQn="Yemen",iQn="Zambia",rQn="Croatian",sQn="Czech",oQn="Danish",aQn="Dutch",lQn="English",cQn="French",uQn="German",dQn="Italian",hQn="Japanese",fQn="Lithuanian",pQn="Norwegian",gQn="Polish",mQn="Spanish",_Qn="Swedish",vQn="Albanian",bQn="Greek",yQn="Slovenian",CQn="Finnish",wQn="Romanian",xQn="Thai",SQn="Macedonian",EQn="Serbian",kQn="Bulgarian",TQn="Advertising",IQn="Aerospace",LQn="Agriculture",AQn="Automotive",NQn="Biotechnology",DQn="Broadcasting",RQn="Communications",PQn="Defense",OQn="Energy",MQn="Entertainment",jQn="Government",FQn="Insurance",BQn="Manufacturing",$Qn="Marketing",HQn="Media",VQn="Pharmaceuticals",WQn="Sports",zQn="Transportation",UQn="Other",qQn="Photography",KQn="View client portal",GQn="View Portal",YQn="Vendor Contacts",QQn="All",XQn="Selected",ZQn="Category",JQn="Categories",eXn="New Expense Category",tXn="Edit Category",nXn="Archive Category",iXn="Expense Categories",rXn="List Expense Categories",sXn="Successfully updated expense category",oXn="Successfully created expense category",aXn="Successfully archived expense category",lXn="Successfully archived :count expense category",cXn="Restore expense category",uXn="Successfully restored expense category",dXn="Apply taxes",hXn=":min to :max users",fXn="The maximum number of users has been reached.",pXn="Buy Now Buttons",gXn="Landing Page",mXn="Payment Type",_Xn="Form",vXn="Link",bXn="Fields",yXn="Dwolla",CXn="Note: the client and invoice are created even if the transaction isn't completed.",wXn="This feature requires that a product is created and a payment gateway is configured.",xXn="Enable support for buy now buttons",SXn="Note: changes take effect immediately",EXn="Payment gateway for Invoice Ninja",kXn="There was an error processing your payment [:code]. Please try again later.",TXn="Fee: 2.9%/1.2% [Credit Card/Bank Transfer] + $0.30 per successful charge.",IXn="Data needs to be imported in batches of :count rows or less",LXn="Something went wrong",AXn="If you'd like help please email us at :mailaddress",NXn="Warning: this can't be undone.",DXn="Please select a contact",RXn="Please select a client",PXn="It may help to set new passwords or generate new API keys.",OXn=":type on file",MXn="Invoice :invoice for :client",jXn="Sorry, I'm not sure what you're asking.",FXn="Sorry, I'm not able to do that.",BXn="I wasn't able to find the client",$Xn="Sorry, you don't have the needed permissions",HXn="Your invoice has been sent.",VXn="I'll email you when it's viewed.",WXn="I'll email you when it's paid.",zXn="Add 1 :product",UXn="You are not authorized",qXn="I wasn't able to find an available account for :email",KXn="The code is not correct",GXn="List Products",YXn="Include <b>line item taxes in line total</b>",QXn="Successfully created :count quotes(s)",XXn="Warning",ZXn="Update Invoice Ninja",JXn="Before start upgrading Invoice Ninja create a backup of your database and files!",eZn="A new version of Invoice Ninja is available.",tZn="No new version of Invoice Ninja available.",nZn="Update now",iZn="Download :version",rZn="Create New",sZn="Toggle Navigation",oZn="Toggle History",aZn="Unassigned",lZn="Task",cZn="Contact Name",uZn="City/State/Postal",dZn="Postal/City",hZn="Custom Field",fZn="Company Fields",pZn="Facebook and Twitter",gZn="Follow our feeds to help support our project",mZn="Note: the white-label license is intended for personal use, please email us at :email if you'd like to resell the app.",_Zn="Unnamed Client",vZn="Day",bZn="Week",yZn="Month",CZn="You have been logged out due to inactivity",wZn="Reports",xZn="Total Profit",SZn="Total Expenses",EZn="Quote to",kZn="Limit",TZn="Min: :min",IZn="Max: :max",LZn="No Limits",AZn="Set :gateway_type Limits",NZn="Enable min",DZn="Enable max",RZn="Min",PZn="Max",OZn="This invoice does not meet the limits for that payment type.",MZn="Date Range",jZn="Raw",FZn="Raw HTML",BZn="Update",$Zn="Drag and drop fields to change their order and location",HZn="New Category",VZn="Restore Product",WZn="Blank",zZn="There was an error saving your invoice",UZn="Enable Recurring",qZn="Disable Recurring",KZn="Text",GZn="expense will be created",YZn="expenses will be created",QZn="Successfully created :count expense(s)",XZn="Help improve our translations with :link",ZZn="Expense Category",JZn="Go Ninja Pro!",eJn="Go Enterprise!",tJn="Upgrade For More Features",nJn="Pay annually for 10 months + 2 free!",iJn="Ninja Pro",rJn="YourBrand.invoicing.co",sJn="Customize every aspect of your invoice!",oJn="Set permissions for multiple-users",aJn="Attach 3rd party files to invoices & expenses",lJn="Much More!",cJn="Plus all pro features!",uJn="Symbol",dJn="Code",hJn="Buy License",fJn="Apply License",pJn="Submit",gJn="License Key",mJn="The white label license is not valid",_Jn="Created by :name",vJn="Modules",bJn="First Month of the Year",yJn="Authentication",CJn="Checkbox",wJn="Signature",xJn="Invoice Terms Checkbox",SJn="Require client to confirm that they accept the invoice terms.",EJn="Quote Terms Checkbox",kJn="Require client to confirm that they accept the quote terms.",TJn="Invoice Signature",IJn="Require client to provide their signature.",LJn="Quote Signature",AJn="Require client to provide their signature.",NJn="I Agree To The Terms",DJn="Please sign here:",RJn="Use the mouse or your touchpad to trace your signature.",PJn="Authorization",OJn="Signed",MJn="Vendor",jJn="State",FJn="Date Created",BJn="There was a problem sending the email through Postmark: :link",$Jn="Project",HJn="Projects",VJn="New Project",WJn="Edit Project",zJn="Archive Project",UJn="List Projects",qJn="Successfully updated project",KJn="Successfully created project",GJn="Successfully archived project",YJn="Successfully archived :count projects",QJn="Restore Project",XJn="Successfully restored project",ZJn="Delete Project",JJn="Successfully deleted project",eei="Successfully deleted :count projects",tei="Delete category",nei="Successfully deleted category",iei="Delete Product",rei="Successfully deleted product",sei="Successfully deleted :count products",oei="Successfully restored product",aei="Update Credit",lei="Successfully updated credit",cei="Edit Credit",uei="Realtime Preview",dei="Realtime refresh PDF preview on the invoice page when editing invoice.<br/>Disable this to improve performance when editing invoices.",hei="Display a live PDF preview on the invoice page.",fei="Replace the built-in PDF viewer in :chrome_link and :firefox_link.<br/>Enable this if your browser is automatically downloading the PDF.",pei="Prevent Download",gei="Redirect URL",mei="Optionally specify a URL to redirect to after a payment is entered.",_ei="Save Draft",vei="Refunded credit payment",bei="Keyboard Shortcuts",yei="Toggle Menu",Cei="Date Created",wei="Contact Us",xei="User Guide",Sei="Upgrade before :expires and get :amount OFF your first year of our Pro or Enterprise packages.",Eei=":amount off expires :expires",kei="Mark Paid",Tei="Successfully marked invoice sent",Iei="Successfully marked invoices sent",Lei="Invoice",Aei="product will be created",Nei="Thank you for your message! We'll try to respond as soon as possible.",Dei="Last 7 Days",Rei="Last 30 Days",Pei="This Month",Oei="Last Month",Mei="Current Quarter",jei="Last Quarter",Fei="Last Year",Bei="All Time",$ei="Custom Range",Hei="URL",Vei="Debug",Wei="HTTPS",zei="Require",Uei="Note: Your license will expire in :count days, :link to renew it.",qei="Your email address has been confirmed.",Kei="Your white label license has expired, please consider renewing it to help support our project.",Gei="Renew License",Yei="Consider downloading our :link",Qei="iPhone app",Xei="Android app",Zei="Logged In",Jei="Switch to your primary company (:name) to manage your plan.",eti="Inclusive",tti="Exclusive",nti="Postal/City/State",iti="In certain cases the app uses :link_phantom to generate the PDF, install :link_docs to generate it locally.",rti="Using local PhantomJS",sti="Client Number",oti="Specify a prefix or use a custom pattern to dynamically set the client number.",ati="The next client number is :number.",lti="Generated Numbers",cti="First Reminder",uti="Second Reminder",dti="Third Reminder",hti="Reminder",fti="BCC Email",pti="Tax Quote",gti="Tax Invoice",mti="Successfully emailed invoices",_ti="Successfully emailed quotes",vti="Website URL",bti="Domain",yti="Used in the client portal and when sending emails.",Cti="Used when sending emails.",wti="Import Invoices",xti="New Report",Sti="Edit Report",Eti="Columns",kti="Filters",Tti="Sort By",Iti="Draft",Lti="Unpaid",Ati="Aging",Nti="Age",Dti="Days",Rti="0 - 30 Days",Pti="30 - 60 Days",Oti="60 - 90 Days",Mti="90 - 120 Days",jti="120+ Days",Fti="Invoice Details",Bti="Quantity",$ti="Profit and Loss",Hti="Revenue",Vti="Profit",Wti="Group Sort",zti="Group Dates By",Uti="Year",qti="View Statement",Kti="Statement",Gti="Statement Date",Yti="Mark Active",Qti="Send Automatically",Xti="Initial Email",Zti="This invoice hasn't been emailed.",Jti="This quote hasn't been emailed.",eni="Sent by :user",tni="Recipients",nni="Save as default",ini="Used by <b>date</b> selectors",rni="Used by <b>date range</b> selectors",sni="Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.",oni="This Year",ani="Create. Send. Get Paid.",lni="Or login with a connected account.",cni="Sign Up Now",uni="Not a member yet?",dni="Create an Account!",hni="Invoices From:",fni="Full Name",pni="MONTH/YEAR",gni="Valid\\nthru",mni="Product Fields",_ni="Add a field when creating a product or invoice and display the label and value on the PDF.",vni="Two months",bni="Annually",yni="Profile",Cni="Construction",wni="Your Statement",xni="Statement issued to",Sni="Statement to",Eni="Customize options",kni="Successfully created payment term",Tni="Successfully updated payment term",Ini="Successfully archived payment term",Lni="Resend Invitation",Ani="Credit created by payment :transaction_reference",Nni="Successfully created payment and credit",Dni="Successfully created payment and credit, and emailed client",Rni="Create project",Pni="Create vendor",Oni="Create category",Mni=":link to enable reports by joining the Pro Plan",jni="Mark Ready",Fni="Limits",Bni="Fees",$ni="Fee",Hni="Set :gateway_type Limits/Fees",Vni="Enable line item taxes to set the fee tax rates.",Wni="The fee for a :amount invoice would be :total.",zni="The discount for a :amount invoice would be :total.",Uni="No Fees",qni="Warning: not all states/payment gateways allow adding fees, please review local laws/terms of service.",Kni="Percent",Gni="Location",Yni="Line Item",Qni="Surcharge",Xni="Enabled - First surcharge",Zni="Enabled - Second surcharge",Jni="Enabled - Line item",eii="Online Payment Surcharge",tii="Gateway Fees",nii="Fees are disabled",iii="Automatically add an online payment surcharge/discount.",rii="Gateway",sii="If there are unpaid invoices with fees they need to be updated manually.",oii="Customize surcharge :link.",aii="label and taxes",lii="Billable",cii="The image file is too large.",uii="Warning: To support gifs the fileinfo PHP extension needs to be enabled.",dii="There was a problem reading the image file, please try a different format.",hii="An error occurred, please refresh the page and try again.",fii="Data",pii="Successfully imported settings",gii="Reset Counter",mii="Next Reset",_ii="Automatically reset the invoice and quote counters.",vii="Auto-billing for invoice :invoice_number failed",bii="Online Payment Discount",yii="Successfully created new company",Cii="Fees are disabled for this gateway.",wii="Log Out/Delete Account",xii="Inclusive tax rates adjust the line item cost when selected.<br/>Only exclusive tax rates can be used as a default.",Sii="Credit Note",Eii="Credit issued to",kii="Credit to",Tii="Your Credit",Iii="Credit Number",Lii="Create Credit Note",Aii="Menu",Nii="Error: The gateways table has incorrect ids.",Dii="Purge Data",Rii="Delete Data",Pii="Permanently delete all data but keep the account and settings.",Oii="Permanently delete the account along with all data and setting.",Mii="Successfully purged company data",jii="Forbidden",Fii="Warning: This will permanently erase your data, there is no undo.",Bii="Contact Phone",$ii="Contact Email",Hii="Reply-To Email",Vii="Specify the reply-to address for client emails.",Wii="Privately include this address with client emails.",zii="Your import has successfully completed.",Uii="Please confirm your account to import data.",qii="Your import has started, we'll send you an email once it completes.",Kii="Venmo",Gii="Successfully archived :count products",Yii="We recommend <b>enabling</b> this setting.",Qii="We recommend <b>disabling</b> this setting.",Xii="Auto-billed",Zii="Surcharge Label",Jii="Contact Fields",eri="Add a field when creating a contact and optionally display the label and value on the PDF.",tri="Showing :start to :end of :total entries",nri="Credit Total",iri="Mark billable",rri="Billed",sri="Company Variables",ori="Client Variables",ari="Invoice Variables",lri="Navigation Variables",cri="Custom Variables",uri="Invalid file type",dri="Add Documents to Invoice",hri="Mark paid",fri="Failed to validate the license, either expired or excessive activations. Email contact@invoiceninja.com for more information.",pri="Plan Price",gri="Incorrect confirmation code",mri="The account is already registered",_ri="Successfully emailed payment",vri="Email Payment",bri="Use :link to migrate your data from InvoicePlane.",yri="Warning: This :link may be a duplicate",Cri="expense",wri="Resume Task",xri="Successfully resumed task",Sri="Quote Design",Eri="Standard Design",kri="Custom Design 1",Tri="Custom Design 2",Iri="Custom Design 3",Lri="Empty",Ari="Load Design",Nri="Accepted Card Logos",Dri="Google Analytics",Rri="Analytics Key",Pri="Track payments using :link",Ori="The start date is required",Mri="Application Settings",jri="Database Connection",Fri="Driver",Bri="Host",$ri="Database",Hri="Test connection",Vri="From Name",Wri="From Address",zri="Port",Uri="Encryption",qri="Mailgun Domain",Kri="Mailgun Private Key",Gri="Brevo Domain",Yri="Brevo Private Key",Qri="Send Test Email",Xri="Select Label",Zri="Label",Jri="Service",esi="Update payment details",tsi="Successfully updated payment details",nsi="Update Credit Card",isi="Recurring Expenses",rsi="Recurring Expense",ssi="New Recurring Expense",osi="Edit Recurring Expense",asi="Archive Recurring Expense",lsi="List Recurring Expenses",csi="Successfully updated recurring expense",usi="Successfully created recurring expense",dsi="Successfully archived recurring expense",hsi="Restore Recurring Expense",fsi="Successfully restored recurring expense",psi="Delete Recurring Expense",gsi="Successfully deleted recurring expense",msi="View Recurring Expense",_si="Taxes and fees",vsi="Import Failed",bsi="Recurring Prefix",ysi="Options",Csi="Specify a prefix or use a custom pattern to dynamically set the credit number for negative invoices.",wsi="The next credit number is :number.",xsi="The number of zero's to pad the number.",Ssi="Warning: The date format appears to be invalid.",Esi="Product Notes",ksi="App Version",Tsi="OFX Version",Isi="Charge Late Fee",Lsi="Late Fee Amount",Asi="Late Fee Percent",Nsi="Late fee added on :date",Dsi="Download Invoice",Rsi="Download Quote",Psi="Your invoice PDFs are attached.",Osi="An email will be sent with the invoice PDF",Msi="An email will be sent with the quote PDF",jsi="An email will be sent with the invoice PDFs",Fsi="An email will be sent with the quote PDFs",Bsi="Clone Expense",$si="Default Documents",Hsi="Send email to the client",Vsi="Refund Processed",Wsi="You have been processed a refund of :amount for invoice :invoice_number.",zsi="US Dollar",Usi="British Pound",qsi="Euro",Ksi="South African Rand",Gsi="Danish Krone",Ysi="Israeli Shekel",Qsi="Swedish Krona",Xsi="Kenyan Shilling",Zsi="Canadian Dollar",Jsi="Philippine Peso",eoi="Indian Rupee",toi="Australian Dollar",noi="Singapore Dollar",ioi="Norske Kroner",roi="New Zealand Dollar",soi="Vietnamese Dong",ooi="Swiss Franc",aoi="Guatemalan Quetzal",loi="Malaysian Ringgit",coi="Brazilian Real",uoi="Thai Baht",doi="Nigerian Naira",hoi="Argentine Peso",foi="Bangladeshi Taka",poi="United Arab Emirates Dirham",goi="Hong Kong Dollar",moi="Indonesian Rupiah",_oi="Mexican Peso",voi="Egyptian Pound",boi="Colombian Peso",yoi="West African Franc",Coi="Chinese Renminbi",woi="Rwandan Franc",xoi="Tanzanian Shilling",Soi="Netherlands Antillean Guilder",Eoi="Trinidad and Tobago Dollar",koi="East Caribbean Dollar",Toi="Ghanaian Cedi",Ioi="Bulgarian Lev",Loi="Aruban Florin",Aoi="Turkish Lira",Noi="Romanian New Leu",Doi="Croatian Kuna",Roi="Saudi Riyal",Poi="Japanese Yen",Ooi="Maldivian Rufiyaa",Moi="Costa Rican Colón",joi="Pakistani Rupee",Foi="Polish Zloty",Boi="Sri Lankan Rupee",$oi="Czech Koruna",Hoi="Uruguayan Peso",Voi="Namibian Dollar",Woi="Tunisian Dinar",zoi="Russian Ruble",Uoi="Mozambican Metical",qoi="Omani Rial",Koi="Ukrainian Hryvnia",Goi="Macanese Pataca",Yoi="Taiwan New Dollar",Qoi="Dominican Peso",Xoi="Chilean Peso",Zoi="Icelandic Króna",Joi="Papua New Guinean Kina",eai="Jordanian Dinar",tai="Myanmar Kyat",nai="Peruvian Sol",iai="Botswana Pula",rai="Hungarian Forint",sai="Ugandan Shilling",oai="Barbadian Dollar",aai="Brunei Dollar",lai="Georgian Lari",cai="Qatari Riyal",uai="Honduran Lempira",dai="Surinamese Dollar",hai="Bahraini Dinar",fai="Venezuelan Bolivars",pai="South Korean Won",gai="Moroccan Dirham",mai="Jamaican Dollar",_ai="Angolan Kwanza",vai="Haitian Gourde",bai="Zambian Kwacha",yai="Nepalese Rupee",Cai="CFP Franc",wai="Mauritian Rupee",xai="Cape Verdean Escudo",Sai="Kuwaiti Dinar",Eai="Algerian Dinar",kai="Macedonian Denar",Tai="Fijian Dollar",Iai="Bolivian Boliviano",Lai="Albanian Lek",Aai="Serbian Dinar",Nai="Lebanese Pound",Dai="Armenian Dram",Rai="Azerbaijan Manat",Pai="Bosnia and Herzegovina Convertible Mark",Oai="Belarusian Ruble",Mai="Moldovan Leu",jai="Kazakhstani Tenge",Fai="Gibraltar Pound",Bai="Gambia Dalasi",$ai="Paraguayan Guarani",Hai="Malawi Kwacha",Vai="Zimbabwean Dollar",Wai="Cambodian Riel",zai="Vanuatu Vatu",Uai="Cuban Peso",qai="BZ Dollar",Kai="Libyan Dinar",Gai="Silver Troy Ounce",Yai="Gold Troy Ounce",Qai="Malagasy ariary",Xai="Tongan Pa'anga",Zai="We hope you're enjoying using the app.<br/>If you'd consider :link we'd greatly appreciate it!",Jai="writing a review",eli="First Tax",tli="Second Tax",nli="Gateway fees are the costs charged for access to the financial networks that handle the processing of online payments.",ili="Exporting format",rli="First Custom",sli="Second Custom",oli="Contact First Name",ali="Contact Last Name",lli="Contact First Custom",cli="Contact Second Custom",uli="Currency",dli="To troubleshoot check for comments on :ofxhome_link and test with :ofxget_link.",hli="Comments",fli="Item Product",pli="Item Notes",gli="Item Cost",mli="Item Quantity",_li="Item Tax Rate",vli="Item Tax Name",bli="Item Tax1",yli="Item Tax2",Cli="Delete Company",wli="Permanently delete the company along with all data and setting.",xli="Warning: This will permanently delete your company, there is no undo.",Sli="The coupon has been applied, the plan price has been reduced by :discount%.",Eli="The coupon has been applied, your account has been upgraded to pro for one year.",kli="If you're reporting an error please include any relevant logs from storage/logs/laravel-error.log",Tli="Include Errors",Ili="Include :link from storage/logs/laravel-error.log",Lli="recent errors",Ali="Customer",Nli="Customers",Dli="Successfully created customer",Rli="Successfully created :count customers",Pli="The data in your company (:account) has been successfully purged.",Oli="Successfully deleted company",Mli="Successfully canceled account",jli="Your company (:account) has been successfully deleted.",Fli="Your account (:account) has been successfully deleted.",Bli="Alipay",$li="Sofort",Hli="SEPA Direct Debit",Vli="Please enter a name with only the letters a-z and whitespaces",Wli="Accept Alipay",zli="Accept EU bank transfers",Uli="These gateways also need to be activated in :link.",qli="Calendar",Kli=":link to enable the calendar by joining the Pro Plan",Gli="What are you working on?",Yli="Time Tracker",Qli="Refresh",Xli="Filter/Sort",Zli="No Description",Jli="Time Tracker Login",eci="Save or discard your changes",tci="Discard Changes",nci="Tasks are not enabled.",ici="Successfully started task",rci="Create Client",sci="Download the desktop app",oci="Download the iPhone app",aci="Download the Android app",lci="Double tap a task to select it",cci="Stopped",uci="Ascending",dci="Descending",hci="Sort By",fci="Direction",pci="Discard",gci="AM",mci="PM",_ci="mins",vci="hr",bci="hrs",yci="Clear",Cci="Note: accepting online payments requires a payment gateway, :link to add one.",wci="Task Rate",xci="Set the default rate for invoiced tasks.",Sci="Past Due",Eci="Document",kci="Invoice/Expense",Tci="Invoice PDFs",Ici="Accept SEPA",Lci="Accept Bitcoin",Aci="IBAN",Nci="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.",Dci="Recover License",Rci="Purchase",Pci="Recover",Oci="Apply",Mci="Recover White Label License",jci="Apply White Label License",Fci="Videos",Bci="Video",$ci="Return to Invoice",Hci="Partial Due Date",Vci="Task Fields",Wci="Drag and drop fields to change their order",zci="Custom Value 1",Uci="Custom Value 2",qci="Two-Factor Authentication",Kci="Use your phone to confirm your identity when logging in",Gci="Two-Factor Setup",Yci="Scan the bar code with a :link compatible app.",Qci="One Time Password",Xci="Set your mobile phone number as a backup to enable.",Zci="Successfully enabled Two-Factor Authentication",Jci="Add Product",eui="Note: the email will be sent on :date.",tui="Invoice Product",nui="Self-Host Login",iui="Self-Host URL",rui="Error: local storage is not available.",sui="Your Password Reset Link",oui="The subdomain is already in use",aui="The inbound mailbox is already in use",lui="The inbound mailbox does not match the required schema",cui="Client Login",uui="Converted Amount",dui="Shipping Address",hui="Billing Address",fui="Billing Street",pui="Billing Apt/Suite",gui="Billing City",mui="Billing State/Province",_ui="Billing Postal Code",vui="Billing Country",bui="Shipping Street",yui="Shipping Apt/Suite",Cui="Shipping City",wui="Shipping State/Province",xui="Shipping Postal Code",Sui="Shipping Country",Eui="Classify",kui="Require client to provide their shipping address",Tui="Ship to billing address",Iui="Delivery Note",Lui="Show tasks in the client portal",Aui="Cancel Schedule",Nui="Scheduled Report",Dui="Email the :report report as :format to :email",Rui="Successfully scheduled report",Pui="Successfully canceled scheduled report",Oui="Your scheduled :type report is attached.",Mui="Failed to create schedule report",jui="Invalid one time password",Fui="Apple/Google Pay",Bui="Accept Apple Pay and Pay with Google",$ui="This payment type requires that a :link.",Hui="subdomain is set",Vui="Verification File",Wui="The verification file is needed to accept payments.",zui="Use <code>:domain</code> as the domain in :link.",Uui="Sorry, Apple/Google Pay isn't supported by your browser",qui="Optional Payment Methods",Kui="Add Subscription",Gui="Target",Yui="When the selected event occurs the app will post the entity to the target URL.",Qui="Event",Xui="Created Client",Zui="Created Invoice",Jui="Created Quote",edi="Created Payment",tdi="Created Vendor",ndi="Updated Quote",idi="Deleted Quote",rdi="Updated Invoice",sdi="Deleted Invoice",odi="Updated Client",adi="Deleted Client",ldi="Deleted Payment",cdi="Updated Vendor",udi="Deleted Vendor",ddi="Created Expense",hdi="Updated Expense",fdi="Deleted Expense",pdi="Created Task",gdi="Updated Task",mdi="Deleted Task",_di="Approved Quote",vdi="Subscriptions",bdi="Successfully updated subscription",ydi="Successfully created subscription",Cdi="Edit Subscription",wdi="Archive Subscription",xdi="Successfully archived subscription",Sdi="The projects can't belong to different clients",Edi="Invoice Project",kdi="Recurring Invoices",Tdi="Credits",Idi="Quotes & Proposals",Ldi="Tasks & Projects",Adi="Expenses & Vendors",Ndi="Tickets",Ddi="Reminders",Rdi="Send email reminders",Pdi="Tasks are visible in the portal",Odi="Reminders are not sent",Mdi="Your promotion will expire soon, :link to upgrade now.",jdi="Note: to delete this company first delete all linked companies.",Fdi="Please register your account",Bdi="Processing request",$di="Warning: Mcrypt is deprecated, run :command to update your cipher.",Hdi="Edit Times",Vdi="Include <b>taxes in the cost</b>",Wdi="This setting can not be changed once an invoice has been created.",zdi="Warning: existing invoices will need to be resaved",Udi="Copy Shipping",qdi="Copy Billing",Kdi="The quote has expired, please contact the merchant.",Gdi="Showing 0 to 0 of 0 entries",Ydi="Do not remember this device",Qdi="Trust for 30 days",Xdi="Trust forever",Zdi="Kanban",Jdi="Backlog",ehi="Ready to do",thi="In progress",nhi="Add status",ihi="Archive Status",rhi="New Status",shi="Convert Products",ohi="Automatically convert product prices to the client's currency",ahi="Set a subdomain to shorten the client portal link.",lhi="Budgeted Hours",chi="Progress",uhi="View Project",dhi="Summary",hhi="Endless Reminder",fhi="Add the following code to show your client's signature on the PDF.",phi="Show on PDF",ghi="Show the client signature on the invoice/quote PDF.",mhi="The white label license has expired",_hi="Return to Login",vhi='Note: add a :link named ":name" to see the exchange rate.',bhi="The amount is greater than the invoice balance, a credit will be created with the remaining amount.",yhi="Use <code>Label|Option1,Option2</code> to show a select box.",Chi="Client Information",whi="Successfully updated client details",xhi="Auto",Shi="Tax Amount",Ehi="Tax Paid",khi="None",Thi="To view your proposal for :amount, click the button below.",Ihi="Proposal",Lhi="Proposals",Ahi="List Proposals",Nhi="New Proposal",Dhi="Edit Proposal",Rhi="Archive Proposal",Phi="Delete Proposal",Ohi="Successfully created proposal",Mhi="Successfully updated proposal",jhi="Successfully archived proposal",Fhi="Successfully archived proposal",Bhi="Successfully archived :count proposals",$hi="Successfully archived :count proposals",Hhi="Successfully restored proposal",Vhi="Restore Proposal",Whi="Snippet",zhi="Snippets",Uhi="Snippet",qhi="Snippets",Khi="New Snippet",Ghi="Edit Snippet",Yhi="Archive Snippet",Qhi="Delete Snippet",Xhi="Successfully created snippet",Zhi="Successfully updated snippet",Jhi="Successfully archived snippet",efi="Successfully archived snippet",tfi="Successfully archived :count snippets",nfi="Successfully archived :count snippets",ifi="Successfully restored snippet",rfi="Restore Snippet",sfi="Template",ofi="Templates",afi="Template",lfi="Templates",cfi="New Template",ufi="Edit Template",dfi="Archive Template",hfi="Delete Template",ffi="Successfully created template",pfi="Successfully updated template",gfi="Successfully archived template",mfi="Successfully archived template",_fi="Successfully archived :count templates",vfi="Successfully archived :count templates",bfi="Successfully restored template",yfi="Restore Template",Cfi="Category",wfi="Categories",xfi="New Category",Sfi="Edit Category",Efi="Archive Category",kfi="Delete Category",Tfi="Successfully created category",Ifi="Successfully updated category",Lfi="Successfully archived category",Afi="Successfully archived category",Nfi="Successfully archived :count categories",Dfi="Successfully archived :count categories",Rfi="Successfully restored category",Pfi="Restore Category",Ofi="Delete Status",Mfi="Standard",jfi="Icon",Ffi="The requested proposal is not available",Bfi="Create category",$fi="Clone Template",Hfi="Proposal Email",Vfi="New proposal :number from :account",Wfi="To view your proposal for :amount, click the link below.",zfi="Successfully emailed proposal",Ufi="Load Template",qfi="No images, drag to upload",Kfi="Add Image",Gfi="Select Image",Yfi="Upgrade to the Enterprise Plan to upload files & images",Qfi="Delete Image",Xfi="Warning: deleting the image will remove it from all proposals.",Zfi="Note: the invoice $amount field will use the partial/deposit field if set otherwise it will use the invoice balance.",Jfi="Note: Inclusive taxes have been enabled.",epi="Note: Inclusive taxes are not enabled.",tpi="Changing this setting requires :link the account data.",npi="purging",ipi="The refund will be recorded in the app but will NOT be processed by the payment gateway.",rpi="Email address has been changed",spi="The email address for your account has been changed from :old_email to :new_email.",opi="Test",api="Beta",lpi="Email History",cpi="Loading",upi="No messages found",dpi="Processing",hpi="Reactivate",fpi="The email address has been reactivated",ppi="Emails",gpi="Opened",mpi="Bounced",_pi="Total Sent",vpi="Total Opened",bpi="Total Bounced",ypi="Total Spam",Cpi="Platforms",wpi="Email Clients",xpi="Mobile",Spi="Desktop",Epi="Webmail",kpi="Group",Tpi="Subgroup",Ipi="Unset",Lpi="You've received a new payment!",Api="Receive payment notifications using :link.",Npi="Slack incoming webhooks",Dpi="Accept",Rpi="Successfully accepted the latest terms of service",Ppi="Invalid URL",Opi="Workflow Settings",Mpi="Auto Email",jpi="Automatically email recurring invoices when created.",Fpi="Auto Archive",Bpi="Automatically archive invoices when paid.",$pi="Auto Archive",Hpi="Automatically archive quotes when converted to invoice.",Vpi="Require approve quote",Wpi="Require clients to approve quotes.",zpi="Allow approve expired quote",Upi="Allow clients to approve expired quotes.",qpi="Invoice Workflow",Kpi="Quote Workflow",Gpi="Error: the client must be active",Ypi="Purge Client",Qpi="Successfully purged client",Xpi="All related records (invoices, tasks, expenses, documents, etc) will also be deleted.",Zpi="Clone Product",Jpi="Item Details",egi="Send line item details to the payment gateway.",tgi="View Proposal",ngi="View in Portal",igi="This website uses cookies to ensure you get the best experience on our website.",rgi="Got it!",sgi="vendor will be created",ogi="vendors will be created",agi="Successfully created :count vendor(s)",lgi="Import Vendors",cgi="Company",ugi="Client Field",dgi="Contact Field",hgi="Product Field",fgi="Task Field",pgi="Project Field",ggi="Expense Field",mgi="Vendor Field",_gi="Company Field",vgi="Invoice Field",bgi="Invoice Surcharge",ygi="Add a field when creating a task.",Cgi="Add a field when creating a project.",wgi="Add a field when creating an expense.",xgi="Add a field when creating a vendor.",Sgi="Messages",Egi="Unpaid Invoice",kgi="Paid Invoice",Tgi="Unapproved Quote",Igi="Unapproved Proposal",Lgi="Auto-fills city/state",Agi="No match found",Ngi="Password Strength",Dgi="Weak",Rgi="Good",Pgi="Strong",Ogi="Mark",Mgi="Successfully update task status",jgi="Background Image",Fgi="Use the :link to manage your images, we recommend using a small file.",Bgi="proposal editor",$gi="Background",Hgi="Guide",Vgi="Gateway Fee Item",Wgi="Gateway Fee Surcharge",zgi="Gateway Fee Discount",Ugi="Show Payments",qgi="Show Aging",Kgi="Reference",Ggi="Amount Paid",Ygi="Send Notifications For",Qgi="All Invoices",Xgi="My Invoices",Zgi="Payment Reference",Jgi="Maximum",emi="Sort",tmi="Refresh Complete",nmi="Please enter your email",imi="Please enter your password",rmi="Please enter your URL",smi="Please enter a product key",omi="An error occurred",ami="Overview",lmi="Copied :value to the clipboard",cmi="Error",umi="Could not launch",dmi="Additional",hmi="Ok",fmi="Email is invalid",pmi="Items",gmi="Partial/Deposit",mmi="Add Item",_mi="Total Amount",vmi="PDF",bmi="Invoice Status",ymi="Click + to add an item",Cmi=":count selected",wmi="Dismiss",xmi="Please select a date",Smi="Please select a client",Emi="Language",kmi="Updated",Tmi="Please enter an invoice number",Imi="Please enter a quote number",Lmi=":client's invoices",Ami="Viewed",Nmi="Approved",Dmi="Draft",Rmi="Sent",Pmi="Viewed",Omi="Approved",Mmi="Partial",jmi="Paid",Fmi="Successfully marked invoice as sent",Bmi="Please enter a client or contact name",$mi="Restart the app to apply the change",Hmi="Refresh Data",Vmi="Blank Contact",Wmi="No records found",zmi="Industry",Umi="Size",qmi="Net",Kmi="Show tasks",Gmi="Email Reminders",Ymi="First Reminder",Qmi="Second Reminder",Xmi="Third Reminder",Zmi="Send",Jmi="Auto billing",e_i="Button",t_i="More",n_i="Edit Recurring Invoice",i_i="Edit Recurring Quote",r_i="Quote Status",s_i="Please select an invoice",o_i="Filtered by",a_i="Payment Status",l_i="Pending",c_i="Voided",u_i="Failed",d_i="Completed",h_i="Partially Refunded",f_i="Refunded",p_i="Send receipt to the client",g_i="Refunded",m_i="Successfully marked quote as sent",__i="Custom Module Settings",v_i="Open",b_i="Closed",y_i="Reopened",C_i="Priority",w_i="Last Updated",x_i="Comment",S_i="Tags",E_i="Linked Objects",k_i="Low",T_i="Medium",I_i="High",L_i="No due date set",A_i="Assigned to",N_i="Reply",D_i="Awaiting reply",R_i="Mark as Spam",P_i="Local Part",O_i="Name taken",M_i="Name available",j_i="Invalid name (alpha numeric only, no spaces",F_i="Customize the local part of your inbound support email, ie. YOUR_NAME@support.invoiceninja.com",B_i="From name is the recognizable sender which is displayed instead of the email address, ie Support Center",$_i="YOUR_NAME",H_i="Support Center",V_i="Attachments",W_i="Client uploads",z_i="Allow clients to upload documents/attachments",U_i="Maximum file size (KB) is limited by your post_max_size and upload_max_filesize variables as set in your PHP.INI",q_i="Maximum file size",K_i="Mime types",G_i=".pdf , .docx, .jpg",Y_i="Comma separated list of allowed mime types, leave blank for all",Q_i="Ticket number must be greater than the current ticket number",X_i="New ticket",Z_i="Selecting a template will send an auto response to a client/contact when a new ticket is created",J_i="Updated ticket",evi="Selecting a template will send an auto response to a client/contact when a ticket is updated",tvi="Closed ticket",nvi="Selecting a template will send an auto response to a client/contact when a ticket is closed",ivi="Default priority",rvi="New comment",svi="Additional new comment notifications",ovi="admin@example.com, supervisor@example.com",avi="Default Agent",lvi="If selected will automatically be assigned to all inbound tickets",cvi="Show agent details on responses",uvi="Avatar",dvi="Remove avatar",hvi="Add Template",fvi="Archive Template",pvi="Restore Template",gvi="Successfully archived template",mvi="Successfully restored template",_vi="Please enter a message to update the ticket",vvi="Show / Hide all",bvi="Subject required",yvi="If you're using the mobile app you may need to do a full refresh.",Cvi="Merge",wvi="Merged",xvi="Agent",Svi="Include in filter",Evi=":VALUE",kvi=":VALUE",Tvi="Compare",Ivi="Hosted Login",Lvi="Selfhost Login",Avi="Google Login",Nvi="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",Dvi="legacy mobile app",Rvi="Today",Pvi="Current",Ovi="Previous",Mvi="Current Period",jvi="Comparison Period",Fvi="Previous Period",Bvi="Previous Year",$vi="Compare to",Hvi="Last Week",Vvi="Clone to Invoice",Wvi="Clone to Quote",zvi="Convert",Uvi="Last 7 Days",qvi="Last 30 Days",Kvi="Custom JS",Gvi="Adjust percent to account for fee",Yvi="Show product details",Qvi="Include the <b>description and cost</b> in the product dropdown",Xvi="Important",Zvi="Thank you for using our app!",Jvi="If you like it please",ebi="to rate it.",tbi="Average",nbi="Unapproved",ibi="Please authenticate to change this setting",rbi="Locked",sbi="Authenticate",obi="Please authenticate",abi="Biometric Authentication",lbi="Auto Start Tasks",cbi="Budgeted",ubi="Please enter a name",dbi="Click + to add time",hbi="Design",fbi="Password is too short",pbi="Failed to find record",gbi="Valid Until",mbi="Automatically sets the <b>Valid Until</b> value on quotes to this many days in the future. Leave blank to disable.",_bi="Days",vbi="Requires an Enterprise Plan",bbi="Take Picture",ybi="Upload File",Cbi="New Document",wbi="Edit Document",xbi="Successfully uploaded document",Sbi="Successfully updated document",Ebi="Successfully archived document",kbi="Successfully deleted document",Tbi="Successfully restored document",Ibi="No History",Lbi="Logged",Abi="Pending",Nbi="Invoiced",Dbi="No record selected",Rbi="Please save or cancel your changes",Pbi="Thank you for your purchase!",Obi="Redeem",Mbi="Back",jbi="Past Purchases",Fbi="Annual Subscription",Bbi="Pro Plan",$bi="Enterprise Plan",Hbi=":count users",Vbi="Upgrade",Wbi="Please enter a first name",zbi="Please enter a last name",Ubi="Please agree to the terms of service and privacy policy to create an account.",qbi="I agree to the",Kbi="terms of service",Gbi="privacy policy",Ybi="View Website",Qbi="Create Account",Xbi="Email Login",Zbi="Late Fees",Jbi="Payment Number",e0i="Before the due date",t0i="After the due date",n0i="After the invoice date",i0i="Filtered by User",r0i="Successfully created user",s0i="Primary Font",o0i="Secondary Font",a0i="Number Padding",l0i="General",c0i="Surcharge Field",u0i="Company Value",d0i="Credit Field",h0i="Payment Field",f0i="Group Field",p0i="Number Counter",g0i="Number Pattern",m0i="Custom JavaScript",_0i="Portal Mode",v0i="Attach PDF",b0i="Attach Documents",y0i="Attach UBL/E-Invoice",C0i="Email Style",w0i="Processed",x0i="Fee Amount",S0i="Fee Percent",E0i="Fee Cap",k0i="Limits/Fees",T0i="Credentials",I0i="Require client to provide their billing address",L0i="Require client to provide their shipping address",A0i="Successfully deleted tax rate",N0i="Successfully restored tax rate",D0i="Provider",R0i="Payment Gateway",P0i="Payment Gateways",O0i="New Gateway",M0i="Edit Gateway",j0i="Successfully created gateway",F0i="Successfully updated gateway",B0i="Successfully archived gateway",$0i="Successfully deleted gateway",H0i="Successfully restored gateway",V0i="Continue Editing",W0i="Default value",z0i="Currency Format",U0i="First Day of the Week",q0i="First Month of the Year",K0i="Symbol",G0i="Code",Y0i="Date Format",Q0i="Datetime Format",X0i="Send Reminders",Z0i="Timezone",J0i="Filtered by Group",eyi="Filtered by Invoice",tyi="Filtered by Client",nyi="Filtered by Vendor",iyi="Group Settings",ryi="Groups",syi="New Group",oyi="Edit Group",ayi="Successfully created group",lyi="Successfully updated group",cyi="Successfully archived group",uyi="Successfully deleted group",dyi="Successfully restored group",hyi="Upload Your Company Logo",fyi="Successfully uploaded logo",pyi="Successfully saved settings",gyi="Device Settings",myi="Credit Cards & Banks",_yi="Price",vyi="Email Sign Up",byi="Google Sign Up",yyi="Sign Up With Google",Cyi="Long-press Multiselect",wyi="Migrate to the next version of Invoice Ninja",xyi="We've been working on next version of Invoice Ninja. Click the button bellow to start the migration.",Syi="Start the migration",Eyi="Migration",kyi="Welcome to the new version of Invoice Ninja",Tyi="At the next step, we'll let you download your data for the migration.",Iyi="Press button below to download the data.",Lyi="Custom Company 1",Ayi="Custom Company 2",Nyi="Custom Company 3",Dyi="Custom Company 4",Ryi="Custom Product 1",Pyi="Custom Product 2",Oyi="Custom Product 3",Myi="Custom Product 4",jyi="Custom Client 1",Fyi="Custom Client 2",Byi="Custom Client 3",$yi="Custom Client 4",Hyi="Custom Contact 1",Vyi="Custom Contact 2",Wyi="Custom Contact 3",zyi="Custom Contact 4",Uyi="Custom Task 1",qyi="Custom Task 2",Kyi="Custom Task 3",Gyi="Custom Task 4",Yyi="Custom Project 1",Qyi="Custom Project 2",Xyi="Custom Project 3",Zyi="Custom Project 4",Jyi="Custom Expense 1",e1i="Custom Expense 2",t1i="Custom Expense 3",n1i="Custom Expense 4",i1i="Custom Vendor 1",r1i="Custom Vendor 2",s1i="Custom Vendor 3",o1i="Custom Vendor 4",a1i="Custom Invoice 1",l1i="Custom Invoice 2",c1i="Custom Invoice 3",u1i="Custom Invoice 4",d1i="Custom Payment 1",h1i="Custom Payment 2",f1i="Custom Payment 3",p1i="Custom Payment 4",g1i="Custom Surcharge 1",m1i="Custom Surcharge 2",_1i="Custom Surcharge 3",v1i="Custom Surcharge 4",b1i="Custom Group 1",y1i="Custom Group 2",C1i="Custom Group 3",w1i="Custom Group 4",x1i="Number",S1i="Count",E1i="Is Active",k1i="Contact Last Login",T1i="Contact Full Name",I1i="Contact Custom Value 1",L1i="Contact Custom Value 2",A1i="Contact Custom Value 3",N1i="Contact Custom Value 4",D1i="Assigned To Id",R1i="Created By Id",P1i="Add Column",O1i="Edit Columns",M1i="to learn about Google Fonts",j1i="Refund Date",F1i="Multiselect",B1i="Verify Password",$1i="Applied",H1i="Include recent errors from the logs",V1i="We have received your message and will try to respond promptly.",W1i="Show Product Details",z1i="Include the description and cost in the product dropdown",U1i="The PDF renderer requires :version",q1i="Adjust Fee Percent",K1i="Configure Settings",G1i="About",Y1i="Credit Email",Q1i="Domain URL",X1i="Password must contain an upper case character and a number",Z1i="Client Portal Tasks",J1i="Client Portal Dashboard",eCi="Please enter a value",tCi="Successfully deleted logo",nCi="Generate Number",iCi="When Saved",rCi="When Sent",sCi="Select Company",oCi="Float",aCi="Collapse",lCi="Show/hide",cCi="Menu Sidebar",uCi="History Sidebar",dCi="Tablet",hCi="Layout",fCi="Module",pCi="First Custom",gCi="Second Custom",mCi="Third Custom",_Ci="Show Cost",vCi="Display a product cost field to track the markup/profit",bCi="Show Product Quantity",yCi="Display a product quantity field, otherwise default to one",CCi="Show Invoice Quantity",wCi="Display a line item quantity field, otherwise default to one",xCi="Default Quantity",SCi="Automatically set the line item quantity to one",ECi="One Tax Rate",kCi="Two Tax Rates",TCi="Three Tax Rates",ICi="Default Tax Rate",LCi="Invoice Tax",ACi="Line Item Tax",NCi="Inclusive Taxes",DCi="Invoice Tax Rates",RCi="Item Tax Rates",PCi="Configure rates",OCi="Tax Rates",MCi="Accent Color",jCi="Comma separated list",FCi="Single-line text",BCi="Multi-line text",$Ci="Dropdown",HCi="Field Type",VCi="A password recovery email has been sent",WCi="Successfully removed user",zCi="Three Years",UCi="24 Hour Display",qCi="Click here",KCi="Successfully marked invoice as paid",GCi="Successfully marked invoices as sent",YCi="Successfully marked invoices as paid",QCi="System failed to email invoice :invoice",XCi="Custom Value 3",ZCi="Custom Value 4",JCi="Custom Email Style",ewi="Custom Dashboard Message",twi="Custom Unpaid Invoice Message",nwi="Custom Paid Invoice Message",iwi="Custom Unapproved Quote Message",rwi="Lock Sent Invoices",swi="Translations",owi="Task Number Pattern",awi="Task Number Counter",lwi="Expense Number Pattern",cwi="Expense Number Counter",uwi="Vendor Number Pattern",dwi="Vendor Number Counter",hwi="Ticket Number Pattern",fwi="Ticket Number Counter",pwi="Payment Number Pattern",gwi="Payment Number Counter",mwi="Invoice Number Pattern",_wi="Quote Number Pattern",vwi="Credit Number Pattern",bwi="Credit Number Counter",ywi="Credit Number Pattern",Cwi="Credit Number Counter",wwi="Reset Counter Date",xwi="Counter Padding",Swi="Share Invoice/Quote Counter",Ewi="Default Tax Name 1",kwi="Default Tax Rate 1",Twi="Default Tax Name 2",Iwi="Default Tax Rate 2",Lwi="Default Tax Name 3",Awi="Default Tax Rate 3",Nwi="Email Invoice Subject",Dwi="Email Quote Subject",Rwi="Email Payment Subject",Pwi="Switch List Table",Owi="Client City",Mwi="Client State",jwi="Client Country",Fwi="Client is Active",Bwi="Client Balance",$wi="Client Street",Hwi="Client Apt/Suite",Vwi="Client Shipping Street",Wwi="Client Shipping Apt/Suite",zwi="Tax Rate 1",Uwi="Tax Rate 2",qwi="Tax Rate 3",Kwi="Archived At",Gwi="Has Expenses",Ywi="Custom Taxes 1",Qwi="Custom Taxes 2",Xwi="Custom Taxes 3",Zwi="Custom Taxes 4",Jwi="Custom Surcharge 1",exi="Custom Surcharge 2",txi="Custom Surcharge 3",nxi="Custom Surcharge 4",ixi="Is Deleted",rxi="Vendor City",sxi="Vendor State",oxi="Vendor Country",axi="Credit Footer",lxi="Credit Terms",cxi="Untitled Company",uxi="Successfully added company",dxi="Supported Events",hxi="Third Custom",fxi="Fourth Custom",pxi="Optional",gxi="License",mxi="Invoice Balance",_xi="Successfully saved design",vxi="Client Details",bxi="Company Address",yxi="Quote Details",Cxi="Credit Details",wxi="Product Columns",xxi="Task Columns",Sxi="Add Field",Exi="All Events",kxi="Owned",Txi="Payment Success",Ixi="Payment Failure",Lxi="Quote Sent",Axi="Credit Sent",Nxi="Invoice Viewed",Dxi="Quote Viewed",Rxi="Credit Viewed",Pxi="Quote Approved",Oxi="Receive All Notifications",Mxi="Purchase License",jxi="Enable Modules",Fxi="Successfully converted quote",Bxi="Credit Design",$xi="Includes",Hxi="CSS Framework",Vxi="Custom Designs",Wxi="Designs",zxi="New Design",Uxi="Edit Design",qxi="Successfully created design",Kxi="Successfully updated design",Gxi="Successfully archived design",Yxi="Successfully deleted design",Qxi="Successfully removed design",Xxi="Successfully restored design",Zxi="Recurring Tasks",Jxi="Successfully removed credit",eSi="Latest Version",tSi="Update Now",nSi="A new version of the web app is available",iSi="Update Available",rSi="Update successfully completed",sSi="Integrations",oSi="Tracking Id",aSi="Slack Webhook URL",lSi="Partial Payment",cSi="Partial Payment Email",uSi="Clone to Credit",dSi="Successfully emailed credit",hSi="Successfully marked credit as sent",fSi="Email Partial Payment Subject",pSi="Is Approved",gSi="Oops, something went wrong! Please make sure you have setup an Invoice Ninja v5 instance before starting the migration.",mSi='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>',_Si="Email Credit",vSi="Client does not have an email address set",bSi="Ledger",ySi="View PDF",CSi="All records",wSi="Owned by user",xSi="Credit Remaining",SSi="Use default",ESi="Endless Reminders",kSi="Number of days",TSi="Configure Payment Terms",ISi="Payment Term",LSi="New Payment Term",ASi="Successfully deleted payment term",NSi="Successfully removed payment term",DSi="Successfully restored payment term",RSi="Full Width Editor",PSi="Full Height Filter",OSi="Sign in with email",MSi="Change",jSi="Change to the mobile layout?",FSi="Change to the desktop layout?",BSi="Send from Gmail",$Si="Reversed",HSi="Cancelled",VSi="Quote Amount",WSi="Hosted",zSi="Self-Hosted",USi="Hide Menu",qSi="Show Menu",KSi="Partially Refunded",GSi="Search Documents",YSi="Search Designs",QSi="Search Invoices",XSi="Search Clients",ZSi="Search Products",JSi="Search Quotes",eEi="Search Credits",tEi="Search Vendors",nEi="Search Users",iEi="Search Tax Rates",rEi="Search Tasks",sEi="Search Settings",oEi="Search Projects",aEi="Search Expenses",lEi="Search Payments",cEi="Search Groups",uEi="Search Company",dEi="Successfully cancelled invoice",hEi="Successfully cancelled invoices",fEi="Successfully reversed invoice",pEi="Successfully reversed invoices",gEi="Reverse",mEi="Filtered by Project",_Ei="Sign in with Google",vEi=":user reversed invoice :invoice",bEi=":user cancelled invoice :invoice",yEi="Reconciliation Failure",CEi="Reconciliation Success",wEi="Gateway Success",xEi="Gateway Failure",SEi="Gateway Error",EEi="Email Send",kEi="Email Retry Queue",TEi="Failure",IEi="Quota Exceeded",LEi="Upstream Failure",AEi="System Logs",NEi="Copy Link",DEi="Welcome to Invoice Ninja",REi="Opt-In",PEi="Opt-Out",OEi="Auto Convert",MEi="Reminder 1 Sent",jEi="Reminder 2 Sent",FEi="Reminder 3 Sent",BEi="Reminder Last Sent",$Ei="Page :current of :total",HEi="Successfully emailed credits",VEi="View in Stripe",WEi="Rows Per Page",zEi="Apply Payment",UEi="Unapplied",qEi="Custom Labels",KEi="Record Type",GEi="Record Name",YEi="File Type",QEi="Height",XEi="Width",ZEi="Health Check",JEi="Last Login At",eki="Company Key",tki="Storefront",nki="Enable third-party apps to create invoices",iki=":count records selected",rki=":count record selected",ski="Client Created",oki="Online Payment Email",aki="Manual Payment Email",lki="Completed",cki="Gross",uki="Net Amount",dki="Net Balance",hki="Client Settings",fki="Selected Invoices",pki="Selected Payments",gki="Selected Quotes",mki="Selected Tasks",_ki="Selected Expenses",vki="Past Due Invoices",bki="Create Payment",yki="Update Quote",Cki="Update Invoice",wki="Update Client",xki="Update Vendor",Ski="Create Expense",Eki="Update Expense",kki="Update Task",Tki="Approve Quote",Iki="When Paid",Lki="Expires On",Aki="Show Sidebar",Nki="Hide Sidebar",Dki="Event Type",Rki="Copy",Pki="Please restart the app once connected to the internet",Oki="The crons need to be enabled",Mki="API Webhooks",jki="Search :count Webhooks",Fki="Search 1 Webhook",Bki="Webhook",$ki="Webhooks",Hki="New Webhook",Vki="Edit Webhook",Wki="Successfully created webhook",zki="Successfully updated webhook",Uki="Successfully archived webhook",qki="Successfully deleted webhook",Kki="Successfully removed webhook",Gki="Successfully restored webhook",Yki="Search :count Tokens",Qki="Search 1 Token",Xki="New Token",Zki="Successfully removed token",Jki="Successfully restored token",eTi="Client Registration",tTi="Enable clients to self register in the portal",nTi="Customize & Preview",iTi="Search 1 Document",rTi="Search 1 Design",sTi="Search 1 Invoice",oTi="Search 1 Client",aTi="Search 1 Product",lTi="Search 1 Quote",cTi="Search 1 Credit",uTi="Search 1 Vendor",dTi="Search 1 User",hTi="Search 1 Tax Rate",fTi="Search 1 Tasks",pTi="Search 1 Project",gTi="Search 1 Expense",mTi="Search 1 Payment",_Ti="Search 1 Group",vTi="Created On",bTi="Lock Invoices",yTi="Show Table",CTi="Show List",wTi="View Changes",xTi="Force Update",STi="You are running the latest version but there may be pending fixes available.",ETi="Track the expense has been paid",kTi="Enable the expense to be invoiced",TTi="Make the documents visible to client",ITi="Set an exchange rate",LTi="Expense Settings",ATi="Clone to Recurring",NTi="Crypto",DTi="User Field",RTi="Variables",PTi="Show Password",OTi="Hide Password",MTi="Copy Error",jTi="Capture Card",FTi="Auto Bill Enabled",BTi="Total Taxes",$Ti="Line Taxes",HTi="Total Fields",VTi="Successfully stopped recurring invoice",WTi="Successfully started recurring invoice",zTi="Successfully resumed recurring invoice",UTi="Gateway Refund",qTi="Process the refund with the payment gateway",KTi="Due Date",GTi="Paused",YTi="Day :count",QTi="First Day of the Month",XTi="Last Day of the Month",ZTi="Use Payment Terms",JTi="Endless",e2i="Next Send Date",t2i="Remaining Cycles",n2i="Successfully created recurring invoice",i2i="Successfully updated recurring invoice",r2i="Successfully removed recurring invoice",s2i="Search 1 Recurring Invoice",o2i="Search :count Recurring Invoices",a2i="Send Date",l2i="Auto Bill On",c2i="Minimum Under Payment Amount",u2i="Allow Overpayment",d2i="Support paying extra to accept tips",h2i="Allow Underpayment",f2i="Support paying at minimum the partial/deposit amount",p2i="Test Mode",g2i="Calculated Rate",m2i="Default Task Rate",_2i="Clear Cache",v2i="Sort Order",b2i="Status",y2i="Task Statuses",C2i="New Task Status",w2i="Edit Task Status",x2i="Successfully created task status",S2i="Successfully archived task status",E2i="Successfully deleted task status",k2i="Successfully removed task status",T2i="Successfully restored task status",I2i="Search 1 Task Status",L2i="Search :count Task Statuses",A2i="Show Tasks Table",N2i="Always show the tasks section when creating invoices",D2i="Invoice Task Timelog",R2i="Add time details to the invoice line items",P2i="Start tasks before saving",O2i="Configure Statuses",M2i="Task Settings",j2i="Configure Categories",F2i="Edit Expense Category",B2i="Successfully removed expense category",$2i="Search 1 Expense Category",H2i="Search :count Expense Categories",V2i="Use Available Credits",W2i="Show Option",z2i="The credit amount cannot exceed the payment amount",U2i="Enable the expense to be invoiced",q2i="Configure Gateways",K2i="Partial Payment",G2i="Is Running",Y2i="Invoice Currency ID",Q2i="Tax Name 1",X2i="Tax Name 2",Z2i="Transaction ID",J2i="Invoice Late",eIi="Quote Expired",tIi="Invoice Total",nIi="Actions",iIi="Expense Number",rIi="Task Number",sIi="Project Number",oIi="View Settings",aIi="Warning: this company has not yet been activated",lIi="Late Invoice",cIi="Expired Quote",uIi="Remind Invoice",dIi="Client Phone",hIi="Required Fields",fIi="Enabled Modules",pIi=":contact viewed quote :quote",gIi=":user updated client :client",mIi=":user updated vendor :vendor",_Ii=":user emailed first reminder for invoice :invoice to :contact",vIi=":user emailed second reminder for invoice :invoice to :contact",bIi=":user emailed third reminder for invoice :invoice to :contact",yIi=":user emailed endless reminder for invoice :invoice to :contact",CIi="Expense Category ID",wIi="View Licenses",xIi="Fullscreen Editor",SIi="Sidebar Editor",EIi='Please type ":value" to confirm',kIi="Purge",TIi="Clone To",IIi="Clone to Other",LIi="Labels",AIi="Add Custom",NIi="Payment Tax",DIi="White Label",RIi="Sent invoices are locked",PIi="Paid invoices are locked",OIi="Source Code",MIi="App Platforms",jIi="Successfully archived :value task statuses",FIi="Successfully deleted :value task statuses",BIi="Successfully restored :value task statuses",$Ii="Successfully deleted expense :value categories",HIi="Successfully restored expense :value categories",VIi="Successfully archived recurring :value invoices",WIi="Successfully deleted recurring :value invoices",zIi="Successfully restored recurring :value invoices",UIi="Successfully archived :value webhooks",qIi="Successfully deleted :value webhooks",KIi="Successfully removed :value webhooks",GIi="Successfully restored :value webhooks",YIi="API Docs",QIi="Successfully archived :value tokens",XIi="Successfully deleted :value tokens",ZIi="Successfully restored :value tokens",JIi="Successfully archived :value payment terms",eLi="Successfully deleted :value payment terms",tLi="Successfully restored :value payment terms",nLi="Successfully archived :value designs",iLi="Successfully deleted :value designs",rLi="Successfully restored :value designs",sLi="Successfully restored :value credits",oLi="Successfully archived :value users",aLi="Successfully deleted :value users",lLi="Successfully removed :value users",cLi="Successfully restored :value users",uLi="Successfully archived :value tax rates",dLi="Successfully deleted :value tax rates",hLi="Successfully restored :value tax rates",fLi="Successfully archived :value gateways",pLi="Successfully deleted :value gateways",gLi="Successfully restored :value gateways",mLi="Successfully archived :value groups",_Li="Successfully deleted :value groups",vLi="Successfully restored :value groups",bLi="Successfully archived :value documents",yLi="Successfully deleted :value documents",CLi="Successfully restored :value documents",wLi="Successfully restored :value vendors",xLi="Successfully restored :value expenses",SLi="Successfully restored :value tasks",ELi="Successfully restored :value projects",kLi="Successfully restored :value products",TLi="Successfully restored :value clients",ILi="Successfully restored :value invoices",LLi="Successfully restored :value payments",ALi="Successfully restored :value quotes",NLi="Update App",DLi="Successfully started import",RLi="Duplicate column mapping",PLi="Uses Inclusive Taxes",OLi="Is Amount Discount",MLi="Map To",jLi="Use first row as column names",FLi="No File Selected",BLi="Import Type",$Li="Draft Mode",HLi="Preview updates faster but is less accurate",VLi="Show Product Discount",WLi="Display a line item discount field",zLi="Tax Name 3",ULi="Debug mode is enabled",qLi="Warning: it is intended for use on local machines, it can leak credentials. Click to learn more.",KLi="Running Tasks",GLi="Recent Tasks",YLi="Recent Expenses",QLi="Upcoming Expenses",XLi="Search 1 Payment Term",ZLi="Search :count Payment Terms",JLi="Save and Preview",eAi="Save and Email",tAi="Converted Balance",nAi="Is Sent",iAi="Document Upload",rAi="Enable clients to upload documents",sAi="Expense Total",oAi="Enter Taxes",aAi="By Rate",lAi="By Amount",cAi="Enter Amount",uAi="Before Taxes",dAi="After Taxes",hAi="Color",fAi="Show",pAi="Empty Columns",gAi="Project Name",mAi="To use :client_counter please add either :client_number or :client_id_number to prevent conflicts",_Ai="This Quarter",vAi="To update run",bAi="Registration URL",yAi="Show Product Cost",CAi="Complete",wAi="Next",xAi="Next step",SAi="Credit :invoice was sent to :client",EAi="Credit :invoice was viewed by :client",kAi="The following client :client was emailed Credit :invoice for :amount.",TAi="The following client :client viewed Credit :credit for :amount.",IAi="Enter your email to reset your password.",LAi="Password reset",AAi="Welcome! Glad to see you.",NAi="Request cancellation",DAi="Delete Payment Method",RAi="You are about to delete the payment method.",PAi="Action can't be reversed",OAi="The profile has been updated successfully.",MAi="Ethiopian Birr",jAi="Use a permanent address where you can receive mail.",FAi="Invoice Status",BAi="This email is already linked to an account",$Ai="Locations",HAi="Indefinitely",VAi="Cycles remaining",WAi="I understand, delete",zAi="Download Files",UAi="Use this link to download your files, the link will expire in 1 hour.",qAi="New Signup",KAi="A new account has been created by :user - :email - from IP address: :ip",GAi="Payment was made by :client",YAi="Partial payment was made by :client",QAi="A payment of :amount was made by client :client towards :invoice",XAi="A partial payment of :amount was made by client :client towards :invoice",ZAi="Notification Bot",JAi="Invoice # :invoice",eNi=":entity # :entity_number",tNi="If the button above isn't working for you, please click on the link",nNi="Display Log",iNi="Report errors to help improve the app",rNi="Setup",sNi="Quick overview & statistics",oNi="Update your personal information",aNi="Name, website & logo",lNi="Make sure you use full link to your site",cNi="Personal address",uNi="Enter your personal address",dNi="Enter your shipping address",hNi="List of invoices",fNi="With selected",pNi="This invoice is still not paid. Click the button to complete the payment",gNi="List of recurring invoices",mNi="Here are some details about recurring invoice",_Ni="Cancellation",vNi="In case you want to stop the recurring invoice, please click to request the cancellation.",bNi="Warning! You are requesting a cancellation of this service. Your service may be cancelled with no further notification to you.",yNi="Cancellation pending, we'll be in touch!",CNi="List of payments",wNi="Details of the payment",xNi="Associate invoices",SNi="List of payment methods",ENi="Details of payment method",kNi="Permanently remove this payment method.",TNi="Warning! This action can not be reversed!",INi="Confirmation",LNi="Quotes",ANi="Waiting for approval",NNi="This quote is still not approved",DNi="Credits",RNi="Required extensions",PNi="PHP version",ONi="Writable .env file",MNi=".env file is not writable by the current user.",jNi="Minimum PHP version",FNi="Make sure all requirements are satisfied.",BNi="Oops, something does not look right!",$Ni="Open in new tab",HNi="Complete payment",VNi="Authorize payment method for future use",WNi="Page",zNi="Per page",UNi="Of",qNi="View Credit",KNi="To view the :entity you need to enter password.",GNi="Showing :first to :last out of :total results",YNi="No results found.",QNi="Payment failed for Client :client",XNi="A payment made by client :client failed with message :message",ZNi="Register",JNi="Create your account in seconds",eDi="Confirm your password",tDi="Verification",nDi="Before using a bank account it must be verified.",iDi="Checkout.com",rDi="Copyright © :year :company.",sDi="Provided credit card number is not valid.",oDi="Provided month is not valid.",aDi="Provided year is not valid.",lDi="HTTPS is required, form will fail",cDi="If you need help you can post to our",uDi="After updating password, your account will be confirmed.",dDi="To pay with a bank account, first you have to add it as payment method.",hDi="Let's store basic information about your Invoice Ninja!",fDi="Highly recommended in production",pDi="Enable only for development",gDi="Test PDF",mDi=`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.`,_Di=`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.`,vDi="Node status",bDi="NPM status",yDi="I could not find Node anywhere. Is it installed?",CDi="I could not find NPM anywhere. Is it installed?",wDi="This invoice is locked and unable to be modified",xDi="Downloads",SDi="Resource",EDi="Details about the document",kDi="Hash",TDi="Resources",IDi="Allowed file types:",LDi="Common codes and their meanings",ADi="20087: Bad Track Data (invalid CVV and/or expiry date)",NDi="Download selected",DDi="To pay invoices, you have to",RDi="add payment method",PDi="No items selected.",ODi="Payment due",MDi="Account Balance",jDi="Thanks",FDi="Minimum required payment is :amount",BDi="Company doesn't support underpayments.",$Di="Company doesn't support overpayments.",HDi="Saved at :time",VDi="Credit applied to Invoice :invoice_number",WDi="New credit :number from :account",zDi="To view your credit for :amount, click the link below.",UDi="Cryptocurrency",qDi="Credit",KDi="Store for future use",GDi="Pay with credit",YDi="Payment method can't be saved for future use.",QDi="Pay with",XDi='By clicking "Next" you accept terms.',ZDi="Not specified",JDi="Before proceeding with payment, you have to fill following fields",eRi="After completing, go back to previous page.",tRi="Pay",nRi="Instructions",iRi="Reminder 1 for Invoice :invoice was sent to :client",rRi="Reminder 2 for Invoice :invoice was sent to :client",sRi="Reminder 3 for Invoice :invoice was sent to :client",oRi="Custom reminder was sent to :client",aRi="Endless reminder for Invoice :invoice was sent to :client",lRi="Assigned User",cRi="To proceed to next step, make sure you test each section.",uRi="Note about Phantom JS. Read more.",dRi="Minimum Payment",hRi="No action provided. If you believe this is wrong, please contact the support.",fRi="No payable invoices selected. Make sure you are not trying to pay draft invoice or invoice with zero balance due.",pRi="Required payment details",gRi="To complete a payment we need more details about you.",mRi="We will save this, so you don't have to enter it next time.",_Ri="We were unable to deliver Credit :invoice to :contact. \\n :error",vRi="Unable to deliver Credit :invoice",bRi="Save payment method details",yRi="New card",CRi="Add Bank Account",wRi="Limit of :limit companies per account.",xRi="Total credits applied cannot be MORE than total of invoices",SRi="Credit number already taken",ERi="Credit not found",kRi="Selected invoices are not from a single client",TRi="Duplicate credits submitted.",IRi="Duplicate invoices submitted.",LRi="You must have an invoice set when using a credit in a payment",ARi="Client id is required",NRi="Expense number already taken",DRi="Invoice number already taken",RRi="Payment `id` required.",PRi="Unable to retrieve specified payment",ORi="Invoice id :invoice is not related to this payment",MRi="Credit id :credit is not related to this payment",jRi="Attempting to refund more than allowed for invoice id :invoice, maximum refundable amount is :amount",FRi="Attempting to refund a payment with invoices attached, please specify valid invoice/s to be refunded.",BRi="Attempting to refund a payment with credits attached, please specify valid credits/s to be refunded.",$Ri="Attempting to refund more than allowed for credit :credit, maximum refundable amount is :amount",HRi="Project client does not match entity client",VRi="Quote number already taken",WRi="Recurring Invoice number :number already taken",zRi="User not associated with this account",URi="Amounts do not balance correctly.",qRi="Insufficient applied amount remaining to cover payment.",KRi="Insufficient balance on credit.",GRi="One or more of these invoices have been paid",YRi="Invoice id :number cannot be refunded",QRi="Attempting to refund :amount only :refundable_amount available for refund",XRi="This user is unable to be attached to this company. Perhaps they have already registered a user on another account?",ZRi="Migration completed",JRi="Your migration has completed, please review your data after logging in.",ePi="404 | Nothing to see here!",tPi="Cannot load a large account without a updated_at parameter",nPi="No backup exists for this activity",iPi="Company User record not found",rPi="No credits found.",sPi="The requested action :action is not available.",oPi="No Documents Found",aPi="No group settings found",lPi="Insufficient privileges to access/modify this resource",cPi="Invoice cannot be marked as paid",uPi="Invalid license, or invalid environment :environment",dPi="Route not available",hPi="Invalid custom design object",fPi="Quote/s not found",pPi="Unable to approve this quote as it has expired.",gPi="Scheduler has run",mPi="Scheduler has never run",_Pi="Self update not available on this system.",vPi="User detached from company",bPi="Failed to create Webhook",yPi="Thank you for your payment of :amount for :invoice",CPi="Note: Online payments are supported only if amount is larger than $1 or currency equivalent.",wPi="Payment token not found, please try again. If an issue still persist, try with another payment method",xPi="Vendor Street",SPi="Vendor Apt/Suite",EPi="Partially Unapplied",kPi="Please select a user authenticated with Gmail",TPi="List Long Press",IPi="Show Actions",LPi="Start Multiselect",APi="An email has been sent to confirm the email address",NPi="Converted Paid to Date",DPi="Converted Credit Balance",RPi="Converted Total",PPi="Reply-To Name",OPi="Color Theme",MPi="Start Migration",jPi="Request for recurring invoice cancellation from :contact",FPi=":contact from Client :client requested to cancel Recurring Invoice :invoice",BPi="Hello",$Pi="Group documents",HPi="Are you sure you want to approve this quote?",VPi="Select companies to migrate",WPi="Force migration",zPi="Require Password with Social Login",UPi="Stay Logged In",qPi="Warning: Your session is about to expire",KPi=":count Hours",GPi="1 Day",YPi=":count Days",QPi="Web Session Timeout",XPi="Security Settings",ZPi="Resend Email",JPi="Please confirm your email address",eOi="FreshBooks",tOi="Invoice2go",nOi="Invoicely",iOi="Wave Accounting",rOi="Zoho",sOi="Accounting",oOi="Please provide all CSVs.",aOi="Let's continue by authenticating.",lOi="API secret",cOi="You can find API_SECRET in the .env file or Invoice Ninja v5. If property is missing, leave field blank.",uOi="Your discount will be applied on the checkout.",dOi="Use last email",hOi="Activate Company",fOi="Enable emails, recurring invoices and notifications",pOi="An error occurred, please try again",gOi="Please first set a password",mOi="Warning: Changing your phone number will disable 2FA",_Oi="Help Translate",vOi="Please select a country",bOi="Successfully disabled 2FA",yOi="Successfully connected account",COi="Successfully disconnected account",wOi="Delivered",xOi="Spam",SOi="View Docs",EOi="Please provide a mobile phone number to enable two factor authentication",kOi="Send SMS",TOi="SMS Code",IOi="Connect Google",LOi="Disconnect Google",AOi="Disable Two Factor",NOi="Invoice Task Datelog",DOi="Add date details to the invoice line items",ROi="Promo code",POi="Recurring invoice issued to",OOi="Subscription",MOi="New Subscription",jOi="Successfully deleted subscription",FOi="Successfully removed subscription",BOi="Successfully restored subscription",$Oi="Search 1 Subscription",HOi="Search :count Subscriptions",VOi="Subdomain is not available",WOi="Connect Gmail",zOi="Disconnect Gmail",UOi="Successfully connected Gmail",qOi="Successfully disconnected Gmail",KOi="Changes to the codebase may be blocking the update, you can run this command to discard the changes:",GOi="Client ID Number",YOi=":count Minutes",QOi="Password Timeout",XOi="Share Invoice/Credit Counter",ZOi=":user created subscription :subscription",JOi=":user updated subscription :subscription",eMi=":user archived subscription :subscription",tMi=":user deleted subscription :subscription",nMi=":user restored subscription :subscription",iMi="The amount is greater than the invoice balance. You cannot overpay an invoice.",rMi="Click to continue",sMi="The following invoice :invoice was created for client :client for :amount.",oMi="Invoice :invoice was created for :client",aMi="The following quote :invoice was created for client :client for :amount.",lMi="Quote :invoice was created for :client",cMi="The following credit :invoice was created for client :client for :amount.",uMi="Credit :invoice was created for :client",dMi="Maximum companies migrated",hMi="You have reached your maximum number of companies. Delete existing companies to migrate new ones.",fMi="Company already migrated",pMi="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.",gMi=`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.`,mMi="New account",_Mi=":user created recurring invoice :recurring_invoice",vMi=":user updated recurring invoice :recurring_invoice",bMi=":user archived recurring invoice :recurring_invoice",yMi=":user deleted recurring invoice :recurring_invoice",CMi=":user restored recurring invoice :recurring_invoice",wMi="New login detected for your account.",xMi="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",SMi="Contact Details",EMi="Your company backup is ready for download",kMi="Account passwordless login",TMi="Cannot add the same user to the same company",IMi="User exists but cannot be crossed linked to multiple accounts",LMi="ACH verification",AMi="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.",NMi="Login link requested",DMi="There was a request to login using link. If you did not request this, it's safe to ignore it.",RMi="Your invoices are ready for download",PMi="Migration failed",OMi="Looks like something went wrong with the migration for the following company:",MMi="If you have any questions please contact us, we're here to help!",jMi="Quote was approved",FMi="We would like to inform you that quote was approved.",BMi="Error importing :company",$Mi="There was an error importing the company data, the error message was:",HMi="Due Date",VMi="Amount in pennies,pence or cents. ie for $0.10 please enter 10",WMi="Default Payment Method",zMi="Make this your preferred way of paying.",UMi="This is your preferred way of paying.",qMi="Auto Bill Disabled",KMi="Select a payment method:",GMi="Log in without password",YMi="Email me when an invoice is <b>sent</b>",QMi="One time purchases",XMi="Recurring purchases",ZMi="You might be interested in the following",JMi='Only quotes with "Sent" status can be approved. Expired quotes cannot be approved.',e4i="No quotes available for download.",t4i="Copyright",n4i=":user created :created_user at :time",i4i="Company deleted",r4i="Company [ :company ] was deleted by :user",s4i="Back to :url",o4i="Connect your Stripe Account",a4i="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!",l4i="Account email quota exceeded.",c4i="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.",u4i="Opt in or out of having this invoice automatically charged.",d4i="Arabic",h4i="Persian",f4i="Latvian",p4i="Expiry date",g4i="Card holder name",m4i="Recurring Quote number :number already taken",_4i="Account type",v4i="Locality",b4i="Checking",y4i="Savings",C4i="Unable to verify payment method.",w4i="Gateway configuration error. Please check your credentials.",x4i="My Documents",S4i="This payment method cannot be preauthorized.",E4i="KBC/CBC",k4i="Bancontact",T4i="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.",I4i="iDEAL",L4i="Bank Account Holder",A4i="All-in-one checkout",N4i="Przelewy24",D4i="I declare that I have familiarized myself with the regulations and information obligation of the Przelewy24 service.",R4i="GiroPay",P4i="By entering your Customer information (such as name, sort code and account number) you (the Customer) agree that this information is given voluntarily.",O4i="Klarna",M4i="EPS",j4i="BECS Direct Debit",F4i="BACS Direct Debit",B4i="BACS Direct Debit",$4i="Please add a payment method first, before trying to pay.",H4i='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.',V4i="You need to accept the terms before proceeding.",W4i="Direct Debit",z4i="Clone to Expense",U4i="Checkout",q4i="ACSS Debit",K4i="Invalid amount. Number/Decimal values only.",G4i="Payment for Invoice :invoice for amount :amount failed.",Y4i="Google Pay, Apple Pay, Microsoft Pay",Q4i=`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>`,X4i="Payment mandate is not ready. Please try again later.",Z4i="Instant Bank Pay",J4i="iDEAL",e3i="Przelewy24",t3i="GiroPay",n3i="EPS",i3i="Bancontact",r3i="BECS",s3i="ACSS",o3i="Gross Line Total",a3i="Slovak",l3i="Normal",c3i="Large",u3i="Extra Large",d3i="Show PDF Preview",h3i="Display PDF preview while editing invoices",f3i="Print PDF",p3i="Remind Me",g3i="Instant Bank Pay",m3i="Click Selected",_3i="Hide Preview",v3i="Edit Record",b3i="The credit amount can not be more than the invoice amount",y3i="Please set an account password",C3i="We recommend using the desktop app for the best performance",w3i="We recommend using the mobile app for the best performance",x3i="Successfully disconnected gateway",S3i="Disconnect",E3i="Add to Invoices",k3i="Download",T3i="Save data locally to enable the app to start faster, disabling may improve performance in large accounts",I3i="Persist UI",L3i="Save UI state locally to enable the app to start at the last location, disabling may improve performance",A3i="Client Postal Code",N3i="Client VAT Number",D3i="Has Tasks",R3i="Registration",P3i="Please authorize Stripe to accept online payments.",O3i="Update all records",M3i="Set Default Company",j3i="Successfully updated company",F3i="KBC",B3i="Help us improve by telling us why (optional)",$3i="Webhook Success",H3i="Tasks must all belong to the same client",V3i="Expenses must all belong to the same client",W3i="App",z3i="For the best performance download the :app app",U3i="Email Invoice",q3i="Email Quote",K3i="Email Credit",G3i="Successfully removed recurring expense",Y3i="Search Recurring Expense",Q3i="Search Recurring Expenses",X3i="Last Sent Date",Z3i="Include Drafts",J3i="Include draft records in reports",e5i="Is Invoiced",t5i="Manage Plan",n5i="Persist Data",i5i="Customer Count",r5i="Verify Customers",s5i="Google Analytics Tracking ID",o5i="Decimal Comma",a5i="Use comma as decimal place in forms",l5i="Select Method",c5i="Select Platform",u5i="Please use the web app to connect to Gmail",d5i="Item tax rates are disabled",h5i="Enable Markdown",f5i="Convert markdown to HTML on the PDF",p5i="Add Second Contact",g5i="Previous Page",m5i="Next Page",_5i="Export Colors",v5i="Import Colors",b5i="Clear All",y5i="Contrast",C5i="Custom Colors",w5i="Colors",x5i="Sidebar Active Background Color",S5i="Sidebar Active Font Color",E5i="Sidebar Inactive Background Color",k5i="Sidebar Inactive Font Color",T5i="Table Alternate Row Background Color",I5i="Invoice Header Background Color",L5i="Invoice Header Font Color",A5i="Review App",N5i="Check Status",D5i="Free Trial",R5i="All accounts receive a two week trial of the Pro plan, once the trial ends your account will automatically change to the free plan.",P5i="The Pro plan trial ends in :count days, click to upgrade.",O5i="Today is the last day of the Pro plan trial, click to upgrade.",M5i="Change Email",j5i="Optionally configure a separate client portal domain",F5i="Tasks Shown in Portal",B5i="Uninvoiced",$5i="The subdomain is used in the client portal to personalize links to match your brand. ie, https://your-brand.invoicing.co",H5i="Send Time",V5i="Import Settings",W5i="Please provide the JSON file",z5i="Please select to import the settings and/or data",U5i="JSON",q5i="No payment types enabled",K5i="Please wait for the data to finish loading",G5i="Net Total",Y5i="Has Taxes",Q5i="Import Customers",X5i="Successfully started importing customers",Z5i="Successful Login",J5i="Failed Login",eji="Once the file is ready you'll receive an email with a download link",tji="Include Deleted Clients",nji="Load records belonging to deleted clients",iji="Step 1: Sign In",rji="Step 2: Authorize",sji="Account ID",oji="The migration has not yet completed",aji="Show Task End Date",lji="Enable specifying the task end date",cji="Gateway Setup",uji="Preview Sidebar",dji="Years Data Shown",hji="Successfully ended all sessions",fji="End All Sessions",pji="1 Session",gji=":count Sessions",mji="Invoice Created",_ji="Quote Created",vji="Credit Created",bji="Enterprise",yji="Invoice Item",Cji="Quote Item",wji="Order",xji="Search Kanban",Sji="Search Kanban",Eji="Move Top",kji="Move Up",Tji="Move Down",Iji="Move Bottom",Lji="Error: the custom email must include a :body variable",Aji="Make sure to include a :body variable",Nji="View Date Formats",Dji="Is Viewed",Rji="Letter",Pji="Legal",Oji="Page Layout",Mji="Portrait",jji="Landscape",Fji="The account owner can upgrade to a paid plan to enable the advanced advanced settings",Bji="Upgrade to a paid plan to enable the advanced settings",$ji="Invoice Payment Terms",Hji="Quote Valid Until",Vji="No Headers",Wji="Add Header",zji="Remove Header",Uji="Return URL",qji="REST Method",Kji="Header Key",Gji="Header Value",Yji="Recurring Products",Qji="Promo Discount",Xji="Allow Cancellation",Zji="Per Seat Enabled",Jji="Max Seats Limit",eFi="Trial Enabled",tFi="Trial Duration",nFi="Allow Query Overrides",iFi="Allow Plan Changes",rFi="Plan Map",sFi="Refund Period",oFi="Webhook Configuration",aFi="Purchase Page",lFi="Email Bounced",cFi="Spam Complaint",uFi="Email Delivery",dFi="Webhook Response",hFi="PDF Response",fFi="Authentication Failure",pFi="PDF Failed",gFi="PDF Success",mFi="Modified",_Fi="HTML Mode",vFi="Preview updates faster but is less accurate",bFi="Status Color Theme",yFi="Load Color Theme",CFi="Estonian",wFi="Successfully marked credit as paid",xFi="Successfully marked credits as paid",SFi="Data loading - please wait for it to complete",EFi="Data saving - please wait for it to complete",kFi="Note: changes made here are only previewed, they must be applied in the tabs above to be saved",TFi="Remaining",IFi="Invoice Paid",LFi=":user created recurring expense :recurring_expense",AFi=":user updated recurring expense :recurring_expense",NFi=":user archived recurring expense :recurring_expense",DFi=":user deleted recurring expense :recurring_expense",RFi=":user restored recurring expense :recurring_expense",PFi="FPX",OFi="To view the :entity you need to set a password.",MFi="Unsubscribe",jFi="Unsubscribed",FFi="You have been removed from notifications for this document",BFi="Client Shipping State",$Fi="Client Shipping City",HFi="Client Shipping Postal Code",VFi="Client Shipping Country",WFi="Load PDF",zFi="Start Free Trial",UFi="Start your FREE 14 day trial of the Pro Plan",qFi="Due on Receipt",KFi="Is Paid",GFi="Paid",YFi="Id",QFi="Convert To",XFi="Client Currency",ZFi="Company Currency",JFi="To prevent spam we require upgrading to a paid account to customize the email",e6i="Upgrade your plan to add companies",t6i="The file has been saved in the downloads folder",n6i="Small",i6i="Your quotes are ready for download",r6i="Your credits are ready for download",s6i="Your documents are ready for download",o6i="Reminder for invoice :number for :balance",a6i="Send with GMail invalid credentials",l6i="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",c6i="Totals Fields",u6i="View Task",d6i="Cancel",h6i="Successfully changed task status",f6i="Change Status",p6i="Enable Touch Events",g6i="Support drag events to scroll",m6i="After Saving",_6i="View Record",v6i="Enable Email Markdown",b6i="Use visual markdown editor for emails",y6i="Enable PDF Markdown",C6i="Note: JSON files generated by the v4 app are not supported",w6i="Release Notes",x6i="Upgrade your plan to view reports",S6i="Successfully started :value tasks",E6i="Successfully stopped :value tasks",k6i="Successfully apporved quote",T6i="Successfully :value approved quotes",I6i="Client Website",L6i="Invalid Time",A6i="Signed in as",N6i="Total results",D6i="Restore gateway",R6i="Archive gateway",P6i="Delete gateway",O6i="Exchange currency",M6i="Tax Amount 1",j6i="Tax Amount 2",F6i="Tax Amount 3",B6i="Update Project",$6i="Auto Archive Cancelled Invoice",H6i="Automatically archive invoices when cancelled",V6i="No invoices found",W6i="Successfully created record",z6i="Auto Archive Paid",U6i="Automatically archive invoices when they are paid.",q6i="Auto Archive Cancelled",K6i="Automatically archive invoices when cancelled.",G6i="Alternate PDF Viewer",Y6i="Improve scrolling over the PDF preview [BETA]",Q6i="Cayman Island Dollar",X6i="Please see attached file to check your report.",Z6i="Left",J6i="Right",e8i="Center",t8i="Page Numbering",n8i="Page Numbering Alignment",i8i="Invoice Sent",r8i="Show Product Description",s8i="Include the description in the product dropdown",o8i="Invoice Items",a8i="Quote Items",l8i="Profit and Loss",c8i="Import Format",u8i="Export Format",d8i="Export Type",h8i="Stop On Unpaid",f8i="Stop creating recurring invoices if the last invoice is unpaid.",p8i="Use Quote Terms",g8i="When converting a quote to an invoice",m8i="Add Country",_8i="Enable Tooltips",v8i="Show tooltips when hovering the mouse",b8i="Error: records belong to more than one client",y8i="Login to an existing account",C8i="Purchase Order",w8i="Purchase Order Number",x8i="Purchase Order #",S8i="Inventory threshold notification for product: :product",E8i="Threshold of :amount has been reached for product: :product",k8i=":user created purchase order :purchase_order",T8i=":user updated purchase order :purchase_order",I8i=":user archived purchase order :purchase_order",L8i=":user deleted purchase order :purchase_order",A8i=":user restored purchase order :purchase_order",N8i=":user emailed purchase order :purchase_order",D8i=":contact viewed purchase order :purchase_order",R8i="New Purchase Order :number from :account",P8i="To view your purchase order for :amount, click the link below.",O8i="View Purchase Order",M8i="Your purchase orders are ready for download",j8i="Purchase Order :invoice was viewed by :client",F8i="The following vendor :client viewed Purchase Order :invoice for :amount.",B8i="Purchase Order Date",$8i="Purchase Orders",H8i="Purchase Order # :purchase_order",V8i="Accepted",W8i=":contact accepted purchase order :purchase_order",z8i="Vendor Information",U8i="Purchase Order :purchase_order was accepted by :vendor",q8i="The following vendor :vendor accepted Purchase Order :purchase_order for :amount.",K8i="Amount received",G8i="Already converted to an expense.",Y8i="Convert to Expense",Q8i="Add to Inventory",X8i="Successfully added purchase order to inventory",Z8i="Successfully added purchase orders to inventory",J8i="Client Document Upload",e7i="Vendor Document Upload",t7i="Enable vendors to upload documents",n7i="Are you enjoying the app?",i7i="Yes, it's great!",r7i="Not so much",s7i="Great to hear! Would you like to rate it?",o7i="Sorry to hear it! Would you like to tell us more?",a7i="Sure, happy to",l7i="No, not now",c7i="Add",u7i="Last Sent Template",d7i="Enable Flexible Search",h7i='Match non-contiguous characters, ie. "ct" matches "cat"',f7i="Vendor Details",p7i="Purchase Order Details",g7i="QR IBAN",m7i="BESR ID",_7i="Clone to PO",v7i="Vendor does not have an email address set",b7i="Send Email",y7i="Successfully marked purchase order as sent",C7i="Successfully marked purchase orders as sent",w7i="Successfully accepted purchase order",x7i="Successfully accepted purchase orders",S7i="Successfully cancelled purchase order",E7i="Successfully cancelled purchase orders",k7i="Please select a vendor",T7i="Purchase Order Total",I7i="Email Purchase Order",L7i="Email Purchase Order",A7i="Successfully disconnected email",N7i="Connect Email",D7i="Disconnect Email",R7i="Please use the web app to connect to Microsoft",P7i="Email Provider",O7i="Connect Microsoft",M7i="Disconnect Microsoft",j7i="Successfully connected Microsoft",F7i="Successfully disconnected Microsoft",B7i="Login with Microsoft",$7i="Sign up with Microsoft",H7i="Successfully queued purchase order to be sent",V7i="Successfully queued purchase orders to be sent",W7i="Change to the React web app",z7i="Purchase Order Design",U7i="Purchase Order Terms",q7i="Purchase Order Footer",K7i="Purchase Order Signature",G7i="Require vendor to provide their signature.",Y7i="New Purchase Order",Q7i="Edit Purchase Order",X7i="Successfully created purchase order",Z7i="Successfully updated purchase order",J7i="Successfully archived purchase order",eBi="Successfully deleted purchase order",tBi="Successfully removed purchase order",nBi="Successfully restored purchase order",iBi="Search Purchase Order",rBi="Search Purchase Orders",sBi="Login URL",oBi="Manual Overpayments",aBi="Support adding an overpayment amount manually on a payment",lBi="Stock Quantity",cBi="Notification Threshold",uBi="Track Inventory",dBi="Display a product stock field and update when invoices are sent",hBi="Stock Notifications",fBi="Send an email when the stock reaches the threshold",pBi="VAT",gBi="View Map",mBi="Set Default Design",_Bi="Purchase Order issued to",vBi="Archive Task Status",bBi="Delete Task Status",yBi="Restore Task Status",CBi="Hebrew",wBi="Price change accepted",xBi="Price change failed with code",SBi="Restore Purchases",EBi="Activate",kBi="Connect Apple",TBi="Disconnect Apple",IBi="Successfully disconnected Apple",LBi="Send Now",ABi="Received",NBi="Successfully converted to expense",DBi="Successfully converted to expenses",RBi="This document has been removed, please contact the vendor for further information",PBi="Document no longer available",OBi="Field",MBi="Period",jBi="Fields Per Row",FBi="Active Invoices",BBi="Outstanding Invoices",$Bi="Completed Payments",HBi="Refunded Payments",VBi="Active Quotes",WBi="Approved Quotes",zBi="Unapproved Quotes",UBi="Logged Tasks",qBi="Invoiced Tasks",KBi="Paid Tasks",GBi="Logged Expenses",YBi="Pending Expenses",QBi="Invoiced Expenses",XBi="Invoice Paid Expenses",ZBi="Vendor Portal",JBi="Send Code",e9i="Save the record to upload documents",t9i="Expense Tax Rates",n9i="Invoice Item Tax Rates",i9i="Successfully verified phone number",r9i="A code has been sent via SMS",s9i="Resend",o9i="Verify",a9i="Please provide a phone number",l9i="Invalid phone number",c9i="Verify Phone Number",u9i="Please verify your phone number to send emails",d9i="Successfully merged clients",h9i="Merge Into",f9i="Note: v5.5 requires PHP 8.1",p9i="Email Purchase Orders",g9i="Email Invoices",m9i="Email Quotes",_9i="Email Credits",v9i="Archive Purchase Order",b9i="Restore Purchase Order",y9i="Delete Purchase Order",C9i="Connect",w9i="Mark Paid Payment Email",x9i="Convert to Project",S9i="Client Email",E9i="Invoice Task Project",k9i="Add the project to the invoice line items",T9i="Bulk Action",I9i="This mobile (cell) phone number is not valid, please enter in E.164 format",L9i="Transaction",A9i="Disable 2FA",N9i="Change Number",D9i="Resend Code",R9i="Base Type",P9i="Category Type",O9i="Transaction",M9i="Print PDF",j9i="Vendor Postal Code",F9i="Preview Location",B9i="Bottom",$9i="Side",H9i="PDF Preview",V9i="Long Press to Select",W9i="Purchase Order Item",z9i="Would you like to rate the app?",U9i="Include Deleted",q9i="Include deleted records in reports",K9i="Due On",G9i="Use Browser PDF Viewer",Y9i="Warning: Prevents interacting with app over the PDF",Q9i="Successfully converted transactions",X9i="Default Category",Z9i="Connect Accounts",J9i="Manage Rules",e$i="Search 1 Category",t$i="Search :count Categories",n$i="Min Amount",i$i="Max Amount",r$i="Successfully converted transaction",s$i="Convert to Payment",o$i="Deposit",a$i="Withdrawal",l$i="Deposits",c$i="Withdrawals",u$i="Matched",d$i="Unmatched",h$i="Create Credit",f$i="Transactions",p$i="New Transaction",g$i="Edit Transaction",m$i="Successfully created transaction",_$i="Successfully updated transaction",v$i="Successfully archived transaction",b$i="Successfully deleted transaction",y$i="Successfully removed transaction",C$i="Successfully restored transaction",w$i="Search Transaction",x$i="Search :count Transactions",S$i="Successfully deleted bank account",E$i="Successfully removed bank account",k$i="Successfully restored bank account",T$i="Search Bank Account",I$i="Search :count Bank Accounts",L$i="A code has been sent via SMS to :number",A$i="Please verify your phone number for 2FA backup",N$i="Enable Applying Payments Later",D$i="Line Item Tax Rates",R$i="Show Tasks in Client Portal",P$i="Quote :invoice has expired for :client",O$i="The following Quote :invoice for client :client and :amount has now expired.",M$i="Auto Sync",j$i="Refresh Accounts",F$i="Upgrade to Enterprise to connect your bank account",B$i="Click here to connect your bank account",$$i="Include tax",H$i="E-mail template body can be changed on",V$i="Insufficient permissions, or task may be locked",W$i="Accrual accounting",z$i="Turn on for accrual reporting, turn off for cash basis reporting.",U$i="Expensed reporting",q$i="Turn on for reporting all expenses, turn off for reporting only paid expenses",K$i="Send an email when an online payment is made",G$i="Send an email when manually entering a payment",Y$i="Send an email when marking an invoice as paid",Q$i="Successfully linked transaction",X$i="Link Payment",Z$i="Link Expense",J$i="Lock Invoiced Tasks",eHi="Prevent tasks from being edited once invoiced",tHi="Require clients to register",nHi="Use Inventory Management",iHi="Require products to be in stock",rHi="Optional Products",sHi="Optional Recurring Products",oHi="Convert",aHi="Successfully queued invoice to be auto-billed",lHi="Successfully queued invoices to be auto-billed",cHi="Operator",uHi="Value",dHi="Is",hHi="Contains",fHi="Starts with",pHi="Is empty",gHi="Add Rule",mHi="Match All Rules",_Hi="All criteria needs to match for the rule to be applied",vHi="Automatically convert matched transactions to expenses",bHi="Rules",yHi="Transaction Rule",CHi="Transaction Rules",wHi="New Transaction Rule",xHi="Edit Transaction Rule",SHi="Successfully created rule",EHi="Successfully updated transaction rule",kHi="Successfully archived transaction rule",THi="Successfully deleted transaction rule",IHi="Successfully removed transaction rule",LHi="Successfully restored transaction rule",AHi="Search Transaction Rule",NHi="Search Transaction Rules",DHi="Delete Bank Account",RHi="Archive Transaction",PHi="Delete Transaction",OHi="We have sent a code to :email enter this code to proceed.",MHi="Your one time passcode code",jHi="Your one time passcode is :code",FHi="Delete Tax Rate",BHi="Restore Tax Rate",$Hi="Select company backup file",HHi="Please upload the .zip file used to create this backup.",VHi="Backup | Restore",WHi="Create company backup",zHi="Backup",UHi="The following purchase_order :purchase_order was created for vendor :vendor for :amount.",qHi="Purchase Order :purchase_order was created for :vendor",KHi="Purchase Order :purchase_order was sent to :vendor",GHi="The following vendor :vendor was emailed Purchase Order :purchase_order for :amount.",YHi="This product is a restricted item, please contact the vendor for further information.",QHi="Product not available.",XHi="Purchase Order Created",ZHi="Purchase Order Sent",JHi="Purchase Order Viewed",eVi="Purchase Order Accepted",tVi="The credit amount can not be greater than the payment amount",nVi="Set an exchange rate when entering a manual payment",iVi="Set an exchange rate when creating an expense",rVi="Matomo URL",sVi="Matomo Id",oVi="Add To Invoice",aVi="Danger Zone",lVi="Import completed",cVi="Your statement from :start_date to :end_date is attached.",uVi="Email queued",dVi="Clone to Recurring Invoice",hVi="Inventory Threshold",fVi="Successfully queued statement to be sent",pVi="Show Email Footer",gVi="Invoice Task Hours",mVi="Add the hours to the invoice line items",_Vi="Auto Bill Standard Invoices",vVi="Auto Bill Recurring Invoices",bVi="Email Alignment",yVi="PDF Preview Location",CVi="Mailgun",wVi="Brevo",xVi="Postmark",SVi="Microsoft",EVi="Click + to create a record",kVi="Last 365 Days",TVi="Import Design",IVi="Successfully imported design",LVi="The design is invalid, the :value section is missing",AVi="Would you like to upload your logo?",NVi="Installed Version",DVi="Notify Vendor When Paid",RVi="Send an email to the vendor when the expense is marked as paid",PVi="Update Payment",OVi="Markup",MVi="Unlock Pro",jVi="Upgrade to a paid plan to create schedules",FVi="Next Run",BVi="All Clients",$Vi="Show Aging Table",HVi="Show Payments Table",VVi="Only Clients with Invoices",WVi="Email Statement",zVi="Once",UVi="Schedules",qVi="New Schedule",KVi="Edit Schedule",GVi="Successfully created schedule",YVi="Successfully updated schedule",QVi="Successfully archived schedule",XVi="Successfully deleted schedule",ZVi="Successfully removed schedule",JVi="Successfully restored schedule",eWi="Search Schedule",tWi="Search Schedules",nWi="Update Product",iWi="Create Purchase Order",rWi="Update Purchase Order",sWi="Sent Invoice",oWi="Sent Quote",aWi="Sent Credit",lWi="Sent Purchase Order",cWi="Image URL",uWi="Max Quantity",dWi="Test URL",hWi="Option is not shown",fWi="Option is shown but not selected",pWi="Option is shown and selected",gWi="Option is not shown",mWi="View All",_Wi="Edit All",vWi="Accept Purchase Order Number",bWi="Enable clients to provide a PO number when approving a quote",yWi="From Email",CWi="Show Preview",wWi="Show Paid Stamp",xWi="Show Shipping Address",SWi="There are no documents in the selected records to download",EWi="Pixels",kWi="Logo Size",TWi="Failed",IWi="Client Contacts",LWi="Sync From",AWi="Invoices: :invoices for :amount for client :client",NWi="Payment with no invoice for amount :amount for client :client",DWi="Click here to see all variables.",RWi="Ship to",PWi="Please transfer into the nominated bank account above.",OWi="Branch Name",MWi="Branch Code",jWi="Bank Name",FWi="Bank Code",BWi="BIC",$Wi="Upgrade or downgrade your current plan.",HWi="Add Logo",VWi="Add Stripe",WWi="Invalid Coupon",zWi="No billable tasks for this project",UWi="Insufficient permissions to perform this action",qWi="Please verify your account to send emails.",KWi="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",GWi="Klarna",YWi="Payable within :payeddue days net until :paydate",QWi="No buyer's reference given",XWi="The invoice needs to be paid online via the provided link",ZWi="Pre Payment",JWi="Number of payments",ezi="The number of times this payment will be made",tzi="Continue until cancelled",nzi="Payment :payment was emailed to :client",izi="Payment :payment was emailed",rzi="Record not found",szi="Minimum Payment Amount",ozi="Client Initiated Payments",azi="Support making a payment in the client portal without an invoice",lzi="Share Invoice/Quote Columns",czi="CC Email",uzi="Payment Balance",dzi="Allow user to access the reports, data is limited to available permissions",hzi="Payment :payment was emailed to :client",fzi="One-Time Products",pzi="Optional One-Time Products",gzi="Required",mzi="Hidden",_zi="Payment Links",vzi="Payment Link",bzi="New Payment Link",yzi="Edit Payment Link",Czi="Successfully created payment link",wzi="Successfully updated payment link",xzi="Successfully archived payment link",Szi="Successfully deleted payment link",Ezi="Successfully removed payment link",kzi="Successfully restored payment link",Tzi="Search 1 Payment Link",Izi="Search :count Payment Links",Lzi="Increase Prices",Azi="Update Prices",Nzi="Successfully queued prices to be increased",Dzi="Successfully queued prices to be updated",Rzi="API Token",Pzi="API Key",Ozi="Endpoint",Mzi="Not Billable",jzi="Allow Billable Task Items",Fzi="Enable configuring which task items are billed",Bzi="Show Task Item Description",$zi="Enable specifying task item descriptions",Hzi="Email Record",Vzi="Invoice Product Columns",Wzi="Quote Product Columns",zzi="Vendors",Uzi="Product Sales",qzi="User sales report for client/s :client from :start_date to :end_date",Kzi="Customer balance report",Gzi="Customer sales report",Yzi="User sales report",Qzi="Aged Receivable Detailed Report",Xzi="Aged Receivable Summary Report",Zzi="Taxable Amount",Jzi="Tax Summary",eUi="OAuth / Mail",tUi="Preferences",nUi="Analytics",iUi="Reduced Rate",rUi="Tax All",sUi="Tax Selected",oUi="version",aUi="Seller Subregion",lUi="Calculate Taxes",cUi="Automatically calculate taxes when saving invoices",uUi="Link Expenses",dUi="Converted Client Balance",hUi="Converted Payment Balance",fUi="Total Hours",pUi="Use +days to set the date in the future",gUi="More information ",mUi="here",_Ui="Show Credits Table",vUi="Payment Manual",bUi="Tax Summary Report",yUi="Tax Category",CUi="Physical Goods",wUi="Digital Products",xUi="Services",SUi="Shipping",EUi="Tax Exempt",kUi="Late fee for invoice :invoice added on :date",TUi="Khmer",IUi="Routing ID",LUi="Enable E-Invoice",AUi="E-Invoice Type",NUi="Reduced Tax",DUi="Override Tax",RUi="Zero Rated",PUi="Reverse Tax",OUi="Successfully updated the tax category",MUi="Successfully updated the tax categories",jUi="Set Tax Category",FUi="Payment Manual",BUi="Expense Payment Type",$Ui="Rename",HUi="Successfully renamed document",VUi="E-Invoice",WUi="Light/Dark Mode",zUi="Activities",UUi="Recent Transactions",qUi="Palestine",KUi="Taiwan",GUi="Duties",YUi="Order Number",QUi="Order",XUi="Total Invoices Outstanding",ZUi="Recent Activity",JUi="Enable auto billing",eqi="Email :count invoices",tqi="Invoice Task Item Description",nqi="Add the item description to the invoice line items",iqi="Next Send Time",rqi="Successfully uploaded certificate",sqi="Certificate set",oqi="Certificate not set",aqi="Passphrase set",lqi="Passphrase not set",cqi="Upload Certificate",uqi="Certificate Passphrase",dqi="Valid VAT Number",hqi="React Notification Links",fqi="Admin emails will contain links to the react application",pqi="Show Task Billable",gqi="Credit Item",mqi="Drop file here",_qi="Files",vqi="Camera",bqi="Gallery",yqi="Project Location",Cqi="Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments",wqi="Hungarian",xqi="Use your phone subscription settings to manage your plan",Sqi="Item Tax3",Eqi="Item Tax Rate 1",kqi="Item Tax Rate 2",Tqi="Item Tax Rate 3",Iqi="Buy Price",Lqi="Macedonia",Aqi="Admin Initiated Payments",Nqi="Support entering a payment in the admin portal without an invoice",Dqi="Paid Date",Rqi="An email will be sent with the PDFs",Pqi="Swazi Lilangeni",Oqi="Income",Mqi="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.",jqi="Vendor Phone",Fqi="Mercado Pago",Bqi="MyBank",$qi="Pay in 4",Hqi="District",Vqi="Region",Wqi="County",zqi="Tax Details",Uqi=":contact made payment :payment for invoice :invoice for :client",qqi=":user entered payment :payment for invoice :invoice for :client",Kqi="Default Payment Type",Gqi="Number precision",Yqi="Controls the number of decimals supported in the interface",Qqi="Tax Exempt",Xqi="Drop files here",Zqi="Upload Files",Jqi="Download E-Invoice",eKi="Download E-Credit",tKi="Download E-Quote",nKi="Intra-community triangular transaction",iKi="Tax-free intra-community delivery",rKi="Please note that this supply is subject to reverse charge",sKi="Nicaraguan Córdoba",oKi="Image",aKi="Other",lKi="Linked To",cKi="The file has been saved in :path",uKi="Successfully unlinked :count transactions",dKi="Successfully unlinked transaction",hKi="Allow user to access the dashboard, data is limited to available permissions",fKi="Successfully marked credits sent",pKi="Show Document Preview",gKi="Cash accounting",mKi="Click or drop files here",_Ki="Set public",vKi="Set private",bKi="Individual",yKi="Business",CKi="Partnership",wKi="Trust",xKi="Charity",SKi="Government",EKi="Stock quantity",kKi="Vendor Contact",TKi="Unpaid",IKi="Paid",LKi="Note: this feature requires a Zip-Tax API key to lookup US sales tax by address",AKi="Cache Data",NKi="Unknown",DKi="Webhook Failure",RKi="Email Opened",PKi="Email Delivered",OKi="Log",MKi="Classification",jKi="Stock :quantity",FKi="Upcoming",BKi="Client Contact",$Ki="Uncategorized",HKi="Login Notification",VKi="Sends an email notifying that a login has taken place.",WKi="Payment Refund Receipt # :number",zKi="Payment Receipt # :number",UKi="The template will be applied to following:",qKi="Run Template",KKi="Statement Design",GKi="Delivery Note Design",YKi="Payment Receipt Design",QKi="Payment Refund Design",XKi="Add the Chrome extension to manage your tasks",ZKi="Watch Video",JKi="View Extension",eGi="Reactivate Email",tGi="Successfully reactivated email",nGi="Enable using the design as a template",iGi="Quarter",rGi="Item Description",sGi="Task Item",oGi="Record State",aGi="Save files to this folder",lGi="Downloads Folder",cGi="Invoiced Quotes",uGi="Invoice Paid Quotes",dGi="The downloads folder does not exist :value",hGi="User Logged in Notification",fGi="Send an email when logging in from a new location",pGi="Payment Email To All Contacts",gGi="Sends the payment email to all contacts when enabled",mGi="Add Line",_Gi="Expense :expense notification sent to :contact",vGi="Confirmation of payment :amount sent to :vendor",bGi="Payment processed for :amount dated :payment_date. <br>[Transaction Reference: :transaction_reference]",yGi="Receipt",CGi="Charges",wGi="Email Report",xGi="Payment Type Credit",SGi="Payment Type Debit",EGi="Send Emails To",kGi="Primary Contact",TGi="All Contacts",IGi="Insert Below",LGi="Bank account authentication. Selecting your institution to complete the request with your account credentials.",AGi="An error has occurred",NGi="An unknown error has occurred! Reason:",DGi="Invalid Token",RGi="The provided token was invalid. Contact support for help, if this issue persists.",PGi="Missing Credentials",OGi="Invalid or missing credentials for Gocardless Bank Account Data. Contact support for help, if this issue persists.",MGi="Not Available",jGi="Feature unavailable, Enterprise Plan only.",FGi="Invalid Institution",BGi="The provided institution-id is invalid or no longer valid.",$Gi="Invalid Reference",HGi="GoCardless did not provide a valid reference. Please run flow again and contact support, if this issue persists.",VGi="EUA Failure",WGi="An error occurred during End User Agreement creation:",zGi="Invalid Requisition",UGi="GoCardless did not provide a valid reference. Please run flow again and contact support, if this issue persists.",qGi="Not Ready",KGi="You called this site too early. Please finish authorization and refresh this page. Contact support for help, if this issue persists.",GGi="No Accounts selected",YGi="The service has not returned any valid accounts. Consider restarting the flow.",QGi="Restart flow.",XGi="Return to application.",ZGi="Lao",JGi="Lao kip",eYi="Regions: USA, UK, Australia & India",tYi="Regions: Europe & UK",nYi="Select Provider",iYi="Requisition expired, please reauthenticate.",rYi="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.",sYi="Participant",oYi="Participant name",aYi="Client unsubscribed from emails.",lYi="Client :client has unsubscribed from your e-mails. The client needs to consent to receive future emails from you.",cYi="Resubscribe",uYi="Subscribe",dYi="You are currently subscribed and will continue to receive email communications.",hYi="You are currently not subscribed, and therefore, will not receive emails at this time.",fYi="We were unable to deliver Purchase Order :invoice to :contact. <br><br> :error",pYi="Unable to deliver Purchase Order :invoice",gYi="Display HTML Version When Viewing On Mobile",mYi="For improved visualization, displays a HTML version of the invoice/quote when viewing on mobile.",_Yi="Please select an invoice or credit",vYi="Mobile Version",bYi="Venmo",yYi="MyBank",CYi="Pay Later",wYi="Local Domain",xYi="Verify Peer",SYi="Note: connecting an account requires a GoCardless/Nordigen API key",EYi="Accounts Receivable Detailed",kYi="Accounts Receivable Summary",TYi="Client Sales",IYi="User Sales",LYi="iFrame URL",AYi="User unsubscribed from emails :link",NYi="Out of stock",DYi=`Component ":step" requires at least one of it's dependencies (":dependencies") in the list.`,RYi='Component ":step" depends on ":dependency". Make component(s) order is correct.',PYi="You must include at least one of authentication methods.",OYi="Cart",MYi="Methods",jYi="Required fields form",FYi="Add step",BYi="Steps",$Yi="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.",HYi="Other steps",VYi="Use Available Payments",WYi="Successfully sent email",zYi="Gateway Type",UYi="Would you like to save this import mapping as a template for future use?",qYi="Save Template Mapping",KYi="Checkout is enabled only for existing customers. Please login with existing account to checkout.",GYi="Checkout is enabled only for new customers. Please register a new account to checkout.",YYi="Auto bill standard invoices on the due date",QYi="Auto bill on send date OR due date (recurring invoices)",XYi="Apply any credit balances to payments prior to charging a payment method",ZYi="Use unapplied payments",JYi="Apply any payment balances prior to charging a payment method",eQi="The number of days after the invoice date that payment is due",tQi="The default payment type to be used for payments",nQi="The number of days that the quote is valid for",iQi="The default expense payment type to be used",rQi="Pay in 4",sQi="Payment Provider",oQi="Set your email as the sending user",aQi="Purchase Order Items",lQi="No data found in this CSV file",cQi="Accept Payments Online",uQi="View all payment gateways",dQi="Product cost",hQi="Duration in words",fQi="Upcoming Recurring Invoices",pQi="Shipping Country",gQi="Show table footer",mQi="Displays the totals in the footer of the table",_Qi="Total Invoices",vQi="Add to group",bQi="Check Credentials",yQi="Credentials are valid",CQi="E-Quote",wQi="E-Credit",xQi="E-Purchase Order",SQi="E-Quote Type",EQi="Please upgrade to unlock unlimited clients!",kQi="Download E-Purchase Order",TQi="We recommend using the new web app or the desktop app for the best performance",IQi="Rappen Rounding",LQi="Round amount to 5 cents",AQi="Assign group",NQi="Advanced Card Payments",DQi="EHLO domain (optional)",RQi="ie. 25,587,465",PQi="ie. smtp.gmail.com",OQi="Always show required fields form",MQi="Displays the required fields form always at checkout",jQi="Advanced Cards",FQi="Statement sent to :client",BQi="Invoice Net Amount",$Qi="Round To Minutes",HQi="Task Rounding Direction",VQi="Round task times up or down.",WQi="Direction",zQi="Round Up",UQi="Round Down",qQi="Round To Nearest",KQi="The interval to round the task to.",GQi="Successfully updated data",YQi="Bulk Update",QQi="Calculate",XQi="Sum",ZQi="Money",JQi="Web App",eXi="Desktop App",tXi="Disconnected",nXi="Reconnect",iXi="E-Invoice Settings",rXi="Refund of your invoice via BTCPay",sXi="A refund intended for you has been issued. To claim it via BTCPay, please click on this link:",oXi="Mauritanian Ouguiya",aXi="Bhutan Ngultrum",lXi="End Of Month",cXi="Merge E-Invoice and PDF",uXi="New task assignment [Task :task] [ :date ]",dXi="You have been assigned task :task <br><br> Description: :description <br><br> Client: :client",hXi="User :user entered note: :notes",fXi="Reminder: Quote :quote from :company",pXi="Reminder for quote :number for :amount",gXi="First Quote Reminder",mXi="Before the valid until date",_Xi="After the valid until date",vXi="After the quote date",bXi="Remind Quote",yXi="Tax currency is different from invoice currency",CXi="The invoice has already been imported on :date",wXi="Before the valid until",xXi="After the valid until",SXi="Task Assigned Notification",EXi="Send an email when a task is assigned",kXi="Invoices are locked at the end of the month",TXi="Referral URL",IXi="Add Comment",LXi="Successfully saved comment",AXi="Tickets",NXi="Successfully assigned group",DXi="Merge to PDF",RXi="Note: the latest version requires PHP :version",PXi="Automatically expand products table notes",OXi="Automatically expands the notes section within the products table to display more lines.",MXi="Institution Number",jXi="Transit Number",FXi="Personal",BXi="Address Information",$Xi="Enter the Information for the Bank Account",HXi="Account Holder Information",VXi="Enter Information for the Account Holder",WXi="Customer Type",zXi="Process Date",UXi="Forever Free",qXi="Comments Only",KXi="Payment Balance On File",GXi="For more e-invoice settings please navigate :here",YXi="You need to stop the task before adding a new item.",QXi="XML File",XXi="One-Page Checkout",ZXi="Enable the new single page payment flow",JXi="Applies To",eZi="Accept Purchase Order",tZi="Round To Seconds",nZi="Quote :quote reminder 1 sent",iZi="Auto Bill succeeded for invoice :invoice",rZi="Auto Bill failed for invoice :invoice. :notes",sZi="E-Invoice :invoice for :client was sent. :notes",oZi="Payment Failed",aZi="SSL Host Override",lZi="Upload Logo",cZi="Melilla",uZi="Ceuta",dZi="Vietnamese",hZi="Please note that the status of your invoice has been updated. We recommend refreshing the page to view the most current version.",fZi="You’re all caught up! No new notifications.",pZi="How to import data",gZi="Download example file",mZi="Inbound e-mail address",_Zi="The inbound email address which accepts expense documents. ie. expense@invoiceninja.com",vZi="Expense Mailbox",bZi="Enables processing of documents such as receipts for expense reporting",yZi="Allow Company Senders",CZi="Allows users within the company to send expense documents.",wZi="Allow Vendor Senders",xZi="Allows company vendors to send expense documents",SZi="Allow Client Senders",EZi="Allows clients to send expense documents",kZi="Inbound sender allow list",TZi="Comma separated list of emails that should be allowed to send emails for processing",IZi="Inbound sender banned list",LZi="Comma separate list of emails that are disallowed to send emails for processing",AZi="Allow All Senders",NZi="Allow anyone to send an expense email for processing",DZi="Quick Actions",RZi="Logs out all users and requires all active users to reauthenticate.",PZi="Updated Records",OZi="Seller not VAT registered",MZi="No disclosure of sales tax in accordance with § 19 UStG",jZi="Looks like it's your first time using PEPPOL.",FZi="Get Started",BZi="Configure PEPPOL",$Zi="Step",HZi="White-label license required in order to use einvoicing over the PEPPOL network.",VZi="Enterprise plan required in order to use einvoicing over the PEPPOL network.",WZi="Ecredits are required to send and receive einvoices. These are charged on a per document basis.",zZi="Buy E Credits",UZi="PEPPOL successsfully configured.",qZi="Enterprise plan required for PEPPOL. Please upgrade your plan.",KZi="PEPPOL network not yet available for this country.",GZi="Disconnect from the PEPPOL network",YZi="Disconnect from PEPPOL.",QZi="Your VAT number will be withdrawn from the PEPPOL network after disconnecting. You will be unable to send or receive edocuments.",XZi="Time log duration in words",ZZi="Time log duration",JZi="Successfully merged vendors",eJi="Somes taxes are hidden due to current tax settings. :link",tJi="Third Tax",nJi="Are you sure you want to create a negative payment? This cannot be used as a credit or payment.",iJi="Bermudian Dollar",rJi="Central African CFA Franc",sJi="Congolese Franc",oJi="Djiboutian Franc",aJi="Eritrean Nakfa",lJi="Falkland Islands Pound",cJi="Guinean Franc",uJi="Iraqi Dinar",dJi="Lesotho Loti",hJi="Mongolian Tugrik",fJi="Seychellois Rupee",pJi="Solomon Islands Dollar",gJi="Somali Shilling",mJi="South Sudanese Pound",_Ji="Sudanese Pound",vJi="Tajikistani Somoni",bJi="Turkmenistani Manat",yJi="Uzbekistani Som",CJi="Please note that the status of your payment has been updated. We recommend refreshing the page to view the most current version.",wJi="Please note that the status of your credit has been updated. We recommend refreshing the page to view the most current version.",xJi="Credit Updated",SJi="Payment Updated",EJi="Find invoices, clients, and more",kJi="The VAT number is not valid for the selected country. Format should be Country Code followed by number only ie, DE123456789",TJi="Send E-Invoices",IJi="Receive E-Invoices",LJi="PEPPOL token successfully generated.",AJi="Token is used as another step to make sure invoices are sent securely. Unlike white-label licenses, token can be rotated at any point without need to wait on Invoice Ninja support.",NJi="You need to generate a token to continue.",DJi="Generate Token",RJi="Amount of Credits",PJi="Sales above threshold",OJi="You can't change your VAT number or ID number once PEPPOL is set up.",MJi="The full IBAN number",jJi="BIC/Swift code",FJi="The Bank identifer",BJi="Payer Bank Account Number",$Ji="The bank account number of the payer",HJi="BSB / Sort Code",VJi="Bank Branch Code",WJi="Card Type",zJi="ie. VISA, AMEX",UJi="last 4 digits only",qJi="Card Holder Name",KJi="Tokenize",GJi="Tokenize payment method for future use.",YJi="Accept credit card payments using Stripe.",QJi="ACH direct debit. USD payments, instant verification available.",XJi="Alipay allows users in China to pay securely using their mobile wallets.",ZJi="Sofort is a popular European payment method that enables bank transfers in real-time, primarily used in Germany and Austria.",JJi="Apple/Google Pay for users with Apple/Android devices, using saved card information for easy checkout.",eer="SEPA Direct Debit (Single Euro Payments Area).",ter="Bancontact is a widely used payment method in Belgium.",ner="iDEAL is the most popular payment method in the Netherlands.",ier="Giropay is a German payment method that facilitates secure and immediate online bank transfers.",rer="Przelewy24 is a common payment method in Poland.",ser="Stripe Bank Transfers using Stripes virtual bank accounts, available in Japan, UK, USA, Europe and Mexico. Ensure this is enabled in Stripe!",oer="EPS is an Austrian online payment system.",aer="ACSS (Automated Clearing Settlement System) Direct Debit for Canadian bank accounts.",ler="BECS Direct Debit for Australian bank accounts.",cer="Klarna buy now and pay later in installments or on a set schedule.",uer="BACS Direct Debit for UK bank accounts, commonly used for subscription billing.",der="FPX is a popular online payment method in Malaysia.",her="Payment Means",fer="Send E-Invoice",per="Receive E-Invoice",ger="Saved E-Invoice Settings",mer="We'll need your license key for future communication to our services. Make sure to LICENSE_KEY as environment variable.",_er="License not found. Make sure to set LICENSE_KEY as environment variable.",ver="White label license not found.",ber="We'll update your company details with the provided information.",yer="Full client address is required for E-invoicing",Cer="Connected",wer="Email :count quotes",xer="E-Invoice :invoice for :client successfully delivered! :notes",Ser="E-Invoice :invoice for :client failed delivery. :notes",Eer="Routing problem. No recipient/destination found.",ker="Technical delivery problem. Retry not possible",Ter="Cleared by tax authority, sending to receiver",Ier="Account Name",Ler="The name of the account",Aer="E-Expense :expense received from :vendor",Ner="Additional Tax Identifiers",Der="If you are registered for VAT in other regions, you can add your VAT numbers for those regions here.",Rer="Configure",Per="New VAT Number",Oer="Warning! Your credit balance is low.",Mer="Please add credits to your account to avoid interruption of services.",jer="Warning! Your credit balance is empty.",Fer="Please add credits to your account to avoid interruption of services.",Ber="Comment Saved",$er='Either "Send E-Invoice" or "Receive E-Invoice" (or both) must be selected.',Her="Delete identifier",Ver="Deleting this identifier will remove it from the system. Make sure this is the desired action before proceeding.",Wer="Oops! Something went wrong. Contact us at contact@invoiceninja.com for more information.",zer="Your Download is now ready! [ :message ]",Uer="Reminder 1 for Quote :invoice was sent to :client",qer="Custom reminder was sent to :client",Ker="Use System Fonts",Ger="Override the standard fonts with those from the web browser",Yer="Active Tasks",Qer="Enable Notifications",Xer="Enable Public Notifications",Zer="Enable real-time notifications from Invoice Ninja.",Jer="Navigate",etr="This action will enable line item taxes and disable total taxes. Any open invoices may be recalculated with the new settings!",ttr=":user emailed credit :credit for :client to :contact",ntr="No email history found, this feature only available when sending with Postmark/Mailgun.",itr="E-Invoicing",rtr="E-invoicing token not found. Please go to Settings > E-invoice and regenerate token.",str="Regenerate",otr="This item is no longer available",atr="Samoan Tala",ltr="Are you sure you want to create another connection?",ctr="You have reached your client limit. Please upgrade your plan.",utr="Remaining Hours",dtr="Just Now",htr="Yesterday",ftr="Allow Clients To Update Their Profile",ptr="Allow clients to update their profile information from the client portal",gtr="Use Item Notes for HTML View",mtr="Preference the item Description over the item title if displaying the invoice in HTML.",_tr="Project Report",vtr="Unlock Documents After Payment",btr="Allows client access to invoice documents when an invoice has been paid",ytr="Quickbooks",Ctr="Disable Emails",wtr="You are not authorized to send emails",xtr="Prevents a user from sending emails from the system",Str="Add Location",Etr="Updated Location",ktr="Created Location",Ttr="Sync Send Time",Itr="Update all reminders / recurring invoices to use this new send time",Ltr="Edit Location",Atr="Downgrade",Ntr="Downgrade to Free Plan",Dtr="Downgrade to the free plan, note this will remove all paid features from your account.",Rtr="Delete Location",Ptr="This will remove the location from the clients record.",Otr="You can add a card again at any time.",Mtr="Free trial, then",jtr=":days days left",Ftr=":days day trial",Btr="Ninja Pro",$tr="Enterprise",Htr="Premium Business+",Vtr="Unlimited Clients & Invoices",Wtr='Remove "Created by Invoice Ninja"',ztr="Email Invoices via Gmail & Microsoft",Utr="Email Invoices via your custom SMTP",qtr='Branded URL: "YourSite".Invoicing.co',Ktr="11 Professional Invoice Templates",Gtr="Customize Invoice Designs",Ytr="API Integration with 3rd Party Apps",Qtr="Password Protect Client-Side Portal",Xtr="Set Up Auto-Reminder Emails",Ztr="Auto-Attached Invoice PDF to Emails",Jtr="Display Clients E-Signature on Invoices",enr="Enable an 'Approve Terms' Checkbox",tnr="Reports: Invoices, Expenses, P&L, more",nnr="Bulk Email Invoices, Quotes, Credits",inr="Interlink 10 Companies with 1 Login",rnr='Create Unique "Client Group" Settings',snr="Auto Sales Tax Calculation (US States)",onr="Additional Account Users & Permissions",anr="Upload & Attach Files",lnr="Custom Portal Domain",cnr="Bank account sync",unr="Developer Concierge",dnr="Direct Priority Support",hnr="Invoice Design Service",fnr="Feature Request Priority",pnr="Data Migration Assist",gnr="Build Custom Reports",mnr="More than invoicing",_nr="Simple Pricing. Advanced Features.",vnr="Pay year for 10 months + 2 free!",bnr="Pay year for 10 months + 2 free!",ynr="Pro + Enterprise + Premium Business Concierge",Cnr="All free features +",wnr="All pro features +",xnr="All features +",Snr="Upgrade Plan",Enr="Pricing? Let's talk!",knr="Plan Selected",Tnr="Invalid date syntax",Inr="Start and end date are required",Lnr="Project Value",Anr="Invalid CSV data, your import was cancelled.",Nnr="Selected Products",Dnr="You are not authorized to create a company. Only the account owner can create a company.",Rnr="Location Deleted",Pnr="Caribbean Guilder",Onr="Is Shipping",Mnr="Successfully added location",jnr="Send Emails",Fnr="Allow user to send emails",Bnr="Cancel Trial",$nr="This will cancel your trial and remove all paid features from your account.",Hnr="Gateway already exists",Vnr="Account deleted :notes",Wnr="DocuNinja",znr="Pro Rata",Unr="Change DocuNinja Plan",qnr="Your plan will automatically downgrade at the end of the current billing cycle.",Knr="New DocuNinja user limit",Gnr="This will remove all access to your DocuNinja account.",Ynr="Your user limit will automatically be reduced at the end of the current billing cycle.",Qnr="Recurring Invoice Item",Xnr="Disable Recurring Payment Notification",Znr="Successful recurring invoice payment notifications will not be sent.",Jnr="Invoice Outstanding Tasks",eir="Payment Schedule",tir="Time Zone",nir="Tax Names",iir="If enabled, when the schedule runs, auto bill will be attempted for the scheduled amount",rir="Choose Schedule Type",sir="Split Payments",oir="Splits the invoice amount into multiple payments over a period of time. ie 4 payments over 4 months",air="Manually create a custom payment schedule",lir="Create a custom payment schedule, allows creating exact dates and amounts for each schedule",cir="The interval time between each payment",uir="First Payment Date",dir="The date of the first payment",hir="Payment :index of :total for :amount",fir="Payment :key on :date for :amount",pir="Auto Send",gir="Automatically emails the invoice to the client",mir="Include Project Tasks",_ir="Also invoice tasks that are part of a project",vir="Tax Nexus",bir="Tax Period Report",yir="Created by",Cir="The SES topic (optional, only for webhook tracking)",wir="The AWS region, ie us-east-1",xir="SES Secret Key",Sir="SES Access Key ID",Eir="Client :notes merged into :client by :user",kir="Vendor :notes merged into :vendor by :user",Tir="Client :notes purged by :user",Iir="Lifecycle",Lir="Order Columns",Air="Topic ARN",Nir="Catalan",Dir="Afrikaans",Rir="Indonesian",Pir="Replaced",Oir={organization:iLn,name:rLn,website:sLn,work_phone:oLn,address:aLn,address1:lLn,address2:cLn,city:uLn,state:dLn,postal_code:hLn,country_id:fLn,contacts:pLn,first_name:gLn,last_name:mLn,phone:_Ln,email:vLn,additional_info:bLn,payment_terms:yLn,currency_id:CLn,size_id:wLn,industry_id:xLn,private_notes:SLn,invoice_date:ELn,due_date:kLn,invoice:TLn,client:ILn,invoice_number:LLn,invoice_number_short:ALn,po_number:NLn,po_number_short:DLn,frequency_id:RLn,discount:PLn,taxes:OLn,tax:MLn,item:jLn,description:FLn,unit_cost:BLn,quantity:$Ln,line_total:HLn,subtotal:VLn,net_subtotal:WLn,paid_to_date:zLn,balance_due:ULn,invoice_design_id:qLn,terms:KLn,your_invoice:GLn,remove_contact:YLn,add_contact:QLn,create_new_client:XLn,edit_client_details:ZLn,enable:JLn,learn_more:eAn,manage_rates:tAn,note_to_client:nAn,invoice_terms:iAn,save_as_default_terms:rAn,download_pdf:sAn,pay_now:oAn,save_invoice:aAn,clone_invoice:lAn,archive_invoice:cAn,delete_invoice:uAn,email_invoice:dAn,enter_payment:hAn,tax_rates:fAn,rate:pAn,settings:gAn,enable_invoice_tax:mAn,enable_line_item_tax:_An,dashboard:vAn,dashboard_totals_in_all_currencies_help:bAn,clients:yAn,invoices:CAn,payments:wAn,credits:xAn,history:SAn,search:EAn,sign_up:kAn,guest:TAn,company_details:IAn,online_payments:LAn,notifications:AAn,import_export:NAn,done:DAn,save:RAn,create:PAn,upload:OAn,import:"Import",download:MAn,cancel:jAn,close:FAn,provide_email:BAn,powered_by:$An,no_items:HAn,recurring_invoices:VAn,recurring_help:WAn,recurring_quotes:zAn,in_total_revenue:UAn,billed_client:qAn,billed_clients:KAn,active_client:GAn,active_clients:YAn,invoices_past_due:QAn,upcoming_invoices:XAn,average_invoice:ZAn,archive:JAn,delete:"Delete",archive_client:eNn,delete_client:tNn,archive_payment:nNn,delete_payment:iNn,archive_credit:rNn,delete_credit:sNn,show_archived_deleted:oNn,filter:aNn,new_client:lNn,new_invoice:cNn,new_payment:uNn,new_credit:dNn,contact:hNn,date_created:fNn,last_login:pNn,balance:gNn,action:mNn,status:_Nn,invoice_total:vNn,frequency:bNn,range:yNn,start_date:CNn,end_date:wNn,transaction_reference:xNn,method:SNn,payment_amount:ENn,payment_date:kNn,credit_amount:TNn,credit_balance:INn,credit_date:LNn,empty_table:ANn,select:NNn,edit_client:DNn,edit_invoice:RNn,create_invoice:PNn,enter_credit:ONn,last_logged_in:MNn,details:jNn,standing:FNn,credit:BNn,activity:$Nn,date:HNn,message:VNn,adjustment:WNn,are_you_sure:zNn,payment_type_id:UNn,amount:qNn,work_email:KNn,language_id:GNn,timezone_id:YNn,date_format_id:QNn,datetime_format_id:XNn,users:ZNn,localization:JNn,remove_logo:eDn,logo_help:tDn,payment_gateway:nDn,gateway_id:iDn,email_notifications:rDn,email_viewed:sDn,email_paid:oDn,site_updates:aDn,custom_messages:lDn,default_email_footer:cDn,select_file:uDn,first_row_headers:dDn,column:hDn,sample:fDn,import_to:pDn,client_will_create:gDn,clients_will_create:mDn,email_settings:_Dn,client_view_styling:vDn,pdf_email_attachment:bDn,custom_css:yDn,import_clients:CDn,csv_file:wDn,export_clients:xDn,created_client:SDn,created_clients:EDn,updated_settings:kDn,removed_logo:TDn,sent_message:IDn,invoice_error:LDn,limit_clients:ADn,payment_error:NDn,registration_required:DDn,confirmation_required:RDn,updated_client:PDn,archived_client:ODn,archived_clients:MDn,deleted_client:jDn,deleted_clients:FDn,updated_invoice:BDn,created_invoice:$Dn,cloned_invoice:HDn,emailed_invoice:VDn,and_created_client:WDn,archived_invoice:zDn,archived_invoices:UDn,deleted_invoice:qDn,deleted_invoices:KDn,created_payment:GDn,created_payments:YDn,archived_payment:QDn,archived_payments:XDn,deleted_payment:ZDn,deleted_payments:JDn,applied_payment:eRn,created_credit:tRn,archived_credit:nRn,archived_credits:iRn,deleted_credit:rRn,deleted_credits:sRn,imported_file:oRn,updated_vendor:aRn,created_vendor:lRn,archived_vendor:cRn,archived_vendors:uRn,deleted_vendor:dRn,deleted_vendors:hRn,confirmation_subject:fRn,confirmation_header:pRn,confirmation_message:gRn,invoice_subject:mRn,invoice_message:_Rn,payment_subject:vRn,payment_message:bRn,email_salutation:yRn,email_signature:CRn,email_from:wRn,invoice_link_message:xRn,notification_invoice_paid_subject:SRn,notification_invoice_sent_subject:ERn,notification_invoice_viewed_subject:kRn,notification_invoice_paid:TRn,notification_invoice_sent:IRn,notification_invoice_viewed:LRn,stripe_payment_text:ARn,stripe_payment_text_without_invoice:NRn,reset_password:DRn,secure_payment:RRn,card_number:PRn,expiration_month:ORn,expiration_year:MRn,cvv:jRn,logout:FRn,sign_up_to_save:BRn,agree_to_terms:$Rn,terms_of_service:HRn,email_taken:VRn,working:WRn,success:zRn,success_message:URn,erase_data:qRn,password:KRn,pro_plan_product:GRn,unsaved_changes:YRn,custom_fields:QRn,company_fields:XRn,client_fields:ZRn,field_label:JRn,field_value:ePn,edit:tPn,set_name:nPn,view_as_recipient:iPn,product_library:rPn,product:sPn,products:oPn,fill_products:aPn,fill_products_help:lPn,update_products:cPn,update_products_help:uPn,create_product:dPn,edit_product:hPn,archive_product:fPn,updated_product:pPn,created_product:gPn,archived_product:mPn,pro_plan_custom_fields:_Pn,advanced_settings:vPn,pro_plan_advanced_settings:bPn,invoice_design:yPn,specify_colors:CPn,specify_colors_label:wPn,chart_builder:xPn,ninja_email_footer:SPn,go_pro:EPn,quote:kPn,quotes:TPn,quote_number:IPn,quote_number_short:LPn,quote_date:APn,quote_total:NPn,your_quote:DPn,total:RPn,clone:PPn,new_quote:OPn,create_quote:MPn,edit_quote:jPn,archive_quote:FPn,delete_quote:BPn,save_quote:$Pn,email_quote:HPn,clone_quote:VPn,convert_to_invoice:WPn,view_invoice:zPn,view_client:UPn,view_quote:qPn,updated_quote:KPn,created_quote:GPn,cloned_quote:YPn,emailed_quote:QPn,archived_quote:XPn,archived_quotes:ZPn,deleted_quote:JPn,deleted_quotes:eOn,converted_to_invoice:tOn,quote_subject:nOn,quote_message:iOn,quote_link_message:rOn,notification_quote_sent_subject:sOn,notification_quote_viewed_subject:oOn,notification_quote_sent:aOn,notification_quote_viewed:lOn,session_expired:cOn,invoice_fields:uOn,invoice_options:dOn,hide_paid_to_date:hOn,hide_paid_to_date_help:fOn,charge_taxes:pOn,user_management:gOn,add_user:mOn,send_invite:_On,sent_invite:vOn,updated_user:bOn,invitation_message:yOn,register_to_add_user:COn,user_state:wOn,edit_user:xOn,delete_user:SOn,active:EOn,pending:kOn,deleted_user:TOn,confirm_email_invoice:IOn,confirm_email_quote:LOn,confirm_recurring_email_invoice:AOn,confirm_recurring_email_invoice_not_sent:NOn,cancel_account:DOn,cancel_account_message:ROn,go_back:POn,data_visualizations:OOn,sample_data:MOn,hide:jOn,new_version_available:FOn,invoice_settings:BOn,invoice_number_prefix:$On,invoice_number_counter:HOn,quote_number_prefix:VOn,quote_number_counter:WOn,share_invoice_counter:zOn,invoice_issued_to:UOn,invalid_counter:qOn,mark_sent:KOn,more_designs:GOn,more_designs_title:YOn,more_designs_cloud_header:QOn,more_designs_cloud_text:XOn,more_designs_self_host_text:ZOn,buy:JOn,bought_designs:eMn,sent:tMn,vat_number:nMn,payment_title:iMn,payment_cvv:rMn,payment_footer1:sMn,payment_footer2:oMn,id_number:aMn,white_label_link:lMn,white_label_header:cMn,bought_white_label:uMn,white_labeled:dMn,restore:hMn,restore_invoice:fMn,restore_quote:pMn,restore_client:gMn,restore_credit:mMn,restore_payment:_Mn,restored_invoice:vMn,restored_quote:bMn,restored_client:yMn,restored_payment:CMn,restored_credit:wMn,reason_for_canceling:xMn,discount_percent:SMn,discount_amount:EMn,invoice_history:kMn,quote_history:TMn,current_version:IMn,select_version:LMn,view_history:AMn,edit_payment:NMn,updated_payment:DMn,deleted:RMn,restore_user:PMn,restored_user:OMn,show_deleted_users:MMn,email_templates:jMn,invoice_email:FMn,payment_email:BMn,quote_email:$Mn,reset_all:HMn,approve:VMn,token_billing_type_id:WMn,token_billing_1:zMn,token_billing_2:UMn,token_billing_3:qMn,token_billing_4:KMn,token_billing_checkbox:GMn,view_in_gateway:YMn,use_card_on_file:QMn,edit_payment_details:XMn,token_billing:ZMn,token_billing_secure:JMn,support:e4n,contact_information:t4n,"256_encryption":"256-Bit Encryption",amount_due:n4n,billing_address:i4n,billing_method:r4n,order_overview:s4n,match_address:o4n,click_once:a4n,invoice_footer:l4n,save_as_default_footer:c4n,token_management:u4n,tokens:d4n,add_token:h4n,show_deleted_tokens:f4n,deleted_token:p4n,created_token:g4n,updated_token:m4n,edit_token:_4n,delete_token:v4n,token:b4n,add_gateway:y4n,delete_gateway:C4n,edit_gateway:w4n,updated_gateway:x4n,created_gateway:S4n,deleted_gateway:E4n,pay_with_paypal:k4n,pay_with_card:T4n,change_password:I4n,current_password:L4n,new_password:A4n,confirm_password:N4n,password_error_incorrect:D4n,password_error_invalid:R4n,updated_password:P4n,api_tokens:O4n,users_and_tokens:M4n,account_login:j4n,recover_password:F4n,forgot_password:B4n,email_address:$4n,lets_go:H4n,password_recovery:V4n,send_email:W4n,set_password:z4n,converted:U4n,email_approved:q4n,notification_quote_approved_subject:K4n,notification_quote_approved:G4n,resend_confirmation:Y4n,confirmation_resent:Q4n,payment_type_credit_card:X4n,payment_type_paypal:Z4n,payment_type_bitcoin:J4n,payment_type_gocardless:e3n,knowledge_base:t3n,partial:n3n,partial_remaining:i3n,more_fields:r3n,less_fields:s3n,client_name:o3n,pdf_settings:a3n,product_settings:l3n,auto_wrap:c3n,duplicate_post:u3n,view_documentation:d3n,app_title:h3n,app_description:f3n,rows:p3n,www:g3n,logo:m3n,subdomain:_3n,provide_name_or_email:v3n,charts_and_reports:b3n,chart:y3n,report:C3n,group_by:w3n,paid:x3n,enable_report:S3n,enable_chart:E3n,totals:k3n,run:T3n,export:"Export",documentation:I3n,zapier:L3n,recurring:A3n,last_invoice_sent:N3n,processed_updates:D3n,tasks:R3n,new_task:P3n,start_time:O3n,created_task:M3n,updated_task:j3n,edit_task:F3n,clone_task:B3n,archive_task:$3n,restore_task:H3n,delete_task:V3n,stop_task:W3n,time:z3n,start:U3n,stop:q3n,now:K3n,timer:G3n,manual:Y3n,date_and_time:Q3n,second:X3n,seconds:Z3n,minute:J3n,minutes:e5n,hour:t5n,hours:n5n,task_details:i5n,duration:r5n,time_log:s5n,end_time:o5n,end:a5n,invoiced:l5n,logged:c5n,running:u5n,task_error_multiple_clients:d5n,task_error_running:h5n,task_error_invoiced:f5n,restored_task:p5n,archived_task:g5n,archived_tasks:m5n,deleted_task:_5n,deleted_tasks:v5n,create_task:b5n,stopped_task:y5n,invoice_task:C5n,invoice_labels:w5n,prefix:x5n,counter:S5n,payment_type_dwolla:E5n,partial_value:k5n,more_actions:T5n,pro_plan_title:I5n,pro_plan_call_to_action:L5n,pro_plan_feature1:A5n,pro_plan_feature2:N5n,pro_plan_feature3:D5n,pro_plan_feature4:R5n,pro_plan_feature5:P5n,pro_plan_feature6:O5n,pro_plan_feature7:M5n,pro_plan_feature8:j5n,resume:F5n,break_duration:B5n,edit_details:$5n,work:H5n,timezone_unset:V5n,click_here:W5n,email_receipt:z5n,created_payment_emailed_client:U5n,add_company:q5n,untitled:K5n,new_company:G5n,associated_accounts:Y5n,unlinked_account:Q5n,login:X5n,or:Z5n,email_error:J5n,confirm_recurring_timing:ejn,confirm_recurring_timing_not_sent:tjn,unlink_account:njn,unlink:ijn,show_address:rjn,show_address_help:sjn,update_address:ojn,update_address_help:ajn,times:ljn,set_now:cjn,dark_mode:ujn,dark_mode_help:djn,add_to_invoice:hjn,create_new_invoice:fjn,task_errors:pjn,from:gjn,to:mjn,font_size:_jn,primary_color:vjn,secondary_color:bjn,customize_design:yjn,content:Cjn,styles:wjn,defaults:xjn,margins:Sjn,header:Ejn,footer:kjn,custom:Tjn,invoice_to:Ijn,invoice_no:Ljn,quote_no:Ajn,recent_payments:Njn,outstanding:Djn,manage_companies:Rjn,total_revenue:Pjn,current_user:Ojn,new_recurring_invoice:Mjn,recurring_invoice:jjn,new_recurring_quote:Fjn,recurring_quote:Bjn,created_by_invoice:$jn,primary_user:Hjn,help:Vjn,playground:Wjn,support_forum:zjn,invoice_due_date:Ujn,quote_due_date:qjn,valid_until:Kjn,reset_terms:Gjn,reset_footer:Yjn,invoice_sent:Qjn,invoices_sent:Xjn,status_draft:Zjn,status_sent:Jjn,status_viewed:eFn,status_partial:tFn,status_paid:nFn,status_unpaid:iFn,status_all:rFn,show_line_item_tax:sFn,auto_bill:oFn,military_time:aFn,last_sent:lFn,reminder_emails:cFn,quote_reminder_emails:uFn,templates_and_reminders:dFn,subject:hFn,body:fFn,first_reminder:pFn,second_reminder:gFn,third_reminder:mFn,num_days_reminder:_Fn,reminder_subject:vFn,reset:bFn,invoice_not_found:yFn,referral_program:CFn,referral_code:wFn,last_sent_on:xFn,page_expire:SFn,upcoming_quotes:EFn,expired_quotes:kFn,sign_up_using:TFn,invalid_credentials:IFn,show_all_options:LFn,user_details:AFn,oneclick_login:NFn,disable:DFn,invoice_quote_number:RFn,invoice_charges:PFn,notification_invoice_bounced:OFn,notification_invoice_bounced_subject:MFn,notification_quote_bounced:jFn,notification_quote_bounced_subject:FFn,custom_invoice_link:BFn,total_invoiced:$Fn,open_balance:HFn,verify_email:VFn,basic_settings:WFn,pro:zFn,gateways:UFn,next_send_on:qFn,no_longer_running:KFn,general_settings:GFn,customize:YFn,oneclick_login_help:QFn,referral_code_help:XFn,enable_with_stripe:ZFn,tax_settings:JFn,create_tax_rate:e6n,updated_tax_rate:t6n,created_tax_rate:n6n,edit_tax_rate:i6n,archive_tax_rate:r6n,archived_tax_rate:s6n,default_tax_rate_id:o6n,tax_rate:a6n,recurring_hour:l6n,pattern:c6n,pattern_help_title:u6n,pattern_help_1:d6n,pattern_help_2:h6n,pattern_help_3:f6n,see_options:p6n,invoice_counter:g6n,quote_counter:m6n,type:_6n,activity_1:v6n,activity_2:b6n,activity_3:y6n,activity_4:C6n,activity_5:w6n,activity_6:x6n,activity_7:S6n,activity_8:E6n,activity_9:k6n,activity_10:T6n,activity_11:I6n,activity_12:L6n,activity_13:A6n,activity_14:N6n,activity_15:D6n,activity_16:R6n,activity_17:P6n,activity_18:O6n,activity_19:M6n,activity_20:j6n,activity_21:F6n,activity_22:B6n,activity_23:$6n,activity_24:H6n,activity_25:V6n,activity_26:W6n,activity_27:z6n,activity_28:U6n,activity_29:q6n,activity_30:K6n,activity_31:G6n,activity_32:Y6n,activity_33:Q6n,activity_34:X6n,activity_35:Z6n,activity_36:J6n,activity_37:e8n,activity_42:t8n,activity_43:n8n,activity_44:i8n,activity_45:r8n,activity_46:s8n,activity_47:o8n,activity_48:a8n,activity_49:l8n,activity_50:c8n,activity_51:u8n,activity_52:d8n,activity_53:h8n,activity_54:f8n,activity_55:p8n,activity_56:g8n,payment:m8n,system:_8n,signature:v8n,default_messages:b8n,quote_terms:y8n,default_quote_terms:C8n,default_invoice_terms:w8n,default_invoice_footer:x8n,quote_footer:S8n,free:E8n,quote_is_approved:k8n,apply_credit:T8n,system_settings:I8n,archive_token:L8n,archived_token:A8n,archive_user:N8n,archived_user:D8n,archive_account_gateway:R8n,archived_account_gateway:P8n,archive_recurring_invoice:O8n,archived_recurring_invoice:M8n,delete_recurring_invoice:j8n,deleted_recurring_invoice:F8n,restore_recurring_invoice:B8n,restored_recurring_invoice:$8n,archive_recurring_quote:H8n,archived_recurring_quote:V8n,delete_recurring_quote:W8n,deleted_recurring_quote:z8n,restore_recurring_quote:U8n,restored_recurring_quote:q8n,archived:K8n,untitled_account:G8n,before:Y8n,after:Q8n,reset_terms_help:X8n,reset_footer_help:Z8n,export_data:J8n,user:e7n,country:t7n,include:n7n,logo_too_large:i7n,import_freshbooks:r7n,import_data:s7n,source:o7n,csv:a7n,client_file:l7n,invoice_file:c7n,task_file:u7n,no_mapper:d7n,invalid_csv_header:h7n,client_portal:f7n,admin:p7n,disabled:g7n,show_archived_users:m7n,notes:_7n,invoice_will_create:v7n,invoices_will_create:b7n,failed_to_import:y7n,publishable_key:C7n,secret_key:w7n,missing_publishable_key:x7n,email_design:S7n,due_by:E7n,enable_email_markup:k7n,enable_email_markup_help:T7n,template_help_title:I7n,template_help_1:L7n,email_design_id:A7n,email_design_help:N7n,plain:D7n,light:R7n,dark:P7n,industry_help:O7n,subdomain_help:M7n,website_help:j7n,invoice_number_help:F7n,quote_number_help:B7n,custom_client_fields_helps:$7n,custom_account_fields_helps:H7n,custom_invoice_fields_helps:V7n,custom_invoice_charges_helps:W7n,token_expired:z7n,invoice_link:U7n,button_confirmation_message:q7n,confirm:K7n,email_preferences:G7n,created_invoices:Y7n,next_invoice_number:Q7n,next_quote_number:X7n,days_before:Z7n,days_after:J7n,field_due_date:eBn,field_invoice_date:tBn,schedule:nBn,email_designs:iBn,assigned_when_sent:rBn,white_label_purchase_link:sBn,expense:oBn,expenses:aBn,new_expense:lBn,new_vendor:cBn,payment_terms_net:uBn,vendor:dBn,edit_vendor:hBn,archive_vendor:fBn,delete_vendor:pBn,view_vendor:gBn,deleted_expense:mBn,archived_expense:_Bn,deleted_expenses:vBn,archived_expenses:bBn,expense_amount:yBn,expense_balance:CBn,expense_date:wBn,expense_should_be_invoiced:xBn,public_notes:SBn,invoice_amount:EBn,exchange_rate:kBn,yes:TBn,no:IBn,should_be_invoiced:LBn,view_expense:ABn,edit_expense:NBn,archive_expense:DBn,delete_expense:RBn,view_expense_num:PBn,updated_expense:OBn,created_expense:MBn,enter_expense:jBn,view:FBn,restore_expense:BBn,invoice_expense:$Bn,expense_error_multiple_clients:HBn,expense_error_invoiced:VBn,convert_currency:WBn,num_days:zBn,create_payment_term:UBn,edit_payment_terms:qBn,edit_payment_term:KBn,archive_payment_term:GBn,recurring_due_dates:YBn,recurring_due_date_help:QBn,due:XBn,next_due_on:ZBn,use_client_terms:JBn,day_of_month:e9n,last_day_of_month:t9n,day_of_week_after:n9n,sunday:i9n,monday:r9n,tuesday:s9n,wednesday:o9n,thursday:a9n,friday:l9n,saturday:c9n,header_font_id:u9n,body_font_id:d9n,color_font_help:h9n,live_preview:f9n,invalid_mail_config:p9n,invoice_message_button:g9n,quote_message_button:m9n,payment_message_button:_9n,payment_type_direct_debit:v9n,bank_accounts:b9n,add_bank_account:y9n,setup_account:C9n,import_expenses:w9n,bank_id:x9n,integration_type:S9n,updated_bank_account:E9n,edit_bank_account:k9n,archive_bank_account:T9n,archived_bank_account:I9n,created_bank_account:L9n,validate_bank_account:A9n,bank_password_help:N9n,bank_password_warning:D9n,username:R9n,account_number:P9n,account_name:O9n,bank_account_error:M9n,status_approved:j9n,quote_settings:F9n,auto_convert_quote:B9n,auto_convert_quote_help:$9n,validate:H9n,info:V9n,imported_expenses:W9n,iframe_url_help3:z9n,expense_error_multiple_currencies:U9n,expense_error_mismatch_currencies:q9n,trello_roadmap:K9n,header_footer:G9n,first_page:Y9n,all_pages:Q9n,last_page:X9n,all_pages_header:Z9n,all_pages_footer:J9n,invoice_currency:e$n,enable_https:t$n,quote_issued_to:n$n,show_currency_code:i$n,free_year_message:r$n,trial_message:s$n,trial_footer:o$n,trial_footer_last_day:a$n,trial_call_to_action:l$n,trial_success:c$n,overdue:u$n,white_label_text:d$n,user_email_footer:h$n,reset_password_footer:f$n,limit_users:p$n,more_designs_self_host_header:g$n,old_browser:m$n,newer_browser:_$n,white_label_custom_css:v$n,pro_plan_remove_logo:b$n,pro_plan_remove_logo_link:y$n,invitation_status_sent:C$n,invitation_status_opened:w$n,invitation_status_viewed:x$n,email_error_inactive_client:S$n,email_error_inactive_contact:E$n,email_error_inactive_invoice:k$n,email_error_inactive_proposal:T$n,email_error_user_unregistered:I$n,email_error_user_unconfirmed:L$n,email_error_invalid_contact_email:A$n,navigation:N$n,list_invoices:D$n,list_clients:R$n,list_quotes:P$n,list_tasks:O$n,list_expenses:M$n,list_recurring_invoices:j$n,list_payments:F$n,list_credits:B$n,tax_name:$$n,report_settings:H$n,new_user:V$n,new_product:W$n,new_tax_rate:z$n,invoiced_amount:U$n,invoice_item_fields:q$n,custom_invoice_item_fields_help:K$n,recurring_invoice_number:G$n,recurring_invoice_number_prefix_help:Y$n,enable_portal_password:Q$n,enable_portal_password_help:X$n,send_portal_password:Z$n,send_portal_password_help:J$n,expired:eHn,invalid_card_number:tHn,invalid_expiry:nHn,invalid_cvv:iHn,cost:rHn,create_invoice_for_sample:sHn,owner:oHn,administrator:aHn,administrator_help:lHn,user_create_all:cHn,user_view_all:uHn,user_edit_all:dHn,partial_due:hHn,restore_vendor:fHn,restored_vendor:pHn,restored_expense:gHn,permissions:mHn,create_all_help:_Hn,view_all_help:vHn,edit_all_help:bHn,view_payment:yHn,january:CHn,february:wHn,march:xHn,april:SHn,may:EHn,june:kHn,july:THn,august:IHn,september:LHn,october:AHn,november:NHn,december:DHn,documents_header:RHn,email_documents_header:PHn,email_documents_example_1:OHn,email_documents_example_2:MHn,quote_documents:jHn,invoice_documents:FHn,expense_documents:BHn,invoice_embed_documents:$Hn,invoice_embed_documents_help:HHn,document_email_attachment:VHn,ubl_email_attachment:WHn,download_documents:zHn,documents_from_expenses:UHn,dropzone_default_message:qHn,dropzone_default_message_disabled:KHn,dropzone_fallback_message:GHn,dropzone_fallback_text:YHn,dropzone_file_too_big:QHn,dropzone_invalid_file_type:XHn,dropzone_response_error:ZHn,dropzone_cancel_upload:JHn,dropzone_cancel_upload_confirmation:eVn,dropzone_remove_file:tVn,documents:nVn,document_date:iVn,document_size:rVn,enable_client_portal:sVn,enable_client_portal_help:oVn,enable_client_portal_dashboard:aVn,enable_client_portal_dashboard_help:lVn,account_management:cVn,plan_status:uVn,plan_upgrade:dVn,plan_change:hVn,pending_change_to:fVn,plan_changes_to:pVn,plan_term_changes_to:gVn,cancel_plan_change:mVn,plan:_Vn,expires:vVn,renews:bVn,plan_expired:yVn,trial_expired:CVn,never:wVn,plan_free:xVn,plan_pro:SVn,plan_enterprise:EVn,plan_white_label:kVn,plan_free_self_hosted:TVn,plan_trial:IVn,plan_term:LVn,plan_term_monthly:AVn,plan_term_yearly:NVn,plan_term_month:DVn,plan_term_year:RVn,plan_price_monthly:PVn,plan_price_yearly:OVn,updated_plan:MVn,plan_paid:jVn,plan_started:FVn,plan_expires:BVn,white_label_button:$Vn,pro_plan_year_description:HVn,pro_plan_month_description:VVn,enterprise_plan_product:WVn,enterprise_plan_year_description:zVn,enterprise_plan_month_description:UVn,plan_credit_product:qVn,plan_credit_description:KVn,plan_pending_monthly:GVn,plan_refunded:YVn,page_size:QVn,live_preview_disabled:XVn,invoice_number_padding:ZVn,preview:JVn,list_vendors:eWn,add_users_not_supported:tWn,enterprise_plan_features:nWn,return_to_app:iWn,refund_payment:rWn,refund_max:sWn,refund:oWn,are_you_sure_refund:aWn,status_pending:lWn,status_completed:cWn,status_failed:uWn,status_partially_refunded:dWn,status_partially_refunded_amount:hWn,status_refunded:fWn,status_voided:pWn,refunded_payment:gWn,activity_39:mWn,activity_40:_Wn,card_expiration:vWn,card_creditcardother:bWn,card_americanexpress:yWn,card_carteblanche:CWn,card_unionpay:wWn,card_diners:xWn,card_discover:SWn,card_jcb:EWn,card_laser:kWn,card_maestro:TWn,card_mastercard:IWn,card_solo:LWn,card_switch:AWn,card_visacard:NWn,card_ach:DWn,payment_type_stripe:RWn,ach:PWn,enable_ach:OWn,stripe_ach_help:MWn,ach_disabled:jWn,plaid:FWn,client_id:BWn,secret:$Wn,public_key:HWn,plaid_optional:VWn,plaid_environment_help:WWn,other_providers:zWn,country_not_supported:UWn,invalid_routing_number:qWn,invalid_account_number:KWn,account_number_mismatch:GWn,missing_account_holder_type:YWn,missing_account_holder_name:QWn,routing_number:XWn,confirm_account_number:ZWn,individual_account:JWn,company_account:ezn,account_holder_name:tzn,add_account:nzn,payment_methods:izn,complete_verification:rzn,verification_amount1:szn,verification_amount2:ozn,payment_method_verified:azn,verification_failed:lzn,remove_payment_method:czn,confirm_remove_payment_method:uzn,remove:dzn,payment_method_removed:hzn,bank_account_verification_help:fzn,bank_account_verification_next_steps:pzn,unknown_bank:gzn,ach_verification_delay_help:mzn,add_credit_card:_zn,payment_method_added:vzn,use_for_auto_bill:bzn,used_for_auto_bill:yzn,payment_method_set_as_default:Czn,activity_41:wzn,webhook_url:xzn,stripe_webhook_help:Szn,stripe_webhook_help_link_text:Ezn,gocardless_webhook_help_link_text:kzn,payment_method_error:Tzn,notification_invoice_payment_failed_subject:Izn,notification_invoice_payment_failed:Lzn,link_with_plaid:Azn,link_manually:Nzn,secured_by_plaid:Dzn,plaid_linked_status:Rzn,add_payment_method:Pzn,account_holder_type:Ozn,ach_authorization:Mzn,ach_authorization_required:jzn,off:Fzn,opt_in:Bzn,opt_out:$zn,always:Hzn,opted_out:Vzn,opted_in:Wzn,manage_auto_bill:zzn,enabled:Uzn,paypal:qzn,braintree_enable_paypal:Kzn,braintree_paypal_disabled_help:Gzn,braintree_paypal_help:Yzn,braintree_paypal_help_link_text:Qzn,token_billing_braintree_paypal:Xzn,add_paypal_account:Zzn,no_payment_method_specified:Jzn,chart_type:eUn,format:tUn,import_ofx:nUn,ofx_file:iUn,ofx_parse_failed:rUn,wepay:sUn,sign_up_with_wepay:oUn,use_another_provider:aUn,company_name:lUn,wepay_company_name_help:cUn,wepay_description_help:uUn,wepay_tos_agree:dUn,wepay_tos_link_text:hUn,resend_confirmation_email:fUn,manage_account:pUn,action_required:gUn,finish_setup:mUn,created_wepay_confirmation_required:_Un,switch_to_wepay:vUn,switch:"Switch",restore_account_gateway:bUn,restored_account_gateway:yUn,united_states:CUn,canada:wUn,accept_debit_cards:xUn,debit_cards:SUn,warn_start_date_changed:EUn,warn_start_date_changed_not_sent:kUn,original_start_date:TUn,new_start_date:IUn,security:LUn,see_whats_new:AUn,wait_for_upload:NUn,upgrade_for_permissions:DUn,enable_second_tax_rate:RUn,payment_file:PUn,expense_file:OUn,product_file:MUn,import_products:jUn,products_will_create:FUn,product_key:BUn,created_products:$Un,export_help:HUn,selfhost_export_help:VUn,JSON_file:WUn,view_dashboard:zUn,client_session_expired:UUn,client_session_expired_message:qUn,auto_bill_notification:KUn,auto_bill_payment_method_bank_transfer:GUn,auto_bill_payment_method_credit_card:YUn,auto_bill_payment_method_paypal:QUn,auto_bill_notification_placeholder:XUn,payment_settings:ZUn,on_send_date:JUn,on_due_date:eqn,auto_bill_ach_date_help:tqn,warn_change_auto_bill:nqn,bank_account:iqn,payment_processed_through_wepay:rqn,privacy_policy:sqn,ach_email_prompt:oqn,verification_pending:aqn,update_font_cache:lqn,more_options:cqn,credit_card:uqn,bank_transfer:dqn,no_transaction_reference:hqn,use_bank_on_file:fqn,auto_bill_email_message:pqn,bitcoin:gqn,gocardless:mqn,added_on:_qn,failed_remove_payment_method:vqn,gateway_exists:bqn,manual_entry:yqn,start_of_week:Cqn,freq_inactive:wqn,freq_daily:xqn,freq_weekly:Sqn,freq_biweekly:Eqn,freq_two_weeks:kqn,freq_four_weeks:Tqn,freq_monthly:Iqn,freq_three_months:Lqn,freq_four_months:Aqn,freq_six_months:Nqn,freq_annually:Dqn,freq_two_years:Rqn,"payment_type_Apply Credit":"Apply Credit","payment_type_Bank Transfer":"Bank Transfer",payment_type_Cash:Pqn,payment_type_Debit:Oqn,payment_type_ACH:Mqn,"payment_type_Visa Card":"Visa Card",payment_type_MasterCard:jqn,"payment_type_American Express":"American Express","payment_type_Discover Card":"Discover Card","payment_type_Diners Card":"Diners Card",payment_type_EuroCard:Fqn,payment_type_Nova:Bqn,"payment_type_Credit Card Other":"Credit Card Other",payment_type_PayPal:$qn,"payment_type_Google Wallet":"Google Wallet",payment_type_Check:Hqn,"payment_type_Carte Blanche":"Carte Blanche",payment_type_UnionPay:Vqn,payment_type_JCB:Wqn,payment_type_Laser:zqn,payment_type_Maestro:Uqn,payment_type_Solo:qqn,payment_type_Switch:Kqn,payment_type_iZettle:Gqn,payment_type_Swish:Yqn,payment_type_Alipay:Qqn,payment_type_Sofort:Xqn,payment_type_SEPA:Zqn,payment_type_Bitcoin:Jqn,payment_type_GoCardless:eKn,payment_type_Zelle:tKn,country_Afghanistan:nKn,country_Albania:iKn,country_Antarctica:rKn,country_Algeria:sKn,"country_American Samoa":"American Samoa",country_Andorra:oKn,country_Angola:aKn,"country_Antigua and Barbuda":"Antigua and Barbuda",country_Azerbaijan:lKn,country_Argentina:cKn,country_Australia:uKn,country_Austria:dKn,country_Bahamas:hKn,country_Bahrain:fKn,country_Bangladesh:pKn,country_Armenia:gKn,country_Barbados:mKn,country_Belgium:_Kn,country_Bermuda:vKn,country_Bhutan:bKn,"country_Bolivia, Plurinational State of":"Bolivia, Plurinational State of","country_Bosnia and Herzegovina":"Bosnia and Herzegovina",country_Botswana:yKn,"country_Bouvet Island":"Bouvet Island",country_Brazil:CKn,country_Belize:wKn,"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:xKn,country_Myanmar:SKn,country_Burundi:EKn,country_Belarus:kKn,country_Cambodia:TKn,country_Cameroon:IKn,country_Canada:LKn,"country_Cape Verde":"Cape Verde","country_Cayman Islands":"Cayman Islands","country_Central African Republic":"Central African Republic","country_Sri Lanka":"Sri Lanka",country_Chad:AKn,country_Chile:NKn,country_China:DKn,"country_Taiwan, Province of China":"Taiwan, Province of China","country_Christmas Island":"Christmas Island","country_Cocos (Keeling) Islands":"Cocos (Keeling) Islands",country_Colombia:RKn,country_Comoros:PKn,country_Mayotte:OKn,country_Congo:MKn,"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:jKn,country_Cuba:FKn,country_Cyprus:BKn,"country_Czech Republic":"Czech Republic",country_Benin:$Kn,country_Denmark:HKn,country_Dominica:VKn,"country_Dominican Republic":"Dominican Republic",country_Ecuador:WKn,"country_El Salvador":"El Salvador","country_Equatorial Guinea":"Equatorial Guinea",country_Ethiopia:zKn,country_Eritrea:UKn,country_Estonia:qKn,"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:KKn,country_Finland:GKn,"country_Åland Islands":"Åland Islands",country_France:YKn,"country_French Guiana":"French Guiana","country_French Polynesia":"French Polynesia","country_French Southern Territories":"French Southern Territories",country_Djibouti:QKn,country_Gabon:XKn,country_Georgia:ZKn,country_Gambia:JKn,"country_Palestinian Territory, Occupied":"Palestinian Territory, Occupied",country_Germany:eGn,country_Ghana:tGn,country_Gibraltar:nGn,country_Kiribati:iGn,country_Greece:rGn,country_Greenland:sGn,country_Grenada:oGn,country_Guadeloupe:aGn,country_Guam:lGn,country_Guatemala:cGn,country_Guinea:uGn,country_Guyana:dGn,country_Haiti:hGn,"country_Heard Island and McDonald Islands":"Heard Island and McDonald Islands","country_Holy See (Vatican City State)":"Holy See (Vatican City State)",country_Honduras:fGn,"country_Hong Kong":"Hong Kong",country_Hungary:pGn,country_Iceland:gGn,country_India:mGn,country_Indonesia:_Gn,"country_Iran, Islamic Republic of":"Iran, Islamic Republic of",country_Iraq:vGn,country_Ireland:bGn,country_Israel:yGn,country_Italy:CGn,"country_Côte d'Ivoire":"Côte d'Ivoire",country_Jamaica:wGn,country_Japan:xGn,country_Kazakhstan:SGn,country_Jordan:EGn,country_Kenya:kGn,"country_Korea, Democratic People's Republic of":"Korea, Democratic People's Republic of","country_Korea, Republic of":"Korea, Republic of",country_Kuwait:TGn,country_Kyrgyzstan:IGn,"country_Lao People's Democratic Republic":"Lao People's Democratic Republic",country_Lebanon:LGn,country_Lesotho:AGn,country_Latvia:NGn,country_Liberia:DGn,country_Libya:RGn,country_Liechtenstein:PGn,country_Lithuania:OGn,country_Luxembourg:MGn,country_Macao:jGn,country_Madagascar:FGn,country_Malawi:BGn,country_Malaysia:$Gn,country_Maldives:HGn,country_Mali:VGn,country_Malta:WGn,country_Martinique:zGn,country_Mauritania:UGn,country_Mauritius:qGn,country_Mexico:KGn,country_Monaco:GGn,country_Mongolia:YGn,"country_Moldova, Republic of":"Moldova, Republic of",country_Montenegro:QGn,country_Montserrat:XGn,country_Morocco:ZGn,country_Mozambique:JGn,country_Oman:eYn,country_Namibia:tYn,country_Nauru:nYn,country_Nepal:iYn,country_Netherlands:rYn,country_Curaçao:"Curaçao",country_Aruba:sYn,"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:oYn,"country_New Zealand":"New Zealand",country_Nicaragua:aYn,country_Niger:lYn,country_Nigeria:cYn,country_Niue:uYn,"country_Norfolk Island":"Norfolk Island",country_Norway:dYn,"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:hYn,country_Pakistan:fYn,country_Panama:pYn,"country_Papua New Guinea":"Papua New Guinea",country_Paraguay:gYn,country_Peru:mYn,country_Philippines:_Yn,country_Pitcairn:vYn,country_Poland:bYn,country_Portugal:yYn,"country_Guinea-Bissau":"Guinea-Bissau","country_Timor-Leste":"Timor-Leste","country_Puerto Rico":"Puerto Rico",country_Qatar:CYn,country_Réunion:"Réunion",country_Romania:wYn,"country_Russian Federation":"Russian Federation",country_Rwanda:xYn,"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:SYn,"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:EYn,country_Serbia:kYn,country_Seychelles:TYn,"country_Sierra Leone":"Sierra Leone",country_Singapore:IYn,country_Slovakia:LYn,"country_Viet Nam":"Viet Nam",country_Slovenia:AYn,country_Somalia:NYn,"country_South Africa":"South Africa",country_Zimbabwe:DYn,country_Spain:RYn,"country_South Sudan":"South Sudan",country_Sudan:PYn,"country_Western Sahara":"Western Sahara",country_Suriname:OYn,"country_Svalbard and Jan Mayen":"Svalbard and Jan Mayen",country_Swaziland:MYn,country_Sweden:jYn,country_Switzerland:FYn,"country_Syrian Arab Republic":"Syrian Arab Republic",country_Tajikistan:BYn,country_Thailand:$Yn,country_Togo:HYn,country_Tokelau:VYn,country_Tonga:WYn,"country_Trinidad and Tobago":"Trinidad and Tobago","country_United Arab Emirates":"United Arab Emirates",country_Tunisia:zYn,country_Turkey:UYn,country_Turkmenistan:qYn,"country_Turks and Caicos Islands":"Turks and Caicos Islands",country_Tuvalu:KYn,country_Uganda:GYn,country_Ukraine:YYn,"country_Macedonia, the former Yugoslav Republic of":"Macedonia, the former Yugoslav Republic of",country_Egypt:QYn,"country_United Kingdom":"United Kingdom",country_Guernsey:XYn,country_Jersey:ZYn,"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:JYn,country_Uzbekistan:eQn,"country_Venezuela, Bolivarian Republic of":"Venezuela, Bolivarian Republic of","country_Wallis and Futuna":"Wallis and Futuna",country_Samoa:tQn,country_Yemen:nQn,country_Zambia:iQn,"lang_Brazilian Portuguese":"Brazilian Portuguese",lang_Croatian:rQn,lang_Czech:sQn,lang_Danish:oQn,lang_Dutch:aQn,lang_English:lQn,"lang_English - United States":"English",lang_French:cQn,"lang_French - Canada":"French - Canada",lang_German:uQn,lang_Italian:dQn,lang_Japanese:hQn,lang_Lithuanian:fQn,lang_Norwegian:pQn,lang_Polish:gQn,lang_Spanish:mQn,"lang_Spanish - Spain":"Spanish - Spain",lang_Swedish:_Qn,lang_Albanian:vQn,lang_Greek:bQn,"lang_English - United Kingdom":"English - United Kingdom","lang_English - Australia":"English - Australia",lang_Slovenian:yQn,lang_Finnish:CQn,lang_Romanian:wQn,"lang_Turkish - Turkey":"Turkish - Turkey","lang_Portuguese - Brazilian":"Portuguese - Brazilian","lang_Portuguese - Portugal":"Portuguese - Portugal",lang_Thai:xQn,lang_Macedonian:SQn,"lang_Chinese - Taiwan":"Chinese - Taiwan",lang_Serbian:EQn,lang_Bulgarian:kQn,"lang_Russian (Russia)":"Russian (Russia)","industry_Accounting & Legal":"Accounting & Legal",industry_Advertising:TQn,industry_Aerospace:IQn,industry_Agriculture:LQn,industry_Automotive:AQn,"industry_Banking & Finance":"Banking & Finance",industry_Biotechnology:NQn,industry_Broadcasting:DQn,"industry_Business Services":"Business Services","industry_Commodities & Chemicals":"Commodities & Chemicals",industry_Communications:RQn,"industry_Computers & Hightech":"Computers & Hightech",industry_Defense:PQn,industry_Energy:OQn,industry_Entertainment:MQn,industry_Government:jQn,"industry_Healthcare & Life Sciences":"Healthcare & Life Sciences",industry_Insurance:FQn,industry_Manufacturing:BQn,industry_Marketing:$Qn,industry_Media:HQn,"industry_Nonprofit & Higher Ed":"Nonprofit & Higher Ed",industry_Pharmaceuticals:VQn,"industry_Professional Services & Consulting":"Professional Services & Consulting","industry_Real Estate":"Real Estate","industry_Retail & Wholesale":"Retail & Wholesale",industry_Sports:WQn,industry_Transportation:zQn,"industry_Travel & Luxury":"Travel & Luxury",industry_Other:UQn,industry_Photography:qQn,view_client_portal:KQn,view_portal:GQn,vendor_contacts:YQn,all:QQn,selected:XQn,category:ZQn,categories:JQn,new_expense_category:eXn,edit_category:tXn,archive_expense_category:nXn,expense_categories:iXn,list_expense_categories:rXn,updated_expense_category:sXn,created_expense_category:oXn,archived_expense_category:aXn,archived_expense_categories:lXn,restore_expense_category:cXn,restored_expense_category:uXn,apply_taxes:dXn,min_to_max_users:hXn,max_users_reached:fXn,buy_now_buttons:pXn,landing_page:gXn,payment_type:mXn,form:_Xn,link:vXn,fields:bXn,dwolla:yXn,buy_now_buttons_warning:CXn,buy_now_buttons_disabled:wXn,enable_buy_now_buttons_help:xXn,changes_take_effect_immediately:SXn,wepay_account_description:EXn,payment_error_code:kXn,standard_fees_apply:TXn,limit_import_rows:IXn,error_title:LXn,error_contact_text:AXn,no_undo:NXn,no_contact_selected:DXn,no_client_selected:RXn,gateway_config_error:PXn,payment_type_on_file:OXn,invoice_for_client:MXn,intent_not_found:jXn,intent_not_supported:FXn,client_not_found:BXn,not_allowed:$Xn,bot_emailed_invoice:HXn,bot_emailed_notify_viewed:VXn,bot_emailed_notify_paid:WXn,add_product_to_invoice:zXn,not_authorized:UXn,email_not_found:qXn,invalid_code:KXn,list_products:GXn,include_item_taxes_inline:YXn,created_quotes:QXn,warning:XXn,"self-update":"Update",update_invoiceninja_title:ZXn,update_invoiceninja_warning:JXn,update_invoiceninja_available:eZn,update_invoiceninja_unavailable:tZn,update_invoiceninja_update_start:nZn,update_invoiceninja_download_start:iZn,create_new:rZn,toggle_navigation:sZn,toggle_history:oZn,unassigned:aZn,task:lZn,contact_name:cZn,city_state_postal:uZn,postal_city:dZn,custom_field:hZn,account_fields:fZn,facebook_and_twitter:pZn,facebook_and_twitter_help:gZn,reseller_text:mZn,unnamed_client:_Zn,day:vZn,week:bZn,month:yZn,inactive_logout:CZn,reports:wZn,total_profit:xZn,total_expenses:SZn,quote_to:EZn,limit:kZn,min_limit:TZn,max_limit:IZn,no_limit:LZn,set_limits:AZn,enable_min:NZn,enable_max:DZn,min:RZn,max:PZn,limits_not_met:OZn,date_range:MZn,raw:jZn,raw_html:FZn,update:BZn,invoice_fields_help:$Zn,new_category:HZn,restore_product:VZn,blank:WZn,invoice_save_error:zZn,enable_recurring:UZn,disable_recurring:qZn,text:KZn,expense_will_create:GZn,expenses_will_create:YZn,created_expenses:QZn,translate_app:XZn,expense_category:ZZn,go_ninja_pro:JZn,go_enterprise:eJn,upgrade_for_features:tJn,pay_annually_discount:nJn,pro_upgrade_title:iJn,pro_upgrade_feature1:rJn,pro_upgrade_feature2:sJn,enterprise_upgrade_feature1:oJn,enterprise_upgrade_feature2:aJn,much_more:lJn,all_pro_fetaures:cJn,currency_symbol:uJn,currency_code:dJn,buy_license:hJn,apply_license:fJn,submit:pJn,white_label_license_key:gJn,invalid_white_label_license:mJn,created_by:_Jn,modules:vJn,financial_year_start:bJn,authentication:yJn,checkbox:CJn,invoice_signature:wJn,show_accept_invoice_terms:xJn,show_accept_invoice_terms_help:SJn,show_accept_quote_terms:EJn,show_accept_quote_terms_help:kJn,require_invoice_signature:TJn,require_invoice_signature_help:IJn,require_quote_signature:LJn,require_quote_signature_help:AJn,i_agree:NJn,sign_here:DJn,sign_here_ux_tip:RJn,authorization:PJn,signed:OJn,vendor_name:MJn,entity_state:jJn,client_created_at:FJn,postmark_error:BJn,project:$Jn,projects:HJn,new_project:VJn,edit_project:WJn,archive_project:zJn,list_projects:UJn,updated_project:qJn,created_project:KJn,archived_project:GJn,archived_projects:YJn,restore_project:QJn,restored_project:XJn,delete_project:ZJn,deleted_project:JJn,deleted_projects:eei,delete_expense_category:tei,deleted_expense_category:nei,delete_product:iei,deleted_product:rei,deleted_products:sei,restored_product:oei,update_credit:aei,updated_credit:lei,edit_credit:cei,realtime_preview:uei,realtime_preview_help:dei,live_preview_help:hei,force_pdfjs_help:fei,force_pdfjs:pei,redirect_url:gei,redirect_url_help:mei,save_draft:_ei,refunded_credit_payment:vei,keyboard_shortcuts:bei,toggle_menu:yei,"new_...":"New ...","list_...":"List ...",created_at:Cei,contact_us:wei,user_guide:xei,promo_message:Sei,discount_message:Eei,mark_paid:kei,marked_sent_invoice:Tei,marked_sent_invoices:Iei,invoice_name:Lei,product_will_create:Aei,contact_us_response:Nei,last_7_days:Dei,last_30_days:Rei,this_month:Pei,last_month:Oei,current_quarter:Mei,last_quarter:jei,last_year:Fei,all_time:Bei,custom_range:$ei,url:Hei,debug:Vei,https:Wei,require:zei,license_expiring:Uei,security_confirmation:qei,white_label_expired:Kei,renew_license:Gei,iphone_app_message:Yei,iphone_app:Qei,android_app:Xei,logged_in:Zei,switch_to_primary:Jei,inclusive:eti,exclusive:tti,postal_city_state:nti,phantomjs_help:iti,phantomjs_local:rti,client_number:sti,client_number_help:oti,next_client_number:ati,generated_numbers:lti,notes_reminder1:cti,notes_reminder2:uti,notes_reminder3:dti,notes_reminder4:hti,bcc_email:fti,tax_quote:pti,tax_invoice:gti,emailed_invoices:mti,emailed_quotes:_ti,website_url:vti,domain:bti,domain_help:yti,domain_help_website:Cti,import_invoices:wti,new_report:xti,edit_report:Sti,columns:Eti,filters:kti,sort_by:Tti,draft:Iti,unpaid:Lti,aging:Ati,age:Nti,days:Dti,age_group_0:Rti,age_group_30:Pti,age_group_60:Oti,age_group_90:Mti,age_group_120:jti,invoice_details:Fti,qty:Bti,profit_and_loss:$ti,revenue:Hti,profit:Vti,group_when_sorted:Wti,group_dates_by:zti,year:Uti,view_statement:qti,statement:Kti,statement_date:Gti,mark_active:Yti,send_automatically:Qti,initial_email:Xti,invoice_not_emailed:Zti,quote_not_emailed:Jti,sent_by:eni,recipients:tni,save_as_default:nni,start_of_week_help:ini,financial_year_start_help:rni,reports_help:sni,this_year:oni,ninja_tagline:ani,login_or_existing:lni,sign_up_now:cni,not_a_member_yet:uni,login_create_an_account:dni,invoice_from:hni,full_name:fni,month_year:pni,valid_thru:gni,product_fields:mni,custom_product_fields_help:_ni,freq_two_months:vni,freq_yearly:bni,profile:yni,industry_Construction:Cni,your_statement:wni,statement_issued_to:xni,statement_to:Sni,customize_options:Eni,created_payment_term:kni,updated_payment_term:Tni,archived_payment_term:Ini,resend_invite:Lni,credit_created_by:Ani,created_payment_and_credit:Nni,created_payment_and_credit_emailed_client:Dni,create_project:Rni,create_vendor:Pni,create_expense_category:Oni,pro_plan_reports:Mni,mark_ready:jni,limits:Fni,fees:Bni,fee:$ni,set_limits_fees:Hni,fees_tax_help:Vni,fees_sample:Wni,discount_sample:zni,no_fees:Uni,gateway_fees_disclaimer:qni,percent:Kni,location:Gni,line_item:Yni,surcharge:Qni,location_first_surcharge:Xni,location_second_surcharge:Zni,location_line_item:Jni,online_payment_surcharge:eii,gateway_fees:tii,fees_disabled:nii,gateway_fees_help:iii,gateway:rii,gateway_fee_change_warning:sii,fees_surcharge_help:oii,label_and_taxes:aii,billable:lii,logo_warning_too_large:cii,logo_warning_fileinfo:uii,logo_warning_invalid:dii,error_refresh_page:hii,data:fii,imported_settings:pii,reset_counter:gii,next_reset:mii,reset_counter_help:_ii,auto_bill_failed:vii,online_payment_discount:bii,created_new_company:yii,fees_disabled_for_gateway:Cii,logout_and_delete:wii,tax_rate_type_help:xii,credit_note:Sii,credit_issued_to:Eii,credit_to:kii,your_credit:Tii,credit_number:Iii,create_credit_note:Lii,menu:Aii,error_incorrect_gateway_ids:Nii,purge_data:Dii,delete_data:Rii,purge_data_help:Pii,cancel_account_help:Oii,purge_successful:Mii,forbidden:jii,purge_data_message:Fii,contact_phone:Bii,contact_email:$ii,reply_to_email:Hii,reply_to_email_help:Vii,bcc_email_help:Wii,import_complete:zii,confirm_account_to_import:Uii,import_started:qii,payment_type_Venmo:Kii,"payment_type_Money Order":"Money Order",archived_products:Gii,recommend_on:Yii,recommend_off:Qii,notes_auto_billed:Xii,surcharge_label:Zii,contact_fields:Jii,custom_contact_fields_help:eri,datatable_info:tri,credit_total:nri,mark_billable:iri,billed:rri,company_variables:sri,client_variables:ori,invoice_variables:ari,navigation_variables:lri,custom_variables:cri,invalid_file:uri,add_documents_to_invoice:dri,mark_expense_paid:hri,white_label_license_error:fri,plan_price:pri,wrong_confirmation:gri,oauth_taken:mri,emailed_payment:_ri,email_payment:vri,invoiceplane_import:bri,duplicate_expense_warning:yri,expense_link:Cri,resume_task:wri,resumed_task:xri,quote_design:Sri,default_design:Eri,custom_design1:kri,custom_design2:Tri,custom_design3:Iri,empty:Lri,load_design:Ari,accepted_card_logos:Nri,google_analytics:Dri,analytics_key:Rri,analytics_key_help:Pri,start_date_required:Ori,application_settings:Mri,database_connection:jri,driver:Fri,host:Bri,database:$ri,test_connection:Hri,from_name:Vri,from_address:Wri,port:zri,encryption:Uri,mailgun_domain:qri,mailgun_private_key:Kri,brevo_domain:Gri,brevo_private_key:Yri,send_test_email:Qri,select_label:Xri,label:Zri,service:Jri,update_payment_details:esi,updated_payment_details:tsi,update_credit_card:nsi,recurring_expenses:isi,recurring_expense:rsi,new_recurring_expense:ssi,edit_recurring_expense:osi,archive_recurring_expense:asi,list_recurring_expense:lsi,updated_recurring_expense:csi,created_recurring_expense:usi,archived_recurring_expense:dsi,restore_recurring_expense:hsi,restored_recurring_expense:fsi,delete_recurring_expense:psi,deleted_recurring_expense:gsi,view_recurring_expense:msi,taxes_and_fees:_si,import_failed:vsi,recurring_prefix:bsi,options:ysi,credit_number_help:Csi,next_credit_number:wsi,padding_help:xsi,import_warning_invalid_date:Ssi,product_notes:Esi,app_version:ksi,ofx_version:Tsi,charge_late_fee:Isi,late_fee_amount:Lsi,late_fee_percent:Asi,late_fee_added:Nsi,download_invoice:Dsi,download_quote:Rsi,invoices_are_attached:Psi,downloaded_invoice:Osi,downloaded_quote:Msi,downloaded_invoices:jsi,downloaded_quotes:Fsi,clone_expense:Bsi,default_documents:$si,send_email_to_client:Hsi,refund_subject:Vsi,refund_body:Wsi,currency_us_dollar:zsi,currency_british_pound:Usi,currency_euro:qsi,currency_south_african_rand:Ksi,currency_danish_krone:Gsi,currency_israeli_shekel:Ysi,currency_swedish_krona:Qsi,currency_kenyan_shilling:Xsi,currency_canadian_dollar:Zsi,currency_philippine_peso:Jsi,currency_indian_rupee:eoi,currency_australian_dollar:toi,currency_singapore_dollar:noi,currency_norske_kroner:ioi,currency_new_zealand_dollar:roi,currency_vietnamese_dong:soi,currency_swiss_franc:ooi,currency_guatemalan_quetzal:aoi,currency_malaysian_ringgit:loi,currency_brazilian_real:coi,currency_thai_baht:uoi,currency_nigerian_naira:doi,currency_argentine_peso:hoi,currency_bangladeshi_taka:foi,currency_united_arab_emirates_dirham:poi,currency_hong_kong_dollar:goi,currency_indonesian_rupiah:moi,currency_mexican_peso:_oi,currency_egyptian_pound:voi,currency_colombian_peso:boi,currency_west_african_franc:yoi,currency_chinese_renminbi:Coi,currency_rwandan_franc:woi,currency_tanzanian_shilling:xoi,currency_netherlands_antillean_guilder:Soi,currency_trinidad_and_tobago_dollar:Eoi,currency_east_caribbean_dollar:koi,currency_ghanaian_cedi:Toi,currency_bulgarian_lev:Ioi,currency_aruban_florin:Loi,currency_turkish_lira:Aoi,currency_romanian_new_leu:Noi,currency_croatian_kuna:Doi,currency_saudi_riyal:Roi,currency_japanese_yen:Poi,currency_maldivian_rufiyaa:Ooi,currency_costa_rican_colon:Moi,currency_pakistani_rupee:joi,currency_polish_zloty:Foi,currency_sri_lankan_rupee:Boi,currency_czech_koruna:$oi,currency_uruguayan_peso:Hoi,currency_namibian_dollar:Voi,currency_tunisian_dinar:Woi,currency_russian_ruble:zoi,currency_mozambican_metical:Uoi,currency_omani_rial:qoi,currency_ukrainian_hryvnia:Koi,currency_macanese_pataca:Goi,currency_taiwan_new_dollar:Yoi,currency_dominican_peso:Qoi,currency_chilean_peso:Xoi,currency_icelandic_krona:Zoi,currency_papua_new_guinean_kina:Joi,currency_jordanian_dinar:eai,currency_myanmar_kyat:tai,currency_peruvian_sol:nai,currency_botswana_pula:iai,currency_hungarian_forint:rai,currency_ugandan_shilling:sai,currency_barbadian_dollar:oai,currency_brunei_dollar:aai,currency_georgian_lari:lai,currency_qatari_riyal:cai,currency_honduran_lempira:uai,currency_surinamese_dollar:dai,currency_bahraini_dinar:hai,currency_venezuelan_bolivars:fai,currency_south_korean_won:pai,currency_moroccan_dirham:gai,currency_jamaican_dollar:mai,currency_angolan_kwanza:_ai,currency_haitian_gourde:vai,currency_zambian_kwacha:bai,currency_nepalese_rupee:yai,currency_cfp_franc:Cai,currency_mauritian_rupee:wai,currency_cape_verdean_escudo:xai,currency_kuwaiti_dinar:Sai,currency_algerian_dinar:Eai,currency_macedonian_denar:kai,currency_fijian_dollar:Tai,currency_bolivian_boliviano:Iai,currency_albanian_lek:Lai,currency_serbian_dinar:Aai,currency_lebanese_pound:Nai,currency_armenian_dram:Dai,currency_azerbaijan_manat:Rai,currency_bosnia_and_herzegovina_convertible_mark:Pai,currency_belarusian_ruble:Oai,currency_moldovan_leu:Mai,currency_kazakhstani_tenge:jai,currency_gibraltar_pound:Fai,currency_gambia_dalasi:Bai,currency_paraguayan_guarani:$ai,currency_malawi_kwacha:Hai,currency_zimbabwean_dollar:Vai,currency_cambodian_riel:Wai,currency_vanuatu_vatu:zai,currency_cuban_peso:Uai,currency_bz_dollar:qai,currency_libyan_dinar:Kai,currency_silver_troy_ounce:Gai,currency_gold_troy_ounce:Yai,currency_nicaraguan_córdoba:"Nicaraguan Córdoba",currency_malagasy_ariary:Qai,currency_tongan_pa_anga:Xai,review_app_help:Zai,writing_a_review:Jai,tax1:eli,tax2:tli,fee_help:nli,format_export:ili,custom1:rli,custom2:sli,contact_first_name:oli,contact_last_name:ali,contact_custom1:lli,contact_custom2:cli,currency:uli,ofx_help:dli,comments:hli,item_product:fli,item_notes:pli,item_cost:gli,item_quantity:mli,item_tax_rate:_li,item_tax_name:vli,item_tax1:bli,item_tax2:yli,delete_company:Cli,delete_company_help:wli,delete_company_message:xli,applied_discount:Sli,applied_free_year:Eli,contact_us_help:kli,include_errors:Tli,include_errors_help:Ili,recent_errors:Lli,customer:Ali,customers:Nli,created_customer:Dli,created_customers:Rli,purge_details:Pli,deleted_company:Oli,deleted_account:Mli,deleted_company_details:jli,deleted_account_details:Fli,alipay:Bli,sofort:$li,sepa:Hli,name_without_special_characters:Vli,enable_alipay:Wli,enable_sofort:zli,stripe_alipay_help:Uli,calendar:qli,pro_plan_calendar:Kli,what_are_you_working_on:Gli,time_tracker:Yli,refresh:Qli,filter_sort:Xli,no_description:Zli,time_tracker_login:Jli,save_or_discard:eci,discard_changes:tci,tasks_not_enabled:nci,started_task:ici,create_client:rci,download_desktop_app:sci,download_iphone_app:oci,download_android_app:aci,time_tracker_mobile_help:lci,stopped:cci,ascending:uci,descending:dci,sort_field:hci,sort_direction:fci,discard:pci,time_am:gci,time_pm:mci,time_mins:_ci,time_hr:vci,time_hrs:bci,clear:yci,warn_payment_gateway:Cci,task_rate:wci,task_rate_help:xci,past_due:Sci,document:Eci,invoice_or_expense:kci,invoice_pdfs:Tci,enable_sepa:Ici,enable_bitcoin:Lci,iban:Aci,sepa_authorization:Nci,recover_license:Dci,purchase:Rci,recover:Pci,apply:Oci,recover_white_label_header:Mci,apply_white_label_header:jci,videos:Fci,video:Bci,return_to_invoice:$ci,partial_due_date:Hci,task_fields:Vci,product_fields_help:Wci,custom_value1:zci,custom_value2:Uci,enable_two_factor:qci,enable_two_factor_help:Kci,two_factor_setup:Gci,two_factor_setup_help:Yci,one_time_password:Qci,set_phone_for_two_factor:Xci,enabled_two_factor:Zci,add_product:Jci,email_will_be_sent_on:eui,invoice_product:tui,self_host_login:nui,set_self_hoat_url:iui,local_storage_required:rui,your_password_reset_link:sui,subdomain_taken:oui,expense_mailbox_taken:aui,expense_mailbox_invalid:lui,client_login:cui,converted_amount:uui,default:"Default",shipping_address:dui,bllling_address:hui,billing_address1:fui,billing_address2:pui,billing_city:gui,billing_state:mui,billing_postal_code:_ui,billing_country:vui,shipping_address1:bui,shipping_address2:yui,shipping_city:Cui,shipping_state:wui,shipping_postal_code:xui,shipping_country:Sui,classify:Eui,show_shipping_address_help:kui,ship_to_billing_address:Tui,delivery_note:Iui,show_tasks_in_portal:Lui,cancel_schedule:Aui,scheduled_report:Nui,scheduled_report_help:Dui,created_scheduled_report:Rui,deleted_scheduled_report:Pui,scheduled_report_attached:Oui,scheduled_report_error:Mui,invalid_one_time_password:jui,apple_pay:Fui,enable_apple_pay:Bui,requires_subdomain:$ui,subdomain_is_set:Hui,verification_file:Vui,verification_file_missing:Wui,apple_pay_domain:zui,apple_pay_not_supported:Uui,optional_payment_methods:qui,add_subscription:Kui,target_url:Gui,target_url_help:Yui,event:Qui,subscription_event_1:Xui,subscription_event_2:Zui,subscription_event_3:Jui,subscription_event_4:edi,subscription_event_5:tdi,subscription_event_6:ndi,subscription_event_7:idi,subscription_event_8:rdi,subscription_event_9:sdi,subscription_event_10:odi,subscription_event_11:adi,subscription_event_12:ldi,subscription_event_13:cdi,subscription_event_14:udi,subscription_event_15:ddi,subscription_event_16:hdi,subscription_event_17:fdi,subscription_event_18:pdi,subscription_event_19:gdi,subscription_event_20:mdi,subscription_event_21:_di,subscriptions:vdi,updated_subscription:bdi,created_subscription:ydi,edit_subscription:Cdi,archive_subscription:wdi,archived_subscription:xdi,project_error_multiple_clients:Sdi,invoice_project:Edi,module_recurring_invoice:kdi,module_credit:Tdi,module_quote:Idi,module_task:Ldi,module_expense:Adi,module_ticket:Ndi,reminders:Ddi,send_client_reminders:Rdi,can_view_tasks:Pdi,is_not_sent_reminders:Odi,promotion_footer:Mdi,unable_to_delete_primary:jdi,please_register:Fdi,processing_request:Bdi,mcrypt_warning:$di,edit_times:Hdi,inclusive_taxes_help:Vdi,inclusive_taxes_notice:Wdi,inclusive_taxes_warning:zdi,copy_shipping:Udi,copy_billing:qdi,quote_has_expired:Kdi,empty_table_footer:Gdi,do_not_trust:Ydi,trust_for_30_days:Qdi,trust_forever:Xdi,kanban:Zdi,backlog:Jdi,ready_to_do:ehi,in_progress:thi,add_status:nhi,archive_status:ihi,new_status:rhi,convert_products:shi,convert_products_help:ohi,improve_client_portal_link:ahi,budgeted_hours:lhi,progress:chi,view_project:uhi,summary:dhi,endless_reminder:hhi,signature_on_invoice_help:fhi,signature_on_pdf:phi,signature_on_pdf_help:ghi,expired_white_label:mhi,return_to_login:_hi,convert_products_tip:vhi,amount_greater_than_balance:bhi,custom_fields_tip:yhi,client_information:Chi,updated_client_details:whi,auto:xhi,tax_amount:Shi,tax_paid:Ehi,none:khi,proposal_message_button:Thi,proposal:Ihi,proposals:Lhi,list_proposals:Ahi,new_proposal:Nhi,edit_proposal:Dhi,archive_proposal:Rhi,delete_proposal:Phi,created_proposal:Ohi,updated_proposal:Mhi,archived_proposal:jhi,deleted_proposal:Fhi,archived_proposals:Bhi,deleted_proposals:$hi,restored_proposal:Hhi,restore_proposal:Vhi,snippet:Whi,snippets:zhi,proposal_snippet:Uhi,proposal_snippets:qhi,new_proposal_snippet:Khi,edit_proposal_snippet:Ghi,archive_proposal_snippet:Yhi,delete_proposal_snippet:Qhi,created_proposal_snippet:Xhi,updated_proposal_snippet:Zhi,archived_proposal_snippet:Jhi,deleted_proposal_snippet:efi,archived_proposal_snippets:tfi,deleted_proposal_snippets:nfi,restored_proposal_snippet:ifi,restore_proposal_snippet:rfi,template:sfi,templates:ofi,proposal_template:afi,proposal_templates:lfi,new_proposal_template:cfi,edit_proposal_template:ufi,archive_proposal_template:dfi,delete_proposal_template:hfi,created_proposal_template:ffi,updated_proposal_template:pfi,archived_proposal_template:gfi,deleted_proposal_template:mfi,archived_proposal_templates:_fi,deleted_proposal_templates:vfi,restored_proposal_template:bfi,restore_proposal_template:yfi,proposal_category:Cfi,proposal_categories:wfi,new_proposal_category:xfi,edit_proposal_category:Sfi,archive_proposal_category:Efi,delete_proposal_category:kfi,created_proposal_category:Tfi,updated_proposal_category:Ifi,archived_proposal_category:Lfi,deleted_proposal_category:Afi,archived_proposal_categories:Nfi,deleted_proposal_categories:Dfi,restored_proposal_category:Rfi,restore_proposal_category:Pfi,delete_status:Ofi,standard:Mfi,icon:jfi,proposal_not_found:Ffi,create_proposal_category:Bfi,clone_proposal_template:$fi,proposal_email:Hfi,proposal_subject:Vfi,proposal_message:Wfi,emailed_proposal:zfi,load_template:Ufi,no_assets:qfi,add_image:Kfi,select_image:Gfi,upgrade_to_upload_images:Yfi,delete_image:Qfi,delete_image_help:Xfi,amount_variable_help:Zfi,taxes_are_included_help:Jfi,taxes_are_not_included_help:epi,change_requires_purge:tpi,purging:npi,warning_local_refund:ipi,email_address_changed:rpi,email_address_changed_message:spi,test:opi,beta:api,email_history:lpi,loading:cpi,no_messages_found:upi,processing:dpi,reactivate:hpi,reactivated_email:fpi,emails:ppi,opened:gpi,bounced:mpi,total_sent:_pi,total_opened:vpi,total_bounced:bpi,total_spam:ypi,platforms:Cpi,email_clients:wpi,mobile:xpi,desktop:Spi,webmail:Epi,group:kpi,subgroup:Tpi,unset:Ipi,received_new_payment:Lpi,slack_webhook_help:Api,slack_incoming_webhooks:Npi,accept:Dpi,accepted_terms:Rpi,invalid_url:Ppi,workflow_settings:Opi,auto_email_invoice:Mpi,auto_email_invoice_help:jpi,auto_archive_invoice:Fpi,auto_archive_invoice_help:Bpi,auto_archive_quote:$pi,auto_archive_quote_help:Hpi,require_approve_quote:Vpi,require_approve_quote_help:Wpi,allow_approve_expired_quote:zpi,allow_approve_expired_quote_help:Upi,invoice_workflow:qpi,quote_workflow:Kpi,client_must_be_active:Gpi,purge_client:Ypi,purged_client:Qpi,purge_client_warning:Xpi,clone_product:Zpi,item_details:Jpi,send_item_details_help:egi,view_proposal:tgi,view_in_portal:ngi,cookie_message:igi,got_it:rgi,vendor_will_create:sgi,vendors_will_create:ogi,created_vendors:agi,import_vendors:lgi,company:cgi,client_field:ugi,contact_field:dgi,product_field:hgi,task_field:fgi,project_field:pgi,expense_field:ggi,vendor_field:mgi,company_field:_gi,invoice_field:vgi,invoice_surcharge:bgi,custom_task_fields_help:ygi,custom_project_fields_help:Cgi,custom_expense_fields_help:wgi,custom_vendor_fields_help:xgi,messages:Sgi,unpaid_invoice:Egi,paid_invoice:kgi,unapproved_quote:Tgi,unapproved_proposal:Igi,autofills_city_state:Lgi,no_match_found:Agi,password_strength:Ngi,strength_weak:Dgi,strength_good:Rgi,strength_strong:Pgi,mark:Ogi,updated_task_status:Mgi,background_image:jgi,background_image_help:Fgi,proposal_editor:Bgi,background:$gi,guide:Hgi,gateway_fee_item:Vgi,gateway_fee_description:Wgi,gateway_fee_discount_description:zgi,show_payments:Ugi,show_aging:qgi,reference:Kgi,amount_paid:Ggi,send_notifications_for:Ygi,all_invoices:Qgi,my_invoices:Xgi,payment_reference:Zgi,maximum:Jgi,sort:emi,refresh_complete:tmi,please_enter_your_email:nmi,please_enter_your_password:imi,please_enter_your_url:rmi,please_enter_a_product_key:smi,an_error_occurred:omi,overview:ami,copied_to_clipboard:lmi,error:cmi,could_not_launch:umi,additional:dmi,ok:hmi,email_is_invalid:fmi,items:pmi,partial_deposit:gmi,add_item:mmi,total_amount:_mi,pdf:vmi,invoice_status_id:bmi,click_plus_to_add_item:ymi,count_selected:Cmi,dismiss:wmi,please_select_a_date:xmi,please_select_a_client:Smi,language:Emi,updated_at:kmi,please_enter_an_invoice_number:Tmi,please_enter_a_quote_number:Imi,clients_invoices:Lmi,viewed:Ami,approved:Nmi,invoice_status_1:Dmi,invoice_status_2:Rmi,invoice_status_3:Pmi,invoice_status_4:Omi,invoice_status_5:Mmi,invoice_status_6:jmi,marked_invoice_as_sent:Fmi,please_enter_a_client_or_contact_name:Bmi,restart_app_to_apply_change:$mi,refresh_data:Hmi,blank_contact:Vmi,no_records_found:Wmi,industry:zmi,size:Umi,net:qmi,show_tasks:Kmi,email_reminders:Gmi,reminder1:Ymi,reminder2:Qmi,reminder3:Xmi,send:Zmi,auto_billing:Jmi,button:e_i,more:t_i,edit_recurring_invoice:n_i,edit_recurring_quote:i_i,quote_status:r_i,please_select_an_invoice:s_i,filtered_by:o_i,payment_status:a_i,payment_status_1:l_i,payment_status_2:c_i,payment_status_3:u_i,payment_status_4:d_i,payment_status_5:h_i,payment_status_6:f_i,send_receipt_to_client:p_i,refunded:g_i,marked_quote_as_sent:m_i,custom_module_settings:__i,open:v_i,new:"New",closed:b_i,reopened:y_i,priority:C_i,last_updated:w_i,comment:x_i,tags:S_i,linked_objects:E_i,low:k_i,medium:T_i,high:I_i,no_due_date:L_i,assigned_to:A_i,reply:N_i,awaiting_reply:D_i,mark_spam:R_i,local_part:P_i,local_part_unavailable:O_i,local_part_available:M_i,local_part_invalid:j_i,local_part_help:F_i,from_name_help:B_i,local_part_placeholder:$_i,from_name_placeholder:H_i,attachments:V_i,client_upload:W_i,enable_client_upload_help:z_i,max_file_size_help:U_i,max_file_size:q_i,mime_types:K_i,mime_types_placeholder:G_i,mime_types_help:Y_i,ticket_number_start_help:Q_i,new_ticket_template_id:X_i,new_ticket_autoresponder_help:Z_i,update_ticket_template_id:J_i,update_ticket_autoresponder_help:evi,close_ticket_template_id:tvi,close_ticket_autoresponder_help:nvi,default_priority:ivi,alert_new_comment_id:rvi,update_ticket_notification_list:svi,comma_separated_values:ovi,default_agent:avi,default_agent_help:lvi,show_agent_details:cvi,avatar:uvi,remove_avatar:dvi,add_template:hvi,archive_ticket_template:fvi,restore_ticket_template:pvi,archived_ticket_template:gvi,restored_ticket_template:mvi,enter_ticket_message:_vi,show_hide_all:vvi,subject_required:bvi,mobile_refresh_warning:yvi,merge:Cvi,merged:wvi,agent:xvi,include_in_filter:Svi,custom_client1:Evi,custom_client2:kvi,compare:Tvi,hosted_login:Ivi,selfhost_login:Lvi,google_login:Avi,thanks_for_patience:Nvi,legacy_mobile_app:Dvi,today:Rvi,current:Pvi,previous:Ovi,current_period:Mvi,comparison_period:jvi,previous_period:Fvi,previous_year:Bvi,compare_to:$vi,last_week:Hvi,clone_to_invoice:Vvi,clone_to_quote:Wvi,convert:zvi,last7_days:Uvi,last30_days:qvi,custom_js:Kvi,adjust_fee_percent_help:Gvi,show_product_notes:Yvi,show_product_notes_help:Qvi,important:Xvi,thank_you_for_using_our_app:Zvi,if_you_like_it:Jvi,to_rate_it:ebi,average:tbi,unapproved:nbi,authenticate_to_change_setting:ibi,locked:rbi,authenticate:sbi,please_authenticate:obi,biometric_authentication:abi,auto_start_tasks:lbi,budgeted:cbi,please_enter_a_name:ubi,click_plus_to_add_time:dbi,design:hbi,password_is_too_short:fbi,failed_to_find_record:pbi,valid_until_days:gbi,valid_until_days_help:mbi,usually_pays_in_days:_bi,requires_an_enterprise_plan:vbi,take_picture:bbi,upload_file:ybi,new_document:Cbi,edit_document:wbi,uploaded_document:xbi,updated_document:Sbi,archived_document:Ebi,deleted_document:kbi,restored_document:Tbi,no_history:Ibi,expense_status_1:Lbi,expense_status_2:Abi,expense_status_3:Nbi,no_record_selected:Dbi,error_unsaved_changes:Rbi,thank_you_for_your_purchase:Pbi,redeem:Obi,back:Mbi,past_purchases:jbi,annual_subscription:Fbi,pro_plan:Bbi,enterprise_plan:$bi,count_users:Hbi,upgrade:Vbi,please_enter_a_first_name:Wbi,please_enter_a_last_name:zbi,please_agree_to_terms_and_privacy:Ubi,i_agree_to_the:qbi,terms_of_service_link:Kbi,privacy_policy_link:Gbi,view_website:Ybi,create_account:Qbi,email_login:Xbi,late_fees:Zbi,payment_number:Jbi,before_due_date:e0i,after_due_date:t0i,after_invoice_date:n0i,filtered_by_user:i0i,created_user:r0i,primary_font:s0i,secondary_font:o0i,number_padding:a0i,general:l0i,surcharge_field:c0i,company_value:u0i,credit_field:d0i,payment_field:h0i,group_field:f0i,number_counter:p0i,number_pattern:g0i,custom_javascript:m0i,portal_mode:_0i,attach_pdf:v0i,attach_documents:b0i,attach_ubl:y0i,email_style:C0i,processed:w0i,fee_amount:x0i,fee_percent:S0i,fee_cap:E0i,limits_and_fees:k0i,credentials:T0i,require_billing_address_help:I0i,require_shipping_address_help:L0i,deleted_tax_rate:A0i,restored_tax_rate:N0i,provider:D0i,company_gateway:R0i,company_gateways:P0i,new_company_gateway:O0i,edit_company_gateway:M0i,created_company_gateway:j0i,updated_company_gateway:F0i,archived_company_gateway:B0i,deleted_company_gateway:$0i,restored_company_gateway:H0i,continue_editing:V0i,default_value:W0i,currency_format:z0i,first_day_of_the_week:U0i,first_month_of_the_year:q0i,symbol:K0i,ocde:G0i,date_format:Y0i,datetime_format:Q0i,send_reminders:X0i,timezone:Z0i,filtered_by_group:J0i,filtered_by_invoice:eyi,filtered_by_client:tyi,filtered_by_vendor:nyi,group_settings:iyi,groups:ryi,new_group:syi,edit_group:oyi,created_group:ayi,updated_group:lyi,archived_group:cyi,deleted_group:uyi,restored_group:dyi,upload_logo:hyi,uploaded_logo:fyi,saved_settings:pyi,device_settings:gyi,credit_cards_and_banks:myi,price:_yi,email_sign_up:vyi,google_sign_up:byi,sign_up_with_google:yyi,long_press_multiselect:Cyi,migrate_to_next_version:wyi,migrate_intro_text:xyi,start_the_migration:Syi,migration:Eyi,welcome_to_the_new_version:kyi,next_step_data_download:Tyi,download_data:Iyi,continue:"Continue",company1:Lyi,company2:Ayi,company3:Nyi,company4:Dyi,product1:Ryi,product2:Pyi,product3:Oyi,product4:Myi,client1:jyi,client2:Fyi,client3:Byi,client4:$yi,contact1:Hyi,contact2:Vyi,contact3:Wyi,contact4:zyi,task1:Uyi,task2:qyi,task3:Kyi,task4:Gyi,project1:Yyi,project2:Qyi,project3:Xyi,project4:Zyi,expense1:Jyi,expense2:e1i,expense3:t1i,expense4:n1i,vendor1:i1i,vendor2:r1i,vendor3:s1i,vendor4:o1i,invoice1:a1i,invoice2:l1i,invoice3:c1i,invoice4:u1i,payment1:d1i,payment2:h1i,payment3:f1i,payment4:p1i,surcharge1:g1i,surcharge2:m1i,surcharge3:_1i,surcharge4:v1i,group1:b1i,group2:y1i,group3:C1i,group4:w1i,number:x1i,count:S1i,is_active:E1i,contact_last_login:k1i,contact_full_name:T1i,contact_custom_value1:I1i,contact_custom_value2:L1i,contact_custom_value3:A1i,contact_custom_value4:N1i,assigned_to_id:D1i,created_by_id:R1i,add_column:P1i,edit_columns:O1i,to_learn_about_gogle_fonts:M1i,refund_date:j1i,multiselect:F1i,verify_password:B1i,applied:$1i,include_recent_errors:H1i,your_message_has_been_received:V1i,show_product_details:W1i,show_product_details_help:z1i,pdf_min_requirements:U1i,adjust_fee_percent:q1i,configure_settings:K1i,about:G1i,credit_email:Y1i,domain_url:Q1i,password_is_too_easy:X1i,client_portal_tasks:Z1i,client_portal_dashboard:J1i,please_enter_a_value:eCi,deleted_logo:tCi,generate_number:nCi,when_saved:iCi,when_sent:rCi,select_company:sCi,float:oCi,collapse:aCi,show_or_hide:lCi,menu_sidebar:cCi,history_sidebar:uCi,tablet:dCi,layout:hCi,module:fCi,first_custom:pCi,second_custom:gCi,third_custom:mCi,show_cost:_Ci,show_cost_help:vCi,show_product_quantity:bCi,show_product_quantity_help:yCi,show_invoice_quantity:CCi,show_invoice_quantity_help:wCi,default_quantity:xCi,default_quantity_help:SCi,one_tax_rate:ECi,two_tax_rates:kCi,three_tax_rates:TCi,default_tax_rate:ICi,invoice_tax:LCi,line_item_tax:ACi,inclusive_taxes:NCi,invoice_tax_rates:DCi,item_tax_rates:RCi,configure_rates:PCi,tax_settings_rates:OCi,accent_color:MCi,comma_sparated_list:jCi,single_line_text:FCi,multi_line_text:BCi,dropdown:$Ci,field_type:HCi,recover_password_email_sent:VCi,removed_user:WCi,freq_three_years:zCi,military_time_help:UCi,click_here_capital:qCi,marked_invoice_as_paid:KCi,marked_invoices_as_sent:GCi,marked_invoices_as_paid:YCi,activity_57:QCi,custom_value3:XCi,custom_value4:ZCi,email_style_custom:JCi,custom_message_dashboard:ewi,custom_message_unpaid_invoice:twi,custom_message_paid_invoice:nwi,custom_message_unapproved_quote:iwi,lock_sent_invoices:rwi,translations:swi,task_number_pattern:owi,task_number_counter:awi,expense_number_pattern:lwi,expense_number_counter:cwi,vendor_number_pattern:uwi,vendor_number_counter:dwi,ticket_number_pattern:hwi,ticket_number_counter:fwi,payment_number_pattern:pwi,payment_number_counter:gwi,invoice_number_pattern:mwi,quote_number_pattern:_wi,client_number_pattern:vwi,client_number_counter:bwi,credit_number_pattern:ywi,credit_number_counter:Cwi,reset_counter_date:wwi,counter_padding:xwi,shared_invoice_quote_counter:Swi,default_tax_name_1:Ewi,default_tax_rate_1:kwi,default_tax_name_2:Twi,default_tax_rate_2:Iwi,default_tax_name_3:Lwi,default_tax_rate_3:Awi,email_subject_invoice:Nwi,email_subject_quote:Dwi,email_subject_payment:Rwi,switch_list_table:Pwi,client_city:Owi,client_state:Mwi,client_country:jwi,client_is_active:Fwi,client_balance:Bwi,client_address1:$wi,client_address2:Hwi,client_shipping_address1:Vwi,client_shipping_address2:Wwi,tax_rate1:zwi,tax_rate2:Uwi,tax_rate3:qwi,archived_at:Kwi,has_expenses:Gwi,custom_taxes1:Ywi,custom_taxes2:Qwi,custom_taxes3:Xwi,custom_taxes4:Zwi,custom_surcharge1:Jwi,custom_surcharge2:exi,custom_surcharge3:txi,custom_surcharge4:nxi,is_deleted:ixi,vendor_city:rxi,vendor_state:sxi,vendor_country:oxi,credit_footer:axi,credit_terms:lxi,untitled_company:cxi,added_company:uxi,supported_events:dxi,custom3:hxi,custom4:fxi,optional:pxi,license:gxi,invoice_balance:mxi,saved_design:_xi,client_details:vxi,company_address:bxi,quote_details:yxi,credit_details:Cxi,product_columns:wxi,task_columns:xxi,add_field:Sxi,all_events:Exi,owned:kxi,payment_success:Txi,payment_failure:Ixi,quote_sent:Lxi,credit_sent:Axi,invoice_viewed:Nxi,quote_viewed:Dxi,credit_viewed:Rxi,quote_approved:Pxi,receive_all_notifications:Oxi,purchase_license:Mxi,enable_modules:jxi,converted_quote:Fxi,credit_design:Bxi,includes:$xi,css_framework:Hxi,custom_designs:Vxi,designs:Wxi,new_design:zxi,edit_design:Uxi,created_design:qxi,updated_design:Kxi,archived_design:Gxi,deleted_design:Yxi,removed_design:Qxi,restored_design:Xxi,recurring_tasks:Zxi,removed_credit:Jxi,latest_version:eSi,update_now:tSi,a_new_version_is_available:nSi,update_available:iSi,app_updated:rSi,integrations:sSi,tracking_id:oSi,slack_webhook_url:aSi,partial_payment:lSi,partial_payment_email:cSi,clone_to_credit:uSi,emailed_credit:dSi,marked_credit_as_sent:hSi,email_subject_payment_partial:fSi,is_approved:pSi,migration_went_wrong:gSi,cross_migration_message:mSi,email_credit:_Si,client_email_not_set:vSi,ledger:bSi,view_pdf:ySi,all_records:CSi,owned_by_user:wSi,credit_remaining:xSi,use_default:SSi,reminder_endless:ESi,number_of_days:kSi,configure_payment_terms:TSi,payment_term:ISi,new_payment_term:LSi,deleted_payment_term:ASi,removed_payment_term:NSi,restored_payment_term:DSi,full_width_editor:RSi,full_height_filter:PSi,email_sign_in:OSi,change:MSi,change_to_mobile_layout:jSi,change_to_desktop_layout:FSi,send_from_gmail:BSi,reversed:$Si,cancelled:HSi,quote_amount:VSi,hosted:WSi,selfhosted:zSi,hide_menu:USi,show_menu:qSi,partially_refunded:KSi,search_documents:GSi,search_designs:YSi,search_invoices:QSi,search_clients:XSi,search_products:ZSi,search_quotes:JSi,search_credits:eEi,search_vendors:tEi,search_users:nEi,search_tax_rates:iEi,search_tasks:rEi,search_settings:sEi,search_projects:oEi,search_expenses:aEi,search_payments:lEi,search_groups:cEi,search_company:uEi,cancelled_invoice:dEi,cancelled_invoices:hEi,reversed_invoice:fEi,reversed_invoices:pEi,reverse:gEi,filtered_by_project:mEi,google_sign_in:_Ei,activity_58:vEi,activity_59:bEi,payment_reconciliation_failure:yEi,payment_reconciliation_success:CEi,gateway_success:wEi,gateway_failure:xEi,gateway_error:SEi,email_send:EEi,email_retry_queue:kEi,failure:TEi,quota_exceeded:IEi,upstream_failure:LEi,system_logs:AEi,copy_link:NEi,welcome_to_invoice_ninja:DEi,optin:REi,optout:PEi,auto_convert:OEi,reminder1_sent:MEi,reminder2_sent:jEi,reminder3_sent:FEi,reminder_last_sent:BEi,pdf_page_info:$Ei,emailed_credits:HEi,view_in_stripe:VEi,rows_per_page:WEi,apply_payment:zEi,unapplied:UEi,custom_labels:qEi,record_type:KEi,record_name:GEi,file_type:YEi,height:QEi,width:XEi,health_check:ZEi,last_login_at:JEi,company_key:eki,storefront:tki,storefront_help:nki,count_records_selected:iki,count_record_selected:rki,client_created:ski,online_payment_email:oki,manual_payment_email:aki,completed:lki,gross:cki,net_amount:uki,net_balance:dki,client_settings:hki,selected_invoices:fki,selected_payments:pki,selected_quotes:gki,selected_tasks:mki,selected_expenses:_ki,past_due_invoices:vki,create_payment:bki,update_quote:yki,update_invoice:Cki,update_client:wki,update_vendor:xki,create_expense:Ski,update_expense:Eki,update_task:kki,approve_quote:Tki,when_paid:Iki,expires_on:Lki,show_sidebar:Aki,hide_sidebar:Nki,event_type:Dki,copy:Rki,must_be_online:Pki,crons_not_enabled:Oki,api_webhooks:Mki,search_webhooks:jki,search_webhook:Fki,webhook:Bki,webhooks:$ki,new_webhook:Hki,edit_webhook:Vki,created_webhook:Wki,updated_webhook:zki,archived_webhook:Uki,deleted_webhook:qki,removed_webhook:Kki,restored_webhook:Gki,search_tokens:Yki,search_token:Qki,new_token:Xki,removed_token:Zki,restored_token:Jki,client_registration:eTi,client_registration_help:tTi,customize_and_preview:nTi,search_document:iTi,search_design:rTi,search_invoice:sTi,search_client:oTi,search_product:aTi,search_quote:lTi,search_credit:cTi,search_vendor:uTi,search_user:dTi,search_tax_rate:hTi,search_task:fTi,search_project:pTi,search_expense:gTi,search_payment:mTi,search_group:_Ti,created_on:vTi,"payment_status_-1":"Unapplied",lock_invoices:bTi,show_table:yTi,show_list:CTi,view_changes:wTi,force_update:xTi,force_update_help:STi,mark_paid_help:ETi,mark_invoiceable_help:kTi,add_documents_to_invoice_help:TTi,convert_currency_help:ITi,expense_settings:LTi,clone_to_recurring:ATi,crypto:NTi,user_field:DTi,variables:RTi,show_password:PTi,hide_password:OTi,copy_error:MTi,capture_card:jTi,auto_bill_enabled:FTi,total_taxes:BTi,line_taxes:$Ti,total_fields:HTi,stopped_recurring_invoice:VTi,started_recurring_invoice:WTi,resumed_recurring_invoice:zTi,gateway_refund:UTi,gateway_refund_help:qTi,due_date_days:KTi,paused:GTi,day_count:YTi,first_day_of_the_month:QTi,last_day_of_the_month:XTi,use_payment_terms:ZTi,endless:JTi,next_send_date:e2i,remaining_cycles:t2i,created_recurring_invoice:n2i,updated_recurring_invoice:i2i,removed_recurring_invoice:r2i,search_recurring_invoice:s2i,search_recurring_invoices:o2i,send_date:a2i,auto_bill_on:l2i,minimum_under_payment_amount:c2i,allow_over_payment:u2i,allow_over_payment_help:d2i,allow_under_payment:h2i,allow_under_payment_help:f2i,test_mode:p2i,calculated_rate:g2i,default_task_rate:m2i,clear_cache:_2i,sort_order:v2i,task_status:b2i,task_statuses:y2i,new_task_status:C2i,edit_task_status:w2i,created_task_status:x2i,archived_task_status:S2i,deleted_task_status:E2i,removed_task_status:k2i,restored_task_status:T2i,search_task_status:I2i,search_task_statuses:L2i,show_tasks_table:A2i,show_tasks_table_help:N2i,invoice_task_timelog:D2i,invoice_task_timelog_help:R2i,auto_start_tasks_help:P2i,configure_statuses:O2i,task_settings:M2i,configure_categories:j2i,edit_expense_category:F2i,removed_expense_category:B2i,search_expense_category:$2i,search_expense_categories:H2i,use_available_credits:V2i,show_option:W2i,negative_payment_error:z2i,should_be_invoiced_help:U2i,configure_gateways:q2i,payment_partial:K2i,is_running:G2i,invoice_currency_id:Y2i,tax_name1:Q2i,tax_name2:X2i,transaction_id:Z2i,invoice_late:J2i,quote_expired:eIi,recurring_invoice_total:tIi,actions:nIi,expense_number:iIi,task_number:rIi,project_number:sIi,view_settings:oIi,company_disabled_warning:aIi,late_invoice:lIi,expired_quote:cIi,remind_invoice:uIi,client_phone:dIi,required_fields:hIi,enabled_modules:fIi,activity_60:pIi,activity_61:gIi,activity_62:mIi,activity_63:_Ii,activity_64:vIi,activity_65:bIi,activity_66:yIi,expense_category_id:CIi,view_licenses:wIi,fullscreen_editor:xIi,sidebar_editor:SIi,please_type_to_confirm:EIi,purge:kIi,clone_to:TIi,clone_to_other:IIi,labels:LIi,add_custom:AIi,payment_tax:NIi,white_label:DIi,sent_invoices_are_locked:RIi,paid_invoices_are_locked:PIi,source_code:OIi,app_platforms:MIi,archived_task_statuses:jIi,deleted_task_statuses:FIi,restored_task_statuses:BIi,deleted_expense_categories:$Ii,restored_expense_categories:HIi,archived_recurring_invoices:VIi,deleted_recurring_invoices:WIi,restored_recurring_invoices:zIi,archived_webhooks:UIi,deleted_webhooks:qIi,removed_webhooks:KIi,restored_webhooks:GIi,api_docs:YIi,archived_tokens:QIi,deleted_tokens:XIi,restored_tokens:ZIi,archived_payment_terms:JIi,deleted_payment_terms:eLi,restored_payment_terms:tLi,archived_designs:nLi,deleted_designs:iLi,restored_designs:rLi,restored_credits:sLi,archived_users:oLi,deleted_users:aLi,removed_users:lLi,restored_users:cLi,archived_tax_rates:uLi,deleted_tax_rates:dLi,restored_tax_rates:hLi,archived_company_gateways:fLi,deleted_company_gateways:pLi,restored_company_gateways:gLi,archived_groups:mLi,deleted_groups:_Li,restored_groups:vLi,archived_documents:bLi,deleted_documents:yLi,restored_documents:CLi,restored_vendors:wLi,restored_expenses:xLi,restored_tasks:SLi,restored_projects:ELi,restored_products:kLi,restored_clients:TLi,restored_invoices:ILi,restored_payments:LLi,restored_quotes:ALi,update_app:NLi,started_import:DLi,duplicate_column_mapping:RLi,uses_inclusive_taxes:PLi,is_amount_discount:OLi,map_to:MLi,first_row_as_column_names:jLi,no_file_selected:FLi,import_type:BLi,draft_mode:$Li,draft_mode_help:HLi,show_product_discount:VLi,show_product_discount_help:WLi,tax_name3:zLi,debug_mode_is_enabled:ULi,debug_mode_is_enabled_help:qLi,running_tasks:KLi,recent_tasks:GLi,recent_expenses:YLi,upcoming_expenses:QLi,search_payment_term:XLi,search_payment_terms:ZLi,save_and_preview:JLi,save_and_email:eAi,converted_balance:tAi,is_sent:nAi,document_upload:iAi,document_upload_help:rAi,expense_total:sAi,enter_taxes:oAi,by_rate:aAi,by_amount:lAi,enter_amount:cAi,before_taxes:uAi,after_taxes:dAi,color:hAi,show:fAi,empty_columns:pAi,project_name:gAi,counter_pattern_error:mAi,this_quarter:_Ai,to_update_run:vAi,registration_url:bAi,show_product_cost:yAi,complete:CAi,next:wAi,next_step:xAi,notification_credit_sent_subject:SAi,notification_credit_viewed_subject:EAi,notification_credit_sent:kAi,notification_credit_viewed:TAi,reset_password_text:IAi,password_reset:LAi,account_login_text:AAi,request_cancellation:NAi,delete_payment_method:DAi,about_to_delete_payment_method:RAi,action_cant_be_reversed:PAi,profile_updated_successfully:OAi,currency_ethiopian_birr:MAi,client_information_text:jAi,status_id:FAi,email_already_register:BAi,locations:$Ai,freq_indefinitely:HAi,cycles_remaining:VAi,i_understand_delete:WAi,download_files:zAi,download_timeframe:UAi,new_signup:qAi,new_signup_text:KAi,notification_payment_paid_subject:GAi,notification_partial_payment_paid_subject:YAi,notification_payment_paid:QAi,notification_partial_payment_paid:XAi,notification_bot:ZAi,invoice_number_placeholder:JAi,entity_number_placeholder:eNi,email_link_not_working:tNi,display_log:nNi,send_fail_logs_to_our_server:iNi,setup:rNi,quick_overview_statistics:sNi,update_your_personal_info:oNi,name_website_logo:aNi,make_sure_use_full_link:lNi,personal_address:cNi,enter_your_personal_address:uNi,enter_your_shipping_address:dNi,list_of_invoices:hNi,with_selected:fNi,invoice_still_unpaid:pNi,list_of_recurring_invoices:gNi,details_of_recurring_invoice:mNi,cancellation:_Ni,about_cancellation:vNi,cancellation_warning:bNi,cancellation_pending:yNi,list_of_payments:CNi,payment_details:wNi,list_of_payment_invoices:xNi,list_of_payment_methods:SNi,payment_method_details:ENi,permanently_remove_payment_method:kNi,warning_action_cannot_be_reversed:TNi,confirmation:INi,list_of_quotes:LNi,waiting_for_approval:ANi,quote_still_not_approved:NNi,list_of_credits:DNi,required_extensions:RNi,php_version:PNi,writable_env_file:ONi,env_not_writable:MNi,minumum_php_version:jNi,satisfy_requirements:FNi,oops_issues:BNi,open_in_new_tab:$Ni,complete_your_payment:HNi,authorize_for_future_use:VNi,page:WNi,per_page:zNi,of:UNi,view_credit:qNi,to_view_entity_password:KNi,showing_x_of:GNi,no_results:YNi,payment_failed_subject:QNi,payment_failed_body:XNi,register:ZNi,register_label:JNi,password_confirmation:eDi,verification:tDi,complete_your_bank_account_verification:nDi,checkout_com:iDi,footer_label:rDi,credit_card_invalid:sDi,month_invalid:oDi,year_invalid:aDi,https_required:lDi,if_you_need_help:cDi,update_password_on_confirm:uDi,bank_account_not_linked:dDi,application_settings_label:hDi,recommended_in_production:fDi,enable_only_for_development:pDi,test_pdf:gDi,checkout_authorize_label:mDi,sofort_authorize_label:_Di,node_status:vDi,npm_status:bDi,node_status_not_found:yDi,npm_status_not_found:CDi,locked_invoice:wDi,downloads:xDi,resource:SDi,document_details:EDi,hash:kDi,resources:TDi,allowed_file_types:IDi,common_codes:LDi,payment_error_code_20087:ADi,download_selected:NDi,to_pay_invoices:DDi,add_payment_method_first:RDi,no_items_selected:PDi,payment_due:ODi,account_balance:MDi,thanks:jDi,minimum_required_payment:FDi,under_payments_disabled:BDi,over_payments_disabled:$Di,saved_at:HDi,credit_payment:VDi,credit_subject:WDi,credit_message:zDi,payment_type_Crypto:UDi,payment_type_Credit:qDi,store_for_future_use:KDi,pay_with_credit:GDi,payment_method_saving_failed:YDi,pay_with:QDi,"n/a":"N/A",by_clicking_next_you_accept_terms:XDi,not_specified:ZDi,before_proceeding_with_payment_warning:JDi,after_completing_go_back_to_previous_page:eRi,pay:tRi,instructions:nRi,notification_invoice_reminder1_sent_subject:iRi,notification_invoice_reminder2_sent_subject:rRi,notification_invoice_reminder3_sent_subject:sRi,notification_invoice_custom_sent_subject:oRi,notification_invoice_reminder_endless_sent_subject:aRi,assigned_user:lRi,setup_steps_notice:cRi,setup_phantomjs_note:uRi,minimum_payment:dRi,no_action_provided:hRi,no_payable_invoices_selected:fRi,required_payment_information:pRi,required_payment_information_more:gRi,required_client_info_save_label:mRi,notification_credit_bounced:_Ri,notification_credit_bounced_subject:vRi,save_payment_method_details:bRi,new_card:yRi,new_bank_account:CRi,company_limit_reached:wRi,credits_applied_validation:xRi,credit_number_taken:SRi,credit_not_found:ERi,invoices_dont_match_client:kRi,duplicate_credits_submitted:TRi,duplicate_invoices_submitted:IRi,credit_with_no_invoice:LRi,client_id_required:ARi,expense_number_taken:NRi,invoice_number_taken:DRi,payment_id_required:RRi,unable_to_retrieve_payment:PRi,invoice_not_related_to_payment:ORi,credit_not_related_to_payment:MRi,max_refundable_invoice:jRi,refund_without_invoices:FRi,refund_without_credits:BRi,max_refundable_credit:$Ri,project_client_do_not_match:HRi,quote_number_taken:VRi,recurring_invoice_number_taken:WRi,user_not_associated_with_account:zRi,amounts_do_not_balance:URi,insufficient_applied_amount_remaining:qRi,insufficient_credit_balance:KRi,one_or_more_invoices_paid:GRi,invoice_cannot_be_refunded:YRi,attempted_refund_failed:QRi,user_not_associated_with_this_account:XRi,migration_completed:ZRi,migration_completed_description:JRi,api_404:ePi,large_account_update_parameter:tPi,no_backup_exists:nPi,company_user_not_found:iPi,no_credits_found:rPi,action_unavailable:sPi,no_documents_found:oPi,no_group_settings_found:aPi,access_denied:lPi,invoice_cannot_be_marked_paid:cPi,invoice_license_or_environment:uPi,route_not_available:dPi,invalid_design_object:hPi,quote_not_found:fPi,quote_unapprovable:pPi,scheduler_has_run:gPi,scheduler_has_never_run:mPi,self_update_not_available:_Pi,user_detached:vPi,create_webhook_failure:bPi,payment_message_extended:yPi,online_payments_minimum_note:CPi,payment_token_not_found:wPi,vendor_address1:xPi,vendor_address2:SPi,partially_unapplied:EPi,select_a_gmail_user:kPi,list_long_press:TPi,show_actions:IPi,start_multiselect:LPi,email_sent_to_confirm_email:APi,converted_paid_to_date:NPi,converted_credit_balance:DPi,converted_total:RPi,reply_to_name:PPi,"payment_status_-2":"Partially Unapplied",color_theme:OPi,start_migration:MPi,recurring_cancellation_request:jPi,recurring_cancellation_request_body:FPi,hello:BPi,group_documents:$Pi,quote_approval_confirmation_label:HPi,migration_select_company_label:VPi,force_migration:WPi,require_password_with_social_login:zPi,stay_logged_in:UPi,session_about_to_expire:qPi,count_hours:KPi,count_day:GPi,count_days:YPi,web_session_timeout:QPi,security_settings:XPi,resend_email:ZPi,confirm_your_email_address:JPi,freshbooks:eOi,invoice2go:tOi,invoicely:nOi,waveaccounting:iOi,zoho:rOi,accounting:sOi,required_files_missing:oOi,migration_auth_label:aOi,api_secret:lOi,migration_api_secret_notice:cOi,billing_coupon_notice:uOi,use_last_email:dOi,activate_company:hOi,activate_company_help:fOi,an_error_occurred_try_again:pOi,please_first_set_a_password:gOi,changing_phone_disables_two_factor:mOi,help_translate:_Oi,please_select_a_country:vOi,disabled_two_factor:bOi,connected_google:yOi,disconnected_google:COi,delivered:wOi,spam:xOi,view_docs:SOi,enter_phone_to_enable_two_factor:EOi,send_sms:kOi,sms_code:TOi,connect_google:IOi,disconnect_google:LOi,disable_two_factor:AOi,invoice_task_datelog:NOi,invoice_task_datelog_help:DOi,promo_code:ROi,recurring_invoice_issued_to:POi,subscription:OOi,new_subscription:MOi,deleted_subscription:jOi,removed_subscription:FOi,restored_subscription:BOi,search_subscription:$Oi,search_subscriptions:HOi,subdomain_is_not_available:VOi,connect_gmail:WOi,disconnect_gmail:zOi,connected_gmail:UOi,disconnected_gmail:qOi,update_fail_help:KOi,client_id_number:GOi,count_minutes:YOi,password_timeout:QOi,shared_invoice_credit_counter:XOi,activity_80:ZOi,activity_81:JOi,activity_82:eMi,activity_83:tMi,activity_84:nMi,amount_greater_than_balance_v5:iMi,click_to_continue:rMi,notification_invoice_created_body:sMi,notification_invoice_created_subject:oMi,notification_quote_created_body:aMi,notification_quote_created_subject:lMi,notification_credit_created_body:cMi,notification_credit_created_subject:uMi,max_companies:dMi,max_companies_desc:hMi,migration_already_completed:fMi,migration_already_completed_desc:pMi,payment_method_cannot_be_authorized_first:gMi,new_account:mMi,activity_100:_Mi,activity_101:vMi,activity_102:bMi,activity_103:yMi,activity_104:CMi,new_login_detected:wMi,new_login_description:xMi,contact_details:SMi,download_backup_subject:EMi,account_passwordless_login:kMi,user_duplicate_error:TMi,user_cross_linked_error:IMi,ach_verification_notification_label:LMi,ach_verification_notification:AMi,login_link_requested_label:NMi,login_link_requested:DMi,invoices_backup_subject:RMi,migration_failed_label:PMi,migration_failed:OMi,client_email_company_contact_label:MMi,quote_was_approved_label:jMi,quote_was_approved:FMi,company_import_failure_subject:BMi,company_import_failure_body:$Mi,recurring_invoice_due_date:HMi,amount_cents:VMi,default_payment_method_label:WMi,default_payment_method:zMi,already_default_payment_method:UMi,auto_bill_disabled:qMi,select_payment_method:KMi,login_without_password:GMi,email_sent:YMi,one_time_purchases:QMi,recurring_purchases:XMi,you_might_be_interested_in_following:ZMi,quotes_with_status_sent_can_be_approved:JMi,no_quotes_available_for_download:e4i,copyright:t4i,user_created_user:n4i,company_deleted:i4i,company_deleted_body:r4i,back_to:s4i,stripe_connect_migration_title:o4i,stripe_connect_migration_desc:a4i,email_quota_exceeded_subject:l4i,email_quota_exceeded_body:c4i,auto_bill_option:u4i,lang_Arabic:d4i,lang_Persian:h4i,lang_Latvian:f4i,expiry_date:p4i,cardholder_name:g4i,recurring_quote_number_taken:m4i,account_type:_4i,locality:v4i,checking:b4i,savings:y4i,unable_to_verify_payment_method:C4i,generic_gateway_error:w4i,my_documents:x4i,payment_method_cannot_be_preauthorized:S4i,kbc_cbc:E4i,bancontact:k4i,sepa_mandat:T4i,ideal:I4i,bank_account_holder:L4i,aio_checkout:A4i,przelewy24:N4i,przelewy24_accept:D4i,giropay:R4i,giropay_law:P4i,klarna:O4i,eps:M4i,becs:j4i,bacs:F4i,payment_type_BACS:B4i,missing_payment_method:$4i,becs_mandate:H4i,you_need_to_accept_the_terms_before_proceeding:V4i,direct_debit:W4i,clone_to_expense:z4i,checkout:U4i,acss:q4i,invalid_amount:K4i,client_payment_failure_body:G4i,browser_pay:Y4i,no_available_methods:Q4i,gocardless_mandate_not_ready:X4i,payment_type_instant_bank_pay:Z4i,payment_type_iDEAL:J4i,payment_type_Przelewy24:e3i,"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:t3i,payment_type_EPS:n3i,"payment_type_Direct Debit":"Direct Debit",payment_type_Bancontact:i3i,payment_type_BECS:r3i,payment_type_ACSS:s3i,gross_line_total:o3i,lang_Slovak:a3i,normal:l3i,large:c3i,extra_large:u3i,show_pdf_preview:d3i,show_pdf_preview_help:h3i,print_pdf:f3i,remind_me:p3i,instant_bank_pay:g3i,click_selected:m3i,hide_preview:_3i,edit_record:v3i,credit_is_more_than_invoice:b3i,please_set_a_password:y3i,recommend_desktop:C3i,recommend_mobile:w3i,disconnected_gateway:x3i,disconnect:S3i,add_to_invoices:E3i,bulk_download:k3i,persist_data_help:T3i,persist_ui:I3i,persist_ui_help:L3i,client_postal_code:A3i,client_vat_number:N3i,has_tasks:D3i,registration:R3i,unauthorized_stripe_warning:P3i,update_all_records:O3i,set_default_company:M3i,updated_company:j3i,kbc:F3i,why_are_you_leaving:B3i,webhook_success:$3i,error_cross_client_tasks:H3i,error_cross_client_expenses:V3i,app:W3i,for_best_performance:z3i,bulk_email_invoice:U3i,bulk_email_quote:q3i,bulk_email_credit:K3i,removed_recurring_expense:G3i,search_recurring_expense:Y3i,search_recurring_expenses:Q3i,last_sent_date:X3i,include_drafts:Z3i,include_drafts_help:J3i,is_invoiced:e5i,change_plan:t5i,persist_data:n5i,customer_count:i5i,verify_customers:r5i,google_analytics_tracking_id:s5i,decimal_comma:o5i,use_comma_as_decimal_place:a5i,select_method:l5i,select_platform:c5i,use_web_app_to_connect_gmail:u5i,expense_tax_help:d5i,enable_markdown:h5i,enable_markdown_help:f5i,add_second_contact:p5i,previous_page:g5i,next_page:m5i,export_colors:_5i,import_colors:v5i,clear_all:b5i,contrast:y5i,custom_colors:C5i,colors:w5i,sidebar_active_background_color:x5i,sidebar_active_font_color:S5i,sidebar_inactive_background_color:E5i,sidebar_inactive_font_color:k5i,table_alternate_row_background_color:T5i,invoice_header_background_color:I5i,invoice_header_font_color:L5i,review_app:A5i,check_status:N5i,free_trial:D5i,free_trial_help:R5i,free_trial_ends_in_days:P5i,free_trial_ends_today:O5i,change_email:M5i,client_portal_domain_hint:j5i,tasks_shown_in_portal:F5i,uninvoiced:B5i,subdomain_guide:$5i,send_time:H5i,import_settings:V5i,json_file_missing:W5i,json_option_missing:z5i,json:U5i,no_payment_types_enabled:q5i,wait_for_data:K5i,net_total:G5i,has_taxes:Y5i,import_customers:Q5i,imported_customers:X5i,login_success:Z5i,login_failure:J5i,exported_data:eji,include_deleted_clients:tji,include_deleted_clients_help:nji,step_1_sign_in:iji,step_2_authorize:rji,account_id:sji,migration_not_yet_completed:oji,show_task_end_date:aji,show_task_end_date_help:lji,gateway_setup:cji,preview_sidebar:uji,years_data_shown:dji,ended_all_sessions:hji,end_all_sessions:fji,count_session:pji,count_sessions:gji,invoice_created:mji,quote_created:_ji,credit_created:vji,enterprise:bji,invoice_item:yji,quote_item:Cji,order:wji,search_kanban:xji,search_kanbans:Sji,move_top:Eji,move_up:kji,move_down:Tji,move_bottom:Iji,body_variable_missing:Lji,add_body_variable_message:Aji,view_date_formats:Nji,is_viewed:Dji,letter:Rji,legal:Pji,page_layout:Oji,portrait:Mji,landscape:jji,owner_upgrade_to_paid_plan:Fji,upgrade_to_paid_plan:Bji,invoice_payment_terms:$ji,quote_valid_until:Hji,no_headers:Vji,add_header:Wji,remove_header:zji,return_url:Uji,rest_method:qji,header_key:Kji,header_value:Gji,recurring_products:Yji,promo_discount:Qji,allow_cancellation:Xji,per_seat_enabled:Zji,max_seats_limit:Jji,trial_enabled:eFi,trial_duration:tFi,allow_query_overrides:nFi,allow_plan_changes:iFi,plan_map:rFi,refund_period:sFi,webhook_configuration:oFi,purchase_page:aFi,email_bounced:lFi,email_spam_complaint:cFi,email_delivery:uFi,webhook_response:dFi,pdf_response:hFi,authentication_failure:fFi,pdf_failed:pFi,pdf_success:gFi,modified:mFi,html_mode:_Fi,html_mode_help:vFi,status_color_theme:bFi,load_color_theme:yFi,lang_Estonian:CFi,marked_credit_as_paid:wFi,marked_credits_as_paid:xFi,wait_for_loading:SFi,wait_for_saving:EFi,html_preview_warning:kFi,remaining:TFi,invoice_paid:IFi,activity_120:LFi,activity_121:AFi,activity_122:NFi,activity_123:DFi,activity_124:RFi,fpx:PFi,to_view_entity_set_password:OFi,unsubscribe:MFi,unsubscribed:jFi,unsubscribed_text:FFi,client_shipping_state:BFi,client_shipping_city:$Fi,client_shipping_postal_code:HFi,client_shipping_country:VFi,load_pdf:WFi,start_free_trial:zFi,start_free_trial_message:UFi,due_on_receipt:qFi,is_paid:KFi,age_group_paid:GFi,id:YFi,convert_to:QFi,client_currency:XFi,company_currency:ZFi,custom_emails_disabled_help:JFi,upgrade_to_add_company:e6i,file_saved_in_downloads_folder:t6i,small:n6i,quotes_backup_subject:i6i,credits_backup_subject:r6i,document_download_subject:s6i,reminder_message:o6i,gmail_credentials_invalid_subject:a6i,gmail_credentials_invalid_body:l6i,total_columns:c6i,view_task:u6i,cancel_invoice:d6i,changed_status:h6i,change_status:f6i,enable_touch_events:p6i,enable_touch_events_help:g6i,after_saving:m6i,view_record:_6i,enable_email_markdown:v6i,enable_email_markdown_help:b6i,enable_pdf_markdown:y6i,json_help:C6i,release_notes:w6i,upgrade_to_view_reports:x6i,started_tasks:S6i,stopped_tasks:E6i,approved_quote:k6i,approved_quotes:T6i,client_website:I6i,invalid_time:L6i,signed_in_as:A6i,total_results:N6i,restore_company_gateway:D6i,archive_company_gateway:R6i,delete_company_gateway:P6i,exchange_currency:O6i,tax_amount1:M6i,tax_amount2:j6i,tax_amount3:F6i,update_project:B6i,auto_archive_invoice_cancelled:$6i,auto_archive_invoice_cancelled_help:H6i,no_invoices_found:V6i,created_record:W6i,auto_archive_paid_invoices:z6i,auto_archive_paid_invoices_help:U6i,auto_archive_cancelled_invoices:q6i,auto_archive_cancelled_invoices_help:K6i,alternate_pdf_viewer:G6i,alternate_pdf_viewer_help:Y6i,currency_cayman_island_dollar:Q6i,download_report_description:X6i,left:Z6i,right:J6i,center:e8i,page_numbering:t8i,page_numbering_alignment:n8i,invoice_sent_notification_label:i8i,show_product_description:r8i,show_product_description_help:s8i,invoice_items:o8i,quote_items:a8i,profitloss:l8i,import_format:c8i,export_format:u8i,export_type:d8i,stop_on_unpaid:h8i,stop_on_unpaid_help:f8i,use_quote_terms:p8i,use_quote_terms_help:g8i,add_country:m8i,enable_tooltips:_8i,enable_tooltips_help:v8i,multiple_client_error:b8i,login_label:y8i,purchase_order:C8i,purchase_order_number:w8i,purchase_order_number_short:x8i,inventory_notification_subject:S8i,inventory_notification_body:E8i,activity_130:k8i,activity_131:T8i,activity_132:I8i,activity_133:L8i,activity_134:A8i,activity_135:N8i,activity_136:D8i,purchase_order_subject:R8i,purchase_order_message:P8i,view_purchase_order:O8i,purchase_orders_backup_subject:M8i,notification_purchase_order_viewed_subject:j8i,notification_purchase_order_viewed:F8i,purchase_order_date:B8i,purchase_orders:$8i,purchase_order_number_placeholder:H8i,accepted:V8i,activity_137:W8i,vendor_information:z8i,notification_purchase_order_accepted_subject:U8i,notification_purchase_order_accepted:q8i,amount_received:K8i,purchase_order_already_expensed:G8i,convert_to_expense:Y8i,add_to_inventory:Q8i,added_purchase_order_to_inventory:X8i,added_purchase_orders_to_inventory:Z8i,client_document_upload:J8i,vendor_document_upload:e7i,vendor_document_upload_help:t7i,are_you_enjoying_the_app:n7i,yes_its_great:i7i,not_so_much:r7i,would_you_rate_it:s7i,would_you_tell_us_more:o7i,sure_happy_to:a7i,no_not_now:l7i,add:c7i,last_sent_template:u7i,enable_flexible_search:d7i,enable_flexible_search_help:h7i,vendor_details:f7i,purchase_order_details:p7i,qr_iban:g7i,besr_id:m7i,clone_to_purchase_order:_7i,vendor_email_not_set:v7i,bulk_send_email:b7i,marked_purchase_order_as_sent:y7i,marked_purchase_orders_as_sent:C7i,accepted_purchase_order:w7i,accepted_purchase_orders:x7i,cancelled_purchase_order:S7i,cancelled_purchase_orders:E7i,please_select_a_vendor:k7i,purchase_order_total:T7i,email_purchase_order:I7i,bulk_email_purchase_order:L7i,disconnected_email:A7i,connect_email:N7i,disconnect_email:D7i,use_web_app_to_connect_microsoft:R7i,email_provider:P7i,connect_microsoft:O7i,disconnect_microsoft:M7i,connected_microsoft:j7i,disconnected_microsoft:F7i,microsoft_sign_in:B7i,microsoft_sign_up:$7i,emailed_purchase_order:H7i,emailed_purchase_orders:V7i,enable_react_app:W7i,purchase_order_design:z7i,purchase_order_terms:U7i,purchase_order_footer:q7i,require_purchase_order_signature:K7i,require_purchase_order_signature_help:G7i,new_purchase_order:Y7i,edit_purchase_order:Q7i,created_purchase_order:X7i,updated_purchase_order:Z7i,archived_purchase_order:J7i,deleted_purchase_order:eBi,removed_purchase_order:tBi,restored_purchase_order:nBi,search_purchase_order:iBi,search_purchase_orders:rBi,login_url:sBi,enable_applying_payments:oBi,enable_applying_payments_help:aBi,stock_quantity:lBi,notification_threshold:cBi,track_inventory:uBi,track_inventory_help:dBi,stock_notifications:hBi,stock_notifications_help:fBi,vat:pBi,view_map:gBi,set_default_design:mBi,purchase_order_issued_to:_Bi,archive_task_status:vBi,delete_task_status:bBi,restore_task_status:yBi,lang_Hebrew:CBi,price_change_accepted:wBi,price_change_failed:xBi,restore_purchases:SBi,activate:EBi,connect_apple:kBi,disconnect_apple:TBi,disconnected_apple:IBi,send_now:LBi,received:ABi,converted_to_expense:NBi,converted_to_expenses:DBi,entity_removed:RBi,entity_removed_title:PBi,field:OBi,period:MBi,fields_per_row:jBi,total_active_invoices:FBi,total_outstanding_invoices:BBi,total_completed_payments:$Bi,total_refunded_payments:HBi,total_active_quotes:VBi,total_approved_quotes:WBi,total_unapproved_quotes:zBi,total_logged_tasks:UBi,total_invoiced_tasks:qBi,total_paid_tasks:KBi,total_logged_expenses:GBi,total_pending_expenses:YBi,total_invoiced_expenses:QBi,total_invoice_paid_expenses:XBi,vendor_portal:ZBi,send_code:JBi,save_to_upload_documents:e9i,expense_tax_rates:t9i,invoice_item_tax_rates:n9i,verified_phone_number:i9i,code_was_sent:r9i,resend:s9i,verify:o9i,enter_phone_number:a9i,invalid_phone_number:l9i,verify_phone_number:c9i,verify_phone_number_help:u9i,merged_clients:d9i,merge_into:h9i,php81_required:f9i,bulk_email_purchase_orders:p9i,bulk_email_invoices:g9i,bulk_email_quotes:m9i,bulk_email_credits:_9i,archive_purchase_order:v9i,restore_purchase_order:b9i,delete_purchase_order:y9i,connect:C9i,mark_paid_payment_email:w9i,convert_to_project:x9i,client_email:S9i,invoice_task_project:E9i,invoice_task_project_help:k9i,bulk_action:T9i,phone_validation_error:I9i,transaction:L9i,disable_2fa:A9i,change_number:N9i,resend_code:D9i,base_type:R9i,category_type:P9i,bank_transaction:O9i,bulk_print:M9i,vendor_postal_code:j9i,preview_location:F9i,bottom:B9i,side:$9i,pdf_preview:H9i,long_press_to_select:V9i,purchase_order_item:W9i,would_you_rate_the_app:z9i,include_deleted:U9i,include_deleted_help:q9i,due_on:K9i,browser_pdf_viewer:G9i,browser_pdf_viewer_help:Y9i,converted_transactions:Q9i,default_category:X9i,connect_accounts:Z9i,manage_rules:J9i,search_category:e$i,search_categories:t$i,min_amount:n$i,max_amount:i$i,converted_transaction:r$i,convert_to_payment:s$i,deposit:o$i,withdrawal:a$i,deposits:l$i,withdrawals:c$i,matched:u$i,unmatched:d$i,create_credit:h$i,transactions:f$i,new_transaction:p$i,edit_transaction:g$i,created_transaction:m$i,updated_transaction:_$i,archived_transaction:v$i,deleted_transaction:b$i,removed_transaction:y$i,restored_transaction:C$i,search_transaction:w$i,search_transactions:x$i,deleted_bank_account:S$i,removed_bank_account:E$i,restored_bank_account:k$i,search_bank_account:T$i,search_bank_accounts:I$i,code_was_sent_to:L$i,verify_phone_number_2fa_help:A$i,enable_applying_payments_later:N$i,line_item_tax_rates:D$i,show_tasks_in_client_portal:R$i,notification_quote_expired_subject:P$i,notification_quote_expired:O$i,auto_sync:M$i,refresh_accounts:j$i,upgrade_to_connect_bank_account:F$i,click_here_to_connect_bank_account:B$i,include_tax:$$i,email_template_change:H$i,task_update_authorization_error:V$i,cash_vs_accrual:W$i,cash_vs_accrual_help:z$i,expense_paid_report:U$i,expense_paid_report_help:q$i,online_payment_email_help:K$i,manual_payment_email_help:G$i,mark_paid_payment_email_help:Y$i,linked_transaction:Q$i,link_payment:X$i,link_expense:Z$i,lock_invoiced_tasks:J$i,lock_invoiced_tasks_help:eHi,registration_required_help:tHi,use_inventory_management:nHi,use_inventory_management_help:iHi,optional_products:rHi,optional_recurring_products:sHi,convert_matched:oHi,auto_billed_invoice:aHi,auto_billed_invoices:lHi,operator:cHi,value:uHi,is:dHi,contains:hHi,starts_with:fHi,is_empty:pHi,add_rule:gHi,match_all_rules:mHi,match_all_rules_help:_Hi,auto_convert_help:vHi,rules:bHi,transaction_rule:yHi,transaction_rules:CHi,new_transaction_rule:wHi,edit_transaction_rule:xHi,created_transaction_rule:SHi,updated_transaction_rule:EHi,archived_transaction_rule:kHi,deleted_transaction_rule:THi,removed_transaction_rule:IHi,restored_transaction_rule:LHi,search_transaction_rule:AHi,search_transaction_rules:NHi,"payment_type_Interac E-Transfer":"Interac E-Transfer",delete_bank_account:DHi,archive_transaction:RHi,delete_transaction:PHi,otp_code_message:OHi,otp_code_subject:MHi,otp_code_body:jHi,delete_tax_rate:FHi,restore_tax_rate:BHi,company_backup_file:$Hi,company_backup_file_help:HHi,backup_restore:VHi,export_company:WHi,backup:zHi,notification_purchase_order_created_body:UHi,notification_purchase_order_created_subject:qHi,notification_purchase_order_sent_subject:KHi,notification_purchase_order_sent:GHi,subscription_blocked:YHi,subscription_blocked_title:QHi,purchase_order_created:XHi,purchase_order_sent:ZHi,purchase_order_viewed:JHi,purchase_order_accepted:eVi,credit_payment_error:tVi,convert_payment_currency_help:nVi,convert_expense_currency_help:iVi,matomo_url:rVi,matomo_id:sVi,action_add_to_invoice:oVi,danger_zone:aVi,import_completed:lVi,client_statement_body:cVi,email_queued:uVi,clone_to_recurring_invoice:dVi,inventory_threshold:hVi,emailed_statement:fVi,show_email_footer:pVi,invoice_task_hours:gVi,invoice_task_hours_help:mVi,auto_bill_standard_invoices:_Vi,auto_bill_recurring_invoices:vVi,email_alignment:bVi,pdf_preview_location:yVi,mailgun:CVi,brevo:wVi,postmark:xVi,microsoft:SVi,click_plus_to_create_record:EVi,last365_days:kVi,import_design:TVi,imported_design:IVi,invalid_design:LVi,setup_wizard_logo:AVi,installed_version:NVi,notify_vendor_when_paid:DVi,notify_vendor_when_paid_help:RVi,update_payment:PVi,markup:OVi,unlock_pro:MVi,upgrade_to_paid_plan_to_schedule:jVi,next_run:FVi,all_clients:BVi,show_aging_table:$Vi,show_payments_table:HVi,only_clients_with_invoices:VVi,email_statement:WVi,once:zVi,schedules:UVi,new_schedule:qVi,edit_schedule:KVi,created_schedule:GVi,updated_schedule:YVi,archived_schedule:QVi,deleted_schedule:XVi,removed_schedule:ZVi,restored_schedule:JVi,search_schedule:eWi,search_schedules:tWi,update_product:nWi,create_purchase_order:iWi,update_purchase_order:rWi,sent_invoice:sWi,sent_quote:oWi,sent_credit:aWi,sent_purchase_order:lWi,image_url:cWi,max_quantity:uWi,test_url:dWi,auto_bill_help_off:hWi,auto_bill_help_optin:fWi,auto_bill_help_optout:pWi,auto_bill_help_always:gWi,view_all:mWi,edit_all:_Wi,accept_purchase_order_number:vWi,accept_purchase_order_number_help:bWi,from_email:yWi,show_preview:CWi,show_paid_stamp:wWi,show_shipping_address:xWi,no_documents_to_download:SWi,pixels:EWi,logo_size:kWi,failed:TWi,client_contacts:IWi,sync_from:LWi,gateway_payment_text:AWi,gateway_payment_text_no_invoice:NWi,click_to_variables:DWi,ship_to:RWi,stripe_direct_debit_details:PWi,branch_name:OWi,branch_code:MWi,bank_name:jWi,bank_code:FWi,bic:BWi,change_plan_description:$Wi,add_company_logo:HWi,add_stripe:VWi,invalid_coupon:WWi,no_assigned_tasks:zWi,authorization_failure:UWi,authorization_sms_failure:qWi,white_label_body:KWi,payment_type_Klarna:GWi,"payment_type_Interac E Transfer":"Interac E Transfer",xinvoice_payable:YWi,xinvoice_no_buyers_reference:QWi,xinvoice_online_payment:XWi,pre_payment:ZWi,number_of_payments:JWi,number_of_payments_helper:ezi,pre_payment_indefinitely:tzi,notification_payment_emailed:nzi,notification_payment_emailed_subject:izi,record_not_found:rzi,minimum_payment_amount:szi,client_initiated_payments:ozi,client_initiated_payments_help:azi,share_invoice_quote_columns:lzi,cc_email:czi,payment_balance:uzi,view_report_permission:dzi,activity_138:hzi,one_time_products:fzi,optional_one_time_products:pzi,required:gzi,hidden:mzi,payment_links:_zi,payment_link:vzi,new_payment_link:bzi,edit_payment_link:yzi,created_payment_link:Czi,updated_payment_link:wzi,archived_payment_link:xzi,deleted_payment_link:Szi,removed_payment_link:Ezi,restored_payment_link:kzi,search_payment_link:Tzi,search_payment_links:Izi,increase_prices:Lzi,update_prices:Azi,incresed_prices:Nzi,updated_prices:Dzi,api_token:Rzi,api_key:Pzi,endpoint:Ozi,not_billable:Mzi,allow_billable_task_items:jzi,allow_billable_task_items_help:Fzi,show_task_item_description:Bzi,show_task_item_description_help:$zi,email_record:Hzi,invoice_product_columns:Vzi,quote_product_columns:Wzi,vendors:zzi,product_sales:Uzi,user_sales_report_header:qzi,client_balance_report:Kzi,client_sales_report:Gzi,user_sales_report:Yzi,aged_receivable_detailed_report:Qzi,aged_receivable_summary_report:Xzi,taxable_amount:Zzi,tax_summary:Jzi,oauth_mail:eUi,preferences:tUi,analytics:nUi,reduced_rate:iUi,tax_all:rUi,tax_selected:sUi,version:oUi,seller_subregion:aUi,calculate_taxes:lUi,calculate_taxes_help:cUi,link_expenses:uUi,converted_client_balance:dUi,converted_payment_balance:hUi,total_hours:fUi,date_picker_hint:pUi,app_help_link:gUi,here:mUi,"industry_Restaurant & Catering":"Restaurant & Catering",show_credits_table:_Ui,manual_payment:vUi,tax_summary_report:bUi,tax_category:yUi,physical_goods:CUi,digital_products:wUi,services:xUi,shipping:SUi,tax_exempt:EUi,late_fee_added_locked_invoice:kUi,lang_Khmer:TUi,routing_id:IUi,enable_e_invoice:LUi,e_invoice_type:AUi,reduced_tax:NUi,override_tax:DUi,zero_rated:RUi,reverse_tax:PUi,updated_tax_category:OUi,updated_tax_categories:MUi,set_tax_category:jUi,payment_manual:FUi,expense_payment_type:BUi,"payment_type_Cash App":"Cash App",rename:$Ui,renamed_document:HUi,e_invoice:VUi,light_dark_mode:WUi,activities:zUi,recent_transactions:UUi,country_Palestine:qUi,country_Taiwan:KUi,duties:GUi,order_number:YUi,order_id:QUi,total_invoices_outstanding:XUi,recent_activity:ZUi,enable_auto_bill:JUi,email_count_invoices:eqi,invoice_task_item_description:tqi,invoice_task_item_description_help:nqi,next_send_time:iqi,uploaded_certificate:rqi,certificate_set:sqi,certificate_not_set:oqi,passphrase_set:aqi,passphrase_not_set:lqi,upload_certificate:cqi,certificate_passphrase:uqi,valid_vat_number:dqi,react_notification_link:hqi,react_notification_link_help:fqi,show_task_billable:pqi,credit_item:gqi,drop_file_here:mqi,files:_qi,camera:vqi,gallery:bqi,project_location:yqi,add_gateway_help_message:Cqi,lang_Hungarian:wqi,use_mobile_to_manage_plan:xqi,item_tax3:Sqi,item_tax_rate1:Eqi,item_tax_rate2:kqi,item_tax_rate3:Tqi,buy_price:Iqi,country_Macedonia:Lqi,admin_initiated_payments:Aqi,admin_initiated_payments_help:Nqi,paid_date:Dqi,downloaded_entities:Rqi,"lang_French - Swiss":"French - Swiss",currency_swazi_lilangeni:Pqi,income:Oqi,amount_received_help:Mqi,vendor_phone:jqi,mercado_pago:Fqi,mybank:Bqi,paypal_paylater:$qi,district:Hqi,region:Vqi,county:Wqi,tax_details:zqi,activity_10_online:Uqi,activity_10_manual:qqi,default_payment_type:Kqi,number_precision:Gqi,number_precision_help:Yqi,is_tax_exempt:Qqi,drop_files_here:Xqi,upload_files:Zqi,download_e_invoice:Jqi,download_e_credit:eKi,download_e_quote:tKi,triangular_tax_info:nKi,intracommunity_tax_info:iKi,reverse_tax_info:rKi,currency_nicaraguan_cordoba:sKi,public:"Public",private:"Private",image:oKi,other:aKi,linked_to:lKi,file_saved_in_path:cKi,unlinked_transactions:uKi,unlinked_transaction:dKi,view_dashboard_permission:hKi,marked_sent_credits:fKi,show_document_preview:pKi,cash_accounting:gKi,click_or_drop_files_here:mKi,set_public:_Ki,set_private:vKi,individual:bKi,business:yKi,partnership:CKi,trust:wKi,charity:xKi,government:SKi,in_stock_quantity:EKi,vendor_contact:kKi,expense_status_4:TKi,expense_status_5:IKi,ziptax_help:LKi,cache_data:AKi,unknown:NKi,webhook_failure:DKi,email_opened:RKi,email_delivered:PKi,log:OKi,classification:MKi,stock_quantity_number:jKi,upcoming:FKi,client_contact:BKi,uncategorized:$Ki,login_notification:HKi,login_notification_help:VKi,payment_refund_receipt:WKi,payment_receipt:zKi,load_template_description:UKi,run_template:qKi,statement_design:KKi,delivery_note_design:GKi,payment_receipt_design:YKi,payment_refund_design:QKi,task_extension_banner:XKi,watch_video:ZKi,view_extension:JKi,reactivate_email:eGi,email_reactivated:tGi,template_help:nGi,quarter:iGi,item_description:rGi,task_item:sGi,record_state:oGi,save_files_to_this_folder:aGi,downloads_folder:lGi,total_invoiced_quotes:cGi,total_invoice_paid_quotes:uGi,downloads_folder_does_not_exist:dGi,user_logged_in_notification:hGi,user_logged_in_notification_help:fGi,payment_email_all_contacts:pGi,payment_email_all_contacts_help:gGi,add_line:mGi,activity_139:_Gi,vendor_notification_subject:vGi,vendor_notification_body:bGi,receipt:yGi,charges:CGi,email_report:wGi,"payment_type_Pay Later":"Pay Later",payment_type_credit:xGi,payment_type_debit:SGi,send_emails_to:EGi,primary_contact:kGi,all_contacts:TGi,insert_below:IGi,nordigen_handler_subtitle:LGi,nordigen_handler_error_heading_unknown:AGi,nordigen_handler_error_contents_unknown:NGi,nordigen_handler_error_heading_token_invalid:DGi,nordigen_handler_error_contents_token_invalid:RGi,nordigen_handler_error_heading_account_config_invalid:PGi,nordigen_handler_error_contents_account_config_invalid:OGi,nordigen_handler_error_heading_not_available:MGi,nordigen_handler_error_contents_not_available:jGi,nordigen_handler_error_heading_institution_invalid:FGi,nordigen_handler_error_contents_institution_invalid:BGi,nordigen_handler_error_heading_ref_invalid:$Gi,nordigen_handler_error_contents_ref_invalid:HGi,nordigen_handler_error_heading_eua_failure:VGi,nordigen_handler_error_contents_eua_failure:WGi,nordigen_handler_error_heading_not_found:zGi,nordigen_handler_error_contents_not_found:UGi,nordigen_handler_error_heading_requisition_invalid_status:qGi,nordigen_handler_error_contents_requisition_invalid_status:KGi,nordigen_handler_error_heading_requisition_no_accounts:GGi,nordigen_handler_error_contents_requisition_no_accounts:YGi,nordigen_handler_restart:QGi,nordigen_handler_return:XGi,lang_Lao:ZGi,currency_lao_kip:JGi,yodlee_regions:eYi,nordigen_regions:tYi,select_provider:nYi,nordigen_requisition_subject:iYi,nordigen_requisition_body:rYi,participant:sYi,participant_name:oYi,client_unsubscribed:aYi,client_unsubscribed_help:lYi,resubscribe:cYi,subscribe:uYi,subscribe_help:dYi,unsubscribe_help:hYi,notification_purchase_order_bounced:fYi,notification_purchase_order_bounced_subject:pYi,show_pdfhtml_on_mobile:gYi,show_pdfhtml_on_mobile_help:mYi,please_select_an_invoice_or_credit:_Yi,mobile_version:vYi,venmo:bYi,my_bank:yYi,pay_later:CYi,local_domain:wYi,verify_peer:xYi,nordigen_help:SYi,ar_detailed:EYi,ar_summary:kYi,client_sales:TYi,user_sales:IYi,iframe_url:LYi,user_unsubscribed:AYi,out_of_stock:NYi,step_dependency_fail:DYi,step_dependency_order_fail:RYi,step_authentication_fail:PYi,"auth.login":"Login","auth.login-or-register":"Login or Register","auth.register":"Register",cart:OYi,methods:MYi,rff:jYi,add_step:FYi,steps:BYi,steps_order_help:$Yi,other_steps:HYi,use_available_payments:VYi,test_email_sent:WYi,gateway_type:zYi,save_template_body:UYi,save_as_template:qYi,checkout_only_for_existing_customers:KYi,checkout_only_for_new_customers:GYi,auto_bill_standard_invoices_help:YYi,auto_bill_on_help:QYi,use_available_credits_help:XYi,use_unapplied_payments:ZYi,use_unapplied_payments_help:JYi,payment_terms_help:eQi,payment_type_help:tQi,quote_valid_until_help:nQi,expense_payment_type_help:iQi,paylater:rQi,payment_provider:sQi,select_email_provider:oQi,purchase_order_items:aQi,csv_rows_length:lQi,accept_payments_online:cQi,all_payment_gateways:uQi,product_cost:dQi,duration_words:hQi,upcoming_recurring_invoices:fQi,shipping_country_id:pQi,show_table_footer:gQi,show_table_footer_help:mQi,total_invoices:_Qi,add_to_group:vQi,check_credentials:bQi,valid_credentials:yQi,e_quote:CQi,e_credit:wQi,e_purchase_order:xQi,e_quote_type:SQi,unlock_unlimited_clients:EQi,download_e_purchase_order:kQi,flutter_web_warning:TQi,rappen_rounding:IQi,rappen_rounding_help:LQi,assign_group:AQi,paypal_advanced_cards:NQi,local_domain_help:DQi,port_help:RQi,host_help:PQi,always_show_required_fields:OQi,always_show_required_fields_help:MQi,advanced_cards:jQi,activity_140:FQi,invoice_net_amount:BQi,round_to_minutes:$Qi,"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:HQi,round_tasks_help:VQi,direction:WQi,round_up:zQi,round_down:UQi,task_round_to_nearest:qQi,task_round_to_nearest_help:KQi,bulk_updated:GQi,bulk_update:YQi,calculate:QQi,sum:XQi,money:ZQi,web_app:JQi,desktop_app:eXi,disconnected:tXi,reconnect:nXi,e_invoice_settings:iXi,btcpay_refund_subject:rXi,btcpay_refund_body:sXi,currency_mauritanian_ouguiya:oXi,currency_bhutan_ngultrum:aXi,end_of_month:lXi,merge_e_invoice_to_pdf:cXi,task_assigned_subject:uXi,task_assigned_body:dXi,activity_141:hXi,quote_reminder_subject:fXi,quote_reminder_message:pXi,quote_reminder1:gXi,before_valid_until_date:mXi,after_valid_until_date:_Xi,after_quote_date:vXi,remind_quote:bXi,tax_currency_mismatch:yXi,edocument_import_already_exists:CXi,before_valid_until:wXi,after_valid_until:xXi,task_assigned_notification:SXi,task_assigned_notification_help:EXi,invoices_locked_end_of_month:kXi,referral_url:TXi,add_comment:IXi,added_comment:LXi,tickets:AXi,assigned_group:NXi,merge_to_pdf:DXi,latest_requires_php_version:RXi,auto_expand_product_table_notes:PXi,auto_expand_product_table_notes_help:OXi,institution_number:MXi,transit_number:jXi,personal:FXi,address_information:BXi,enter_the_information_for_the_bank_account:$Xi,account_holder_information:HXi,enter_information_for_the_account_holder:VXi,customer_type:WXi,process_date:zXi,forever_free:UXi,comments_only:qXi,payment_balance_on_file:KXi,ubl_email_attachment_help:GXi,stop_task_to_add_task_entry:YXi,xml_file:QXi,one_page_checkout:XXi,one_page_checkout_help:ZXi,applies_to:JXi,accept_purchase_order:eZi,round_to_seconds:tZi,activity_142:nZi,activity_143:iZi,activity_144:rZi,activity_145:sZi,payment_failed:oZi,ssl_host_override:aZi,upload_logo_short:lZi,country_Melilla:cZi,country_Ceuta:uZi,"country_Canary Islands":"Canary Islands",lang_Vietnamese:dZi,invoice_status_changed:hZi,no_unread_notifications:fZi,how_to_import_data:pZi,download_example_file:gZi,expense_mailbox:mZi,expense_mailbox_help:_Zi,expense_mailbox_active:vZi,expense_mailbox_active_help:bZi,inbound_mailbox_allow_company_users:yZi,inbound_mailbox_allow_company_users_help:CZi,inbound_mailbox_allow_vendors:wZi,inbound_mailbox_allow_vendors_help:xZi,inbound_mailbox_allow_clients:SZi,inbound_mailbox_allow_clients_help:EZi,inbound_mailbox_whitelist:kZi,inbound_mailbox_whitelist_help:TZi,inbound_mailbox_blacklist:IZi,inbound_mailbox_blacklist_help:LZi,inbound_mailbox_allow_unknown:AZi,inbound_mailbox_allow_unknown_help:NZi,quick_actions:DZi,end_all_sessions_help:RZi,updated_records:PZi,vat_not_registered:OZi,small_company_info:MZi,peppol_onboarding:jZi,get_started:FZi,configure_peppol:BZi,step:$Zi,peppol_whitelabel_warning:HZi,peppol_plan_warning:VZi,peppol_credits_info:WZi,buy_credits:zZi,peppol_successfully_configured:UZi,peppol_not_paid_message:qZi,peppol_country_not_supported:KZi,peppol_disconnect:GZi,peppol_disconnect_short:YZi,peppol_disconnect_long:QZi,log_duration_words:XZi,log_duration:ZZi,merged_vendors:JZi,hidden_taxes_warning:eJi,tax3:tJi,negative_payment_warning:nJi,currency_bermudian_dollar:iJi,currency_central_african_cfa_franc:rJi,currency_congolese_franc:sJi,currency_djiboutian_franc:oJi,currency_eritrean_nakfa:aJi,currency_falkland_islands_pound:lJi,currency_guinean_franc:cJi,currency_iraqi_dinar:uJi,currency_lesotho_loti:dJi,currency_mongolian_tugrik:hJi,currency_seychellois_rupee:fJi,currency_solomon_islands_dollar:pJi,currency_somali_shilling:gJi,currency_south_sudanese_pound:mJi,currency_sudanese_pound:_Ji,currency_tajikistani_somoni:vJi,currency_turkmenistani_manat:bJi,currency_uzbekistani_som:yJi,payment_status_changed:CJi,credit_status_changed:wJi,credit_updated:xJi,payment_updated:SJi,search_placeholder:EJi,invalid_vat_number:kJi,acts_as_sender:TJi,acts_as_receiver:IJi,peppol_token_generated:LJi,peppol_token_description:AJi,peppol_token_warning:NJi,generate_token:DJi,total_credits_amount:RJi,sales_above_threshold:PJi,changing_vat_and_id_number_note:OJi,iban_help:MJi,bic_swift:jJi,bic_swift_help:FJi,payer_bank_account:BJi,payer_bank_account_help:$Ji,bsb_sort:HJi,bsb_sort_help:VJi,card_type:WJi,card_type_help:zJi,card_number_help:UJi,card_holder:qJi,tokenize:KJi,tokenize_help:GJi,credit_card_stripe_help:YJi,bank_transfer_stripe_help:QJi,alipay_stripe_help:XJi,sofort_stripe_help:ZJi,apple_pay_stripe_help:JJi,sepa_stripe_help:eer,bancontact_stripe_help:ter,ideal_stripe_help:ner,giropay_stripe_help:ier,przelewy24_stripe_help:rer,direct_debit_stripe_help:ser,eps_stripe_help:oer,acss_stripe_help:aer,becs_stripe_help:ler,klarna_stripe_help:cer,bacs_stripe_help:uer,fpx_stripe_help:der,payment_means:her,act_as_sender:fer,act_as_receiver:per,saved_einvoice_details:ger,add_license_to_env:mer,white_label_license_not_present:_er,white_label_license_not_found:ver,details_update_info:ber,client_address_required:yer,connected:Cer,email_count_quotes:wer,activity_146:xer,activity_147:Ser,peppol_routing_problem:Eer,peppol_sending_failed:ker,peppol_cleared_for_sending:Ter,account_holder:Ier,account_holder_help:Ler,activity_148:Aer,additional_tax_identifiers:Ner,additional_tax_identifiers_help:Der,configure:Rer,new_identifier:Per,notification_credits_low:Oer,notification_credits_low_text:Mer,notification_no_credits:jer,notification_no_credits_text:Fer,saved_comment:Ber,acts_as_must_be_true:$er,delete_identifier:Her,delete_identifier_description:Ver,einvoice_something_went_wrong:Wer,download_ready:zer,notification_quote_reminder1_sent_subject:Uer,custom_reminder_sent:qer,use_system_fonts:Ker,use_system_fonts_help:Ger,active_tasks:Yer,enable_notifications:Qer,enable_public_notifications:Xer,enable_public_notifications_help:Zer,navigate:Jer,calculate_taxes_warning:etr,activity_149:ttr,email_history_empty:ntr,e_invoicing:itr,einvoice_token_not_found:rtr,regenerate:str,subscription_unavailable:otr,currency_samoan_tala:atr,confirm_duplicate_gateway:ltr,clients_limit:ctr,remaining_hours:utr,just_now:dtr,yesterday:htr,enable_client_profile_update:ftr,enable_client_profile_update_help:ptr,preference_product_notes_for_html_view:gtr,preference_product_notes_for_html_view_help:mtr,project_report:_tr,unlock_invoice_documents_after_payment:vtr,unlock_invoice_documents_after_payment_help:btr,quickbooks:ytr,disable_emails:Ctr,disable_emails_error:wtr,disable_emails_help:xtr,add_location:Str,updated_location:Etr,created_location:ktr,sync_send_time:Ttr,sync_send_time_help:Itr,edit_location:Ltr,downgrade:Atr,downgrade_to_free:Ntr,downgrade_to_free_description:Dtr,delete_location:Rtr,delete_location_confirmation:Ptr,add_card_reminder:Otr,free_trial_then:Mtr,days_left:jtr,days_trial:Ftr,pro_plan_label:Btr,enterprise_plan_label:$tr,premium_business_plus_label:Htr,pro_plan_feature_1:Vtr,pro_plan_feature_2:Wtr,pro_plan_feature_3:ztr,pro_plan_feature_4:Utr,pro_plan_feature_5:qtr,pro_plan_feature_6:Ktr,pro_plan_feature_7:Gtr,pro_plan_feature_8:Ytr,pro_plan_feature_9:Qtr,pro_plan_feature_10:Xtr,pro_plan_feature_11:Ztr,pro_plan_feature_12:Jtr,pro_plan_feature_13:enr,pro_plan_feature_14:tnr,pro_plan_feature_15:nnr,pro_plan_feature_16:inr,pro_plan_feature_17:rnr,pro_plan_feature_18:snr,enterprise_plan_feature_1:onr,enterprise_plan_feature_2:anr,enterprise_plan_feature_3:lnr,enterprise_plan_feature_4:cnr,premium_business_plus_feature_1:unr,premium_business_plus_feature_2:dnr,premium_business_plus_feature_3:hnr,premium_business_plus_feature_4:fnr,premium_business_plus_feature_5:pnr,premium_business_plus_feature_6:gnr,upgrade_popup_headline:mnr,upgrade_popup_description:_nr,upgrade_popup_pro_headline:vnr,upgrade_popup_enterprise_headline:bnr,upgrade_popup_premium_business_plus_headline:ynr,all_free_features_plus:Cnr,all_pro_features_plus:wnr,all_features_plus:xnr,upgrade_plan:Snr,upgrade_popup_premium_business_plus_pricing:Enr,plan_selected:knr,invalid_date_create_syntax:Tnr,start_and_end_date_required:Inr,project_value:Lnr,invalid_csv_data:Anr,selected_products:Nnr,create_company_error_unauthorized:Dnr,deleted_location:Rnr,currency_caribbean_guilder:Pnr,is_shipping:Onr,added_location:Mnr,send_emails:jnr,send_emails_permission:Fnr,cancel_trial:Bnr,cancel_trial_description:$nr,existing_gateway:Hnr,activity_150:Vnr,docuninja:Wnr,pro_rata:znr,change_docuninja_plan:Unr,downgrade_end_of_cycle:qnr,docuninja_change_users:Knr,docuninja_disable_warning:Gnr,docuninja_downgrade_info:Ynr,recurring_invoice_item:Qnr,disable_recurring_payment_notification:Xnr,disable_recurring_payment_notification_help:Znr,invoice_outstanding_tasks:Jnr,payment_schedule:eir,time_zone:tir,tax_names:nir,auto_bill_help:iir,choose_schedule_type:rir,split_payments:sir,split_payments_help:oir,custom_schedule:air,custom_schedule_help:lir,schedule_frequency_help:cir,first_payment_date:uir,first_payment_date_help:dir,payment_schedule_interval:hir,payment_schedule_table:fir,auto_send:pir,auto_send_help:gir,include_project_tasks:mir,include_project_tasks_help:_ir,tax_nexus:vir,tax_period_report:bir,creator:yir,ses_topic_arn_help:Cir,ses_region_help:wir,ses_secret_key:xir,ses_access_key:Sir,activity_151:Eir,activity_152:kir,activity_153:Tir,lifecycle:Iir,order_columns:Lir,topic_arn:Air,lang_Catalan:Nir,lang_Afrikaans:Dir,lang_Indonesian:Rir,replaced:Pir};x.lazy(()=>ue(()=>Promise.resolve().then(()=>_Gt),void 0).then(n=>({default:n.GoogleOAuthProvider})));function Mir({children:n}){return h.jsx(h.Fragment,{children:n})}function jir(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 Fir(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function R6e(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 P6e(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?R6e(Object(t),!0).forEach(function(i){Fir(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):R6e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Bir(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function $ir(n,e){if(n==null)return{};var t=Bir(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Hir(n,e){return Vir(n)||Wir(n,e)||zir(n,e)||Uir()}function Vir(n){if(Array.isArray(n))return n}function Wir(n,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(n)))){var t=[],i=!0,r=!1,s=void 0;try{for(var o=n[Symbol.iterator](),a;!(i=(a=o.next()).done)&&(t.push(a.value),!(e&&t.length===e));i=!0);}catch(l){r=!0,s=l}finally{try{!i&&o.return!=null&&o.return()}finally{if(r)throw s}}return t}}function zir(n,e){if(n){if(typeof n=="string")return O6e(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 O6e(n,e)}}function O6e(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 Uir(){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 qir(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function M6e(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 j6e(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?M6e(Object(t),!0).forEach(function(i){qir(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):M6e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Kir(){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,s){return s(r)},i)}}function qj(n){return function e(){for(var t=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return r.length>=n.length?n.apply(this,r):function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return e.apply(t,[].concat(r,a))}}}function SK(n){return{}.toString.call(n).includes("Object")}function Gir(n){return!Object.keys(n).length}function Q8(n){return typeof n=="function"}function Yir(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Qir(n,e){return SK(e)||oE("changeType"),Object.keys(e).some(function(t){return!Yir(n,t)})&&oE("changeField"),e}function Xir(n){Q8(n)||oE("selectorType")}function Zir(n){Q8(n)||SK(n)||oE("handlerType"),SK(n)&&Object.values(n).some(function(e){return!Q8(e)})&&oE("handlersType")}function Jir(n){n||oE("initialIsRequired"),SK(n)||oE("initialType"),Gir(n)&&oE("initialContent")}function err(n,e){throw new Error(n[e]||n.default)}var trr={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"},oE=qj(err)(trr),VV={changes:Qir,selector:Xir,handler:Zir,initial:Jir};function nrr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};VV.initial(n),VV.handler(e);var t={current:n},i=qj(srr)(t,e),r=qj(rrr)(t),s=qj(VV.changes)(n),o=qj(irr)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return VV.selector(c),c(t.current)}function l(c){Kir(i,r,s,o)(c)}return[a,l]}function irr(n,e){return Q8(e)?e(n.current):e}function rrr(n,e){return n.current=j6e(j6e({},n.current),e),e}function srr(n,e,t){return Q8(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 orr={create:nrr},arr={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function lrr(n){return function e(){for(var t=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return r.length>=n.length?n.apply(this,r):function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return e.apply(t,[].concat(r,a))}}}function crr(n){return{}.toString.call(n).includes("Object")}function urr(n){return n||F6e("configIsRequired"),crr(n)||F6e("configType"),n.urls?(drr(),{paths:{vs:n.urls.monacoBase}}):n}function drr(){console.warn(Ost.deprecation)}function hrr(n,e){throw new Error(n[e]||n.default)}var Ost={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 `},F6e=lrr(hrr)(Ost),frr={config:urr},prr=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(s,o){return o(s)},r)}};function Mst(n,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&n[t]&&Object.assign(e[t],Mst(n[t],e[t]))}),P6e(P6e({},n),e)}var grr={type:"cancelation",msg:"operation is manually canceled"};function nce(n){var e=!1,t=new Promise(function(i,r){n.then(function(s){return e?r(grr):i(s)}),n.catch(r)});return t.cancel=function(){return e=!0},t}var mrr=orr.create({config:arr,isInitialized:!1,resolve:null,reject:null,monaco:null}),jst=Hir(mrr,2),$9=jst[0],$ee=jst[1];function _rr(n){var e=frr.config(n),t=e.monaco,i=$ir(e,["monaco"]);$ee(function(r){return{config:Mst(r.config,i),monaco:t}})}function vrr(){var n=$9(function(e){var t=e.monaco,i=e.isInitialized,r=e.resolve;return{monaco:t,isInitialized:i,resolve:r}});if(!n.isInitialized){if($ee({isInitialized:!0}),n.monaco)return n.resolve(n.monaco),nce(ice);if(window.monaco&&window.monaco.editor)return Fst(window.monaco),n.resolve(window.monaco),nce(ice);prr(brr,Crr)(wrr)}return nce(ice)}function brr(n){return document.body.appendChild(n)}function yrr(n){var e=document.createElement("script");return n&&(e.src=n),e}function Crr(n){var e=$9(function(i){var r=i.config,s=i.reject;return{config:r,reject:s}}),t=yrr("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return n()},t.onerror=e.reject,t}function wrr(){var n=$9(function(t){var i=t.config,r=t.resolve,s=t.reject;return{config:i,resolve:r,reject:s}}),e=window.require;e.config(n.config),e(["vs/editor/editor.main"],function(t){Fst(t),n.resolve(t)},function(t){n.reject(t)})}function Fst(n){$9().monaco||$ee({monaco:n})}function xrr(){return $9(function(n){var e=n.monaco;return e})}var ice=new Promise(function(n,e){return $ee({resolve:n,reject:e})}),Hee={config:_rr,init:vrr,__getMonacoInstance:xrr},Srr={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},rce=Srr,Err={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},krr=Err;function Trr({children:n}){return we.createElement("div",{style:krr.container},n)}var Irr=Trr,Lrr=Irr;function Arr({width:n,height:e,isEditorReady:t,loading:i,_ref:r,className:s,wrapperProps:o}){return we.createElement("section",{style:{...rce.wrapper,width:n,height:e},...o},!t&&we.createElement(Lrr,null,i),we.createElement("div",{ref:r,style:{...rce.fullWidth,...!t&&rce.hide},className:s}))}var Nrr=Arr,Bst=x.memo(Nrr);function Drr(n){x.useEffect(n,[])}var $st=Drr;function Rrr(n,e,t=!0){let i=x.useRef(!0);x.useEffect(i.current||!t?()=>{i.current=!1}:n,e)}var im=Rrr;function GF(){}function ER(n,e,t,i){return Prr(n,i)||Orr(n,e,t,i)}function Prr(n,e){return n.editor.getModel(Hst(n,e))}function Orr(n,e,t,i){return n.editor.createModel(e,t,i?Hst(n,i):void 0)}function Hst(n,e){return n.Uri.parse(e)}function Mrr({original:n,modified:e,language:t,originalLanguage:i,modifiedLanguage:r,originalModelPath:s,modifiedModelPath:o,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:f="100%",width:p="100%",className:g,wrapperProps:m={},beforeMount:_=GF,onMount:v=GF}){let[b,y]=x.useState(!1),[C,S]=x.useState(!0),k=x.useRef(null),I=x.useRef(null),L=x.useRef(null),N=x.useRef(v),P=x.useRef(_),O=x.useRef(!1);$st(()=>{let B=Hee.init();return B.then(W=>(I.current=W)&&S(!1)).catch(W=>(W==null?void 0:W.type)!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>k.current?M():B.cancel()}),im(()=>{if(k.current&&I.current){let B=k.current.getOriginalEditor(),W=ER(I.current,n||"",i||t||"text",s||"");W!==B.getModel()&&B.setModel(W)}},[s],b),im(()=>{if(k.current&&I.current){let B=k.current.getModifiedEditor(),W=ER(I.current,e||"",r||t||"text",o||"");W!==B.getModel()&&B.setModel(W)}},[o],b),im(()=>{let B=k.current.getModifiedEditor();B.getOption(I.current.editor.EditorOption.readOnly)?B.setValue(e||""):e!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[e],b),im(()=>{var B,W;(W=(B=k.current)==null?void 0:B.getModel())==null||W.original.setValue(n||"")},[n],b),im(()=>{let{original:B,modified:W}=k.current.getModel();I.current.editor.setModelLanguage(B,i||t||"text"),I.current.editor.setModelLanguage(W,r||t||"text")},[t,i,r],b),im(()=>{var B;(B=I.current)==null||B.editor.setTheme(c)},[c],b),im(()=>{var B;(B=k.current)==null||B.updateOptions(d)},[d],b);let F=x.useCallback(()=>{var q;if(!I.current)return;P.current(I.current);let B=ER(I.current,n||"",i||t||"text",s||""),W=ER(I.current,e||"",r||t||"text",o||"");(q=k.current)==null||q.setModel({original:B,modified:W})},[t,e,r,n,i,s,o]),V=x.useCallback(()=>{var B;!O.current&&L.current&&(k.current=I.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...d}),F(),(B=I.current)==null||B.editor.setTheme(c),y(!0),O.current=!0)},[d,c,F]);x.useEffect(()=>{b&&N.current(k.current,I.current)},[b]),x.useEffect(()=>{!C&&!b&&V()},[C,b,V]);function M(){var W,q,U,G;let B=(W=k.current)==null?void 0:W.getModel();a||((q=B==null?void 0:B.original)==null||q.dispose()),l||((U=B==null?void 0:B.modified)==null||U.dispose()),(G=k.current)==null||G.dispose()}return we.createElement(Bst,{width:p,height:f,isEditorReady:b,loading:u,_ref:L,className:g,wrapperProps:m})}var jrr=Mrr;x.memo(jrr);function Frr(n){let e=x.useRef();return x.useEffect(()=>{e.current=n},[n]),e.current}var Brr=Frr,WV=new Map;function $rr({defaultValue:n,defaultLanguage:e,defaultPath:t,value:i,language:r,path:s,theme:o="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p="100%",height:g="100%",className:m,wrapperProps:_={},beforeMount:v=GF,onMount:b=GF,onChange:y,onValidate:C=GF}){let[S,k]=x.useState(!1),[I,L]=x.useState(!0),N=x.useRef(null),P=x.useRef(null),O=x.useRef(null),F=x.useRef(b),V=x.useRef(v),M=x.useRef(),B=x.useRef(i),W=Brr(s),q=x.useRef(!1),U=x.useRef(!1);$st(()=>{let z=Hee.init();return z.then(Z=>(N.current=Z)&&L(!1)).catch(Z=>(Z==null?void 0:Z.type)!=="cancelation"&&console.error("Monaco initialization: error:",Z)),()=>P.current?H():z.cancel()}),im(()=>{var Z,X,oe,fe;let z=ER(N.current,n||i||"",e||r||"",s||t||"");z!==((Z=P.current)==null?void 0:Z.getModel())&&(d&&WV.set(W,(X=P.current)==null?void 0:X.saveViewState()),(oe=P.current)==null||oe.setModel(z),d&&((fe=P.current)==null||fe.restoreViewState(WV.get(s))))},[s],S),im(()=>{var z;(z=P.current)==null||z.updateOptions(c)},[c],S),im(()=>{!P.current||i===void 0||(P.current.getOption(N.current.editor.EditorOption.readOnly)?P.current.setValue(i):i!==P.current.getValue()&&(U.current=!0,P.current.executeEdits("",[{range:P.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),P.current.pushUndoStop(),U.current=!1))},[i],S),im(()=>{var Z,X;let z=(Z=P.current)==null?void 0:Z.getModel();z&&r&&((X=N.current)==null||X.editor.setModelLanguage(z,r))},[r],S),im(()=>{var z;a!==void 0&&((z=P.current)==null||z.revealLine(a))},[a],S),im(()=>{var z;(z=N.current)==null||z.editor.setTheme(o)},[o],S);let G=x.useCallback(()=>{var z;if(!(!O.current||!N.current)&&!q.current){V.current(N.current);let Z=s||t,X=ER(N.current,i||n||"",e||r||"",Z||"");P.current=(z=N.current)==null?void 0:z.editor.create(O.current,{model:X,automaticLayout:!0,...c},u),d&&P.current.restoreViewState(WV.get(Z)),N.current.editor.setTheme(o),a!==void 0&&P.current.revealLine(a),k(!0),q.current=!0}},[n,e,t,i,r,s,c,u,d,o,a]);x.useEffect(()=>{S&&F.current(P.current,N.current)},[S]),x.useEffect(()=>{!I&&!S&&G()},[I,S,G]),B.current=i,x.useEffect(()=>{var z,Z;S&&y&&((z=M.current)==null||z.dispose(),M.current=(Z=P.current)==null?void 0:Z.onDidChangeModelContent(X=>{U.current||y(P.current.getValue(),X)}))},[S,y]),x.useEffect(()=>{if(S){let z=N.current.editor.onDidChangeMarkers(Z=>{var oe;let X=(oe=P.current.getModel())==null?void 0:oe.uri;if(X&&Z.find(fe=>fe.path===X.path)){let fe=N.current.editor.getModelMarkers({resource:X});C==null||C(fe)}});return()=>{z==null||z.dispose()}}return()=>{}},[S,C]);function H(){var z,Z;(z=M.current)==null||z.dispose(),f?d&&WV.set(s,P.current.saveViewState()):(Z=P.current.getModel())==null||Z.dispose(),P.current.dispose()}return we.createElement(Bst,{width:p,height:g,isEditorReady:S,loading:l,_ref:O,className:m,wrapperProps:_})}var Hrr=$rr,Vrr=x.memo(Hrr),G5r=Vrr;function Kg(n,e=0){return n[n.length-(1+e)]}function Wrr(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function fa(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 zrr(n,e){const t=n.length-1;e<t&&(n[e]=n[t]),n.pop()}function X8(n,e,t){return Urr(n.length,i=>t(n[i],e))}function Urr(n,e){let t=0,i=n-1;for(;t<=i;){const r=(t+i)/2|0,s=e(r);if(s<0)t=r+1;else if(s>0)i=r-1;else return r}return-(t+1)}function gge(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=[],s=[],o=[];for(const a of e){const l=t(a,i);l<0?r.push(a):l>0?s.push(a):o.push(a)}return n<r.length?gge(n,r,t):n<r.length+o.length?o[0]:gge(n-(r.length+o.length),s,t)}function B6e(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*JEe(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 Vst(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 qrr(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 iv(n){return n.filter(e=>!!e)}function $6e(n){let e=0;for(let t=0;t<n.length;t++)n[t]&&(n[e]=n[t],e+=1);n.length=e}function Wst(n){return!Array.isArray(n)||n.length===0}function Gd(n){return Array.isArray(n)&&n.length>0}function Iw(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 eke(n,e){return n.length>0?n[0]:e}function Xh(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 Vee(n,e,t){const i=n.slice(0,e),r=n.slice(e);return i.concat(t,r)}function sce(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function zV(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function mge(n,e){for(const t of e)n.push(t)}function tke(n){return Array.isArray(n)?n:[n]}function Krr(n,e,t){const i=zst(n,e),r=n.length,s=t.length;n.length=r+s;for(let o=r-1;o>=i;o--)n[o+s]=n[o];for(let o=0;o<s;o++)n[o+i]=t[o]}function H6e(n,e,t,i){const r=zst(n,e);let s=n.splice(r,t);return s===void 0&&(s=[]),Krr(n,r,i),s}function zst(n,e){return e<0?Math.max(e+n.length,0):Math.min(e,n.length)}var Z8;(function(n){function e(s){return s<0}n.isLessThan=e;function t(s){return s<=0}n.isLessThanOrEqual=t;function i(s){return s>0}n.isGreaterThan=i;function r(s){return s===0}n.isNeitherLessOrGreaterThan=r,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(Z8||(Z8={}));function kh(n,e){return(t,i)=>e(n(t),n(i))}function Grr(...n){return(e,t)=>{for(const i of n){const r=i(e,t);if(!Z8.isNeitherLessOrGreaterThan(r))return r}return Z8.neitherLessOrGreaterThan}}const z_=(n,e)=>n-e,Yrr=(n,e)=>z_(n?1:0,e?1:0);function Ust(n){return(e,t)=>-n(e,t)}class Lw{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}}const XR=class XR{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new XR(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new XR(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||Z8.isGreaterThan(e(r,t)))&&(i=!1,t=r),!0)),t}};XR.empty=new XR(e=>{});let aI=XR;class EK{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((r,s)=>t(e[r],e[s]));return new EK(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t<this._indexMap.length;t++)e[this._indexMap[t]]=t;return new EK(e)}}function cf(n){return typeof n=="string"}function zc(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function Qrr(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function zE(n){return typeof n=="number"&&!isNaN(n)}function V6e(n){return!!n&&typeof n[Symbol.iterator]=="function"}function qst(n){return n===!0||n===!1}function Kd(n){return typeof n>"u"}function Oy(n){return!Gp(n)}function Gp(n){return Kd(n)||n===null}function ys(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function MS(n){if(Gp(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function J8(n){return typeof n=="function"}function Xrr(n,e){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)Zrr(n[i],e[i])}function Zrr(n,e){if(cf(e)){if(typeof n!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(J8(e)){try{if(n instanceof e)return}catch{}if(!Gp(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 TC(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"?TC(i):i}),e}function Jrr(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(Kst.call(t,i)){const r=t[i];typeof r=="object"&&!Object.isFrozen(r)&&!Qrr(r)&&e.push(r)}}return n}const Kst=Object.prototype.hasOwnProperty;function Gst(n,e){return _ge(n,e,new Set)}function _ge(n,e,t){if(Gp(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const r=[];for(const s of n)r.push(_ge(s,e,t));return r}if(zc(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const r={};for(const s in n)Kst.call(n,s)&&(r[s]=_ge(n[s],e,t));return t.delete(n),r}return n}function Wee(n,e,t=!0){return zc(n)?(zc(e)&&Object.keys(e).forEach(i=>{i in n?t&&(zc(n[i])&&zc(e[i])?Wee(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Xf(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(!Xf(n[t],e[t]))return!1}else{const r=[];for(i in n)r.push(i);r.sort();const s=[];for(i in e)s.push(i);if(s.sort(),!Xf(r,s))return!1;for(t=0;t<r.length;t++)if(!Xf(n[r[t]],e[r[t]]))return!1}return!0}function esr(n){let e=[];for(;Object.prototype!==n;)e=e.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return e}function vge(n){const e=[];for(const t of esr(n))typeof n[t]=="function"&&e.push(t);return e}function tsr(n,e){const t=r=>function(){const s=Array.prototype.slice.call(arguments,0);return e(r,s)},i={};for(const r of n)i[r]=t(r);return i}function Yst(){return globalThis._VSCODE_NLS_MESSAGES}function nke(){return globalThis._VSCODE_NLS_LANGUAGE}const nsr=nke()==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function kK(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,r)=>{const s=r[0],o=e[s];let a=i;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),nsr&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function A(n,e,...t){return kK(typeof n=="number"?Qst(n,e):e,t)}function Qst(n,e){var i;const t=(i=Yst())==null?void 0:i[n];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return t}function $i(n,e,...t){let i;typeof n=="number"?i=Qst(n,e):i=e;const r=kK(i,t);return{value:r,original:e===i?r:kK(e,t)}}const kR="en";let TK=!1,IK=!1,Qz=!1,Xst=!1,ike=!1,rke=!1,Zst=!1,UV,Xz=kR,W6e=kR,isr,$v;const cw=globalThis;let uh;var cVe;typeof cw.vscode<"u"&&typeof cw.vscode.process<"u"?uh=cw.vscode.process:typeof process<"u"&&typeof((cVe=process==null?void 0:process.versions)==null?void 0:cVe.node)=="string"&&(uh=process);var uVe;const rsr=typeof((uVe=uh==null?void 0:uh.versions)==null?void 0:uVe.electron)=="string",ssr=rsr&&(uh==null?void 0:uh.type)==="renderer";var dVe;if(typeof uh=="object"){TK=uh.platform==="win32",IK=uh.platform==="darwin",Qz=uh.platform==="linux",Qz&&uh.env.SNAP&&uh.env.SNAP_REVISION,uh.env.CI||uh.env.BUILD_ARTIFACTSTAGINGDIRECTORY,UV=kR,Xz=kR;const n=uh.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n);UV=e.userLocale,W6e=e.osLocale,Xz=e.resolvedLanguage||kR,isr=(dVe=e.languagePack)==null?void 0:dVe.translationsConfigFile}catch{}Xst=!0}else typeof navigator=="object"&&!ssr?($v=navigator.userAgent,TK=$v.indexOf("Windows")>=0,IK=$v.indexOf("Macintosh")>=0,rke=($v.indexOf("Macintosh")>=0||$v.indexOf("iPad")>=0||$v.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Qz=$v.indexOf("Linux")>=0,Zst=($v==null?void 0:$v.indexOf("Mobi"))>=0,ike=!0,Xz=nke()||kR,UV=navigator.language.toLowerCase(),W6e=UV):console.error("Unable to resolve platform.");const Wu=TK,zr=IK,Nh=Qz,qy=Xst,FA=ike,osr=ike&&typeof cw.importScripts=="function",asr=osr?cw.origin:void 0,Fb=rke,Jst=Zst,Ky=$v,lsr=Xz,csr=typeof cw.postMessage=="function"&&!cw.importScripts,eot=(()=>{if(csr){const n=[];cw.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,r=n.length;i<r;i++){const s=n[i];if(s.id===t.data.vscodeScheduleAsyncWork){n.splice(i,1),s.callback();return}}});let e=0;return t=>{const i=++e;n.push({id:i,callback:t}),cw.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),Yf=IK||rke?2:TK?1:3;let z6e=!0,U6e=!1;function tot(){if(!U6e){U6e=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,z6e=new Uint16Array(n.buffer)[0]===513}return z6e}const not=!!(Ky&&Ky.indexOf("Chrome")>=0),usr=!!(Ky&&Ky.indexOf("Firefox")>=0),dsr=!!(!not&&Ky&&Ky.indexOf("Safari")>=0),hsr=!!(Ky&&Ky.indexOf("Edg/")>=0),fsr=!!(Ky&&Ky.indexOf("Android")>=0),id={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var ss;(function(n){function e(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*r(C){yield C}n.single=r;function s(C){return e(C)?C:r(C)}n.wrap=s;function o(C){return C||t}n.from=o;function*a(C){for(let S=C.length-1;S>=0;S--)yield C[S]}n.reverse=a;function l(C){return!C||C[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(C){return C[Symbol.iterator]().next().value}n.first=c;function u(C,S){let k=0;for(const I of C)if(S(I,k++))return!0;return!1}n.some=u;function d(C,S){for(const k of C)if(S(k))return k}n.find=d;function*f(C,S){for(const k of C)S(k)&&(yield k)}n.filter=f;function*p(C,S){let k=0;for(const I of C)yield S(I,k++)}n.map=p;function*g(C,S){let k=0;for(const I of C)yield*S(I,k++)}n.flatMap=g;function*m(...C){for(const S of C)yield*S}n.concat=m;function _(C,S,k){let I=k;for(const L of C)I=S(I,L);return I}n.reduce=_;function*v(C,S,k=C.length){for(S<0&&(S+=C.length),k<0?k+=C.length:k>C.length&&(k=C.length);S<k;S++)yield C[S]}n.slice=v;function b(C,S=Number.POSITIVE_INFINITY){const k=[];if(S===0)return[k,C];const I=C[Symbol.iterator]();for(let L=0;L<S;L++){const N=I.next();if(N.done)return[k,n.empty()];k.push(N.value)}return[k,{[Symbol.iterator](){return I}}]}n.consume=b;async function y(C){const S=[];for await(const k of C)S.push(k);return Promise.resolve(S)}n.asyncToArray=y})(ss||(ss={}));var XC;let wc=(XC=class{constructor(e){this.element=e,this.next=XC.Undefined,this.prev=XC.Undefined}},XC.Undefined=new XC(void 0),XC);class Ch{constructor(){this._first=wc.Undefined,this._last=wc.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===wc.Undefined}clear(){let e=this._first;for(;e!==wc.Undefined;){const t=e.next;e.prev=wc.Undefined,e.next=wc.Undefined,e=t}this._first=wc.Undefined,this._last=wc.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new wc(e);if(this._first===wc.Undefined)this._first=i,this._last=i;else if(t){const s=this._last;this._last=i,i.prev=s,s.next=i}else{const s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first!==wc.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==wc.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==wc.Undefined&&e.next!==wc.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===wc.Undefined&&e.next===wc.Undefined?(this._first=wc.Undefined,this._last=wc.Undefined):e.next===wc.Undefined?(this._last=this._last.prev,this._last.next=wc.Undefined):e.prev===wc.Undefined&&(this._first=this._first.next,this._first.prev=wc.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==wc.Undefined;)yield e.element,e=e.next}}const LK="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function psr(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of LK)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const ske=psr();function oke(n){let e=ske;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 iot=new Ch;iot.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function e7(n,e,t,i,r){if(e=oke(e),r||(r=ss.first(iot)),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),e7(n,e,t,i,r)}const s=Date.now(),o=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-s>=r.timeBudget);c++){const u=o-r.windowSize*c;e.lastIndex=Math.max(0,u);const d=gsr(e,t,o,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 gsr(n,e,t,i){let r;for(;r=n.exec(e);){const s=r.index||0;if(s<=t&&n.lastIndex>=t)return r;if(i>0&&s>i)return null}return null}const j0=8;class rot{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class sot{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class ca{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return zee(e,t)}compute(e,t,i){return i}}class YF{constructor(e,t){this.newValue=e,this.didChange=t}}function zee(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new YF(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&fa(n,e);return new YF(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const r=zee(n[i],e[i]);r.didChange&&(n[i]=r.newValue,t=!0)}return new YF(n,t)}class H9{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return zee(e,t)}validate(e){return this.defaultValue}}class F4{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return zee(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function ci(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class _s extends F4{constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=i),super(e,t,i,r)}validate(e){return ci(e,this.defaultValue)}}function t2(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 ko extends F4{static clampedInt(e,t,i,r){return t2(e,t,i,r)}constructor(e,t,i,r,s,o=void 0){typeof o<"u"&&(o.type="integer",o.default=i,o.minimum=r,o.maximum=s),super(e,t,i,o),this.minimum=r,this.maximum=s}validate(e){return ko.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function msr(n,e,t,i){if(typeof n>"u")return e;const r=tg.float(n,e);return tg.clamp(r,t,i)}class tg extends F4{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,s){typeof s<"u"&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=r}validate(e){return this.validationFn(tg.float(e,this.defaultValue))}}class Hd extends F4{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 Hd.string(e,this.defaultValue)}}function qa(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class Va extends F4{constructor(e,t,i,r,s=void 0){typeof s<"u"&&(s.type="string",s.enum=r,s.default=i),super(e,t,i,s),this._allowedValues=r}validate(e){return qa(e,this.defaultValue,this._allowedValues)}}class qV extends ca{constructor(e,t,i,r,s,o,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=r),super(e,t,i,a),this._allowedValues=s,this._convert=o}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function _sr(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class vsr extends ca{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[A("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),A("accessibilitySupport.on","Optimize for usage with a Screen Reader."),A("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:A("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 bsr extends ca{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:A("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:A("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:ci(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:ci(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function ysr(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var du;(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"})(du||(du={}));function Csr(n){switch(n){case"line":return du.Line;case"block":return du.Block;case"underline":return du.Underline;case"line-thin":return du.LineThin;case"block-outline":return du.BlockOutline;case"underline-thin":return du.UnderlineThin}}class wsr extends H9{constructor(){super(143)}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(74)==="default"?r.push("mouse-default"):t.get(74)==="copy"&&r.push("mouse-copy"),t.get(112)&&r.push("showUnused"),t.get(141)&&r.push("showDeprecated"),r.join(" ")}}class xsr extends _s{constructor(){super(37,"emptySelectionClipboard",!0,{description:A("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class Ssr extends ca{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:A("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:[A("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),A("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),A("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:A("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:[A("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),A("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),A("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:A("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:A("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:zr},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:A("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:A("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:ci(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":qa(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":qa(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:ci(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:ci(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:ci(t.loop,this.defaultValue.loop)}}}const yC=class yC extends ca{constructor(){super(51,"fontLigatures",yC.OFF,{anyOf:[{type:"boolean",description:A("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:A("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:A("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"||e.length===0?yC.OFF:e==="true"?yC.ON:e:e?yC.ON:yC.OFF}};yC.OFF='"liga" off, "calt" off',yC.ON='"liga" on, "calt" on';let UE=yC;const CC=class CC extends ca{constructor(){super(54,"fontVariations",CC.OFF,{anyOf:[{type:"boolean",description:A("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:A("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:A("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"?CC.OFF:e==="true"?CC.TRANSLATE:e:e?CC.TRANSLATE:CC.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};CC.OFF="normal",CC.TRANSLATE="translate";let t7=CC;class Esr extends H9{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class ksr extends F4{constructor(){super(52,"fontSize",Th.fontSize,{type:"number",minimum:6,maximum:100,default:Th.fontSize,description:A("fontSize","Controls the font size in pixels.")})}validate(e){const t=tg.float(e,this.defaultValue);return t===0?Th.fontSize:tg.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const z0=class z0 extends ca{constructor(){super(53,"fontWeight",Th.fontWeight,{anyOf:[{type:"number",minimum:z0.MINIMUM_VALUE,maximum:z0.MAXIMUM_VALUE,errorMessage:A("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:z0.SUGGESTION_VALUES}],default:Th.fontWeight,description:A("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(ko.clampedInt(e,Th.fontWeight,z0.MINIMUM_VALUE,z0.MAXIMUM_VALUE))}};z0.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],z0.MINIMUM_VALUE=1,z0.MAXIMUM_VALUE=1e3;let bge=z0;class Tsr extends ca{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[A("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),A("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),A("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:A("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":{description:A("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:A("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:A("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:A("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:A("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:A("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:A("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:A("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:A("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:A("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:qa(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:t.multipleDefinitions??qa(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:t.multipleTypeDefinitions??qa(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:t.multipleDeclarations??qa(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:t.multipleImplementations??qa(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:t.multipleReferences??qa(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:t.multipleTests??qa(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Hd.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Hd.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Hd.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Hd.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Hd.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Hd.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class Isr extends ca{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:A("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:A("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:A("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:A("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:A("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:ci(t.enabled,this.defaultValue.enabled),delay:ko.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:ci(t.sticky,this.defaultValue.sticky),hidingDelay:ko.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:ci(t.above,this.defaultValue.above)}}}class LP extends H9{constructor(){super(146)}compute(e,t,i){return LP.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 s=(i+e.viewLineCount+r)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:r,desiredRatio:s,minimapLineCount:o}}static _computeMinimapLayout(e,t){const i=e.outerWidth,r=e.outerHeight,s=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(s*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};const o=t.stableMinimapLayoutInput,a=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,u=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let f=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const p=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,_=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,y=e.isViewportWrapping,C=d?2:3;let S=Math.floor(s*r);const k=S/s;let I=!1,L=!1,N=C*f,P=f/s,O=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:U,extraLinesBeforeFirstLine:G,extraLinesBeyondLastLine:H,desiredRatio:z,minimapLineCount:Z}=LP.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:s});if(v/Z>1)I=!0,L=!0,f=1,N=1,P=f/s;else{let oe=!1,fe=f+1;if(g==="fit"){const Se=Math.ceil((G+v+H)*N);y&&a&&b<=t.stableFitRemainingWidth?(oe=!0,fe=t.stableFitMaxMinimapScale):oe=Se>S}if(g==="fill"||oe){I=!0;const Se=f;N=Math.min(l*s,Math.max(1,Math.floor(1/z))),y&&a&&b<=t.stableFitRemainingWidth&&(fe=t.stableFitMaxMinimapScale),f=Math.min(fe,Math.max(1,Math.floor(N/C))),f>Se&&(O=Math.min(2,f/Se)),P=f/s/O,S=Math.ceil(Math.max(U,G+v+H)*N),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=f):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const F=Math.floor(p*P),V=Math.min(F,Math.max(0,Math.floor((b-_-2)*P/(c+P)))+j0);let M=Math.floor(s*V);const B=M/s;M=Math.floor(M*O);const W=d?1:2,q=m==="left"?0:i-V-_;return{renderMinimap:W,minimapLeft:q,minimapWidth:V,minimapHeightIsEditorHeight:I,minimapIsSampling:L,minimapScale:f,minimapLineHeight:N,minimapCanvasInnerWidth:M,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:B,minimapCanvasOuterHeight:k}}static computeLayout(e,t){const i=t.outerWidth|0,r=t.outerHeight|0,s=t.lineHeight|0,o=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,u=t.viewLineCount,d=e.get(138),f=d==="inherit"?e.get(137):d,p=f==="inherit"?e.get(133):f,g=e.get(136),m=t.isDominatedByLongLines,_=e.get(57),v=e.get(68).renderType!==0,b=e.get(69),y=e.get(106),C=e.get(84),S=e.get(73),k=e.get(104),I=k.verticalScrollbarSize,L=k.verticalHasArrows,N=k.arrowSize,P=k.horizontalScrollbarSize,O=e.get(43),F=e.get(111)!=="never";let V=e.get(66);O&&F&&(V+=16);let M=0;if(v){const Ie=Math.max(o,b);M=Math.round(Ie*l)}let B=0;_&&(B=s*t.glyphMarginDecorationLaneCount);let W=0,q=W+B,U=q+M,G=U+V;const H=i-B-M-V;let z=!1,Z=!1,X=-1;f==="inherit"&&m?(z=!0,Z=!0):p==="on"||p==="bounded"?Z=!0:p==="wordWrapColumn"&&(X=g);const oe=LP._computeMinimapLayout({outerWidth:i,outerHeight:r,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:C.top,paddingBottom:C.bottom,minimap:S,verticalScrollbarWidth:I,viewLineCount:u,remainingWidth:H,isViewportWrapping:Z},t.memory||new sot);oe.renderMinimap!==0&&oe.minimapLeft===0&&(W+=oe.minimapWidth,q+=oe.minimapWidth,U+=oe.minimapWidth,G+=oe.minimapWidth);const fe=H-oe.minimapWidth,Se=Math.max(1,Math.floor((fe-I-2)/a)),Me=L?N:0;return Z&&(X=Math.max(1,Se),p==="bounded"&&(X=Math.min(X,g))),{width:i,height:r,glyphMarginLeft:W,glyphMarginWidth:B,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:q,lineNumbersWidth:M,decorationsLeft:U,decorationsWidth:V,contentLeft:G,contentWidth:fe,minimap:oe,viewportColumn:Se,isWordWrapMinified:z,isViewportWrapping:Z,wrappingColumn:X,verticalScrollbarWidth:I,horizontalScrollbarHeight:P,overviewRuler:{top:Me,width:I,height:r-2*Me,right:0}}}}class Lsr extends ca{constructor(){super(140,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[A("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."),A("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:A("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 qa(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var L_;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(L_||(L_={}));class Asr extends ca{constructor(){const e={enabled:L_.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[L_.Off,L_.OnCode,L_.On],default:e.enabled,enumDescriptions:[A("editor.lightbulb.enabled.off","Disable the code action menu."),A("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),A("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:A("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:qa(e.enabled,this.defaultValue.enabled,[L_.Off,L_.OnCode,L_.On])}}}class Nsr extends ca{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(116,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:A("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:A("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:A("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:A("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ci(t.enabled,this.defaultValue.enabled),maxLineCount:ko.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:qa(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:ci(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Dsr extends ca{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(142,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:A("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[A("editor.inlayHints.on","Inlay hints are enabled"),A("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",zr?"Ctrl+Option":"Ctrl+Alt"),A("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",zr?"Ctrl+Option":"Ctrl+Alt"),A("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:A("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:A("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:A("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:qa(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:ko.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Hd.string(t.fontFamily,this.defaultValue.fontFamily),padding:ci(t.padding,this.defaultValue.padding)}}}class Rsr extends ca{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):ko.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?ko.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class Psr extends tg{constructor(){super(67,"lineHeight",Th.lineHeight,e=>tg.clamp(e,0,150),{markdownDescription:A("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 Osr extends ca{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:A("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:A("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[A("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),A("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),A("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:A("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:A("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:A("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:A("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:A("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:A("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:A("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:A("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:A("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:A("minimap.sectionHeaderLetterSpacing","Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ci(t.enabled,this.defaultValue.enabled),autohide:ci(t.autohide,this.defaultValue.autohide),size:qa(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:qa(t.side,this.defaultValue.side,["right","left"]),showSlider:qa(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ci(t.renderCharacters,this.defaultValue.renderCharacters),scale:ko.clampedInt(t.scale,1,1,3),maxColumn:ko.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:ci(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:ci(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:tg.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:tg.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function Msr(n){return n==="ctrlCmd"?zr?"metaKey":"ctrlKey":"altKey"}class jsr extends ca{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:A("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:A("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:ko.clampedInt(t.top,0,0,1e3),bottom:ko.clampedInt(t.bottom,0,0,1e3)}}}class Fsr extends ca{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:A("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:A("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:ci(t.enabled,this.defaultValue.enabled),cycle:ci(t.cycle,this.defaultValue.cycle)}}}class Bsr extends H9{constructor(){super(144)}compute(e,t,i){return e.pixelRatio}}class $sr extends ca{constructor(){super(88,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class Hsr extends ca{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[A("on","Quick suggestions show inside the suggest widget"),A("inline","Quick suggestions show as ghost text"),A("off","Quick suggestions are disabled")]}];super(90,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:A("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:A("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:A("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:A("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,s=["on","inline","off"];let o,a,l;return typeof t=="boolean"?o=t?"on":"off":o=qa(t,this.defaultValue.other,s),typeof i=="boolean"?a=i?"on":"off":a=qa(i,this.defaultValue.comments,s),typeof r=="boolean"?l=r?"on":"off":l=qa(r,this.defaultValue.strings,s),{other:o,comments:a,strings:l}}}class Vsr extends ca{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[A("lineNumbers.off","Line numbers are not rendered."),A("lineNumbers.on","Line numbers are rendered as absolute number."),A("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),A("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:A("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 AK(n){const e=n.get(99);return e==="editable"?n.get(92):e!=="on"}class Wsr extends ca{constructor(){const e=[],t={type:"number",description:A("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(103,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:A("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:A("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:ko.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const r=i;t.push({column:ko.clampedInt(r.column,0,0,1e4),color:r.color})}return t.sort((i,r)=>i.column-r.column),t}return this.defaultValue}}class zsr extends ca{constructor(){super(93,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function q6e(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let Usr=class extends ca{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,ignoreHorizontalScrollbarInContentHeight:!1};super(104,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[A("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),A("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),A("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:A("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[A("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),A("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),A("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:A("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:A("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:A("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:A("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:A("scrollbar.ignoreHorizontalScrollbarInContentHeight","When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=ko.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=ko.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:ko.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:q6e(t.vertical,this.defaultValue.vertical),horizontal:q6e(t.horizontal,this.defaultValue.horizontal),useShadows:ci(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:ci(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:ci(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:ci(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:ci(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:ko.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:r,verticalSliderSize:ko.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:ci(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:ci(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Bp="inUntrustedWorkspace",ef={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 qsr extends ca{constructor(){const e={nonBasicASCII:Bp,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Bp,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(126,"unicodeHighlight",e,{[ef.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Bp],default:e.nonBasicASCII,description:A("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.")},[ef.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:A("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[ef.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:A("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.")},[ef.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Bp],default:e.includeComments,description:A("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[ef.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Bp],default:e.includeStrings,description:A("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[ef.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:A("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[ef.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:A("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Xf(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(Xf(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const r=super.applyUpdate(e,t);return i?new YF(r.newValue,!0):r}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:AP(t.nonBasicASCII,Bp,[!0,!1,Bp]),invisibleCharacters:ci(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:ci(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:AP(t.includeComments,Bp,[!0,!1,Bp]),includeStrings:AP(t.includeStrings,Bp,[!0,!1,Bp]),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,s]of Object.entries(e))s===!0&&(i[r]=!0);return i}}class Ksr extends ca{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:A("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[A("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),A("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),A("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:A("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:A("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.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:A("inlineSuggest.fontFamily","Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ci(t.enabled,this.defaultValue.enabled),mode:qa(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:qa(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:ci(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:ci(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Hd.string(t.fontFamily,this.defaultValue.fontFamily)}}}class Gsr extends ca{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:A("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[A("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),A("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),A("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:A("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:A("inlineEdit.fontFamily","Controls the font family of the inline edit.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ci(t.enabled,this.defaultValue.enabled),showToolbar:qa(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:Hd.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:ci(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class Ysr extends ca{constructor(){const e={enabled:id.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:id.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:A("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:A("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:ci(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:ci(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class Qsr extends ca{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:[A("editor.guides.bracketPairs.true","Enables bracket pair guides."),A("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),A("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:A("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[A("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),A("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),A("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:A("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:A("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:A("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[A("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),A("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),A("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:A("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:AP(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:AP(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:ci(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:ci(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:AP(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function AP(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class Xsr extends ca{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(119,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[A("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),A("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:A("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:A("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:A("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:A("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:[A("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),A("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),A("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),A("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:A("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:A("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:A("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:A("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:A("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:A("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:A("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:A("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:A("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:A("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:A("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:A("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:qa(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:ci(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:ci(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:ci(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:ci(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:qa(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:ci(t.showIcons,this.defaultValue.showIcons),showStatusBar:ci(t.showStatusBar,this.defaultValue.showStatusBar),preview:ci(t.preview,this.defaultValue.preview),previewMode:qa(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:ci(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:ci(t.showMethods,this.defaultValue.showMethods),showFunctions:ci(t.showFunctions,this.defaultValue.showFunctions),showConstructors:ci(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:ci(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:ci(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:ci(t.showFields,this.defaultValue.showFields),showVariables:ci(t.showVariables,this.defaultValue.showVariables),showClasses:ci(t.showClasses,this.defaultValue.showClasses),showStructs:ci(t.showStructs,this.defaultValue.showStructs),showInterfaces:ci(t.showInterfaces,this.defaultValue.showInterfaces),showModules:ci(t.showModules,this.defaultValue.showModules),showProperties:ci(t.showProperties,this.defaultValue.showProperties),showEvents:ci(t.showEvents,this.defaultValue.showEvents),showOperators:ci(t.showOperators,this.defaultValue.showOperators),showUnits:ci(t.showUnits,this.defaultValue.showUnits),showValues:ci(t.showValues,this.defaultValue.showValues),showConstants:ci(t.showConstants,this.defaultValue.showConstants),showEnums:ci(t.showEnums,this.defaultValue.showEnums),showEnumMembers:ci(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:ci(t.showKeywords,this.defaultValue.showKeywords),showWords:ci(t.showWords,this.defaultValue.showWords),showColors:ci(t.showColors,this.defaultValue.showColors),showFiles:ci(t.showFiles,this.defaultValue.showFiles),showReferences:ci(t.showReferences,this.defaultValue.showReferences),showFolders:ci(t.showFolders,this.defaultValue.showFolders),showTypeParameters:ci(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:ci(t.showSnippets,this.defaultValue.showSnippets),showUsers:ci(t.showUsers,this.defaultValue.showUsers),showIssues:ci(t.showIssues,this.defaultValue.showIssues)}}}class Zsr extends ca{constructor(){super(114,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:A("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:A("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:ci(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:ci(e.selectSubwords,this.defaultValue.selectSubwords)}}}class Jsr extends ca{constructor(){const e=[];super(131,"wordSegmenterLocales",e,{anyOf:[{description:A("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:A("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}class eor extends ca{constructor(){super(139,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[A("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),A("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),A("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),A("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:A("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 tor extends H9{constructor(){super(147)}compute(e,t,i){const r=t.get(146);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}}class nor extends ca{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:A("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:A("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:[A("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),A("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:ci(t.enabled,this.defaultValue.enabled),showDropSelector:qa(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class ior extends ca{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:A("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:A("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:[A("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),A("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:ci(t.enabled,this.defaultValue.enabled),showPasteSelector:qa(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const ror="Consolas, 'Courier New', monospace",sor="Menlo, Monaco, 'Courier New', monospace",oor="'Droid Sans Mono', 'monospace', monospace",Th={fontFamily:zr?sor:Nh?oor:ror,fontWeight:"normal",fontSize:zr?12:14,lineHeight:0,letterSpacing:0},TR=[];function tn(n){return TR[n.id]=n,n}const Xb={acceptSuggestionOnCommitCharacter:tn(new _s(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:A("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:tn(new Va(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",A("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:A("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:tn(new vsr),accessibilityPageSize:tn(new ko(3,"accessibilityPageSize",10,1,1073741824,{description:A("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:tn(new Hd(4,"ariaLabel",A("editorViewAccessibleLabel","Editor content"))),ariaRequired:tn(new _s(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:tn(new _s(8,"screenReaderAnnounceInlineSuggestion",!0,{description:A("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:tn(new Va(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",A("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),A("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:A("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:tn(new Va(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",A("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),A("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:A("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:tn(new Va(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",A("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:A("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:tn(new Va(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",A("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:A("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:tn(new Va(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",A("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),A("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:A("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:tn(new qV(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],_sr,{enumDescriptions:[A("editor.autoIndent.none","The editor will not insert indentation automatically."),A("editor.autoIndent.keep","The editor will keep the current line's indentation."),A("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),A("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),A("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:A("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:tn(new _s(13,"automaticLayout",!1)),autoSurround:tn(new Va(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[A("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),A("editor.autoSurround.quotes","Surround with quotes but not brackets."),A("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:A("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:tn(new Ysr),bracketPairGuides:tn(new Qsr),stickyTabStops:tn(new _s(117,"stickyTabStops",!1,{description:A("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:tn(new _s(17,"codeLens",!0,{description:A("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:tn(new Hd(18,"codeLensFontFamily","",{description:A("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:tn(new ko(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:A("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:tn(new _s(20,"colorDecorators",!0,{description:A("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:tn(new Va(149,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[A("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),A("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),A("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:A("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:tn(new ko(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:A("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:tn(new _s(22,"columnSelection",!1,{description:A("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:tn(new bsr),contextmenu:tn(new _s(24,"contextmenu",!0)),copyWithSyntaxHighlighting:tn(new _s(25,"copyWithSyntaxHighlighting",!0,{description:A("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:tn(new qV(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],ysr,{description:A("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:tn(new Va(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[A("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),A("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),A("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:A("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:tn(new qV(28,"cursorStyle",du.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Csr,{description:A("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:tn(new ko(29,"cursorSurroundingLines",0,0,1073741824,{description:A("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:tn(new Va(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[A("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),A("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:A("cursorSurroundingLinesStyle","Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:tn(new ko(31,"cursorWidth",0,0,1073741824,{markdownDescription:A("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:tn(new _s(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:tn(new _s(33,"disableMonospaceOptimizations",!1)),domReadOnly:tn(new _s(34,"domReadOnly",!1)),dragAndDrop:tn(new _s(35,"dragAndDrop",!0,{description:A("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:tn(new xsr),dropIntoEditor:tn(new nor),stickyScroll:tn(new Nsr),experimentalWhitespaceRendering:tn(new Va(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[A("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),A("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),A("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:A("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:tn(new Hd(39,"extraEditorClassName","")),fastScrollSensitivity:tn(new tg(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:A("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:tn(new Ssr),fixedOverflowWidgets:tn(new _s(42,"fixedOverflowWidgets",!1)),folding:tn(new _s(43,"folding",!0,{description:A("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:tn(new Va(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[A("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),A("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:A("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:tn(new _s(45,"foldingHighlight",!0,{description:A("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:tn(new _s(46,"foldingImportsByDefault",!1,{description:A("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:tn(new ko(47,"foldingMaximumRegions",5e3,10,65e3,{description:A("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:tn(new _s(48,"unfoldOnClickAfterEndOfLine",!1,{description:A("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:tn(new Hd(49,"fontFamily",Th.fontFamily,{description:A("fontFamily","Controls the font family.")})),fontInfo:tn(new Esr),fontLigatures2:tn(new UE),fontSize:tn(new ksr),fontWeight:tn(new bge),fontVariations:tn(new t7),formatOnPaste:tn(new _s(55,"formatOnPaste",!1,{description:A("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:tn(new _s(56,"formatOnType",!1,{description:A("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:tn(new _s(57,"glyphMargin",!0,{description:A("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:tn(new Tsr),hideCursorInOverviewRuler:tn(new _s(59,"hideCursorInOverviewRuler",!1,{description:A("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:tn(new Isr),inDiffEditor:tn(new _s(61,"inDiffEditor",!1)),letterSpacing:tn(new tg(64,"letterSpacing",Th.letterSpacing,n=>tg.clamp(n,-5,20),{description:A("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:tn(new Asr),lineDecorationsWidth:tn(new Rsr),lineHeight:tn(new Psr),lineNumbers:tn(new Vsr),lineNumbersMinChars:tn(new ko(69,"lineNumbersMinChars",5,1,300)),linkedEditing:tn(new _s(70,"linkedEditing",!1,{description:A("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:tn(new _s(71,"links",!0,{description:A("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:tn(new Va(72,"matchBrackets","always",["always","near","never"],{description:A("matchBrackets","Highlight matching brackets.")})),minimap:tn(new Osr),mouseStyle:tn(new Va(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:tn(new tg(75,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:A("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:tn(new _s(76,"mouseWheelZoom",!1,{markdownDescription:zr?A("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):A("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:tn(new _s(77,"multiCursorMergeOverlapping",!0,{description:A("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:tn(new qV(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Msr,{markdownEnumDescriptions:[A("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),A("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:A({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:tn(new Va(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[A("multiCursorPaste.spread","Each cursor pastes a single line of the text."),A("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:A("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:tn(new ko(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:A("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:tn(new Va(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[A("occurrencesHighlight.off","Does not highlight occurrences."),A("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),A("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:A("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:tn(new _s(82,"overviewRulerBorder",!0,{description:A("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:tn(new ko(83,"overviewRulerLanes",3,0,3)),padding:tn(new jsr),pasteAs:tn(new ior),parameterHints:tn(new Fsr),peekWidgetDefaultFocus:tn(new Va(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[A("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),A("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:A("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:tn(new $sr),definitionLinkOpensInPeek:tn(new _s(89,"definitionLinkOpensInPeek",!1,{description:A("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:tn(new Hsr),quickSuggestionsDelay:tn(new ko(91,"quickSuggestionsDelay",10,0,1073741824,{description:A("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:tn(new _s(92,"readOnly",!1)),readOnlyMessage:tn(new zsr),renameOnType:tn(new _s(94,"renameOnType",!1,{description:A("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:A("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:tn(new _s(95,"renderControlCharacters",!0,{description:A("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:tn(new Va(96,"renderFinalNewline",Nh?"dimmed":"on",["off","on","dimmed"],{description:A("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:tn(new Va(97,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",A("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:A("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:tn(new _s(98,"renderLineHighlightOnlyWhenFocus",!1,{description:A("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:tn(new Va(99,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:tn(new Va(100,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",A("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),A("renderWhitespace.selection","Render whitespace characters only on selected text."),A("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:A("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:tn(new ko(101,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:tn(new _s(102,"roundedSelection",!0,{description:A("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:tn(new Wsr),scrollbar:tn(new Usr),scrollBeyondLastColumn:tn(new ko(105,"scrollBeyondLastColumn",4,0,1073741824,{description:A("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:tn(new _s(106,"scrollBeyondLastLine",!0,{description:A("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:tn(new _s(107,"scrollPredominantAxis",!0,{description:A("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:tn(new _s(108,"selectionClipboard",!0,{description:A("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Nh})),selectionHighlight:tn(new _s(109,"selectionHighlight",!0,{description:A("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:tn(new _s(110,"selectOnLineNumbers",!0)),showFoldingControls:tn(new Va(111,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[A("showFoldingControls.always","Always show the folding controls."),A("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),A("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:A("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:tn(new _s(112,"showUnused",!0,{description:A("showUnused","Controls fading out of unused code.")})),showDeprecated:tn(new _s(141,"showDeprecated",!0,{description:A("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:tn(new Dsr),snippetSuggestions:tn(new Va(113,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[A("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),A("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),A("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),A("snippetSuggestions.none","Do not show snippet suggestions.")],description:A("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:tn(new Zsr),smoothScrolling:tn(new _s(115,"smoothScrolling",!1,{description:A("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:tn(new ko(118,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:tn(new Xsr),inlineSuggest:tn(new Ksr),inlineEdit:tn(new Gsr),inlineCompletionsAccessibilityVerbose:tn(new _s(150,"inlineCompletionsAccessibilityVerbose",!1,{description:A("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:tn(new ko(120,"suggestFontSize",0,0,1e3,{markdownDescription:A("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:tn(new ko(121,"suggestLineHeight",0,0,1e3,{markdownDescription:A("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:tn(new _s(122,"suggestOnTriggerCharacters",!0,{description:A("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:tn(new Va(123,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[A("suggestSelection.first","Always select the first suggestion."),A("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),A("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:A("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:tn(new Va(124,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[A("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),A("tabCompletion.off","Disable tab completions."),A("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:A("tabCompletion","Enables tab completions.")})),tabIndex:tn(new ko(125,"tabIndex",0,-1,1073741824)),unicodeHighlight:tn(new qsr),unusualLineTerminators:tn(new Va(127,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[A("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),A("unusualLineTerminators.off","Unusual line terminators are ignored."),A("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:A("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:tn(new _s(128,"useShadowDOM",!0)),useTabStops:tn(new _s(129,"useTabStops",!0,{description:A("useTabStops","Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:tn(new Va(130,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[A("wordBreak.normal","Use the default line break rule."),A("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:A("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:tn(new Jsr),wordSeparators:tn(new Hd(132,"wordSeparators",LK,{description:A("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:tn(new Va(133,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[A("wordWrap.off","Lines will never wrap."),A("wordWrap.on","Lines will wrap at the viewport width."),A({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),A({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:A({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:tn(new Hd(134,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:tn(new Hd(135,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:tn(new ko(136,"wordWrapColumn",80,1,1073741824,{markdownDescription:A({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:tn(new Va(137,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:tn(new Va(138,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:tn(new wsr),defaultColorDecorators:tn(new _s(148,"defaultColorDecorators",!1,{markdownDescription:A("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:tn(new Bsr),tabFocusMode:tn(new _s(145,"tabFocusMode",!1,{markdownDescription:A("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:tn(new LP),wrappingInfo:tn(new tor),wrappingIndent:tn(new eor),wrappingStrategy:tn(new Lsr)};class aor{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?iM.isErrorNoTelemetry(e)?new iM(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 oot=new aor;function tr(n){Km(n)||oot.onUnexpectedError(n)}function ll(n){Km(n)||oot.onUnexpectedExternalError(n)}function K6e(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:iM.isErrorNoTelemetry(n)}}return n}const NK="Canceled";function Km(n){return n instanceof rv?!0:n instanceof Error&&n.name===NK&&n.message===NK}class rv extends Error{constructor(){super(NK),this.name=this.message}}function lor(){const n=new Error(NK);return n.name=n.message,n}function Sm(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function ake(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class cor extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class iM extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof iM)return e;const t=new iM;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Ps extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ps.prototype)}}function qE(n,e){const t=this;let i=!1,r;return function(){return i||(i=!0,r=n.apply(t,arguments)),r}}function Uee(n){return typeof n=="object"&&n!==null&&typeof n.dispose=="function"&&n.dispose.length===0}function vo(n){if(ss.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 U_(...n){return gi(()=>vo(n))}function gi(n){return{dispose:qE(()=>{n()})}}const kQ=class kQ{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{vo(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?kQ.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)}};kQ.DISABLE_DISPOSED_WARNING=!1;let Et=kQ;const FIe=class FIe{constructor(){this._store=new Et,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)}};FIe.None=Object.freeze({dispose(){}});let Ye=FIe;class Dc{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.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}}class uor{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class dor{constructor(e){this.object=e}dispose(){}}class lke{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{vo(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.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))==null||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const hor=globalThis.performance&&typeof globalThis.performance.now=="function";class Qc{static create(e){return new Qc(e)}constructor(e){this._now=hor&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var rn;(function(n){n.None=()=>Ye.None;function e(V,M){return f(V,()=>{},0,void 0,!0,void 0,M)}n.defer=e;function t(V){return(M,B=null,W)=>{let q=!1,U;return U=V(G=>{if(!q)return U?U.dispose():q=!0,M.call(B,G)},null,W),q&&U.dispose(),U}}n.once=t;function i(V,M){return n.once(n.filter(V,M))}n.onceIf=i;function r(V,M,B){return u((W,q=null,U)=>V(G=>W.call(q,M(G)),null,U),B)}n.map=r;function s(V,M,B){return u((W,q=null,U)=>V(G=>{M(G),W.call(q,G)},null,U),B)}n.forEach=s;function o(V,M,B){return u((W,q=null,U)=>V(G=>M(G)&&W.call(q,G),null,U),B)}n.filter=o;function a(V){return V}n.signal=a;function l(...V){return(M,B=null,W)=>{const q=U_(...V.map(U=>U(G=>M.call(B,G))));return d(q,W)}}n.any=l;function c(V,M,B,W){let q=B;return r(V,U=>(q=M(q,U),q),W)}n.reduce=c;function u(V,M){let B;const W={onWillAddFirstListener(){B=V(q.fire,q)},onDidRemoveLastListener(){B==null||B.dispose()}},q=new Ue(W);return M==null||M.add(q),q.event}function d(V,M){return M instanceof Array?M.push(V):M&&M.add(V),V}function f(V,M,B=100,W=!1,q=!1,U,G){let H,z,Z,X=0,oe;const fe={leakWarningThreshold:U,onWillAddFirstListener(){H=V(Me=>{X++,z=M(z,Me),W&&!Z&&(Se.fire(z),z=void 0),oe=()=>{const Ie=z;z=void 0,Z=void 0,(!W||X>1)&&Se.fire(Ie),X=0},typeof B=="number"?(clearTimeout(Z),Z=setTimeout(oe,B)):Z===void 0&&(Z=0,queueMicrotask(oe))})},onWillRemoveListener(){q&&X>0&&(oe==null||oe())},onDidRemoveLastListener(){oe=void 0,H.dispose()}},Se=new Ue(fe);return G==null||G.add(Se),Se.event}n.debounce=f;function p(V,M=0,B){return n.debounce(V,(W,q)=>W?(W.push(q),W):[q],M,void 0,!0,void 0,B)}n.accumulate=p;function g(V,M=(W,q)=>W===q,B){let W=!0,q;return o(V,U=>{const G=W||!M(U,q);return W=!1,q=U,G},B)}n.latch=g;function m(V,M,B){return[n.filter(V,M,B),n.filter(V,W=>!M(W),B)]}n.split=m;function _(V,M=!1,B=[],W){let q=B.slice(),U=V(z=>{q?q.push(z):H.fire(z)});W&&W.add(U);const G=()=>{q==null||q.forEach(z=>H.fire(z)),q=null},H=new Ue({onWillAddFirstListener(){U||(U=V(z=>H.fire(z)),W&&W.add(U))},onDidAddFirstListener(){q&&(M?setTimeout(G):G())},onDidRemoveLastListener(){U&&U.dispose(),U=null}});return W&&W.add(H),H.event}n.buffer=_;function v(V,M){return(W,q,U)=>{const G=M(new y);return V(function(H){const z=G.evaluate(H);z!==b&&W.call(q,z)},void 0,U)}}n.chain=v;const b=Symbol("HaltChainable");class y{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:b),this}reduce(M,B){let W=B;return this.steps.push(q=>(W=M(W,q),W)),this}latch(M=(B,W)=>B===W){let B=!0,W;return this.steps.push(q=>{const U=B||!M(q,W);return B=!1,W=q,U?q:b}),this}evaluate(M){for(const B of this.steps)if(M=B(M),M===b)break;return M}}function C(V,M,B=W=>W){const W=(...H)=>G.fire(B(...H)),q=()=>V.on(M,W),U=()=>V.removeListener(M,W),G=new Ue({onWillAddFirstListener:q,onDidRemoveLastListener:U});return G.event}n.fromNodeEventEmitter=C;function S(V,M,B=W=>W){const W=(...H)=>G.fire(B(...H)),q=()=>V.addEventListener(M,W),U=()=>V.removeEventListener(M,W),G=new Ue({onWillAddFirstListener:q,onDidRemoveLastListener:U});return G.event}n.fromDOMEventEmitter=S;function k(V){return new Promise(M=>t(V)(M))}n.toPromise=k;function I(V){const M=new Ue;return V.then(B=>{M.fire(B)},()=>{M.fire(void 0)}).finally(()=>{M.dispose()}),M.event}n.fromPromise=I;function L(V,M){return V(B=>M.fire(B))}n.forward=L;function N(V,M,B){return M(B),V(W=>M(W))}n.runAndSubscribe=N;class P{constructor(M,B){this._observable=M,this._counter=0,this._hasChanged=!1;const W={onWillAddFirstListener:()=>{M.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{M.removeObserver(this)}};this.emitter=new Ue(W),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 O(V,M){return new P(V,M).emitter.event}n.fromObservable=O;function F(V){return(M,B,W)=>{let q=0,U=!1;const G={beginUpdate(){q++},endUpdate(){q--,q===0&&(V.reportChanges(),U&&(U=!1,M.call(B)))},handlePossibleChange(){},handleChange(){U=!0}};V.addObserver(G),V.reportChanges();const H={dispose(){V.removeObserver(G)}};return W instanceof Et?W.add(H):Array.isArray(W)&&W.push(H),H}}n.fromObservableLight=F})(rn||(rn={}));const ZR=class ZR{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${ZR._idPool++}`,ZR.all.add(this)}start(e){this._stopWatch=new Qc,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}}};ZR.all=new Set,ZR._idPool=0;let yge=ZR,por=-1;const TQ=class TQ{constructor(e,t,i=(TQ._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||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;const[s,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(s);const l=new gor(a,s);this._errorHandler(l)}return()=>{const s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,r]of this._stacks)(!e||t<r)&&(e=[i,r],t=r);return e}};TQ._idPool=1;let Cge=TQ;class cke{static create(){const e=new Error;return new cke(e.stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` `).slice(2).join(` `))}}class gor extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class mor extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class oce{constructor(e){this.value=e}}const _or=2;let Ue=class{constructor(e){var t,i,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new Cge((e==null?void 0:e.onListenerError)??tr,((i=this._options)==null?void 0:i.leakWarningThreshold)??por):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new yge(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,i,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||i.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,i)=>{var a,l,c,u,d;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const f=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(f);const p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],g=new mor(`${f}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((a=this._options)==null?void 0:a.onListenerError)||tr)(g),Ye.None}if(this._disposed)return Ye.None;t&&(e=e.bind(t));const r=new oce(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=cke.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof oce?(this._deliveryQueue??(this._deliveryQueue=new aot),this._listeners=[this._listeners,r]):this._listeners.push(r):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=r,(d=(u=this._options)==null?void 0:u.onDidAddFirstListener)==null||d.call(u,this)),this._size++;const o=gi(()=>{s==null||s(),this._removeListener(r)});return i instanceof Et?i.add(o):Array.isArray(i)&&i.push(o),o}),this._event}_removeListener(e){var s,o,a,l;if((o=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||o.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||l.call(a,this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-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--,t[i]=void 0;const r=this._deliveryQueue.current===this;if(this._size*_or<=t.length){let c=0;for(let u=0;u<t.length;u++)t[u]?t[c++]=t[u]:r&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=c}}_deliver(e,t){var r;if(!e)return;const i=((r=this._options)==null?void 0:r.onListenerError)||tr;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_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,s;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)==null||i.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof oce)this._deliver(this._listeners,e);else{const o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}};const vor=()=>new aot;class aot{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 ML extends Ue{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Ch,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 lot extends ML{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class bor extends Ue{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 yor{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new Ue({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),gi(qE(()=>{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){var t;(t=e.listener)==null||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)==null||e.dispose();this.events=[]}}class V9{constructor(){this.data=[]}wrapEvent(e,t,i){return(r,s,o)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>r.call(s,a)):r.call(s,a);return}const c=l;if(!c){r.call(s,t(i,a));return}c.items??(c.items=[]),c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??(c.reducedResult=i?c.items.reduce(t,i):c.items.reduce(t)),r.call(s,c.reducedResult)})},void 0,o)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(r=>r()),i}}class G6e{constructor(){this.listening=!1,this.inputEvent=rn.None,this.inputEventListener=Ye.None,this.emitter=new Ue({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 cot=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var xr;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof Zz?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:rn.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:cot})})(xr||(xr={}));class Zz{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?cot:(this._emitter||(this._emitter=new Ue),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let ba=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 Zz),this._token}cancel(){this._token?this._token instanceof Zz&&this._token.cancel():this._token=xr.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)==null||t.dispose(),this._token?this._token instanceof Zz&&this._token.dispose():this._token=xr.None}};function wge(n){const e=new ba;return n.add({dispose(){e.cancel()}}),e.token}class uke{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 Jz=new uke,xge=new uke,Sge=new uke,uot=new Array(230),Cor=Object.create(null),wor=Object.create(null),dke=[];for(let n=0;n<=193;n++)dke[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[s,o,a,l,c,u,d,f,p]=r;if(i[o]||(i[o]=!0,Cor[a]=o,wor[a.toLowerCase()]=o,s&&(dke[o]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);Jz.define(l,c),xge.define(l,f||c),Sge.define(l,p||f||c)}u&&(uot[u]=l)}})();var DC;(function(n){function e(a){return Jz.keyCodeToStr(a)}n.toString=e;function t(a){return Jz.strToKeyCode(a)}n.fromString=t;function i(a){return xge.keyCodeToStr(a)}n.toUserSettingsUS=i;function r(a){return Sge.keyCodeToStr(a)}n.toUserSettingsGeneral=r;function s(a){return xge.strToKeyCode(a)||Sge.strToKeyCode(a)}n.fromUserSettings=s;function o(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 Jz.keyCodeToStr(a)}n.toElectronAccelerator=o})(DC||(DC={}));function Gl(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}var Y6e={};let NP;const ace=globalThis.vscode;var hVe;if(typeof ace<"u"&&typeof ace.process<"u"){const n=ace.process;NP={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"&&typeof((hVe=process==null?void 0:process.versions)==null?void 0:hVe.node)=="string"?NP={get platform(){return process.platform},get arch(){return process.arch},get env(){return Y6e},cwd(){return Y6e.VSCODE_CWD||process.cwd()}}:NP={get platform(){return Wu?"win32":zr?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const DK=NP.cwd,Ege=NP.env,xor=NP.platform,Sor=65,Eor=97,kor=90,Tor=122,aE=46,Rd=47,jp=92,Ux=58,Ior=63;class dot 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 s=e.indexOf(".")!==-1?"property":"argument";let o=`The "${e}" ${s} ${r} of type ${t}`;o+=`. Received type ${typeof i}`,super(o),this.code="ERR_INVALID_ARG_TYPE"}}function Lor(n,e){if(n===null||typeof n!="object")throw new dot(e,"Object",n)}function Hc(n,e){if(typeof n!="string")throw new dot(e,"string",n)}const Qw=xor==="win32";function ro(n){return n===Rd||n===jp}function kge(n){return n===Rd}function qx(n){return n>=Sor&&n<=kor||n>=Eor&&n<=Tor}function RK(n,e,t,i){let r="",s=0,o=-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=Rd}if(i(l)){if(!(o===c-1||a===1))if(a===2){if(r.length<2||s!==2||r.charCodeAt(r.length-1)!==aE||r.charCodeAt(r.length-2)!==aE){if(r.length>2){const u=r.lastIndexOf(t);u===-1?(r="",s=0):(r=r.slice(0,u),s=r.length-1-r.lastIndexOf(t)),o=c,a=0;continue}else if(r.length!==0){r="",s=0,o=c,a=0;continue}}e&&(r+=r.length>0?`${t}..`:"..",s=2)}else r.length>0?r+=`${t}${n.slice(o+1,c)}`:r=n.slice(o+1,c),s=c-o-1;o=c,a=0}else l===aE&&a!==-1?++a:a=-1}return r}function Aor(n){return n?`${n[0]==="."?"":"."}${n}`:""}function hot(n,e){Lor(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${Aor(e.ext)}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const lf={resolve(...n){let e="",t="",i=!1;for(let r=n.length-1;r>=-1;r--){let s;if(r>=0){if(s=n[r],Hc(s,`paths[${r}]`),s.length===0)continue}else e.length===0?s=DK():(s=Ege[`=${e}`]||DK(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===jp)&&(s=`${e}\\`));const o=s.length;let a=0,l="",c=!1;const u=s.charCodeAt(0);if(o===1)ro(u)&&(a=1,c=!0);else if(ro(u))if(c=!0,ro(s.charCodeAt(1))){let d=2,f=d;for(;d<o&&!ro(s.charCodeAt(d));)d++;if(d<o&&d!==f){const p=s.slice(f,d);for(f=d;d<o&&ro(s.charCodeAt(d));)d++;if(d<o&&d!==f){for(f=d;d<o&&!ro(s.charCodeAt(d));)d++;(d===o||d!==f)&&(l=`\\\\${p}\\${s.slice(f,d)}`,a=d)}}}else a=1;else qx(u)&&s.charCodeAt(1)===Ux&&(l=s.slice(0,2),a=2,o>2&&ro(s.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=`${s.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=RK(t,!i,"\\",ro),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){Hc(n,"path");const e=n.length;if(e===0)return".";let t=0,i,r=!1;const s=n.charCodeAt(0);if(e===1)return kge(s)?"\\":n;if(ro(s))if(r=!0,ro(n.charCodeAt(1))){let a=2,l=a;for(;a<e&&!ro(n.charCodeAt(a));)a++;if(a<e&&a!==l){const c=n.slice(l,a);for(l=a;a<e&&ro(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!ro(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 qx(s)&&n.charCodeAt(1)===Ux&&(i=n.slice(0,2),t=2,e>2&&ro(n.charCodeAt(2))&&(r=!0,t=3));let o=t<e?RK(n.slice(t),!r,"\\",ro):"";return o.length===0&&!r&&(o="."),o.length>0&&ro(n.charCodeAt(e-1))&&(o+="\\"),i===void 0?r?`\\${o}`:o:r?`${i}\\${o}`:`${i}${o}`},isAbsolute(n){Hc(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return ro(t)||e>2&&qx(t)&&n.charCodeAt(1)===Ux&&ro(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let s=0;s<n.length;++s){const o=n[s];Hc(o,"path"),o.length>0&&(e===void 0?e=t=o:e+=`\\${o}`)}if(e===void 0)return".";let i=!0,r=0;if(typeof t=="string"&&ro(t.charCodeAt(0))){++r;const s=t.length;s>1&&ro(t.charCodeAt(1))&&(++r,s>2&&(ro(t.charCodeAt(2))?++r:i=!1))}if(i){for(;r<e.length&&ro(e.charCodeAt(r));)r++;r>=2&&(e=`\\${e.slice(r)}`)}return lf.normalize(e)},relative(n,e){if(Hc(n,"from"),Hc(e,"to"),n===e)return"";const t=lf.resolve(n),i=lf.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let r=0;for(;r<n.length&&n.charCodeAt(r)===jp;)r++;let s=n.length;for(;s-1>r&&n.charCodeAt(s-1)===jp;)s--;const o=s-r;let a=0;for(;a<e.length&&e.charCodeAt(a)===jp;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===jp;)l--;const c=l-a,u=o<c?o:c;let d=-1,f=0;for(;f<u;f++){const g=n.charCodeAt(r+f);if(g!==e.charCodeAt(a+f))break;g===jp&&(d=f)}if(f!==u){if(d===-1)return i}else{if(c>u){if(e.charCodeAt(a+f)===jp)return i.slice(a+f+1);if(f===2)return i.slice(a+f)}o>u&&(n.charCodeAt(r+f)===jp?d=f:f===2&&(d=3)),d===-1&&(d=0)}let p="";for(f=r+d+1;f<=s;++f)(f===s||n.charCodeAt(f)===jp)&&(p+=p.length===0?"..":"\\..");return a+=d,p.length>0?`${p}${i.slice(a,l)}`:(i.charCodeAt(a)===jp&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=lf.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===jp){if(e.charCodeAt(1)===jp){const t=e.charCodeAt(2);if(t!==Ior&&t!==aE)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(qx(e.charCodeAt(0))&&e.charCodeAt(1)===Ux&&e.charCodeAt(2)===jp)return`\\\\?\\${e}`;return n},dirname(n){Hc(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const r=n.charCodeAt(0);if(e===1)return ro(r)?n:".";if(ro(r)){if(t=i=1,ro(n.charCodeAt(1))){let a=2,l=a;for(;a<e&&!ro(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&ro(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!ro(n.charCodeAt(a));)a++;if(a===e)return n;a!==l&&(t=i=a+1)}}}}else qx(r)&&n.charCodeAt(1)===Ux&&(t=e>2&&ro(n.charCodeAt(2))?3:2,i=t);let s=-1,o=!0;for(let a=e-1;a>=i;--a)if(ro(n.charCodeAt(a))){if(!o){s=a;break}}else o=!1;if(s===-1){if(t===-1)return".";s=t}return n.slice(0,s)},basename(n,e){e!==void 0&&Hc(e,"suffix"),Hc(n,"path");let t=0,i=-1,r=!0,s;if(n.length>=2&&qx(n.charCodeAt(0))&&n.charCodeAt(1)===Ux&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let o=e.length-1,a=-1;for(s=n.length-1;s>=t;--s){const l=n.charCodeAt(s);if(ro(l)){if(!r){t=s+1;break}}else a===-1&&(r=!1,a=s+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(i=s):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(s=n.length-1;s>=t;--s)if(ro(n.charCodeAt(s))){if(!r){t=s+1;break}}else i===-1&&(r=!1,i=s+1);return i===-1?"":n.slice(t,i)},extname(n){Hc(n,"path");let e=0,t=-1,i=0,r=-1,s=!0,o=0;n.length>=2&&n.charCodeAt(1)===Ux&&qx(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(ro(l)){if(!s){i=a+1;break}continue}r===-1&&(s=!1,r=a+1),l===aE?t===-1?t=a:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||r===-1||o===0||o===1&&t===r-1&&t===i+1?"":n.slice(t,r)},format:hot.bind(null,"\\"),parse(n){Hc(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 ro(r)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(ro(r)){if(i=1,ro(n.charCodeAt(1))){let d=2,f=d;for(;d<t&&!ro(n.charCodeAt(d));)d++;if(d<t&&d!==f){for(f=d;d<t&&ro(n.charCodeAt(d));)d++;if(d<t&&d!==f){for(f=d;d<t&&!ro(n.charCodeAt(d));)d++;d===t?i=d:d!==f&&(i=d+1)}}}}else if(qx(r)&&n.charCodeAt(1)===Ux){if(t<=2)return e.root=e.dir=n,e;if(i=2,ro(n.charCodeAt(2))){if(t===3)return e.root=e.dir=n,e;i=3}}i>0&&(e.root=n.slice(0,i));let s=-1,o=i,a=-1,l=!0,c=n.length-1,u=0;for(;c>=i;--c){if(r=n.charCodeAt(c),ro(r)){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===aE?s===-1?s=c:u!==1&&(u=1):s!==-1&&(u=-1)}return a!==-1&&(s===-1||u===0||u===1&&s===a-1&&s===o+1?e.base=e.name=n.slice(o,a):(e.name=n.slice(o,s),e.base=n.slice(o,a),e.ext=n.slice(s,a))),o>0&&o!==i?e.dir=n.slice(0,o-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Nor=(()=>{if(Qw){const n=/\\/g;return()=>{const e=DK().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>DK()})(),Rl={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const r=i>=0?n[i]:Nor();Hc(r,`paths[${i}]`),r.length!==0&&(e=`${r}/${e}`,t=r.charCodeAt(0)===Rd)}return e=RK(e,!t,"/",kge),t?`/${e}`:e.length>0?e:"."},normalize(n){if(Hc(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Rd,t=n.charCodeAt(n.length-1)===Rd;return n=RK(n,!e,"/",kge),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return Hc(n,"path"),n.length>0&&n.charCodeAt(0)===Rd},join(...n){if(n.length===0)return".";let e;for(let t=0;t<n.length;++t){const i=n[t];Hc(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Rl.normalize(e)},relative(n,e){if(Hc(n,"from"),Hc(e,"to"),n===e||(n=Rl.resolve(n),e=Rl.resolve(e),n===e))return"";const t=1,i=n.length,r=i-t,s=1,o=e.length-s,a=r<o?r:o;let l=-1,c=0;for(;c<a;c++){const d=n.charCodeAt(t+c);if(d!==e.charCodeAt(s+c))break;d===Rd&&(l=c)}if(c===a)if(o>a){if(e.charCodeAt(s+c)===Rd)return e.slice(s+c+1);if(c===0)return e.slice(s+c)}else r>a&&(n.charCodeAt(t+c)===Rd?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===Rd)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(s+l)}`},toNamespacedPath(n){return n},dirname(n){if(Hc(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Rd;let t=-1,i=!0;for(let r=n.length-1;r>=1;--r)if(n.charCodeAt(r)===Rd){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&&Hc(e,"ext"),Hc(n,"path");let t=0,i=-1,r=!0,s;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let o=e.length-1,a=-1;for(s=n.length-1;s>=0;--s){const l=n.charCodeAt(s);if(l===Rd){if(!r){t=s+1;break}}else a===-1&&(r=!1,a=s+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(i=s):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(s=n.length-1;s>=0;--s)if(n.charCodeAt(s)===Rd){if(!r){t=s+1;break}}else i===-1&&(r=!1,i=s+1);return i===-1?"":n.slice(t,i)},extname(n){Hc(n,"path");let e=-1,t=0,i=-1,r=!0,s=0;for(let o=n.length-1;o>=0;--o){const a=n.charCodeAt(o);if(a===Rd){if(!r){t=o+1;break}continue}i===-1&&(r=!1,i=o+1),a===aE?e===-1?e=o:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||i===-1||s===0||s===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:hot.bind(null,"/"),parse(n){Hc(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===Rd;let i;t?(e.root="/",i=1):i=0;let r=-1,s=0,o=-1,a=!0,l=n.length-1,c=0;for(;l>=i;--l){const u=n.charCodeAt(l);if(u===Rd){if(!a){s=l+1;break}continue}o===-1&&(a=!1,o=l+1),u===aE?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}if(o!==-1){const u=s===0&&t?1:s;r===-1||c===0||c===1&&r===o-1&&r===s+1?e.base=e.name=n.slice(u,o):(e.name=n.slice(u,r),e.base=n.slice(u,o),e.ext=n.slice(r,o))}return s>0?e.dir=n.slice(0,s-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Rl.win32=lf.win32=lf;Rl.posix=lf.posix=Rl;const fot=Qw?lf.normalize:Rl.normalize,Dor=Qw?lf.join:Rl.join,Ror=Qw?lf.resolve:Rl.resolve,Por=Qw?lf.relative:Rl.relative,pot=Qw?lf.dirname:Rl.dirname,lE=Qw?lf.basename:Rl.basename,Oor=Qw?lf.extname:Rl.extname,Tb=Qw?lf.sep:Rl.sep,Mor=/^\w[\w\d+.-]*$/,jor=/^\//,For=/^\/\//;function Bor(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&&!Mor.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!jor.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(For.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 $or(n,e){return!n&&!e?"file":n}function Hor(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==ob&&(e=ob+e):e=ob;break}return e}const Il="",ob="/",Vor=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class vi{static isUri(e){return e instanceof vi?!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,s,o=!1){typeof e=="object"?(this.scheme=e.scheme||Il,this.authority=e.authority||Il,this.path=e.path||Il,this.query=e.query||Il,this.fragment=e.fragment||Il):(this.scheme=$or(e,o),this.authority=t||Il,this.path=Hor(this.scheme,i||Il),this.query=r||Il,this.fragment=s||Il,Bor(this,o))}get fsPath(){return PK(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:r,query:s,fragment:o}=e;return t===void 0?t=this.scheme:t===null&&(t=Il),i===void 0?i=this.authority:i===null&&(i=Il),r===void 0?r=this.path:r===null&&(r=Il),s===void 0?s=this.query:s===null&&(s=Il),o===void 0?o=this.fragment:o===null&&(o=Il),t===this.scheme&&i===this.authority&&r===this.path&&s===this.query&&o===this.fragment?this:new ID(t,i,r,s,o)}static parse(e,t=!1){const i=Vor.exec(e);return i?new ID(i[2]||Il,KV(i[4]||Il),KV(i[5]||Il),KV(i[7]||Il),KV(i[9]||Il),t):new ID(Il,Il,Il,Il,Il)}static file(e){let t=Il;if(Wu&&(e=e.replace(/\\/g,ob)),e[0]===ob&&e[1]===ob){const i=e.indexOf(ob,2);i===-1?(t=e.substring(2),e=ob):(t=e.substring(2,i),e=e.substring(i)||ob)}return new ID("file",t,e,Il,Il)}static from(e,t){return new ID(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 Wu&&e.scheme==="file"?i=vi.file(lf.join(PK(e,!0),...t)).path:i=Rl.join(e.path,...t),e.with({path:i})}toString(e=!1){return Tge(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof vi)return e;{const t=new ID(e);return t._formatted=e.external??null,t._fsPath=e._sep===got?e.fsPath??null:null,t}}else return e}}const got=Wu?1:void 0;let ID=class extends vi{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=PK(this,!1)),this._fsPath}toString(e=!1){return e?Tge(this,!0):(this._formatted||(this._formatted=Tge(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=got),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 mot={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 Q6e(n,e,t){let i,r=-1;for(let s=0;s<n.length;s++){const o=n.charCodeAt(s);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||e&&o===47||t&&o===91||t&&o===93||t&&o===58)r!==-1&&(i+=encodeURIComponent(n.substring(r,s)),r=-1),i!==void 0&&(i+=n.charAt(s));else{i===void 0&&(i=n.substr(0,s));const a=mot[o];a!==void 0?(r!==-1&&(i+=encodeURIComponent(n.substring(r,s)),r=-1),i+=a):r===-1&&(r=s)}}return r!==-1&&(i+=encodeURIComponent(n.substring(r))),i!==void 0?i:n}function Wor(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+=mot[i]):e!==void 0&&(e+=n[t])}return e!==void 0?e:n}function PK(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,Wu&&(t=t.replace(/\//g,"\\")),t}function Tge(n,e){const t=e?Wor:Q6e;let i="",{scheme:r,authority:s,path:o,query:a,fragment:l}=n;if(r&&(i+=r,i+=":"),(s||r==="file")&&(i+=ob,i+=ob),s){let c=s.indexOf("@");if(c!==-1){const u=s.substr(0,c);s=s.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+="@"}s=s.toLowerCase(),c=s.lastIndexOf(":"),c===-1?i+=t(s,!1,!0):(i+=t(s.substr(0,c),!1,!0),i+=s.substr(c))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){const c=o.charCodeAt(1);c>=65&&c<=90&&(o=`/${String.fromCharCode(c+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){const c=o.charCodeAt(0);c>=65&&c<=90&&(o=`${String.fromCharCode(c+32)}:${o.substr(2)}`)}i+=t(o,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:Q6e(l,!1,!1)),i}function _ot(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+_ot(n.substr(3)):n}}const X6e=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function KV(n){return n.match(X6e)?n.replace(X6e,e=>_ot(e)):n}let We=class n2{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 n2(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return n2.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return n2.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 n2.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 s=e.column|0,o=t.column|0;return s-o}return i-r}clone(){return new n2(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new n2(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}},ie=class su{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 su.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return su.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 su.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 su.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 su.plusRange(this,e)}static plusRange(e,t){let i,r,s,o;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?(s=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,o=e.endColumn),new su(i,r,s,o)}intersectRanges(e){return su.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,r=e.startColumn,s=e.endLineNumber,o=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)),s>c?(s=c,o=u):s===c&&(o=Math.min(o,u)),i>s||i===s&&r>o?null:new su(i,r,s,o)}equalsRange(e){return su.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 su.getEndPosition(this)}static getEndPosition(e){return new We(e.endLineNumber,e.endColumn)}getStartPosition(){return su.getStartPosition(this)}static getStartPosition(e){return new We(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new su(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new su(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return su.collapseToStart(this)}static collapseToStart(e){return new su(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return su.collapseToEnd(this)}static collapseToEnd(e){return new su(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new su(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new su(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new su(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 s=e.startLineNumber|0,o=t.startLineNumber|0;if(s===o){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,f=t.endColumn|0;return d-f}return c-u}return a-l}return s-o}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}},Yn=class x_ extends ie{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 x_.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 x_(this.startLineNumber,this.startColumn,e,t):new x_(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new We(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new We(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new x_(e,t,this.endLineNumber,this.endColumn):new x_(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new x_(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new x_(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new x_(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new x_(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,s){return s===0?new x_(e,t,i,r):new x_(i,r,e,t)}};const Ige=Object.create(null);function J(n,e){if(cf(e)){const t=Ige[e];if(t===void 0)throw new Error(`${n} references an unknown codicon: ${e}`);e=t}return Ige[n]=e,{id:n}}function vot(){return Ige}const zor={add:J("add",6e4),plus:J("plus",6e4),gistNew:J("gist-new",6e4),repoCreate:J("repo-create",6e4),lightbulb:J("lightbulb",60001),lightBulb:J("light-bulb",60001),repo:J("repo",60002),repoDelete:J("repo-delete",60002),gistFork:J("gist-fork",60003),repoForked:J("repo-forked",60003),gitPullRequest:J("git-pull-request",60004),gitPullRequestAbandoned:J("git-pull-request-abandoned",60004),recordKeys:J("record-keys",60005),keyboard:J("keyboard",60005),tag:J("tag",60006),gitPullRequestLabel:J("git-pull-request-label",60006),tagAdd:J("tag-add",60006),tagRemove:J("tag-remove",60006),person:J("person",60007),personFollow:J("person-follow",60007),personOutline:J("person-outline",60007),personFilled:J("person-filled",60007),gitBranch:J("git-branch",60008),gitBranchCreate:J("git-branch-create",60008),gitBranchDelete:J("git-branch-delete",60008),sourceControl:J("source-control",60008),mirror:J("mirror",60009),mirrorPublic:J("mirror-public",60009),star:J("star",60010),starAdd:J("star-add",60010),starDelete:J("star-delete",60010),starEmpty:J("star-empty",60010),comment:J("comment",60011),commentAdd:J("comment-add",60011),alert:J("alert",60012),warning:J("warning",60012),search:J("search",60013),searchSave:J("search-save",60013),logOut:J("log-out",60014),signOut:J("sign-out",60014),logIn:J("log-in",60015),signIn:J("sign-in",60015),eye:J("eye",60016),eyeUnwatch:J("eye-unwatch",60016),eyeWatch:J("eye-watch",60016),circleFilled:J("circle-filled",60017),primitiveDot:J("primitive-dot",60017),closeDirty:J("close-dirty",60017),debugBreakpoint:J("debug-breakpoint",60017),debugBreakpointDisabled:J("debug-breakpoint-disabled",60017),debugHint:J("debug-hint",60017),terminalDecorationSuccess:J("terminal-decoration-success",60017),primitiveSquare:J("primitive-square",60018),edit:J("edit",60019),pencil:J("pencil",60019),info:J("info",60020),issueOpened:J("issue-opened",60020),gistPrivate:J("gist-private",60021),gitForkPrivate:J("git-fork-private",60021),lock:J("lock",60021),mirrorPrivate:J("mirror-private",60021),close:J("close",60022),removeClose:J("remove-close",60022),x:J("x",60022),repoSync:J("repo-sync",60023),sync:J("sync",60023),clone:J("clone",60024),desktopDownload:J("desktop-download",60024),beaker:J("beaker",60025),microscope:J("microscope",60025),vm:J("vm",60026),deviceDesktop:J("device-desktop",60026),file:J("file",60027),fileText:J("file-text",60027),more:J("more",60028),ellipsis:J("ellipsis",60028),kebabHorizontal:J("kebab-horizontal",60028),mailReply:J("mail-reply",60029),reply:J("reply",60029),organization:J("organization",60030),organizationFilled:J("organization-filled",60030),organizationOutline:J("organization-outline",60030),newFile:J("new-file",60031),fileAdd:J("file-add",60031),newFolder:J("new-folder",60032),fileDirectoryCreate:J("file-directory-create",60032),trash:J("trash",60033),trashcan:J("trashcan",60033),history:J("history",60034),clock:J("clock",60034),folder:J("folder",60035),fileDirectory:J("file-directory",60035),symbolFolder:J("symbol-folder",60035),logoGithub:J("logo-github",60036),markGithub:J("mark-github",60036),github:J("github",60036),terminal:J("terminal",60037),console:J("console",60037),repl:J("repl",60037),zap:J("zap",60038),symbolEvent:J("symbol-event",60038),error:J("error",60039),stop:J("stop",60039),variable:J("variable",60040),symbolVariable:J("symbol-variable",60040),array:J("array",60042),symbolArray:J("symbol-array",60042),symbolModule:J("symbol-module",60043),symbolPackage:J("symbol-package",60043),symbolNamespace:J("symbol-namespace",60043),symbolObject:J("symbol-object",60043),symbolMethod:J("symbol-method",60044),symbolFunction:J("symbol-function",60044),symbolConstructor:J("symbol-constructor",60044),symbolBoolean:J("symbol-boolean",60047),symbolNull:J("symbol-null",60047),symbolNumeric:J("symbol-numeric",60048),symbolNumber:J("symbol-number",60048),symbolStructure:J("symbol-structure",60049),symbolStruct:J("symbol-struct",60049),symbolParameter:J("symbol-parameter",60050),symbolTypeParameter:J("symbol-type-parameter",60050),symbolKey:J("symbol-key",60051),symbolText:J("symbol-text",60051),symbolReference:J("symbol-reference",60052),goToFile:J("go-to-file",60052),symbolEnum:J("symbol-enum",60053),symbolValue:J("symbol-value",60053),symbolRuler:J("symbol-ruler",60054),symbolUnit:J("symbol-unit",60054),activateBreakpoints:J("activate-breakpoints",60055),archive:J("archive",60056),arrowBoth:J("arrow-both",60057),arrowDown:J("arrow-down",60058),arrowLeft:J("arrow-left",60059),arrowRight:J("arrow-right",60060),arrowSmallDown:J("arrow-small-down",60061),arrowSmallLeft:J("arrow-small-left",60062),arrowSmallRight:J("arrow-small-right",60063),arrowSmallUp:J("arrow-small-up",60064),arrowUp:J("arrow-up",60065),bell:J("bell",60066),bold:J("bold",60067),book:J("book",60068),bookmark:J("bookmark",60069),debugBreakpointConditionalUnverified:J("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:J("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:J("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:J("debug-breakpoint-data-unverified",60072),debugBreakpointData:J("debug-breakpoint-data",60073),debugBreakpointDataDisabled:J("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:J("debug-breakpoint-log-unverified",60074),debugBreakpointLog:J("debug-breakpoint-log",60075),debugBreakpointLogDisabled:J("debug-breakpoint-log-disabled",60075),briefcase:J("briefcase",60076),broadcast:J("broadcast",60077),browser:J("browser",60078),bug:J("bug",60079),calendar:J("calendar",60080),caseSensitive:J("case-sensitive",60081),check:J("check",60082),checklist:J("checklist",60083),chevronDown:J("chevron-down",60084),chevronLeft:J("chevron-left",60085),chevronRight:J("chevron-right",60086),chevronUp:J("chevron-up",60087),chromeClose:J("chrome-close",60088),chromeMaximize:J("chrome-maximize",60089),chromeMinimize:J("chrome-minimize",60090),chromeRestore:J("chrome-restore",60091),circleOutline:J("circle-outline",60092),circle:J("circle",60092),debugBreakpointUnverified:J("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:J("terminal-decoration-incomplete",60092),circleSlash:J("circle-slash",60093),circuitBoard:J("circuit-board",60094),clearAll:J("clear-all",60095),clippy:J("clippy",60096),closeAll:J("close-all",60097),cloudDownload:J("cloud-download",60098),cloudUpload:J("cloud-upload",60099),code:J("code",60100),collapseAll:J("collapse-all",60101),colorMode:J("color-mode",60102),commentDiscussion:J("comment-discussion",60103),creditCard:J("credit-card",60105),dash:J("dash",60108),dashboard:J("dashboard",60109),database:J("database",60110),debugContinue:J("debug-continue",60111),debugDisconnect:J("debug-disconnect",60112),debugPause:J("debug-pause",60113),debugRestart:J("debug-restart",60114),debugStart:J("debug-start",60115),debugStepInto:J("debug-step-into",60116),debugStepOut:J("debug-step-out",60117),debugStepOver:J("debug-step-over",60118),debugStop:J("debug-stop",60119),debug:J("debug",60120),deviceCameraVideo:J("device-camera-video",60121),deviceCamera:J("device-camera",60122),deviceMobile:J("device-mobile",60123),diffAdded:J("diff-added",60124),diffIgnored:J("diff-ignored",60125),diffModified:J("diff-modified",60126),diffRemoved:J("diff-removed",60127),diffRenamed:J("diff-renamed",60128),diff:J("diff",60129),diffSidebyside:J("diff-sidebyside",60129),discard:J("discard",60130),editorLayout:J("editor-layout",60131),emptyWindow:J("empty-window",60132),exclude:J("exclude",60133),extensions:J("extensions",60134),eyeClosed:J("eye-closed",60135),fileBinary:J("file-binary",60136),fileCode:J("file-code",60137),fileMedia:J("file-media",60138),filePdf:J("file-pdf",60139),fileSubmodule:J("file-submodule",60140),fileSymlinkDirectory:J("file-symlink-directory",60141),fileSymlinkFile:J("file-symlink-file",60142),fileZip:J("file-zip",60143),files:J("files",60144),filter:J("filter",60145),flame:J("flame",60146),foldDown:J("fold-down",60147),foldUp:J("fold-up",60148),fold:J("fold",60149),folderActive:J("folder-active",60150),folderOpened:J("folder-opened",60151),gear:J("gear",60152),gift:J("gift",60153),gistSecret:J("gist-secret",60154),gist:J("gist",60155),gitCommit:J("git-commit",60156),gitCompare:J("git-compare",60157),compareChanges:J("compare-changes",60157),gitMerge:J("git-merge",60158),githubAction:J("github-action",60159),githubAlt:J("github-alt",60160),globe:J("globe",60161),grabber:J("grabber",60162),graph:J("graph",60163),gripper:J("gripper",60164),heart:J("heart",60165),home:J("home",60166),horizontalRule:J("horizontal-rule",60167),hubot:J("hubot",60168),inbox:J("inbox",60169),issueReopened:J("issue-reopened",60171),issues:J("issues",60172),italic:J("italic",60173),jersey:J("jersey",60174),json:J("json",60175),kebabVertical:J("kebab-vertical",60176),key:J("key",60177),law:J("law",60178),lightbulbAutofix:J("lightbulb-autofix",60179),linkExternal:J("link-external",60180),link:J("link",60181),listOrdered:J("list-ordered",60182),listUnordered:J("list-unordered",60183),liveShare:J("live-share",60184),loading:J("loading",60185),location:J("location",60186),mailRead:J("mail-read",60187),mail:J("mail",60188),markdown:J("markdown",60189),megaphone:J("megaphone",60190),mention:J("mention",60191),milestone:J("milestone",60192),gitPullRequestMilestone:J("git-pull-request-milestone",60192),mortarBoard:J("mortar-board",60193),move:J("move",60194),multipleWindows:J("multiple-windows",60195),mute:J("mute",60196),noNewline:J("no-newline",60197),note:J("note",60198),octoface:J("octoface",60199),openPreview:J("open-preview",60200),package:J("package",60201),paintcan:J("paintcan",60202),pin:J("pin",60203),play:J("play",60204),run:J("run",60204),plug:J("plug",60205),preserveCase:J("preserve-case",60206),preview:J("preview",60207),project:J("project",60208),pulse:J("pulse",60209),question:J("question",60210),quote:J("quote",60211),radioTower:J("radio-tower",60212),reactions:J("reactions",60213),references:J("references",60214),refresh:J("refresh",60215),regex:J("regex",60216),remoteExplorer:J("remote-explorer",60217),remote:J("remote",60218),remove:J("remove",60219),replaceAll:J("replace-all",60220),replace:J("replace",60221),repoClone:J("repo-clone",60222),repoForcePush:J("repo-force-push",60223),repoPull:J("repo-pull",60224),repoPush:J("repo-push",60225),report:J("report",60226),requestChanges:J("request-changes",60227),rocket:J("rocket",60228),rootFolderOpened:J("root-folder-opened",60229),rootFolder:J("root-folder",60230),rss:J("rss",60231),ruby:J("ruby",60232),saveAll:J("save-all",60233),saveAs:J("save-as",60234),save:J("save",60235),screenFull:J("screen-full",60236),screenNormal:J("screen-normal",60237),searchStop:J("search-stop",60238),server:J("server",60240),settingsGear:J("settings-gear",60241),settings:J("settings",60242),shield:J("shield",60243),smiley:J("smiley",60244),sortPrecedence:J("sort-precedence",60245),splitHorizontal:J("split-horizontal",60246),splitVertical:J("split-vertical",60247),squirrel:J("squirrel",60248),starFull:J("star-full",60249),starHalf:J("star-half",60250),symbolClass:J("symbol-class",60251),symbolColor:J("symbol-color",60252),symbolConstant:J("symbol-constant",60253),symbolEnumMember:J("symbol-enum-member",60254),symbolField:J("symbol-field",60255),symbolFile:J("symbol-file",60256),symbolInterface:J("symbol-interface",60257),symbolKeyword:J("symbol-keyword",60258),symbolMisc:J("symbol-misc",60259),symbolOperator:J("symbol-operator",60260),symbolProperty:J("symbol-property",60261),wrench:J("wrench",60261),wrenchSubaction:J("wrench-subaction",60261),symbolSnippet:J("symbol-snippet",60262),tasklist:J("tasklist",60263),telescope:J("telescope",60264),textSize:J("text-size",60265),threeBars:J("three-bars",60266),thumbsdown:J("thumbsdown",60267),thumbsup:J("thumbsup",60268),tools:J("tools",60269),triangleDown:J("triangle-down",60270),triangleLeft:J("triangle-left",60271),triangleRight:J("triangle-right",60272),triangleUp:J("triangle-up",60273),twitter:J("twitter",60274),unfold:J("unfold",60275),unlock:J("unlock",60276),unmute:J("unmute",60277),unverified:J("unverified",60278),verified:J("verified",60279),versions:J("versions",60280),vmActive:J("vm-active",60281),vmOutline:J("vm-outline",60282),vmRunning:J("vm-running",60283),watch:J("watch",60284),whitespace:J("whitespace",60285),wholeWord:J("whole-word",60286),window:J("window",60287),wordWrap:J("word-wrap",60288),zoomIn:J("zoom-in",60289),zoomOut:J("zoom-out",60290),listFilter:J("list-filter",60291),listFlat:J("list-flat",60292),listSelection:J("list-selection",60293),selection:J("selection",60293),listTree:J("list-tree",60294),debugBreakpointFunctionUnverified:J("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:J("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:J("debug-breakpoint-function-disabled",60296),debugStackframeActive:J("debug-stackframe-active",60297),circleSmallFilled:J("circle-small-filled",60298),debugStackframeDot:J("debug-stackframe-dot",60298),terminalDecorationMark:J("terminal-decoration-mark",60298),debugStackframe:J("debug-stackframe",60299),debugStackframeFocused:J("debug-stackframe-focused",60299),debugBreakpointUnsupported:J("debug-breakpoint-unsupported",60300),symbolString:J("symbol-string",60301),debugReverseContinue:J("debug-reverse-continue",60302),debugStepBack:J("debug-step-back",60303),debugRestartFrame:J("debug-restart-frame",60304),debugAlt:J("debug-alt",60305),callIncoming:J("call-incoming",60306),callOutgoing:J("call-outgoing",60307),menu:J("menu",60308),expandAll:J("expand-all",60309),feedback:J("feedback",60310),gitPullRequestReviewer:J("git-pull-request-reviewer",60310),groupByRefType:J("group-by-ref-type",60311),ungroupByRefType:J("ungroup-by-ref-type",60312),account:J("account",60313),gitPullRequestAssignee:J("git-pull-request-assignee",60313),bellDot:J("bell-dot",60314),debugConsole:J("debug-console",60315),library:J("library",60316),output:J("output",60317),runAll:J("run-all",60318),syncIgnored:J("sync-ignored",60319),pinned:J("pinned",60320),githubInverted:J("github-inverted",60321),serverProcess:J("server-process",60322),serverEnvironment:J("server-environment",60323),pass:J("pass",60324),issueClosed:J("issue-closed",60324),stopCircle:J("stop-circle",60325),playCircle:J("play-circle",60326),record:J("record",60327),debugAltSmall:J("debug-alt-small",60328),vmConnect:J("vm-connect",60329),cloud:J("cloud",60330),merge:J("merge",60331),export:J("export",60332),graphLeft:J("graph-left",60333),magnet:J("magnet",60334),notebook:J("notebook",60335),redo:J("redo",60336),checkAll:J("check-all",60337),pinnedDirty:J("pinned-dirty",60338),passFilled:J("pass-filled",60339),circleLargeFilled:J("circle-large-filled",60340),circleLarge:J("circle-large",60341),circleLargeOutline:J("circle-large-outline",60341),combine:J("combine",60342),gather:J("gather",60342),table:J("table",60343),variableGroup:J("variable-group",60344),typeHierarchy:J("type-hierarchy",60345),typeHierarchySub:J("type-hierarchy-sub",60346),typeHierarchySuper:J("type-hierarchy-super",60347),gitPullRequestCreate:J("git-pull-request-create",60348),runAbove:J("run-above",60349),runBelow:J("run-below",60350),notebookTemplate:J("notebook-template",60351),debugRerun:J("debug-rerun",60352),workspaceTrusted:J("workspace-trusted",60353),workspaceUntrusted:J("workspace-untrusted",60354),workspaceUnknown:J("workspace-unknown",60355),terminalCmd:J("terminal-cmd",60356),terminalDebian:J("terminal-debian",60357),terminalLinux:J("terminal-linux",60358),terminalPowershell:J("terminal-powershell",60359),terminalTmux:J("terminal-tmux",60360),terminalUbuntu:J("terminal-ubuntu",60361),terminalBash:J("terminal-bash",60362),arrowSwap:J("arrow-swap",60363),copy:J("copy",60364),personAdd:J("person-add",60365),filterFilled:J("filter-filled",60366),wand:J("wand",60367),debugLineByLine:J("debug-line-by-line",60368),inspect:J("inspect",60369),layers:J("layers",60370),layersDot:J("layers-dot",60371),layersActive:J("layers-active",60372),compass:J("compass",60373),compassDot:J("compass-dot",60374),compassActive:J("compass-active",60375),azure:J("azure",60376),issueDraft:J("issue-draft",60377),gitPullRequestClosed:J("git-pull-request-closed",60378),gitPullRequestDraft:J("git-pull-request-draft",60379),debugAll:J("debug-all",60380),debugCoverage:J("debug-coverage",60381),runErrors:J("run-errors",60382),folderLibrary:J("folder-library",60383),debugContinueSmall:J("debug-continue-small",60384),beakerStop:J("beaker-stop",60385),graphLine:J("graph-line",60386),graphScatter:J("graph-scatter",60387),pieChart:J("pie-chart",60388),bracket:J("bracket",60175),bracketDot:J("bracket-dot",60389),bracketError:J("bracket-error",60390),lockSmall:J("lock-small",60391),azureDevops:J("azure-devops",60392),verifiedFilled:J("verified-filled",60393),newline:J("newline",60394),layout:J("layout",60395),layoutActivitybarLeft:J("layout-activitybar-left",60396),layoutActivitybarRight:J("layout-activitybar-right",60397),layoutPanelLeft:J("layout-panel-left",60398),layoutPanelCenter:J("layout-panel-center",60399),layoutPanelJustify:J("layout-panel-justify",60400),layoutPanelRight:J("layout-panel-right",60401),layoutPanel:J("layout-panel",60402),layoutSidebarLeft:J("layout-sidebar-left",60403),layoutSidebarRight:J("layout-sidebar-right",60404),layoutStatusbar:J("layout-statusbar",60405),layoutMenubar:J("layout-menubar",60406),layoutCentered:J("layout-centered",60407),target:J("target",60408),indent:J("indent",60409),recordSmall:J("record-small",60410),errorSmall:J("error-small",60411),terminalDecorationError:J("terminal-decoration-error",60411),arrowCircleDown:J("arrow-circle-down",60412),arrowCircleLeft:J("arrow-circle-left",60413),arrowCircleRight:J("arrow-circle-right",60414),arrowCircleUp:J("arrow-circle-up",60415),layoutSidebarRightOff:J("layout-sidebar-right-off",60416),layoutPanelOff:J("layout-panel-off",60417),layoutSidebarLeftOff:J("layout-sidebar-left-off",60418),blank:J("blank",60419),heartFilled:J("heart-filled",60420),map:J("map",60421),mapHorizontal:J("map-horizontal",60421),foldHorizontal:J("fold-horizontal",60421),mapFilled:J("map-filled",60422),mapHorizontalFilled:J("map-horizontal-filled",60422),foldHorizontalFilled:J("fold-horizontal-filled",60422),circleSmall:J("circle-small",60423),bellSlash:J("bell-slash",60424),bellSlashDot:J("bell-slash-dot",60425),commentUnresolved:J("comment-unresolved",60426),gitPullRequestGoToChanges:J("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:J("git-pull-request-new-changes",60428),searchFuzzy:J("search-fuzzy",60429),commentDraft:J("comment-draft",60430),send:J("send",60431),sparkle:J("sparkle",60432),insert:J("insert",60433),mic:J("mic",60434),thumbsdownFilled:J("thumbsdown-filled",60435),thumbsupFilled:J("thumbsup-filled",60436),coffee:J("coffee",60437),snake:J("snake",60438),game:J("game",60439),vr:J("vr",60440),chip:J("chip",60441),piano:J("piano",60442),music:J("music",60443),micFilled:J("mic-filled",60444),repoFetch:J("repo-fetch",60445),copilot:J("copilot",60446),lightbulbSparkle:J("lightbulb-sparkle",60447),robot:J("robot",60448),sparkleFilled:J("sparkle-filled",60449),diffSingle:J("diff-single",60450),diffMultiple:J("diff-multiple",60451),surroundWith:J("surround-with",60452),share:J("share",60453),gitStash:J("git-stash",60454),gitStashApply:J("git-stash-apply",60455),gitStashPop:J("git-stash-pop",60456),vscode:J("vscode",60457),vscodeInsiders:J("vscode-insiders",60458),codeOss:J("code-oss",60459),runCoverage:J("run-coverage",60460),runAllCoverage:J("run-all-coverage",60461),coverage:J("coverage",60462),githubProject:J("github-project",60463),mapVertical:J("map-vertical",60464),foldVertical:J("fold-vertical",60464),mapVerticalFilled:J("map-vertical-filled",60465),foldVerticalFilled:J("fold-vertical-filled",60465),goToSearch:J("go-to-search",60466),percentage:J("percentage",60467),sortPercentage:J("sort-percentage",60467),attach:J("attach",60468)},Uor={dialogError:J("dialog-error","error"),dialogWarning:J("dialog-warning","warning"),dialogInfo:J("dialog-info","info"),dialogClose:J("dialog-close","close"),treeItemExpanded:J("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:J("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:J("tree-filter-on-type-off","list-selection"),treeFilterClear:J("tree-filter-clear","close"),treeItemLoading:J("tree-item-loading","loading"),menuSelection:J("menu-selection","check"),menuSubmenu:J("menu-submenu","chevron-right"),menuBarMore:J("menubar-more","more"),scrollbarButtonLeft:J("scrollbar-button-left","triangle-left"),scrollbarButtonRight:J("scrollbar-button-right","triangle-right"),scrollbarButtonUp:J("scrollbar-button-up","triangle-up"),scrollbarButtonDown:J("scrollbar-button-down","triangle-down"),toolBarMore:J("toolbar-more","more"),quickInputBack:J("quick-input-back","arrow-left"),dropDownButton:J("drop-down-button",60084),symbolCustomColor:J("symbol-customcolor",60252),exportIcon:J("export",60332),workspaceUnspecified:J("workspace-unspecified",60355),newLine:J("newline",60394),thumbsDownFilled:J("thumbsdown-filled",60435),thumbsUpFilled:J("thumbsup-filled",60436),gitFetch:J("git-fetch",60445),lightbulbSparkleAutofix:J("lightbulb-sparkle-autofix",60447),debugBreakpointPending:J("debug-breakpoint-pending",60377)},Yt={...zor,...Uor};let bot=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new Ue,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]),gi(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var r;(r=this._factories.get(e))==null||r.dispose();const i=new qor(this,e,t);return this._factories.set(e,i),gi(()=>{const s=this._factories.get(e);!s||s!==i||(this._factories.delete(e),s.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await 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 qor extends Ye{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()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}let n7=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 hke{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class qee{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var Uf;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(Uf||(Uf={}));var i7;(function(n){const e=new Map;e.set(0,Yt.symbolMethod),e.set(1,Yt.symbolFunction),e.set(2,Yt.symbolConstructor),e.set(3,Yt.symbolField),e.set(4,Yt.symbolVariable),e.set(5,Yt.symbolClass),e.set(6,Yt.symbolStruct),e.set(7,Yt.symbolInterface),e.set(8,Yt.symbolModule),e.set(9,Yt.symbolProperty),e.set(10,Yt.symbolEvent),e.set(11,Yt.symbolOperator),e.set(12,Yt.symbolUnit),e.set(13,Yt.symbolValue),e.set(15,Yt.symbolEnum),e.set(14,Yt.symbolConstant),e.set(15,Yt.symbolEnum),e.set(16,Yt.symbolEnumMember),e.set(17,Yt.symbolKeyword),e.set(27,Yt.symbolSnippet),e.set(18,Yt.symbolText),e.set(19,Yt.symbolColor),e.set(20,Yt.symbolFile),e.set(21,Yt.symbolReference),e.set(22,Yt.symbolCustomColor),e.set(23,Yt.symbolFolder),e.set(24,Yt.symbolTypeParameter),e.set(25,Yt.account),e.set(26,Yt.issues);function t(s){let o=e.get(s);return o||(console.info("No codicon found for CompletionItemKind "+s),o=Yt.symbolProperty),o}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(s,o){let a=i.get(s);return typeof a>"u"&&!o&&(a=9),a}n.fromString=r})(i7||(i7={}));var Ib;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Ib||(Ib={}));class yot{constructor(e,t,i,r){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=r}equals(e){return ie.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var r7;(function(n){n[n.Automatic=0]="Automatic",n[n.PasteAs=1]="PasteAs"})(r7||(r7={}));var My;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(My||(My={}));var rM;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(rM||(rM={}));function Kor(n){return n&&vi.isUri(n.uri)&&ie.isIRange(n.range)&&(ie.isIRange(n.originSelectionRange)||ie.isIRange(n.targetSelectionRange))}const Gor={17:A("Array","array"),16:A("Boolean","boolean"),4:A("Class","class"),13:A("Constant","constant"),8:A("Constructor","constructor"),9:A("Enum","enumeration"),21:A("EnumMember","enumeration member"),23:A("Event","event"),7:A("Field","field"),0:A("File","file"),11:A("Function","function"),10:A("Interface","interface"),19:A("Key","key"),5:A("Method","method"),1:A("Module","module"),2:A("Namespace","namespace"),20:A("Null","null"),15:A("Number","number"),18:A("Object","object"),24:A("Operator","operator"),3:A("Package","package"),6:A("Property","property"),14:A("String","string"),22:A("Struct","struct"),25:A("TypeParameter","type parameter"),12:A("Variable","variable")};function Yor(n,e){return A("symbolAriaLabel","{0} ({1})",n,Gor[e])}var OK;(function(n){const e=new Map;e.set(0,Yt.symbolFile),e.set(1,Yt.symbolModule),e.set(2,Yt.symbolNamespace),e.set(3,Yt.symbolPackage),e.set(4,Yt.symbolClass),e.set(5,Yt.symbolMethod),e.set(6,Yt.symbolProperty),e.set(7,Yt.symbolField),e.set(8,Yt.symbolConstructor),e.set(9,Yt.symbolEnum),e.set(10,Yt.symbolInterface),e.set(11,Yt.symbolFunction),e.set(12,Yt.symbolVariable),e.set(13,Yt.symbolConstant),e.set(14,Yt.symbolString),e.set(15,Yt.symbolNumber),e.set(16,Yt.symbolBoolean),e.set(17,Yt.symbolArray),e.set(18,Yt.symbolObject),e.set(19,Yt.symbolKey),e.set(20,Yt.symbolNull),e.set(21,Yt.symbolEnumMember),e.set(22,Yt.symbolStruct),e.set(23,Yt.symbolEvent),e.set(24,Yt.symbolOperator),e.set(25,Yt.symbolTypeParameter);function t(i){let r=e.get(i);return r||(console.info("No codicon found for SymbolKind "+i),r=Yt.symbolProperty),r}n.toIcon=t})(OK||(OK={}));const E_=class E_{static fromValue(e){switch(e){case"comment":return E_.Comment;case"imports":return E_.Imports;case"region":return E_.Region}return new E_(e)}constructor(e){this.value=e}};E_.Comment=new E_("comment"),E_.Imports=new E_("imports"),E_.Region=new E_("region");let KE=E_;var Lge;(function(n){n[n.AIGenerated=1]="AIGenerated"})(Lge||(Lge={}));var s7;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(s7||(s7={}));var Age;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(Age||(Age={}));var MK;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(MK||(MK={}));class Qor{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 Ka=new bot,Nge=new bot;var jK;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(jK||(jK={}));var Dge;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(Dge||(Dge={}));var Rge;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(Rge||(Rge={}));var Pge;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(Pge||(Pge={}));var Oge;(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"})(Oge||(Oge={}));var Mge;(function(n){n[n.Deprecated=1]="Deprecated"})(Mge||(Mge={}));var jge;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(jge||(jge={}));var Fge;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(Fge||(Fge={}));var Bge;(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"})(Bge||(Bge={}));var $ge;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})($ge||($ge={}));var Hge;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(Hge||(Hge={}));var Vge;(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"})(Vge||(Vge={}));var Wge;(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.inlineEdit=63]="inlineEdit",n[n.letterSpacing=64]="letterSpacing",n[n.lightbulb=65]="lightbulb",n[n.lineDecorationsWidth=66]="lineDecorationsWidth",n[n.lineHeight=67]="lineHeight",n[n.lineNumbers=68]="lineNumbers",n[n.lineNumbersMinChars=69]="lineNumbersMinChars",n[n.linkedEditing=70]="linkedEditing",n[n.links=71]="links",n[n.matchBrackets=72]="matchBrackets",n[n.minimap=73]="minimap",n[n.mouseStyle=74]="mouseStyle",n[n.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=76]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",n[n.multiCursorModifier=78]="multiCursorModifier",n[n.multiCursorPaste=79]="multiCursorPaste",n[n.multiCursorLimit=80]="multiCursorLimit",n[n.occurrencesHighlight=81]="occurrencesHighlight",n[n.overviewRulerBorder=82]="overviewRulerBorder",n[n.overviewRulerLanes=83]="overviewRulerLanes",n[n.padding=84]="padding",n[n.pasteAs=85]="pasteAs",n[n.parameterHints=86]="parameterHints",n[n.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",n[n.placeholder=88]="placeholder",n[n.definitionLinkOpensInPeek=89]="definitionLinkOpensInPeek",n[n.quickSuggestions=90]="quickSuggestions",n[n.quickSuggestionsDelay=91]="quickSuggestionsDelay",n[n.readOnly=92]="readOnly",n[n.readOnlyMessage=93]="readOnlyMessage",n[n.renameOnType=94]="renameOnType",n[n.renderControlCharacters=95]="renderControlCharacters",n[n.renderFinalNewline=96]="renderFinalNewline",n[n.renderLineHighlight=97]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=98]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=99]="renderValidationDecorations",n[n.renderWhitespace=100]="renderWhitespace",n[n.revealHorizontalRightPadding=101]="revealHorizontalRightPadding",n[n.roundedSelection=102]="roundedSelection",n[n.rulers=103]="rulers",n[n.scrollbar=104]="scrollbar",n[n.scrollBeyondLastColumn=105]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=106]="scrollBeyondLastLine",n[n.scrollPredominantAxis=107]="scrollPredominantAxis",n[n.selectionClipboard=108]="selectionClipboard",n[n.selectionHighlight=109]="selectionHighlight",n[n.selectOnLineNumbers=110]="selectOnLineNumbers",n[n.showFoldingControls=111]="showFoldingControls",n[n.showUnused=112]="showUnused",n[n.snippetSuggestions=113]="snippetSuggestions",n[n.smartSelect=114]="smartSelect",n[n.smoothScrolling=115]="smoothScrolling",n[n.stickyScroll=116]="stickyScroll",n[n.stickyTabStops=117]="stickyTabStops",n[n.stopRenderingLineAfter=118]="stopRenderingLineAfter",n[n.suggest=119]="suggest",n[n.suggestFontSize=120]="suggestFontSize",n[n.suggestLineHeight=121]="suggestLineHeight",n[n.suggestOnTriggerCharacters=122]="suggestOnTriggerCharacters",n[n.suggestSelection=123]="suggestSelection",n[n.tabCompletion=124]="tabCompletion",n[n.tabIndex=125]="tabIndex",n[n.unicodeHighlighting=126]="unicodeHighlighting",n[n.unusualLineTerminators=127]="unusualLineTerminators",n[n.useShadowDOM=128]="useShadowDOM",n[n.useTabStops=129]="useTabStops",n[n.wordBreak=130]="wordBreak",n[n.wordSegmenterLocales=131]="wordSegmenterLocales",n[n.wordSeparators=132]="wordSeparators",n[n.wordWrap=133]="wordWrap",n[n.wordWrapBreakAfterCharacters=134]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=135]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=136]="wordWrapColumn",n[n.wordWrapOverride1=137]="wordWrapOverride1",n[n.wordWrapOverride2=138]="wordWrapOverride2",n[n.wrappingIndent=139]="wrappingIndent",n[n.wrappingStrategy=140]="wrappingStrategy",n[n.showDeprecated=141]="showDeprecated",n[n.inlayHints=142]="inlayHints",n[n.editorClassName=143]="editorClassName",n[n.pixelRatio=144]="pixelRatio",n[n.tabFocusMode=145]="tabFocusMode",n[n.layoutInfo=146]="layoutInfo",n[n.wrappingInfo=147]="wrappingInfo",n[n.defaultColorDecorators=148]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=149]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=150]="inlineCompletionsAccessibilityVerbose"})(Wge||(Wge={}));var zge;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(zge||(zge={}));var Uge;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(Uge||(Uge={}));var qge;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=3]="Right"})(qge||(qge={}));var Kge;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(Kge||(Kge={}));var Gge;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Gge||(Gge={}));var Yge;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(Yge||(Yge={}));var Qge;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(Qge||(Qge={}));var Xge;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Xge||(Xge={}));var Zge;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(Zge||(Zge={}));var Jge;(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"})(Jge||(Jge={}));var eme;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(eme||(eme={}));var tme;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(tme||(tme={}));var nme;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(nme||(nme={}));var ime;(function(n){n[n.Normal=1]="Normal",n[n.Underlined=2]="Underlined"})(ime||(ime={}));var rme;(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"})(rme||(rme={}));var sme;(function(n){n[n.AIGenerated=1]="AIGenerated"})(sme||(sme={}));var ome;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(ome||(ome={}));var ame;(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"})(ame||(ame={}));var lme;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(lme||(lme={}));var cme;(function(n){n[n.Word=0]="Word",n[n.Line=1]="Line",n[n.Suggest=2]="Suggest"})(cme||(cme={}));var ume;(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"})(ume||(ume={}));var dme;(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"})(dme||(dme={}));var hme;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(hme||(hme={}));var fme;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(fme||(fme={}));var pme;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(pme||(pme={}));var gme;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(gme||(gme={}));var mme;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(mme||(mme={}));var _me;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(_me||(_me={}));var vme;(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"})(vme||(vme={}));var bme;(function(n){n[n.Deprecated=1]="Deprecated"})(bme||(bme={}));var yme;(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"})(yme||(yme={}));var Cme;(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"})(Cme||(Cme={}));var wme;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(wme||(wme={}));var xme;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(xme||(xme={}));var ZC;let Xor=(ZC=class{static chord(e,t){return Gl(e,t)}},ZC.CtrlCmd=2048,ZC.Shift=1024,ZC.Alt=512,ZC.WinCtrl=256,ZC);function Cot(){return{editor:void 0,languages:void 0,CancellationTokenSource:ba,Emitter:Ue,KeyCode:Jge,KeyMod:Xor,Position:We,Range:ie,Selection:Yn,SelectionDirection:gme,MarkerSeverity:eme,MarkerTag:tme,Uri:vi,Token:n7}}function Zor(n,e){const t=n;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const bo=window;function wot(n){return n}class Jor{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=wot):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}}class Z6e{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=wot):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);const i=this._fn(e);return this._map.set(e,i),this._map2.set(t,i),i}}class Bb{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}}function xot(n){return!n||typeof n!="string"?!0:n.trim().length===0}const ear=/{(\d+)}/g;function jL(n,...e){return e.length===0?n:n.replace(ear,function(t,i){const r=parseInt(i,10);return isNaN(r)||r<0||r>=e.length?t:e[r]})}function tar(n){return n.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function QF(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function mg(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function nar(n,e=" "){const t=W9(n,e);return Sot(t,e)}function W9(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 Sot(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let r=i,s=-1;for(;s=n.lastIndexOf(e,r-1),!(s===-1||s+t!==r);){if(s===0)return"";r=s}return n.substring(0,r)}function iar(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function rar(n){return n.replace(/\*/g,"")}function Eot(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=mg(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 sar(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function _1(n){return n.split(/\r\n|\r|\n/)}function oar(n){const e=[],t=n.split(/(\r\n|\r|\n)/);for(let i=0;i<Math.ceil(t.length/2);i++)e.push(t[2*i]+(t[2*i+1]??""));return e}function Yd(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 _o(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 Lb(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 o7(n,e){return n<e?-1:n>e?1:0}function fke(n,e,t=0,i=n.length,r=0,s=e.length){for(;t<i&&r<s;t++,r++){const l=n.charCodeAt(t),c=e.charCodeAt(r);if(l<c)return-1;if(l>c)return 1}const o=i-t,a=s-r;return o<a?-1:o>a?1:0}function Sme(n,e){return z9(n,e,0,n.length,0,e.length)}function z9(n,e,t=0,i=n.length,r=0,s=e.length){for(;t<i&&r<s;t++,r++){let l=n.charCodeAt(t),c=e.charCodeAt(r);if(l===c)continue;if(l>=128||c>=128)return fke(n.toLowerCase(),e.toLowerCase(),t,i,r,s);jS(l)&&(l-=32),jS(c)&&(c-=32);const u=l-c;if(u!==0)return u}const o=i-t,a=s-r;return o<a?-1:o>a?1:0}function GV(n){return n>=48&&n<=57}function jS(n){return n>=97&&n<=122}function oy(n){return n>=65&&n<=90}function IR(n,e){return n.length===e.length&&z9(n,e)===0}function pke(n,e){const t=e.length;return e.length>n.length?!1:z9(n,e,0,t)===0}function GE(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 FK(n,e){const t=Math.min(n.length,e.length);let i;const r=n.length-1,s=e.length-1;for(i=0;i<t;i++)if(n.charCodeAt(r-i)!==e.charCodeAt(s-i))return i;return t}function Ec(n){return 55296<=n&&n<=56319}function FL(n){return 56320<=n&&n<=57343}function gke(n,e){return(n-55296<<10)+(e-56320)+65536}function BK(n,e,t){const i=n.charCodeAt(t);if(Ec(i)&&t+1<e){const r=n.charCodeAt(t+1);if(FL(r))return gke(i,r)}return i}function aar(n,e){const t=n.charCodeAt(e-1);if(FL(t)&&e>1){const i=n.charCodeAt(e-2);if(Ec(i))return gke(i,t)}return t}class mke{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=aar(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=BK(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class $K{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new mke(e,t)}nextGraphemeLength(){const e=HK.getInstance(),t=this._iterator,i=t.offset;let r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const s=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(J6e(r,o)){t.setOffset(s);break}r=o}return t.offset-i}prevGraphemeLength(){const e=HK.getInstance(),t=this._iterator,i=t.offset;let r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const s=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(J6e(o,r)){t.setOffset(s);break}r=o}return i-t.offset}eol(){return this._iterator.eol()}}function _ke(n,e){return new $K(n,e).nextGraphemeLength()}function kot(n,e){return new $K(n,e).prevGraphemeLength()}function lar(n,e){e>0&&FL(n.charCodeAt(e))&&e--;const t=e+_ke(n,e);return[t-kot(n,t),t]}let lce;function car(){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 sM(n){return lce||(lce=car()),lce.test(n)}const uar=/^[\t\n\r\x20-\x7E]*$/;function U9(n){return uar.test(n)}const Tot=/[\u2028\u2029]/;function Iot(n){return Tot.test(n)}function YE(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function vke(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 dar="\uFEFF";function bke(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function har(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function Lot(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function J6e(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)}const A2=class A2{static getInstance(){return A2._INSTANCE||(A2._INSTANCE=new A2),A2._INSTANCE}constructor(){this._data=far()}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}};A2._INSTANCE=null;let HK=A2;function far(){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 par(n,e){if(n===0)return 0;const t=gar(n,e);if(t!==void 0)return t;const i=new mke(e,n);return i.prevCodePoint(),i.offset}function gar(n,e){const t=new mke(e,n);let i=t.prevCodePoint();for(;mar(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!vke(i))return;let r=t.offset;return r>0&&t.prevCodePoint()===8205&&(r=t.offset),r}function mar(n){return 127995<=n&&n<=127999}const Aot=" ",U0=class U0{static getInstance(e){return U0.cache.get(Array.from(e))}static getLocales(){return U0._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())}};U0.ambiguousCharacterData=new Bb(()=>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]}')),U0.cache=new Jor({getCacheKey:JSON.stringify},e=>{function t(u){const d=new Map;for(let f=0;f<u.length;f+=2)d.set(u[f],u[f+1]);return d}function i(u,d){const f=new Map(u);for(const[p,g]of d)f.set(p,g);return f}function r(u,d){if(!u)return d;const f=new Map;for(const[p,g]of u)d.has(p)&&f.set(p,g);return f}const s=U0.ambiguousCharacterData.value;let o=e.filter(u=>!u.startsWith("_")&&u in s);o.length===0&&(o=["_default"]);let a;for(const u of o){const d=t(s[u]);a=r(a,d)}const l=t(s._common),c=i(l,a);return new U0(c)}),U0._locales=new Bb(()=>Object.keys(U0.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")));let a7=U0;const JR=class JR{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(JR.getRawData())),this._data}static isInvisibleCharacter(e){return JR.getData().has(e)}static get codePoints(){return JR.getData()}};JR._data=void 0;let lI=JR;const IQ=class IQ{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}};IQ.INSTANCE=new IQ;let Eme=IQ;function Not(n,e,t){typeof e=="string"&&(e=n.matchMedia(e)),e.addEventListener("change",t)}function _ar(n){return Eme.INSTANCE.getZoomFactor(n)}const B4=navigator.userAgent,Dm=B4.indexOf("Firefox")>=0,Kee=B4.indexOf("AppleWebKit")>=0,q9=B4.indexOf("Chrome")>=0,QE=!q9&&B4.indexOf("Safari")>=0,Dot=!q9&&!QE&&Kee;B4.indexOf("Electron/")>=0;const e8e=B4.indexOf("Android")>=0;let cce=!1;if(typeof bo.matchMedia=="function"){const n=bo.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=bo.matchMedia("(display-mode: fullscreen)");cce=n.matches,Not(bo,n,({matches:t})=>{cce&&e.matches||(cce=t)})}const yke={clipboard:{writeText:qy||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:qy||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:bo.PointerEvent&&("ontouchstart"in bo||navigator.maxTouchPoints>0)};function kme(n,e){if(typeof n=="number"){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new uce([YV(t,e),YV(i,e)]):new uce([YV(t,e)])}else{const t=[];for(let i=0;i<n.length;i++)t.push(YV(n[i],e));return new uce(t)}}function YV(n,e){const t=!!(n&2048),i=!!(n&256),r=e===2?i:t,s=!!(n&1024),o=!!(n&512),a=e===2?t:i,l=n&255;return new Aw(r,s,o,a,l)}class Aw{constructor(e,t,i,r,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=r,this.keyCode=s}equals(e){return e instanceof Aw&&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 uce{constructor(e){if(e.length===0)throw Sm("chords");this.chords=e}}class bar{constructor(e,t,i,r,s,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=r,this.keyLabel=s,this.keyAriaLabel=o}}class yar{}function Car(n){if(n.charCode){const t=String.fromCharCode(n.charCode).toUpperCase();return DC.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(Dm)switch(e){case 59:return 85;case 60:if(Nh)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(zr)return 57;break}else if(Kee){if(zr&&e===93)return 57;if(!zr&&e===92)return 57}return uot[e]||0}const war=zr?256:2048,xar=512,Sar=1024,Ear=zr?2048:256;class Io{constructor(e){var i;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=(i=t.getModifierState)==null?void 0:i.call(t,"AltGraph"),this.keyCode=Car(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|=war),this.altKey&&(t|=xar),this.shiftKey&&(t|=Sar),this.metaKey&&(t|=Ear),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Aw(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}const t8e=new WeakMap;function kar(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 null}catch{return null}return n.parent}class Tar{static getSameOriginWindowChain(e){let t=t8e.get(e);if(!t){t=[],t8e.set(e,t);let i=e,r;do r=kar(i),r?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=r;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,r=0;const s=this.getSameOriginWindowChain(e);for(const o of s){const a=o.window.deref();if(i+=(a==null?void 0:a.scrollY)??0,r+=(a==null?void 0:a.scrollX)??0,a===t||!o.iframeElement)break;const l=o.iframeElement.getBoundingClientRect();i+=l.top,r+=l.left}return{top:i,left:r}}}class B_{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const i=Tar.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class BL{constructor(e,t=0,i=0){var s;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let r=!1;if(q9){const o=navigator.userAgent.match(/Chrome\/(\d+)/);r=(o?parseInt(o[1]):123)<=122}if(e){const o=e,a=e,l=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof o.wheelDeltaY<"u")r?this.deltaY=o.wheelDeltaY/(120*l):this.deltaY=o.wheelDeltaY/120;else if(typeof a.VERTICAL_AXIS<"u"&&a.axis===a.VERTICAL_AXIS)this.deltaY=-a.detail/3;else if(e.type==="wheel"){const c=e;c.deltaMode===c.DOM_DELTA_LINE?Dm&&!zr?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")QE&&Wu?this.deltaX=-(o.wheelDeltaX/120):r?this.deltaX=o.wheelDeltaX/(120*l):this.deltaX=o.wheelDeltaX/120;else if(typeof a.HORIZONTAL_AXIS<"u"&&a.axis===a.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const c=e;c.deltaMode===c.DOM_DELTA_LINE?Dm&&!zr?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*l):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}}const Rot=Symbol("MicrotaskDelay");function Tme(n){return!!n&&typeof n.then=="function"}function Ic(n){const e=new ba,t=n(e.token),i=new Promise((r,s)=>{const o=e.token.onCancellationRequested(()=>{o.dispose(),s(new rv)});Promise.resolve(t).then(a=>{o.dispose(),e.dispose(),r(a)},a=>{o.dispose(),e.dispose(),s(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(r,s){return i.then(r,s)}catch(r){return this.then(void 0,r)}finally(r){return i.finally(r)}}}function K9(n,e,t){return new Promise((i,r)=>{const s=e.onCancellationRequested(()=>{s.dispose(),i(t)});n.then(i,r).finally(()=>s.dispose())})}class Iar{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 Lar=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},Aar=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Rm{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,s)=>{this.doResolve=r,this.doReject=s}).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.call(this,null)};return this.deferred=t===Rot?Aar(i):Lar(t,i),this.completionPromise}isTriggered(){var e;return!!((e=this.deferred)!=null&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)==null||e.call(this,new rv),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)==null||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class Pot{constructor(e){this.delayer=new Rm(e),this.throttler=new Iar}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function Nw(n,e){return e?new Promise((t,i)=>{const r=setTimeout(()=>{s.dispose(),t()},n),s=e.onCancellationRequested(()=>{clearTimeout(r),s.dispose(),i(new rv)})}):Ic(t=>Nw(n,t))}function XE(n,e=0,t){const i=setTimeout(()=>{n(),t&&r.dispose()},e),r=gi(()=>{clearTimeout(i),t==null||t.deleteAndLeak(r)});return t==null||t.add(r),r}function Cke(n,e=i=>!!i,t=null){let i=0;const r=n.length,s=()=>{if(i>=r)return Promise.resolve(t);const o=n[i++];return Promise.resolve(o()).then(l=>e(l)?Promise.resolve(l):s())};return s()}class vv{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Ps("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ps("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class wke{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new Ps("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const r=i.setInterval(()=>{e()},t);this.disposable=gi(()=>{i.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class ao{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.call(this)}}let Oot,XF;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?XF=(n,e)=>{eot(()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:XF=(n,e,t)=>{const i=n.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let r=!1;return{dispose(){r||(r=!0,n.cancelIdleCallback(i))}}},Oot=n=>XF(globalThis,n)})();class Mot{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=XF(e,()=>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 Nar extends Mot{constructor(e){super(globalThis,e)}}class $4{get isRejected(){var e;return((e=this.outcome)==null?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 rv)}}var Ime;(function(n){async function e(i){let r;const s=await Promise.all(i.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return s}n.settled=e;function t(i){return new Promise(async(r,s)=>{try{await i(r,s)}catch(o){s(o)}})}n.withAsyncBody=t})(Ime||(Ime={}));const Bf=class Bf{static fromArray(e){return new Bf(t=>{t.emitMany(e)})}static fromPromise(e){return new Bf(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Bf(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new Bf(async t=>{await Promise.all(e.map(async i=>{for await(const r of i)t.emitOne(r)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Ue,queueMicrotask(async()=>{const i={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(i)),this.resolve()}catch(r){this.reject(r)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{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};await rn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var t;return(t=this._onReturn)==null||t.call(this),{done:!0,value:void 0}}}}static map(e,t){return new Bf(async i=>{for await(const r of e)i.emitOne(t(r))})}map(e){return Bf.map(this,e)}static filter(e,t){return new Bf(async i=>{for await(const r of e)t(r)&&i.emitOne(r)})}filter(e){return Bf.filter(this,e)}static coalesce(e){return Bf.filter(e,t=>!!t)}coalesce(){return Bf.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return Bf.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())}};Bf.EMPTY=Bf.fromArray([]);let ng=Bf;class Dar extends ng{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function Rar(n){const e=new ba,t=n(e.token);return new Dar(e,async i=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),i.reject(new rv)});try{for await(const s of t){if(e.token.isCancellationRequested)return;i.emitOne(s)}r.dispose(),e.dispose()}catch(s){r.dispose(),e.dispose(),i.reject(s)}})}/*! @license DOMPurify 3.1.7 | (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.7/LICENSE */const{entries:jot,setPrototypeOf:n8e,isFrozen:Par,getPrototypeOf:Oar,getOwnPropertyDescriptor:Mar}=Object;let{freeze:ap,seal:sv,create:Fot}=Object,{apply:Lme,construct:Ame}=typeof Reflect<"u"&&Reflect;ap||(ap=function(e){return e});sv||(sv=function(e){return e});Lme||(Lme=function(e,t,i){return e.apply(t,i)});Ame||(Ame=function(e,t){return new e(...t)});const QV=Pm(Array.prototype.forEach),i8e=Pm(Array.prototype.pop),rj=Pm(Array.prototype.push),eU=Pm(String.prototype.toLowerCase),dce=Pm(String.prototype.toString),r8e=Pm(String.prototype.match),sj=Pm(String.prototype.replace),jar=Pm(String.prototype.indexOf),Far=Pm(String.prototype.trim),qv=Pm(Object.prototype.hasOwnProperty),Mf=Pm(RegExp.prototype.test),oj=Bar(TypeError);function Pm(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 Lme(n,e,i)}}function Bar(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Ame(n,t)}}function Eo(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eU;n8e&&n8e(n,null);let i=e.length;for(;i--;){let r=e[i];if(typeof r=="string"){const s=t(r);s!==r&&(Par(e)||(e[i]=s),r=s)}n[r]=!0}return n}function $ar(n){for(let e=0;e<n.length;e++)qv(n,e)||(n[e]=null);return n}function i2(n){const e=Fot(null);for(const[t,i]of jot(n))qv(n,t)&&(Array.isArray(i)?e[t]=$ar(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=i2(i):e[t]=i);return e}function aj(n,e){for(;n!==null;){const i=Mar(n,e);if(i){if(i.get)return Pm(i.get);if(typeof i.value=="function")return Pm(i.value)}n=Oar(n)}function t(){return null}return t}const s8e=ap(["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"]),hce=ap(["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"]),fce=ap(["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"]),Har=ap(["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"]),pce=ap(["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"]),Var=ap(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),o8e=ap(["#text"]),a8e=ap(["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","popover","popovertarget","popovertargetaction","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"]),gce=ap(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","slope","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","tablevalues","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"]),l8e=ap(["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"]),XV=ap(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),War=sv(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zar=sv(/<%[\w\W]*|[\w\W]*%>/gm),Uar=sv(/\${[\w\W]*}/gm),qar=sv(/^data-[\-\w.\u00B7-\uFFFF]/),Kar=sv(/^aria-[\-\w]+$/),Bot=sv(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gar=sv(/^(?:\w+script|data):/i),Yar=sv(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$ot=sv(/^html$/i),Qar=sv(/^[a-z][.\w]*(-[.\w]+)+$/i);var c8e=Object.freeze({__proto__:null,MUSTACHE_EXPR:War,ERB_EXPR:zar,TMPLIT_EXPR:Uar,DATA_ATTR:qar,ARIA_ATTR:Kar,IS_ALLOWED_URI:Bot,IS_SCRIPT_OR_DATA:Gar,ATTR_WHITESPACE:Yar,DOCTYPE_NAME:$ot,CUSTOM_ELEMENT:Qar});const lj={element:1,text:3,progressingInstruction:7,comment:8,document:9},Xar=function(){return typeof window>"u"?null:window},Zar=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 s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function Hot(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xar();const e=Dt=>Hot(Dt);if(e.version="3.1.7",e.removed=[],!n||!n.document||n.document.nodeType!==lj.document)return e.isSupported=!1,e;let{document:t}=n;const i=t,r=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=n,g=l.prototype,m=aj(g,"cloneNode"),_=aj(g,"remove"),v=aj(g,"nextSibling"),b=aj(g,"childNodes"),y=aj(g,"parentNode");if(typeof o=="function"){const Dt=t.createElement("template");Dt.content&&Dt.content.ownerDocument&&(t=Dt.content.ownerDocument)}let C,S="";const{implementation:k,createNodeIterator:I,createDocumentFragment:L,getElementsByTagName:N}=t,{importNode:P}=i;let O={};e.isSupported=typeof jot=="function"&&typeof y=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:V,TMPLIT_EXPR:M,DATA_ATTR:B,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:G}=c8e;let{IS_ALLOWED_URI:H}=c8e,z=null;const Z=Eo({},[...s8e,...hce,...fce,...pce,...o8e]);let X=null;const oe=Eo({},[...a8e,...gce,...l8e,...XV]);let fe=Object.seal(Fot(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}})),Se=null,Me=null,Ie=!0,ge=!0,ye=!1,Pe=!0,Be=!1,$e=!0,qe=!1,mt=!1,vt=!1,ft=!1,tt=!1,St=!1,Ft=!0,en=!1;const Ke="user-content-";let dt=!0,nt=!1,at={},Oe=null;const ce=Eo({},["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 Ne=null;const Xe=Eo({},["audio","video","img","source","image","track"]);let it=null;const Tt=Eo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ct="http://www.w3.org/1998/Math/MathML",Rt="http://www.w3.org/2000/svg",se="http://www.w3.org/1999/xhtml";let ke=se,Ae=!1,je=null;const Ve=Eo({},[Ct,Rt,se],dce);let Qt=null;const rt=["application/xhtml+xml","text/html"],Cn="text/html";let Rn=null,li=null;const Mi=t.createElement("form"),si=function(le){return le instanceof RegExp||le instanceof Function},oi=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(li&&li===le)){if((!le||typeof le!="object")&&(le={}),le=i2(le),Qt=rt.indexOf(le.PARSER_MEDIA_TYPE)===-1?Cn:le.PARSER_MEDIA_TYPE,Rn=Qt==="application/xhtml+xml"?dce:eU,z=qv(le,"ALLOWED_TAGS")?Eo({},le.ALLOWED_TAGS,Rn):Z,X=qv(le,"ALLOWED_ATTR")?Eo({},le.ALLOWED_ATTR,Rn):oe,je=qv(le,"ALLOWED_NAMESPACES")?Eo({},le.ALLOWED_NAMESPACES,dce):Ve,it=qv(le,"ADD_URI_SAFE_ATTR")?Eo(i2(Tt),le.ADD_URI_SAFE_ATTR,Rn):Tt,Ne=qv(le,"ADD_DATA_URI_TAGS")?Eo(i2(Xe),le.ADD_DATA_URI_TAGS,Rn):Xe,Oe=qv(le,"FORBID_CONTENTS")?Eo({},le.FORBID_CONTENTS,Rn):ce,Se=qv(le,"FORBID_TAGS")?Eo({},le.FORBID_TAGS,Rn):{},Me=qv(le,"FORBID_ATTR")?Eo({},le.FORBID_ATTR,Rn):{},at=qv(le,"USE_PROFILES")?le.USE_PROFILES:!1,Ie=le.ALLOW_ARIA_ATTR!==!1,ge=le.ALLOW_DATA_ATTR!==!1,ye=le.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Be=le.SAFE_FOR_TEMPLATES||!1,$e=le.SAFE_FOR_XML!==!1,qe=le.WHOLE_DOCUMENT||!1,ft=le.RETURN_DOM||!1,tt=le.RETURN_DOM_FRAGMENT||!1,St=le.RETURN_TRUSTED_TYPE||!1,vt=le.FORCE_BODY||!1,Ft=le.SANITIZE_DOM!==!1,en=le.SANITIZE_NAMED_PROPS||!1,dt=le.KEEP_CONTENT!==!1,nt=le.IN_PLACE||!1,H=le.ALLOWED_URI_REGEXP||Bot,ke=le.NAMESPACE||se,fe=le.CUSTOM_ELEMENT_HANDLING||{},le.CUSTOM_ELEMENT_HANDLING&&si(le.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(fe.tagNameCheck=le.CUSTOM_ELEMENT_HANDLING.tagNameCheck),le.CUSTOM_ELEMENT_HANDLING&&si(le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(fe.attributeNameCheck=le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),le.CUSTOM_ELEMENT_HANDLING&&typeof le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Be&&(ge=!1),tt&&(ft=!0),at&&(z=Eo({},o8e),X=[],at.html===!0&&(Eo(z,s8e),Eo(X,a8e)),at.svg===!0&&(Eo(z,hce),Eo(X,gce),Eo(X,XV)),at.svgFilters===!0&&(Eo(z,fce),Eo(X,gce),Eo(X,XV)),at.mathMl===!0&&(Eo(z,pce),Eo(X,l8e),Eo(X,XV))),le.ADD_TAGS&&(z===Z&&(z=i2(z)),Eo(z,le.ADD_TAGS,Rn)),le.ADD_ATTR&&(X===oe&&(X=i2(X)),Eo(X,le.ADD_ATTR,Rn)),le.ADD_URI_SAFE_ATTR&&Eo(it,le.ADD_URI_SAFE_ATTR,Rn),le.FORBID_CONTENTS&&(Oe===ce&&(Oe=i2(Oe)),Eo(Oe,le.FORBID_CONTENTS,Rn)),dt&&(z["#text"]=!0),qe&&Eo(z,["html","head","body"]),z.table&&(Eo(z,["tbody"]),delete Se.tbody),le.TRUSTED_TYPES_POLICY){if(typeof le.TRUSTED_TYPES_POLICY.createHTML!="function")throw oj('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw oj('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=le.TRUSTED_TYPES_POLICY,S=C.createHTML("")}else C===void 0&&(C=Zar(p,r)),C!==null&&typeof S=="string"&&(S=C.createHTML(""));ap&&ap(le),li=le}},_n=Eo({},["mi","mo","mn","ms","mtext"]),de=Eo({},["annotation-xml"]),_e=Eo({},["title","style","font","a","script"]),Le=Eo({},[...hce,...fce,...Har]),Ge=Eo({},[...pce,...Var]),gt=function(le){let Qe=y(le);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:ke,tagName:"template"});const ht=eU(le.tagName),Bt=eU(Qe.tagName);return je[le.namespaceURI]?le.namespaceURI===Rt?Qe.namespaceURI===se?ht==="svg":Qe.namespaceURI===Ct?ht==="svg"&&(Bt==="annotation-xml"||_n[Bt]):!!Le[ht]:le.namespaceURI===Ct?Qe.namespaceURI===se?ht==="math":Qe.namespaceURI===Rt?ht==="math"&&de[Bt]:!!Ge[ht]:le.namespaceURI===se?Qe.namespaceURI===Rt&&!de[Bt]||Qe.namespaceURI===Ct&&!_n[Bt]?!1:!Ge[ht]&&(_e[ht]||!Le[ht]):!!(Qt==="application/xhtml+xml"&&je[le.namespaceURI]):!1},pt=function(le){rj(e.removed,{element:le});try{y(le).removeChild(le)}catch{_(le)}},Vt=function(le,Qe){try{rj(e.removed,{attribute:Qe.getAttributeNode(le),from:Qe})}catch{rj(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(le),le==="is"&&!X[le])if(ft||tt)try{pt(Qe)}catch{}else try{Qe.setAttribute(le,"")}catch{}},Pn=function(le){let Qe=null,ht=null;if(vt)le="<remove></remove>"+le;else{const mn=r8e(le,/^[\r\n\t ]+/);ht=mn&&mn[0]}Qt==="application/xhtml+xml"&&ke===se&&(le='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+le+"</body></html>");const Bt=C?C.createHTML(le):le;if(ke===se)try{Qe=new f().parseFromString(Bt,Qt)}catch{}if(!Qe||!Qe.documentElement){Qe=k.createDocument(ke,"template",null);try{Qe.documentElement.innerHTML=Ae?S:Bt}catch{}}const An=Qe.body||Qe.documentElement;return le&&ht&&An.insertBefore(t.createTextNode(ht),An.childNodes[0]||null),ke===se?N.call(Qe,qe?"html":"body")[0]:qe?Qe.documentElement:An},Ln=function(le){return I.call(le.ownerDocument||le,le,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},bi=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")},et=function(le){return typeof a=="function"&&le instanceof a},Lt=function(le,Qe,ht){O[le]&&QV(O[le],Bt=>{Bt.call(e,Qe,ht,li)})},qt=function(le){let Qe=null;if(Lt("beforeSanitizeElements",le,null),bi(le))return pt(le),!0;const ht=Rn(le.nodeName);if(Lt("uponSanitizeElement",le,{tagName:ht,allowedTags:z}),le.hasChildNodes()&&!et(le.firstElementChild)&&Mf(/<[/\w]/g,le.innerHTML)&&Mf(/<[/\w]/g,le.textContent)||le.nodeType===lj.progressingInstruction||$e&&le.nodeType===lj.comment&&Mf(/<[/\w]/g,le.data))return pt(le),!0;if(!z[ht]||Se[ht]){if(!Se[ht]&&ln(ht)&&(fe.tagNameCheck instanceof RegExp&&Mf(fe.tagNameCheck,ht)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ht)))return!1;if(dt&&!Oe[ht]){const Bt=y(le)||le.parentNode,An=b(le)||le.childNodes;if(An&&Bt){const mn=An.length;for(let hi=mn-1;hi>=0;--hi){const Di=m(An[hi],!0);Di.__removalCount=(le.__removalCount||0)+1,Bt.insertBefore(Di,v(le))}}}return pt(le),!0}return le instanceof l&&!gt(le)||(ht==="noscript"||ht==="noembed"||ht==="noframes")&&Mf(/<\/no(script|embed|frames)/i,le.innerHTML)?(pt(le),!0):(Be&&le.nodeType===lj.text&&(Qe=le.textContent,QV([F,V,M],Bt=>{Qe=sj(Qe,Bt," ")}),le.textContent!==Qe&&(rj(e.removed,{element:le.cloneNode()}),le.textContent=Qe)),Lt("afterSanitizeElements",le,null),!1)},sn=function(le,Qe,ht){if(Ft&&(Qe==="id"||Qe==="name")&&(ht in t||ht in Mi))return!1;if(!(ge&&!Me[Qe]&&Mf(B,Qe))){if(!(Ie&&Mf(W,Qe))){if(!X[Qe]||Me[Qe]){if(!(ln(le)&&(fe.tagNameCheck instanceof RegExp&&Mf(fe.tagNameCheck,le)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(le))&&(fe.attributeNameCheck instanceof RegExp&&Mf(fe.attributeNameCheck,Qe)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(Qe))||Qe==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&Mf(fe.tagNameCheck,ht)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ht))))return!1}else if(!it[Qe]){if(!Mf(H,sj(ht,U,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&le!=="script"&&jar(ht,"data:")===0&&Ne[le])){if(!(ye&&!Mf(q,sj(ht,U,"")))){if(ht)return!1}}}}}}return!0},ln=function(le){return le!=="annotation-xml"&&r8e(le,G)},ti=function(le){Lt("beforeSanitizeAttributes",le,null);const{attributes:Qe}=le;if(!Qe)return;const ht={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X};let Bt=Qe.length;for(;Bt--;){const An=Qe[Bt],{name:mn,namespaceURI:hi,value:Di}=An,cr=Rn(mn);let Li=mn==="value"?Di:Far(Di);if(ht.attrName=cr,ht.attrValue=Li,ht.keepAttr=!0,ht.forceKeepAttr=void 0,Lt("uponSanitizeAttribute",le,ht),Li=ht.attrValue,ht.forceKeepAttr||(Vt(mn,le),!ht.keepAttr))continue;if(!Pe&&Mf(/\/>/i,Li)){Vt(mn,le);continue}Be&&QV([F,V,M],rr=>{Li=sj(Li,rr," ")});const Sr=Rn(le.nodeName);if(sn(Sr,cr,Li)){if(en&&(cr==="id"||cr==="name")&&(Vt(mn,le),Li=Ke+Li),$e&&Mf(/((--!?|])>)|<\/(style|title)/i,Li)){Vt(mn,le);continue}if(C&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!hi)switch(p.getAttributeType(Sr,cr)){case"TrustedHTML":{Li=C.createHTML(Li);break}case"TrustedScriptURL":{Li=C.createScriptURL(Li);break}}try{hi?le.setAttributeNS(hi,mn,Li):le.setAttribute(mn,Li),bi(le)?pt(le):i8e(e.removed)}catch{}}}Lt("afterSanitizeAttributes",le,null)},di=function Dt(le){let Qe=null;const ht=Ln(le);for(Lt("beforeSanitizeShadowDOM",le,null);Qe=ht.nextNode();)Lt("uponSanitizeShadowNode",Qe,null),!qt(Qe)&&(Qe.content instanceof s&&Dt(Qe.content),ti(Qe));Lt("afterSanitizeShadowDOM",le,null)};return e.sanitize=function(Dt){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,ht=null,Bt=null,An=null;if(Ae=!Dt,Ae&&(Dt="<!-->"),typeof Dt!="string"&&!et(Dt))if(typeof Dt.toString=="function"){if(Dt=Dt.toString(),typeof Dt!="string")throw oj("dirty is not a string, aborting")}else throw oj("toString is not a function");if(!e.isSupported)return Dt;if(mt||oi(le),e.removed=[],typeof Dt=="string"&&(nt=!1),nt){if(Dt.nodeName){const Di=Rn(Dt.nodeName);if(!z[Di]||Se[Di])throw oj("root node is forbidden and cannot be sanitized in-place")}}else if(Dt instanceof a)Qe=Pn("<!---->"),ht=Qe.ownerDocument.importNode(Dt,!0),ht.nodeType===lj.element&&ht.nodeName==="BODY"||ht.nodeName==="HTML"?Qe=ht:Qe.appendChild(ht);else{if(!ft&&!Be&&!qe&&Dt.indexOf("<")===-1)return C&&St?C.createHTML(Dt):Dt;if(Qe=Pn(Dt),!Qe)return ft?null:St?S:""}Qe&&vt&&pt(Qe.firstChild);const mn=Ln(nt?Dt:Qe);for(;Bt=mn.nextNode();)qt(Bt)||(Bt.content instanceof s&&di(Bt.content),ti(Bt));if(nt)return Dt;if(ft){if(tt)for(An=L.call(Qe.ownerDocument);Qe.firstChild;)An.appendChild(Qe.firstChild);else An=Qe;return(X.shadowroot||X.shadowrootmode)&&(An=P.call(i,An,!0)),An}let hi=qe?Qe.outerHTML:Qe.innerHTML;return qe&&z["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Mf($ot,Qe.ownerDocument.doctype.name)&&(hi="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`> `+hi),Be&&QV([F,V,M],Di=>{hi=sj(hi,Di," ")}),C&&St?C.createHTML(hi):hi},e.setConfig=function(){let Dt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};oi(Dt),mt=!0},e.clearConfig=function(){li=null,mt=!1},e.isValidAttribute=function(Dt,le,Qe){li||oi({});const ht=Rn(Dt),Bt=Rn(le);return sn(ht,Bt,Qe)},e.addHook=function(Dt,le){typeof le=="function"&&(O[Dt]=O[Dt]||[],rj(O[Dt],le))},e.removeHook=function(Dt){if(O[Dt])return i8e(O[Dt])},e.removeHooks=function(Dt){O[Dt]&&(O[Dt]=[])},e.removeAllHooks=function(){O={}},e}var v1=Hot();v1.version;v1.isSupported;const Vot=v1.sanitize;v1.setConfig;v1.clearConfig;v1.isValidAttribute;const Wot=v1.addHook,zot=v1.removeHook;v1.removeHooks;v1.removeAllHooks;var ir;(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.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",n.vscodeNotebookMetadata="vscode-notebook-metadata",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatCodeBlock="vscode-chat-code-block",n.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",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",n.commentsInput="comment",n.codeSetting="code-setting",n.outputChannel="output"})(ir||(ir={}));function Gee(n,e){return vi.isUri(n)?IR(n.scheme,e):pke(n,e+":")}function Nme(n,...e){return e.some(t=>Gee(n,t))}const Jar="tkn";class elr{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return Rl.join(this._serverRootPath,ir.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return tr(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],s=this._connectionTokens[t];let o=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(o+=`&${Jar}=${encodeURIComponent(s)}`),vi.from({scheme:FA?this._preferredWebSchema:ir.vscodeRemoteResource,authority:`${i}:${r}`,path:this._remoteResourcesPath,query:o})}}const Uot=new elr,tlr="vscode-app",O6=class O6{asBrowserUri(e){const t=this.toUri(e);return this.uriToBrowserUri(t)}uriToBrowserUri(e){return e.scheme===ir.vscodeRemote?Uot.rewrite(e):e.scheme===ir.file&&(qy||asr===`${ir.vscodeFileResource}://${O6.FALLBACK_AUTHORITY}`)?e.with({scheme:ir.vscodeFileResource,authority:e.authority||O6.FALLBACK_AUTHORITY,query:null,fragment:null}):e}toUri(e,t){if(vi.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){const i=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(i))return vi.joinPath(vi.parse(i,!0),e);const r=Dor(i,e);return vi.file(r)}return vi.parse(t.toUrl(e))}};O6.FALLBACK_AUTHORITY=tlr;let Dme=O6;const Yee=new Dme;var Rme;(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(s){let o;typeof s=="string"?o=new URL(s).searchParams:s instanceof URL?o=s.searchParams:vi.isUri(s)&&(o=new URL(s.toString(!0)).searchParams);const a=o==null?void 0:o.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function r(s,o,a){if(!globalThis.crossOriginIsolated)return;const l=o&&a?"3":a?"2":"1";s instanceof URLSearchParams?s.set(t,l):s[t]=l}n.addSearchParam=r})(Rme||(Rme={}));function Qee(n){return Xee(n,0)}function Xee(n,e){switch(typeof n){case"object":return n===null?WC(349,e):Array.isArray(n)?ilr(n,e):rlr(n,e);case"string":return xke(n,e);case"boolean":return nlr(n,e);case"number":return WC(n,e);case"undefined":return WC(937,e);default:return WC(617,e)}}function WC(n,e){return(e<<5)-e+n|0}function nlr(n,e){return WC(n?433:863,e)}function xke(n,e){e=WC(149417,e);for(let t=0,i=n.length;t<i;t++)e=WC(n.charCodeAt(t),e);return e}function ilr(n,e){return e=WC(104579,e),n.reduce((t,i)=>Xee(i,t),e)}function rlr(n,e){return e=WC(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=xke(i,t),Xee(n[i],t)),e)}function mce(n,e,t=32){const i=t-e,r=~((1<<i)-1);return(n<<e|(r&n)>>>i)>>>0}function u8e(n,e=0,t=n.byteLength,i=0){for(let r=0;r<t;r++)n[e+r]=i}function slr(n,e,t="0"){for(;n.length<e;)n=t+n;return n}function cj(n,e=32){return n instanceof ArrayBuffer?Array.from(new Uint8Array(n)).map(t=>t.toString(16).padStart(2,"0")).join(""):slr((n>>>0).toString(16),e/4)}const LQ=class LQ{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let r=this._buffLen,s=this._leftoverHighSurrogate,o,a;for(s!==0?(o=s,a=-1,s=0):(o=e.charCodeAt(0),a=0);;){let l=o;if(Ec(o))if(a+1<t){const c=e.charCodeAt(a+1);FL(c)?(a++,l=gke(o,c)):l=65533}else{s=o;break}else FL(o)&&(l=65533);if(r=this._push(i,r,l),a++,a<t)o=e.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=s}_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],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),cj(this._h0)+cj(this._h1)+cj(this._h2)+cj(this._h3)+cj(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,u8e(this._buff,this._buffLen),this._buffLen>56&&(this._step(),u8e(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=LQ._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,mce(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,s=this._h2,o=this._h3,a=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=r&s|~r&o,c=1518500249):d<40?(l=r^s^o,c=1859775393):d<60?(l=r&s|r&o|s&o,c=2400959708):(l=r^s^o,c=3395469782),u=mce(i,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=o,o=s,s=mce(r,30),r=i,i=u;this._h0=this._h0+i&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};LQ._bigBlock32=new DataView(new ArrayBuffer(320));let Pme=LQ;const{getWindow:Ti,getWindows:qot,getWindowsCount:olr,getWindowId:VK,getWindowById:d8e,onDidRegisterWindow:Zee,onWillUnregisterWindow:alr,onDidUnregisterWindow:llr}=function(){const n=new Map;Zor(bo,1);const e={window:bo,disposables:new Et};n.set(bo.vscodeWindowId,e);const t=new Ue,i=new Ue,r=new Ue;function s(o,a){return(typeof o=="number"?n.get(o):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:i.event,registerWindow(o){if(n.has(o.vscodeWindowId))return Ye.None;const a=new Et,l={window:o,disposables:a.add(new Et)};return n.set(o.vscodeWindowId,l),a.add(gi(()=>{n.delete(o.vscodeWindowId),i.fire(o)})),a.add(_t(o,Xt.BEFORE_UNLOAD,()=>{r.fire(o)})),t.fire(l),a},getWindows(){return n.values()},getWindowsCount(){return n.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return n.has(o)},getWindowById:s,getWindow(o){var c;const a=o;if((c=a==null?void 0:a.ownerDocument)!=null&&c.defaultView)return a.ownerDocument.defaultView.window;const l=o;return l!=null&&l.view?l.view.window:bo},getDocument(o){return Ti(o).document}}}();function mu(n){for(;n.firstChild;)n.firstChild.remove()}class clr{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 _t(n,e,t,i){return new clr(n,e,t,i)}function Kot(n,e){return function(t){return e(new B_(n,t))}}function ulr(n){return function(e){return n(new Io(e))}}const Da=function(e,t,i,r){let s=i;return t==="click"||t==="mousedown"||t==="contextmenu"?s=Kot(Ti(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(s=ulr(i)),_t(e,t,s,r)},dlr=function(e,t,i){const r=Kot(Ti(e),t);return hlr(e,r,i)};function hlr(n,e,t){return _t(n,Fb&&yke.pointerEvents?Xt.POINTER_DOWN:Xt.MOUSE_DOWN,e,t)}function Kj(n,e,t){return XF(n,e,t)}class _ce extends Mot{constructor(e,t){super(e,t)}}let WK,lp;class Ske extends wke{constructor(e){super(),this.defaultTarget=e&&Ti(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class vce{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){tr(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const n=new Map,e=new Map,t=new Map,i=new Map,r=s=>{t.set(s,!1);const o=n.get(s)??[];for(e.set(s,o),n.set(s,[]),i.set(s,!0);o.length>0;)o.sort(vce.sort),o.shift().execute();i.set(s,!1)};lp=(s,o,a=0)=>{const l=VK(s),c=new vce(o,a);let u=n.get(l);return u||(u=[],n.set(l,u)),u.push(c),t.get(l)||(t.set(l,!0),s.requestAnimationFrame(()=>r(l))),c},WK=(s,o,a)=>{const l=VK(s);if(i.get(l)){const c=new vce(o,a);let u=e.get(l);return u||(u=[],e.set(l,u)),u.push(c),c}else return lp(s,o,a)}})();function Jee(n){return Ti(n).getComputedStyle(n,null)}function ZE(n,e){const t=Ti(n),i=t.document;if(n!==i.body)return new Ys(n.clientWidth,n.clientHeight);if(Fb&&(t!=null&&t.visualViewport))return new Ys(t.visualViewport.width,t.visualViewport.height);if(t!=null&&t.innerWidth&&t.innerHeight)return new Ys(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Ys(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Ys(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class ml{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const r=Jee(e),s=r?r.getPropertyValue(t):"0";return ml.convertToPixels(e,s)}static getBorderLeftWidth(e){return ml.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return ml.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return ml.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return ml.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return ml.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return ml.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return ml.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return ml.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return ml.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return ml.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return ml.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return ml.getDimension(e,"margin-bottom","marginBottom")}}const N2=class N2{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new N2(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof N2?e:new N2(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};N2.None=new N2(0,0);let Ys=N2;function Got(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=Qot(n)?null:Jee(n);r&&(i-=r.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=ml.getBorderLeftWidth(n),t+=ml.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function flr(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function al(n){const e=n.getBoundingClientRect(),t=Ti(n);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function Yot(n){let e=n,t=1;do{const i=Jee(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Vf(n){const e=ml.getMarginLeft(n)+ml.getMarginRight(n);return n.offsetWidth+e}function bce(n){const e=ml.getBorderLeftWidth(n)+ml.getBorderRightWidth(n),t=ml.getPaddingLeft(n)+ml.getPaddingRight(n);return n.offsetWidth-e-t}function plr(n){const e=ml.getBorderTopWidth(n)+ml.getBorderBottomWidth(n),t=ml.getPaddingTop(n)+ml.getPaddingBottom(n);return n.offsetHeight-e-t}function zC(n){const e=ml.getMarginTop(n)+ml.getMarginBottom(n);return n.offsetHeight+e}function kc(n,e){return!!(e!=null&&e.contains(n))}function glr(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 yce(n,e,t){return!!glr(n,e,t)}function Qot(n){return n&&!!n.host&&!!n.mode}function zK(n){return!!$L(n)}function $L(n){var e;for(;n.parentNode;){if(n===((e=n.ownerDocument)==null?void 0:e.body))return null;n=n.parentNode}return Qot(n)?n:null}function Hu(){let n=H4().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function ete(n){return Hu()===n}function Xot(n){return kc(Hu(),n)}function H4(){return olr()<=1?bo.document:Array.from(qot()).map(({window:e})=>e.document).find(e=>e.hasFocus())??bo.document}function Gj(){var e;return((e=H4().defaultView)==null?void 0:e.window)??bo}const Eke=new Map;function Zot(){return new mlr}class mlr{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=_g(bo.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function _g(n=bo.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e==null||e(i),n.appendChild(i),t&&t.add(gi(()=>i.remove())),n===bo.document.head){const r=new Set;Eke.set(i,r);for(const{window:s,disposables:o}of qot()){if(s===bo)continue;const a=o.add(_lr(i,r,s));t==null||t.add(a)}}return i}function _lr(n,e,t){var s,o;const i=new Et,r=n.cloneNode(!0);t.document.head.appendChild(r),i.add(gi(()=>r.remove()));for(const a of eat(n))(o=r.sheet)==null||o.insertRule(a.cssText,(s=r.sheet)==null?void 0:s.cssRules.length);return i.add(vlr.observe(n,i,{childList:!0})(()=>{r.textContent=n.textContent})),e.add(r),i.add(gi(()=>e.delete(r))),i}const vlr=new class{constructor(){this.mutationObservers=new Map}observe(n,e,t){let i=this.mutationObservers.get(n);i||(i=new Map,this.mutationObservers.set(n,i));const r=Qee(t);let s=i.get(r);if(s)s.users+=1;else{const o=new Ue,a=new MutationObserver(c=>o.fire(c));a.observe(n,t);const l=s={users:1,observer:a,onDidMutate:o.event};e.add(gi(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),i==null||i.delete(r),(i==null?void 0:i.size)===0&&this.mutationObservers.delete(n))})),i.set(r,s)}return s.onDidMutate}};let Cce=null;function Jot(){return Cce||(Cce=_g()),Cce}function eat(n){var e,t;return(e=n==null?void 0:n.sheet)!=null&&e.rules?n.sheet.rules:(t=n==null?void 0:n.sheet)!=null&&t.cssRules?n.sheet.cssRules:[]}function UK(n,e,t=Jot()){var i;if(!(!t||!e)){(i=t.sheet)==null||i.insertRule(`${n} {${e}}`,0);for(const r of Eke.get(t)??[])UK(n,e,r)}}function Ome(n,e=Jot()){var r;if(!e)return;const t=eat(e),i=[];for(let s=0;s<t.length;s++){const o=t[s];blr(o)&&o.selectorText.indexOf(n)!==-1&&i.push(s)}for(let s=i.length-1;s>=0;s--)(r=e.sheet)==null||r.deleteRule(i[s]);for(const s of Eke.get(e)??[])Ome(n,s)}function blr(n){return typeof n.selectorText=="string"}function Lc(n){return n instanceof HTMLElement||n instanceof Ti(n).HTMLElement}function h8e(n){return n instanceof HTMLAnchorElement||n instanceof Ti(n).HTMLAnchorElement}function ylr(n){return n instanceof SVGElement||n instanceof Ti(n).SVGElement}function kke(n){return n instanceof MouseEvent||n instanceof Ti(n).MouseEvent}function IC(n){return n instanceof KeyboardEvent||n instanceof Ti(n).KeyboardEvent}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",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend"};function Clr(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const Jr={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function wlr(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function xlr(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 qK extends Ye{static hasFocusWithin(e){if(Lc(e)){const t=$L(e),i=t?t.activeElement:e.ownerDocument.activeElement;return kc(i,e)}else{const t=e;return kc(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new Ue),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Ue),this.onDidBlur=this._onDidBlur.event;let t=qK.hasFocusWithin(e),i=!1;const r=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},s=()=>{t&&(i=!0,(Lc(e)?Ti(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{qK.hasFocusWithin(e)!==t&&(t?s():r())},this._register(_t(e,Xt.FOCUS,r,!0)),this._register(_t(e,Xt.BLUR,s,!0)),Lc(e)&&(this._register(_t(e,Xt.FOCUS_IN,()=>this._refreshStateHandler())),this._register(_t(e,Xt.FOCUS_OUT,()=>this._refreshStateHandler())))}}function $b(n){return new qK(n)}function Slr(n,e){return n.after(e),e}function Ot(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Tke(n,e){return n.insertBefore(e,n.firstChild),e}function _u(n,...e){n.innerText="",Ot(n,...e)}const Elr=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var l7;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(l7||(l7={}));function tat(n,e,t,...i){const r=Elr.exec(e);if(!r)throw new Error("Bad use of emmet");const s=r[1]||"div";let o;return n!==l7.HTML?o=document.createElementNS(n,s):o=document.createElement(s),r[3]&&(o.id=r[3]),r[4]&&(o.className=r[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...i),o}function Jt(n,e,...t){return tat(l7.HTML,n,e,...t)}Jt.SVG=function(n,e,...t){return tat(l7.SVG,n,e,...t)};function klr(n,...e){n?qf(...e):ph(...e)}function qf(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function ph(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function f8e(n,e){const t=n.devicePixelRatio*e;return Math.max(1,Math.floor(t))/n.devicePixelRatio}function nat(n){bo.open(n,"_blank","noopener")}function Tlr(n,e){const t=()=>{e(),i=lp(n,t)};let i=lp(n,t);return gi(()=>i.dispose())}Uot.setPreferredWebSchema(/^https:/.test(bo.location.href)?"https":"http");function Dw(n){return n?`url('${Yee.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function wce(n){return`'${n.replace(/'/g,"%27")}'`}function uw(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=uw(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function Ilr(n,e=!1){const t=document.createElement("a");return Wot("afterSanitizeAttributes",i=>{for(const r of["href","src"])if(i.hasAttribute(r)){const s=i.getAttribute(r);if(r==="href"&&s.startsWith("#"))continue;if(t.href=s,!n.includes(t.protocol.replace(/:$/,""))){if(e&&r==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(r)}}}),gi(()=>{zot("afterSanitizeAttributes")})}const Llr=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","input","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 UC extends Ue{constructor(){super(),this._subscriptions=new Et,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(rn.runAndSubscribe(Zee,({window:e,disposables:t})=>this.registerListeners(e,t),{window:bo,disposables:this._subscriptions}))}registerListeners(e,t){t.add(_t(e,"keydown",i=>{if(i.defaultPrevented)return;const r=new Io(i);if(!(r.keyCode===6&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(r.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add(_t(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.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=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add(_t(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(_t(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(_t(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(_t(e,"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 UC.instance||(UC.instance=new UC),UC.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Alr extends Ye{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(_t(this.element,Xt.DRAG_START,e=>{var t,i;(i=(t=this.callbacks).onDragStart)==null||i.call(t,e)})),this.callbacks.onDrag&&this._register(_t(this.element,Xt.DRAG,e=>{var t,i;(i=(t=this.callbacks).onDrag)==null||i.call(t,e)})),this._register(_t(this.element,Xt.DRAG_ENTER,e=>{var t,i;this.counter++,this.dragStartTime=e.timeStamp,(i=(t=this.callbacks).onDragEnter)==null||i.call(t,e)})),this._register(_t(this.element,Xt.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)==null||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(_t(this.element,Xt.DRAG_LEAVE,e=>{var t,i;this.counter--,this.counter===0&&(this.dragStartTime=0,(i=(t=this.callbacks).onDragLeave)==null||i.call(t,e))})),this._register(_t(this.element,Xt.DRAG_END,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDragEnd)==null||i.call(t,e)})),this._register(_t(this.element,Xt.DROP,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDrop)==null||i.call(t,e)}))}}const iat=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function jr(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const r=iat.exec(n);if(!r||!r.groups)throw new Error("Bad use of h");const s=r.groups.tag||"div",o=document.createElement(s);r.groups.id&&(o.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&&(o.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=o),i)for(const c of i)Lc(c)?o.appendChild(c):typeof c=="string"?o.append(c):"root"in c&&(Object.assign(l,c),o.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,f]of Object.entries(u))o.style.setProperty(KK(d),typeof f=="number"?f+"px":""+f);else c==="tabIndex"?o.tabIndex=u:o.setAttribute(KK(c),u.toString());return l.root=o,l}function LD(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const r=iat.exec(n);if(!r||!r.groups)throw new Error("Bad use of h");const s=r.groups.tag||"div",o=document.createElementNS("http://www.w3.org/2000/svg",s);r.groups.id&&(o.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&&(o.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=o),i)for(const c of i)Lc(c)?o.appendChild(c):typeof c=="string"?o.append(c):"root"in c&&(Object.assign(l,c),o.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,f]of Object.entries(u))o.style.setProperty(KK(d),typeof f=="number"?f+"px":""+f);else c==="tabIndex"?o.tabIndex=u:o.setAttribute(KK(c),u.toString());return l.root=o,l}function KK(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Nlr extends Ye{constructor(e){super(),this._onDidChange=this._register(new Ue),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var i;(i=this._mediaQueryList)==null||i.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class Dlr extends Ye{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new Ue),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new Nlr(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/r}}class Rlr{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=VK(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=new Dlr(e),this.mapWindowIdToPixelRatioMonitor.set(t,i),rn.once(llr)(({vscodeWindowId:r})=>{r===t&&(i==null||i.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const c7=new Rlr;class rat{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=Fv(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Fv(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Fv(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Fv(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Fv(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Fv(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Fv(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Fv(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=Fv(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=Fv(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Fv(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 Fv(n){return typeof n=="number"?`${n}px`:n}function Hs(n){return new rat(n)}function vu(n,e){n instanceof rat?(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 Plr{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class Ike{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){var t;this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),(t=this._container)==null||t.remove(),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");vu(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");vu(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const r=document.createElement("div");vu(r,this._bareFontInfo),r.style.fontStyle="italic",e.appendChild(r);const s=[];for(const o of this._requests){let a;o.type===0&&(a=t),o.type===2&&(a=i),o.type===1&&(a=r),a.appendChild(document.createElement("br"));const l=document.createElement("span");Ike._render(l,o),a.appendChild(l),s.push(l)}this._container=e,this._testElements=s}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 Olr(n,e,t){new Ike(e,t).read(n)}const lm=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new Ue,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))}},Mlr=zr?1.5:1.35,xce=8;class cI{static createFromValidatedSettings(e,t,i){const r=e.get(49),s=e.get(53),o=e.get(52),a=e.get(51),l=e.get(54),c=e.get(67),u=e.get(64);return cI._create(r,s,o,a,l,c,u,t,i)}static _create(e,t,i,r,s,o,a,l,c){o===0?o=Mlr*i:o<xce&&(o=o*i),o=Math.round(o),o<xce&&(o=xce);const u=1+(c?0:lm.getZoomLevel()*.1);return i*=u,o*=u,s===t7.TRANSLATE&&(t==="normal"||t==="bold"?s=t7.OFF:(s=`'wght' ${parseInt(t,10)}`,t="normal")),new cI({pixelRatio:l,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:r,fontVariationSettings:s,lineHeight:o,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=Th.fontFamily,t=cI._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const jlr=2;class Mme extends cI{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=jlr,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 Flr extends Ye{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new Ue),this.onDidChange=this._onDidChange.event}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){const t=VK(e);let i=this._cache.get(t);return i||(i=new Blr,this._cache.set(t,i)),i}_writeToCache(e,t,i){this._ensureCache(e).put(t,i),!i.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=e.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let r=!1;for(const s of i)s.isTrusted||(r=!0,t.remove(s));r&&this._onDidChange.fire()}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let r=this._actualReadFontInfo(e,t);(r.typicalHalfwidthCharacterWidth<=2||r.typicalFullwidthCharacterWidth<=2||r.spaceWidth<=2||r.maxDigitWidth<=2)&&(r=new Mme({pixelRatio:c7.getInstance(e).value,fontFamily:r.fontFamily,fontWeight:r.fontWeight,fontSize:r.fontSize,fontFeatureSettings:r.fontFeatureSettings,fontVariationSettings:r.fontVariationSettings,lineHeight:r.lineHeight,letterSpacing:r.letterSpacing,isMonospace:r.isMonospace,typicalHalfwidthCharacterWidth:Math.max(r.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(r.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:r.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(r.spaceWidth,5),middotWidth:Math.max(r.middotWidth,5),wsmiddotWidth:Math.max(r.wsmiddotWidth,5),maxDigitWidth:Math.max(r.maxDigitWidth,5)},!1)),this._writeToCache(e,t,r)}return i.get(t)}_createRequest(e,t,i,r){const s=new Plr(e,t);return i.push(s),r==null||r.push(s),s}_actualReadFontInfo(e,t){const i=[],r=[],s=this._createRequest("n",0,i,r),o=this._createRequest("m",0,i,null),a=this._createRequest(" ",0,i,r),l=this._createRequest("0",0,i,r),c=this._createRequest("1",0,i,r),u=this._createRequest("2",0,i,r),d=this._createRequest("3",0,i,r),f=this._createRequest("4",0,i,r),p=this._createRequest("5",0,i,r),g=this._createRequest("6",0,i,r),m=this._createRequest("7",0,i,r),_=this._createRequest("8",0,i,r),v=this._createRequest("9",0,i,r),b=this._createRequest("→",0,i,r),y=this._createRequest("→",0,i,null),C=this._createRequest("·",0,i,r),S=this._createRequest("⸱",0,i,null),k="|/-_ilm%";for(let O=0,F=k.length;O<F;O++)this._createRequest(k.charAt(O),0,i,r),this._createRequest(k.charAt(O),1,i,r),this._createRequest(k.charAt(O),2,i,r);Olr(e,t,i);const I=Math.max(l.width,c.width,u.width,d.width,f.width,p.width,g.width,m.width,_.width,v.width);let L=t.fontFeatureSettings===UE.OFF;const N=r[0].width;for(let O=1,F=r.length;L&&O<F;O++){const V=N-r[O].width;if(V<-.001||V>.001){L=!1;break}}let P=!0;return L&&y.width!==N&&(P=!1),y.width>b.width&&(P=!1),new Mme({pixelRatio:c7.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:L,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:P,spaceWidth:a.width,middotWidth:C.width,wsmiddotWidth:S.width,maxDigitWidth:I},!0)}}class Blr{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 jme=new Flr;var vb;(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})(vb||(vb={}));const mi=Ur("instantiationService");function $lr(n,e,t){e[vb.DI_TARGET]===e?e[vb.DI_DEPENDENCIES].push({id:n,index:t}):(e[vb.DI_DEPENDENCIES]=[{id:n,index:t}],e[vb.DI_TARGET]=e)}function Ur(n){if(vb.serviceIds.has(n))return vb.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");$lr(e,t,r)};return e.toString=()=>n,vb.serviceIds.set(n,e),e}const Cs=Ur("codeEditorService"),Xo=Ur("modelService"),Cf=Ur("textModelService");class Zf extends Ye{constructor(e,t="",i="",r=!0,s){super(),this._onDidChange=this._register(new Ue),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=r,this._actionCallback=s}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}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class HL extends Ye{constructor(){super(...arguments),this._onWillRun=this._register(new Ue),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new Ue),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{await this.runAction(e,t)}catch(r){i=r}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}const M6=class M6{constructor(){this.id=M6.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 M6,...i]:t=i);return t}async run(){}};M6.ID="vs.actions.separator";let Ac=M6;class oM{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}async run(){}}const AQ=class AQ extends Zf{constructor(){super(AQ.ID,A("submenu.empty","(empty)"),void 0,!1)}};AQ.ID="vs.actions.empty";let Fme=AQ;function uI(n){return{id:n.id,label:n.label,tooltip:n.tooltip??n.label,class:n.class,enabled:n.enabled??!0,checked:n.checked,run:async(...e)=>n.run(...e)}}var Bme;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(Bme||(Bme={}));var Ni;(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(f){const p=e.exec(f.id);if(!p)return t(Yt.error);const[,g,m]=p,_=["codicon","codicon-"+g];return m&&_.push("codicon-modifier-"+m.substring(1)),_}n.asClassNameArray=t;function i(f){return t(f).join(" ")}n.asClassName=i;function r(f){return"."+t(f).join(".")}n.asCSSSelector=r;function s(f){return f&&typeof f=="object"&&typeof f.id=="string"&&(typeof f.color>"u"||Bme.isThemeColor(f.color))}n.isThemeIcon=s;const o=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(f){const p=o.exec(f);if(!p)return;const[,g]=p;return{id:g}}n.fromString=a;function l(f){return{id:f}}n.fromId=l;function c(f,p){let g=f.id;const m=g.lastIndexOf("~");return m!==-1&&(g=g.substring(0,m)),p&&(g=`${g}~${p}`),{id:g}}n.modify=c;function u(f){const p=f.id.lastIndexOf("~");if(p!==-1)return f.id.substring(p+1)}n.getModifier=u;function d(f,p){var g,m;return f.id===p.id&&((g=f.color)==null?void 0:g.id)===((m=p.color)==null?void 0:m.id)}n.isEqual=d})(Ni||(Ni={}));const Fo=Ur("commandService"),os=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Ue,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.metadata&&Array.isArray(n.metadata.args)){const o=[];for(const l of n.metadata.args)o.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return Xrr(c,o),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new Ch,this._commands.set(t,i));const r=i.unshift(n),s=gi(()=>{r();const o=this._commands.get(t);o!=null&&o.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),s}registerCommandAlias(n,e){return os.registerCommand(n,(t,...i)=>t.get(Fo).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return ss.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}};os.registerCommand("noop",()=>{});function Sce(...n){switch(n.length){case 1:return A("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return A("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return A("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}const Hlr=A("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Vlr=A("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");var JC;let uj=(JC=class{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 ake(`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(Sce("==","=~"));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(Sce("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(Sce("||"));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=JC._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(Hlr);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(Vlr);return}const s=this._input.charCodeAt(e);if(t)t=!1;else if(s===47&&!i){e++;break}else s===91?i=!0:s===92?t=!0:s===93&&(i=!1);e++}for(;e<this._input.length&&JC._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}},JC._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0))),JC._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]),JC);const ud=new Map;ud.set("false",!1);ud.set("true",!0);ud.set("isMac",zr);ud.set("isLinux",Nh);ud.set("isWindows",Wu);ud.set("isWeb",FA);ud.set("isMacNative",zr&&!FA);ud.set("isEdge",hsr);ud.set("isFirefox",usr);ud.set("isChrome",not);ud.set("isSafari",dsr);const Wlr=Object.prototype.hasOwnProperty,zlr={regexParsingWithErrorRecovery:!0},Ulr=A("contextkey.parser.error.emptyString","Empty context key expression"),qlr=A("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."),Klr=A("contextkey.parser.error.noInAfterNot","'in' after 'not'."),p8e=A("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),Glr=A("contextkey.parser.error.unexpectedToken","Unexpected token"),Ylr=A("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),Qlr=A("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),Xlr=A("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");var by;let Zlr=(by=class{constructor(e=zlr){this._config=e,this._scanner=new uj,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:Ulr,offset:0,lexeme:"",additionalInfo:qlr});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?Ylr:void 0;throw this._parsingErrors.push({message:Glr,offset:i.offset,lexeme:uj.getLexeme(i),additionalInfo:r}),by._parseError}return t}catch(t){if(t!==by._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]:It.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:It.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Dh.INSTANCE;case 12:return this._advance(),df.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,p8e),t==null?void 0:t.negate()}case 17:return this._advance(),$A.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(),It.true();case 12:return this._advance(),It.false();case 0:{this._advance();const t=this._expr();return this._consume(1,p8e),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 s=r.lexeme,o=s.lastIndexOf("/"),a=o===s.length-1?void 0:this._removeFlagsGY(s.substring(o+1));let l;try{l=new RegExp(s.substring(1,o),a)}catch{throw this._errExpectedButGot("REGEX",r)}return u7.create(t,l)}switch(r.type){case 10:case 19:{const s=[r.lexeme];this._advance();let o=this._peek(),a=0;for(let f=0;f<r.lexeme.length;f++)r.lexeme.charCodeAt(f)===40?a++:r.lexeme.charCodeAt(f)===41&&a--;for(;!this._isAtEnd()&&o.type!==15&&o.type!==16;){switch(o.type){case 0:a++;break;case 1:a--;break;case 10:case 18:for(let f=0;f<o.lexeme.length;f++)o.lexeme.charCodeAt(f)===40?a++:r.lexeme.charCodeAt(f)===41&&a--}if(a<0)break;s.push(uj.getLexeme(o)),this._advance(),o=this._peek()}const l=s.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 It.regex(t,d)}case 18:{const s=r.lexeme;this._advance();let o=null;if(!xot(s)){const a=s.indexOf("/"),l=s.lastIndexOf("/");if(a!==l&&a>=0){const c=s.slice(a+1,l),u=s[l+1]==="i"?"i":"";try{o=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",r)}}}if(o===null)throw this._errExpectedButGot("REGEX",r);return u7.create(t,o)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Klr);const r=this._value();return It.notIn(t,r)}switch(this._peek().type){case 3:{this._advance();const r=this._value();if(this._previous().type===18)return It.equals(t,r);switch(r){case"true":return It.has(t);case"false":return It.not(t);default:return It.equals(t,r)}}case 4:{this._advance();const r=this._value();if(this._previous().type===18)return It.notEquals(t,r);switch(r){case"true":return It.not(t);case"false":return It.has(t);default:return It.notEquals(t,r)}}case 5:return this._advance(),ate.create(t,this._value());case 6:return this._advance(),lte.create(t,this._value());case 7:return this._advance(),ste.create(t,this._value());case 8:return this._advance(),ote.create(t,this._value());case 13:return this._advance(),It.in(t,this._value());default:return It.has(t)}}case 20:throw this._parsingErrors.push({message:Qlr,offset:e.offset,lexeme:"",additionalInfo:Xlr}),by._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=A("contextkey.parser.error.expectedButGot",`Expected: {0} Received: '{1}'.`,e,uj.getLexeme(t)),s=t.offset,o=uj.getLexeme(t);return this._parsingErrors.push({message:r,offset:s,lexeme:o,additionalInfo:i}),by._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},by._parseError=new Error,by);const BIe=class BIe{static false(){return Dh.INSTANCE}static true(){return df.INSTANCE}static has(e){return BA.create(e)}static equals(e,t){return V4.create(e,t)}static notEquals(e,t){return ite.create(e,t)}static regex(e,t){return u7.create(e,t)}static in(e,t){return tte.create(e,t)}static notIn(e,t){return nte.create(e,t)}static not(e){return $A.create(e)}static and(...e){return U2.create(e,null,!0)}static or(...e){return RC.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}};BIe._parser=new Zlr({regexParsingWithErrorRecovery:!1});let It=BIe;function Jlr(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 ZF(n,e){return n.cmp(e)}const NQ=class NQ{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 df.INSTANCE}};NQ.INSTANCE=new NQ;let Dh=NQ;const DQ=class DQ{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 Dh.INSTANCE}};DQ.INSTANCE=new DQ;let df=DQ;class BA{static create(e,t=null){const i=ud.get(e);return typeof i=="boolean"?i?df.INSTANCE:Dh.INSTANCE:new BA(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:oat(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=ud.get(this.key);return typeof e=="boolean"?e?df.INSTANCE:Dh.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=$A.create(this.key,this)),this.negated}}class V4{static create(e,t,i=null){if(typeof t=="boolean")return t?BA.create(e,i):$A.create(e,i);const r=ud.get(e);return typeof r=="boolean"?t===(r?"true":"false")?df.INSTANCE:Dh.INSTANCE:new V4(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:HA(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=ud.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?df.INSTANCE:Dh.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=ite.create(this.key,this.value,this)),this.negated}}class tte{static create(e,t){return new tte(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:HA(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?Wlr.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=nte.create(this.key,this.valueKey)),this.negated}}class nte{static create(e,t){return new nte(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=tte.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 ite{static create(e,t,i=null){if(typeof t=="boolean")return t?$A.create(e,i):BA.create(e,i);const r=ud.get(e);return typeof r=="boolean"?t===(r?"true":"false")?Dh.INSTANCE:df.INSTANCE:new ite(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:HA(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=ud.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Dh.INSTANCE:df.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=V4.create(this.key,this.value,this)),this.negated}}class $A{static create(e,t=null){const i=ud.get(e);return typeof i=="boolean"?i?Dh.INSTANCE:df.INSTANCE:new $A(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:oat(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=ud.get(this.key);return typeof e=="boolean"?e?Dh.INSTANCE:df.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=BA.create(this.key,this)),this.negated}}function rte(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):Dh.INSTANCE}class ste{static create(e,t,i=null){return rte(t,r=>new ste(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:HA(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=lte.create(this.key,this.value,this)),this.negated}}class ote{static create(e,t,i=null){return rte(t,r=>new ote(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:HA(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=ate.create(this.key,this.value,this)),this.negated}}class ate{static create(e,t,i=null){return rte(t,r=>new ate(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:HA(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=ote.create(this.key,this.value,this)),this.negated}}class lte{static create(e,t,i=null){return rte(t,r=>new lte(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:HA(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=ste.create(this.key,this.value,this)),this.negated}}class u7{static create(e,t){return new u7(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=Lke.create(this)),this.negated}}class Lke{static create(e){return new Lke(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 sat(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 s=0;s<t;s++)e[s]=n[s]}e!==null&&(e[t]=r)}return e===null?n:e}class U2{static create(e,t,i){return U2._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=ZF(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=sat(this.expr);return e===this.expr?this:U2.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 s=!1;for(const o of e)if(o){if(o.type===1){s=!0;continue}if(o.type===0)return Dh.INSTANCE;if(o.type===6){r.push(...o.expr);continue}r.push(o)}if(r.length===0&&s)return df.INSTANCE;if(r.length!==0){if(r.length===1)return r[0];r.sort(ZF);for(let o=1;o<r.length;o++)r[o-1].equals(r[o])&&(r.splice(o,1),o--);if(r.length===1)return r[0];for(;r.length>1;){const o=r[r.length-1];if(o.type!==9)break;r.pop();const a=r.pop(),l=r.length===0,c=RC.create(o.expr.map(u=>U2.create([u,a],null,i)),null,l);c&&(r.push(c),r.sort(ZF))}if(r.length===1)return r[0];if(i){for(let o=0;o<r.length;o++)for(let a=o+1;a<r.length;a++)if(r[o].negate().equals(r[a]))return Dh.INSTANCE;if(r.length===1)return r[0]}return new U2(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=RC.create(e,this,!0)}return this.negated}}class RC{static create(e,t,i){return RC._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=ZF(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=sat(this.expr);return e===this.expr?this:RC.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=[],s=!1;if(e){for(let o=0,a=e.length;o<a;o++){const l=e[o];if(l){if(l.type===0){s=!0;continue}if(l.type===1)return df.INSTANCE;if(l.type===9){r=r.concat(l.expr);continue}r.push(l)}}if(r.length===0&&s)return Dh.INSTANCE;r.sort(ZF)}if(r.length!==0){if(r.length===1)return r[0];for(let o=1;o<r.length;o++)r[o-1].equals(r[o])&&(r.splice(o,1),o--);if(r.length===1)return r[0];if(i){for(let o=0;o<r.length;o++)for(let a=o+1;a<r.length;a++)if(r[o].negate().equals(r[a]))return df.INSTANCE;if(r.length===1)return r[0]}return new RC(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 s of m8e(t))for(const o of m8e(i))r.push(U2.create([s,o],null,!1));e.unshift(RC.create(r,null,!1))}this.negated=RC.create(e,this,!0)}return this.negated}}const eP=class eP extends BA{static all(){return eP._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?eP._info.push({...i,key:e}):i!==!0&&eP._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 V4.create(this.key,e)}};eP._info=[];let yn=eP;const Oi=Ur("contextKeyService");function oat(n,e){return n<e?-1:n>e?1:0}function HA(n,e,t,i){return n<t?-1:n>t?1:e<i?-1:e>i?1:0}function $me(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?g8e(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if($me(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return g8e(e.expr,n.expr);for(const t of n.expr)if($me(t,e))return!0;return!1}return n.equals(e)}function g8e(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 m8e(n){return n.type===9?n.expr:[n]}function Ece(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function cte(n,e="Unreachable"){throw new Error(e)}function _8e(n){n||tr(new Ps("Soft Assertion Failed"))}function VL(n){if(!n()){debugger;n(),tr(new Ps("Assertion Failed"))}}function Ake(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 ecr{constructor(){this.data=new Map}add(e,t){Ece(cf(e)),Ece(zc(t)),Ece(!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 Ca=new ecr;class Nke{constructor(){this._coreKeybindings=new Ch,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(Yf===1){if(e&&e.win)return e.win}else if(Yf===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=Nke.bindToCurrentPlatform(e),i=new Et;if(t&&t.primary){const r=kme(t.primary,Yf);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,s=t.secondary.length;r<s;r++){const o=t.secondary[r],a=kme(o,Yf);a&&i.add(this._registerDefaultKeybinding(a,e.id,e.args,e.weight,-r-1,e.when))}return i}registerCommandAndKeybindingRule(e){return U_(this.registerKeybindingRule(e),os.registerCommand(e))}_registerDefaultKeybinding(e,t,i,r,s,o){const a=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:o,weight1:r,weight2:s,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,gi(()=>{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(ncr)),this._cachedMergedKeybindings.slice(0)}}const Rh=new Nke,tcr={EditorModes:"platform.keybindingsRegistry"};Ca.add(tcr.EditorModes,Rh);function ncr(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 icr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},v8e=function(n,e){return function(t,i){e(t,i,n)}},tU;function DP(n){return n.command!==void 0}function rcr(n){return n.submenu!==void 0}const Ce=class Ce{constructor(e){if(Ce._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);Ce._instances.set(e,this),this.id=e}};Ce._instances=new Map,Ce.CommandPalette=new Ce("CommandPalette"),Ce.DebugBreakpointsContext=new Ce("DebugBreakpointsContext"),Ce.DebugCallStackContext=new Ce("DebugCallStackContext"),Ce.DebugConsoleContext=new Ce("DebugConsoleContext"),Ce.DebugVariablesContext=new Ce("DebugVariablesContext"),Ce.NotebookVariablesContext=new Ce("NotebookVariablesContext"),Ce.DebugHoverContext=new Ce("DebugHoverContext"),Ce.DebugWatchContext=new Ce("DebugWatchContext"),Ce.DebugToolBar=new Ce("DebugToolBar"),Ce.DebugToolBarStop=new Ce("DebugToolBarStop"),Ce.DebugCallStackToolbar=new Ce("DebugCallStackToolbar"),Ce.DebugCreateConfiguration=new Ce("DebugCreateConfiguration"),Ce.EditorContext=new Ce("EditorContext"),Ce.SimpleEditorContext=new Ce("SimpleEditorContext"),Ce.EditorContent=new Ce("EditorContent"),Ce.EditorLineNumberContext=new Ce("EditorLineNumberContext"),Ce.EditorContextCopy=new Ce("EditorContextCopy"),Ce.EditorContextPeek=new Ce("EditorContextPeek"),Ce.EditorContextShare=new Ce("EditorContextShare"),Ce.EditorTitle=new Ce("EditorTitle"),Ce.EditorTitleRun=new Ce("EditorTitleRun"),Ce.EditorTitleContext=new Ce("EditorTitleContext"),Ce.EditorTitleContextShare=new Ce("EditorTitleContextShare"),Ce.EmptyEditorGroup=new Ce("EmptyEditorGroup"),Ce.EmptyEditorGroupContext=new Ce("EmptyEditorGroupContext"),Ce.EditorTabsBarContext=new Ce("EditorTabsBarContext"),Ce.EditorTabsBarShowTabsSubmenu=new Ce("EditorTabsBarShowTabsSubmenu"),Ce.EditorTabsBarShowTabsZenModeSubmenu=new Ce("EditorTabsBarShowTabsZenModeSubmenu"),Ce.EditorActionsPositionSubmenu=new Ce("EditorActionsPositionSubmenu"),Ce.ExplorerContext=new Ce("ExplorerContext"),Ce.ExplorerContextShare=new Ce("ExplorerContextShare"),Ce.ExtensionContext=new Ce("ExtensionContext"),Ce.GlobalActivity=new Ce("GlobalActivity"),Ce.CommandCenter=new Ce("CommandCenter"),Ce.CommandCenterCenter=new Ce("CommandCenterCenter"),Ce.LayoutControlMenuSubmenu=new Ce("LayoutControlMenuSubmenu"),Ce.LayoutControlMenu=new Ce("LayoutControlMenu"),Ce.MenubarMainMenu=new Ce("MenubarMainMenu"),Ce.MenubarAppearanceMenu=new Ce("MenubarAppearanceMenu"),Ce.MenubarDebugMenu=new Ce("MenubarDebugMenu"),Ce.MenubarEditMenu=new Ce("MenubarEditMenu"),Ce.MenubarCopy=new Ce("MenubarCopy"),Ce.MenubarFileMenu=new Ce("MenubarFileMenu"),Ce.MenubarGoMenu=new Ce("MenubarGoMenu"),Ce.MenubarHelpMenu=new Ce("MenubarHelpMenu"),Ce.MenubarLayoutMenu=new Ce("MenubarLayoutMenu"),Ce.MenubarNewBreakpointMenu=new Ce("MenubarNewBreakpointMenu"),Ce.PanelAlignmentMenu=new Ce("PanelAlignmentMenu"),Ce.PanelPositionMenu=new Ce("PanelPositionMenu"),Ce.ActivityBarPositionMenu=new Ce("ActivityBarPositionMenu"),Ce.MenubarPreferencesMenu=new Ce("MenubarPreferencesMenu"),Ce.MenubarRecentMenu=new Ce("MenubarRecentMenu"),Ce.MenubarSelectionMenu=new Ce("MenubarSelectionMenu"),Ce.MenubarShare=new Ce("MenubarShare"),Ce.MenubarSwitchEditorMenu=new Ce("MenubarSwitchEditorMenu"),Ce.MenubarSwitchGroupMenu=new Ce("MenubarSwitchGroupMenu"),Ce.MenubarTerminalMenu=new Ce("MenubarTerminalMenu"),Ce.MenubarViewMenu=new Ce("MenubarViewMenu"),Ce.MenubarHomeMenu=new Ce("MenubarHomeMenu"),Ce.OpenEditorsContext=new Ce("OpenEditorsContext"),Ce.OpenEditorsContextShare=new Ce("OpenEditorsContextShare"),Ce.ProblemsPanelContext=new Ce("ProblemsPanelContext"),Ce.SCMInputBox=new Ce("SCMInputBox"),Ce.SCMChangesSeparator=new Ce("SCMChangesSeparator"),Ce.SCMChangesContext=new Ce("SCMChangesContext"),Ce.SCMIncomingChanges=new Ce("SCMIncomingChanges"),Ce.SCMIncomingChangesContext=new Ce("SCMIncomingChangesContext"),Ce.SCMIncomingChangesSetting=new Ce("SCMIncomingChangesSetting"),Ce.SCMOutgoingChanges=new Ce("SCMOutgoingChanges"),Ce.SCMOutgoingChangesContext=new Ce("SCMOutgoingChangesContext"),Ce.SCMOutgoingChangesSetting=new Ce("SCMOutgoingChangesSetting"),Ce.SCMIncomingChangesAllChangesContext=new Ce("SCMIncomingChangesAllChangesContext"),Ce.SCMIncomingChangesHistoryItemContext=new Ce("SCMIncomingChangesHistoryItemContext"),Ce.SCMOutgoingChangesAllChangesContext=new Ce("SCMOutgoingChangesAllChangesContext"),Ce.SCMOutgoingChangesHistoryItemContext=new Ce("SCMOutgoingChangesHistoryItemContext"),Ce.SCMChangeContext=new Ce("SCMChangeContext"),Ce.SCMResourceContext=new Ce("SCMResourceContext"),Ce.SCMResourceContextShare=new Ce("SCMResourceContextShare"),Ce.SCMResourceFolderContext=new Ce("SCMResourceFolderContext"),Ce.SCMResourceGroupContext=new Ce("SCMResourceGroupContext"),Ce.SCMSourceControl=new Ce("SCMSourceControl"),Ce.SCMSourceControlInline=new Ce("SCMSourceControlInline"),Ce.SCMSourceControlTitle=new Ce("SCMSourceControlTitle"),Ce.SCMHistoryTitle=new Ce("SCMHistoryTitle"),Ce.SCMTitle=new Ce("SCMTitle"),Ce.SearchContext=new Ce("SearchContext"),Ce.SearchActionMenu=new Ce("SearchActionContext"),Ce.StatusBarWindowIndicatorMenu=new Ce("StatusBarWindowIndicatorMenu"),Ce.StatusBarRemoteIndicatorMenu=new Ce("StatusBarRemoteIndicatorMenu"),Ce.StickyScrollContext=new Ce("StickyScrollContext"),Ce.TestItem=new Ce("TestItem"),Ce.TestItemGutter=new Ce("TestItemGutter"),Ce.TestProfilesContext=new Ce("TestProfilesContext"),Ce.TestMessageContext=new Ce("TestMessageContext"),Ce.TestMessageContent=new Ce("TestMessageContent"),Ce.TestPeekElement=new Ce("TestPeekElement"),Ce.TestPeekTitle=new Ce("TestPeekTitle"),Ce.TestCallStack=new Ce("TestCallStack"),Ce.TouchBarContext=new Ce("TouchBarContext"),Ce.TitleBarContext=new Ce("TitleBarContext"),Ce.TitleBarTitleContext=new Ce("TitleBarTitleContext"),Ce.TunnelContext=new Ce("TunnelContext"),Ce.TunnelPrivacy=new Ce("TunnelPrivacy"),Ce.TunnelProtocol=new Ce("TunnelProtocol"),Ce.TunnelPortInline=new Ce("TunnelInline"),Ce.TunnelTitle=new Ce("TunnelTitle"),Ce.TunnelLocalAddressInline=new Ce("TunnelLocalAddressInline"),Ce.TunnelOriginInline=new Ce("TunnelOriginInline"),Ce.ViewItemContext=new Ce("ViewItemContext"),Ce.ViewContainerTitle=new Ce("ViewContainerTitle"),Ce.ViewContainerTitleContext=new Ce("ViewContainerTitleContext"),Ce.ViewTitle=new Ce("ViewTitle"),Ce.ViewTitleContext=new Ce("ViewTitleContext"),Ce.CommentEditorActions=new Ce("CommentEditorActions"),Ce.CommentThreadTitle=new Ce("CommentThreadTitle"),Ce.CommentThreadActions=new Ce("CommentThreadActions"),Ce.CommentThreadAdditionalActions=new Ce("CommentThreadAdditionalActions"),Ce.CommentThreadTitleContext=new Ce("CommentThreadTitleContext"),Ce.CommentThreadCommentContext=new Ce("CommentThreadCommentContext"),Ce.CommentTitle=new Ce("CommentTitle"),Ce.CommentActions=new Ce("CommentActions"),Ce.CommentsViewThreadActions=new Ce("CommentsViewThreadActions"),Ce.InteractiveToolbar=new Ce("InteractiveToolbar"),Ce.InteractiveCellTitle=new Ce("InteractiveCellTitle"),Ce.InteractiveCellDelete=new Ce("InteractiveCellDelete"),Ce.InteractiveCellExecute=new Ce("InteractiveCellExecute"),Ce.InteractiveInputExecute=new Ce("InteractiveInputExecute"),Ce.InteractiveInputConfig=new Ce("InteractiveInputConfig"),Ce.ReplInputExecute=new Ce("ReplInputExecute"),Ce.IssueReporter=new Ce("IssueReporter"),Ce.NotebookToolbar=new Ce("NotebookToolbar"),Ce.NotebookStickyScrollContext=new Ce("NotebookStickyScrollContext"),Ce.NotebookCellTitle=new Ce("NotebookCellTitle"),Ce.NotebookCellDelete=new Ce("NotebookCellDelete"),Ce.NotebookCellInsert=new Ce("NotebookCellInsert"),Ce.NotebookCellBetween=new Ce("NotebookCellBetween"),Ce.NotebookCellListTop=new Ce("NotebookCellTop"),Ce.NotebookCellExecute=new Ce("NotebookCellExecute"),Ce.NotebookCellExecuteGoTo=new Ce("NotebookCellExecuteGoTo"),Ce.NotebookCellExecutePrimary=new Ce("NotebookCellExecutePrimary"),Ce.NotebookDiffCellInputTitle=new Ce("NotebookDiffCellInputTitle"),Ce.NotebookDiffCellMetadataTitle=new Ce("NotebookDiffCellMetadataTitle"),Ce.NotebookDiffCellOutputsTitle=new Ce("NotebookDiffCellOutputsTitle"),Ce.NotebookOutputToolbar=new Ce("NotebookOutputToolbar"),Ce.NotebookOutlineFilter=new Ce("NotebookOutlineFilter"),Ce.NotebookOutlineActionMenu=new Ce("NotebookOutlineActionMenu"),Ce.NotebookEditorLayoutConfigure=new Ce("NotebookEditorLayoutConfigure"),Ce.NotebookKernelSource=new Ce("NotebookKernelSource"),Ce.BulkEditTitle=new Ce("BulkEditTitle"),Ce.BulkEditContext=new Ce("BulkEditContext"),Ce.TimelineItemContext=new Ce("TimelineItemContext"),Ce.TimelineTitle=new Ce("TimelineTitle"),Ce.TimelineTitleContext=new Ce("TimelineTitleContext"),Ce.TimelineFilterSubMenu=new Ce("TimelineFilterSubMenu"),Ce.AccountsContext=new Ce("AccountsContext"),Ce.SidebarTitle=new Ce("SidebarTitle"),Ce.PanelTitle=new Ce("PanelTitle"),Ce.AuxiliaryBarTitle=new Ce("AuxiliaryBarTitle"),Ce.AuxiliaryBarHeader=new Ce("AuxiliaryBarHeader"),Ce.TerminalInstanceContext=new Ce("TerminalInstanceContext"),Ce.TerminalEditorInstanceContext=new Ce("TerminalEditorInstanceContext"),Ce.TerminalNewDropdownContext=new Ce("TerminalNewDropdownContext"),Ce.TerminalTabContext=new Ce("TerminalTabContext"),Ce.TerminalTabEmptyAreaContext=new Ce("TerminalTabEmptyAreaContext"),Ce.TerminalStickyScrollContext=new Ce("TerminalStickyScrollContext"),Ce.WebviewContext=new Ce("WebviewContext"),Ce.InlineCompletionsActions=new Ce("InlineCompletionsActions"),Ce.InlineEditsActions=new Ce("InlineEditsActions"),Ce.InlineEditActions=new Ce("InlineEditActions"),Ce.NewFile=new Ce("NewFile"),Ce.MergeInput1Toolbar=new Ce("MergeToolbar1Toolbar"),Ce.MergeInput2Toolbar=new Ce("MergeToolbar2Toolbar"),Ce.MergeBaseToolbar=new Ce("MergeBaseToolbar"),Ce.MergeInputResultToolbar=new Ce("MergeToolbarResultToolbar"),Ce.InlineSuggestionToolbar=new Ce("InlineSuggestionToolbar"),Ce.InlineEditToolbar=new Ce("InlineEditToolbar"),Ce.ChatContext=new Ce("ChatContext"),Ce.ChatCodeBlock=new Ce("ChatCodeblock"),Ce.ChatCompareBlock=new Ce("ChatCompareBlock"),Ce.ChatMessageTitle=new Ce("ChatMessageTitle"),Ce.ChatExecute=new Ce("ChatExecute"),Ce.ChatExecuteSecondary=new Ce("ChatExecuteSecondary"),Ce.ChatInputSide=new Ce("ChatInputSide"),Ce.AccessibleView=new Ce("AccessibleView"),Ce.MultiDiffEditorFileToolbar=new Ce("MultiDiffEditorFileToolbar"),Ce.DiffEditorHunkToolbar=new Ce("DiffEditorHunkToolbar"),Ce.DiffEditorSelectionToolbar=new Ce("DiffEditorSelectionToolbar");let zn=Ce;const Eg=Ur("menuService"),j6=class j6{static for(e){let t=this._all.get(e);return t||(t=new j6(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof j6&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};j6._all=new Map;let _2=j6;const Uc=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new bor({merge:_2.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(_2.for(zn.CommandPalette)),gi(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(_2.for(zn.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 Ch,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(_2.for(n)),gi(()=>{i(),this._onDidChangeMenu.fire(_2.for(n))})}appendMenuItems(n){const e=new Et;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===zn.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)DP(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 RP extends oM{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 Jf=tU=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,s,o,a){var c;this.hideActions=r,this.menuKeybinding=s,this._commandService=a,this.id=e.id,this.label=tU.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:(c=e.tooltip)==null?void 0:c.value)??"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let l;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&&Ni.isThemeIcon(u.icon)&&(l=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}l||(l=Ni.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new tU(t,void 0,i,r,void 0,o,a):void 0,this._options=i,this.class=l&&Ni.asClassName(l)}run(...e){var i,r;let t=[];return(i=this._options)!=null&&i.arg&&(t=[...t,this._options.arg]),(r=this._options)!=null&&r.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};Jf=tU=icr([v8e(5,Oi),v8e(6,Fo)],Jf);class Mh{constructor(e){this.desc=e}}function Ao(n){const e=[],t=new n,{f1:i,menu:r,keybinding:s,...o}=t.desc;if(os.getCommand(o.id))throw new Error(`Cannot register two commands with the same id: ${o.id}`);if(e.push(os.registerCommand({id:o.id,handler:(a,...l)=>t.run(a,...l),metadata:o.metadata})),Array.isArray(r))for(const a of r)e.push(Uc.appendMenuItem(a.id,{command:{...o,precondition:a.precondition===null?void 0:o.precondition},...a}));else r&&e.push(Uc.appendMenuItem(r.id,{command:{...o,precondition:r.precondition===null?void 0:o.precondition},...r}));if(i&&(e.push(Uc.appendMenuItem(zn.CommandPalette,{command:o,when:o.precondition})),e.push(Uc.addCommand(o))),Array.isArray(s))for(const a of s)e.push(Rh.registerKeybindingRule({...a,id:o.id,when:o.precondition?It.and(o.precondition,a.when):a.when}));else s&&e.push(Rh.registerKeybindingRule({...s,id:o.id,when:o.precondition?It.and(o.precondition,s.when):s.when}));return{dispose(){vo(e)}}}const md=Ur("telemetryService"),Uu=Ur("logService");var nf;(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"})(nf||(nf={}));const aat=nf.Info;class lat extends Ye{constructor(){super(...arguments),this.level=aat,this._onDidChangeLogLevel=this._register(new Ue),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!==nf.Off&&this.level<=e}}class scr extends lat{constructor(e=aat,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(nf.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(nf.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(nf.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(nf.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(nf.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class ocr extends lat{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();super.dispose()}}function acr(n){switch(n){case nf.Trace:return"trace";case nf.Debug:return"debug";case nf.Info:return"info";case nf.Warning:return"warn";case nf.Error:return"error";case nf.Off:return"off"}}new yn("logLevel",acr(nf.Info));class ute{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}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=It.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};Rh.registerKeybindingRule(r)}}os.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){Uc.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 W4 extends ute{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((s,o)=>o.priority-s.priority),{dispose:()=>{for(let s=0;s<this._implementations.length;s++)if(this._implementations[s].implementation===i){this._implementations.splice(s,1);return}}}}runCommand(e,t){const i=e.get(Uu),r=e.get(Oi);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const s of this._implementations){if(s.when){const a=r.getContext(Hu());if(!s.when.evaluate(a))continue}const o=s.implementation(e,t);if(o)return i.trace(`Command '${this.id}' was handled by '${s.name}'.`),typeof o=="boolean"?void 0:o}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class cat extends ute{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class pc extends ute{static bindToContribution(e){return class extends pc{constructor(i){super(i),this._callback=i.handler}runEditorCommand(i,r,s){const o=e(r);o&&this._callback(o,s)}}}static runEditorCommand(e,t,i,r){const s=e.get(Cs),o=s.getFocusedCodeEditor()||s.getActiveCodeEditor();if(o)return o.invokeWithinContext(a=>{if(a.get(Oi).contextMatchesRules(i??void 0))return r(a,o,t)})}runCommand(e,t){return pc.runEditorCommand(e,t,this.precondition,(i,r,s)=>this.runEditorCommand(i,r,s))}}class In extends pc{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=zn.EditorContext),r.title||(r.title=e.label),r.when=It.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(In.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(md).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class uat extends In{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 s=r[1](e,t,i);if(s)return typeof s=="boolean"?void 0:s}}}class Zb extends Mh{run(e,...t){const i=e.get(Cs),r=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(r)return r.invokeWithinContext(s=>{var c;const o=s.get(Oi),a=s.get(Uu);if(!o.contextMatchesRules(this.desc.precondition??void 0)){a.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(c=this.desc.precondition)==null?void 0:c.serialize());return}return this.runEditorCommand(s,r,...t)})}}function wf(n,e){os.registerCommand(n,function(t,...i){const r=t.get(mi),[s,o]=i;ys(vi.isUri(s)),ys(We.isIPosition(o));const a=t.get(Xo).getModel(s);if(a){const l=We.lift(o);return r.invokeFunction(e,a,l,...i.slice(2))}return t.get(Cf).createModelReference(s).then(l=>new Promise((c,u)=>{try{const d=r.invokeFunction(e,l.object.textEditorModel,We.lift(o),i.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function gn(n){return cm.INSTANCE.registerEditorCommand(n),n}function zt(n){const e=new n;return cm.INSTANCE.registerEditorAction(e),e}function dat(n){return cm.INSTANCE.registerEditorAction(n),n}function lcr(n){cm.INSTANCE.registerEditorAction(n)}function cs(n,e,t){cm.INSTANCE.registerEditorContribution(n,e,t)}var dI;(function(n){function e(o){return cm.INSTANCE.getEditorCommand(o)}n.getEditorCommand=e;function t(){return cm.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return cm.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function r(o){return cm.INSTANCE.getEditorContributions().filter(a=>o.indexOf(a.id)>=0)}n.getSomeEditorContributions=r;function s(){return cm.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=s})(dI||(dI={}));const ccr={EditorCommonContributions:"editor.contributions"},RQ=class RQ{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}};RQ.INSTANCE=new RQ;let cm=RQ;Ca.add(ccr.EditorCommonContributions,cm.INSTANCE);function G9(n){return n.register(),n}const hat=G9(new W4({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:zn.MenubarEditMenu,group:"1_do",title:A({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:zn.CommandPalette,group:"",title:A("undo","Undo"),order:1}]}));G9(new cat(hat,{id:"default:undo",precondition:void 0}));const fat=G9(new W4({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:zn.MenubarEditMenu,group:"1_do",title:A({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:zn.CommandPalette,group:"",title:A("redo","Redo"),order:1}]}));G9(new cat(fat,{id:"default:redo",precondition:void 0}));const ucr=G9(new W4({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:zn.MenubarSelectionMenu,group:"1_basic",title:A({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:zn.CommandPalette,group:"",title:A("selectAll","Select All"),order:1}]})),b8e="default",dcr="$initialize";let y8e=!1;function Hme(n){FA&&(y8e||(y8e=!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 hcr{constructor(e,t,i,r,s){this.vsWorker=e,this.req=t,this.channel=i,this.method=r,this.args=s,this.type=0}}class C8e{constructor(e,t,i,r){this.vsWorker=e,this.seq=t,this.res=i,this.err=r,this.type=1}}class fcr{constructor(e,t,i,r,s){this.vsWorker=e,this.req=t,this.channel=i,this.eventName=r,this.arg=s,this.type=2}}class pcr{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class gcr{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class mcr{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,i){const r=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[r]={resolve:s,reject:o},this._send(new hcr(this._workerId,r,e,t,i))})}listen(e,t,i){let r=null;const s=new Ue({onWillAddFirstListener:()=>{r=String(++this._lastSentReq),this._pendingEmitters.set(r,s),this._send(new fcr(this._workerId,r,e,t,i))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(r),this._send(new gcr(this._workerId,r)),r=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}createProxyToRemoteChannel(e,t){const i={get:(r,s)=>(typeof s=="string"&&!r[s]&&(gat(s)?r[s]=o=>this.listen(e,s,o):pat(s)?r[s]=this.listen(e,s,void 0):s.charCodeAt(0)===36&&(r[s]=async(...o)=>(await(t==null?void 0:t()),this.sendMessage(e,s,o)))),r[s])};return new Proxy(Object.create(null),i)}_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.channel,e.method,e.args).then(r=>{this._send(new C8e(this._workerId,t,r,void 0))},r=>{r.detail instanceof Error&&(r.detail=K6e(r.detail)),this._send(new C8e(this._workerId,t,void 0,K6e(r)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.channel,e.eventName,e.arg)(r=>{this._send(new pcr(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 _cr extends Ye{constructor(e,t){super(),this._localChannels=new Map,this._worker=this._register(e.create({amdModuleId:"vs/base/common/worker/simpleWorker",esmModuleLocation:t.esmModuleLocation,label:t.label},s=>{this._protocol.handleMessage(s)},s=>{tr(s)})),this._protocol=new mcr({sendMessage:(s,o)=>{this._worker.postMessage(s,o)},handleMessage:(s,o,a)=>this._handleMessage(s,o,a),handleEvent:(s,o,a)=>this._handleEvent(s,o,a)}),this._protocol.setWorkerId(this._worker.getId());let i=null;const r=globalThis.require;typeof r<"u"&&typeof r.getConfig=="function"?i=r.getConfig():typeof globalThis.requirejs<"u"&&(i=globalThis.requirejs.s.contexts._.config),this._onModuleLoaded=this._protocol.sendMessage(b8e,dcr,[this._worker.getId(),JSON.parse(JSON.stringify(i)),t.amdModuleId]),this.proxy=this._protocol.createProxyToRemoteChannel(b8e,async()=>{await this._onModuleLoaded}),this._onModuleLoaded.catch(s=>{this._onError("Worker failed to load "+t.amdModuleId,s)})}_handleMessage(e,t,i){const r=this._localChannels.get(e);if(!r)return Promise.reject(new Error(`Missing channel ${e} on main thread`));if(typeof r[t]!="function")return Promise.reject(new Error(`Missing method ${t} on main thread channel ${e}`));try{return Promise.resolve(r[t].apply(r,i))}catch(s){return Promise.reject(s)}}_handleEvent(e,t,i){const r=this._localChannels.get(e);if(!r)throw new Error(`Missing channel ${e} on main thread`);if(gat(t)){const s=r[t].call(r,i);if(typeof s!="function")throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);return s}if(pat(t)){const s=r[t];if(typeof s!="function")throw new Error(`Missing event ${t} on main thread channel ${e}.`);return s}throw new Error(`Malformed event name ${t}`)}setChannel(e,t){this._localChannels.set(e,t)}_onError(e,t){console.error(e),console.info(t)}}function pat(n){return n[0]==="o"&&n[1]==="n"&&oy(n.charCodeAt(2))}function gat(n){return/^onDynamic/.test(n)&&oy(n.charCodeAt(9))}function Xw(n,e){var i;const t=globalThis.MonacoEnvironment;if(t!=null&&t.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(n,e)}catch(r){tr(r);return}try{return(i=globalThis.trustedTypes)==null?void 0:i.createPolicy(n,e)}catch(r){tr(r);return}}let LR;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?LR=globalThis.workerttPolicy:LR=Xw("defaultWorkerFactory",{createScriptURL:n=>n});function vcr(n,e){const t=globalThis.MonacoEnvironment;if(t){if(typeof t.getWorker=="function")return t.getWorker("workerMain.js",e);if(typeof t.getWorkerUrl=="function"){const i=t.getWorkerUrl("workerMain.js",e);return new Worker(LR?LR.createScriptURL(i):i,{name:e,type:"module"})}}if(n){const i=bcr(e,n.toString(!0)),r=new Worker(LR?LR.createScriptURL(i):i,{name:e,type:"module"});return ycr(r)}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function bcr(n,e,t){if(!(/^((http:)|(https:)|(file:)|(vscode-file:))/.test(e)&&e.substring(0,globalThis.origin.length)!==globalThis.origin)){const s=e.lastIndexOf("?"),o=e.lastIndexOf("#",s),a=s>0?new URLSearchParams(e.substring(s+1,~o?o:void 0)):new URLSearchParams;Rme.addSearchParam(a,!0,!0),a.toString()?e=`${e}?${a.toString()}#${n}`:e=`${e}#${n}`}const r=new Blob([iv([`/*${n}*/`,void 0,`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(Yst())};`,`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(nke())};`,`globalThis._VSCODE_FILE_ROOT = '${globalThis._VSCODE_FILE_ROOT}';`,"const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });","globalThis.workerttPolicy = ttPolicy;",`await import(ttPolicy?.createScriptURL('${e}') ?? '${e}');`,"globalThis.postMessage({ type: 'vscode-worker-ready' });",`/*${n}*/`]).join("")],{type:"application/javascript"});return URL.createObjectURL(r)}function ycr(n){return new Promise((e,t)=>{n.onmessage=function(i){i.data.type==="vscode-worker-ready"&&(n.onmessage=null,e(n))},n.onerror=t})}function Ccr(n){return typeof n.then=="function"}class wcr extends Ye{constructor(e,t,i,r,s,o){super(),this.id=i,this.label=r;const a=vcr(e,r);Ccr(a)?this.worker=a:this.worker=Promise.resolve(a),this.postMessage(t,[]),this.worker.then(l=>{l.onmessage=function(c){s(c.data)},l.onmessageerror=o,typeof l.addEventListener=="function"&&l.addEventListener("error",o)}),this._register(gi(()=>{var l;(l=this.worker)==null||l.then(c=>{c.onmessage=null,c.onmessageerror=null,c.removeEventListener("error",o),c.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)==null||i.then(r=>{try{r.postMessage(e,t)}catch(s){tr(s),tr(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:s}))}})}}class xcr{constructor(e,t){this.amdModuleId=e,this.label=t,this.esmModuleLocation=Yee.asBrowserUri(`${e}.esm.js`)}}const PQ=class PQ{constructor(){this._webWorkerFailedBeforeError=!1}create(e,t,i){const r=++PQ.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new wcr(e.esmModuleLocation,e.amdModuleId,r,e.label||"anonymous"+r,t,s=>{Hme(s),this._webWorkerFailedBeforeError=s,i(s)})}};PQ.LAST_WORKER_ID=0;let Vme=PQ;function Scr(n,e){const t=typeof n=="string"?new xcr(n,e):n;return new _cr(new Vme,t)}var Ul;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Ul||(Ul={}));class kce{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 Ecr{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)dj(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),dj(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),dj(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),dj(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&dj(this.autoClosingPairsCloseSingleChar,t.close,t)}}function dj(n,e,t){n.has(e)?n.get(e).push(t):n.set(e,[t])}const tP=class tP{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new kce(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new kce({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new kce({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:tP.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:tP.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}};tP.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `,tP.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> `;let Wme=tP;function q2(n,e){const t=n.getCount(),i=n.findTokenIndexAtOffset(e),r=n.getLanguageId(i);let s=i;for(;s+1<t&&n.getLanguageId(s+1)===r;)s++;let o=i;for(;o>0&&n.getLanguageId(o-1)===r;)o--;return new kcr(n,r,o,s+1,n.getStartOffset(o),n.getEndOffset(s))}class kcr{constructor(e,t,i,r,s,o){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=r,this.firstCharOffset=s,this._lastCharOffset=o,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}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)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function F0(n){return(n&3)!==0}const w8e=typeof Buffer<"u";let Tce;class dte{static wrap(e){return w8e&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new dte(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return w8e?this.buffer.toString():(Tce||(Tce=new TextDecoder),Tce.decode(this.buffer))}}function Tcr(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function Icr(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Qv(n,e){return n[e]*2**24+n[e+1]*2**16+n[e+2]*2**8+n[e+3]}function Xv(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 x8e(n,e){return n[e]}function S8e(n,e,t){n[t]=e}let Ice;function mat(){return Ice||(Ice=new TextDecoder("UTF-16LE")),Ice}let Lce;function Lcr(){return Lce||(Lce=new TextDecoder("UTF-16BE")),Lce}let Ace;function _at(){return Ace||(Ace=tot()?mat():Lcr()),Ace}function Acr(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?Ncr(n,e,t):mat().decode(i)}function Ncr(n,e,t){const i=[];let r=0;for(let s=0;s<t;s++){const o=Tcr(n,e);e+=2,i[r++]=String.fromCharCode(o)}return i.join("")}class z4{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 _at().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||Ec(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 GK{constructor(e,t,i,r,s,o){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=r,this.forwardRegex=s,this.reversedRegex=o,this._openSet=GK._toSet(this.open),this._closeSet=GK._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 Dcr(n){const e=n.length;n=n.map(o=>[o[0].toLowerCase(),o[1].toLowerCase()]);const t=[];for(let o=0;o<e;o++)t[o]=o;const i=(o,a)=>{const[l,c]=o,[u,d]=a;return l===u||l===d||c===u||c===d},r=(o,a)=>{const l=Math.min(o,a),c=Math.max(o,a);for(let u=0;u<e;u++)t[u]===c&&(t[u]=l)};for(let o=0;o<e;o++){const a=n[o];for(let l=o+1;l<e;l++){const c=n[l];i(a,c)&&r(t[o],t[l])}}const s=[];for(let o=0;o<e;o++){const a=[],l=[];for(let c=0;c<e;c++)if(t[c]===o){const[u,d]=n[c];a.push(u),l.push(d)}a.length>0&&s.push({open:a,close:l})}return s}class Rcr{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Dcr(t);this.brackets=i.map((r,s)=>new GK(e,s,r.open,r.close,Pcr(r.open,r.close,i,s),Ocr(r.open,r.close,i,s))),this.forwardRegex=Mcr(this.brackets),this.reversedRegex=jcr(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const r of this.brackets){for(const s of r.open)this.textIsBracket[s]=r,this.textIsOpenBracket[s]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,s.length);for(const s of r.close)this.textIsBracket[s]=r,this.textIsOpenBracket[s]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,s.length)}}}function vat(n,e,t,i){for(let r=0,s=e.length;r<s;r++){if(r===t)continue;const o=e[r];for(const a of o.open)a.indexOf(n)>=0&&i.push(a);for(const a of o.close)a.indexOf(n)>=0&&i.push(a)}}function bat(n,e){return n.length-e.length}function hte(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 Pcr(n,e,t,i){let r=[];r=r.concat(n),r=r.concat(e);for(let s=0,o=r.length;s<o;s++)vat(r[s],t,i,r);return r=hte(r),r.sort(bat),r.reverse(),Y9(r)}function Ocr(n,e,t,i){let r=[];r=r.concat(n),r=r.concat(e);for(let s=0,o=r.length;s<o;s++)vat(r[s],t,i,r);return r=hte(r),r.sort(bat),r.reverse(),Y9(r.map(Dke))}function Mcr(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=hte(e),Y9(e)}function jcr(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=hte(e),Y9(e.map(Dke))}function Fcr(n){const e=/^[\w ]+$/.test(n);return n=mg(n),e?`\\b${n}\\b`:n}function Y9(n,e){const t=`(${n.map(Fcr).join(")|(")})`;return Eot(t,!0,e)}const Dke=function(){function n(i){const r=new Uint16Array(i.length);let s=0;for(let o=i.length-1;o>=0;o--)r[s++]=i.charCodeAt(o);return _at().decode(r)}let e=null,t=null;return function(r){return e!==r&&(e=r,t=n(e)),t}}();class S_{static _findPrevBracketInText(e,t,i,r){const s=i.match(e);if(!s)return null;const o=i.length-(s.index||0),a=s[0].length,l=r+o;return new ie(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,r,s){const a=Dke(i).substring(i.length-s,i.length-r);return this._findPrevBracketInText(e,t,a,r)}static findNextBracketInText(e,t,i,r){const s=i.match(e);if(!s)return null;const o=s.index||0,a=s[0].length;if(a===0)return null;const l=r+o;return new ie(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,r,s){const o=i.substring(r,s);return this.findNextBracketInText(e,t,o,r)}}class Bcr{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 Iw(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const r=t.findTokenIndexAtOffset(i-1);if(F0(t.getStandardTokenType(r)))return null;const s=this._richEditBrackets.reversedRegex,o=t.getLineContent().substring(0,i-1)+e,a=S_.findPrevBracketInRange(s,1,o,0,o.length);if(!a)return null;const l=o.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 ZV(n){return n.global&&(n.lastIndex=0),!0}class $cr{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&ZV(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&ZV(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&ZV(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&ZV(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 AR{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=AR._createOpenBracketRegExp(t[0]),r=AR._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 s=0,o=this._regExpRules.length;s<o;s++){const a=this._regExpRules[s];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 s=0,o=this._brackets.length;s<o;s++){const a=this._brackets[s];if(a.openRegExp.test(i)&&a.closeRegExp.test(r))return{indentAction:Ul.IndentOutdent}}if(e>=2&&i.length>0){for(let s=0,o=this._brackets.length;s<o;s++)if(this._brackets[s].openRegExp.test(i))return{indentAction:Ul.Indent}}return null}static _createOpenBracketRegExp(e){let t=mg(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",AR._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=mg(e);return/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"),t="^\\s*"+t,AR._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return tr(t),null}}}const Dr=Ur("configurationService");function zme(n,e){const t=Object.create(null);for(const i in n)yat(t,i,n[i],e);return t}function yat(n,e,t,i){const r=e.split("."),s=r.pop();let o=n;for(let a=0;a<r.length;a++){const l=r[a];let c=o[l];switch(typeof c){case"undefined":c=o[l]=Object.create(null);break;case"object":if(c===null){i(`Ignoring ${e} as ${r.slice(0,a+1).join(".")} is null`);return}break;default:i(`Ignoring ${e} as ${r.slice(0,a+1).join(".")} is ${JSON.stringify(c)}`);return}o=c}if(typeof o=="object"&&o!==null)try{o[s]=t}catch{i(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(o)}`)}else i(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(o)}`)}function Hcr(n,e){const t=e.split(".");Cat(n,t)}function Cat(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)&&(Cat(i,e),Object.keys(i).length===0&&delete n[t])}}function E8e(n,e,t){function i(o,a){let l=o;for(const c of a){if(typeof l!="object"||l===null)return;l=l[c]}return l}const r=e.split("."),s=i(n,r);return typeof s>"u"?t:s}function Vcr(n){return n.replace(/[\[\]]/g,"")}const pa=Ur("languageService");class ay{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const wat=[];function ns(n,e,t){e instanceof ay||(e=new ay(e,[],!!t)),wat.push([n,e])}function k8e(){return wat}const ol=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),fte={JSONContribution:"base.contributions.json"};function Wcr(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class zcr{constructor(){this._onDidChangeSchema=new Ue,this.schemasById={}}registerSchema(e,t){this.schemasById[Wcr(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Ucr=new zcr;Ca.add(fte.JSONContribution,Ucr);const bv={Configuration:"base.contributions.configuration"},JV="vscode://schemas/settings/resourceLanguage",T8e=Ca.as(fte.JSONContribution);class qcr{constructor(){this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=new Ue,this._onDidUpdateConfiguration=new Ue,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:A("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={},T8e.registerSchema(JV,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),T8e.registerSchema(JV,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){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:r,source:s}of e)for(const o in r){t.add(o);const a=this.configurationDefaultsOverrides.get(o)??this.configurationDefaultsOverrides.set(o,{configurationDefaultOverrides:[]}).get(o),l=r[o];if(a.configurationDefaultOverrides.push({value:l,source:s}),JE.test(o)){const c=this.mergeDefaultConfigurationsForOverrideIdentifier(o,l,s,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(o,c,s),i.push(...YK(o))}else{const c=this.mergeDefaultConfigurationsForConfigurationProperty(o,l,s,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c;const u=this.configurationProperties[o];u&&(this.updatePropertyDefaultValue(o,u),this.updateSchema(o,u))}}this.doRegisterOverrideIdentifiers(i)}updateDefaultOverrideProperty(e,t,i){const r={type:"object",default:t.value,description:A("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",Vcr(e)),$ref:JV,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=r,this.defaultLanguageConfigurationOverridesNode.properties[e]=r}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,r){const s=(r==null?void 0:r.value)||{},o=(r==null?void 0:r.source)??new Map;if(!(o instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const l=t[a];if(zc(l)&&(Kd(s[a])||zc(s[a]))){if(s[a]={...s[a]??{},...l},i)for(const u in l)o.set(`${a}.${u}`,i)}else s[a]=l,i?o.set(a,i):o.delete(a)}return{value:s,source:o}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,r){const s=this.configurationProperties[e],o=(r==null?void 0:r.value)??(s==null?void 0:s.defaultDefaultValue);let a=i;if(zc(t)&&(s!==void 0&&s.type==="object"||s===void 0&&(Kd(o)||zc(o)))){if(a=(r==null?void 0:r.source)??new Map,!(a instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const c in t)i&&a.set(`${e}.${c}`,i);t={...zc(o)?o:{},...t}}return{value:t,source:a}}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,s=3,o){var c;s=Gp(e.scope)?s:e.scope;const a=e.properties;if(a)for(const u in a){const d=a[u];if(t&&Ycr(u,d)){delete a[u];continue}if(d.source=i,d.defaultDefaultValue=a[u].default,this.updatePropertyDefaultValue(u,d),JE.test(u)?d.scope=void 0:(d.scope=Gp(d.scope)?s:d.scope,d.restricted=Gp(d.restricted)?!!(r!=null&&r.includes(u)):d.restricted),a[u].hasOwnProperty("included")&&!a[u].included){this.excludedConfigurationProperties[u]=a[u],delete a[u];continue}else this.configurationProperties[u]=a[u],(c=a[u].policy)!=null&&c.name&&this.policyConfigurations.set(a[u].policy.name,u);!a[u].deprecationMessage&&a[u].markdownDeprecationMessage&&(a[u].deprecationMessage=a[u].markdownDeprecationMessage),o.add(u)}const l=e.allOf;if(l)for(const u of l)this.validateAndRegisterProperties(u,t,i,r,s,o)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const r=i.properties;if(r)for(const o in r)this.updateSchema(o,r[o]);const s=i.allOf;s==null||s.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:A("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:A("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:JV};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){A("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),A("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){var o;const i=(o=this.configurationDefaultsOverrides.get(e))==null?void 0:o.configurationDefaultOverrideValue;let r,s;i&&(!t.disallowConfigurationDefault||!i.source)&&(r=i.value,s=i.source),Kd(r)&&(r=t.defaultDefaultValue,s=void 0),Kd(r)&&(r=Gcr(t.type)),t.default=r,t.defaultValueSource=s}}const xat="\\[([^\\]]+)\\]",I8e=new RegExp(xat,"g"),Kcr=`^(${xat})+$`,JE=new RegExp(Kcr);function YK(n){const e=[];if(JE.test(n)){let t=I8e.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=I8e.exec(n)}}return Iw(e)}function Gcr(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 nU=new qcr;Ca.add(bv.Configuration,nU);function Ycr(n,e){var t,i,r,s;return n.trim()?JE.test(n)?A("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):nU.getConfigurationProperties()[n]!==void 0?A("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):(t=e.policy)!=null&&t.name&&nU.getPolicyConfigurations().get((i=e.policy)==null?void 0:i.name)!==void 0?A("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,(r=e.policy)==null?void 0:r.name,nU.getPolicyConfigurations().get((s=e.policy)==null?void 0:s.name)):null:A("config.property.empty","Cannot register an empty property")}const Qcr={ModesRegistry:"editor.modesRegistry"};class Xcr{constructor(){this._onDidChangeLanguages=new Ue,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 aM=new Xcr;Ca.add(Qcr.ModesRegistry,aM);const Ih="plaintext",Zcr=".txt";aM.registerLanguage({id:Ih,extensions:[Zcr],aliases:[A("plainText.alias","Plain Text"),"text"],mimetypes:[ol.text]});Ca.as(bv.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class Jcr{constructor(e,t){this.languageId=e;const i=t.brackets?L8e(t.brackets):[],r=new Z6e(a=>{const l=new Set;return{info:new eur(this,a,l),closing:l}}),s=new Z6e(a=>{const l=new Set,c=new Set;return{info:new tur(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=r.get(a),u=s.get(l);c.closing.add(u.info),u.opening.add(c.info)}const o=t.colorizedBracketPairs?L8e(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of o){const c=r.get(a),u=s.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([...s.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)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return Y9(t,e)}}function L8e(n){return n.filter(([e,t])=>e!==""&&t!=="")}class Sat{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class eur extends Sat{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class tur extends Sat{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 nur=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},A8e=function(n,e){return function(t,i){e(t,i,n)}};class Nce{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const wa=Ur("languageConfigurationService");let Ume=class extends Ye{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new our),this.onDidChangeEmitter=this._register(new Ue),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(qme));this._register(this.configurationService.onDidChangeConfiguration(r=>{const s=r.change.keys.some(a=>i.has(a)),o=r.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(s)this.configurations.clear(),this.onDidChangeEmitter.fire(new Nce(void 0));else for(const a of o)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new Nce(a)))})),this._register(this._registry.onDidChange(r=>{this.configurations.delete(r.languageId),this.onDidChangeEmitter.fire(new Nce(r.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=iur(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Ume=nur([A8e(0,Dr),A8e(1,pa)],Ume);function iur(n,e,t,i){let r=e.getLanguageConfiguration(n);if(!r){if(!i.isRegisteredLanguageId(n))return new PP(n,{});r=new PP(n,{})}const s=rur(r.languageId,t),o=kat([r.underlyingConfig,s]);return new PP(r.languageId,o)}const qme={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function rur(n,e){const t=e.getValue(qme.brackets,{overrideIdentifier:n}),i=e.getValue(qme.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:N8e(t),colorizedBracketPairs:N8e(i)}}function N8e(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 Eat(n,e,t){const i=n.getLineContent(e);let r=_o(i);return r.length>t-1&&(r=r.substring(0,t-1)),r}class sur{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new D8e(e,t,++this._order);return this._entries.push(i),this._resolved=null,gi(()=>{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 PP(this.languageId,e))}return this._resolved}_resolve(){return this._entries.length===0?null:(this._entries.sort(D8e.cmp),kat(this._entries.map(e=>e.configuration)))}}function kat(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 D8e{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 R8e{constructor(e){this.languageId=e}}class our extends Ye{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new Ue),this.onDidChange=this._onDidChange.event,this._register(this.register(Ih,{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 sur(e),this._entries.set(e,r));const s=r.register(t,i);return this._onDidChange.fire(new R8e(e)),gi(()=>{s.dispose(),this._onDidChange.fire(new R8e(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class PP{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 AR(this.underlyingConfig):null,this.comments=PP._handleComments(this.underlyingConfig),this.characterPair=new Wme(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||ske,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new $cr(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Jcr(e,this.underlyingConfig)}getWordDefinition(){return oke(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Rcr(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Bcr(this.brackets)),this._electricCharacter}onEnter(e,t,i,r){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,r):null}getAutoClosingPairs(){return new Ecr(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,s]=t.blockComment;i.blockCommentStartToken=r,i.blockCommentEndToken=s}return i}}ns(wa,Ume,1);class nS{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}}class P8e{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 aur(n,e,t){return new my(new P8e(n),new P8e(e)).ComputeDiff(t).changes}class AD{static Assert(e,t){if(!e)throw new Error(t)}}class ND{static Copy(e,t,i,r,s){for(let o=0;o<s;o++)i[r+o]=e[t+o]}static Copy2(e,t,i,r,s){for(let o=0;o<s;o++)i[r+o]=e[t+o]}}class O8e{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 nS(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 my{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[r,s,o]=my._getElements(e),[a,l,c]=my._getElements(t);this._hasStrings=o&&c,this._originalStringElements=r,this._originalElementsOrHash=s,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(my._isStringArray(t)){const i=new Int32Array(t.length);for(let r=0,s=t.length;r<s;r++)i[r]=xke(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=my._getStrictElement(this._originalSequence,e),r=my._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,s){const o=[!1];let a=this.ComputeDiffRecursive(e,t,i,r,o);return s&&(a=this.PrettifyChanges(a)),{quitEarly:o[0],changes:a}}ComputeDiffRecursive(e,t,i,r,s){for(s[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?(AD.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new nS(e,0,i,r-i+1)]):e<=t?(AD.Assert(i===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[new nS(e,t-e+1,i,0)]):(AD.Assert(e===t+1,"originalStart should only be one more than originalEnd"),AD.Assert(i===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[]),d}const o=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,r,o,a,s),c=o[0],u=a[0];if(l!==null)return l;if(!s[0]){const d=this.ComputeDiffRecursive(e,c,i,u,s);let f=[];return s[0]?f=[new nS(c+1,t-(c+1)+1,u+1,r-(u+1)+1)]:f=this.ComputeDiffRecursive(c+1,t,u+1,r,s),this.ConcatenateChanges(d,f)}return[new nS(e,t-e+1,i,r-i+1)]}WALKTRACE(e,t,i,r,s,o,a,l,c,u,d,f,p,g,m,_,v,b){let y=null,C=null,S=new O8e,k=t,I=i,L=p[0]-_[0]-r,N=-1073741824,P=this.m_forwardHistory.length-1;do{const O=L+e;O===k||O<I&&c[O-1]<c[O+1]?(d=c[O+1],g=d-L-r,d<N&&S.MarkNextChange(),N=d,S.AddModifiedElement(d+1,g),L=O+1-e):(d=c[O-1]+1,g=d-L-r,d<N&&S.MarkNextChange(),N=d-1,S.AddOriginalElement(d,g+1),L=O-1-e),P>=0&&(c=this.m_forwardHistory[P],e=c[0],k=1,I=c.length-1)}while(--P>=-1);if(y=S.getReverseChanges(),b[0]){let O=p[0]+1,F=_[0]+1;if(y!==null&&y.length>0){const V=y[y.length-1];O=Math.max(O,V.getOriginalEnd()),F=Math.max(F,V.getModifiedEnd())}C=[new nS(O,f-O+1,F,m-F+1)]}else{S=new O8e,k=o,I=a,L=p[0]-_[0]-l,N=1073741824,P=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const O=L+s;O===k||O<I&&u[O-1]>=u[O+1]?(d=u[O+1]-1,g=d-L-l,d>N&&S.MarkNextChange(),N=d+1,S.AddOriginalElement(d+1,g+1),L=O+1-s):(d=u[O-1],g=d-L-l,d>N&&S.MarkNextChange(),N=d,S.AddModifiedElement(d+1,g+1),L=O-1-s),P>=0&&(u=this.m_reverseHistory[P],s=u[0],k=1,I=u.length-1)}while(--P>=-1);C=S.getChanges()}return this.ConcatenateChanges(y,C)}ComputeRecursionPoint(e,t,i,r,s,o,a){let l=0,c=0,u=0,d=0,f=0,p=0;e--,i--,s[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(r-i),m=g+1,_=new Int32Array(m),v=new Int32Array(m),b=r-i,y=t-e,C=e-i,S=t-r,I=(y-b)%2===0;_[b]=e,v[y]=t,a[0]=!1;for(let L=1;L<=g/2+1;L++){let N=0,P=0;u=this.ClipDiagonalBound(b-L,L,b,m),d=this.ClipDiagonalBound(b+L,L,b,m);for(let F=u;F<=d;F+=2){F===u||F<d&&_[F-1]<_[F+1]?l=_[F+1]:l=_[F-1]+1,c=l-(F-b)-C;const V=l;for(;l<t&&c<r&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(_[F]=l,l+c>N+P&&(N=l,P=c),!I&&Math.abs(F-y)<=L-1&&l>=v[F])return s[0]=l,o[0]=c,V<=v[F]&&L<=1448?this.WALKTRACE(b,u,d,C,y,f,p,S,_,v,l,t,s,c,r,o,I,a):null}const O=(N-e+(P-i)-L)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(N,O))return a[0]=!0,s[0]=N,o[0]=P,O>0&&L<=1448?this.WALKTRACE(b,u,d,C,y,f,p,S,_,v,l,t,s,c,r,o,I,a):(e++,i++,[new nS(e,t-e+1,i,r-i+1)]);f=this.ClipDiagonalBound(y-L,L,y,m),p=this.ClipDiagonalBound(y+L,L,y,m);for(let F=f;F<=p;F+=2){F===f||F<p&&v[F-1]>=v[F+1]?l=v[F+1]-1:l=v[F-1],c=l-(F-y)-S;const V=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(v[F]=l,I&&Math.abs(F-b)<=L&&l<=_[F])return s[0]=l,o[0]=c,V>=_[F]&&L<=1448?this.WALKTRACE(b,u,d,C,y,f,p,S,_,v,l,t,s,c,r,o,I,a):null}if(L<=1447){let F=new Int32Array(d-u+2);F[0]=b-u+1,ND.Copy2(_,u,F,1,d-u+1),this.m_forwardHistory.push(F),F=new Int32Array(p-f+2),F[0]=y-f+1,ND.Copy2(v,f,F,1,p-f+1),this.m_reverseHistory.push(F)}}return this.WALKTRACE(b,u,d,C,y,f,p,S,_,v,l,t,s,c,r,o,I,a)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],r=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,s=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,o=i.originalLength>0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength<r&&i.modifiedStart+i.modifiedLength<s&&(!o||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,s=0;if(t>0){const d=e[t-1];r=d.originalStart+d.originalLength,s=d.modifiedStart+d.modifiedLength}const o=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 f=i.originalStart-d,p=i.modifiedStart-d;if(f<r||p<s||o&&!this.OriginalElementsAreEqual(f,f+i.originalLength)||a&&!this.ModifiedElementsAreEqual(p,p+i.modifiedLength))break;const m=(f===r&&p===s?5:0)+this._boundaryScore(f,i.originalLength,p,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],s=e[t],o=s.originalStart-r.originalStart-r.originalLength,a=r.originalStart,l=s.originalStart+s.originalLength,c=l-a,u=r.modifiedStart,d=s.modifiedStart+s.modifiedLength,f=d-u;if(o<5&&c<20&&f<20){const p=this._findBetterContiguousSequence(a,c,u,f,o);if(p){const[g,m]=p;(g!==r.originalStart+r.originalLength||m!==r.modifiedStart+r.modifiedLength)&&(r.originalLength=g-r.originalStart,r.modifiedLength=m-r.modifiedStart,s.originalStart=g+o,s.modifiedStart=m+o,s.originalLength=l-s.originalStart,s.modifiedLength=d-s.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,r,s){if(t<s||r<s)return null;const o=e+t-s+1,a=i+r-s+1;let l=0,c=0,u=0;for(let d=e;d<o;d++)for(let f=i;f<a;f++){const p=this._contiguousSequenceScore(d,f,s);p>0&&p>l&&(l=p,c=d,u=f)}return l>0?[c,u]:null}_contiguousSequenceScore(e,t,i){let r=0;for(let s=0;s<i;s++){if(!this.ElementsAreEqual(e+s,t+s))return 0;r+=this._originalStringElements[e+s].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 s=this._OriginalRegionIsBoundary(e,t)?1:0,o=this._ModifiedRegionIsBoundary(i,r)?1:0;return s+o}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 ND.Copy(e,0,r,0,e.length-1),r[e.length-1]=i[0],ND.Copy(t,1,r,e.length,t.length-1),r}else{const r=new Array(e.length+t.length);return ND.Copy(e,0,r,0,e.length),ND.Copy(t,0,r,e.length,t.length),r}}ChangesOverlap(e,t,i){if(AD.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),AD.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 s=e.originalLength;const o=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new nS(r,s,o,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,r){if(e>=0&&e<r)return e;const s=i,o=r-i-1,a=t%2===0;if(e<0){const l=s%2===0;return a===l?0:1}else{const l=o%2===0;return a===l?r-1:r-2}}}function QK(n){return n<0?0:n>255?255:n|0}function DD(n){return n<0?0:n>4294967295?4294967295:n|0}class U4{constructor(e){const t=QK(e);this._defaultValue=t,this._asciiMap=U4._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=QK(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 XK{constructor(){this._actual=new U4(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class lur{constructor(e,t,i){const r=new Uint8Array(e*t);for(let s=0,o=e*t;s<o;s++)r[s]=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 cur{constructor(e){let t=0,i=0;for(let s=0,o=e.length;s<o;s++){const[a,l,c]=e[s];l>t&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const r=new lur(i,t,0);for(let s=0,o=e.length;s<o;s++){const[a,l,c]=e[s];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 Dce=null;function uur(){return Dce===null&&(Dce=new cur([[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]])),Dce}let hj=null;function dur(){if(hj===null){hj=new U4(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;t<n.length;t++)hj.set(n.charCodeAt(t),1);const e=".,;:";for(let t=0;t<e.length;t++)hj.set(e.charCodeAt(t),2)}return hj}class ZK{static _createLink(e,t,i,r,s){let o=s-1;do{const a=t.charCodeAt(o);if(e.get(a)!==2)break;o--}while(o>r);if(r>0){const a=t.charCodeAt(r-1),l=t.charCodeAt(o);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&o--}return{range:{startLineNumber:i,startColumn:r+1,endLineNumber:i,endColumn:o+2},url:t.substring(r,o+1)}}static computeLinks(e,t=uur()){const i=dur(),r=[];for(let s=1,o=e.getLineCount();s<=o;s++){const a=e.getLineContent(s),l=a.length;let c=0,u=0,d=0,f=1,p=!1,g=!1,m=!1,_=!1;for(;c<l;){let v=!1;const b=a.charCodeAt(c);if(f===13){let y;switch(b){case 40:p=!0,y=0;break;case 41:y=p?0:1;break;case 91:m=!0,g=!0,y=0;break;case 93:m=!1,y=g?0:1;break;case 123:_=!0,y=0;break;case 125:y=_?0:1;break;case 39:case 34:case 96:d===b?y=1:d===39||d===34||d===96?y=0:y=1;break;case 42:y=d===42?1:0;break;case 124:y=d===124?1:0;break;case 32:y=m?0:1;break;default:y=i.get(b)}y===1&&(r.push(ZK._createLink(i,a,s,u,c)),v=!0)}else if(f===12){let y;b===91?(g=!0,y=0):y=i.get(b),y===1?v=!0:f=13}else f=t.nextState(f,b),f===0&&(v=!0);v&&(f=1,p=!1,g=!1,_=!1,u=c+1,d=b),c++}f===13&&r.push(ZK._createLink(i,a,s,u,l))}return r}}function hur(n){return!n||typeof n.getLineCount!="function"||typeof n.getLineContent!="function"?[]:ZK.computeLinks(n)}const OQ=class OQ{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,r,s){if(e&&t){const o=this.doNavigateValueSet(t,s);if(o)return{range:e,value:o}}if(i&&r){const o=this.doNavigateValueSet(r,s);if(o)return{range:i,value:o}}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 s=parseFloat(e);return!isNaN(r)&&!isNaN(s)&&r===s?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 s=0,o=e.length;r===null&&s<o;s++)r=this.valueSetReplace(e[s],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}};OQ.INSTANCE=new OQ;let Kme=OQ;const F6=class F6{static getChannel(e){return e.getChannel(F6.CHANNEL_NAME)}static setChannel(e,t){e.setChannel(F6.CHANNEL_NAME,t)}};F6.CHANNEL_NAME="editorWorkerHost";let Gme=F6;var M8e,j8e;class fur{constructor(e,t){this.uri=e,this.value=t}}function pur(n){return Array.isArray(n)}const D2=class D2{constructor(e,t){if(this[M8e]="ResourceMap",e instanceof D2)this.map=new Map(e.map),this.toKey=t??D2.defaultToKey;else if(pur(e)){this.map=new Map,this.toKey=t??D2.defaultToKey;for(const[i,r]of e)this.set(i,r)}else this.map=new Map,this.toKey=e??D2.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new fur(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))==null?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]}*[(M8e=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}};D2.defaultToKey=e=>e.toString();let Yc=D2;class gur{constructor(){this[j8e]="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?void 0:e.value}get last(){var e;return(e=this._tail)==null?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 s={value:i.key,done:!1};return i=i.next,s}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 s={value:i.value,done:!1};return i=i.next,s}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 s={value:[i.key,i.value],done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return r}[(j8e=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++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.previous,i--;this._tail=t,this._size=i,t&&(t.next=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 mur extends gur{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.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}class b1 extends mur{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}}class _ur{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 Rke{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 vur extends U4{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,r=e.length;i<r;i++)this.set(e.charCodeAt(i),2);this.set(32,1),this.set(9,1)}findPrevIntlWordBeforeOrAtOffset(e,t){let i=null;for(const r of this._getIntlSegmenterWordsOnLine(e)){if(r.index>t)break;i=r}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index<t))return i;return null}_getIntlSegmenterWordsOnLine(e){return this._segmenter?this._cachedLine===e?this._cachedSegments:(this._cachedLine=e,this._cachedSegments=this._filterWordSegments(this._segmenter.segment(e)),this._cachedSegments):[]}_filterWordSegments(e){const t=[];for(const i of e)this._isWordLike(i)&&t.push(i);return t}_isWordLike(e){return!!e.isWordLike}}const F8e=new b1(10);function Om(n,e){const t=`${n}/${e.join(",")}`;let i=F8e.get(t);return i||(i=new vur(n,e),F8e.set(t,i)),i}var ug;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(ug||(ug={}));var ov;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=3]="Right"})(ov||(ov={}));var $_;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})($_||($_={}));class iU{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&&Xf(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 d7{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function bur(n){return n&&typeof n.read=="function"}class Rce{constructor(e,t,i,r,s,o){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=r,this.isAutoWhitespaceEdit=s,this._isTracked=o}}class yur{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class Cur{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function Tat(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const wur=999;class r2{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=xur(this.searchString):e=this.searchString.indexOf(` `)>=0;let t=null;try{t=Eot(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 yur(t,this.wordSeparators?Om(this.wordSeparators,[]):null,i?this.searchString:null)}}function xur(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 v2(n,e,t){if(!t)return new d7(n,null);const i=[];for(let r=0,s=e.length;r<s;r++)i[r]=e[r];return new d7(n,i)}class B8e{constructor(e){const t=[];let i=0;for(let r=0,s=e.length;r<s;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 s=i+((r-i)/2>>0);t[s]>=e?r=s-1:t[s+1]>=e?(i=s,r=s):i=s+1}return i+1}}class eW{static findMatches(e,t,i,r,s){const o=t.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(e,i,new NR(o.wordSeparators,o.regex),r,s):this._doFindMatchesLineByLine(e,i,o,r,s):[]}static _getMultilineMatchRange(e,t,i,r,s,o){let a,l=0;r?(l=r.findLineFeedCountBeforeOffset(s),a=t+s+l):a=t+s;let c;if(r){const p=r.findLineFeedCountBeforeOffset(s+o.length)-l;c=a+o.length+p}else c=a+o.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new ie(u.lineNumber,u.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,r,s){const o=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r `?new B8e(a):null,c=[];let u=0,d;for(i.reset(0);d=i.next(a);)if(c[u++]=v2(this._getMultilineMatchRange(e,o,a,l,d.index,d[0]),d,r),u>=s)return c;return c}static _doFindMatchesLineByLine(e,t,i,r,s){const o=[];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,o,r,s),o}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,o,r,s);for(let c=t.startLineNumber+1;c<t.endLineNumber&&a<s;c++)a=this._findMatchesInLine(i,e.getLineContent(c),c,0,a,o,r,s);if(a<s){const c=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,c,t.endLineNumber,0,a,o,r,s)}return o}static _findMatchesInLine(e,t,i,r,s,o,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const f=e.simpleSearch,p=f.length,g=t.length;let m=-p;for(;(m=t.indexOf(f,m+p))!==-1;)if((!c||Pke(c,t,g,m,p))&&(o[s++]=new d7(new ie(i,m+1+r,i,m+1+p+r),null),s>=l))return s;return s}const u=new NR(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(o[s++]=v2(new ie(i,d.index+1+r,i,d.index+1+d[0].length+r),d,a),s>=l))return s;while(d);return s}static findNextMatch(e,t,i,r){const s=t.parseSearchRequest();if(!s)return null;const o=new NR(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,o,r):this._doFindNextMatchLineByLine(e,i,o,r)}static _doFindNextMatchMultiline(e,t,i,r){const s=new We(t.lineNumber,1),o=e.getOffsetAt(s),a=e.getLineCount(),l=e.getValueInRange(new ie(s.lineNumber,s.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r `?new B8e(l):null;i.reset(t.column-1);const u=i.next(l);return u?v2(this._getMultilineMatchRange(e,o,l,c,u.index,u[0]),u,r):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new We(1,1),i,r):null}static _doFindNextMatchLineByLine(e,t,i,r){const s=e.getLineCount(),o=t.lineNumber,a=e.getLineContent(o),l=this._findFirstMatchInLine(i,a,o,t.column,r);if(l)return l;for(let c=1;c<=s;c++){const u=(o+c-1)%s,d=e.getLineContent(u+1),f=this._findFirstMatchInLine(i,d,u+1,1,r);if(f)return f}return null}static _findFirstMatchInLine(e,t,i,r,s){e.reset(r-1);const o=e.next(t);return o?v2(new ie(i,o.index+1,i,o.index+1+o[0].length),o,s):null}static findPreviousMatch(e,t,i,r){const s=t.parseSearchRequest();if(!s)return null;const o=new NR(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,o,r):this._doFindPreviousMatchLineByLine(e,i,o,r)}static _doFindPreviousMatchMultiline(e,t,i,r){const s=this._doFindMatchesMultiline(e,new ie(1,1,t.lineNumber,t.column),i,r,10*wur);if(s.length>0)return s[s.length-1];const o=e.getLineCount();return t.lineNumber!==o||t.column!==e.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(e,new We(o,e.getLineMaxColumn(o)),i,r):null}static _doFindPreviousMatchLineByLine(e,t,i,r){const s=e.getLineCount(),o=t.lineNumber,a=e.getLineContent(o).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,o,r);if(l)return l;for(let c=1;c<=s;c++){const u=(s+o-c-1)%s,d=e.getLineContent(u+1),f=this._findLastMatchInLine(i,d,u+1,r);if(f)return f}return null}static _findLastMatchInLine(e,t,i,r){let s=null,o;for(e.reset(0);o=e.next(t);)s=v2(new ie(i,o.index+1,i,o.index+1+o[0].length),o,r);return s}}function Sur(n,e,t,i,r){if(i===0)return!0;const s=e.charCodeAt(i-1);if(n.get(s)!==0||s===13||s===10)return!0;if(r>0){const o=e.charCodeAt(i);if(n.get(o)!==0)return!0}return!1}function Eur(n,e,t,i,r){if(i+r===t)return!0;const s=e.charCodeAt(i+r);if(n.get(s)!==0||s===13||s===10)return!0;if(r>0){const o=e.charCodeAt(i+r-1);if(n.get(o)!==0)return!0}return!1}function Pke(n,e,t,i,r){return Sur(n,e,t,i,r)&&Eur(n,e,t,i,r)}class NR{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,s=i[0].length;if(r===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){BK(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=s,!this._wordSeparators||Pke(this._wordSeparators,e,t,r,s))return i}while(i);return null}}class Oke{static computeUnicodeHighlights(e,t,i){const r=i?i.startLineNumber:1,s=i?i.endLineNumber:e.getLineCount(),o=new $8e(t),a=o.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${kur(Array.from(a))}`,"g");const c=new NR(null,l),u=[];let d=!1,f,p=0,g=0,m=0;e:for(let _=r,v=s;_<=v;_++){const b=e.getLineContent(_),y=b.length;c.reset(0);do if(f=c.next(b),f){let C=f.index,S=f.index+f[0].length;if(C>0){const N=b.charCodeAt(C-1);Ec(N)&&C--}if(S+1<y){const N=b.charCodeAt(S-1);Ec(N)&&S++}const k=b.substring(C,S);let I=e7(C+1,ske,b,0);I&&I.endColumn<=C+1&&(I=null);const L=o.shouldHighlightNonBasicASCII(k,I?I.word:null);if(L!==0){if(L===3?p++:L===2?g++:L===1?m++:cte(),u.length>=1e3){d=!0;break e}u.push(new ie(_,C+1,_,S+1))}}while(f)}return{ranges:u,hasMore:d,ambiguousCharacterCount:p,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new $8e(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const s=e.codePointAt(0),o=i.ambiguousCharacters.getPrimaryConfusable(s),a=a7.getLocales().filter(l=>!a7.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(s));return{kind:0,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function kur(n,e){return`[${mg(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class $8e{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=a7.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of lI.codePoints)H8e(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,s=!1;if(t)for(const o of t){const a=o.codePointAt(0),l=U9(o);r=r||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!lI.isInvisibleCharacter(a)&&(s=!0)}return!r&&s?0:this.options.invisibleCharacters&&!H8e(e)&&lI.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function H8e(n){return n===" "||n===` `||n===" "}class rU{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class Iat{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Pr{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 s=Math.min(e.start,t[i].start),o=Math.max(e.endExclusive,t[r-1].endExclusive);t.splice(i,r-i,new Pr(s,o))}}static tryCreate(e,t){if(!(e>t))return new Pr(e,t)}static ofLength(e){return new Pr(0,e)}static ofStartAndLength(e,t){return new Pr(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Ps(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Pr(this.start+e,this.endExclusive+e)}deltaStart(e){return new Pr(this.start+e,this.endExclusive)}deltaEnd(e){return new Pr(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new Pr(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 Pr(t,i)}intersects(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return t<i}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Ps(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Ps(`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 Mke{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),s=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new Pr(r,s))}}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 Mke;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 h7(n,e){const t=Tur(n,e);if(t!==-1)return n[t]}function Tur(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 lM(n,e){const t=f7(n,e);return t===-1?void 0:n[t]}function f7(n,e,t=0,i=n.length){let r=t,s=i;for(;r<s;){const o=Math.floor((r+s)/2);e(n[o])?r=o+1:s=o}return r-1}function Iur(n,e){const t=p7(n,e);return t===n.length?void 0:n[t]}function p7(n,e,t=0,i=n.length){let r=t,s=i;for(;r<s;){const o=Math.floor((r+s)/2);e(n[o])?s=o:r=o+1}return r}const MQ=class MQ{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(MQ.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=f7(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,t===-1?void 0:this._array[t]}};MQ.assertInvariants=!1;let JK=MQ;function jke(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 Lur(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 Aur(n,e){return jke(n,(t,i)=>-e(t,i))}function Nur(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 Dur(n,e){for(const t of n){const i=e(t);if(i!==void 0)return i}}let fr=class uC{static fromRangeInclusive(e){return new uC(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new um(e[0].slice());for(let i=1;i<e.length;i++)t=t.getUnion(new um(e[i].slice()));return t.ranges}static join(e){if(e.length===0)throw new Ps("lineRanges cannot be empty");let t=e[0].startLineNumber,i=e[0].endLineNumberExclusive;for(let r=1;r<e.length;r++)t=Math.min(t,e[r].startLineNumber),i=Math.max(i,e[r].endLineNumberExclusive);return new uC(t,i)}static ofLength(e,t){return new uC(e,e+t)}static deserialize(e){return new uC(e[0],e[1])}constructor(e,t){if(e>t)throw new Ps(`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 uC(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new uC(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new uC(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 uC(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 ie(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new ie(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 Pr(this.startLineNumber-1,this.endLineNumberExclusive-1)}};class um{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(e.length===0)return;const t=p7(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=f7(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=lM(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=lM(this._normalizedRanges,i=>i.startLineNumber<e.endLineNumberExclusive);return!!t&&t.endLineNumberExclusive>e.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,r=0,s=null;for(;i<this._normalizedRanges.length||r<e._normalizedRanges.length;){let o=null;if(i<this._normalizedRanges.length&&r<e._normalizedRanges.length){const a=this._normalizedRanges[i],l=e._normalizedRanges[r];a.startLineNumber<l.startLineNumber?(o=a,i++):(o=l,r++)}else i<this._normalizedRanges.length?(o=this._normalizedRanges[i],i++):(o=e._normalizedRanges[r],r++);s===null?s=o:s.endLineNumberExclusive>=o.startLineNumber?s=new fr(s.startLineNumber,Math.max(s.endLineNumberExclusive,o.endLineNumberExclusive)):(t.push(s),s=o)}return s!==null&&t.push(s),new um(t)}subtractFrom(e){const t=p7(this._normalizedRanges,o=>o.endLineNumberExclusive>=e.startLineNumber),i=f7(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new um([e]);const r=[];let s=e.startLineNumber;for(let o=t;o<i;o++){const a=this._normalizedRanges[o];a.startLineNumber>s&&r.push(new fr(s,a.startLineNumber)),s=a.endLineNumberExclusive}return s<e.endLineNumberExclusive&&r.push(new fr(s,e.endLineNumberExclusive)),new um(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 s=this._normalizedRanges[i],o=e._normalizedRanges[r],a=s.intersect(o);a&&!a.isEmpty&&t.push(a),s.endLineNumberExclusive<o.endLineNumberExclusive?i++:r++}return new um(t)}getWithDelta(e){return new um(this._normalizedRanges.map(t=>t.delta(e)))}}const uS=class uS{static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new uS(0,t.column-e.column):new uS(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return uS.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const r of e)r===` `?(t++,i=0):i++;return new uS(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}createRange(e){return this.lineCount===0?new ie(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new ie(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new We(e.lineNumber,e.column+this.columnCount):new We(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};uS.zero=new uS(0,0);let av=uS;class Rur{constructor(e){this.text=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}getOffsetRange(e){return new Pr(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new av(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}class Fke{constructor(e){this.edits=e,VL(()=>Ake(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}apply(e){let t="",i=new We(1,1);for(const s of this.edits){const o=s.range,a=o.getStartPosition(),l=o.getEndPosition(),c=V8e(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=s.text,i=l}const r=V8e(i,e.endPositionExclusive);return r.isEmpty()||(t+=e.getValueOfRange(r)),t}applyToString(e){const t=new Pur(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,r=0;for(const s of this.edits){const o=av.ofText(s.text),a=We.lift({lineNumber:s.range.startLineNumber+i,column:s.range.startColumn+(s.range.startLineNumber===t?r:0)}),l=o.createRange(a);e.push(l),i=l.endLineNumber-s.range.endLineNumber,r=l.endColumn-s.range.endColumn,t=s.range.endLineNumber}return e}}class Gy{constructor(e,t){this.range=e,this.text=t}toSingleEditOperation(){return{range:this.range,text:this.text}}}function V8e(n,e){if(n.lineNumber===e.lineNumber&&n.column===Number.MAX_SAFE_INTEGER)return ie.fromPositions(e,e);if(!n.isBeforeOrEqual(e))throw new Ps("start must be before end");return new ie(n.lineNumber,n.column,e.lineNumber,e.column)}class Lat{get endPositionExclusive(){return this.length.addToPosition(new We(1,1))}}class Pur extends Lat{constructor(e){super(),this.value=e,this._t=new Rur(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}class Ud{static inverse(e,t,i){const r=[];let s=1,o=1;for(const l of e){const c=new Ud(new fr(s,l.original.startLineNumber),new fr(o,l.modified.startLineNumber));c.modified.isEmpty||r.push(c),s=l.original.endLineNumberExclusive,o=l.modified.endLineNumberExclusive}const a=new Ud(new fr(s,t+1),new fr(o,i+1));return a.modified.isEmpty||r.push(a),r}static clip(e,t,i){const r=[];for(const s of e){const o=s.original.intersect(t),a=s.modified.intersect(i);o&&!o.isEmpty&&a&&!a.isEmpty&&r.push(new Ud(o,a))}return r}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Ud(this.modified,this.original)}join(e){return new Ud(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new zp(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ps("not a valid diff");return new zp(new ie(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new ie(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new zp(new ie(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new ie(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(W8e(this.original.endLineNumberExclusive,e)&&W8e(this.modified.endLineNumberExclusive,t))return new zp(new ie(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new ie(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new zp(ie.fromPositions(new We(this.original.startLineNumber,1),RD(new We(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),ie.fromPositions(new We(this.modified.startLineNumber,1),RD(new We(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new zp(ie.fromPositions(RD(new We(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),RD(new We(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),ie.fromPositions(RD(new We(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),RD(new We(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new Ps}}function RD(n,e){if(n.lineNumber<1)return new We(1,1);if(n.lineNumber>e.length)return new We(e.length,e[e.length-1].length+1);const t=e[n.lineNumber-1];return n.column>t.length+1?new We(n.lineNumber,t.length+1):n}function W8e(n,e){return n>=1&&n<=e.length}class dg extends Ud{static fromRangeMappings(e){const t=fr.join(e.map(r=>fr.fromRangeInclusive(r.originalRange))),i=fr.join(e.map(r=>fr.fromRangeInclusive(r.modifiedRange)));return new dg(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new dg(this.modified,this.original,(e=this.innerChanges)==null?void 0:e.map(t=>t.flip()))}withInnerChangesFromLineRanges(){return new dg(this.original,this.modified,[this.toRangeMapping()])}}class zp{static assertSorted(e){for(let t=1;t<e.length;t++){const i=e[t-1],r=e[t];if(!(i.originalRange.getEndPosition().isBeforeOrEqual(r.originalRange.getStartPosition())&&i.modifiedRange.getEndPosition().isBeforeOrEqual(r.modifiedRange.getStartPosition())))throw new Ps("Range mappings must be sorted")}}constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new zp(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new Gy(this.originalRange,t)}}const Our=3;class Mur{computeDiff(e,t,i){var l;const s=new Bur(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),o=[];let a=null;for(const c of s.changes){let u;c.originalEndLineNumber===0?u=new fr(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new fr(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new fr(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new fr(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let f=new dg(u,d,(l=c.charChanges)==null?void 0:l.map(p=>new zp(new ie(p.originalStartLineNumber,p.originalStartColumn,p.originalEndLineNumber,p.originalEndColumn),new ie(p.modifiedStartLineNumber,p.modifiedStartColumn,p.modifiedEndLineNumber,p.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===f.modified.startLineNumber||a.original.endLineNumberExclusive===f.original.startLineNumber)&&(f=new dg(a.original.join(f.original),a.modified.join(f.modified),a.innerChanges&&f.innerChanges?a.innerChanges.concat(f.innerChanges):void 0),o.pop()),o.push(f),a=f}return VL(()=>Ake(o,(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 rU(o,[],s.quitEarly)}}function Aat(n,e,t,i){return new my(n,e,t).ComputeDiff(i)}let z8e=class{constructor(e){const t=[],i=[];for(let r=0,s=e.length;r<s;r++)t[r]=Yme(e[r],1),i[r]=Qme(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=[],s=[],o=[];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 f=u;f<d;f++)r[a]=c.charCodeAt(f-1),s[a]=l+1,o[a]=f,a++;!e&&l<i&&(r[a]=10,s[a]=l+1,o[a]=c.length+1,a++)}return new jur(r,s,o)}};class jur{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 OP{constructor(e,t,i,r,s,o,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=r,this.modifiedStartLineNumber=s,this.modifiedStartColumn=o,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const r=t.getStartLineNumber(e.originalStart),s=t.getStartColumn(e.originalStart),o=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 OP(r,s,o,a,l,c,u,d)}}function Fur(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 s=n[i],o=s.originalStart-(t.originalStart+t.originalLength),a=s.modifiedStart-(t.modifiedStart+t.modifiedLength);Math.min(o,a)<Our?(t.originalLength=s.originalStart+s.originalLength-t.originalStart,t.modifiedLength=s.modifiedStart+s.modifiedLength-t.modifiedStart):(e.push(s),t=s)}return e}class JF{constructor(e,t,i,r,s){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=r,this.charChanges=s}static createFromDiffResult(e,t,i,r,s,o,a){let l,c,u,d,f;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)),o&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&s()){const p=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(p.getElements().length>0&&g.getElements().length>0){let m=Aat(p,g,s,!0).changes;a&&(m=Fur(m)),f=[];for(let _=0,v=m.length;_<v;_++)f.push(OP.createFromDiffChange(m[_],p,g))}}return new JF(l,c,u,d,f)}}class Bur{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 z8e(e),this.modified=new z8e(t),this.continueLineDiff=U8e(i.maxComputationTime),this.continueCharDiff=U8e(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=Aat(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(JF.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[l],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:a}}const r=[];let s=0,o=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(;s<u&&o<d;){const f=this.originalLines[s],p=this.modifiedLines[o];if(f!==p){{let g=Yme(f,1),m=Yme(p,1);for(;g>1&&m>1;){const _=f.charCodeAt(g-2),v=p.charCodeAt(m-2);if(_!==v)break;g--,m--}(g>1||m>1)&&this._pushTrimWhitespaceCharChange(r,s+1,1,g,o+1,1,m)}{let g=Qme(f,1),m=Qme(p,1);const _=f.length+1,v=p.length+1;for(;g<_&&m<v;){const b=f.charCodeAt(g-1),y=f.charCodeAt(m-1);if(b!==y)break;g++,m++}(g<_||m<v)&&this._pushTrimWhitespaceCharChange(r,s+1,g,_,o+1,m,v)}}s++,o++}c&&(r.push(JF.createFromDiffResult(this.shouldIgnoreTrimWhitespace,c,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),s+=c.originalLength,o+=c.modifiedLength)}return{quitEarly:i,changes:r}}_pushTrimWhitespaceCharChange(e,t,i,r,s,o,a){if(this._mergeTrimWhitespaceCharChange(e,t,i,r,s,o,a))return;let l;this.shouldComputeCharChanges&&(l=[new OP(t,i,t,r,s,o,s,a)]),e.push(new JF(t,t,s,s,l))}_mergeTrimWhitespaceCharChange(e,t,i,r,s,o,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===s?(this.shouldComputeCharChanges&&c.charChanges&&c.charChanges.push(new OP(t,i,t,r,s,o,s,a)),!0):c.originalEndLineNumber+1===t&&c.modifiedEndLineNumber+1===s?(c.originalEndLineNumber=t,c.modifiedEndLineNumber=s,this.shouldComputeCharChanges&&c.charChanges&&c.charChanges.push(new OP(t,i,t,r,s,o,s,a)),!0):!1}}function Yme(n,e){const t=Yd(n);return t===-1?e:t+1}function Qme(n,e){const t=Lb(n);return t===-1?e:t+2}function U8e(n){if(n===0)return()=>!0;const e=Date.now();return()=>Date.now()-e<n}class dw{static trivial(e,t){return new dw([new Sc(Pr.ofLength(e.length),Pr.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new dw([new Sc(Pr.ofLength(e.length),Pr.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class Sc{static invert(e,t){const i=[];return Vst(e,(r,s)=>{i.push(Sc.fromOffsetPairs(r?r.getEndExclusives():qC.zero,s?s.getStarts():new qC(t,(r?r.seq2Range.endExclusive-r.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new Sc(new Pr(e.offset1,t.offset1),new Pr(e.offset2,t.offset2))}static assertSorted(e){let t;for(const i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new Ps("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Sc(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Sc(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Sc(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Sc(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Sc(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 Sc(t,i)}getStarts(){return new qC(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new qC(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const R2=class R2{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new R2(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};R2.zero=new R2(0,0),R2.max=new R2(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let qC=R2;const jQ=class jQ{isValid(){return!0}};jQ.instance=new jQ;let g7=jQ;class $ur{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Ps("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime<this.timeout)&&this.valid){this.valid=!1;debugger}return this.valid}}class Pce{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 Xme(n){return n===32||n===9}const B6=class B6{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 s=e.startLineNumber-1;s<e.endLineNumberExclusive-1;s++){const o=t[s];for(let l=0;l<o.length;l++){r++;const c=o[l],u=B6.getKey(c);this.histogram[u]=(this.histogram[u]||0)+1}r++;const a=B6.getKey(` `);this.histogram[a]=(this.histogram[a]||0)+1}this.totalCount=r}computeSimilarity(e){let t=0;const i=Math.max(this.histogram.length,e.histogram.length);for(let r=0;r<i;r++)t+=Math.abs((this.histogram[r]??0)-(e.histogram[r]??0));return 1-t/(this.totalCount+e.totalCount)}};B6.chrKeys=new Map;let eG=B6;class Hur{compute(e,t,i=g7.instance,r){if(e.length===0||t.length===0)return dw.trivial(e,t);const s=new Pce(e.length,t.length),o=new Pce(e.length,t.length),a=new Pce(e.length,t.length);for(let g=0;g<e.length;g++)for(let m=0;m<t.length;m++){if(!i.isValid())return dw.trivialTimedOut(e,t);const _=g===0?0:s.get(g-1,m),v=m===0?0:s.get(g,m-1);let b;e.getElement(g)===t.getElement(m)?(g===0||m===0?b=0:b=s.get(g-1,m-1),g>0&&m>0&&o.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),o.set(g,m,3)}else y===_?(a.set(g,m,0),o.set(g,m,1)):y===v&&(a.set(g,m,0),o.set(g,m,2));s.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 Sc(new Pr(g+1,c),new Pr(m+1,u))),c=g,u=m}let f=e.length-1,p=t.length-1;for(;f>=0&&p>=0;)o.get(f,p)===3?(d(f,p),f--,p--):o.get(f,p)===1?f--:p--;return d(-1,-1),l.reverse(),new dw(l,!1)}}class Nat{compute(e,t,i=g7.instance){if(e.length===0||t.length===0)return dw.trivial(e,t);const r=e,s=t;function o(m,_){for(;m<r.length&&_<s.length&&r.getElement(m)===s.getElement(_);)m++,_++;return m}let a=0;const l=new Vur;l.set(0,o(0,0));const c=new Wur;c.set(0,l.get(0)===0?null:new q8e(null,0,0,l.get(0)));let u=0;e:for(;;){if(a++,!i.isValid())return dw.trivialTimedOut(r,s);const m=-Math.min(a,s.length+a%2),_=Math.min(a,r.length+a%2);for(u=m;u<=_;u+=2){const v=u===_?-1:l.get(u+1),b=u===m?-1:l.get(u-1)+1,y=Math.min(Math.max(v,b),r.length),C=y-u;if(y>r.length||C>s.length)continue;const S=o(y,C);l.set(u,S);const k=y===v?c.get(u+1):c.get(u-1);if(c.set(u,S!==y?new q8e(k,y,C,S-y):k),l.get(u)===r.length&&l.get(u)-u===s.length)break e}}let d=c.get(u);const f=[];let p=r.length,g=s.length;for(;;){const m=d?d.x+d.length:0,_=d?d.y+d.length:0;if((m!==p||_!==g)&&f.push(new Sc(new Pr(m,p),new Pr(_,g))),!d)break;p=d.x,g=d.y,d=d.prev}return f.reverse(),new dw(f,!1)}}class q8e{constructor(e,t,i,r){this.prev=e,this.x=t,this.y=i,this.length=r}}class Vur{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 Wur{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}}class tG{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let r=this.range.startLineNumber;r<=this.range.endLineNumber;r++){let s=e[r-1],o=0;r===this.range.startLineNumber&&this.range.startColumn>1&&(o=this.range.startColumn-1,s=s.substring(o)),this.lineStartOffsets.push(o);let a=0;if(!i){const c=s.trimStart();a=s.length-c.length,s=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const l=r===this.range.endLineNumber?Math.min(this.range.endColumn-1-o-a,s.length):s.length;for(let c=0;c<l;c++)this.elements.push(s.charCodeAt(c));r<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new Pr(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=G8e(e>0?this.elements[e-1]:-1),i=G8e(e<this.elements.length?this.elements[e]:-1);if(t===7&&i===8)return 0;if(t===8)return 150;let r=0;return t!==i&&(r+=10,t===0&&i===1&&(r+=1)),r+=K8e(t),r+=K8e(i),r}translateOffset(e,t="right"){const i=f7(this.firstElementOffsetByLineIdx,s=>s<=e),r=e-this.firstElementOffsetByLineIdx[i];return new We(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+r+(r===0&&t==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?ie.fromPositions(i,i):ie.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!Oce(this.elements[e]))return;let t=e;for(;t>0&&Oce(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&Oce(this.elements[i]);)i++;return new Pr(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){const t=lM(this.firstElementOffsetByLineIdx,r=>r<=e.start)??0,i=Iur(this.firstElementOffsetByLineIdx,r=>e.endExclusive<=r)??this.elements.length;return new Pr(t,i)}}function Oce(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const zur={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function K8e(n){return zur[n]}function G8e(n){return n===10?8:n===13?7:Xme(n)?6:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:n===44||n===59?5:4}function Uur(n,e,t,i,r,s){let{moves:o,excludedChanges:a}=Kur(n,e,t,s);if(!s.isValid())return[];const l=n.filter(u=>!a.has(u)),c=Gur(l,i,r,e,t,s);return mge(o,c),o=Yur(o),o=o.filter(u=>{const d=u.original.toOffsetRange().slice(e).map(p=>p.trim());return d.join(` `).length>=15&&qur(d,p=>p.length>=2)>=2}),o=Qur(n,o),o}function qur(n,e){let t=0;for(const i of n)e(i)&&t++;return t}function Kur(n,e,t,i){const r=[],s=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new eG(l.original,e,l)),o=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new eG(l.modified,t,l))),a=new Set;for(const l of s){let c=-1,u;for(const d of o){const f=l.computeSimilarity(d);f>c&&(c=f,u=d)}if(c>.9&&u&&(o.delete(u),r.push(new Ud(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 Gur(n,e,t,i,r,s){const o=[],a=new Rke;for(const f of n)for(let p=f.original.startLineNumber;p<f.original.endLineNumberExclusive-2;p++){const g=`${e[p-1]}:${e[p+1-1]}:${e[p+2-1]}`;a.add(g,{range:new fr(p,p+3)})}const l=[];n.sort(kh(f=>f.modified.startLineNumber,z_));for(const f of n){let p=[];for(let g=f.modified.startLineNumber;g<f.modified.endLineNumberExclusive-2;g++){const m=`${t[g-1]}:${t[g+1-1]}:${t[g+2-1]}`,_=new fr(g,g+3),v=[];a.forEach(m,({range:b})=>{for(const C of p)if(C.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&C.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){C.originalLineRange=new fr(C.originalLineRange.startLineNumber,b.endLineNumberExclusive),C.modifiedLineRange=new fr(C.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(C);return}const y={modifiedLineRange:_,originalLineRange:b};l.push(y),v.push(y)}),p=v}if(!s.isValid())return[]}l.sort(Ust(kh(f=>f.modifiedLineRange.length,z_)));const c=new um,u=new um;for(const f of l){const p=f.modifiedLineRange.startLineNumber-f.originalLineRange.startLineNumber,g=c.subtractFrom(f.modifiedLineRange),m=u.subtractFrom(f.originalLineRange).getWithDelta(p),_=g.getIntersection(m);for(const v of _.ranges){if(v.length<3)continue;const b=v,y=v.delta(-p);o.push(new Ud(y,b)),c.addRange(b),u.addRange(y)}}o.sort(kh(f=>f.original.startLineNumber,z_));const d=new JK(n);for(let f=0;f<o.length;f++){const p=o[f],g=d.findLastMonotonous(k=>k.original.startLineNumber<=p.original.startLineNumber),m=lM(n,k=>k.modified.startLineNumber<=p.modified.startLineNumber),_=Math.max(p.original.startLineNumber-g.original.startLineNumber,p.modified.startLineNumber-m.modified.startLineNumber),v=d.findLastMonotonous(k=>k.original.startLineNumber<p.original.endLineNumberExclusive),b=lM(n,k=>k.modified.startLineNumber<p.modified.endLineNumberExclusive),y=Math.max(v.original.endLineNumberExclusive-p.original.endLineNumberExclusive,b.modified.endLineNumberExclusive-p.modified.endLineNumberExclusive);let C;for(C=0;C<_;C++){const k=p.original.startLineNumber-C-1,I=p.modified.startLineNumber-C-1;if(k>i.length||I>r.length||c.contains(I)||u.contains(k)||!Y8e(i[k-1],r[I-1],s))break}C>0&&(u.addRange(new fr(p.original.startLineNumber-C,p.original.startLineNumber)),c.addRange(new fr(p.modified.startLineNumber-C,p.modified.startLineNumber)));let S;for(S=0;S<y;S++){const k=p.original.endLineNumberExclusive+S,I=p.modified.endLineNumberExclusive+S;if(k>i.length||I>r.length||c.contains(I)||u.contains(k)||!Y8e(i[k-1],r[I-1],s))break}S>0&&(u.addRange(new fr(p.original.endLineNumberExclusive,p.original.endLineNumberExclusive+S)),c.addRange(new fr(p.modified.endLineNumberExclusive,p.modified.endLineNumberExclusive+S))),(C>0||S>0)&&(o[f]=new Ud(new fr(p.original.startLineNumber-C,p.original.endLineNumberExclusive+S),new fr(p.modified.startLineNumber-C,p.modified.endLineNumberExclusive+S)))}return o}function Y8e(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const r=new Nat().compute(new tG([n],new ie(1,1,1,n.length),!1),new tG([e],new ie(1,1,1,e.length),!1),t);let s=0;const o=Sc.invert(r.diffs,n.length);for(const u of o)u.seq1Range.forEach(d=>{Xme(n.charCodeAt(d))||s++});function a(u){let d=0;for(let f=0;f<n.length;f++)Xme(u.charCodeAt(f))||d++;return d}const l=a(n.length>e.length?n:e);return s/l>.6&&l>10}function Yur(n){if(n.length===0)return n;n.sort(kh(t=>t.original.startLineNumber,z_));const e=[n[0]];for(let t=1;t<n.length;t++){const i=e[e.length-1],r=n[t],s=r.original.startLineNumber-i.original.endLineNumberExclusive,o=r.modified.startLineNumber-i.modified.endLineNumberExclusive;if(s>=0&&o>=0&&s+o<=2){e[e.length-1]=i.join(r);continue}e.push(r)}return e}function Qur(n,e){const t=new JK(n);return e=e.filter(i=>{const r=t.findLastMonotonous(a=>a.original.startLineNumber<i.original.endLineNumberExclusive)||new Ud(new fr(1,1),new fr(1,1)),s=lM(n,a=>a.modified.startLineNumber<i.modified.endLineNumberExclusive);return r!==s}),e}function Zme(n,e,t){let i=t;return i=Q8e(n,e,i),i=Q8e(n,e,i),i=Xur(n,e,i),i}function Q8e(n,e,t){if(t.length===0)return t;const i=[];i.push(t[0]);for(let s=1;s<t.length;s++){const o=i[i.length-1];let a=t[s];if(a.seq1Range.isEmpty||a.seq2Range.isEmpty){const l=a.seq1Range.start-o.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 Sc(new Pr(o.seq1Range.start,a.seq1Range.endExclusive-l),new Pr(o.seq2Range.start,a.seq2Range.endExclusive-l));continue}a=a.delta(-c)}i.push(a)}const r=[];for(let s=0;s<i.length-1;s++){const o=i[s+1];let a=i[s];if(a.seq1Range.isEmpty||a.seq2Range.isEmpty){const l=o.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[s+1]=new Sc(new Pr(a.seq1Range.start+l,o.seq1Range.endExclusive),new Pr(a.seq2Range.start+l,o.seq2Range.endExclusive));continue}c>0&&(a=a.delta(c))}r.push(a)}return i.length>0&&r.push(i[i.length-1]),r}function Xur(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,s=t[i],o=i+1<t.length?t[i+1]:void 0,a=new Pr(r?r.seq1Range.endExclusive+1:0,o?o.seq1Range.start-1:n.length),l=new Pr(r?r.seq2Range.endExclusive+1:0,o?o.seq2Range.start-1:e.length);s.seq1Range.isEmpty?t[i]=X8e(s,n,e,a,l):s.seq2Range.isEmpty&&(t[i]=X8e(s.swap(),e,n,l,a).swap())}return t}function X8e(n,e,t,i,r){let o=1;for(;n.seq1Range.start-o>=i.start&&n.seq2Range.start-o>=r.start&&t.isStronglyEqual(n.seq2Range.start-o,n.seq2Range.endExclusive-o)&&o<100;)o++;o--;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(o===0&&a===0)return n;let l=0,c=-1;for(let u=-o;u<=a;u++){const d=n.seq2Range.start+u,f=n.seq2Range.endExclusive+u,p=n.seq1Range.start+u,g=e.getBoundaryScore(p)+t.getBoundaryScore(d)+t.getBoundaryScore(f);g>c&&(c=g,l=u)}return n.delta(l)}function Zur(n,e,t){const i=[];for(const r of t){const s=i[i.length-1];if(!s){i.push(r);continue}r.seq1Range.start-s.seq1Range.endExclusive<=2||r.seq2Range.start-s.seq2Range.endExclusive<=2?i[i.length-1]=new Sc(s.seq1Range.join(r.seq1Range),s.seq2Range.join(r.seq2Range)):i.push(r)}return i}function Jur(n,e,t){const i=Sc.invert(t,n.length),r=[];let s=new qC(0,0);function o(l,c){if(l.offset1<s.offset1||l.offset2<s.offset2)return;const u=n.findWordContaining(l.offset1),d=e.findWordContaining(l.offset2);if(!u||!d)return;let f=new Sc(u,d);const p=f.intersect(c);let g=p.seq1Range.length,m=p.seq2Range.length;for(;i.length>0;){const _=i[0];if(!(_.seq1Range.intersects(f.seq1Range)||_.seq2Range.intersects(f.seq2Range)))break;const b=n.findWordContaining(_.seq1Range.start),y=e.findWordContaining(_.seq2Range.start),C=new Sc(b,y),S=C.intersect(_);if(g+=S.seq1Range.length,m+=S.seq2Range.length,f=f.join(C),f.seq1Range.endExclusive>=_.seq1Range.endExclusive)i.shift();else break}g+m<(f.seq1Range.length+f.seq2Range.length)*2/3&&r.push(f),s=f.getEndExclusives()}for(;i.length>0;){const l=i.shift();l.seq1Range.isEmpty||(o(l.getStarts(),l),o(l.getEndExclusives().delta(-1),l))}return edr(t,r)}function edr(n,e){const t=[];for(;n.length>0||e.length>0;){const i=n[0],r=e[0];let s;i&&(!r||i.seq1Range.start<r.seq1Range.start)?s=n.shift():s=e.shift(),t.length>0&&t[t.length-1].seq1Range.endExclusive>=s.seq1Range.start?t[t.length-1]=t[t.length-1].join(s):t.push(s)}return t}function tdr(n,e,t){let i=t;if(i.length===0)return i;let r=0,s;do{s=!1;const o=[i[0]];for(let a=1;a<i.length;a++){let u=function(f,p){const g=new Pr(c.seq1Range.endExclusive,l.seq1Range.start);return n.getText(g).replace(/\s/g,"").length<=4&&(f.seq1Range.length+f.seq2Range.length>5||p.seq1Range.length+p.seq2Range.length>5)};const l=i[a],c=o[o.length-1];u(c,l)?(s=!0,o[o.length-1]=o[o.length-1].join(l)):o.push(l)}i=o}while(r++<10&&s);return i}function ndr(n,e,t){let i=t;if(i.length===0)return i;let r=0,s;do{s=!1;const a=[i[0]];for(let l=1;l<i.length;l++){let d=function(p,g){const m=new Pr(u.seq1Range.endExclusive,c.seq1Range.start);if(n.countLinesIn(m)>5||m.length>500)return!1;const v=n.getText(m).trim();if(v.length>20||v.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(p.seq1Range),y=p.seq1Range.length,C=e.countLinesIn(p.seq2Range),S=p.seq2Range.length,k=n.countLinesIn(g.seq1Range),I=g.seq1Range.length,L=e.countLinesIn(g.seq2Range),N=g.seq2Range.length,P=2*40+50;function O(F){return Math.min(F,P)}return Math.pow(Math.pow(O(b*40+y),1.5)+Math.pow(O(C*40+S),1.5),1.5)+Math.pow(Math.pow(O(k*40+I),1.5)+Math.pow(O(L*40+N),1.5),1.5)>(P**1.5)**1.5*1.3};const c=i[l],u=a[a.length-1];d(u,c)?(s=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(r++<10&&s);const o=[];return qrr(i,(a,l,c)=>{let u=l;function d(v){return v.length>0&&v.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const f=n.extendToFullLines(l.seq1Range),p=n.getText(new Pr(f.start,l.seq1Range.start));d(p)&&(u=u.deltaStart(-p.length));const g=n.getText(new Pr(l.seq1Range.endExclusive,f.endExclusive));d(g)&&(u=u.deltaEnd(g.length));const m=Sc.fromOffsetPairs(a?a.getEndExclusives():qC.zero,c?c.getStarts():qC.max),_=u.intersect(m);o.length>0&&_.getStarts().equals(o[o.length-1].getEndExclusives())?o[o.length-1]=o[o.length-1].join(_):o.push(_)}),o}class Z8e{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:J8e(this.lines[e-1]),i=e===this.lines.length?0:J8e(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 J8e(n){let e=0;for(;e<n.length&&(n.charCodeAt(e)===32||n.charCodeAt(e)===9);)e++;return e}class Dat{constructor(){this.dynamicProgrammingDiffing=new Hur,this.myersDiffingAlgorithm=new Nat}computeDiff(e,t,i){if(e.length<=1&&fa(e,t,(S,k)=>S===k))return new rU([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new rU([new dg(new fr(1,e.length+1),new fr(1,t.length+1),[new zp(new ie(1,1,e.length,e[e.length-1].length+1),new ie(1,1,t.length,t[t.length-1].length+1))])],[],!1);const r=i.maxComputationTimeMs===0?g7.instance:new $ur(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,o=new Map;function a(S){let k=o.get(S);return k===void 0&&(k=o.size,o.set(S,k)),k}const l=e.map(S=>a(S.trim())),c=t.map(S=>a(S.trim())),u=new Z8e(l,e),d=new Z8e(c,t),f=u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,r,(S,k)=>e[S]===t[k]?t[k].length===0?.1:1+Math.log(1+t[k].length):.99):this.myersDiffingAlgorithm.compute(u,d,r);let p=f.diffs,g=f.hitTimeout;p=Zme(u,d,p),p=tdr(u,d,p);const m=[],_=S=>{if(s)for(let k=0;k<S;k++){const I=v+k,L=b+k;if(e[I]!==t[L]){const N=this.refineDiff(e,t,new Sc(new Pr(I,I+1),new Pr(L,L+1)),r,s);for(const P of N.mappings)m.push(P);N.hitTimeout&&(g=!0)}}};let v=0,b=0;for(const S of p){VL(()=>S.seq1Range.start-v===S.seq2Range.start-b);const k=S.seq1Range.start-v;_(k),v=S.seq1Range.endExclusive,b=S.seq2Range.endExclusive;const I=this.refineDiff(e,t,S,r,s);I.hitTimeout&&(g=!0);for(const L of I.mappings)m.push(L)}_(e.length-v);const y=e7e(m,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(y,e,t,l,c,r,s)),VL(()=>{function S(I,L){if(I.lineNumber<1||I.lineNumber>L.length)return!1;const N=L[I.lineNumber-1];return!(I.column<1||I.column>N.length+1)}function k(I,L){return!(I.startLineNumber<1||I.startLineNumber>L.length+1||I.endLineNumberExclusive<1||I.endLineNumberExclusive>L.length+1)}for(const I of y){if(!I.innerChanges)return!1;for(const L of I.innerChanges)if(!(S(L.modifiedRange.getStartPosition(),t)&&S(L.modifiedRange.getEndPosition(),t)&&S(L.originalRange.getStartPosition(),e)&&S(L.originalRange.getEndPosition(),e)))return!1;if(!k(I.modified,t)||!k(I.original,e))return!1}return!0}),new rU(y,C,g)}computeMoves(e,t,i,r,s,o,a){return Uur(e,t,i,r,s,o).map(u=>{const d=this.refineDiff(t,i,new Sc(u.original.toOffsetRange(),u.modified.toOffsetRange()),o,a),f=e7e(d.mappings,t,i,!0);return new Iat(u,f)})}refineDiff(e,t,i,r,s){const a=rdr(i).toRangeMapping2(e,t),l=new tG(e,a.originalRange,s),c=new tG(t,a.modifiedRange,s),u=l.length+c.length<500?this.dynamicProgrammingDiffing.compute(l,c,r):this.myersDiffingAlgorithm.compute(l,c,r);let d=u.diffs;return d=Zme(l,c,d),d=Jur(l,c,d),d=Zur(l,c,d),d=ndr(l,c,d),{mappings:d.map(p=>new zp(l.translateRange(p.seq1Range),c.translateRange(p.seq2Range))),hitTimeout:u.hitTimeout}}}function e7e(n,e,t,i=!1){const r=[];for(const s of JEe(n.map(o=>idr(o,e,t)),(o,a)=>o.original.overlapOrTouch(a.original)||o.modified.overlapOrTouch(a.modified))){const o=s[0],a=s[s.length-1];r.push(new dg(o.original.join(a.original),o.modified.join(a.modified),s.map(l=>l.innerChanges[0])))}return VL(()=>!i&&r.length>0&&(r[0].modified.startLineNumber!==r[0].original.startLineNumber||t.length-r[r.length-1].modified.endLineNumberExclusive!==e.length-r[r.length-1].original.endLineNumberExclusive)?!1:Ake(r,(s,o)=>o.original.startLineNumber-s.original.endLineNumberExclusive===o.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive<o.original.startLineNumber&&s.modified.endLineNumberExclusive<o.modified.startLineNumber)),r}function idr(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 s=new fr(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+r),o=new fr(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+r);return new dg(s,o,[n])}function rdr(n){return new Ud(new fr(n.seq1Range.start+1,n.seq1Range.endExclusive+1),new fr(n.seq2Range.start+1,n.seq2Range.endExclusive+1))}const t7e={getLegacy:()=>new Mur,getDefault:()=>new Dat};function cE(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class ds{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=cE(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 N_{constructor(e,t,i,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=cE(Math.max(Math.min(1,t),0),3),this.l=cE(Math.max(Math.min(1,i),0),3),this.a=cE(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,s=e.a,o=Math.max(t,i,r),a=Math.min(t,i,r);let l=0,c=0;const u=(a+o)/2,d=o-a;if(d>0){switch(c=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),o){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 N_(l,c,u,s)}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:s}=e;let o,a,l;if(i===0)o=a=l=r;else{const c=r<.5?r*(1+i):r+i-r*i,u=2*r-c;o=N_._hue2rgb(u,c,t+1/3),a=N_._hue2rgb(u,c,t),l=N_._hue2rgb(u,c,t-1/3)}return new ds(Math.round(o*255),Math.round(a*255),Math.round(l*255),s)}}class ky{constructor(e,t,i,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=cE(Math.max(Math.min(1,t),0),3),this.v=cE(Math.max(Math.min(1,i),0),3),this.a=cE(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,s=Math.max(t,i,r),o=Math.min(t,i,r),a=s-o,l=s===0?0:a/s;let c;return a===0?c=0:s===t?c=((i-r)/a%6+6)%6:s===i?c=(r-t)/a+2:c=(t-i)/a+4,new ky(Math.round(c*60),l,s,e.a)}static toRGBA(e){const{h:t,s:i,v:r,a:s}=e,o=r*i,a=o*(1-Math.abs(t/60%2-1)),l=r-o;let[c,u,d]=[0,0,0];return t<60?(c=o,u=a):t<120?(c=a,u=o):t<180?(u=o,d=a):t<240?(u=a,d=o):t<300?(c=a,d=o):t<=360&&(c=o,d=a),c=Math.round((c+l)*255),u=Math.round((u+l)*255),d=Math.round((d+l)*255),new ds(c,u,d,s)}}const nl=class nl{static fromHex(e){return nl.Format.CSS.parseHex(e)||nl.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:N_.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:ky.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof ds)this.rgba=e;else if(e instanceof N_)this._hsla=e,this.rgba=N_.toRGBA(e);else if(e instanceof ky)this._hsva=e,this.rgba=ky.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&ds.equals(this.rgba,e.rgba)&&N_.equals(this.hsla,e.hsla)&&ky.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=nl._relativeLuminanceForComponent(this.rgba.r),t=nl._relativeLuminanceForComponent(this.rgba.g),i=nl._relativeLuminanceForComponent(this.rgba.b),r=.2126*e+.7152*t+.0722*i;return cE(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 nl(new N_(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new nl(new N_(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:s}=this.rgba;return new nl(new ds(t,i,r,s*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new nl(new ds(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:s}=this.rgba;return new nl(new ds(e.rgba.r-s*(e.rgba.r-t),e.rgba.g-s*(e.rgba.g-i),e.rgba.b-s*(e.rgba.b-r),1))}toString(){return this._toString||(this._toString=nl.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const r=e.getRelativeLuminance(),s=t.getRelativeLuminance();return i=i*(s-r)/s,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const r=e.getRelativeLuminance(),s=t.getRelativeLuminance();return i=i*(r-s)/r,e.darken(i)}};nl.white=new nl(new ds(255,255,255,1)),nl.black=new nl(new ds(0,0,0,1)),nl.red=new nl(new ds(255,0,0,1)),nl.blue=new nl(new ds(0,0,255,1)),nl.green=new nl(new ds(0,255,0,1)),nl.cyan=new nl(new ds(0,255,255,1)),nl.lightgrey=new nl(new ds(211,211,211,1)),nl.transparent=new nl(new ds(0,0,0,0));let At=nl;(function(n){(function(e){(function(t){function i(p){return p.rgba.a===1?`rgb(${p.rgba.r}, ${p.rgba.g}, ${p.rgba.b})`:n.Format.CSS.formatRGBA(p)}t.formatRGB=i;function r(p){return`rgba(${p.rgba.r}, ${p.rgba.g}, ${p.rgba.b}, ${+p.rgba.a.toFixed(2)})`}t.formatRGBA=r;function s(p){return p.hsla.a===1?`hsl(${p.hsla.h}, ${(p.hsla.s*100).toFixed(2)}%, ${(p.hsla.l*100).toFixed(2)}%)`:n.Format.CSS.formatHSLA(p)}t.formatHSL=s;function o(p){return`hsla(${p.hsla.h}, ${(p.hsla.s*100).toFixed(2)}%, ${(p.hsla.l*100).toFixed(2)}%, ${p.hsla.a.toFixed(2)})`}t.formatHSLA=o;function a(p){const g=p.toString(16);return g.length!==2?"0"+g:g}function l(p){return`#${a(p.rgba.r)}${a(p.rgba.g)}${a(p.rgba.b)}`}t.formatHex=l;function c(p,g=!1){return g&&p.rgba.a===1?n.Format.CSS.formatHex(p):`#${a(p.rgba.r)}${a(p.rgba.g)}${a(p.rgba.b)}${a(Math.round(p.rgba.a*255))}`}t.formatHexA=c;function u(p){return p.isOpaque()?n.Format.CSS.formatHex(p):n.Format.CSS.formatRGBA(p)}t.format=u;function d(p){const g=p.length;if(g===0||p.charCodeAt(0)!==35)return null;if(g===7){const m=16*f(p.charCodeAt(1))+f(p.charCodeAt(2)),_=16*f(p.charCodeAt(3))+f(p.charCodeAt(4)),v=16*f(p.charCodeAt(5))+f(p.charCodeAt(6));return new n(new ds(m,_,v,1))}if(g===9){const m=16*f(p.charCodeAt(1))+f(p.charCodeAt(2)),_=16*f(p.charCodeAt(3))+f(p.charCodeAt(4)),v=16*f(p.charCodeAt(5))+f(p.charCodeAt(6)),b=16*f(p.charCodeAt(7))+f(p.charCodeAt(8));return new n(new ds(m,_,v,b/255))}if(g===4){const m=f(p.charCodeAt(1)),_=f(p.charCodeAt(2)),v=f(p.charCodeAt(3));return new n(new ds(16*m+m,16*_+_,16*v+v))}if(g===5){const m=f(p.charCodeAt(1)),_=f(p.charCodeAt(2)),v=f(p.charCodeAt(3)),b=f(p.charCodeAt(4));return new n(new ds(16*m+m,16*_+_,16*v+v,(16*b+b)/255))}return null}t.parseHex=d;function f(p){switch(p){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={}))})(At||(At={}));function Rat(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 Bke(n,e,t,i){return{red:n/255,blue:t/255,green:e/255,alpha:i}}function fj(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 sdr(n,e){if(!n)return;const t=At.Format.CSS.parseHex(e);if(t)return{range:n,color:Bke(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function n7e(n,e,t){if(!n||e.length!==1)return;const r=e[0].values(),s=Rat(r);return{range:n,color:Bke(s[0],s[1],s[2],t?s[3]:1)}}function i7e(n,e,t){if(!n||e.length!==1)return;const r=e[0].values(),s=Rat(r),o=new At(new N_(s[0],s[1]/100,s[2]/100,t?s[3]:1));return{range:n,color:Bke(o.rgba.r,o.rgba.g,o.rgba.b,o.rgba.a)}}function pj(n,e){return typeof n=="string"?[...n.matchAll(e)]:n.findMatches(e)}function odr(n){const e=[],i=pj(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 s=r.filter(c=>c!==void 0),o=s[1],a=s[2];if(!a)continue;let l;if(o==="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=n7e(fj(n,r),pj(a,c),!1)}else if(o==="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=n7e(fj(n,r),pj(a,c),!0)}else if(o==="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=i7e(fj(n,r),pj(a,c),!1)}else if(o==="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=i7e(fj(n,r),pj(a,c),!0)}else o==="#"&&(l=sdr(fj(n,r),o+a));l&&e.push(l)}return e}function adr(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:odr(n)}const r7e=new RegExp("\\bMARK:\\s*(.*)$","d"),ldr=/^-+|-+$/g;function cdr(n,e){var i;let t=[];if(e.findRegionSectionHeaders&&((i=e.foldingRules)!=null&&i.markers)){const r=udr(n,e);t=t.concat(r)}if(e.findMarkSectionHeaders){const r=ddr(n);t=t.concat(r)}return t}function udr(n,e){const t=[],i=n.getLineCount();for(let r=1;r<=i;r++){const s=n.getLineContent(r),o=s.match(e.foldingRules.markers.start);if(o){const a={startLineNumber:r,startColumn:o[0].length+1,endLineNumber:r,endColumn:s.length+1};if(a.endColumn>a.startColumn){const l={range:a,...Pat(s.substring(o[0].length)),shouldBeInComments:!1};(l.text||l.hasSeparatorLine)&&t.push(l)}}}return t}function ddr(n){const e=[],t=n.getLineCount();for(let i=1;i<=t;i++){const r=n.getLineContent(i);hdr(r,i,e)}return e}function hdr(n,e,t){r7e.lastIndex=0;const i=r7e.exec(n);if(i){const r=i.indices[1][0]+1,s=i.indices[1][1]+1,o={startLineNumber:e,startColumn:r,endLineNumber:e,endColumn:s};if(o.endColumn>o.startColumn){const a={range:o,...Pat(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function Pat(n){n=n.trim();const e=n.startsWith("-");return n=n.replace(ldr,""),{text:n,hasSeparatorLine:e}}class fdr{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=DD(e);const i=this.values,r=this.prefixSum,s=t.length;return s===0?!1:(this.values=new Uint32Array(i.length+s),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+s),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=DD(e),t=DD(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=DD(e),t=DD(t);const i=this.values,r=this.prefixSum;if(e>=i.length)return!1;const s=i.length-e;return t>=s&&(t=s),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=DD(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,s=0,o=0;for(;t<=i;)if(r=t+(i-t)/2|0,s=this.prefixSum[r],o=s-this.values[r],e<o)i=r-1;else if(e>=s)t=r+1;else break;return new Oat(r,e-o)}}class pdr{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 Oat(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=Vee(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 s=0;s<i;s++)this._indexBySum[r+s]=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 Oat{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class gdr{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 We(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 fdr(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=_1(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 s=1;s<i.length;s++)this._lines.splice(e.lineNumber+s-1,0,i[s]),r[s-1]=i[s].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,r)}}const s7e=60*1e3;class mdr extends Ye{constructor(e,t,i=!1){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const r=new wke;r.cancelAndSet(()=>this._checkStopModelSync(),Math.round(s7e/2)),this._register(r)}}dispose(){for(const e in this._syncedModels)vo(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t=!1){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]>s7e&&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 s=new Et;s.add(i.onDidChangeContent(o=>{this._proxy.$acceptModelChanged(r.toString(),o)})),s.add(i.onWillDispose(()=>{this._stopModelSync(r)})),s.add(gi(()=>{this._proxy.$acceptRemovedModel(r)})),this._syncedModels[r]=s}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],vo(t)}}class _dr{constructor(){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 vdr(vi.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]}}class vdr extends gdr{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],s=this.offsetAt(new We(i+1,1)),o=r.matchAll(e);for(const a of o)(a.index||a.index===0)&&(a.index=a.index+s),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=e7(e.column,oke(t),this._lines[e.lineNumber-1],0);return i?new ie(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let r=0,s="",o=0,a=[];return{*[Symbol.iterator](){for(;;)if(o<a.length){const l=s.substring(a[o].start,a[o].end);o+=1,yield l}else if(r<t.length)s=t[r],a=i(s,e),o=0,r+=1;else break}}}getLineWords(e,t){const i=this._lines[e-1],r=this._wordenize(i,t),s=[];for(const o of r)s.push({word:i.substring(o.start,o.end),startColumn:o.start+1,endColumn:o.end+1});return s}_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,s=[];s.push(this._lines[i].substring(e.startColumn-1));for(let o=i+1;o<r;o++)s.push(this._lines[o]);return s.push(this._lines[r].substring(0,e.endColumn-1)),s.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(!We.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 s=this._lines[t-1].length+1;i<1?(i=1,r=!0):i>s&&(i=s,r=!0)}return r?{lineNumber:t,column:i}:e}}const FQ=class FQ{constructor(){this._workerTextModelSyncServer=new _dr}dispose(){}_getModel(e){return this._workerTextModelSyncServer.getModel(e)}_getModels(){return this._workerTextModelSyncServer.getModels()}$acceptNewModel(e){this._workerTextModelSyncServer.$acceptNewModel(e)}$acceptModelChanged(e,t){this._workerTextModelSyncServer.$acceptModelChanged(e,t)}$acceptRemovedModel(e){this._workerTextModelSyncServer.$acceptRemovedModel(e)}async $computeUnicodeHighlights(e,t,i){const r=this._getModel(e);return r?Oke.computeUnicodeHighlights(r,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async $findSectionHeaders(e,t){const i=this._getModel(e);return i?cdr(i,t):[]}async $computeDiff(e,t,i,r){const s=this._getModel(e),o=this._getModel(t);return!s||!o?null:sU.computeDiff(s,o,i,r)}static computeDiff(e,t,i,r){const s=r==="advanced"?t7e.getDefault():t7e.getLegacy(),o=e.getLinesContent(),a=t.getLinesContent(),l=s.computeDiff(o,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function u(d){return d.map(f=>{var p;return[f.original.startLineNumber,f.original.endLineNumberExclusive,f.modified.startLineNumber,f.modified.endLineNumberExclusive,(p=f.innerChanges)==null?void 0:p.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 s=1;s<=i;s++){const o=e.getLineContent(s),a=t.getLineContent(s);if(o!==a)return!1}return!0}async $computeMoreMinimalEdits(e,t,i){const r=this._getModel(e);if(!r)return t;const s=[];let o;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return ie.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++)ie.getEndPosition(t[a].range).equals(ie.getStartPosition(t[l].range))?(t[a].range=ie.fromPositions(ie.getStartPosition(t[a].range),ie.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"&&(o=u),ie.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)>sU._diffLimit){s.push({range:l,text:c});continue}const f=aur(d,c,i),p=r.offsetAt(ie.lift(l).getStartPosition());for(const g of f){const m=r.positionAt(p+g.originalStart),_=r.positionAt(p+g.originalStart+g.originalLength),v={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:_.lineNumber,endColumn:_.column}};r.getValueInRange(v.range)!==v.text&&s.push(v)}}return typeof o=="number"&&s.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}async $computeLinks(e){const t=this._getModel(e);return t?hur(t):null}async $computeDefaultDocumentColors(e){const t=this._getModel(e);return t?adr(t):null}async $textualSuggest(e,t,i,r){const s=new Qc,o=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(o))if(!(u===t||!isNaN(Number(u)))&&(a.add(u),a.size>sU._suggestionsLimit))break e}}return{words:Array.from(a),duration:s.elapsed()}}async $computeWordRanges(e,t,i,r){const s=this._getModel(e);if(!s)return Object.create(null);const o=new RegExp(i,r),a=Object.create(null);for(let l=t.startLineNumber;l<t.endLineNumber;l++){const c=s.getLineWords(l,o);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}async $navigateValueSet(e,t,i,r,s){const o=this._getModel(e);if(!o)return null;const a=new RegExp(r,s);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const l=o.getValueInRange(t),c=o.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},a);if(!c)return null;const u=o.getValueInRange(c);return Kme.INSTANCE.navigateValueSet(t,l,c,u,i)}};FQ._diffLimit=1e5,FQ._suggestionsLimit=1e4;let Jme=FQ;class sU extends Jme{constructor(e,t){super(),this._host=e,this._foreignModuleFactory=t,this._foreignModule=null}async $ping(){return"pong"}$loadForeignModule(e,t,i){const o={host:tsr(i,(a,l)=>this._host.$fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(o,t),Promise.resolve(vge(this._foreignModule))):new Promise((a,l)=>{const c=u=>{this._foreignModule=u.create(o,t),a(vge(this._foreignModule))};{const u=Yee.asBrowserUri(`${e}.js`).toString(!0);ue(()=>import(`${u}`),[]).then(c).catch(l)}})}$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)}}}typeof importScripts=="function"&&(globalThis.monaco=Cot());const pte=Ur("textResourceConfigurationService"),Mat=Ur("textResourcePropertiesService"),Fn=Ur("ILanguageFeaturesService");var $ke=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},b2=function(n,e){return function(t,i){e(t,i,n)}};const o7e=5*60*1e3;function y2(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let e_e=class extends Ye{constructor(e,t,i,r,s,o){super(),this._languageConfigurationService=s,this._modelService=t,this._workerManager=this._register(new t_e(e,this._modelService)),this._logService=r,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:async(a,l)=>{if(!y2(this._modelService,a.uri))return Promise.resolve({links:[]});const u=await(await this._workerWithResources([a.uri])).$computeLinks(a.uri.toString());return u&&{links:u}}})),this._register(o.completionProvider.register("*",new bdr(this._workerManager,i,this._modelService,this._languageConfigurationService)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return y2(this._modelService,e)}async computedUnicodeHighlights(e,t,i){return(await this._workerWithResources([e])).$computeUnicodeHighlights(e.toString(),t,i)}async computeDiff(e,t,i,r){const o=await(await this._workerWithResources([e,t],!0)).$computeDiff(e.toString(),t.toString(),i,r);if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:l(o.changes),moves:o.moves.map(c=>new Iat(new Ud(new fr(c[0],c[1]),new fr(c[2],c[3])),l(c[4])))};function l(c){return c.map(u=>{var d;return new dg(new fr(u[0],u[1]),new fr(u[2],u[3]),(d=u[4])==null?void 0:d.map(f=>new zp(new ie(f[0],f[1],f[2],f[3]),new ie(f[4],f[5],f[6],f[7]))))})}}async computeMoreMinimalEdits(e,t,i=!1){if(Gd(t)){if(!y2(this._modelService,e))return Promise.resolve(t);const r=Qc.create(),s=this._workerWithResources([e]).then(o=>o.$computeMoreMinimalEdits(e.toString(),t,i));return s.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),r.elapsed())),Promise.race([s,Nw(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return y2(this._modelService,e)}async navigateValueSet(e,t,i){const r=this._modelService.getModel(e);if(!r)return null;const s=this._languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),o=s.source,a=s.flags;return(await this._workerWithResources([e])).$navigateValueSet(e.toString(),t,i,o,a)}canComputeWordRanges(e){return y2(this._modelService,e)}async computeWordRanges(e,t){const i=this._modelService.getModel(e);if(!i)return Promise.resolve(null);const r=this._languageConfigurationService.getLanguageConfiguration(i.getLanguageId()).getWordDefinition(),s=r.source,o=r.flags;return(await this._workerWithResources([e])).$computeWordRanges(e.toString(),t,s,o)}async findSectionHeaders(e,t){return(await this._workerWithResources([e])).$findSectionHeaders(e.toString(),t)}async computeDefaultDocumentColors(e){return(await this._workerWithResources([e])).$computeDefaultDocumentColors(e.toString())}async _workerWithResources(e,t=!1){return await(await this._workerManager.withWorker()).workerWithSyncedResources(e,t)}};e_e=$ke([b2(1,Xo),b2(2,pte),b2(3,Uu),b2(4,wa),b2(5,Fn)],e_e);class bdr{constructor(e,t,i,r){this.languageConfigurationService=r,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;const r=[];if(i.wordBasedSuggestions==="currentDocument")y2(this._modelService,e.uri)&&r.push(e.uri);else for(const d of this._modelService.getModels())y2(this._modelService,d.uri)&&(d===e?r.unshift(d.uri):(i.wordBasedSuggestions==="allDocuments"||d.getLanguageId()===e.getLanguageId())&&r.push(d.uri));if(r.length===0)return;const s=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),o=e.getWordAtPosition(t),a=o?new ie(t.lineNumber,o.startColumn,t.lineNumber,o.endColumn):ie.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),u=await(await this._workerManager.withWorker()).textualSuggest(r,o==null?void 0:o.word,s);if(u)return{duration:u.duration,suggestions:u.words.map(d=>({kind:18,label:d,insertText:d,range:{insert:l,replace:a}}))}}}let t_e=class extends Ye{constructor(e,t){super(),this._workerDescriptor=e,this._modelService=t,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new Ske).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(o7e/2),bo),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>o7e&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new nG(this._workerDescriptor,!1,this._modelService)),Promise.resolve(this._editorWorkerClient)}};t_e=$ke([b2(1,Xo)],t_e);class ydr{constructor(e){this._instance=e,this.proxy=this._instance}dispose(){this._instance.dispose()}setChannel(e,t){throw new Error("Not supported")}}let nG=class extends Ye{constructor(e,t,i){super(),this._workerDescriptor=e,this._disposed=!1,this._modelService=i,this._keepIdleModels=t,this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(Scr(this._workerDescriptor)),Gme.setChannel(this._worker,this._createEditorWorkerHost())}catch(e){Hme(e),this._worker=this._createFallbackLocalWorker()}return this._worker}async _getProxy(){try{const e=this._getOrCreateWorker().proxy;return await e.$ping(),e}catch(e){return Hme(e),this._worker=this._createFallbackLocalWorker(),this._worker.proxy}}_createFallbackLocalWorker(){return new ydr(new sU(this._createEditorWorkerHost(),null))}_createEditorWorkerHost(){return{$fhr:(e,t)=>this.fhr(e,t)}}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new mdr(e,this._modelService,this._keepIdleModels))),this._modelManager}async workerWithSyncedResources(e,t=!1){if(this._disposed)return Promise.reject(lor());const i=await this._getProxy();return this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i}async textualSuggest(e,t,i){const r=await this.workerWithSyncedResources(e),s=i.source,o=i.flags;return r.$textualSuggest(e.map(a=>a.toString()),t,s,o)}dispose(){super.dispose(),this._disposed=!0}};nG=$ke([b2(2,Xo)],nG);var _m;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(_m||(_m={}));function Ab(n){return n===_m.HIGH_CONTRAST_DARK||n===_m.HIGH_CONTRAST_LIGHT}function cM(n){return n===_m.DARK||n===_m.HIGH_CONTRAST_DARK}const mc=Ur("themeService");function Ga(n){return{id:n}}function n_e(n){switch(n){case _m.DARK:return"vs-dark";case _m.HIGH_CONTRAST_DARK:return"hc-black";case _m.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const jat={ThemingContribution:"base.contributions.theming"};class Cdr{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Ue}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),gi(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const Fat=new Cdr;Ca.add(jat.ThemingContribution,Fat);function Gm(n){return Fat.onColorThemeChange(n)}class wdr extends Ye{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(){}}var xdr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Sdr=function(n,e){return function(t,i){e(t,i,n)}};let i_e=class extends Ye{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new Ue),this._onCodeEditorAdd=this._register(new Ue),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new Ue),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new Ue),this._onDiffEditorAdd=this._register(new Ue),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new Ue),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Ch,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 s;this._modelProperties.has(r)?s=this._modelProperties.get(r):(s=new Map,this._modelProperties.set(r,s)),s.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(const r of this._codeEditorOpenHandlers){const s=await r(e,t,i);if(s!==null)return s}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return gi(t)}};i_e=xdr([Sdr(0,mc)],i_e);var Edr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},a7e=function(n,e){return function(t,i){e(t,i,n)}};let iG=class extends i_e{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(async(i,r,s)=>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 s=t.resource.scheme;if(s===ir.http||s===ir.https)return nat(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 s={lineNumber:r.startLineNumber,column:r.startColumn};e.setPosition(s),e.revealPositionInCenter(s,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};iG=Edr([a7e(0,Oi),a7e(1,mc)],iG);ns(Cs,iG,0);const Nk=Ur("layoutService");var Bat=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},$at=function(n,e){return function(t,i){e(t,i,n)}};let rG=class{get mainContainer(){var e;return((e=eke(this._codeEditorService.listCodeEditors()))==null?void 0:e.getContainerDomNode())??bo.document.body}get activeContainer(){const e=this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor();return(e==null?void 0:e.getContainerDomNode())??this.mainContainer}get mainContainerDimension(){return ZE(this.mainContainer)}get activeContainerDimension(){return ZE(this.activeContainer)}get containers(){return iv(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())==null||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=rn.None,this.onDidLayoutActiveContainer=rn.None,this.onDidLayoutContainer=rn.None,this.onDidChangeActiveContainer=rn.None,this.onDidAddContainer=rn.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};rG=Bat([$at(0,Cs)],rG);let r_e=class extends rG{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};r_e=Bat([$at(1,Cs)],r_e);ns(Nk,rG,1);var m7;(function(n){n[n.Ignore=0]="Ignore",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(m7||(m7={}));(function(n){const e="error",t="warning",i="warn",r="info",s="ignore";function o(l){return l?IR(e,l)?n.Error:IR(t,l)||IR(i,l)?n.Warning:IR(r,l)?n.Info:n.Ignore:n.Ignore}n.fromValue=o;function a(l){switch(l){case n.Error:return e;case n.Warning:return t;case n.Info:return r;default:return s}}n.toString=a})(m7||(m7={}));const _l=m7,Q9=Ur("dialogService");var gte=_l;const wl=Ur("notificationService");class kdr{}const Hke=Ur("undoRedoService");class Hat{constructor(e,t){this.resource=e,this.elements=t}}const nP=class nP{constructor(){this.id=nP._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};nP._ID=0,nP.None=new nP;let s_e=nP;const iP=class iP{constructor(){this.id=iP._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};iP._ID=0,iP.None=new iP;let C2=iP;var Tdr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},l7e=function(n,e){return function(t,i){e(t,i,n)}};function tW(n){return n.scheme===ir.file?n.fsPath:n.path}let Vat=0;class nW{constructor(e,t,i,r,s,o,a){this.id=++Vat,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=s,this.sourceId=o,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 c7e{constructor(e,t){this.resourceLabel=e,this.reason=t}}class u7e{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(A({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(A({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 Idr{constructor(e,t,i,r,s,o,a){this.id=++Vat,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=s,this.sourceId=o,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 u7e),this.removedResources.has(t)||this.removedResources.set(t,new c7e(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 u7e),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new c7e(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Wat{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 Hat(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,r=0,s=-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,s=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let o=-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,o=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),o!==-1&&(this._future=this._future.slice(o+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 Mce{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 zat=new Wat("","");zat.locked=!0;let o_e=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=s_e.None,i=C2.None){if(e.type===0){const r=tW(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new nW(e,r,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const r=new Set,s=[],o=[];for(const a of e.resources){const l=tW(a),c=this.getUriComparisonKey(a);r.has(c)||(r.add(c),s.push(l),o.push(c))}s.length===1?this._pushElement(new nW(e,s[0],o[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new Idr(e,s,o,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],s=e.strResources[t];let o;this._editStacks.has(s)?o=this._editStacks.get(s):(o=new Wat(r,s),this._editStacks.set(s,o)),o.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 s of i){const o=tW(s.resource),a=this.getUriComparisonKey(s.resource),l=new nW(s,o,a,0,0,0,0);r.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitPastWorkspaceElement(e,r)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),r=new Map;for(const s of i){const o=tW(s.resource),a=this.getUriComparisonKey(s.resource),l=new nW(s,o,a,0,0,0,0);r.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).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 Hat(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,s]of this._editStacks){const o=s.getClosestPastElement();o&&o.sourceId===e&&(!t||o.sourceOrder>t.sourceOrder)&&(t=o,i=r)}return[t,i]}canUndo(e){if(e instanceof C2){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){tr(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,s){const o=this._acquireLocks(i);let a;try{a=t()}catch(l){return o(),r.dispose(),this._onError(l,e)}return a?a.then(()=>(o(),r.dispose(),s()),l=>(o(),r.dispose(),this._onError(l,e))):(o(),r.dispose(),s())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return Ye.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?Ye.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(Ye.None);const i=e.actual.prepareUndoRedo();return i?Uee(i)?t(i):i.then(r=>t(r)):t(Ye.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||zat);return new Mce(t)}_tryToSplitAndUndo(e,t,i,r){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(r),new iW(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(r),new iW}_checkWorkspaceUndo(e,t,i,r){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,A({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,A({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 s=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&s.push(a.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,A({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,s.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.length>0?this._tryToSplitAndUndo(e,t,null,A({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,o.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,A({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),s=this._checkWorkspaceUndo(e,t,r,!1);return s?s.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}async _confirmAndExecuteWorkspaceUndo(e,t,i,r){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}=await this._dialogService.prompt({type:_l.Info,message:A("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:A({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:A({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 s;try{s=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const o=this._checkWorkspaceUndo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,s,()=>this._continueUndoInGroup(t.groupId,r))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const r=A({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 Mce([e]),r,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[r,s]of this._editStacks){const o=s.getClosestPastElement();o&&o.groupId===e&&(!t||o.groupOrder>t.groupOrder)&&(t=o,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 C2){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),s=r.getClosestPastElement();if(!s)return;if(s.groupId){const[a,l]=this._findClosestUndoElementInGroup(s.groupId);if(s!==a&&l)return this._undo(l,t,i)}if((s.sourceId!==t||s.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,s);try{return s.type===1?this._workspaceUndo(e,s,i):this._resourceUndo(r,s,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:A("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:A({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:A("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,s]of this._editStacks){const o=s.getClosestFutureElement();o&&o.sourceId===e&&(!t||o.sourceOrder<t.sourceOrder)&&(t=o,i=r)}return[t,i]}canRedo(e){if(e instanceof C2){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 iW(this._redo(e));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(r),new iW}_checkWorkspaceRedo(e,t,i,r){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,A({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,A({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 s=[];for(const a of i.editStacks)a.getClosestFutureElement()!==t&&s.push(a.resourceLabel);if(s.length>0)return this._tryToSplitAndRedo(e,t,null,A({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,s.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.length>0?this._tryToSplitAndRedo(e,t,null,A({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,o.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,A({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)}async _executeWorkspaceRedo(e,t,i){let r;try{r=await this._invokeWorkspacePrepare(t)}catch(o){return this._onError(o,t)}const s=this._checkWorkspaceRedo(e,t,i,!0);if(s)return r.dispose(),s.returnValue;for(const o of i.editStacks)o.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=A({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 Mce([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[r,s]of this._editStacks){const o=s.getClosestFutureElement();o&&o.groupId===e&&(!t||o.groupOrder<t.groupOrder)&&(t=o,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 C2){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,s]=this._findClosestRedoElementInGroup(i.groupId);if(i!==r&&s)return this._redo(s)}try{return i.type===1?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};o_e=Tdr([l7e(0,Q9),l7e(1,wl)],o_e);class iW{constructor(e){this.returnValue=e}}ns(Hke,o_e,1);function hh(n,e,t){return Math.min(Math.max(n,e),t)}class Uat{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 Ldr{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 Vke=Ur("environmentService");var Adr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},d7e=function(n,e){return function(t,i){e(t,i,n)}};const kg=Ur("ILanguageFeatureDebounceService");var sG;(function(n){const e=new WeakMap;let t=0;function i(r){let s=e.get(r);return s===void 0&&(s=++t,e.set(r,s)),s}n.of=i})(sG||(sG={}));class Ndr{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class Ddr{constructor(e,t,i,r,s,o){this._logService=e,this._name=t,this._registry=i,this._default=r,this._min=s,this._max=o,this._cache=new b1(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>Xee(sG.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?hh(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 Ldr(6),this._cache.set(i,r));const s=hh(r.update(t),this._min,this._max);return Gee(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${s}ms`),s}_overall(){const e=new Uat;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return hh(e,this._min,this._max)}}let a_e=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const r=(i==null?void 0:i.min)??50,s=(i==null?void 0:i.max)??r**2,o=(i==null?void 0:i.key)??void 0,a=`${sG.of(e)},${r}${o?","+o:""}`;let l=this._data.get(a);return l||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),l=new Ndr(r*1.5)):l=new Ddr(this._logService,t,e,this._overallAverage()|0||r*1.5,r,s),this._data.set(a,l)),l}_overallAverage(){const e=new Uat;for(const t of this._data.values())e.update(t.default());return e.value}};a_e=Adr([d7e(0,Uu),d7e(1,Vke)],a_e);ns(kg,a_e,1);class rf{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 s=`color: ${t[i]};`;r&1&&(s+="font-style: italic;"),r&2&&(s+="font-weight: bold;");let o="";return r&4&&(o+=" underline"),r&8&&(o+=" line-through"),o&&(s+=`text-decoration:${o};`),s}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)}}}function ek(n){let e=0,t=0,i=0,r=0;for(let s=0,o=n.length;s<o;s++){const a=n.charCodeAt(s);a===13?(e===0&&(t=s),e++,s+1<o&&n.charCodeAt(s+1)===10?(r|=2,s++):r|=3,i=s+1):a===10&&(r|=1,e===0&&(t=s),e++,i=s+1)}return e===0&&(t=n.length),[e,t,n.length-i,r]}class e6{static create(e,t){return new e6(e,new oG(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 ie(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,s,o]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new e6(this._startLineNumber,r),new e6(this._startLineNumber+o,s)]}applyEdit(e,t){const[i,r,s]=ek(t);this.acceptEdit(e,i,r,s,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,r,s){this._acceptDeleteRange(e),this._acceptInsertText(new We(e.startLineNumber,e.startColumn),t,i,r,s),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 s=i-t;this._startLineNumber-=s;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 s=-t;this._startLineNumber-=s,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,s){if(t===0&&i===0)return;const o=e.lineNumber-this._startLineNumber;if(o<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();o>=a+1||this._tokens.acceptInsertText(o,e.column-1,t,i,r,s)}}class oG{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 ie(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),s=this._getDeltaLine(r);if(s<e)t=r+1;else if(s>e)i=r-1;else{let o=r;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let a=r;for(;a<i&&this._getDeltaLine(a+1)===e;)a++;return new h7e(this._tokens.subarray(4*o,4*a+4))}}return this._getDeltaLine(t)===e?new h7e(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,r){const s=this._tokens,o=this._tokenCount;let a=0,l=!1,c=0;for(let u=0;u<o;u++){const d=4*u,f=s[d],p=s[d+1],g=s[d+2],m=s[d+3];if((f>e||f===e&&g>=t)&&(f<i||f===i&&p<=r))l=!0;else{if(a===0&&(c=f),l){const _=4*a;s[_]=f-c,s[_+1]=p,s[_+2]=g,s[_+3]=m}a++}}return this._tokenCount=a,c}split(e,t,i,r){const s=this._tokens,o=this._tokenCount,a=[],l=[];let c=a,u=0,d=0;for(let f=0;f<o;f++){const p=4*f,g=s[p],m=s[p+1],_=s[p+2],v=s[p+3];if(g>e||g===e&&_>=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++]=_,c[u++]=v}return[new oG(new Uint32Array(a)),new oG(new Uint32Array(l)),d]}acceptDeleteRange(e,t,i,r,s){const o=this._tokens,a=this._tokenCount,l=r-t;let c=0,u=!1;for(let d=0;d<a;d++){const f=4*d;let p=o[f],g=o[f+1],m=o[f+2];const _=o[f+3];if(p<t||p===t&&m<=i){c++;continue}else if(p===t&&g<i)p===r&&m>s?m-=s-i:m=i;else if(p===t&&g===i)if(p===r&&m>s)m-=s-i;else{u=!0;continue}else if(p<r||p===r&&g<s)if(p===r&&m>s)p=t,g=i,m=g+(m-s);else{u=!0;continue}else if(p>r){if(l===0&&!u){c=a;break}p-=l}else if(p===r&&g>=s)e&&p===0&&(g+=e,m+=e),p-=l,g-=s-i,m-=s-i;else throw new Error("Not possible!");const v=4*c;o[v]=p,o[v+1]=g,o[v+2]=m,o[v+3]=_,c++}this._tokenCount=c}acceptInsertText(e,t,i,r,s,o){const a=i===0&&r===1&&(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122),l=this._tokens,c=this._tokenCount;for(let u=0;u<c;u++){const d=4*u;let f=l[d],p=l[d+1],g=l[d+2];if(!(f<e||f===e&&g<t)){if(f===e&&g===t)if(a)g+=1;else continue;else if(f===e&&p<t&&t<g)i===0?g+=r:g=t;else{if(f===e&&p===t&&a)continue;if(f===e)if(f+=i,i===0)p+=r,g+=r;else{const m=g-p;p=s+(p-t),g=p+m}else f+=i}l[d]=f,l[d+1]=p,l[d+2]=g}}}}class h7e{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 Rdr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},jce=function(n,e){return function(t,i){e(t,i,n)}};let l_e=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 c_e}getMetadata(e,t,i){const r=this._languageService.languageIdCodec.encodeLanguageId(i),s=this._hashTable.get(e,t,r);let o;if(s)o=s.metadata;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;const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof u>"u")o=2147483647;else{if(o=0,typeof u.italic<"u"){const d=(u.italic?1:0)<<11;o|=d|1}if(typeof u.bold<"u"){const d=(u.bold?2:0)<<11;o|=d|2}if(typeof u.underline<"u"){const d=(u.underline?4:0)<<11;o|=d|4}if(typeof u.strikethrough<"u"){const d=(u.strikethrough?8:0)<<11;o|=d|8}if(u.foreground){const d=u.foreground<<15;o|=d|16}o===0&&(o=2147483647)}}else o=2147483647,a="not-in-legend";this._hashTable.add(e,t,r,o)}return o}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,r,s){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${r} is outside the previous data (length ${s}).`))}};l_e=Rdr([jce(1,mc),jce(2,pa),jce(3,Uu)],l_e);function qat(n,e,t){const i=n.data,r=n.data.length/5|0,s=Math.max(Math.ceil(r/1024),400),o=[];let a=0,l=1,c=0;for(;a<r;){const u=a;let d=Math.min(u+s,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 f=new Uint32Array((d-u)*4),p=0,g=0,m=0,_=0;for(;a<d;){const b=5*a,y=i[b],C=i[b+1],S=l+y|0,k=y===0?c+C|0:C,I=i[b+2],L=k+I|0,N=i[b+3],P=i[b+4];if(L<=k)e.warnInvalidLengthSemanticTokens(S,k+1);else if(m===S&&_>k)e.warnOverlappingSemanticTokens(S,k+1);else{const O=e.getMetadata(N,P,t);O!==2147483647&&(g===0&&(g=S),f[p]=S-g,f[p+1]=k,f[p+2]=L,f[p+3]=O,p+=4,m=S,_=L)}l=S,c=k,a++}p!==f.length&&(f=f.subarray(0,p));const v=e6.create(g,f);o.push(v)}return o}class Pdr{constructor(e,t,i,r){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=r,this.next=null}}const wC=class wC{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=wC._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<wC._SIZES.length?2/3*this._currentLength:0),this._elements=[],wC._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 s=this._elements[r];for(;s;){if(s.tokenTypeIndex===e&&s.tokenModifierSet===t&&s.languageId===i)return s;s=s.next}return null}add(e,t,i,r){if(this._elementsCount++,this._growCount!==0&&this._elementsCount>=this._growCount){const s=this._elements;this._currentLengthIndex++,this._currentLength=wC._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<wC._SIZES.length?2/3*this._currentLength:0),this._elements=[],wC._nullOutEntries(this._elements,this._currentLength);for(const o of s){let a=o;for(;a;){const l=a.next;a.next=null,this._add(a),a=l}}}this._add(new Pdr(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}};wC._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];let c_e=wC;const mte=Ur("semanticTokensStylingService");var Odr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Fce=function(n,e){return function(t,i){e(t,i,n)}};let u_e=class extends Ye{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 l_e(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};u_e=Odr([Fce(0,mc),Fce(1,Uu),Fce(2,pa)],u_e);ns(mte,u_e,1);function Kx(n){return n===47||n===92}function Kat(n){return n.replace(/[\\/]/g,Rl.sep)}function Mdr(n){return n.indexOf("/")===-1&&(n=Kat(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}function f7e(n,e=Rl.sep){if(!n)return"";const t=n.length,i=n.charCodeAt(0);if(Kx(i)){if(Kx(n.charCodeAt(1))&&!Kx(n.charCodeAt(2))){let s=3;const o=s;for(;s<t&&!Kx(n.charCodeAt(s));s++);if(o!==s&&!Kx(n.charCodeAt(s+1))){for(s+=1;s<t;s++)if(Kx(n.charCodeAt(s)))return n.slice(0,s+1).replace(/[\\/]/g,e)}}return e}else if(Gat(i)&&n.charCodeAt(1)===58)return Kx(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(Kx(n.charCodeAt(r)))return n.slice(0,r+1)}return""}function d_e(n,e,t,i=Tb){if(n===e)return!0;if(!n||!e||e.length>n.length)return!1;if(t){if(!pke(n,e))return!1;if(e.length===n.length)return!0;let s=e.length;return e.charAt(e.length-1)===i&&s--,n.charAt(s)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function Gat(n){return n>=65&&n<=90||n>=97&&n<=122}function jdr(n,e=Wu){return e?Gat(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}const rW="**",p7e="/",oU="[/\\\\]",aU="[^/\\\\]",Fdr=/\//g;function g7e(n,e){switch(n){case 0:return"";case 1:return`${aU}*?`;default:return`(?:${oU}|${aU}+${oU}${e?`|${oU}${aU}+`:""})*?`}}function m7e(n,e){if(!n)return[];const t=[];let i=!1,r=!1,s="";for(const o of n){switch(o){case e:if(!i&&!r){t.push(s),s="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":r=!0;break;case"]":r=!1;break}s+=o}return s&&t.push(s),t}function Yat(n){if(!n)return"";let e="";const t=m7e(n,p7e);if(t.every(i=>i===rW))e=".*";else{let i=!1;t.forEach((r,s)=>{if(r===rW){if(i)return;e+=g7e(2,s===t.length-1)}else{let o=!1,a="",l=!1,c="";for(const u of r){if(u!=="}"&&o){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===p7e?d="":d=mg(u),c+=d;continue}switch(u){case"{":o=!0;continue;case"[":l=!0;continue;case"}":{const f=`(?:${m7e(a,",").map(p=>Yat(p)).join("|")})`;e+=f,o=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=aU;continue;case"*":e+=g7e(1);continue;default:e+=mg(u)}}s<t.length-1&&(t[s+1]!==rW||s+2<t.length)&&(e+=oU)}i=r===rW})}return e}const Bdr=/^\*\*\/\*\.[\w\.-]+$/,$dr=/^\*\*\/([\w\.-]+)\/?$/,Hdr=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,Vdr=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,Wdr=/^\*\*((\/[\w\.-]+)+)\/?$/,zdr=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,_7e=new b1(1e4),v7e=function(){return!1},jy=function(){return null};function Wke(n,e){if(!n)return jy;let t;typeof n!="string"?t=n.pattern:t=n,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let r=_7e.get(i);if(r)return b7e(r,n);let s;return Bdr.test(t)?r=Udr(t.substr(4),t):(s=$dr.exec(Bce(t,e)))?r=qdr(s[1],t):(e.trimForExclusions?Vdr:Hdr).test(t)?r=Kdr(t,e):(s=Wdr.exec(Bce(t,e)))?r=y7e(s[1].substr(1),t,!0):(s=zdr.exec(Bce(t,e)))?r=y7e(s[1],t,!1):r=Gdr(t),_7e.set(i,r),b7e(r,n)}function b7e(n,e){if(typeof e=="string")return n;const t=function(i,r){return d_e(i,e.base,!Nh)?n(W9(i.substr(e.base.length),Tb),r):null};return t.allBasenames=n.allBasenames,t.allPaths=n.allPaths,t.basenames=n.basenames,t.patterns=n.patterns,t}function Bce(n,e){return e.trimForExclusions&&n.endsWith("/**")?n.substr(0,n.length-2):n}function Udr(n,e){return function(t,i){return typeof t=="string"&&t.endsWith(n)?e:null}}function qdr(n,e){const t=`/${n}`,i=`\\${n}`,r=function(o,a){return typeof o!="string"?null:a?a===n?e:null:o===n||o.endsWith(t)||o.endsWith(i)?e:null},s=[n];return r.basenames=s,r.patterns=[e],r.allBasenames=s,r}function Kdr(n,e){const t=Xat(n.slice(1,-1).split(",").map(a=>Wke(a,e)).filter(a=>a!==jy),n),i=t.length;if(!i)return jy;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},s=t.find(a=>!!a.allBasenames);s&&(r.allBasenames=s.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(r.allPaths=o),r}function y7e(n,e,t){const i=Tb===Rl.sep,r=i?n:n.replace(Fdr,Tb),s=Tb+r,o=Rl.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===r||l.endsWith(s)||!i&&(l===n||l.endsWith(o)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===r||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function Gdr(n){try{const e=new RegExp(`^${Yat(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return jy}}function Ydr(n,e,t){return!n||typeof e!="string"?!1:Qat(n)(e,void 0,t)}function Qat(n,e={}){if(!n)return v7e;if(typeof n=="string"||Qdr(n)){const t=Wke(n,e);if(t===jy)return v7e;const i=function(r,s){return!!t(r,s)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return Xdr(n,e)}function Qdr(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Xdr(n,e){const t=Xat(Object.getOwnPropertyNames(n).map(a=>Zdr(a,n[a],e)).filter(a=>a!==jy)),i=t.length;if(!i)return jy;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(u,d){let f;for(let p=0,g=t.length;p<g;p++){const m=t[p](u,d);if(typeof m=="string")return m;Tme(m)&&(f||(f=[]),f.push(m))}return f?(async()=>{for(const p of f){const g=await p;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 f=0,p=t.length;f<p;f++){const g=t[f];g.requiresSiblings&&c&&(l||(l=lE(a)),u||(u=l.substr(0,l.length-Oor(a).length)));const m=g(a,l,u,c);if(typeof m=="string")return m;Tme(m)&&(d||(d=[]),d.push(m))}return d?(async()=>{for(const f of d){const p=await f;if(typeof p=="string")return p}return null})():null},s=t.find(a=>!!a.allBasenames);s&&(r.allBasenames=s.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(r.allPaths=o),r}function Zdr(n,e,t){if(e===!1)return jy;const i=Wke(n,t);if(i===jy)return jy;if(typeof e=="boolean")return i;if(e){const r=e.when;if(typeof r=="string"){const s=(o,a,l,c)=>{if(!c||!i(o,a))return null;const u=r.replace("$(basename)",()=>l),d=c(u);return Tme(d)?d.then(f=>f?n:null):d?n:null};return s.requiresSiblings=!0,s}}return i}function Xat(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 s=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};s.basenames=i,s.patterns=r,s.allBasenames=i;const o=n.filter(a=>!a.basenames);return o.push(s),o}function zke(n,e,t,i,r,s){if(Array.isArray(n)){let o=0;for(const a of n){const l=zke(a,e,t,i,r,s);if(l===10)return l;l>o&&(o=l)}return o}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:o,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(o)if(o===t)d=10;else if(o==="*")d=Math.max(d,5);else return 0;if(u)if(u===s)d=10;else if(u==="*"&&s!==void 0)d=Math.max(d,5);else return 0;if(a){let f;if(typeof a=="string"?f=a:f={...a,base:fot(a.base)},f===e.fsPath||Ydr(f,e.fsPath))d=10;else return 0}return d}else return 0}}function Zat(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(Zat):!!n.exclusive}class C7e{constructor(e,t,i,r,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=r,this.recursive=s}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)==null?void 0:t.toString())===((i=e.notebookUri)==null?void 0:i.toString())&&this.recursive===e.recursive}}class ga{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new Ue,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),gi(()=>{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,!1);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,r=>i.push(r.provider)),i}orderedGroups(e){const t=[];let i,r;return this._orderedForEach(e,!1,s=>{i&&r===s._score?i.push(s.provider):(r=s._score,i=[s.provider],t.push(i))}),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const r of this._entries)r._score>0&&i(r)}_updateScores(e,t){var s,o;const i=(s=this._notebookInfoResolver)==null?void 0:s.call(this,e.uri),r=i?new C7e(e.uri,e.getLanguageId(),i.uri,i.type,t):new C7e(e.uri,e.getLanguageId(),void 0,void 0,t);if(!((o=this._lastCandidate)!=null&&o.equals(r))){this._lastCandidate=r;for(const a of this._entries)if(a._score=zke(a.selector,r.uri,r.languageId,Tat(e),r.notebookUri,r.notebookType),Zat(a.selector)&&a._score>0)if(t)a._score=0;else{for(const l of this._entries)l._score=0;a._score=1e3;break}this._entries.sort(ga._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:Yj(e.selector)&&!Yj(t.selector)?1:!Yj(e.selector)&&Yj(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}}function Yj(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(Yj):!!n.isBuiltin}class Jdr{constructor(){this.referenceProvider=new ga(this._score.bind(this)),this.renameProvider=new ga(this._score.bind(this)),this.newSymbolNamesProvider=new ga(this._score.bind(this)),this.codeActionProvider=new ga(this._score.bind(this)),this.definitionProvider=new ga(this._score.bind(this)),this.typeDefinitionProvider=new ga(this._score.bind(this)),this.declarationProvider=new ga(this._score.bind(this)),this.implementationProvider=new ga(this._score.bind(this)),this.documentSymbolProvider=new ga(this._score.bind(this)),this.inlayHintsProvider=new ga(this._score.bind(this)),this.colorProvider=new ga(this._score.bind(this)),this.codeLensProvider=new ga(this._score.bind(this)),this.documentFormattingEditProvider=new ga(this._score.bind(this)),this.documentRangeFormattingEditProvider=new ga(this._score.bind(this)),this.onTypeFormattingEditProvider=new ga(this._score.bind(this)),this.signatureHelpProvider=new ga(this._score.bind(this)),this.hoverProvider=new ga(this._score.bind(this)),this.documentHighlightProvider=new ga(this._score.bind(this)),this.multiDocumentHighlightProvider=new ga(this._score.bind(this)),this.selectionRangeProvider=new ga(this._score.bind(this)),this.foldingRangeProvider=new ga(this._score.bind(this)),this.linkProvider=new ga(this._score.bind(this)),this.inlineCompletionsProvider=new ga(this._score.bind(this)),this.inlineEditProvider=new ga(this._score.bind(this)),this.completionProvider=new ga(this._score.bind(this)),this.linkedEditingRangeProvider=new ga(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new ga(this._score.bind(this)),this.documentSemanticTokensProvider=new ga(this._score.bind(this)),this.documentDropEditProvider=new ga(this._score.bind(this)),this.documentPasteEditProvider=new ga(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)==null?void 0:t.call(this,e)}}ns(Fn,Jdr,1);function Uke(n){return`--vscode-${n.replace(/\./g,"-")}`}function kn(n){return`var(${Uke(n)})`}function ehr(n,e){return`var(${Uke(n)}, ${e})`}function thr(n){return n!==null&&typeof n=="object"&&"light"in n&&"dark"in n}const Jat={ColorContribution:"base.contributions.colors"},nhr="default";class ihr{constructor(){this._onDidChangeSchema=new Ue,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,r=!1,s){const o={id:e,description:i,defaults:t,needsTransparency:r,deprecationMessage:s};this.colorsById[e]=o;const a={type:"string",format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return s&&(a.deprecationMessage=s),r&&(a.pattern="^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage=A("transparecyRequired","This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={description:i,oneOf:[a,{type:"string",const:nhr,description:A("useDefault","Use the default color.")}]},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!=null&&i.defaults){const r=thr(i.defaults)?i.defaults[t.type]:i.defaults;return Hv(r,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const r=t.indexOf(".")===-1?0:1,s=i.indexOf(".")===-1?0:1;return r!==s?r-s:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` `)}}const _te=new ihr;Ca.add(Jat.ColorContribution,_te);function ve(n,e,t,i,r){return _te.registerColor(n,e,t,i,r)}function rhr(n,e){var t,i,r,s;switch(n.op){case 0:return(t=Hv(n.value,e))==null?void 0:t.darken(n.factor);case 1:return(i=Hv(n.value,e))==null?void 0:i.lighten(n.factor);case 2:return(r=Hv(n.value,e))==null?void 0:r.transparent(n.factor);case 3:{const o=Hv(n.background,e);return o?(s=Hv(n.value,e))==null?void 0:s.makeOpaque(o):Hv(n.value,e)}case 4:for(const o of n.values){const a=Hv(o,e);if(a)return a}return;case 6:return Hv(e.defines(n.if)?n.then:n.else,e);case 5:{const o=Hv(n.value,e);if(!o)return;const a=Hv(n.background,e);return a?o.isDarkerThan(a)?At.getLighterColor(o,a,n.factor).transparent(n.transparency):At.getDarkerColor(o,a,n.factor).transparent(n.transparency):o.transparent(n.factor*n.transparency)}default:throw cte()}}function VA(n,e){return{op:0,value:n,factor:e}}function Nb(n,e){return{op:1,value:n,factor:e}}function Ir(n,e){return{op:2,value:n,factor:e}}function _7(...n){return{op:4,values:n}}function shr(n,e,t){return{op:6,if:n,then:e,else:t}}function w7e(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function Hv(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?At.fromHex(n):e.getColor(n);if(n instanceof At)return n;if(typeof n=="object")return rhr(n,e)}}const elt="vscode://schemas/workbench-colors",tlt=Ca.as(fte.JSONContribution);tlt.registerSchema(elt,_te.getColorSchema());const x7e=new ao(()=>tlt.notifySchemaChanged(elt),200);_te.onDidChangeSchema(()=>{x7e.isScheduled()||x7e.schedule()});const Or=ve("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},A("foreground","Overall foreground color. This color is only used if not overridden by a component."));ve("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},A("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));ve("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},A("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));ve("descriptionForeground",{light:"#717171",dark:Ir(Or,.7),hcDark:Ir(Or,.7),hcLight:Ir(Or,.7)},A("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const aG=ve("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},A("iconForeground","The default color for icons in the workbench.")),Yy=ve("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},A("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),ls=ve("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},A("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),aa=ve("contrastActiveBorder",{light:null,dark:null,hcDark:Yy,hcLight:Yy},A("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));ve("selection.background",null,A("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."));const ohr=ve("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},A("textLinkForeground","Foreground color for links in text."));ve("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},A("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));ve("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:At.black,hcLight:"#292929"},A("textSeparatorForeground","Color for text separators."));ve("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},A("textPreformatForeground","Foreground color for preformatted text segments."));ve("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},A("textPreformatBackground","Background color for preformatted text segments."));ve("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},A("textBlockQuoteBackground","Background color for block quotes in text."));ve("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:At.white,hcLight:"#292929"},A("textBlockQuoteBorder","Border color for block quotes in text."));ve("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:At.black,hcLight:"#F2F2F2"},A("textCodeBlockBackground","Background color for code blocks in text."));ve("sash.hoverBorder",Yy,A("sashActiveBorder","Border color of active sashes."));const lU=ve("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:At.black,hcLight:"#0F4A85"},A("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),ahr=ve("badge.foreground",{dark:At.white,light:"#333",hcDark:At.white,hcLight:At.white},A("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),qke=ve("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},A("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),nlt=ve("scrollbarSlider.background",{dark:At.fromHex("#797979").transparent(.4),light:At.fromHex("#646464").transparent(.4),hcDark:Ir(ls,.6),hcLight:Ir(ls,.4)},A("scrollbarSliderBackground","Scrollbar slider background color.")),ilt=ve("scrollbarSlider.hoverBackground",{dark:At.fromHex("#646464").transparent(.7),light:At.fromHex("#646464").transparent(.7),hcDark:Ir(ls,.8),hcLight:Ir(ls,.8)},A("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),rlt=ve("scrollbarSlider.activeBackground",{dark:At.fromHex("#BFBFBF").transparent(.4),light:At.fromHex("#000000").transparent(.6),hcDark:ls,hcLight:ls},A("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),lhr=ve("progressBar.background",{dark:At.fromHex("#0E70C0"),light:At.fromHex("#0E70C0"),hcDark:ls,hcLight:ls},A("progressBarBackground","Background color of the progress bar that can show for long running operations.")),lv=ve("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:At.black,hcLight:At.white},A("editorBackground","Editor background color.")),y1=ve("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:At.white,hcLight:Or},A("editorForeground","Editor default foreground color."));ve("editorStickyScroll.background",lv,A("editorStickyScrollBackground","Background color of sticky scroll in the editor"));ve("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:At.fromHex("#0F4A85").transparent(.1)},A("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));ve("editorStickyScroll.border",{dark:null,light:null,hcDark:ls,hcLight:ls},A("editorStickyScrollBorder","Border color of sticky scroll in the editor"));ve("editorStickyScroll.shadow",qke,A("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const ig=ve("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:At.white},A("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),vte=ve("editorWidget.foreground",Or,A("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Kke=ve("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:ls,hcLight:ls},A("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."));ve("editorWidget.resizeBorder",null,A("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."));ve("editorError.background",null,A("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 bte=ve("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},A("editorError.foreground","Foreground color of error squigglies in the editor.")),chr=ve("editorError.border",{dark:null,light:null,hcDark:At.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},A("errorBorder","If set, color of double underlines for errors in the editor.")),uhr=ve("editorWarning.background",null,A("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Rw=ve("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},A("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),v7=ve("editorWarning.border",{dark:null,light:null,hcDark:At.fromHex("#FFCC00").transparent(.8),hcLight:At.fromHex("#FFCC00").transparent(.8)},A("warningBorder","If set, color of double underlines for warnings in the editor."));ve("editorInfo.background",null,A("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 Qy=ve("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},A("editorInfo.foreground","Foreground color of info squigglies in the editor.")),b7=ve("editorInfo.border",{dark:null,light:null,hcDark:At.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},A("infoBorder","If set, color of double underlines for infos in the editor.")),dhr=ve("editorHint.foreground",{dark:At.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},A("editorHint.foreground","Foreground color of hint squigglies in the editor."));ve("editorHint.border",{dark:null,light:null,hcDark:At.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},A("hintBorder","If set, color of double underlines for hints in the editor."));const hhr=ve("editorLink.activeForeground",{dark:"#4E94CE",light:At.blue,hcDark:At.cyan,hcLight:"#292929"},A("activeLinkForeground","Color of active links.")),FS=ve("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},A("editorSelectionBackground","Color of the editor selection.")),fhr=ve("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:At.white},A("editorSelectionForeground","Color of the selected text for high contrast.")),slt=ve("editor.inactiveSelectionBackground",{light:Ir(FS,.5),dark:Ir(FS,.5),hcDark:Ir(FS,.7),hcLight:Ir(FS,.5)},A("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Gke=ve("editor.selectionHighlightBackground",{light:w7e(FS,lv,.3,.6),dark:w7e(FS,lv,.3,.6),hcDark:null,hcLight:null},A("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);ve("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:aa,hcLight:aa},A("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));ve("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},A("editorFindMatch","Color of the current search match."));const phr=ve("editor.findMatchForeground",null,A("editorFindMatchForeground","Text color of the current search match.")),KC=ve("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},A("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),ghr=ve("editor.findMatchHighlightForeground",null,A("findMatchHighlightForeground","Foreground color of the other search matches."),!0);ve("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},A("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);ve("editor.findMatchBorder",{light:null,dark:null,hcDark:aa,hcLight:aa},A("editorFindMatchBorder","Border color of the current search match."));const BS=ve("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:aa,hcLight:aa},A("findMatchHighlightBorder","Border color of the other search matches.")),mhr=ve("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Ir(aa,.4),hcLight:Ir(aa,.4)},A("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);ve("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},A("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 lG=ve("editorHoverWidget.background",ig,A("hoverBackground","Background color of the editor hover."));ve("editorHoverWidget.foreground",vte,A("hoverForeground","Foreground color of the editor hover."));const olt=ve("editorHoverWidget.border",Kke,A("hoverBorder","Border color of the editor hover."));ve("editorHoverWidget.statusBarBackground",{dark:Nb(lG,.2),light:VA(lG,.05),hcDark:ig,hcLight:ig},A("statusBarBackground","Background color of the editor hover status bar."));const Yke=ve("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:At.white,hcLight:At.black},A("editorInlayHintForeground","Foreground color of inline hints")),Qke=ve("editorInlayHint.background",{dark:Ir(lU,.1),light:Ir(lU,.1),hcDark:Ir(At.white,.1),hcLight:Ir(lU,.1)},A("editorInlayHintBackground","Background color of inline hints")),_hr=ve("editorInlayHint.typeForeground",Yke,A("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),vhr=ve("editorInlayHint.typeBackground",Qke,A("editorInlayHintBackgroundTypes","Background color of inline hints for types")),bhr=ve("editorInlayHint.parameterForeground",Yke,A("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),yhr=ve("editorInlayHint.parameterBackground",Qke,A("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),Chr=ve("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},A("editorLightBulbForeground","The color used for the lightbulb actions icon."));ve("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},A("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));ve("editorLightBulbAi.foreground",Chr,A("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));ve("editor.snippetTabstopHighlightBackground",{dark:new At(new ds(124,124,124,.3)),light:new At(new ds(10,50,100,.2)),hcDark:new At(new ds(124,124,124,.3)),hcLight:new At(new ds(10,50,100,.2))},A("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));ve("editor.snippetTabstopHighlightBorder",null,A("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));ve("editor.snippetFinalTabstopHighlightBackground",null,A("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));ve("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new At(new ds(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},A("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const h_e=new At(new ds(155,185,85,.2)),f_e=new At(new ds(255,0,0,.2)),whr=ve("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},A("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),xhr=ve("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},A("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);ve("diffEditor.insertedLineBackground",{dark:h_e,light:h_e,hcDark:null,hcLight:null},A("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);ve("diffEditor.removedLineBackground",{dark:f_e,light:f_e,hcDark:null,hcLight:null},A("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);ve("diffEditorGutter.insertedLineBackground",null,A("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));ve("diffEditorGutter.removedLineBackground",null,A("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const Shr=ve("diffEditorOverview.insertedForeground",null,A("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Ehr=ve("diffEditorOverview.removedForeground",null,A("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));ve("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},A("diffEditorInsertedOutline","Outline color for the text that got inserted."));ve("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},A("diffEditorRemovedOutline","Outline color for text that got removed."));ve("diffEditor.border",{dark:null,light:null,hcDark:ls,hcLight:ls},A("diffEditorBorder","Border color between the two text editors."));ve("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},A("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));ve("diffEditor.unchangedRegionBackground","sideBar.background",A("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));ve("diffEditor.unchangedRegionForeground","foreground",A("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));ve("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},A("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const q4=ve("widget.shadow",{dark:Ir(At.black,.36),light:Ir(At.black,.16),hcDark:null,hcLight:null},A("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),alt=ve("widget.border",{dark:null,light:null,hcDark:ls,hcLight:ls},A("widgetBorder","Border color of widgets such as find/replace inside the editor.")),S7e=ve("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},A("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));ve("toolbar.hoverOutline",{dark:null,light:null,hcDark:aa,hcLight:aa},A("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));ve("toolbar.activeBackground",{dark:Nb(S7e,.1),light:VA(S7e,.1),hcDark:null,hcLight:null},A("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));const khr=ve("breadcrumb.foreground",Ir(Or,.8),A("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Thr=ve("breadcrumb.background",lv,A("breadcrumbsBackground","Background color of breadcrumb items.")),E7e=ve("breadcrumb.focusForeground",{light:VA(Or,.2),dark:Nb(Or,.1),hcDark:Nb(Or,.1),hcLight:Nb(Or,.1)},A("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Ihr=ve("breadcrumb.activeSelectionForeground",{light:VA(Or,.2),dark:Nb(Or,.1),hcDark:Nb(Or,.1),hcLight:Nb(Or,.1)},A("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));ve("breadcrumbPicker.background",ig,A("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const llt=.5,k7e=At.fromHex("#40C8AE").transparent(llt),T7e=At.fromHex("#40A6FF").transparent(llt),I7e=At.fromHex("#606060").transparent(.4),Xke=.4,uM=1,p_e=ve("merge.currentHeaderBackground",{dark:k7e,light:k7e,hcDark:null,hcLight:null},A("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);ve("merge.currentContentBackground",Ir(p_e,Xke),A("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const g_e=ve("merge.incomingHeaderBackground",{dark:T7e,light:T7e,hcDark:null,hcLight:null},A("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);ve("merge.incomingContentBackground",Ir(g_e,Xke),A("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const m_e=ve("merge.commonHeaderBackground",{dark:I7e,light:I7e,hcDark:null,hcLight:null},A("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);ve("merge.commonContentBackground",Ir(m_e,Xke),A("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const dM=ve("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},A("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));ve("editorOverviewRuler.currentContentForeground",{dark:Ir(p_e,uM),light:Ir(p_e,uM),hcDark:dM,hcLight:dM},A("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));ve("editorOverviewRuler.incomingContentForeground",{dark:Ir(g_e,uM),light:Ir(g_e,uM),hcDark:dM,hcLight:dM},A("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));ve("editorOverviewRuler.commonContentForeground",{dark:Ir(m_e,uM),light:Ir(m_e,uM),hcDark:dM,hcLight:dM},A("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const $ce=ve("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},A("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),clt=ve("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",A("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Lhr=ve("problemsErrorIcon.foreground",bte,A("problemsErrorIconForeground","The color used for the problems error icon.")),Ahr=ve("problemsWarningIcon.foreground",Rw,A("problemsWarningIconForeground","The color used for the problems warning icon.")),Nhr=ve("problemsInfoIcon.foreground",Qy,A("problemsInfoIconForeground","The color used for the problems info icon.")),__e=ve("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},A("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),yte=ve("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},A("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),L7e=ve("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},A("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Dhr=ve("minimap.infoHighlight",{dark:Qy,light:Qy,hcDark:b7,hcLight:b7},A("minimapInfo","Minimap marker color for infos.")),Rhr=ve("minimap.warningHighlight",{dark:Rw,light:Rw,hcDark:v7,hcLight:v7},A("overviewRuleWarning","Minimap marker color for warnings.")),Phr=ve("minimap.errorHighlight",{dark:new At(new ds(255,18,18,.7)),light:new At(new ds(255,18,18,.7)),hcDark:new At(new ds(255,50,50,1)),hcLight:"#B5200D"},A("minimapError","Minimap marker color for errors.")),Ohr=ve("minimap.background",null,A("minimapBackground","Minimap background color.")),Mhr=ve("minimap.foregroundOpacity",At.fromHex("#000f"),A("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));ve("minimapSlider.background",Ir(nlt,.5),A("minimapSliderBackground","Minimap slider background color."));ve("minimapSlider.hoverBackground",Ir(ilt,.5),A("minimapSliderHoverBackground","Minimap slider background color when hovering."));ve("minimapSlider.activeBackground",Ir(rlt,.5),A("minimapSliderActiveBackground","Minimap slider background color when clicked on."));ve("charts.foreground",Or,A("chartsForeground","The foreground color used in charts."));ve("charts.lines",Ir(Or,.5),A("chartsLines","The color used for horizontal lines in charts."));ve("charts.red",bte,A("chartsRed","The red color used in chart visualizations."));ve("charts.blue",Qy,A("chartsBlue","The blue color used in chart visualizations."));ve("charts.yellow",Rw,A("chartsYellow","The yellow color used in chart visualizations."));ve("charts.orange",__e,A("chartsOrange","The orange color used in chart visualizations."));ve("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},A("chartsGreen","The green color used in chart visualizations."));ve("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},A("chartsPurple","The purple color used in chart visualizations."));const v_e=ve("input.background",{dark:"#3C3C3C",light:At.white,hcDark:At.black,hcLight:At.white},A("inputBoxBackground","Input box background.")),ult=ve("input.foreground",Or,A("inputBoxForeground","Input box foreground.")),dlt=ve("input.border",{dark:null,light:null,hcDark:ls,hcLight:ls},A("inputBoxBorder","Input box border.")),Cte=ve("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:ls,hcLight:ls},A("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),jhr=ve("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},A("inputOption.hoverBackground","Background color of activated options in input fields.")),X9=ve("inputOption.activeBackground",{dark:Ir(Yy,.4),light:Ir(Yy,.2),hcDark:At.transparent,hcLight:At.transparent},A("inputOption.activeBackground","Background hover color of options in input fields.")),wte=ve("inputOption.activeForeground",{dark:At.white,light:At.black,hcDark:Or,hcLight:Or},A("inputOption.activeForeground","Foreground color of activated options in input fields."));ve("input.placeholderForeground",{light:Ir(Or,.5),dark:Ir(Or,.5),hcDark:Ir(Or,.7),hcLight:Ir(Or,.7)},A("inputPlaceholderForeground","Input box foreground color for placeholder text."));const Fhr=ve("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:At.black,hcLight:At.white},A("inputValidationInfoBackground","Input validation background color for information severity.")),Bhr=ve("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Or},A("inputValidationInfoForeground","Input validation foreground color for information severity.")),$hr=ve("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:ls,hcLight:ls},A("inputValidationInfoBorder","Input validation border color for information severity.")),Hhr=ve("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:At.black,hcLight:At.white},A("inputValidationWarningBackground","Input validation background color for warning severity.")),Vhr=ve("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Or},A("inputValidationWarningForeground","Input validation foreground color for warning severity.")),Whr=ve("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:ls,hcLight:ls},A("inputValidationWarningBorder","Input validation border color for warning severity.")),zhr=ve("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:At.black,hcLight:At.white},A("inputValidationErrorBackground","Input validation background color for error severity.")),Uhr=ve("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Or},A("inputValidationErrorForeground","Input validation foreground color for error severity.")),qhr=ve("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:ls,hcLight:ls},A("inputValidationErrorBorder","Input validation border color for error severity.")),xte=ve("dropdown.background",{dark:"#3C3C3C",light:At.white,hcDark:At.black,hcLight:At.white},A("dropdownBackground","Dropdown background.")),Khr=ve("dropdown.listBackground",{dark:null,light:null,hcDark:At.black,hcLight:At.white},A("dropdownListBackground","Dropdown list background.")),Zke=ve("dropdown.foreground",{dark:"#F0F0F0",light:Or,hcDark:At.white,hcLight:Or},A("dropdownForeground","Dropdown foreground.")),Jke=ve("dropdown.border",{dark:xte,light:"#CECECE",hcDark:ls,hcLight:ls},A("dropdownBorder","Dropdown border.")),hlt=ve("button.foreground",At.white,A("buttonForeground","Button foreground color.")),Ghr=ve("button.separator",Ir(hlt,.4),A("buttonSeparator","Button separator color.")),Qj=ve("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},A("buttonBackground","Button background color.")),Yhr=ve("button.hoverBackground",{dark:Nb(Qj,.2),light:VA(Qj,.2),hcDark:Qj,hcLight:Qj},A("buttonHoverBackground","Button background color when hovering.")),Qhr=ve("button.border",ls,A("buttonBorder","Button border color.")),Xhr=ve("button.secondaryForeground",{dark:At.white,light:At.white,hcDark:At.white,hcLight:Or},A("buttonSecondaryForeground","Secondary button foreground color.")),b_e=ve("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:At.white},A("buttonSecondaryBackground","Secondary button background color.")),Zhr=ve("button.secondaryHoverBackground",{dark:Nb(b_e,.2),light:VA(b_e,.2),hcDark:null,hcLight:null},A("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),Xj=ve("radio.activeForeground",wte,A("radioActiveForeground","Foreground color of active radio option.")),Jhr=ve("radio.activeBackground",X9,A("radioBackground","Background color of active radio option.")),efr=ve("radio.activeBorder",Cte,A("radioActiveBorder","Border color of the active radio option.")),tfr=ve("radio.inactiveForeground",null,A("radioInactiveForeground","Foreground color of inactive radio option.")),nfr=ve("radio.inactiveBackground",null,A("radioInactiveBackground","Background color of inactive radio option.")),ifr=ve("radio.inactiveBorder",{light:Ir(Xj,.2),dark:Ir(Xj,.2),hcDark:Ir(Xj,.4),hcLight:Ir(Xj,.2)},A("radioInactiveBorder","Border color of the inactive radio option.")),rfr=ve("radio.inactiveHoverBackground",jhr,A("radioHoverBackground","Background color of inactive active radio option when hovering.")),sfr=ve("checkbox.background",xte,A("checkbox.background","Background color of checkbox widget."));ve("checkbox.selectBackground",ig,A("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const ofr=ve("checkbox.foreground",Zke,A("checkbox.foreground","Foreground color of checkbox widget.")),afr=ve("checkbox.border",Jke,A("checkbox.border","Border color of checkbox widget."));ve("checkbox.selectBorder",aG,A("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const lfr=ve("keybindingLabel.background",{dark:new At(new ds(128,128,128,.17)),light:new At(new ds(221,221,221,.4)),hcDark:At.transparent,hcLight:At.transparent},A("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),cfr=ve("keybindingLabel.foreground",{dark:At.fromHex("#CCCCCC"),light:At.fromHex("#555555"),hcDark:At.white,hcLight:Or},A("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),ufr=ve("keybindingLabel.border",{dark:new At(new ds(51,51,51,.6)),light:new At(new ds(204,204,204,.4)),hcDark:new At(new ds(111,195,223)),hcLight:ls},A("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),dfr=ve("keybindingLabel.bottomBorder",{dark:new At(new ds(68,68,68,.6)),light:new At(new ds(187,187,187,.4)),hcDark:new At(new ds(111,195,223)),hcLight:Or},A("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),hfr=ve("list.focusBackground",null,A("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.")),ffr=ve("list.focusForeground",null,A("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.")),pfr=ve("list.focusOutline",{dark:Yy,light:Yy,hcDark:aa,hcLight:aa},A("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.")),gfr=ve("list.focusAndSelectionOutline",null,A("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.")),WL=ve("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:At.fromHex("#0F4A85").transparent(.1)},A("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.")),y7=ve("list.activeSelectionForeground",{dark:At.white,light:At.white,hcDark:null,hcLight:null},A("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.")),flt=ve("list.activeSelectionIconForeground",null,A("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.")),mfr=ve("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:At.fromHex("#0F4A85").transparent(.1)},A("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.")),_fr=ve("list.inactiveSelectionForeground",null,A("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.")),vfr=ve("list.inactiveSelectionIconForeground",null,A("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.")),bfr=ve("list.inactiveFocusBackground",null,A("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.")),yfr=ve("list.inactiveFocusOutline",null,A("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.")),plt=ve("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:At.white.transparent(.1),hcLight:At.fromHex("#0F4A85").transparent(.1)},A("listHoverBackground","List/Tree background when hovering over items using the mouse.")),glt=ve("list.hoverForeground",null,A("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Cfr=ve("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},A("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),wfr=ve("list.dropBetweenBackground",{dark:aG,light:aG,hcDark:null,hcLight:null},A("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),DR=ve("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Yy,hcLight:Yy},A("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),xfr=ve("list.focusHighlightForeground",{dark:DR,light:shr(WL,DR,"#BBE7FF"),hcDark:DR,hcLight:DR},A("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));ve("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},A("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));ve("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},A("listErrorForeground","Foreground color of list items containing errors."));ve("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},A("listWarningForeground","Foreground color of list items containing warnings."));const Sfr=ve("listFilterWidget.background",{light:VA(ig,0),dark:Nb(ig,0),hcDark:ig,hcLight:ig},A("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),Efr=ve("listFilterWidget.outline",{dark:At.transparent,light:At.transparent,hcDark:"#f38518",hcLight:"#007ACC"},A("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),kfr=ve("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:ls,hcLight:ls},A("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Tfr=ve("listFilterWidget.shadow",q4,A("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));ve("list.filterMatchBackground",{dark:KC,light:KC,hcDark:null,hcLight:null},A("listFilterMatchHighlight","Background color of the filtered match."));ve("list.filterMatchBorder",{dark:BS,light:BS,hcDark:ls,hcLight:aa},A("listFilterMatchHighlightBorder","Border color of the filtered match."));ve("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},A("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized."));const mlt=ve("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},A("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Ifr=ve("tree.inactiveIndentGuidesStroke",Ir(mlt,.4),A("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),Lfr=ve("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},A("tableColumnsBorder","Table border color between columns.")),Afr=ve("tree.tableOddRowsBackground",{dark:Ir(Or,.04),light:Ir(Or,.04),hcDark:null,hcLight:null},A("tableOddRowsBackgroundColor","Background color for odd table rows."));ve("editorActionList.background",ig,A("editorActionListBackground","Action List background color."));ve("editorActionList.foreground",vte,A("editorActionListForeground","Action List foreground color."));ve("editorActionList.focusForeground",y7,A("editorActionListFocusForeground","Action List foreground color for the focused item."));ve("editorActionList.focusBackground",WL,A("editorActionListFocusBackground","Action List background color for the focused item."));const Nfr=ve("menu.border",{dark:null,light:null,hcDark:ls,hcLight:ls},A("menuBorder","Border color of menus.")),Dfr=ve("menu.foreground",Zke,A("menuForeground","Foreground color of menu items.")),Rfr=ve("menu.background",xte,A("menuBackground","Background color of menu items.")),Pfr=ve("menu.selectionForeground",y7,A("menuSelectionForeground","Foreground color of the selected menu item in menus.")),Ofr=ve("menu.selectionBackground",WL,A("menuSelectionBackground","Background color of the selected menu item in menus.")),Mfr=ve("menu.selectionBorder",{dark:null,light:null,hcDark:aa,hcLight:aa},A("menuSelectionBorder","Border color of the selected menu item in menus.")),jfr=ve("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:ls,hcLight:ls},A("menuSeparatorBackground","Color of a separator menu item in menus.")),A7e=ve("quickInput.background",ig,A("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Ffr=ve("quickInput.foreground",vte,A("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Bfr=ve("quickInputTitle.background",{dark:new At(new ds(255,255,255,.105)),light:new At(new ds(0,0,0,.06)),hcDark:"#000000",hcLight:At.white},A("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),_lt=ve("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:At.white,hcLight:"#0F4A85"},A("pickerGroupForeground","Quick picker color for grouping labels.")),$fr=ve("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:At.white,hcLight:"#0F4A85"},A("pickerGroupBorder","Quick picker color for grouping borders.")),N7e=ve("quickInput.list.focusBackground",null,"",void 0,A("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),C7=ve("quickInputList.focusForeground",y7,A("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),eTe=ve("quickInputList.focusIconForeground",flt,A("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),w7=ve("quickInputList.focusBackground",{dark:_7(N7e,WL),light:_7(N7e,WL),hcDark:null,hcLight:null},A("quickInput.listFocusBackground","Quick picker background color for the focused item."));ve("search.resultsInfoForeground",{light:Or,dark:Ir(Or,.65),hcDark:Or,hcLight:Or},A("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));ve("searchEditor.findMatchBackground",{light:Ir(KC,.66),dark:Ir(KC,.66),hcDark:KC,hcLight:KC},A("searchEditor.queryMatch","Color of the Search Editor query matches."));ve("searchEditor.findMatchBorder",{light:Ir(BS,.66),dark:Ir(BS,.66),hcDark:BS,hcLight:BS},A("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));var Hfr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},D7e=function(n,e){return function(t,i){e(t,i,n)}};const C1=Ur("hoverService");let hM=class extends Ye{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},r,s){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=r,this.hoverService=s,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new Et),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const r=Lc(e.target)?[e.target]:e.target.targetElements;for(const o of r)this.hoverDisposables.add(Da(o,"keydown",a=>{a.equals(9)&&this.hoverService.hideHover()}));const s=Lc(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:s,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime<this.timeLimit}onDidHideHover(){this.hoverDisposables.clear(),this.instantHover&&(this.lastHoverHideTime=Date.now())}};hM=Hfr([D7e(3,Dr),D7e(4,C1)],hM);const Zw=Ur("contextViewService"),up=Ur("contextMenuService"),Ws=Ur("keybindingService");class K4{constructor(){this._hooks=new Et,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,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=s;let o=e;try{e.setPointerCapture(t),this._hooks.add(gi(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=Ti(e)}this._hooks.add(_t(o,Xt.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(_t(o,Xt.POINTER_UP,a=>this.stopMonitoring(!0)))}}function xl(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 s=`$memoize$${e}`;t[i]=function(...o){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[s]}}var Vfr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Oo;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(Oo||(Oo={}));const Du=class Du extends Ye{constructor(){super(),this.dispatched=!1,this.targets=new Ch,this.ignoreTargets=new Ch,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(rn.runAndSubscribe(Zee,({window:e,disposables:t})=>{t.add(_t(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(_t(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(_t(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:bo,disposables:this._store}))}static addTarget(e){if(!Du.isTouchDevice())return Ye.None;Du.INSTANCE||(Du.INSTANCE=new Du);const t=Du.INSTANCE.targets.push(e);return gi(t)}static ignoreTarget(e){if(!Du.isTouchDevice())return Ye.None;Du.INSTANCE||(Du.INSTANCE=new Du);const t=Du.INSTANCE.ignoreTargets.push(e);return gi(t)}static isTouchDevice(){return"ontouchstart"in bo||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 s=e.targetTouches.item(i);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:t,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[t],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};const o=this.newGestureEvent(Oo.Start,s.target);o.pageX=s.pageX,o.pageY=s.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,t){const i=Date.now(),r=Object.keys(this.activeTouches).length;for(let s=0,o=t.changedTouches.length;s<o;s++){const a=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}const l=this.activeTouches[a.identifier],c=Date.now()-l.initialTimeStamp;if(c<Du.HOLD_DELAY&&Math.abs(l.initialPageX-Kg(l.rollingPageX))<30&&Math.abs(l.initialPageY-Kg(l.rollingPageY))<30){const u=this.newGestureEvent(Oo.Tap,l.initialTarget);u.pageX=Kg(l.rollingPageX),u.pageY=Kg(l.rollingPageY),this.dispatchEvent(u)}else if(c>=Du.HOLD_DELAY&&Math.abs(l.initialPageX-Kg(l.rollingPageX))<30&&Math.abs(l.initialPageY-Kg(l.rollingPageY))<30){const u=this.newGestureEvent(Oo.Contextmenu,l.initialTarget);u.pageX=Kg(l.rollingPageX),u.pageY=Kg(l.rollingPageY),this.dispatchEvent(u)}else if(r===1){const u=Kg(l.rollingPageX),d=Kg(l.rollingPageY),f=Kg(l.rollingTimestamps)-l.rollingTimestamps[0],p=u-l.rollingPageX[0],g=d-l.rollingPageY[0],m=[...this.targets].filter(_=>l.initialTarget instanceof Node&&_.contains(l.initialTarget));this.inertia(e,m,i,Math.abs(p)/f,p>0?1:-1,u,Math.abs(g)/f,g>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Oo.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.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===Oo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Du.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Oo.Change||e.type===Oo.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let r=0,s=e.initialTarget;for(;s&&s!==i;)r++,s=s.parentElement;t.push([r,i])}t.sort((i,r)=>i[0]-r[0]);for(const[i,r]of t)r.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,r,s,o,a,l,c){this.handle=lp(e,()=>{const u=Date.now(),d=u-i;let f=0,p=0,g=!0;r+=Du.SCROLL_FRICTION*d,a+=Du.SCROLL_FRICTION*d,r>0&&(g=!1,f=s*r*d),a>0&&(g=!1,p=l*a*d);const m=this.newGestureEvent(Oo.Change);m.translationX=f,m.translationY=p,t.forEach(_=>_.dispatchEvent(m)),g||this.inertia(e,t,u,r,s,o+f,a,l,c+p)})}onTouchMove(e){const t=Date.now();for(let i=0,r=e.changedTouches.length;i<r;i++){const s=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}const o=this.activeTouches[s.identifier],a=this.newGestureEvent(Oo.Change,o.initialTarget);a.translationX=s.pageX-Kg(o.rollingPageX),a.translationY=s.pageY-Kg(o.rollingPageY),a.pageX=s.pageX,a.pageY=s.pageY,this.dispatchEvent(a),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(s.pageX),o.rollingPageY.push(s.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Du.SCROLL_FRICTION=-.005,Du.HOLD_DELAY=700,Du.CLEAR_TAP_COUNT_TIME=400;let dd=Du;Vfr([xl],dd,"isTouchDevice",null);let Tg=class extends Ye{onclick(e,t){this._register(_t(e,Xt.CLICK,i=>t(new B_(Ti(e),i))))}onmousedown(e,t){this._register(_t(e,Xt.MOUSE_DOWN,i=>t(new B_(Ti(e),i))))}onmouseover(e,t){this._register(_t(e,Xt.MOUSE_OVER,i=>t(new B_(Ti(e),i))))}onmouseleave(e,t){this._register(_t(e,Xt.MOUSE_LEAVE,i=>t(new B_(Ti(e),i))))}onkeydown(e,t){this._register(_t(e,Xt.KEY_DOWN,i=>t(new Io(i))))}onkeyup(e,t){this._register(_t(e,Xt.KEY_UP,i=>t(new Io(i))))}oninput(e,t){this._register(_t(e,Xt.INPUT,t))}onblur(e,t){this._register(_t(e,Xt.BLUR,t))}onfocus(e,t){this._register(_t(e,Xt.FOCUS,t))}ignoreGesture(e){return dd.ignoreTarget(e)}};const fM=11;class Wfr extends Tg{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(...Ni.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=fM+"px",this.domNode.style.height=fM+"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 K4),this._register(Da(this.bgDomNode,Xt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Da(this.domNode,Xt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Ske),this._pointerdownScheduleRepeatTimer=this._register(new vv)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ti(e))};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 zfr extends Ye{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 vv)}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.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Ufr=140;class vlt extends Tg{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 zfr(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new K4),this._shouldRender=!0,this.domNode=Hs(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(_t(this.domNode.domNode,Xt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Wfr(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,r){this.slider=Hs(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(_t(this.slider.domNode,Xt.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.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(),s=this._sliderPointerPosition(e);i<=s&&s<=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 s=al(this.domNode.domNode);t=e.pageX-s.left,i=e.pageY-s.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,s=>{const o=this._sliderOrthogonalPointerPosition(s),a=Math.abs(o-i);if(Wu&&a>Ufr){this._setDesiredScrollPositionNow(r.getScrollPosition());return}const c=this._sliderPointerPosition(s)-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 qfr=20;class pM{constructor(e,t,i,r,s,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new pM(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,s){const o=Math.max(0,i-e),a=Math.max(0,o-2*t),l=r>0&&r>i;if(!l)return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(qfr,Math.floor(i*a/r))),u=(a-c)/(r-i),d=s*u;return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=pM._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 Kfr extends vlt{constructor(e,t,i){const r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new pM(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,s.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const o=(t.arrowSize-fM)/2,a=(t.horizontalScrollbarSize-fM)/2;this._createArrow({className:"scra",icon:Yt.scrollbarButtonLeft,top:a,left:o,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new BL(null,1,0))}),this._createArrow({className:"scra",icon:Yt.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:o,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new BL(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 Gfr extends vlt{constructor(e,t,i){const r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new pM(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const o=(t.arrowSize-fM)/2,a=(t.verticalScrollbarSize-fM)/2;this._createArrow({className:"scra",icon:Yt.scrollbarButtonUp,top:o,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new BL(null,0,1))}),this._createArrow({className:"scra",icon:Yt.scrollbarButtonDown,top:void 0,left:a,bottom:o,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new BL(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 cG{constructor(e,t,i,r,s,o,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,r=r|0,s=s|0,o=o|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,t<0&&(t=0),r+t>i&&(r=i-t),r<0&&(r=0),s<0&&(s=0),a+s>o&&(a=o-s),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=r,this.height=s,this.scrollHeight=o,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 cG(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 cG(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,s=this.scrollLeft!==e.scrollLeft,o=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:s,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:l}}}class G4 extends Ye{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Ue),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new cG(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 r;const i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.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 x7(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=x7.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 R7e{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function Hce(n,e){const t=e-n;return function(i){return n+t*Xfr(i)}}function Yfr(n,e,t){return function(i){return i<t?n(i/t):e((i-t)/(1-t))}}class x7{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 s,o;return e<t?(s=e+.75*i,o=t-.75*i):(s=e-.75*i,o=t+.75*i),Yfr(Hce(e,s),Hce(o,t),.33)}return Hce(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 R7e(i,r,!1)}return new R7e(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return x7.start(e,t,i)}static start(e,t,i){i=i+10;const r=Date.now()-10;return new x7(e,t,r,i)}}function Qfr(n){return Math.pow(n,3)}function Xfr(n){return 1-Qfr(1-n)}const Zfr=500,P7e=50;class Jfr{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const BQ=class BQ{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 s=r===this._front?e:Math.pow(2,-i);if(e-=s,t+=this._memory[r].score*s,r===this._front)break;r=(this._capacity+r-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(q9){const t=Ti(e.browserEvent),i=_ar(t);this.accept(Date.now(),e.deltaX*i,e.deltaY*i)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let r=null;const s=new Jfr(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s),s.score=this._computeScore(s,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const r=Math.abs(e.deltaX),s=Math.abs(e.deltaY),o=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(r,o),1),c=Math.max(Math.min(s,a),1),u=Math.max(r,o),d=Math.max(s,a);u%l===0&&d%c===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};BQ.INSTANCE=new BQ;let uG=BQ;class tTe extends Tg{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new Ue),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Ue),e.style.overflow="hidden",this._options=epr(t),this._scrollable=i,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));const r={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Gfr(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Kfr(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=Hs(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Hs(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Hs(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,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new vv),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=vo(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,zr&&(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 BL(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=vo(this._mouseWheelToDispose),e)){const i=r=>{this._onMouseWheel(new BL(r))};this._mouseWheelToDispose.push(_t(this._listenOnDomNode,Xt.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;const t=uG.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+o===0?a=o=0:Math.abs(o)>=Math.abs(a)?a=0:o=0),this._options.flipAxes&&([o,a]=[a,o]);const l=!zr&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(o){const d=P7e*o,f=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,f)}if(a){const d=P7e*a,f=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,f)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),i=!0)}let r=i;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(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":"",s=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${s}${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(),Zfr)}}class blt extends tTe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new G4({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>lp(Ti(e),r)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class Ste extends tTe{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 Z9 extends tTe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new G4({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>lp(Ti(e),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 epr(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,zr&&(e.className+=" mac"),e}const sW=Jt;let nTe=class extends Ye{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 Z9(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class Ete extends Ye{static render(e,t,i){return new Ete(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=Ot(e,sW("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ot(this.actionContainer,sW("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ot(this.action,sW(`span.icon.${t.iconClass}`));const r=Ot(this.action,sW("span"));r.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new Clt(this.actionContainer,t.run)),this._store.add(new wlt(this.actionContainer,t.run,[3,10])),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 ylt(n,e){return n&&e?A("acessibleViewHint","Inspect this in the accessible view with {0}.",e):n?A("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class Clt extends Ye{constructor(e,t){super(),this._register(_t(e,Xt.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class wlt extends Ye{constructor(e,t,i){super(),this._register(_t(e,Xt.KEY_DOWN,r=>{const s=new Io(r);i.some(o=>s.equals(o))&&(r.stopPropagation(),r.preventDefault(),t(e))}))}}const xf=Ur("openerService");function tpr(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}}class Yr{get event(){return this.emitter.event}constructor(e,t,i){const r=s=>this.emitter.fire(s);this.emitter=new Ue({onWillAddFirstListener:()=>e.addEventListener(t,r,i),onDidRemoveLastListener:()=>e.removeEventListener(t,r,i)})}dispose(){this.emitter.dispose()}}function npr(n,e={}){const t=iTe(e);return t.textContent=n,t}function ipr(n,e={}){const t=iTe(e);return xlt(t,spr(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function iTe(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class rpr{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 xlt(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 s=document.createElement("a");t.disposables.add(Da(s,"click",o=>{t.callback(String(e.index),o)})),r=s}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(s=>{xlt(r,s,t,i)})}function spr(n,e){const t={type:1,children:[]};let i=0,r=t;const s=[],o=new rpr(n);for(;!o.eos();){let a=o.next();const l=a==="\\"&&y_e(o.peek(),e)!==0;if(l&&(a=o.next()),!l&&opr(a,e)&&a===o.peek()){o.advance(),r.type===2&&(r=s.pop());const c=y_e(a,e);if(r.type===c||r.type===5&&c===6)r=s.pop();else{const u={type:c,children:[]};c===5&&(u.index=i,i++),r.children.push(u),s.push(r),r=u}}else if(a===` `)r.type===2&&(r=s.pop()),r.children.push({type:8});else if(r.type!==2){const c={type:2,content:a};r.children.push(c),s.push(r),r=c}else r.content+=a}return r.type===2&&(r=s.pop()),t}function opr(n,e){return y_e(n,e)!==0}function y_e(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 apr=new RegExp(`(\\\\)?\\$\\((${Ni.iconNameExpression}(?:${Ni.iconModifierExpression})?)\\)`,"g");function uE(n){const e=new Array;let t,i=0,r=0;for(;(t=apr.exec(n))!==null;){r=t.index||0,i<r&&e.push(n.substring(i,r)),i=(t.index||0)+t[0].length;const[,s,o]=t;e.push(s?`$(${o})`:zL({id:o}))}return i<n.length&&e.push(n.substring(i)),e}function zL(n){const e=Jt("span");return e.classList.add(...Ni.asClassNameArray(n)),e}function lpr(n){const e=cpr(n);if(e&&e.length>0)return new Uint32Array(e)}let $p=0;const wS=new Uint32Array(10);function cpr(n){if($p=0,A0(n,Vce,4352),$p>0||(A0(n,Wce,4449),$p>0)||(A0(n,zce,4520),$p>0)||(A0(n,jT,12593),$p))return wS.subarray(0,$p);if(n>=44032&&n<=55203){const e=n-44032,t=e%588,i=Math.floor(e/588),r=Math.floor(t/28),s=t%28-1;if(i<Vce.length?A0(i,Vce,0):4352+i-12593<jT.length&&A0(4352+i,jT,12593),r<Wce.length?A0(r,Wce,0):4449+r-12593<jT.length&&A0(4449+r-12593,jT,12593),s>=0&&(s<zce.length?A0(s,zce,0):4520+s-12593<jT.length&&A0(4520+s-12593,jT,12593)),$p>0)return wS.subarray(0,$p)}}function A0(n,e,t){n>=t&&n<t+e.length&&upr(e[n-t])}function upr(n){n!==0&&(wS[$p++]=n&255,n>>8&&(wS[$p++]=n>>8&255),n>>16&&(wS[$p++]=n>>16&255))}const Vce=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),Wce=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),zce=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),jT=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function rTe(...n){return function(e,t){for(let i=0,r=n.length;i<r;i++){const s=n[i](e,t);if(s)return s}return null}}Slt.bind(void 0,!1);const S7=Slt.bind(void 0,!0);function Slt(n,e,t){if(!t||t.length<e.length)return null;let i;return n?i=pke(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function Elt(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function klt(n,e){return C_e(n.toLowerCase(),e.toLowerCase(),0,0)}function C_e(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=C_e(n,e,t+1,i+1))?aTe({start:i,end:i+1},r):null}return C_e(n,e,t,i+1)}function sTe(n){return 97<=n&&n<=122}function kte(n){return 65<=n&&n<=90}function oTe(n){return 48<=n&&n<=57}function Tlt(n){return n===32||n===9||n===10||n===13}const Ilt=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>Ilt.add(n.charCodeAt(0)));function dG(n){return Tlt(n)||Ilt.has(n)}function O7e(n,e){return n===e||dG(n)&&dG(e)}const Uce=new Map;function M7e(n){if(Uce.has(n))return Uce.get(n);let e;const t=lpr(n);return t&&(e=t),Uce.set(n,e),e}function Llt(n){return sTe(n)||kte(n)||oTe(n)}function aTe(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function Alt(n,e){for(let t=e;t<n.length;t++){const i=n.charCodeAt(t);if(kte(i)||oTe(i)||t>0&&!Llt(n.charCodeAt(t-1)))return t}return n.length}function w_e(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,s=i+1;for(r=w_e(n,e,t+1,i+1);!r&&(s=Alt(e,s))<e.length;)r=w_e(n,e,t+1,s),s++;return r===null?null:aTe({start:i,end:i+1},r)}}function dpr(n){let e=0,t=0,i=0,r=0,s=0;for(let u=0;u<n.length;u++)s=n.charCodeAt(u),kte(s)&&e++,sTe(s)&&t++,Llt(s)&&i++,oTe(s)&&r++;const o=e/n.length,a=t/n.length,l=i/n.length,c=r/n.length;return{upperPercent:o,lowerPercent:a,alphaPercent:l,numericPercent:c}}function hpr(n){const{upperPercent:e,lowerPercent:t}=n;return t===0&&e>.6}function fpr(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:r}=n;return t>.2&&e<.8&&i>.6&&r<.2}function ppr(n){let e=0,t=0,i=0,r=0;for(let s=0;s<n.length;s++)i=n.charCodeAt(s),kte(i)&&e++,sTe(i)&&t++,Tlt(i)&&r++;return(e===0||t===0)&&r===0?n.length<=30:e<=5}function Nlt(n,e){if(!e||(e=e.trim(),e.length===0)||!ppr(n))return null;e.length>60&&(e=e.substring(0,60));const t=dpr(e);if(!fpr(t)){if(!hpr(t))return null;e=e.toLowerCase()}let i=null,r=0;for(n=n.toLowerCase();r<e.length&&(i=w_e(n,e,0,r))===null;)r=Alt(e,r+1);return i}function gpr(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=x_e(n,e,0,r,t),i===null);)r=Dlt(e,r+1);return i}function x_e(n,e,t,i,r){let s=0;if(t===n.length)return[];if(i===e.length)return null;if(!O7e(n.charCodeAt(t),e.charCodeAt(i))){const l=M7e(n.charCodeAt(t));if(!l)return null;for(let c=0;c<l.length;c++)if(!O7e(l[c],e.charCodeAt(i+c)))return null;s+=l.length-1}let o=null,a=i+s+1;if(o=x_e(n,e,t+1,a,r),!r)for(;!o&&(a=Dlt(e,a))<e.length;)o=x_e(n,e,t+1,a,r),a++;if(!o)return null;if(n.charCodeAt(t)!==e.charCodeAt(i)){const l=M7e(n.charCodeAt(t));if(!l)return o;for(let c=0;c<l.length;c++)if(l[c]!==e.charCodeAt(i+c))return o}return aTe({start:i,end:i+s+1},o)}function Dlt(n,e){for(let t=e;t<n.length;t++)if(dG(n.charCodeAt(t))||t>0&&dG(n.charCodeAt(t-1)))return t;return n.length}const mpr=rTe(S7,Nlt,Elt),_pr=rTe(S7,Nlt,klt),j7e=new b1(1e4);function F7e(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=j7e.get(n);i||(i=new RegExp(iar(n),"i"),j7e.set(n,i));const r=i.exec(e);return r?[{start:r.index,end:r.index+r[0].length}]:t?_pr(n,e):mpr(n,e)}function vpr(n,e){const t=UL(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?J9(t):null}function bpr(n,e,t,i,r,s){const o=Math.min(13,n.length);for(;t<o;t++){const a=UL(n,e,t,i,r,s,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(a)return a}return[0,s]}function J9(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,s=e[e.length-1];s&&s.end===r?s.end=r+1:e.push({start:r,end:r+1})}return e}const $S=128;function lTe(){const n=[],e=[];for(let t=0;t<=$S;t++)e[t]=0;for(let t=0;t<=$S;t++)n.push(e.slice(0));return n}function Rlt(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const Plt=Rlt(2*$S),S_e=Rlt(2*$S),rC=lTe(),FT=lTe(),oW=lTe();function aW(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!!vke(t)}}function B7e(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function cU(n,e,t){return e[n]!==t[n]}function ypr(n,e,t,i,r,s,o=!1){for(;e<t&&r<s;)n[e]===i[r]&&(o&&(Plt[e]=r),e+=1),r+=1;return e===t}var Db;(function(n){n.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}n.isDefault=e})(Db||(Db={}));const $Ie=class $Ie{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}};$Ie.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};let E7=$Ie;function UL(n,e,t,i,r,s,o=E7.default){const a=n.length>$S?$S:n.length,l=i.length>$S?$S:i.length;if(t>=a||s>=l||a-t>l-s||!ypr(e,t,a,r,s,l,!0))return;Cpr(a,l,t,s,e,r);let c=1,u=1,d=t,f=s;const p=[!1];for(c=1,d=t;d<a;c++,d++){const b=Plt[d],y=S_e[d],C=d+1<a?S_e[d+1]:l;for(u=b-s+1,f=b;f<C;u++,f++){let S=Number.MIN_SAFE_INTEGER,k=!1;f<=y&&(S=wpr(n,e,d,t,i,r,f,l,s,rC[c-1][u-1]===0,p));let I=0;S!==Number.MAX_SAFE_INTEGER&&(k=!0,I=S+FT[c-1][u-1]);const L=f>b,N=L?FT[c][u-1]+(rC[c][u-1]>0?-5:0):0,P=f>b+1&&rC[c][u-1]>0,O=P?FT[c][u-2]+(rC[c][u-2]>0?-5:0):0;if(P&&(!L||O>=N)&&(!k||O>=I))FT[c][u]=O,oW[c][u]=3,rC[c][u]=0;else if(L&&(!k||N>=I))FT[c][u]=N,oW[c][u]=2,rC[c][u]=0;else if(k)FT[c][u]=I,oW[c][u]=1,rC[c][u]=rC[c-1][u-1]+1;else throw new Error("not possible")}}if(!p[0]&&!o.firstMatchCanBeWeak)return;c--,u--;const g=[FT[c][u],s];let m=0,_=0;for(;c>=1;){let b=u;do{const y=oW[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[s+u-1]&&!cU(b+s-1,i,r)&&m+1>rC[c][b]&&(b=u),b===u?m++:m=1,_||(_=b),c--,u=b-1,g.push(u)}l-s===a&&o.boostFullMatch&&(g[0]+=2);const v=_-a;return g[0]-=v,g}function Cpr(n,e,t,i,r,s){let o=n-1,a=e-1;for(;o>=t&&a>=i;)r[o]===s[a]&&(S_e[o]=a,o--),a--}function wpr(n,e,t,i,r,s,o,a,l,c,u){if(e[t]!==s[o])return Number.MIN_SAFE_INTEGER;let d=1,f=!1;return o===t-i?d=n[t]===r[o]?7:5:cU(o,r,s)&&(o===0||!cU(o-1,r,s))?(d=n[t]===r[o]?7:5,f=!0):aW(s,o)&&(o===0||!aW(s,o-1))?d=5:(aW(s,o-1)||B7e(s,o-1))&&(d=5,f=!0),d>1&&t===i&&(u[0]=!0),f||(f=cU(o,r,s)||aW(s,o-1)||B7e(s,o-1)),t===i?o>l&&(d-=f?3:5):c?d+=f?2:0:d+=f?0:1,o+1===a&&(d-=f?3:5),d}function xpr(n,e,t,i,r,s,o){return Spr(n,e,t,i,r,s,!0,o)}function Spr(n,e,t,i,r,s,o,a){let l=UL(n,e,t,i,r,s,a);if(n.length>=3){const c=Math.min(7,n.length-1);for(let u=t+1;u<c;u++){const d=Epr(n,u);if(d){const f=UL(d,d.toLowerCase(),t,i,r,s,a);f&&(f[0]-=3,(!l||f[0]>l[0])&&(l=f))}}}return l}function Epr(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 kpr="$(",cTe=new RegExp(`\\$\\(${Ni.iconNameExpression}(?:${Ni.iconModifierExpression})?\\)`,"g"),Tpr=new RegExp(`(\\\\)?${cTe.source}`,"g");function Ipr(n){return n.replace(Tpr,(e,t)=>t?e:`\\${e}`)}const Lpr=new RegExp(`\\\\${cTe.source}`,"g");function Apr(n){return n.replace(Lpr,e=>`\\${e}`)}const Npr=new RegExp(`(\\s)?(\\\\)?${cTe.source}(\\s)?`,"g");function uTe(n){return n.indexOf(kpr)===-1?n:n.replace(Npr,(e,t,i,r)=>i?e:t||r||"")}function Dpr(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const qce=new RegExp(`\\$\\(${Ni.iconNameCharacter}+\\)`,"g");function Zj(n){qce.lastIndex=0;let e="";const t=[];let i=0;for(;;){const r=qce.lastIndex,s=qce.exec(n),o=n.substring(r,s==null?void 0:s.index);if(o.length>0){e+=o;for(let a=0;a<o.length;a++)t.push(i)}if(!s)break;i+=s[0].length}return{text:e,iconOffsets:t}}function Kce(n,e,t=!1){const{text:i,iconOffsets:r}=e;if(!r||r.length===0)return F7e(n,i,t);const s=W9(i," "),o=i.length-s.length,a=F7e(n,s,t);if(a)for(const l of a){const c=r[l.start+o]+o;l.start+=c,l.end+=c}return a}function B0(n){return PK(n,!0)}class Rpr{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:o7(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===ir.file)return d_e(B0(e),B0(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(H7e(e.authority,t.authority))return d_e(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return vi.joinPath(e,...t)}basenameOrAuthority(e){return Mm(e)||e.authority}basename(e){return Rl.basename(e.path)}extname(e){return Rl.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===ir.file?t=vi.file(pot(B0(e))).path:(t=Rl.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===ir.file?t=vi.file(fot(B0(e))).path:t=Rl.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!H7e(e.authority,t.authority))return;if(e.scheme===ir.file){const s=Por(B0(e),B0(t));return Wu?Kat(s):s}let i=e.path||"/";const r=t.path||"/";if(this._ignorePathCasing(e)){let s=0;for(const o=Math.min(i.length,r.length);s<o&&!(i.charCodeAt(s)!==r.charCodeAt(s)&&i.charAt(s).toLowerCase()!==r.charAt(s).toLowerCase());s++);i=r.substr(0,s)+i.substr(s)}return Rl.relative(i,r)}resolvePath(e,t){if(e.scheme===ir.file){const i=vi.file(Ror(B0(e),t));return e.with({authority:i.authority,path:i.path})}return t=Mdr(t),e.with({path:Rl.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]==="/"}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&IR(e,t)}hasTrailingPathSeparator(e,t=Tb){if(e.scheme===ir.file){const i=B0(e);return i.length>f7e(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=Tb){return V7e(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Tb){let i=!1;if(e.scheme===ir.file){const r=B0(e);i=r!==void 0&&r.length===f7e(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&&!V7e(e,t)?e.with({path:e.path+"/"}):e}}const la=new Rpr(()=>!1),k7=la.isEqual.bind(la);la.isEqualOrParent.bind(la);la.getComparisonKey.bind(la);const Ppr=la.basenameOrAuthority.bind(la),Mm=la.basename.bind(la),Opr=la.extname.bind(la),Tte=la.dirname.bind(la),Mpr=la.joinPath.bind(la),jpr=la.normalizePath.bind(la),Fpr=la.relativePath.bind(la),$7e=la.resolvePath.bind(la);la.isAbsolutePath.bind(la);const H7e=la.isEqualAuthority.bind(la),V7e=la.hasTrailingPathSeparator.bind(la);la.removeTrailingPathSeparator.bind(la);la.addTrailingPathSeparator.bind(la);var tk;(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(o=>{const[a,l]=o.split(":");a&&l&&i.set(a,l)});const s=t.path.substring(0,t.path.indexOf(";"));return s&&i.set(n.META_DATA_MIME,s),i}n.parseMetaData=e})(tk||(tk={}));class rd{constructor(e="",t=!1){if(this.value=e,typeof this.value!="string")throw Sm("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1)}appendText(e,t=0){return this.value+=$pr(this.supportThemeIcons?Ipr(e):e).replace(/([ \t]+)/g,(i,r)=>" ".repeat(r.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` ${Hpr(t,e)} `,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(mg(t),"g");return e.replace(i,(r,s)=>e.charAt(s-1)!=="\\"?`\\${r}`:r)}}function gM(n){return Rb(n)?!n.value:Array.isArray(n)?n.every(gM):!0}function Rb(n){return n instanceof rd?!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 Bpr(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&&k7(vi.from(n.baseUri),vi.from(e.baseUri)))}function $pr(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function Hpr(n,e){var r;const t=((r=n.match(/^`+/gm))==null?void 0:r.reduce((s,o)=>s.length>o.length?s:o).length)??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,n,`${"`".repeat(i)}`].join(` `)}function lW(n){return n.replace(/"/g,""")}function Gce(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Vpr(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),s=/width=(\d+)/.exec(i),o=r?r[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(o));l&&e.push(`width="${a}"`),c&&e.push(`height="${o}"`)}return{href:n,dimensions:e}}class dTe{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const E_e=new dTe("id#");let _d={};(function(){function n(e,t){t(_d)}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(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}e.defaults=t();function i(_n){e.defaults=_n}const r=/[&<>"']/,s=new RegExp(r.source,"g"),o=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,a=new RegExp(o.source,"g"),l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=_n=>l[_n];function u(_n,de){if(de){if(r.test(_n))return _n.replace(s,c)}else if(o.test(_n))return _n.replace(a,c);return _n}const d=/(^|[^\[])\^/g;function f(_n,de){let _e=typeof _n=="string"?_n:_n.source;de=de||"";const Le={replace:(Ge,gt)=>{let pt=typeof gt=="string"?gt:gt.source;return pt=pt.replace(d,"$1"),_e=_e.replace(Ge,pt),Le},getRegex:()=>new RegExp(_e,de)};return Le}function p(_n){try{_n=encodeURI(_n).replace(/%25/g,"%")}catch{return null}return _n}const g={exec:()=>null};function m(_n,de){const _e=_n.replace(/\|/g,(gt,pt,Vt)=>{let Pn=!1,Ln=pt;for(;--Ln>=0&&Vt[Ln]==="\\";)Pn=!Pn;return Pn?"|":" |"}),Le=_e.split(/ \|/);let Ge=0;if(Le[0].trim()||Le.shift(),Le.length>0&&!Le[Le.length-1].trim()&&Le.pop(),de)if(Le.length>de)Le.splice(de);else for(;Le.length<de;)Le.push("");for(;Ge<Le.length;Ge++)Le[Ge]=Le[Ge].trim().replace(/\\\|/g,"|");return Le}function _(_n,de,_e){const Le=_n.length;if(Le===0)return"";let Ge=0;for(;Ge<Le&&_n.charAt(Le-Ge-1)===de;)Ge++;return _n.slice(0,Le-Ge)}function v(_n,de){if(_n.indexOf(de[1])===-1)return-1;let _e=0;for(let Le=0;Le<_n.length;Le++)if(_n[Le]==="\\")Le++;else if(_n[Le]===de[0])_e++;else if(_n[Le]===de[1]&&(_e--,_e<0))return Le;return-1}function b(_n,de,_e,Le){const Ge=de.href,gt=de.title?u(de.title):null,pt=_n[1].replace(/\\([\[\]])/g,"$1");if(_n[0].charAt(0)!=="!"){Le.state.inLink=!0;const Vt={type:"link",raw:_e,href:Ge,title:gt,text:pt,tokens:Le.inlineTokens(pt)};return Le.state.inLink=!1,Vt}return{type:"image",raw:_e,href:Ge,title:gt,text:u(pt)}}function y(_n,de){const _e=_n.match(/^(\s+)(?:```)/);if(_e===null)return de;const Le=_e[1];return de.split(` `).map(Ge=>{const gt=Ge.match(/^\s+/);if(gt===null)return Ge;const[pt]=gt;return pt.length>=Le.length?Ge.slice(Le.length):Ge}).join(` `)}class C{constructor(de){Xr(this,"options");Xr(this,"rules");Xr(this,"lexer");this.options=de||e.defaults}space(de){const _e=this.rules.block.newline.exec(de);if(_e&&_e[0].length>0)return{type:"space",raw:_e[0]}}code(de){const _e=this.rules.block.code.exec(de);if(_e){const Le=_e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:_e[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:_(Le,` `)}}}fences(de){const _e=this.rules.block.fences.exec(de);if(_e){const Le=_e[0],Ge=y(Le,_e[3]||"");return{type:"code",raw:Le,lang:_e[2]?_e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):_e[2],text:Ge}}}heading(de){const _e=this.rules.block.heading.exec(de);if(_e){let Le=_e[2].trim();if(/#$/.test(Le)){const Ge=_(Le,"#");(this.options.pedantic||!Ge||/ $/.test(Ge))&&(Le=Ge.trim())}return{type:"heading",raw:_e[0],depth:_e[1].length,text:Le,tokens:this.lexer.inline(Le)}}}hr(de){const _e=this.rules.block.hr.exec(de);if(_e)return{type:"hr",raw:_(_e[0],` `)}}blockquote(de){const _e=this.rules.block.blockquote.exec(de);if(_e){let Le=_(_e[0],` `).split(` `),Ge="",gt="";const pt=[];for(;Le.length>0;){let Vt=!1;const Pn=[];let Ln;for(Ln=0;Ln<Le.length;Ln++)if(/^ {0,3}>/.test(Le[Ln]))Pn.push(Le[Ln]),Vt=!0;else if(!Vt)Pn.push(Le[Ln]);else break;Le=Le.slice(Ln);const bi=Pn.join(` `),et=bi.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` $1`).replace(/^ {0,3}>[ \t]?/gm,"");Ge=Ge?`${Ge} ${bi}`:bi,gt=gt?`${gt} ${et}`:et;const Lt=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(et,pt,!0),this.lexer.state.top=Lt,Le.length===0)break;const qt=pt[pt.length-1];if((qt==null?void 0:qt.type)==="code")break;if((qt==null?void 0:qt.type)==="blockquote"){const sn=qt,ln=sn.raw+` `+Le.join(` `),ti=this.blockquote(ln);pt[pt.length-1]=ti,Ge=Ge.substring(0,Ge.length-sn.raw.length)+ti.raw,gt=gt.substring(0,gt.length-sn.text.length)+ti.text;break}else if((qt==null?void 0:qt.type)==="list"){const sn=qt,ln=sn.raw+` `+Le.join(` `),ti=this.list(ln);pt[pt.length-1]=ti,Ge=Ge.substring(0,Ge.length-qt.raw.length)+ti.raw,gt=gt.substring(0,gt.length-sn.raw.length)+ti.raw,Le=ln.substring(pt[pt.length-1].raw.length).split(` `);continue}}return{type:"blockquote",raw:Ge,tokens:pt,text:gt}}}list(de){let _e=this.rules.block.list.exec(de);if(_e){let Le=_e[1].trim();const Ge=Le.length>1,gt={type:"list",raw:"",ordered:Ge,start:Ge?+Le.slice(0,-1):"",loose:!1,items:[]};Le=Ge?`\\d{1,9}\\${Le.slice(-1)}`:`\\${Le}`,this.options.pedantic&&(Le=Ge?Le:"[*+-]");const pt=new RegExp(`^( {0,3}${Le})((?:[ ][^\\n]*)?(?:\\n|$))`);let Vt=!1;for(;de;){let Pn=!1,Ln="",bi="";if(!(_e=pt.exec(de))||this.rules.block.hr.test(de))break;Ln=_e[0],de=de.substring(Ln.length);let et=_e[2].split(` `,1)[0].replace(/^\t+/,di=>" ".repeat(3*di.length)),Lt=de.split(` `,1)[0],qt=!et.trim(),sn=0;if(this.options.pedantic?(sn=2,bi=et.trimStart()):qt?sn=_e[1].length+1:(sn=_e[2].search(/[^ ]/),sn=sn>4?1:sn,bi=et.slice(sn),sn+=_e[1].length),qt&&/^ *$/.test(Lt)&&(Ln+=Lt+` `,de=de.substring(Lt.length+1),Pn=!0),!Pn){const di=new RegExp(`^ {0,${Math.min(3,sn-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),Dt=new RegExp(`^ {0,${Math.min(3,sn-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),le=new RegExp(`^ {0,${Math.min(3,sn-1)}}(?:\`\`\`|~~~)`),Qe=new RegExp(`^ {0,${Math.min(3,sn-1)}}#`);for(;de;){const ht=de.split(` `,1)[0];if(Lt=ht,this.options.pedantic&&(Lt=Lt.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),le.test(Lt)||Qe.test(Lt)||di.test(Lt)||Dt.test(de))break;if(Lt.search(/[^ ]/)>=sn||!Lt.trim())bi+=` `+Lt.slice(sn);else{if(qt||et.search(/[^ ]/)>=4||le.test(et)||Qe.test(et)||Dt.test(et))break;bi+=` `+Lt}!qt&&!Lt.trim()&&(qt=!0),Ln+=ht+` `,de=de.substring(ht.length+1),et=Lt.slice(sn)}}gt.loose||(Vt?gt.loose=!0:/\n *\n *$/.test(Ln)&&(Vt=!0));let ln=null,ti;this.options.gfm&&(ln=/^\[[ xX]\] /.exec(bi),ln&&(ti=ln[0]!=="[ ] ",bi=bi.replace(/^\[[ xX]\] +/,""))),gt.items.push({type:"list_item",raw:Ln,task:!!ln,checked:ti,loose:!1,text:bi,tokens:[]}),gt.raw+=Ln}gt.items[gt.items.length-1].raw=gt.items[gt.items.length-1].raw.trimEnd(),gt.items[gt.items.length-1].text=gt.items[gt.items.length-1].text.trimEnd(),gt.raw=gt.raw.trimEnd();for(let Pn=0;Pn<gt.items.length;Pn++)if(this.lexer.state.top=!1,gt.items[Pn].tokens=this.lexer.blockTokens(gt.items[Pn].text,[]),!gt.loose){const Ln=gt.items[Pn].tokens.filter(et=>et.type==="space"),bi=Ln.length>0&&Ln.some(et=>/\n.*\n/.test(et.raw));gt.loose=bi}if(gt.loose)for(let Pn=0;Pn<gt.items.length;Pn++)gt.items[Pn].loose=!0;return gt}}html(de){const _e=this.rules.block.html.exec(de);if(_e)return{type:"html",block:!0,raw:_e[0],pre:_e[1]==="pre"||_e[1]==="script"||_e[1]==="style",text:_e[0]}}def(de){const _e=this.rules.block.def.exec(de);if(_e){const Le=_e[1].toLowerCase().replace(/\s+/g," "),Ge=_e[2]?_e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",gt=_e[3]?_e[3].substring(1,_e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):_e[3];return{type:"def",tag:Le,raw:_e[0],href:Ge,title:gt}}}table(de){const _e=this.rules.block.table.exec(de);if(!_e||!/[:|]/.test(_e[2]))return;const Le=m(_e[1]),Ge=_e[2].replace(/^\||\| *$/g,"").split("|"),gt=_e[3]&&_e[3].trim()?_e[3].replace(/\n[ \t]*$/,"").split(` `):[],pt={type:"table",raw:_e[0],header:[],align:[],rows:[]};if(Le.length===Ge.length){for(const Vt of Ge)/^ *-+: *$/.test(Vt)?pt.align.push("right"):/^ *:-+: *$/.test(Vt)?pt.align.push("center"):/^ *:-+ *$/.test(Vt)?pt.align.push("left"):pt.align.push(null);for(let Vt=0;Vt<Le.length;Vt++)pt.header.push({text:Le[Vt],tokens:this.lexer.inline(Le[Vt]),header:!0,align:pt.align[Vt]});for(const Vt of gt)pt.rows.push(m(Vt,pt.header.length).map((Pn,Ln)=>({text:Pn,tokens:this.lexer.inline(Pn),header:!1,align:pt.align[Ln]})));return pt}}lheading(de){const _e=this.rules.block.lheading.exec(de);if(_e)return{type:"heading",raw:_e[0],depth:_e[2].charAt(0)==="="?1:2,text:_e[1],tokens:this.lexer.inline(_e[1])}}paragraph(de){const _e=this.rules.block.paragraph.exec(de);if(_e){const Le=_e[1].charAt(_e[1].length-1)===` `?_e[1].slice(0,-1):_e[1];return{type:"paragraph",raw:_e[0],text:Le,tokens:this.lexer.inline(Le)}}}text(de){const _e=this.rules.block.text.exec(de);if(_e)return{type:"text",raw:_e[0],text:_e[0],tokens:this.lexer.inline(_e[0])}}escape(de){const _e=this.rules.inline.escape.exec(de);if(_e)return{type:"escape",raw:_e[0],text:u(_e[1])}}tag(de){const _e=this.rules.inline.tag.exec(de);if(_e)return!this.lexer.state.inLink&&/^<a /i.test(_e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(_e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(_e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(_e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:_e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:_e[0]}}link(de){const _e=this.rules.inline.link.exec(de);if(_e){const Le=_e[2].trim();if(!this.options.pedantic&&/^</.test(Le)){if(!/>$/.test(Le))return;const pt=_(Le.slice(0,-1),"\\");if((Le.length-pt.length)%2===0)return}else{const pt=v(_e[2],"()");if(pt>-1){const Pn=(_e[0].indexOf("!")===0?5:4)+_e[1].length+pt;_e[2]=_e[2].substring(0,pt),_e[0]=_e[0].substring(0,Pn).trim(),_e[3]=""}}let Ge=_e[2],gt="";if(this.options.pedantic){const pt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ge);pt&&(Ge=pt[1],gt=pt[3])}else gt=_e[3]?_e[3].slice(1,-1):"";return Ge=Ge.trim(),/^</.test(Ge)&&(this.options.pedantic&&!/>$/.test(Le)?Ge=Ge.slice(1):Ge=Ge.slice(1,-1)),b(_e,{href:Ge&&Ge.replace(this.rules.inline.anyPunctuation,"$1"),title:gt&>.replace(this.rules.inline.anyPunctuation,"$1")},_e[0],this.lexer)}}reflink(de,_e){let Le;if((Le=this.rules.inline.reflink.exec(de))||(Le=this.rules.inline.nolink.exec(de))){const Ge=(Le[2]||Le[1]).replace(/\s+/g," "),gt=_e[Ge.toLowerCase()];if(!gt){const pt=Le[0].charAt(0);return{type:"text",raw:pt,text:pt}}return b(Le,gt,Le[0],this.lexer)}}emStrong(de,_e,Le=""){let Ge=this.rules.inline.emStrongLDelim.exec(de);if(!Ge||Ge[3]&&Le.match(/[\p{L}\p{N}]/u))return;if(!(Ge[1]||Ge[2]||"")||!Le||this.rules.inline.punctuation.exec(Le)){const pt=[...Ge[0]].length-1;let Vt,Pn,Ln=pt,bi=0;const et=Ge[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(et.lastIndex=0,_e=_e.slice(-1*de.length+pt);(Ge=et.exec(_e))!=null;){if(Vt=Ge[1]||Ge[2]||Ge[3]||Ge[4]||Ge[5]||Ge[6],!Vt)continue;if(Pn=[...Vt].length,Ge[3]||Ge[4]){Ln+=Pn;continue}else if((Ge[5]||Ge[6])&&pt%3&&!((pt+Pn)%3)){bi+=Pn;continue}if(Ln-=Pn,Ln>0)continue;Pn=Math.min(Pn,Pn+Ln+bi);const Lt=[...Ge[0]][0].length,qt=de.slice(0,pt+Ge.index+Lt+Pn);if(Math.min(pt,Pn)%2){const ln=qt.slice(1,-1);return{type:"em",raw:qt,text:ln,tokens:this.lexer.inlineTokens(ln)}}const sn=qt.slice(2,-2);return{type:"strong",raw:qt,text:sn,tokens:this.lexer.inlineTokens(sn)}}}}codespan(de){const _e=this.rules.inline.code.exec(de);if(_e){let Le=_e[2].replace(/\n/g," ");const Ge=/[^ ]/.test(Le),gt=/^ /.test(Le)&&/ $/.test(Le);return Ge&>&&(Le=Le.substring(1,Le.length-1)),Le=u(Le,!0),{type:"codespan",raw:_e[0],text:Le}}}br(de){const _e=this.rules.inline.br.exec(de);if(_e)return{type:"br",raw:_e[0]}}del(de){const _e=this.rules.inline.del.exec(de);if(_e)return{type:"del",raw:_e[0],text:_e[2],tokens:this.lexer.inlineTokens(_e[2])}}autolink(de){const _e=this.rules.inline.autolink.exec(de);if(_e){let Le,Ge;return _e[2]==="@"?(Le=u(_e[1]),Ge="mailto:"+Le):(Le=u(_e[1]),Ge=Le),{type:"link",raw:_e[0],text:Le,href:Ge,tokens:[{type:"text",raw:Le,text:Le}]}}}url(de){var Le;let _e;if(_e=this.rules.inline.url.exec(de)){let Ge,gt;if(_e[2]==="@")Ge=u(_e[0]),gt="mailto:"+Ge;else{let pt;do pt=_e[0],_e[0]=((Le=this.rules.inline._backpedal.exec(_e[0]))==null?void 0:Le[0])??"";while(pt!==_e[0]);Ge=u(_e[0]),_e[1]==="www."?gt="http://"+_e[0]:gt=_e[0]}return{type:"link",raw:_e[0],text:Ge,href:gt,tokens:[{type:"text",raw:Ge,text:Ge}]}}}inlineText(de){const _e=this.rules.inline.text.exec(de);if(_e){let Le;return this.lexer.state.inRawBlock?Le=_e[0]:Le=u(_e[0]),{type:"text",raw:_e[0],text:Le}}}}const S=/^(?: *(?:\n|$))+/,k=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,I=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,L=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,N=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,P=/(?:[*+-]|\d{1,9}[.)])/,O=f(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,P).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),F=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,V=/^[^\n]+/,M=/(?!\s*\])(?:\\.|[^\[\]\\])+/,B=f(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",M).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),W=f(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,P).getRegex(),q="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",U=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,G=f("^ {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|$))","i").replace("comment",U).replace("tag",q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H=f(F).replace("hr",L).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",q).getRegex(),Z={blockquote:f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",H).getRegex(),code:k,def:B,fences:I,heading:N,hr:L,html:G,lheading:O,list:W,newline:S,paragraph:H,table:g,text:V},X=f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",L).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",q).getRegex(),oe={...Z,table:X,paragraph:f(F).replace("hr",L).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",X).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",q).getRegex()},fe={...Z,html:f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",U).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:g,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:f(F).replace("hr",L).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",O).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Se=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Me=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ie=/^( {2,}|\\)\n(?!\s*$)/,ge=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ye="\\p{P}\\p{S}",Pe=f(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,ye).getRegex(),Be=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,$e=f(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ye).getRegex(),qe=f("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ye).getRegex(),mt=f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ye).getRegex(),vt=f(/\\([punct])/,"gu").replace(/punct/g,ye).getRegex(),ft=f(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),tt=f(U).replace("(?:-->|$)","-->").getRegex(),St=f("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ft=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,en=f(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ft).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ke=f(/^!?\[(label)\]\[(ref)\]/).replace("label",Ft).replace("ref",M).getRegex(),dt=f(/^!?\[(ref)\](?:\[\])?/).replace("ref",M).getRegex(),nt=f("reflink|nolink(?!\\()","g").replace("reflink",Ke).replace("nolink",dt).getRegex(),at={_backpedal:g,anyPunctuation:vt,autolink:ft,blockSkip:Be,br:Ie,code:Me,del:g,emStrongLDelim:$e,emStrongRDelimAst:qe,emStrongRDelimUnd:mt,escape:Se,link:en,nolink:dt,punctuation:Pe,reflink:Ke,reflinkSearch:nt,tag:St,text:ge,url:g},Oe={...at,link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",Ft).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ft).getRegex()},ce={...at,escape:f(Se).replace("])","~|])").getRegex(),url:f(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ne={...ce,br:f(Ie).replace("{2,}","*").getRegex(),text:f(ce.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xe={normal:Z,gfm:oe,pedantic:fe},it={normal:at,gfm:ce,breaks:Ne,pedantic:Oe};class Tt{constructor(de){Xr(this,"tokens");Xr(this,"options");Xr(this,"state");Xr(this,"tokenizer");Xr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=de||e.defaults,this.options.tokenizer=this.options.tokenizer||new C,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const _e={block:Xe.normal,inline:it.normal};this.options.pedantic?(_e.block=Xe.pedantic,_e.inline=it.pedantic):this.options.gfm&&(_e.block=Xe.gfm,this.options.breaks?_e.inline=it.breaks:_e.inline=it.gfm),this.tokenizer.rules=_e}static get rules(){return{block:Xe,inline:it}}static lex(de,_e){return new Tt(_e).lex(de)}static lexInline(de,_e){return new Tt(_e).inlineTokens(de)}lex(de){de=de.replace(/\r\n|\r/g,` `),this.blockTokens(de,this.tokens);for(let _e=0;_e<this.inlineQueue.length;_e++){const Le=this.inlineQueue[_e];this.inlineTokens(Le.src,Le.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(de,_e=[],Le=!1){this.options.pedantic?de=de.replace(/\t/g," ").replace(/^ +$/gm,""):de=de.replace(/^( *)(\t+)/gm,(Vt,Pn,Ln)=>Pn+" ".repeat(Ln.length));let Ge,gt,pt;for(;de;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(Vt=>(Ge=Vt.call({lexer:this},de,_e))?(de=de.substring(Ge.raw.length),_e.push(Ge),!0):!1))){if(Ge=this.tokenizer.space(de)){de=de.substring(Ge.raw.length),Ge.raw.length===1&&_e.length>0?_e[_e.length-1].raw+=` `:_e.push(Ge);continue}if(Ge=this.tokenizer.code(de)){de=de.substring(Ge.raw.length),gt=_e[_e.length-1],gt&&(gt.type==="paragraph"||gt.type==="text")?(gt.raw+=` `+Ge.raw,gt.text+=` `+Ge.text,this.inlineQueue[this.inlineQueue.length-1].src=gt.text):_e.push(Ge);continue}if(Ge=this.tokenizer.fences(de)){de=de.substring(Ge.raw.length),_e.push(Ge);continue}if(Ge=this.tokenizer.heading(de)){de=de.substring(Ge.raw.length),_e.push(Ge);continue}if(Ge=this.tokenizer.hr(de)){de=de.substring(Ge.raw.length),_e.push(Ge);continue}if(Ge=this.tokenizer.blockquote(de)){de=de.substring(Ge.raw.length),_e.push(Ge);continue}if(Ge=this.tokenizer.list(de)){de=de.substring(Ge.raw.length),_e.push(Ge);continue}if(Ge=this.tokenizer.html(de)){de=de.substring(Ge.raw.length),_e.push(Ge);continue}if(Ge=this.tokenizer.def(de)){de=de.substring(Ge.raw.length),gt=_e[_e.length-1],gt&&(gt.type==="paragraph"||gt.type==="text")?(gt.raw+=` `+Ge.raw,gt.text+=` `+Ge.raw,this.inlineQueue[this.inlineQueue.length-1].src=gt.text):this.tokens.links[Ge.tag]||(this.tokens.links[Ge.tag]={href:Ge.href,title:Ge.title});continue}if(Ge=this.tokenizer.table(de)){de=de.substring(Ge.raw.length),_e.push(Ge);continue}if(Ge=this.tokenizer.lheading(de)){de=de.substring(Ge.raw.length),_e.push(Ge);continue}if(pt=de,this.options.extensions&&this.options.extensions.startBlock){let Vt=1/0;const Pn=de.slice(1);let Ln;this.options.extensions.startBlock.forEach(bi=>{Ln=bi.call({lexer:this},Pn),typeof Ln=="number"&&Ln>=0&&(Vt=Math.min(Vt,Ln))}),Vt<1/0&&Vt>=0&&(pt=de.substring(0,Vt+1))}if(this.state.top&&(Ge=this.tokenizer.paragraph(pt))){gt=_e[_e.length-1],Le&&(gt==null?void 0:gt.type)==="paragraph"?(gt.raw+=` `+Ge.raw,gt.text+=` `+Ge.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=gt.text):_e.push(Ge),Le=pt.length!==de.length,de=de.substring(Ge.raw.length);continue}if(Ge=this.tokenizer.text(de)){de=de.substring(Ge.raw.length),gt=_e[_e.length-1],gt&>.type==="text"?(gt.raw+=` `+Ge.raw,gt.text+=` `+Ge.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=gt.text):_e.push(Ge);continue}if(de){const Vt="Infinite loop on byte: "+de.charCodeAt(0);if(this.options.silent){console.error(Vt);break}else throw new Error(Vt)}}return this.state.top=!0,_e}inline(de,_e=[]){return this.inlineQueue.push({src:de,tokens:_e}),_e}inlineTokens(de,_e=[]){let Le,Ge,gt,pt=de,Vt,Pn,Ln;if(this.tokens.links){const bi=Object.keys(this.tokens.links);if(bi.length>0)for(;(Vt=this.tokenizer.rules.inline.reflinkSearch.exec(pt))!=null;)bi.includes(Vt[0].slice(Vt[0].lastIndexOf("[")+1,-1))&&(pt=pt.slice(0,Vt.index)+"["+"a".repeat(Vt[0].length-2)+"]"+pt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Vt=this.tokenizer.rules.inline.blockSkip.exec(pt))!=null;)pt=pt.slice(0,Vt.index)+"["+"a".repeat(Vt[0].length-2)+"]"+pt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Vt=this.tokenizer.rules.inline.anyPunctuation.exec(pt))!=null;)pt=pt.slice(0,Vt.index)+"++"+pt.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;de;)if(Pn||(Ln=""),Pn=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(bi=>(Le=bi.call({lexer:this},de,_e))?(de=de.substring(Le.raw.length),_e.push(Le),!0):!1))){if(Le=this.tokenizer.escape(de)){de=de.substring(Le.raw.length),_e.push(Le);continue}if(Le=this.tokenizer.tag(de)){de=de.substring(Le.raw.length),Ge=_e[_e.length-1],Ge&&Le.type==="text"&&Ge.type==="text"?(Ge.raw+=Le.raw,Ge.text+=Le.text):_e.push(Le);continue}if(Le=this.tokenizer.link(de)){de=de.substring(Le.raw.length),_e.push(Le);continue}if(Le=this.tokenizer.reflink(de,this.tokens.links)){de=de.substring(Le.raw.length),Ge=_e[_e.length-1],Ge&&Le.type==="text"&&Ge.type==="text"?(Ge.raw+=Le.raw,Ge.text+=Le.text):_e.push(Le);continue}if(Le=this.tokenizer.emStrong(de,pt,Ln)){de=de.substring(Le.raw.length),_e.push(Le);continue}if(Le=this.tokenizer.codespan(de)){de=de.substring(Le.raw.length),_e.push(Le);continue}if(Le=this.tokenizer.br(de)){de=de.substring(Le.raw.length),_e.push(Le);continue}if(Le=this.tokenizer.del(de)){de=de.substring(Le.raw.length),_e.push(Le);continue}if(Le=this.tokenizer.autolink(de)){de=de.substring(Le.raw.length),_e.push(Le);continue}if(!this.state.inLink&&(Le=this.tokenizer.url(de))){de=de.substring(Le.raw.length),_e.push(Le);continue}if(gt=de,this.options.extensions&&this.options.extensions.startInline){let bi=1/0;const et=de.slice(1);let Lt;this.options.extensions.startInline.forEach(qt=>{Lt=qt.call({lexer:this},et),typeof Lt=="number"&&Lt>=0&&(bi=Math.min(bi,Lt))}),bi<1/0&&bi>=0&&(gt=de.substring(0,bi+1))}if(Le=this.tokenizer.inlineText(gt)){de=de.substring(Le.raw.length),Le.raw.slice(-1)!=="_"&&(Ln=Le.raw.slice(-1)),Pn=!0,Ge=_e[_e.length-1],Ge&&Ge.type==="text"?(Ge.raw+=Le.raw,Ge.text+=Le.text):_e.push(Le);continue}if(de){const bi="Infinite loop on byte: "+de.charCodeAt(0);if(this.options.silent){console.error(bi);break}else throw new Error(bi)}}return _e}}class Ct{constructor(de){Xr(this,"options");Xr(this,"parser");this.options=de||e.defaults}space(de){return""}code({text:de,lang:_e,escaped:Le}){var pt;const Ge=(pt=(_e||"").match(/^\S*/))==null?void 0:pt[0],gt=de.replace(/\n$/,"")+` `;return Ge?'<pre><code class="language-'+u(Ge)+'">'+(Le?gt:u(gt,!0))+`</code></pre> `:"<pre><code>"+(Le?gt:u(gt,!0))+`</code></pre> `}blockquote({tokens:de}){return`<blockquote> ${this.parser.parse(de)}</blockquote> `}html({text:de}){return de}heading({tokens:de,depth:_e}){return`<h${_e}>${this.parser.parseInline(de)}</h${_e}> `}hr(de){return`<hr> `}list(de){const _e=de.ordered,Le=de.start;let Ge="";for(let Vt=0;Vt<de.items.length;Vt++){const Pn=de.items[Vt];Ge+=this.listitem(Pn)}const gt=_e?"ol":"ul",pt=_e&&Le!==1?' start="'+Le+'"':"";return"<"+gt+pt+`> `+Ge+"</"+gt+`> `}listitem(de){let _e="";if(de.task){const Le=this.checkbox({checked:!!de.checked});de.loose?de.tokens.length>0&&de.tokens[0].type==="paragraph"?(de.tokens[0].text=Le+" "+de.tokens[0].text,de.tokens[0].tokens&&de.tokens[0].tokens.length>0&&de.tokens[0].tokens[0].type==="text"&&(de.tokens[0].tokens[0].text=Le+" "+de.tokens[0].tokens[0].text)):de.tokens.unshift({type:"text",raw:Le+" ",text:Le+" "}):_e+=Le+" "}return _e+=this.parser.parse(de.tokens,!!de.loose),`<li>${_e}</li> `}checkbox({checked:de}){return"<input "+(de?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:de}){return`<p>${this.parser.parseInline(de)}</p> `}table(de){let _e="",Le="";for(let gt=0;gt<de.header.length;gt++)Le+=this.tablecell(de.header[gt]);_e+=this.tablerow({text:Le});let Ge="";for(let gt=0;gt<de.rows.length;gt++){const pt=de.rows[gt];Le="";for(let Vt=0;Vt<pt.length;Vt++)Le+=this.tablecell(pt[Vt]);Ge+=this.tablerow({text:Le})}return Ge&&(Ge=`<tbody>${Ge}</tbody>`),`<table> <thead> `+_e+`</thead> `+Ge+`</table> `}tablerow({text:de}){return`<tr> ${de}</tr> `}tablecell(de){const _e=this.parser.parseInline(de.tokens),Le=de.header?"th":"td";return(de.align?`<${Le} align="${de.align}">`:`<${Le}>`)+_e+`</${Le}> `}strong({tokens:de}){return`<strong>${this.parser.parseInline(de)}</strong>`}em({tokens:de}){return`<em>${this.parser.parseInline(de)}</em>`}codespan({text:de}){return`<code>${de}</code>`}br(de){return"<br>"}del({tokens:de}){return`<del>${this.parser.parseInline(de)}</del>`}link({href:de,title:_e,tokens:Le}){const Ge=this.parser.parseInline(Le),gt=p(de);if(gt===null)return Ge;de=gt;let pt='<a href="'+de+'"';return _e&&(pt+=' title="'+_e+'"'),pt+=">"+Ge+"</a>",pt}image({href:de,title:_e,text:Le}){const Ge=p(de);if(Ge===null)return Le;de=Ge;let gt=`<img src="${de}" alt="${Le}"`;return _e&&(gt+=` title="${_e}"`),gt+=">",gt}text(de){return"tokens"in de&&de.tokens?this.parser.parseInline(de.tokens):de.text}}class Rt{strong({text:de}){return de}em({text:de}){return de}codespan({text:de}){return de}del({text:de}){return de}html({text:de}){return de}text({text:de}){return de}link({text:de}){return""+de}image({text:de}){return""+de}br(){return""}}class se{constructor(de){Xr(this,"options");Xr(this,"renderer");Xr(this,"textRenderer");this.options=de||e.defaults,this.options.renderer=this.options.renderer||new Ct,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Rt}static parse(de,_e){return new se(_e).parse(de)}static parseInline(de,_e){return new se(_e).parseInline(de)}parse(de,_e=!0){let Le="";for(let Ge=0;Ge<de.length;Ge++){const gt=de[Ge];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[gt.type]){const Vt=gt,Pn=this.options.extensions.renderers[Vt.type].call({parser:this},Vt);if(Pn!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(Vt.type)){Le+=Pn||"";continue}}const pt=gt;switch(pt.type){case"space":{Le+=this.renderer.space(pt);continue}case"hr":{Le+=this.renderer.hr(pt);continue}case"heading":{Le+=this.renderer.heading(pt);continue}case"code":{Le+=this.renderer.code(pt);continue}case"table":{Le+=this.renderer.table(pt);continue}case"blockquote":{Le+=this.renderer.blockquote(pt);continue}case"list":{Le+=this.renderer.list(pt);continue}case"html":{Le+=this.renderer.html(pt);continue}case"paragraph":{Le+=this.renderer.paragraph(pt);continue}case"text":{let Vt=pt,Pn=this.renderer.text(Vt);for(;Ge+1<de.length&&de[Ge+1].type==="text";)Vt=de[++Ge],Pn+=` `+this.renderer.text(Vt);_e?Le+=this.renderer.paragraph({type:"paragraph",raw:Pn,text:Pn,tokens:[{type:"text",raw:Pn,text:Pn}]}):Le+=Pn;continue}default:{const Vt='Token with "'+pt.type+'" type was not found.';if(this.options.silent)return console.error(Vt),"";throw new Error(Vt)}}}return Le}parseInline(de,_e){_e=_e||this.renderer;let Le="";for(let Ge=0;Ge<de.length;Ge++){const gt=de[Ge];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[gt.type]){const Vt=this.options.extensions.renderers[gt.type].call({parser:this},gt);if(Vt!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(gt.type)){Le+=Vt||"";continue}}const pt=gt;switch(pt.type){case"escape":{Le+=_e.text(pt);break}case"html":{Le+=_e.html(pt);break}case"link":{Le+=_e.link(pt);break}case"image":{Le+=_e.image(pt);break}case"strong":{Le+=_e.strong(pt);break}case"em":{Le+=_e.em(pt);break}case"codespan":{Le+=_e.codespan(pt);break}case"br":{Le+=_e.br(pt);break}case"del":{Le+=_e.del(pt);break}case"text":{Le+=_e.text(pt);break}default:{const Vt='Token with "'+pt.type+'" type was not found.';if(this.options.silent)return console.error(Vt),"";throw new Error(Vt)}}}return Le}}class ke{constructor(de){Xr(this,"options");this.options=de||e.defaults}preprocess(de){return de}postprocess(de){return de}processAllTokens(de){return de}}Xr(ke,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Ae{constructor(...de){Xr(this,"defaults",t());Xr(this,"options",this.setOptions);Xr(this,"parse",this.parseMarkdown(Tt.lex,se.parse));Xr(this,"parseInline",this.parseMarkdown(Tt.lexInline,se.parseInline));Xr(this,"Parser",se);Xr(this,"Renderer",Ct);Xr(this,"TextRenderer",Rt);Xr(this,"Lexer",Tt);Xr(this,"Tokenizer",C);Xr(this,"Hooks",ke);this.use(...de)}walkTokens(de,_e){var Ge,gt;let Le=[];for(const pt of de)switch(Le=Le.concat(_e.call(this,pt)),pt.type){case"table":{const Vt=pt;for(const Pn of Vt.header)Le=Le.concat(this.walkTokens(Pn.tokens,_e));for(const Pn of Vt.rows)for(const Ln of Pn)Le=Le.concat(this.walkTokens(Ln.tokens,_e));break}case"list":{const Vt=pt;Le=Le.concat(this.walkTokens(Vt.items,_e));break}default:{const Vt=pt;(gt=(Ge=this.defaults.extensions)==null?void 0:Ge.childTokens)!=null&>[Vt.type]?this.defaults.extensions.childTokens[Vt.type].forEach(Pn=>{const Ln=Vt[Pn].flat(1/0);Le=Le.concat(this.walkTokens(Ln,_e))}):Vt.tokens&&(Le=Le.concat(this.walkTokens(Vt.tokens,_e)))}}return Le}use(...de){const _e=this.defaults.extensions||{renderers:{},childTokens:{}};return de.forEach(Le=>{const Ge={...Le};if(Ge.async=this.defaults.async||Ge.async||!1,Le.extensions&&(Le.extensions.forEach(gt=>{if(!gt.name)throw new Error("extension name required");if("renderer"in gt){const pt=_e.renderers[gt.name];pt?_e.renderers[gt.name]=function(...Vt){let Pn=gt.renderer.apply(this,Vt);return Pn===!1&&(Pn=pt.apply(this,Vt)),Pn}:_e.renderers[gt.name]=gt.renderer}if("tokenizer"in gt){if(!gt.level||gt.level!=="block"&>.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const pt=_e[gt.level];pt?pt.unshift(gt.tokenizer):_e[gt.level]=[gt.tokenizer],gt.start&&(gt.level==="block"?_e.startBlock?_e.startBlock.push(gt.start):_e.startBlock=[gt.start]:gt.level==="inline"&&(_e.startInline?_e.startInline.push(gt.start):_e.startInline=[gt.start]))}"childTokens"in gt&>.childTokens&&(_e.childTokens[gt.name]=gt.childTokens)}),Ge.extensions=_e),Le.renderer){const gt=this.defaults.renderer||new Ct(this.defaults);for(const pt in Le.renderer){if(!(pt in gt))throw new Error(`renderer '${pt}' does not exist`);if(["options","parser"].includes(pt))continue;const Vt=pt,Pn=Le.renderer[Vt],Ln=gt[Vt];gt[Vt]=(...bi)=>{let et=Pn.apply(gt,bi);return et===!1&&(et=Ln.apply(gt,bi)),et||""}}Ge.renderer=gt}if(Le.tokenizer){const gt=this.defaults.tokenizer||new C(this.defaults);for(const pt in Le.tokenizer){if(!(pt in gt))throw new Error(`tokenizer '${pt}' does not exist`);if(["options","rules","lexer"].includes(pt))continue;const Vt=pt,Pn=Le.tokenizer[Vt],Ln=gt[Vt];gt[Vt]=(...bi)=>{let et=Pn.apply(gt,bi);return et===!1&&(et=Ln.apply(gt,bi)),et}}Ge.tokenizer=gt}if(Le.hooks){const gt=this.defaults.hooks||new ke;for(const pt in Le.hooks){if(!(pt in gt))throw new Error(`hook '${pt}' does not exist`);if(pt==="options")continue;const Vt=pt,Pn=Le.hooks[Vt],Ln=gt[Vt];ke.passThroughHooks.has(pt)?gt[Vt]=bi=>{if(this.defaults.async)return Promise.resolve(Pn.call(gt,bi)).then(Lt=>Ln.call(gt,Lt));const et=Pn.call(gt,bi);return Ln.call(gt,et)}:gt[Vt]=(...bi)=>{let et=Pn.apply(gt,bi);return et===!1&&(et=Ln.apply(gt,bi)),et}}Ge.hooks=gt}if(Le.walkTokens){const gt=this.defaults.walkTokens,pt=Le.walkTokens;Ge.walkTokens=function(Vt){let Pn=[];return Pn.push(pt.call(this,Vt)),gt&&(Pn=Pn.concat(gt.call(this,Vt))),Pn}}this.defaults={...this.defaults,...Ge}}),this}setOptions(de){return this.defaults={...this.defaults,...de},this}lexer(de,_e){return Tt.lex(de,_e??this.defaults)}parser(de,_e){return se.parse(de,_e??this.defaults)}parseMarkdown(de,_e){return(Ge,gt)=>{const pt={...gt},Vt={...this.defaults,...pt},Pn=this.onError(!!Vt.silent,!!Vt.async);if(this.defaults.async===!0&&pt.async===!1)return Pn(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof Ge>"u"||Ge===null)return Pn(new Error("marked(): input parameter is undefined or null"));if(typeof Ge!="string")return Pn(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ge)+", string expected"));if(Vt.hooks&&(Vt.hooks.options=Vt),Vt.async)return Promise.resolve(Vt.hooks?Vt.hooks.preprocess(Ge):Ge).then(Ln=>de(Ln,Vt)).then(Ln=>Vt.hooks?Vt.hooks.processAllTokens(Ln):Ln).then(Ln=>Vt.walkTokens?Promise.all(this.walkTokens(Ln,Vt.walkTokens)).then(()=>Ln):Ln).then(Ln=>_e(Ln,Vt)).then(Ln=>Vt.hooks?Vt.hooks.postprocess(Ln):Ln).catch(Pn);try{Vt.hooks&&(Ge=Vt.hooks.preprocess(Ge));let Ln=de(Ge,Vt);Vt.hooks&&(Ln=Vt.hooks.processAllTokens(Ln)),Vt.walkTokens&&this.walkTokens(Ln,Vt.walkTokens);let bi=_e(Ln,Vt);return Vt.hooks&&(bi=Vt.hooks.postprocess(bi)),bi}catch(Ln){return Pn(Ln)}}}onError(de,_e){return Le=>{if(Le.message+=` Please report this to https://github.com/markedjs/marked.`,de){const Ge="<p>An error occurred:</p><pre>"+u(Le.message+"",!0)+"</pre>";return _e?Promise.resolve(Ge):Ge}if(_e)return Promise.reject(Le);throw Le}}}const je=new Ae;function Ve(_n,de){return je.parse(_n,de)}Ve.options=Ve.setOptions=function(_n){return je.setOptions(_n),Ve.defaults=je.defaults,i(Ve.defaults),Ve},Ve.getDefaults=t,Ve.defaults=e.defaults,Ve.use=function(..._n){return je.use(..._n),Ve.defaults=je.defaults,i(Ve.defaults),Ve},Ve.walkTokens=function(_n,de){return je.walkTokens(_n,de)},Ve.parseInline=je.parseInline,Ve.Parser=se,Ve.parser=se.parse,Ve.Renderer=Ct,Ve.TextRenderer=Rt,Ve.Lexer=Tt,Ve.lexer=Tt.lex,Ve.Tokenizer=C,Ve.Hooks=ke,Ve.parse=Ve;const Qt=Ve.options,rt=Ve.setOptions,Cn=Ve.use,Rn=Ve.walkTokens,li=Ve.parseInline,Mi=Ve,si=se.parse,oi=Tt.lex;e.Hooks=ke,e.Lexer=Tt,e.Marked=Ae,e.Parser=se,e.Renderer=Ct,e.TextRenderer=Rt,e.Tokenizer=C,e.getDefaults=t,e.lexer=oi,e.marked=Ve,e.options=Qt,e.parse=Mi,e.parseInline=li,e.parser=si,e.setOptions=rt,e.use=Cn,e.walkTokens=Rn})})();_d.Hooks||exports.Hooks;_d.Lexer||exports.Lexer;_d.Marked||exports.Marked;_d.Parser||exports.Parser;var Olt=_d.Renderer||exports.Renderer;_d.TextRenderer||exports.TextRenderer;_d.Tokenizer||exports.Tokenizer;var Wpr=_d.defaults||exports.defaults;_d.getDefaults||exports.getDefaults;var Ite=_d.lexer||exports.lexer;_d.marked||exports.marked;_d.options||exports.options;var Mlt=_d.parse||exports.parse;_d.parseInline||exports.parseInline;var zpr=_d.parser||exports.parser;_d.setOptions||exports.setOptions;_d.use||exports.use;_d.walkTokens||exports.walkTokens;function Upr(n){return JSON.stringify(n,qpr)}function k_e(n){let e=JSON.parse(n);return e=T_e(e),e}function qpr(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function T_e(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return vi.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof dte||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t<n.length;++t)n[t]=T_e(n[t],e+1);else for(const t in n)Object.hasOwnProperty.call(n,t)&&(n[t]=T_e(n[t],e+1))}return n}const Yce=Object.freeze({image:({href:n,title:e,text:t})=>{let i=[],r=[];return n&&({href:n,dimensions:i}=Vpr(n),r.push(`src="${lW(n)}"`)),t&&r.push(`alt="${lW(t)}"`),e&&r.push(`title="${lW(e)}"`),i.length&&(r=r.concat(i)),"<img "+r.join(" ")+">"},paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>`},link({href:n,title:e,tokens:t}){let i=this.parser.parseInline(t);return typeof n!="string"?"":(n===i&&(i=Gce(i)),e=typeof e=="string"?lW(Gce(e)):"",n=Gce(n),n=n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),`<a href="${n}" title="${e||n}" draggable="false">${i}</a>`)}});function Lte(n,e={},t={}){const i=new Et;let r=!1;const s=iTe(e),o=function(m){let _;try{_=k_e(decodeURIComponent(m))}catch{}return _?(_=Gst(_,v=>{if(n.uris&&n.uris[v])return vi.revive(n.uris[v])}),encodeURIComponent(JSON.stringify(_))):m},a=function(m,_){const v=n.uris&&n.uris[m];let b=vi.revive(v);return _?m.startsWith(ir.data+":")?m:(b||(b=vi.parse(m)),Yee.uriToBrowserUri(b).toString(!0)):!b||vi.parse(m).toString()===b.toString()?m:(b.query&&(b=b.with({query:o(b.query)})),b.toString())},l=new Olt;l.image=Yce.image,l.link=Yce.link,l.paragraph=Yce.paragraph;const c=[],u=[];if(e.codeBlockRendererSync?l.code=({text:m,lang:_})=>{const v=E_e.nextId(),b=e.codeBlockRendererSync(W7e(_),m);return u.push([v,b]),`<div class="code" data-code="${v}">${QF(m)}</div>`}:e.codeBlockRenderer&&(l.code=({text:m,lang:_})=>{const v=E_e.nextId(),b=e.codeBlockRenderer(W7e(_),m);return c.push(b.then(y=>[v,y])),`<div class="code" data-code="${v}">${QF(m)}</div>`}),e.actionHandler){const m=function(b){let y=b.target;if(!(y.tagName!=="A"&&(y=y.parentElement,!y||y.tagName!=="A")))try{let C=y.dataset.href;C&&(n.baseUri&&(C=Qce(vi.from(n.baseUri),C)),e.actionHandler.callback(C,b))}catch(C){tr(C)}finally{b.preventDefault()}},_=e.actionHandler.disposables.add(new Yr(s,"click")),v=e.actionHandler.disposables.add(new Yr(s,"auxclick"));e.actionHandler.disposables.add(rn.any(_.event,v.event)(b=>{const y=new B_(Ti(s),b);!y.leftButton&&!y.middleButton||m(y)})),e.actionHandler.disposables.add(_t(s,"keydown",b=>{const y=new Io(b);!y.equals(10)&&!y.equals(3)||m(y)}))}n.supportHtml||(l.html=({text:m})=>{var v;return(v=e.sanitizerOptions)!=null&&v.replaceWithPlaintext?QF(m):(n.isTrusted?m.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?m:""}),t.renderer=l;let d=n.value??"";d.length>1e5&&(d=`${d.substr(0,1e5)}…`),n.supportThemeIcons&&(d=Apr(d));let f;if(e.fillInIncompleteTokens){const m={...Wpr,...t},_=Ite(d,m),v=sgr(_);f=zpr(v,m)}else f=Mlt(d,{...t,async:!1});n.supportThemeIcons&&(f=uE(f).map(_=>typeof _=="string"?_:_.outerHTML).join(""));const g=new DOMParser().parseFromString(I_e({isTrusted:n.isTrusted,...e.sanitizerOptions},f),"text/html");if(g.body.querySelectorAll("img, audio, video, source").forEach(m=>{const _=m.getAttribute("src");if(_){let v=_;try{n.baseUri&&(v=Qce(vi.from(n.baseUri),v))}catch{}if(m.setAttribute("src",a(v,!0)),e.remoteImageIsAllowed){const b=vi.parse(v);b.scheme!==ir.file&&b.scheme!==ir.data&&!e.remoteImageIsAllowed(b)&&m.replaceWith(Jt("",void 0,m.outerHTML))}}}),g.body.querySelectorAll("a").forEach(m=>{const _=m.getAttribute("href");if(m.setAttribute("href",""),!_||/^data:|javascript:/i.test(_)||/^command:/i.test(_)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(_))m.replaceWith(...m.childNodes);else{let v=a(_,!1);n.baseUri&&(v=Qce(vi.from(n.baseUri),_)),m.dataset.href=v}}),s.innerHTML=I_e({isTrusted:n.isTrusted,...e.sanitizerOptions},g.body.innerHTML),c.length>0)Promise.all(c).then(m=>{var b;if(r)return;const _=new Map(m),v=s.querySelectorAll("div[data-code]");for(const y of v){const C=_.get(y.dataset.code??"");C&&_u(y,C)}(b=e.asyncRenderCallback)==null||b.call(e)});else if(u.length>0){const m=new Map(u),_=s.querySelectorAll("div[data-code]");for(const v of _){const b=m.get(v.dataset.code??"");b&&_u(v,b)}}if(e.asyncRenderCallback)for(const m of s.getElementsByTagName("img")){const _=i.add(_t(m,"load",()=>{_.dispose(),e.asyncRenderCallback()}))}return{element:s,dispose:()=>{r=!0,i.dispose()}}}function W7e(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function Qce(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?$7e(n,e).toString():$7e(Tte(n),e).toString()}const Kpr=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function I_e(n,e){const{config:t,allowedSchemes:i}=Ypr(n),r=new Et;r.add(z7e("uponSanitizeAttribute",(s,o)=>{var a;if(o.attrName==="style"||o.attrName==="class"){if(s.tagName==="SPAN"){if(o.attrName==="style"){o.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(border-radius:[0-9]+px;)?$/.test(o.attrValue);return}else if(o.attrName==="class"){o.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(o.attrValue);return}}o.keepAttr=!1;return}else if(s.tagName==="INPUT"&&((a=s.attributes.getNamedItem("type"))==null?void 0:a.value)==="checkbox"){if(o.attrName==="type"&&o.attrValue==="checkbox"||o.attrName==="disabled"||o.attrName==="checked"){o.keepAttr=!0;return}o.keepAttr=!1}})),r.add(z7e("uponSanitizeElement",(s,o)=>{var a;if(o.tagName==="input"&&(((a=s.attributes.getNamedItem("type"))==null?void 0:a.value)==="checkbox"?s.setAttribute("disabled",""):n.replaceWithPlaintext||s.remove()),n.replaceWithPlaintext&&!o.allowedTags[o.tagName]&&o.tagName!=="body"&&s.parentElement){let l,c;if(o.tagName==="#comment")l=`<!--${s.textContent}-->`;else{const p=Kpr.includes(o.tagName),g=s.attributes.length?" "+Array.from(s.attributes).map(m=>`${m.name}="${m.value}"`).join(" "):"";l=`<${o.tagName}${g}>`,p||(c=`</${o.tagName}>`)}const u=document.createDocumentFragment(),d=s.parentElement.ownerDocument.createTextNode(l);u.appendChild(d);const f=c?s.parentElement.ownerDocument.createTextNode(c):void 0;for(;s.firstChild;)u.appendChild(s.firstChild);f&&u.appendChild(f),s.nodeType===Node.COMMENT_NODE?s.parentElement.insertBefore(u,s):s.parentElement.replaceChild(u,s)}})),r.add(Ilr(i));try{return Vot(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{r.dispose()}}const Gpr=["align","autoplay","alt","checked","class","colspan","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","style","target","title","type","width","start"];function Ypr(n){const e=[ir.http,ir.https,ir.mailto,ir.data,ir.file,ir.vscodeFileResource,ir.vscodeRemote,ir.vscodeRemoteResource];return n.isTrusted&&e.push(ir.command),{config:{ALLOWED_TAGS:n.allowedTags??[...Llr],ALLOWED_ATTR:Gpr,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function Qpr(n){return typeof n=="string"?n:Xpr(n)}function Xpr(n,e){let t=n.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=Mlt(t,{async:!1,renderer:egr.value}).replace(/&(#\d+|[a-zA-Z]+);/g,r=>Zpr.get(r)??r);return I_e({isTrusted:!1},i).toString()}const Zpr=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function Jpr(){const n=new Olt;return n.code=({text:e})=>e,n.blockquote=({text:e})=>e+` `,n.html=e=>"",n.heading=function({tokens:e}){return this.parser.parseInline(e)+` `},n.hr=()=>"",n.list=function({items:e}){return e.map(t=>this.listitem(t)).join(` `)+` `},n.listitem=({text:e})=>e+` `,n.paragraph=function({tokens:e}){return this.parser.parseInline(e)+` `},n.table=function({header:e,rows:t}){return e.map(i=>this.tablecell(i)).join(" ")+` `+t.map(i=>i.map(r=>this.tablecell(r)).join(" ")).join(` `)+` `},n.tablerow=({text:e})=>e,n.tablecell=function({tokens:e}){return this.parser.parseInline(e)},n.strong=({text:e})=>e,n.em=({text:e})=>e,n.codespan=({text:e})=>e,n.br=e=>` `,n.del=({text:e})=>e,n.image=e=>"",n.text=({text:e})=>e,n.link=({text:e})=>e,n}const egr=new Bb(n=>Jpr());function hG(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function jlt(n){var e,t;if(n.tokens)for(let i=n.tokens.length-1;i>=0;i--){const r=n.tokens[i];if(r.type==="text"){const s=r.raw.split(` `),o=s[s.length-1];if(o.includes("`"))return agr(n);if(o.includes("**"))return fgr(n);if(o.match(/\*\w/))return lgr(n);if(o.match(/(^|\s)__\w/))return pgr(n);if(o.match(/(^|\s)_\w/))return cgr(n);if(tgr(o)||ngr(o)&&n.tokens.slice(0,i).some(a=>a.type==="text"&&a.raw.match(/\[[^\]]*$/))){const a=n.tokens.slice(i+1);return((e=a[0])==null?void 0:e.type)==="link"&&((t=a[1])==null?void 0:t.type)==="text"&&a[1].raw.match(/^ *"[^"]*$/)||o.match(/^[^"]* +"[^"]*$/)?dgr(n):ugr(n)}else if(o.match(/(^|\s)\[\w*/))return hgr(n)}}}function tgr(n){return!!n.match(/(^|\s)\[.*\]\(\w*/)}function ngr(n){return!!n.match(/^[^\[]*\]\([^\)]*$/)}function igr(n){var l;const e=n.items[n.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0;let i;if((t==null?void 0:t.type)==="text"&&!("inRawBlock"in e)&&(i=jlt(t)),!i||i.type!=="paragraph")return;const r=hG(n.items.slice(0,-1)),s=(l=e.raw.match(/^(\s*(-|\d+\.|\*) +)/))==null?void 0:l[0];if(!s)return;const o=s+hG(e.tokens.slice(0,-1))+i.raw,a=Ite(r+o)[0];if(a.type==="list")return a}const rgr=3;function sgr(n){for(let e=0;e<rgr;e++){const t=ogr(n);if(t)n=t;else break}return n}function ogr(n){let e,t;for(e=0;e<n.length;e++){const i=n[e];if(i.type==="paragraph"&&i.raw.match(/(\n|^)\|/)){t=ggr(n.slice(e));break}if(e===n.length-1&&i.type==="list"){const r=igr(i);if(r){t=[r];break}}if(e===n.length-1&&i.type==="paragraph"){const r=jlt(i);if(r){t=[r];break}}}if(t){const i=[...n.slice(0,e),...t];return i.links=n.links,i}return null}function agr(n){return Dk(n,"`")}function lgr(n){return Dk(n,"*")}function cgr(n){return Dk(n,"_")}function ugr(n){return Dk(n,")")}function dgr(n){return Dk(n,'")')}function hgr(n){return Dk(n,"](https://microsoft.com)")}function fgr(n){return Dk(n,"**")}function pgr(n){return Dk(n,"__")}function Dk(n,e){const t=hG(Array.isArray(n)?n:[n]);return Ite(t+e)[0]}function ggr(n){const e=hG(n),t=e.split(` `);let i,r=!1;for(let s=0;s<t.length;s++){const o=t[s].trim();if(typeof i>"u"&&o.match(/^\s*\|/)){const a=o.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(o.match(/^\s*\|/)){if(s!==t.length-1)return;r=!0}else return}if(typeof i=="number"&&i>0){const s=r?t.slice(0,-1).join(` `):e,o=!!s.match(/\|\s*$/),a=s+(o?"":"|")+` |${" --- |".repeat(i)}`;return Ite(a)}}function z7e(n,e){return Wot(n,e),gi(()=>zot(n))}const xC=class xC{static createEmpty(e,t){const i=xC.defaultTokenMetadata,r=new Uint32Array(2);return r[0]=e.length,r[1]=i,new xC(r,e,t)}static createFromTextAndMetadata(e,t){let i=0,r="";const s=new Array;for(const{text:o,metadata:a}of e)s.push(i+o.length,a),i+=o.length,r+=o;return new xC(new Uint32Array(s),r,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 xC?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,s=r+(i<<1);for(let o=r;o<s;o++)if(this._tokens[o]!==e._tokens[o])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=rf.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return rf.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return rf.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return rf.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return rf.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return rf.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return xC.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new hTe(this,e,t,i)}static convertToEndOffset(e,t){const r=(e.length>>>1)-1;for(let s=0;s<r;s++)e[s<<1]=e[s+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 s=i+Math.floor((r-i)/2),o=e[s<<1];if(o===t)return s+1;o<t?i=s+1:o>t&&(r=s)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,r="";const s=new Array;let o=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(o,a);const c=this._tokens[(t<<1)+1];s.push(r.length,c),t++,o=a}else if(l){if(l.offset>o){r+=this._text.substring(o,l.offset);const c=this._tokens[(t<<1)+1];s.push(r.length,c),o=l.offset}r+=l.text,s.push(r.length,l.tokenMetadata),i++}else break}return new xC(new Uint32Array(s),r,this.languageIdCodec)}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i<t;i++)e(i)}};xC.defaultTokenMetadata=(32768|2<<24)>>>0;let Xc=xC;class hTe{constructor(e,t,i,r){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let s=this._firstTokenIndex,o=e.getCount();s<o&&!(e.getStartOffset(s)>=i);s++)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 hTe?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}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}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}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),r=this._source.getEndOffset(t);let s=this._source.getTokenText(t);return i<this._startOffset&&(s=s.substring(this._startOffset-i)),r>this._endOffset&&(s=s.substring(0,s.length-(r-this._endOffset))),s}forEach(e){for(let t=0;t<this.getCount();t++)e(t)}}function mgr(n,e){const t=e.lineNumber;if(!n.tokenization.isCheapToTokenize(t))return;n.tokenization.forceTokenization(t);const i=n.tokenization.getLineTokens(t),r=i.findTokenIndexAtOffset(e.column-1);return i.getStandardTokenType(r)}const mM=new class{clone(){return this}equals(n){return this===n}};function fTe(n,e){return new hke([new n7(0,"",n)],e)}function Ate(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new qee(t,e===null?mM:e)}const U7e={getInitialState:()=>mM,tokenizeEncoded:(n,e,t)=>Ate(0,t)};async function _gr(n,e,t){if(!t)return q7e(e,n.languageIdCodec,U7e);const i=await Ka.getOrCreate(t);return q7e(e,n.languageIdCodec,i||U7e)}function vgr(n,e,t,i,r,s,o){let a="<div>",l=i,c=0,u=!0;for(let d=0,f=e.getCount();d<f;d++){const p=e.getEndOffset(d);if(p<=i)continue;let g="";for(;l<p&&l<r;l++){const m=n.charCodeAt(l);switch(m){case 9:{let _=s-(l+c)%s;for(c+=_-1;_>0;)o&&u?(g+=" ",u=!1):(g+=" ",u=!0),_--;break}case 60:g+="<",u=!1;break;case 62:g+=">",u=!1;break;case 38:g+="&",u=!1;break;case 0:g+="�",u=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",u=!1;break;case 13:g+="​",u=!1;break;case 32:o&&u?(g+=" ",u=!1):(g+=" ",u=!0);break;default:g+=String.fromCharCode(m),u=!1}}if(a+=`<span style="${e.getInlineStyle(d,t)}">${g}</span>`,p>r||l>=r)break}return a+="</div>",a}function q7e(n,e,t){let i='<div class="monaco-tokenized-source">';const r=_1(n);let s=t.getInitialState();for(let o=0,a=r.length;o<a;o++){const l=r[o];o>0&&(i+="<br/>");const c=t.tokenizeEncoded(l,!0,s);Xc.convertToEndOffset(c.tokens,l.length);const d=new Xc(c.tokens,l,e).inflate();let f=0;for(let p=0,g=d.getCount();p<g;p++){const m=d.getClassName(p),_=d.getEndOffset(p);i+=`<span class="${m}">${QF(l.substring(f,_))}</span>`,f=_}s=c.endState}return i+="</div>",i}var bgr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},K7e=function(n,e){return function(t,i){e(t,i,n)}},L_e,CI;let Pw=(CI=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new Ue,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new Et,s=r.add(Lte(e,{...this._getRenderOptions(e,r),...t},i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,r)=>{var l,c;let s;i?s=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(s=(l=this._options.editor.getModel())==null?void 0:l.getLanguageId()),s||(s=Ih);const o=await _gr(this._languageService,r,s),a=document.createElement("span");if(a.innerHTML=((c=L_e._ttpTokenizer)==null?void 0:c.createHTML(o))??o,this._options.editor){const u=this._options.editor.getOption(50);vu(a,u)}else this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(a.style.fontSize=this._options.codeBlockFontSize),a},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>pTe(this._openerService,i,e.isTrusted),disposables:t}}}},L_e=CI,CI._ttpTokenizer=Xw("tokenizeToString",{createHTML(e){return e}}),CI);Pw=L_e=bgr([K7e(1,pa),K7e(2,xf)],Pw);async function pTe(n,e,t){try{return await n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:ygr(t)})}catch(i){return tr(i),!1}}function ygr(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}const dp=Ur("accessibilityService"),e$=new yn("accessibilityModeEnabled",!1),G7e=2e4;let w2,uU,A_e,dU,N_e;function Cgr(n){w2=document.createElement("div"),w2.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"),w2.appendChild(i),i};uU=e(),A_e=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),w2.appendChild(i),i};dU=t(),N_e=t(),n.appendChild(w2)}function Ph(n){w2&&(uU.textContent!==n?(mu(A_e),fG(uU,n)):(mu(uU),fG(A_e,n)))}function Xy(n){w2&&(dU.textContent!==n?(mu(N_e),fG(dU,n)):(mu(dU),fG(N_e,n)))}function fG(n,e){mu(n),e.length>G7e&&(e=e.substr(0,G7e)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}var wgr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},gj=function(n,e){return function(t,i){e(t,i,n)}};const N0=Jt;let D_e=class extends Tg{get _targetWindow(){return Ti(this._target.targetElements[0])}get _targetDocumentElement(){return Ti(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,r,s,o){var f,p,g,m,_,v,b;super(),this._keybindingService=t,this._configurationService=i,this._openerService=r,this._instantiationService=s,this._accessibilityService=o,this._messageListeners=new Et,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new Ue),this._onRequestLayout=this._register(new Ue),this._linkHandler=e.linkHandler||(y=>pTe(this._openerService,y,Rb(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new xgr(e.target),this._hoverPointer=(f=e.appearance)!=null&&f.showPointer?N0("div.workbench-hover-pointer"):void 0,this._hover=this._register(new nTe),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),(p=e.appearance)!=null&&p.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),(g=e.appearance)!=null&&g.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),(m=e.position)!=null&&m.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=((_=e.position)==null?void 0:_.hoverPosition)??3,this.onmousedown(this._hover.containerDomNode,y=>y.stopPropagation()),this.onkeydown(this._hover.containerDomNode,y=>{y.equals(9)&&this.dispose()}),this._register(_t(this._targetWindow,"blur",()=>this.dispose()));const a=N0("div.hover-row.markdown-hover"),l=N0("div.hover-contents");if(typeof e.content=="string")l.textContent=e.content,l.style.whiteSpace="pre-wrap";else if(Lc(e.content))l.appendChild(e.content),l.classList.add("html-hover-contents");else{const y=e.content,C=this._instantiationService.createInstance(Pw,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||Th.fontFamily}),{element:S}=C.render(y,{actionHandler:{callback:k=>this._linkHandler(k),disposables:this._messageListeners},asyncRenderCallback:()=>{l.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});l.appendChild(S)}if(a.appendChild(l),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const y=N0("div.hover-row.status-bar"),C=N0("div.actions");e.actions.forEach(S=>{const k=this._keybindingService.lookupKeybinding(S.commandId),I=k?k.getLabel():null;Ete.render(C,{label:S.label,commandId:S.commandId,run:L=>{S.run(L),this.dispose()},iconClass:S.iconClass},I)}),y.appendChild(C),this._hover.containerDomNode.appendChild(y)}this._hoverContainer=N0("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let c;if(e.actions&&e.actions.length>0?c=!1:((v=e.persistence)==null?void 0:v.hideOnHover)===void 0?c=typeof e.content=="string"||Rb(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes("</a>"):c=e.persistence.hideOnHover,(b=e.appearance)!=null&&b.showHoverHint){const y=N0("div.hover-row.status-bar"),C=N0("div.info");C.textContent=A("hoverhint","Hold {0} key to mouse over",zr?"Option":"Alt"),y.appendChild(C),this._hover.containerDomNode.appendChild(y)}const u=[...this._target.targetElements];c||u.push(this._hoverContainer);const d=this._register(new Y7e(u));if(this._register(d.onMouseOut(()=>{this._isLocked||this.dispose()})),c){const y=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new Y7e(y)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=d}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=Tke(this._hoverContainer,N0("div")),r=Ot(this._hoverContainer,N0("div"));i.tabIndex=0,r.tabIndex=0,this._register(_t(r,"focus",s=>{e.focus(),s.preventDefault()})),this._register(_t(i,"focus",s=>{t.focus(),s.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t<e.childNodes.length;t++){const i=e.childNodes.item(e.childNodes.length-t-1);if(i.nodeType===i.ELEMENT_NODE){const s=i;if(typeof s.tabIndex=="number"&&s.tabIndex>=0)return s}const r=this.findLastFocusableChild(i);if(r)return r}}render(e){var r;e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&ylt(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:r.getAriaLabel());i&&Xy(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=u=>{const d=Yot(u),f=u.getBoundingClientRect();return{top:f.top*d,bottom:f.bottom*d,right:f.right*d,left:f.left*d}},t=this._target.targetElements.map(u=>e(u)),{top:i,right:r,bottom:s,left:o}=t[0],a=r-o,l=s-i,c={top:i,right:r,bottom:s,left:o,width:a,height:l,center:{x:o+a/2,y:i+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._x<this._targetDocumentElement.clientLeft&&(this._x=e.left+2)}computeYCordinate(e){this._target.y!==void 0?this._y=this._target.y:this._hoverPosition===3?this._y=e.top:this._hoverPosition===2?this._y=e.bottom-2:this._hoverPointer?this._y=e.center.y+this._hover.containerDomNode.clientHeight/2:this._y=e.bottom,this._y>this._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?3:0;if(this._forcePosition){const i=t+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right<this._hover.containerDomNode.clientWidth+t&&(e.left>=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left<this._hover.containerDomNode.clientWidth+t&&(this._targetDocumentElement.clientWidth-e.right>=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?3:0;this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-i):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeight<this._hover.contentsDomNode.scrollHeight){const i=`${this._hover.scrollbar.options.verticalScrollbarSize}px`;this._hover.contentsDomNode.style.paddingRight!==i&&(this._hover.contentsDomNode.style.paddingRight=i)}}setHoverPointerPosition(e){if(this._hoverPointer)switch(this._hoverPosition){case 0:case 1:{this._hoverPointer.classList.add(this._hoverPosition===0?"right":"left");const t=this._hover.containerDomNode.clientHeight;t>e.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const r=this._x+i;(r<e.left||r>e.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};D_e=wgr([gj(1,Ws),gj(2,Dr),gj(3,xf),gj(4,mi),gj(5,dp)],D_e);class Y7e extends Tg{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new Ue),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=Ti(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(Ti(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class xgr{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var ed;(function(n){function e(s,o){if(s.start>=o.end||o.start>=s.end)return{start:0,end:0};const a=Math.max(s.start,o.start),l=Math.min(s.end,o.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(s){return s.end-s.start<=0}n.isEmpty=t;function i(s,o){return!t(e(s,o))}n.intersects=i;function r(s,o){const a=[],l={start:s.start,end:Math.min(o.start,s.end)},c={start:Math.max(o.end,s.start),end:s.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=r})(ed||(ed={}));function Sgr(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var HS;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(HS||(HS={}));function RR(n,e,t){const i=t.mode===HS.ALIGN?t.offset:t.offset+t.size,r=t.mode===HS.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}const rP=class rP extends Ye{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=Ye.None,this.toDisposeOnSetContainer=Ye.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Jt(".context-view"),ph(this.view),this.setContainer(e,t),this._register(gi(()=>this.setContainer(null,1)))}setContainer(e,t){var r;this.useFixedPosition=t!==1;const i=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,(r=this.shadowRootHostElement)==null||r.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=Jt(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=Egr,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Jt("slot"))}else this.container.appendChild(this.view);const s=new Et;rP.BUBBLE_UP_EVENTS.forEach(o=>{s.add(Da(this.container,o,a=>{this.onDOMEvent(a,!1)}))}),rP.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(Da(this.container,o,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var t,i;this.isVisible()&&this.hide(),mu(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",qf(this.view),this.toDisposeOnClean=e.render(this.view)||Ye.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)==null||i.call(t)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Fb&&yke.pointerEvents)){this.hide();return}(t=(e=this.delegate)==null?void 0:e.layout)==null||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Lc(e)){const f=al(e),p=Yot(e);t={top:f.top*p,left:f.left*p,width:f.width*p,height:f.height*p}}else Sgr(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=Vf(this.view),r=zC(this.view),s=this.delegate.anchorPosition||0,o=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;const u=Gj();if(a===0){const f={offset:t.top-u.pageYOffset,size:t.height,position:s===0?0:1},p={offset:t.left,size:t.width,position:o===0?0:1,mode:HS.ALIGN};l=RR(u.innerHeight,r,f)+u.pageYOffset,ed.intersects({start:l,end:l+r},{start:f.offset,end:f.offset+f.size})&&(p.mode=HS.AVOID),c=RR(u.innerWidth,i,p)}else{const f={offset:t.left,size:t.width,position:o===0?0:1},p={offset:t.top,size:t.height,position:s===0?0:1,mode:HS.ALIGN};c=RR(u.innerWidth,i,f),ed.intersects({start:c,end:c+i},{start:f.offset,end:f.offset+f.size})&&(p.mode=HS.AVOID),l=RR(u.innerHeight,r,p)+u.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(s===0?"bottom":"top"),this.view.classList.add(o===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=al(this.container);this.view.style.top=`${l-(this.useFixedPosition?al(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?al(this.view).left:d.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(),ph(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,Ti(e).document.activeElement):t&&!kc(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};rP.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],rP.BUBBLE_DOWN_EVENTS=["click"];let R_e=rP;const Egr=` :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 kgr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Tgr=function(n,e){return function(t,i){e(t,i,n)}};let pG=class extends Ye{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new R_e(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let r;t?t===this.layoutService.getContainer(Ti(t))?r=1:i?r=3:r=2:r=1,this.contextView.setContainer(t??this.layoutService.activeContainer,r),this.contextView.show(e);const s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};pG=kgr([Tgr(0,Nk)],pG);class Igr extends pG{getContextViewElement(){return this.contextView.getViewElement()}}class Lgr{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let r;if(e===void 0||cf(e)||Lc(e))r=e;else if(!J8(e.markdown))r=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(A("iconLabel.loading","Loading..."),t,i),this._cancellationTokenSource=new ba;const s=this._cancellationTokenSource.token;if(r=await e.markdown(s),r===void 0&&(r=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(r,t,i)}show(e,t,i){var s;const r=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,actions:i==null?void 0:i.actions,linkHandler:i==null?void 0:i.linkHandler,trapFocus:i==null?void 0:i.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!r,showHoverHint:(s=i==null?void 0:i.appearance)==null?void 0:s.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(o,t)}r==null||r.dispose()}hasContent(e){return e?Rb(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)==null?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)==null||e.dispose(),(t=this._cancellationTokenSource)==null||t.dispose(!0),this._cancellationTokenSource=void 0}}var Agr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},mj=function(n,e){return function(t,i){e(t,i,n)}};let P_e=class extends Ye{constructor(e,t,i,r,s){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=r,this._accessibilityService=s,this._managedHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new pG(this._layoutService))}showHover(e,t,i){var l,c,u,d;if(Q7e(this._currentHoverOptions)===Q7e(e)||this._currentHover&&((c=(l=this._currentHoverOptions)==null?void 0:l.persistence)!=null&&c.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const r=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),s=Hu();i||(r&&s?s.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=s):this._lastFocusedElementBeforeOpen=void 0);const o=new Et,a=this._instantiationService.createInstance(D_e,e);if((u=e.persistence)!=null&&u.sticky&&(a.isLocked=!0),a.onDispose(()=>{var p,g;((p=this._currentHover)==null?void 0:p.domNode)&&Xot(this._currentHover.domNode)&&((g=this._lastFocusedElementBeforeOpen)==null||g.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),o.dispose()},void 0,o),!e.container){const f=Lc(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(Ti(f))}if(this._contextViewHandler.showContextView(new Ngr(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,o),(d=e.persistence)!=null&&d.sticky)o.add(_t(Ti(e.container).document,Xt.MOUSE_DOWN,f=>{kc(f.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const p of e.target.targetElements)o.add(_t(p,Xt.CLICK,()=>this.hideHover()));else o.add(_t(e.target,Xt.CLICK,()=>this.hideHover()));const f=Hu();if(f){const p=Ti(f).document;o.add(_t(f,Xt.KEY_DOWN,g=>{var m;return this._keyDown(g,a,!!((m=e.persistence)!=null&&m.hideOnKeyDown))})),o.add(_t(p,Xt.KEY_DOWN,g=>{var m;return this._keyDown(g,a,!!((m=e.persistence)!=null&&m.hideOnKeyDown))})),o.add(_t(f,Xt.KEY_UP,g=>this._keyUp(g,a))),o.add(_t(p,Xt.KEY_UP,g=>this._keyUp(g,a)))}}if("IntersectionObserver"in bo){const f=new IntersectionObserver(g=>this._intersectionChange(g,a),{threshold:0}),p="targetElements"in e.target?e.target.targetElements[0]:e.target;f.observe(p),o.add(gi(()=>f.disconnect()))}return this._currentHover=a,a}hideHover(){var e;(e=this._currentHover)!=null&&e.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showHover(this._lastHoverOptions,!0,!0)}_keyDown(e,t,i){var o,a;if(e.key==="Alt"){t.isLocked=!0;return}const r=new Io(e);this._keybindingService.resolveKeyboardEvent(r).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(r,r.target).kind!==0||i&&(!((o=this._currentHoverOptions)!=null&&o.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(a=this._lastFocusedElementBeforeOpen)==null||a.focus())}_keyUp(e,t){var i;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(i=this._lastFocusedElementBeforeOpen)==null||i.focus()))}setupManagedHover(e,t,i,r){t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let s,o;const a=(y,C)=>{var k;const S=o!==void 0;y&&(o==null||o.dispose(),o=void 0),C&&(s==null||s.dispose(),s=void 0),S&&((k=e.onDidHideHover)==null||k.call(e),o=void 0)},l=(y,C,S,k)=>new vv(async()=>{(!o||o.isDisposed)&&(o=new Lgr(e,S||t,y>0),await o.update(typeof i=="function"?i():i,C,{...r,trapFocus:k}))},y);let c=!1;const u=_t(t,Xt.MOUSE_DOWN,()=>{c=!0,a(!0,!0)},!0),d=_t(t,Xt.MOUSE_UP,()=>{c=!1},!0),f=_t(t,Xt.MOUSE_LEAVE,y=>{c=!1,a(!1,y.fromElement===t)},!0),p=y=>{if(s)return;const C=new Et,S={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const k=I=>{S.x=I.x+10,Lc(I.target)&&X7e(I.target,t)!==t&&a(!0,!0)};C.add(_t(t,Xt.MOUSE_MOVE,k,!0))}s=C,!(Lc(y.target)&&X7e(y.target,t)!==t)&&C.add(l(e.delay,!1,S))},g=_t(t,Xt.MOUSE_OVER,p,!0),m=()=>{if(c||s)return;const y={targetElements:[t],dispose:()=>{}},C=new Et,S=()=>a(!0,!0);C.add(_t(t,Xt.BLUR,S,!0)),C.add(l(e.delay,!1,y)),s=C};let _;const v=t.tagName.toLowerCase();v!=="input"&&v!=="textarea"&&(_=_t(t,Xt.FOCUS,m,!0));const b={show:y=>{a(!1,!0),l(0,y,void 0,y)},hide:()=>{a(!0,!0)},update:async(y,C)=>{i=y,await(o==null?void 0:o.update(i,void 0,C))},dispose:()=>{this._managedHovers.delete(t),g.dispose(),f.dispose(),u.dispose(),d.dispose(),_==null||_.dispose(),a(!0,!0)}};return this._managedHovers.set(t,b),b}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};P_e=Agr([mj(0,mi),mj(1,up),mj(2,Ws),mj(3,Nk),mj(4,dp)],P_e);function Q7e(n){if(n!==void 0)return(n==null?void 0:n.id)??n}class Ngr{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function X7e(n,e){for(e=e??Ti(n).document.body;!n.hasAttribute("custom-hover")&&n!==e;)n=n.parentElement;return n}ns(C1,P_e,1);Gm((n,e)=>{const t=n.getColor(olt);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const t$=Ur("IWorkspaceEditService");class gTe{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(dE.is(t))return dE.lift(t);if(MP.is(t))return MP.lift(t);throw new Error("Unsupported edit")})}}class dE extends gTe{static is(e){return e instanceof dE?!0:zc(e)&&vi.isUri(e.resource)&&zc(e.textEdit)}static lift(e){return e instanceof dE?e:new dE(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 MP extends gTe{static is(e){return e instanceof MP?!0:zc(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof MP?e:new MP(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 Iu={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!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,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},n$=Object.freeze({id:"editor",order:5,type:"object",title:A("editorConfigurationTitle","Editor"),scope:5}),gG={...n$,properties:{"editor.tabSize":{type:"number",default:id.tabSize,minimum:1,markdownDescription:A("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:A("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:id.insertSpaces,markdownDescription:A("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:id.detectIndentation,markdownDescription:A("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:id.trimAutoWhitespace,description:A("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:id.largeFileOptimizations,description:A("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[A("wordBasedSuggestions.off","Turn off Word Based Suggestions."),A("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),A("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),A("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:A("wordBasedSuggestions","Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[A("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),A("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),A("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:A("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:A("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:A("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:A("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:A("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:A("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:A("editor.experimental.treeSitterTelemetry","Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `editor.experimental.preferTreeSitter` for specific languages will take precedence."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:A("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:A("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:A("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:A("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:A("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:A("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Iu.maxComputationTime,description:A("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Iu.maxFileSize,description:A("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Iu.renderSideBySide,description:A("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Iu.renderSideBySideInlineBreakpoint,description:A("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Iu.useInlineViewWhenSpaceIsLimited,description:A("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Iu.renderMarginRevertIcon,description:A("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Iu.renderGutterMenu,description:A("renderGutterMenu","When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Iu.ignoreTrimWhitespace,description:A("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Iu.renderIndicators,description:A("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Iu.diffCodeLens,description:A("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Iu.diffWordWrap,markdownEnumDescriptions:[A("wordWrap.off","Lines will never wrap."),A("wordWrap.on","Lines will wrap at the viewport width."),A("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Iu.diffAlgorithm,markdownEnumDescriptions:[A("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),A("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Iu.hideUnchangedRegions.enabled,markdownDescription:A("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Iu.hideUnchangedRegions.revealLineCount,markdownDescription:A("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Iu.hideUnchangedRegions.minimumLineCount,markdownDescription:A("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Iu.hideUnchangedRegions.contextLineCount,markdownDescription:A("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Iu.experimental.showMoves,markdownDescription:A("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Iu.experimental.showEmptyDecorations,description:A("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:Iu.experimental.useTrueInlineView,description:A("useTrueInlineView","If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function Dgr(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of TR){const e=n.schema;if(typeof e<"u")if(Dgr(e))gG.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(gG.properties[t]=e[t])}let cW=null;function Flt(){return cW===null&&(cW=Object.create(null),Object.keys(gG.properties).forEach(n=>{cW[n]=!0})),cW}function Rgr(n){return Flt()[`editor.${n}`]||!1}function Pgr(n){return Flt()[`diffEditor.${n}`]||!1}const Ogr=Ca.as(bv.Configuration);Ogr.registerConfiguration(gG);class ma{static insert(e,t){return{range:new ie(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 uW(n){return Object.isFrozen(n)?n:Jrr(n)}class hu{static createEmptyModel(e){return new hu({},[],[],void 0,e)}constructor(e,t,i,r,s){this._contents=e,this._keys=t,this._overrides=i,this.raw=r,this.logService=s,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if((e=this.raw)!=null&&e.length){const t=this.raw.map(i=>{if(i instanceof hu)return i;const r=new Mgr("",this.logService);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?E8e(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return uW(i.rawConfiguration.getValue(e))},get override(){return t?uW(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return uW(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const r=[];for(const{contents:s,identifiers:o,keys:a}of i.rawConfiguration.overrides){const l=new hu(s,a,[],void 0,i.logService).getValue(e);l!==void 0&&r.push({identifiers:o,value:l})}return r.length?uW(r):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?E8e(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 o,a;const t=TC(this.contents),i=TC(this.overrides),r=[...this.keys],s=(o=this.raw)!=null&&o.length?[...this.raw]:[this];for(const l of e)if(s.push(...(a=l.raw)!=null&&a.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(t,l.contents);for(const c of l.overrides){const[u]=i.filter(d=>fa(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=Iw(u.keys)):i.push(TC(c))}for(const c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new hu(t,r,i,s.every(l=>l instanceof hu)?void 0:s,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const r of Iw([...Object.keys(this.contents),...Object.keys(t)])){let s=this.contents[r];const o=t[r];o&&(typeof s=="object"&&typeof o=="object"?(s=TC(s),this.mergeContents(s,o)):s=o),i[r]=s}return new hu(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&zc(e[i])&&zc(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=TC(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const r=s=>{s&&(i?this.mergeContents(i,s):i=TC(s))};for(const s of this.overrides)s.identifiers.length===1&&s.identifiers[0]===e?t=s.contents:s.identifiers.includes(e)&&r(s.contents);return r(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Hcr(this.contents,e),JE.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>fa(i.identifiers,YK(e))),1))}updateValue(e,t,i){if(yat(this.contents,e,t,r=>this.logService.error(r)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),JE.test(e)){const r=YK(e),s={identifiers:r,keys:Object.keys(this.contents[e]),contents:zme(this.contents[e],a=>this.logService.error(a))},o=this.overrides.findIndex(a=>fa(a.identifiers,r));o!==-1?this.overrides[o]=s:this.overrides.push(s)}}}class Mgr{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||hu.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:r,overrides:s,restricted:o,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new hu(i,r,s,a?[e]:void 0,this.logService),this._restrictedConfigurations=o||[]}doParseRaw(e,t){const i=Ca.as(bv.Configuration).getConfigurationProperties(),r=this.filter(e,i,!0,t);e=r.raw;const s=zme(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`)),o=Object.keys(e),a=this.toOverrides(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:s,keys:o,overrides:a,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,i,r){var l,c,u;let s=!1;if(!(r!=null&&r.scopes)&&!(r!=null&&r.skipRestricted)&&!((l=r==null?void 0:r.exclude)!=null&&l.length))return{raw:e,restricted:[],hasExcludedProperties:s};const o={},a=[];for(const d in e)if(JE.test(d)&&i){const f=this.filter(e[d],t,!1,r);o[d]=f.raw,s=s||f.hasExcludedProperties,a.push(...f.restricted)}else{const f=t[d],p=f?typeof f.scope<"u"?f.scope:3:void 0;f!=null&&f.restricted&&a.push(d),!((c=r.exclude)!=null&&c.includes(d))&&((u=r.include)!=null&&u.includes(d)||(p===void 0||r.scopes===void 0||r.scopes.includes(p))&&!(r.skipRestricted&&(f!=null&&f.restricted)))?o[d]=e[d]:s=!0}return{raw:o,restricted:a,hasExcludedProperties:s}}toOverrides(e,t){const i=[];for(const r of Object.keys(e))if(JE.test(r)){const s={};for(const o in e[r])s[o]=e[r][o];i.push({identifiers:YK(r),keys:Object.keys(s),contents:zme(s,t)})}return i}}class jgr{constructor(e,t,i,r,s,o,a,l,c,u,d,f,p){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=r,this.defaultConfiguration=s,this.policyConfiguration=o,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=f,this.memoryConfigurationModel=p}toInspectValue(e){return(e==null?void 0:e.value)!==void 0||(e==null?void 0:e.override)!==void 0||(e==null?void 0:e.overrides)!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class Nte{constructor(e,t,i,r,s,o,a,l,c,u){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=r,this._remoteUserConfiguration=s,this._workspaceConfiguration=o,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=u,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Yc,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=hu.createEmptyModel(this.logService),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),s=this.getFolderConfigurationModelForResource(t.resource,i),o=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 jgr(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,s||void 0,o)}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 s=this._memoryConfigurationByResource.get(e);s&&(i=i.merge(s))}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:s}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:r,keys:s}]),e},[])}}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),r=this.parseConfigurationModel(e.policy,t),s=this.parseConfigurationModel(e.application,t),o=this.parseConfigurationModel(e.user,t),a=this.parseConfigurationModel(e.workspace,t),l=e.folders.reduce((c,u)=>(c.set(vi.revive(u[0]),this.parseConfigurationModel(u[1],t)),c),new Yc);return new Nte(i,r,s,o,hu.createEmptyModel(t),a,l,hu.createEmptyModel(t),new Yc,t)}static parseConfigurationModel(e,t){return new hu(e.contents,e.keys,e.overrides,void 0,t)}}class Fgr{constructor(e,t,i,r,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=r,this.logService=s,this._marker=` `,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,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 a of o)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Nte.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var a;const i=this._marker+e,r=this._affectsConfigStr.indexOf(i);if(r<0)return!1;const s=r+i.length;if(s>=this._affectsConfigStr.length)return!1;const o=this._affectsConfigStr.charCodeAt(s);if(o!==this._markerCode1&&o!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(a=this.previous)==null?void 0:a.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Xf(l,c)}return!0}}class Bgr{constructor(){this._onDidChange=new Ue,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 t6=new Bgr,mG={kind:0},$gr={kind:1};function Hgr(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class n6{constructor(e,t,i){var r;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const s of e){const o=s.command;o&&o.charAt(0)!=="-"&&this._defaultBoundCommands.set(o,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=n6.handleRemovals([].concat(e).concat(t));for(let s=0,o=this._keybindings.length;s<o;s++){const a=this._keybindings[s];if(a.chords.length===0)continue;const l=(r=a.when)==null?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||!Jlr(i,e.when)))}static handleRemovals(e){const t=new Map;for(let r=0,s=e.length;r<s;r++){const o=e[r];if(o.command&&o.command.charAt(0)==="-"){const a=o.command.substring(1);t.has(a)?t.get(a).push(o):t.set(a,[o])}}if(t.size===0)return e;const i=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];if(!o.command||o.command.length===0){i.push(o);continue}if(o.command.charAt(0)==="-")continue;const a=t.get(o.command);if(!a||!o.isDefault){i.push(o);continue}let l=!1;for(const c of a){const u=c.when;if(this._isTargetedForRemoval(o,c.chords,u)){l=!0;break}}if(!l){i.push(o);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 s=i[r];if(s.command===t.command)continue;let o=!0;for(let a=1;a<s.chords.length&&a<t.chords.length;a++)if(s.chords[a]!==t.chords[a]){o=!1;break}o&&n6.whenIsEntirelyIncluded(s.when,t.when)&&this._removeFromLookupMap(s)}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:$me(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 s=i[r];if(t.contextMatchesRules(s.when))return s}return i[i.length-1]}resolve(e,t,i){const r=[...t,i];this._log(`| Resolving ${r}`);const s=this._map.get(r[0]);if(s===void 0)return this._log("\\ No keybinding entries."),mG;let o=null;if(r.length<2)o=s;else{o=[];for(let l=0,c=s.length;l<c;l++){const u=s[l];if(r.length>u.chords.length)continue;let d=!0;for(let f=1;f<r.length;f++)if(u.chords[f]!==r[f]){d=!1;break}d&&o.push(u)}}const a=this._findCommand(e,o);return a?r.length<a.chords.length?(this._log(`\\ From ${o.length} keybinding entries, awaiting ${a.chords.length-r.length} more chord(s), when: ${Z7e(a.when)}, source: ${J7e(a)}.`),$gr):(this._log(`\\ From ${o.length} keybinding entries, matched ${a.command}, when: ${Z7e(a.when)}, source: ${J7e(a)}.`),Hgr(a.command,a.commandArgs,a.bubble)):(this._log(`\\ From ${o.length} keybinding entries, no when clauses matched the context.`),mG)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){const r=t[i];if(n6._contextMatchesRules(e,r.when))return r}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Z7e(n){return n?`${n.serialize()}`:"no when condition"}function J7e(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const Vgr=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class Wgr extends Ye{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:rn.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,r,s){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=r,this._logService=s,this._onDidUpdateKeybindings=this._register(new Ue),this._currentChords=[],this._currentChordChecker=new wke,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=PR.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new vv,this._currentlyDispatchingCommandId=null,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"),mG;const[r]=i.getDispatchChords();if(r===null)return this._log("\\ Keyboard event cannot be dispatched"),mG;const s=this._contextKeyService.getContext(t),o=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(s,o,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 ake("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(A("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(A("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),t6.enabled&&t6.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],t6.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=PR.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=PR.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[s]=i.getChords();return this._ignoreSingleModifiers=new PR(s),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){let r=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,o=null;if(i){const[u]=e.getSingleModifierDispatchChords();s=u,o=u?[u]:[]}else[s]=e.getDispatchChords(),o=this._currentChords.map(({keypress:u})=>u);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),r;const a=this._contextKeyService.getContext(t),l=e.getLabel(),c=this._getResolver().resolve(a,o,s);switch(c.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const u=this._currentChords.map(({label:d})=>d).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${l}".`),this._notificationService.status(A("missing.chord","The key combination ({0}, {1}) is not a command.",u,l),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}return r}case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),r=!0,this._expectAnotherChord(s,l),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),r;case 2:{if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${c.commandId} ]`),c.commandId===null||c.commandId===""){if(this.inChordMode){const u=this._currentChords.map(({label:d})=>d).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${l}".`),this._notificationService.status(A("missing.chord","The key combination ({0}, {1}) is not a command.",u,l),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}}else{this.inChordMode&&this._leaveChordMode(),c.isBubble||(r=!0),this._log(`+ Invoking command ${c.commandId}.`),this._currentlyDispatchingCommandId=c.commandId;try{typeof c.commandArgs>"u"?this._commandService.executeCommand(c.commandId).then(void 0,u=>this._notificationService.warn(u)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,u=>this._notificationService.warn(u))}finally{this._currentlyDispatchingCommandId=null}Vgr.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return r}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}const $Q=class $Q{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}}};$Q.EMPTY=new $Q(null);let PR=$Q;class eBe{constructor(e,t,i,r,s,o,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?O_e(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=O_e(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=s,this.extensionId=o,this.isBuiltinExtension=a}}function O_e(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 Dte{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 s=0,o=t.length;s<o;s++){const a=t[s],l=i(a);if(l===null)return null;r[s]=Kgr(a,l,this.modifierLabels[e])}return r.join(" ")}}const mTe=new Dte({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:A({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:A({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:A({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:A({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:A({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:A({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:A({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:A({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),zgr=new Dte({ctrlKey:A({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:A({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:A({key:"optKey.long",comment:["This is the long form for the Alt/Option key on the keyboard"]},"Option"),metaKey:A({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:A({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:A({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:A({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:A({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:A({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:A({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:A({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:A({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"}),Ugr=new Dte({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),qgr=new Dte({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 Kgr(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 Ggr extends yar{constructor(e,t){if(super(),t.length===0)throw Sm("chords");this._os=e,this._chords=t}getLabel(){return mTe.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return zgr.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Ugr.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return qgr.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 bar(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 T7 extends Ggr{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 DC.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":DC.toString(e.keyCode)}_getElectronAccelerator(e){return DC.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=DC.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return T7.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+=DC.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=dke[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 Aw)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Aw(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=O_e(e.chords.map(r=>this._toKeyCodeChord(r)));return i.length>0?[new T7(i,t)]:[]}}const _M=Ur("labelService"),Blt=Ur("progressService"),HIe=class HIe{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};HIe.None=Object.freeze({report(){}});let bb=HIe;const Rk=Ur("editorProgressService");class Ygr{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 Qgr{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?fke(e,this._value,0,e.length,this._from,this._to):z9(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Xgr{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?fke(e,this._value,0,e.length,this._from,this._to):z9(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Zgr{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 Xgr(!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 Sme(e,this._value.scheme);if(this._states[this._stateIdx]===2)return Sme(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return o7(e,this._value.query);if(this._states[this._stateIdx]===5)return o7(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 dW{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;return((e=this.left)==null?void 0:e.height)??0}get heightRight(){var e;return((e=this.right)==null?void 0:e.height)??0}}class jP{static forUris(e=()=>!1,t=()=>!1){return new jP(new Zgr(e,t))}static forStrings(){return new jP(new Ygr)}static forConfigKeys(){return new jP(new Qgr)}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 dW,this._root.segment=i.value());const s=[];for(r=this._root;;){const a=i.cmp(r.segment);if(a>0)r.left||(r.left=new dW,r.left.segment=i.value()),s.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new dW,r.right.segment=i.value()),s.push([1,r]),r=r.right;else if(i.hasNext())i.next(),r.mid||(r.mid=new dW,r.mid.segment=i.value()),s.push([0,r]),r=r.mid;else break}const o=r.value;r.value=t,r.key=e;for(let a=s.length-1;a>=0;a--){const l=s[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=s[a][0],d=s[a+1][0];if(u===1&&d===1)s[a][1]=l.rotateLeft();else if(u===-1&&d===-1)s[a][1]=l.rotateRight();else if(u===1&&d===-1)l.right=s[a+1][1]=s[a+1][1].rotateRight(),s[a][1]=l.rotateLeft();else if(u===-1&&d===1)l.left=s[a+1][1]=s[a+1][1].rotateLeft(),s[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(s[a-1][0]){case-1:s[a-1][1].left=s[a][1];break;case 1:s[a-1][1].right=s[a][1];break;case 0:s[a-1][1].mid=s[a][1];break}else this._root=s[0][1]}}return o}get(e){var t;return(t=this._getNode(e))==null?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){const i=this._iter.reset(e),r=[];let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)r.push([-1,s]),s=s.left;else if(o<0)r.push([1,s]),s=s.right;else if(i.hasNext())i.next(),r.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 o=this._min(s.right);if(o.key){const{key:a,value:l,segment:c}=o;this._delete(o.key,!1),s.key=a,s.value=l,s.segment=c}}else{const o=s.left??s.right;if(r.length>0){const[a,l]=r[r.length-1];switch(a){case-1:l.left=o;break;case 0:l.mid=o;break;case 1:l.right=o;break}}else this._root=o}for(let o=r.length-1;o>=0;o--){const a=r[o][1];a.updateHeight();const l=a.balanceFactor();if(l>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),r[o][1]=a.rotateLeft()):l<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),r[o][1]=a.rotateRight()),o>0)switch(r[o-1][0]){case-1:r[o-1][1].left=r[o][1];break;case 1:r[o-1][1].right=r[o][1];break;case 0:r[o-1][1].mid=r[o][1];break}else this._root=r[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 s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<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 s=i.cmp(r.segment);if(s>0)r=r.left;else if(s<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 qL=Ur("contextService");function M_e(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&vi.isUri(e.uri)}function Jgr(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&!M_e(n)&&!nmr(n)}const emr={id:"empty-window"};function tmr(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:lE(n)}:emr;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 nmr(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&vi.isUri(e.configPath)}class imr{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 j_e="code-workspace";A("codeWorkspace","Code Workspace");const $lt="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function rmr(n){return n.id===$lt}var F_e;(function(n){n.inspectTokensAction=A("inspectTokens","Developer: Inspect Tokens")})(F_e||(F_e={}));var _G;(function(n){n.gotoLineActionLabel=A("gotoLineActionLabel","Go to Line/Column...")})(_G||(_G={}));var B_e;(function(n){n.helpQuickAccessActionLabel=A("helpQuickAccess","Show all Quick Access Providers")})(B_e||(B_e={}));var vG;(function(n){n.quickCommandActionLabel=A("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=A("quickCommandActionHelp","Show And Run Commands")})(vG||(vG={}));var I7;(function(n){n.quickOutlineActionLabel=A("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=A("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(I7||(I7={}));var $_e;(function(n){n.editorViewAccessibleLabel=A("editorViewAccessibleLabel","Editor content")})($_e||($_e={}));var H_e;(function(n){n.toggleHighContrast=A("toggleHighContrast","Toggle High Contrast Theme")})(H_e||(H_e={}));var V_e;(function(n){n.bulkEditServiceSummary=A("bulkEditServiceSummary","Made {0} edits in {1} files")})(V_e||(V_e={}));const Hlt=Ur("workspaceTrustManagementService");let vM=[],_Te=[],Vlt=[];function hW(n,e=!1){smr(n,!1,e)}function smr(n,e,t){const i=omr(n,e);vM.push(i),i.userConfigured?Vlt.push(i):_Te.push(i),t&&!i.userConfigured&&vM.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 omr(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?Qat(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Rl.sep)>=0:!1}}function amr(){vM=vM.filter(n=>n.userConfigured),_Te=[]}function lmr(n,e){return cmr(n,e).map(t=>t.id)}function cmr(n,e){let t;if(n)switch(n.scheme){case ir.file:t=n.fsPath;break;case ir.data:{t=tk.parseMetaData(n).get(tk.META_DATA_LABEL);break}case ir.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:ol.unknown}];t=t.toLowerCase();const i=lE(t),r=tBe(t,i,Vlt);if(r)return[r,{id:Ih,mime:ol.text}];const s=tBe(t,i,_Te);if(s)return[s,{id:Ih,mime:ol.text}];if(e){const o=umr(e);if(o)return[o,{id:Ih,mime:ol.text}]}return[{id:"unknown",mime:ol.unknown}]}function tBe(n,e,t){var o;let i,r,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){i=l;break}if(l.filepattern&&(!r||l.filepattern.length>r.filepattern.length)){const c=l.filepatternOnPath?n:e;(o=l.filepatternLowercase)!=null&&o.call(l,c)&&(r=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(i)return i;if(r)return r;if(s)return s}function umr(n){if(bke(n)&&(n=n.substr(1)),n.length>0)for(let e=vM.length-1;e>=0;e--){const t=vM[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const fW=Object.prototype.hasOwnProperty,nBe="vs.editor.nullLanguage";class dmr{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(nBe,0),this._register(Ih,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]||nBe}}const $6=class $6 extends Ye{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new Ue),this.onDidChange=this._onDidChange.event,$6.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new dmr,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(aM.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){$6.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},amr();const e=[].concat(aM.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})}),Ca.as(bv.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;fW.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)hW({id:i,mime:r,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)hW({id:i,mime:r,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)hW({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);sar(l)||hW({id:i,mime:r,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let s=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?s=[null]:s=t.aliases),s!==null)for(const a of s)!a||a.length===0||e.aliases.push(a);const o=s!==null&&s.length>0;if(!(o&&s[0]===null)){const a=(o?s[0]:null)||i;(o||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?fW.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return fW.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&fW.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:lmr(e,t)}};$6.instanceCount=0;let W_e=$6;const vg=(n,e)=>n===e;function bG(n=vg){return(e,t)=>fa(e,t,n)}function hmr(){return(n,e)=>n.equals(e)}function z_e(n,e,t){if(t!==void 0){const i=n;return i==null||e===void 0||e===null?e===i:t(i,e)}else{const i=n;return(r,s)=>r==null||s===void 0||s===null?s===r:i(r,s)}}function yG(n,e){if(n===e)return!0;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!yG(n[t],e[t]))return!1;return!0}if(n&&typeof n=="object"&&e&&typeof e=="object"&&Object.getPrototypeOf(n)===Object.prototype&&Object.getPrototypeOf(e)===Object.prototype){const t=n,i=e,r=Object.keys(t),s=Object.keys(i),o=new Set(s);if(r.length!==s.length)return!1;for(const a of r)if(!o.has(a)||!yG(t[a],i[a]))return!1;return!0}return!1}class hd{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return fmr(e,this)}}const iBe=new Map,U_e=new WeakMap;function fmr(n,e){const t=U_e.get(n);if(t)return t;const i=pmr(n,e);if(i){let r=iBe.get(i)??0;r++,iBe.set(i,r);const s=r===1?i:`${i}#${r}`;return U_e.set(n,s),s}}function pmr(n,e){const t=U_e.get(n);if(t)return t;const i=e.owner?mmr(e.owner)+".":"";let r;const s=e.debugNameSource;if(s!==void 0)if(typeof s=="function"){if(r=s(),r!==void 0)return i+r}else return i+s;const o=e.referenceFn;if(o!==void 0&&(r=vTe(o),r!==void 0))return i+r;if(e.owner!==void 0){const a=gmr(e.owner,n);if(a!==void 0)return i+a}}function gmr(n,e){for(const t in n)if(n[t]===e)return t}const rBe=new Map,sBe=new WeakMap;function mmr(n){const e=sBe.get(n);if(e)return e;const t=_mr(n);let i=rBe.get(t)??0;i++,rBe.set(t,i);const r=i===1?t:`${t}#${i}`;return sBe.set(n,r),r}function _mr(n){const e=n.constructor;return e?e.name:"Object"}function vTe(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),r=i?i[1]:void 0;return r==null?void 0:r.trim()}let vmr;function Wlt(){return vmr}let zlt;function bmr(n){zlt=n}let Ult;function ymr(n){Ult=n}let q_e;function Cmr(n){q_e=n}class qlt{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 q_e({owner:i,debugName:()=>{const s=vTe(r);if(s!==void 0)return s;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)`},debugReferenceFn:r},s=>r(this.read(s),s))}flatten(){return q_e({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(zlt(this,t)),this}keepObserved(e){return e.add(Ult(this)),this}}class Y4 extends qlt{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 va(n,e){const t=new Q4(n,e);try{n(t)}finally{t.finish()}}let pW;function Jj(n){if(pW)n(pW);else{const e=new Q4(n,void 0);pW=e;try{n(e)}finally{e.finish(),pW=void 0}}}async function Klt(n,e){const t=new Q4(n,e);try{await n(t)}finally{t.finish()}}function KL(n,e,t){n?e(n):va(e,t)}class Q4{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():vTe(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this.updatingObservers;for(let t=0;t<e.length;t++){const{observer:i,observable:r}=e[t];i.endUpdate(r)}this.updatingObservers=null}}function Ar(n,e){let t;return typeof n=="string"?t=new hd(void 0,n,void 0):t=new hd(n,void 0,void 0),new bTe(t,e,vg)}class bTe extends Y4{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,i){super(),this._debugNameData=e,this._equalityComparator=i,this._value=t}get(){return this._value}set(e,t,i){var s;if(i===void 0&&this._equalityComparator(this._value,e))return;let r;t||(t=r=new Q4(()=>{},()=>`Setting ${this.debugName}`));try{const o=this._value;this._setValue(e),(s=Wlt())==null||s.handleObservableChanged(this,{oldValue:o,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{r&&r.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function L7(n,e){let t;return typeof n=="string"?t=new hd(void 0,n,void 0):t=new hd(n,void 0,void 0),new wmr(t,e,vg)}class wmr extends bTe{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)==null||e.dispose()}}function ai(n,e){return e!==void 0?new GL(new hd(n,void 0,e),e,void 0,void 0,void 0,vg):new GL(new hd(void 0,void 0,n),n,void 0,void 0,void 0,vg)}function i$(n,e,t){return new xmr(new hd(n,void 0,e),e,void 0,void 0,void 0,vg,t)}function Yp(n,e){return new GL(new hd(n.owner,n.debugName,n.debugReferenceFn),e,void 0,void 0,n.onLastObserverRemoved,n.equalsFn??vg)}Cmr(Yp);function Glt(n,e){return new GL(new hd(n.owner,n.debugName,void 0),e,n.createEmptyChangeSummary,n.handleChange,void 0,n.equalityComparer??vg)}function Pk(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const r=new Et;return new GL(new hd(i,void 0,t),s=>(r.clear(),t(s,r)),void 0,void 0,()=>r.dispose(),vg)}function $d(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);let r;return new GL(new hd(i,void 0,t),s=>{r?r.clear():r=new Et;const o=t(s);return o&&r.add(o),o},void 0,void 0,()=>{r&&(r.dispose(),r=void 0)},vg)}class GL extends Y4{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,r,s=void 0,o){var a;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=r,this._handleLastObserverRemoved=s,this._equalityComparator=o,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(a=this.createChangeSummary)==null?void 0:a.call(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.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)==null?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 o;if(this.state===3)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==0,i=this.value;this.state=3;const r=this.changeSummary;this.changeSummary=(o=this.createChangeSummary)==null?void 0:o.call(this);try{this.value=this._computeFn(this,r)}finally{for(const a of this.dependenciesToBeRemoved)a.removeObserver(this);this.dependenciesToBeRemoved.clear()}if(t&&!this._equalityComparator(i,this.value))for(const a of this.observers)a.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)}VL(()=>this.updateCount>=0)}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:s=>s===e},this.changeSummary):!0,r=this.state===3;if(i&&(this.state===1||r)&&(this.state=2,r))for(const s of this.observers)s.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)}}class xmr extends GL{constructor(e,t,i,r,s=void 0,o,a){super(e,t,i,r,s,o),this.set=a}}function Gi(n){return new Rte(new hd(void 0,void 0,n),n,void 0,void 0)}function r$(n,e){return new Rte(new hd(n.owner,n.debugName,n.debugReferenceFn??e),e,void 0,void 0)}function s$(n,e){return new Rte(new hd(n.owner,n.debugName,n.debugReferenceFn??e),e,n.createEmptyChangeSummary,n.handleChange)}function Smr(n,e){const t=new Et,i=s$({owner:n.owner,debugName:n.debugName,debugReferenceFn:n.debugReferenceFn??e,createEmptyChangeSummary:n.createEmptyChangeSummary,handleChange:n.handleChange},(r,s)=>{t.clear(),e(r,s,t)});return gi(()=>{i.dispose(),t.dispose()})}function uf(n){const e=new Et,t=r$({owner:void 0,debugName:void 0,debugReferenceFn:n},i=>{e.clear(),n(i,e)});return gi(()=>{t.dispose(),e.dispose()})}class Rte{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,r){var s;this._debugNameData=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=(s=this.createChangeSummary)==null?void 0:s.call(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var i,r;if(this.state===3)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=3;const t=this.disposed;try{if(!t){(i=Wlt())==null||i.handleAutorunTriggered(this);const s=this.changeSummary;this.changeSummary=(r=this.createChangeSummary)==null?void 0:r.call(this),this._runFn(this,s)}}finally{for(const s of this.dependenciesToBeRemoved)s.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--,VL(()=>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=Rte})(Gi||(Gi={}));function vm(n){return new Emr(n)}class Emr extends qlt{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 Gs(...n){let e,t,i;return n.length===3?[e,t,i]=n:[t,i]=n,new VS(new hd(e,void 0,i),t,i,()=>VS.globalTransaction,vg)}function kmr(n,e,t){return new VS(new hd(n.owner,n.debugName,n.debugReferenceFn??t),e,t,()=>VS.globalTransaction,n.equalsFn??vg)}class VS extends Y4{constructor(e,t,i,r,s){super(),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=r,this._equalityComparator=s,this.hasValue=!1,this.handleEvent=o=>{const a=this._getValue(o),l=this.value;(!this.hasValue||!this._equalityComparator(l,a))&&(this.value=a,this.hasValue&&KL(this._getTransaction(),u=>{for(const d of this.observers)u.updateObserver(d,this),d.handleChange(this,void 0)},()=>{const u=this.getDebugName();return"Event fired"+(u?`: ${u}`:"")}),this.hasValue=!0)}}getDebugName(){return this._debugNameData.getDebugName(this)}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=VS;function e(t,i){let r=!1;VS.globalTransaction===void 0&&(VS.globalTransaction=t,r=!0);try{i()}finally{r&&(VS.globalTransaction=void 0)}}n.batchEventsGlobally=e})(Gs||(Gs={}));function Fu(n,e){return new Tmr(n,e)}class Tmr extends Y4{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{va(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 X4(n){return typeof n=="string"?new oBe(n):new oBe(void 0,n)}class oBe extends Y4{get debugName(){return new hd(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){va(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 Imr(n){const e=new Ylt(!1,void 0);return n.addObserver(e),gi(()=>{n.removeObserver(e)})}ymr(Imr);function Z4(n,e){const t=new Ylt(!0,e);return n.addObserver(t),e?e(n.get()):n.reportChanges(),gi(()=>{n.removeObserver(t)})}bmr(Z4);class Ylt{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function o$(n,e){let t;return Yp({owner:n,debugReferenceFn:e},r=>(t=e(r,t),t))}function Lmr(n,e,t,i){let r=new aBe(t,i);return Yp({debugReferenceFn:t,owner:n,onLastObserverRemoved:()=>{r.dispose(),r=new aBe(t)}},o=>(r.setItems(e.read(o)),r.getItems()))}class aBe{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const r of e){const s=this._keySelector?this._keySelector(r):r;let o=this._cache.get(s);if(o)i.delete(s);else{const a=new Et;o={out:this._map(r,a),store:a},this._cache.set(s,o)}t.push(o.out)}for(const r of i)this._cache.get(r).store.dispose(),this._cache.delete(r);this._items=t}getItems(){return this._items}}function Amr(n,e){return o$(n,(t,i)=>i??e(t))}class Pte{static fromFn(e){return new Pte(e())}constructor(e){this._value=Ar(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(va(i=>{this._value.set(new lBe(t,void 0),i)}),t),t=>{throw va(i=>{this._value.set(new lBe(void 0,t),i)}),t})}}class lBe{constructor(e,t){this.data=e,this.error=t}}function Qlt(n,e,t,i){return e||(e=r=>r!=null),new Promise((r,s)=>{let o=!0,a=!1;const l=n.map(u=>({isFinished:e(u),error:t?t(u):!1,state:u})),c=Gi(u=>{const{isFinished:d,error:f,state:p}=l.read(u);(d||f)&&(o?a=!0:c.dispose(),f?s(f===!0?p:f):r(p))});if(i){const u=i.onCancellationRequested(()=>{c.dispose(),u.dispose(),s(new rv)});if(i.isCancellationRequested){c.dispose(),u.dispose(),s(new rv);return}}o=!1,a&&c.dispose()})}class Nmr extends Y4{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i){super(),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this.observers)for(const t of this._deltas)e.handleChange(this,t);this._deltas.length=0}else for(const e of this.observers)e.handleChange(this,void 0)}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(const e of this.observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();const e=[...this.observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this.observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let r;t||(t=r=new Q4(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),i!==void 0&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(s,o)=>{},handlePossibleChange:s=>{}},this),this._updateCounter>1)for(const s of this.observers)s.handlePossibleChange(this)}finally{r&&r.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function K_e(n,e){return n.lazy?new Nmr(new hd(n.owner,n.debugName,void 0),e,n.equalsFn??vg):new bTe(new hd(n.owner,n.debugName,void 0),e,n.equalsFn??vg)}const H6=class H6 extends Ye{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new Ue),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new Ue),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new Ue({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,H6.instanceCount++,this._registry=this._register(new W_e(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){H6.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 eke(i,null)}createById(e){return new cBe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new cBe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Ih),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),Ka.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};H6.instanceCount=0;let G_e=H6;class cBe{constructor(e,t){this._value=Gs(this,e,()=>t()),this.onDidChange=rn.fromObservable(this._value)}get languageId(){return this._value.get()}}const A7={RESOURCES:"ResourceURLs",TEXT:ol.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},Dmr=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let Ote=Dmr;const Rmr=new Bb(()=>Ote("mouse",!1)),Pmr=new Bb(()=>Ote("element",!1));function Omr(n){Ote=n}function jh(n){return n==="element"?Pmr.value:Rmr.value}function bM(){return Ote("element",!0)}let Xlt={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>null,showManagedHover:()=>{}};function Mmr(n){Xlt=n}function Jb(){return Xlt}class jmr{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(r=>r.splice(e,t,i))}}class BT extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function uBe(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=ed.intersect(n,i.range);ed.isEmpty(r)||t.push({range:r,size:i.size})}return t}function Y_e({start:n,end:e},t){return{start:n+t,end:e+t}}function Fmr(n){const e=[];let t=null;for(const i of n){const r=i.range.start,s=i.range.end,o=i.size;if(t&&o===t.size){t.range.end=s;continue}t={range:{start:r,end:s},size:o},e.push(t)}return e}function Bmr(...n){return Fmr(n.reduce((e,t)=>e.concat(t),[]))}class $mr{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,s=uBe({start:0,end:e},this.groups),o=uBe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:Y_e(l.range,r),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=Bmr(s,a,o),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 s=r.range.end-r.range.start,o=i+s*r.size;if(e<o)return t+Math.floor((e-i)/r.size);t+=s,i=o}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 s=r.range.end-r.range.start,o=i+s;if(e<o)return this._paddingTop+t+(e-i)*r.size;t+=s*r.size,i=o}return-1}}class Hmr{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=Jt(".monaco-list-row"),o=this.getRenderer(e).renderTemplate(r);t={domNode:r,templateId:e,templateData:o}}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"),e.remove()}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 Jw=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s};const $T={CurrentDragAndDropData:void 0},D0={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 a${constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Vmr{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Wmr{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 zmr(n,e){return Array.isArray(n)&&Array.isArray(e)?fa(n,e):n===e}class Umr{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=>{}}}const HQ=class HQ{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}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:bce(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=D0){var o,a;if(this.virtualDelegate=t,this.domId=`list_id_${++HQ.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Rm(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Ye.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Ye.None,this.onDragLeaveTimeout=Ye.None,this.disposables=new Et,this._onDidChangeContentHeight=new Ue,this._onDidChangeContentWidth=new Ue,this.onDidChangeContentHeight=rn.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),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=this.createRangeMap(r.paddingTop??0);for(const l of i)this.renderers.set(l.templateId,l);this.cache=this.disposables.add(new Hmr(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=r.horizontalScrolling??D0.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof r.paddingBottom>"u"?0:r.paddingBottom,this.accessibilityProvider=new Umr(r.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(r.transformOptimization??D0.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(dd.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new G4({forceIntegerValues:!0,smoothScrollDuration:r.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:l=>lp(Ti(this.domNode),l)})),this.scrollableElement=this.disposables.add(new Ste(this.rowsContainer,{alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel??D0.alwaysConsumeMouseWheel,horizontal:1,vertical:r.verticalScrollMode??D0.verticalScrollMode,useShadows:r.useShadows??D0.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(_t(this.rowsContainer,Oo.Change,l=>this.onTouchChange(l))),this.disposables.add(_t(this.scrollableElement.getDomNode(),"scroll",l=>l.target.scrollTop=0)),this.disposables.add(_t(this.domNode,"dragover",l=>this.onDragOver(this.toDragEvent(l)))),this.disposables.add(_t(this.domNode,"drop",l=>this.onDrop(this.toDragEvent(l)))),this.disposables.add(_t(this.domNode,"dragleave",l=>this.onDragLeave(this.toDragEvent(l)))),this.disposables.add(_t(this.domNode,"dragend",l=>this.onDragEnd(l))),this.setRowLineHeight=r.setRowLineHeight??D0.setRowLineHeight,this.setRowHeight=r.setRowHeight??D0.setRowHeight,this.supportDynamicHeights=r.supportDynamicHeights??D0.supportDynamicHeights,this.dnd=r.dnd??this.disposables.add(D0.dnd),this.layout((o=r.initialSize)==null?void 0:o.height,(a=r.initialSize)==null?void 0:a.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={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...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)}}createRangeMap(e){return new $mr(e)}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),s={start:e,end:e+t},o=ed.intersect(r,s),a=new Map;for(let S=o.end-1;S>=o.start;S--){const k=this.items[S];if(k.dragStartDisposable.dispose(),k.checkedDisposable.dispose(),k.row){let I=a.get(k.templateId);I||(I=[],a.set(k.templateId,I));const L=this.renderers.get(k.templateId);L&&L.disposeElement&&L.disposeElement(k.element,S,k.row.templateData,k.size),I.unshift(k.row)}k.row=null,k.stale=!0}const l={start:e+t,end:this.items.length},c=ed.intersect(l,r),u=ed.relativeComplement(l,r),d=i.map(S=>({id:String(this.itemId++),element:S,templateId:this.virtualDelegate.getTemplateId(S),size:this.virtualDelegate.getHeight(S),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(S),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Ye.None,checkedDisposable:Ye.None,stale:!1}));let f;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),f=this.items,this.items=d):(this.rangeMap.splice(e,t,d),f=this.items.splice(e,t,...d));const p=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=Y_e(c,p),_=ed.intersect(g,m);for(let S=_.start;S<_.end;S++)this.updateItemInDOM(this.items[S],S);const v=ed.relativeComplement(m,g);for(const S of v)for(let k=S.start;k<S.end;k++)this.removeItemFromDOM(k);const b=u.map(S=>Y_e(S,p)),C=[{start:e,end:e+i.length},...b].map(S=>ed.intersect(g,S)).reverse();for(const S of C)for(let k=S.end-1;k>=S.start;k--){const I=this.items[k],L=a.get(I.templateId),N=L==null?void 0:L.pop();this.insertItemInDOM(k,N)}for(const S of a.values())for(const k of S)this.cache.release(k);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),f.map(S=>S.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=lp(Ti(this.domNode),()=>{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(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}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:plr(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:bce(this.domNode)})}render(e,t,i,r,s,o=!1){const a=this.getRenderRange(t,i),l=ed.relativeComplement(a,e).reverse(),c=ed.relativeComplement(e,a);if(o){const u=ed.intersect(e,a);for(let d=u.start;d<u.end;d++)this.updateItemInDOM(this.items[d],d)}this.cache.transact(()=>{for(const u of c)for(let d=u.start;d<u.end;d++)this.removeItemFromDOM(d);for(const u of l)for(let d=u.end-1;d>=u.start;d--)this.insertItemInDOM(d)}),r!==void 0&&(this.rowsContainer.style.left=`-${r}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&s!==void 0&&(this.rowsContainer.style.width=`${Math.max(s,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){var l,c;const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const u=this.cache.alloc(i.templateId);i.row=u.row,i.stale||(i.stale=u.isReusingConnectedDomNode)}const r=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",r);const s=this.accessibilityProvider.isChecked(i.element);if(typeof s=="boolean")i.row.domNode.setAttribute("aria-checked",String(!!s));else if(s){const u=d=>i.row.domNode.setAttribute("aria-checked",String(!!d));u(s.value),i.checkedDisposable=s.onDidChange(()=>u(s.value))}if(i.stale||!i.row.domNode.parentElement){const u=((c=(l=this.items.at(e+1))==null?void 0:l.row)==null?void 0:c.domNode)??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==u)&&this.rowsContainer.insertBefore(i.row.domNode,u),i.stale=!1}this.updateItemInDOM(i,e);const o=this.renderers.get(i.templateId);if(!o)throw new Error(`No renderer found for template id ${i.templateId}`);o==null||o.renderElement(i.element,e,i.row.templateData,i.size);const a=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!a,a&&(i.dragStartDisposable=_t(i.row.domNode,"dragstart",u=>this.onDragStart(i.element,a,u))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=bce(e.row.domNode);const t=Ti(e.row.domNode).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 rn.map(this.disposables.add(new Yr(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return rn.map(this.disposables.add(new Yr(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return rn.filter(rn.map(this.disposables.add(new Yr(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return rn.map(this.disposables.add(new Yr(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return rn.map(this.disposables.add(new Yr(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return rn.map(this.disposables.add(new Yr(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return rn.any(rn.map(this.disposables.add(new Yr(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),rn.map(this.disposables.add(new Yr(this.domNode,Oo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return rn.map(this.disposables.add(new Yr(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return rn.map(this.disposables.add(new Yr(this.rowsContainer,Oo.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,s=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:r,sector:s}}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 s,o;if(!i.dataTransfer)return;const r=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(A7.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(r,i)),typeof a>"u"&&(a=String(r.length));const l=Jt(".monaco-drag-image");l.textContent=a,(d=>{for(;d&&!d.classList.contains("monaco-workbench");)d=d.parentElement;return d||this.domNode.ownerDocument})(this.domNode).appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>l.remove(),0)}this.domNode.classList.add("dragging"),this.currentDragData=new a$(r),$T.CurrentDragAndDropData=new Vmr(r),(o=(s=this.dnd).onDragStart)==null||o.call(s,this.currentDragData,i)}onDragOver(e){var s,o;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),$T.CurrentDragAndDropData&&$T.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if($T.CurrentDragAndDropData)this.currentDragData=$T.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new Wmr}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&((s=t.effect)==null?void 0:s.type)===0?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=Iw(i).filter(a=>a>=-1&&a<this.length).sort((a,l)=>a-l),i=i[0]===-1?[-1]:i;let r=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:"drop-target";if(zmr(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===r)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=r,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(r),this.rowsContainer.classList.add(r),this.currentDragFeedbackDisposable=gi(()=>{this.domNode.classList.remove(r),this.rowsContainer.classList.remove(r)});else{if(i.length>1&&r!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");r==="drop-target-after"&&i[0]<this.length-1&&(i[0]+=1,r="drop-target-before");for(const a of i){const l=this.items[a];l.dropTarget=!0,(o=l.row)==null||o.domNode.classList.add(r)}this.currentDragFeedbackDisposable=gi(()=>{var a;for(const l of i){const c=this.items[l];c.dropTarget=!1,(a=c.row)==null||a.domNode.classList.remove(r)}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=XE(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)==null||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,$T.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,$T.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Ye.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=Got(this.domNode).top;this.dragOverAnimationDisposable=Tlr(Ti(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=XE(()=>{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)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,r=Math.floor(i/.25);return hh(r,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(Lc(i)||ylr(i))&&i!==this.rowsContainer&&t.contains(i);){const r=i.getAttribute("data-index");if(r){const s=Number(r);if(!isNaN(s))return s}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 s,o;e===this.elementTop(r.start)?(s=r.start,o=0):r.end-r.start>1&&(s=r.start+1,o=this.elementTop(s)-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=ed.relativeComplement(r,l);for(const f of u)for(let p=f.start;p<f.end;p++)this.items[p].row&&this.removeItemFromDOM(p);const d=ed.relativeComplement(l,r).reverse();for(const f of d)for(let p=f.end-1;p>=f.start;p--)this.insertItemInDOM(p);for(let f=l.start;f<l.end;f++)this.items[f].row&&this.updateItemInDOM(this.items[f],f);if(typeof s=="number"){const f=this.scrollable.getFutureScrollPosition().scrollTop-e,p=this.elementTop(s)-o+f;this.setScrollTop(p,i)}this._onDidChangeContentHeight.fire(this.contentHeight);return}}}probeDynamicHeight(e){var o,a,l;const t=this.items[e];if(this.virtualDelegate.getDynamicHeight){const c=this.virtualDelegate.getDynamicHeight(t.element);if(c!==null){const u=t.size;return t.size=c,t.lastDynamicHeightWidth=this.renderWidth,c-u}}if(!t.hasDynamicHeight||t.lastDynamicHeightWidth===this.renderWidth||this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(t.element))return 0;const i=t.size;if(t.row)return t.row.domNode.style.height="",t.size=t.row.domNode.offsetHeight,t.size===0&&!kc(t.row.domNode,Ti(t.row.domNode).document.body)&&console.warn("Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!",new Error().stack),t.lastDynamicHeightWidth=this.renderWidth,t.size-i;const{row:r}=this.cache.alloc(t.templateId);r.domNode.style.height="",this.rowsContainer.appendChild(r.domNode);const s=this.renderers.get(t.templateId);if(!s)throw new Ps("Missing renderer for templateId: "+t.templateId);return s.renderElement(t.element,e,r.templateData,void 0),t.size=r.domNode.offsetHeight,(o=s.disposeElement)==null||o.call(s,t.element,e,r.templateData,void 0),(l=(a=this.virtualDelegate).setDynamicHeight)==null||l.call(a,t.element,t.size),t.lastDynamicHeightWidth=this.renderWidth,r.domNode.remove(),this.cache.release(r),t.size-i}getElementDomId(e){return`${this.domId}_${e}`}dispose(){var e,t,i;for(const r of this.items)if(r.dragStartDisposable.dispose(),r.checkedDisposable.dispose(),r.row){const s=this.renderers.get(r.row.templateId);s&&((e=s.disposeElement)==null||e.call(s,r.element,-1,r.row.templateData,void 0),s.disposeTemplate(r.row.templateData))}this.items=[],(t=this.domNode)==null||t.remove(),(i=this.dragOverAnimationDisposable)==null||i.dispose(),this.disposables.dispose()}};HQ.InstanceCount=0;let cv=HQ;Jw([xl],cv.prototype,"onMouseClick",null);Jw([xl],cv.prototype,"onMouseDblClick",null);Jw([xl],cv.prototype,"onMouseMiddleClick",null);Jw([xl],cv.prototype,"onMouseDown",null);Jw([xl],cv.prototype,"onMouseOver",null);Jw([xl],cv.prototype,"onMouseOut",null);Jw([xl],cv.prototype,"onContextMenu",null);Jw([xl],cv.prototype,"onTouchStart",null);Jw([xl],cv.prototype,"onTap",null);var Ok=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s};class qmr{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(s=>s.templateData===i);if(r>=0){const s=this.renderedElements[r];this.trait.unrender(i),s.index=t}else{const s={index:t,templateData:i};this.renderedElements.push(s)}this.trait.renderIndex(t,i)}splice(e,t,i){const r=[];for(const s of this.renderedElements)s.index<e?r.push(s):s.index>=e+t&&r.push({index:s.index+i-t,templateData:s.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 CG=class{get name(){return this._trait}get renderer(){return new qmr(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new Ue,this.onChange=this._onChange.event}splice(e,t,i){const r=i.length-t,s=e+t,o=[];let a=0;for(;a<this.sortedIndexes.length&&this.sortedIndexes[a]<e;)o.push(this.sortedIndexes[a++]);for(let l=0;l<i.length;l++)i[l]&&o.push(l+e);for(;a<this.sortedIndexes.length&&this.sortedIndexes[a]>=s;)o.push(this.sortedIndexes[a++]+r);this.renderer.splice(e,t,i.length),this._set(o,o)}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(hBe),t)}_set(e,t,i){const r=this.indexes,s=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const o=Q_e(s,e);return this.renderer.renderIndexes(o),this._onChange.fire({indexes:e,browserEvent:i}),r}get(){return this.indexes}contains(e){return X8(this.sortedIndexes,e,hBe)>=0}dispose(){vo(this._onChange)}};Ok([xl],CG.prototype,"renderer",null);class Kmr extends CG{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 Xce{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 s=new Set(r),o=i.map(a=>s.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,o)}}function hE(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function l$(n,e){return n.classList.contains(e)?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:l$(n.parentElement,e)}function eF(n){return l$(n,"monaco-editor")}function Gmr(n){return l$(n,"monaco-custom-toggle")}function Ymr(n){return l$(n,"action-item")}function i6(n){return l$(n,"monaco-tree-sticky-row")}function N7(n){return n.classList.contains("monaco-tree-sticky-container")}function Zlt(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:Zlt(n.parentElement)}class Jlt{get onKeyDown(){return rn.chain(this.disposables.add(new Yr(this.view.domNode,"keydown")).event,e=>e.filter(t=>!hE(t.target)).map(t=>new Io(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Et,this.multipleSelectionDisposables=new Et,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&&(zr?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(Xh(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()}}Ok([xl],Jlt.prototype,"onKeyDown",null);var _y;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(_y||(_y={}));var OR;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(OR||(OR={}));const Qmr=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 Xmr{constructor(e,t,i,r,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=r,this.delegate=s,this.enabled=!1,this.state=OR.Idle,this.mode=_y.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Et,this.disposables=new Et,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??_y.Automatic}enable(){if(this.enabled)return;let e=!1;const t=rn.chain(this.enabledDisposables.add(new Yr(this.view.domNode,"keydown")).event,s=>s.filter(o=>!hE(o.target)).filter(()=>this.mode===_y.Automatic||this.triggered).map(o=>new Io(o)).filter(o=>e||this.keyboardNavigationEventFilter(o)).filter(o=>this.delegate.mightProducePrintableCharacter(o)).forEach(o=>Jr.stop(o,!0)).map(o=>o.browserEvent.key)),i=rn.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);rn.reduce(rn.any(t,i),(s,o)=>o===null?null:(s||"")+o,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 t;const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const i=(t=this.list.options.accessibilityProvider)==null?void 0:t.getAriaLabel(this.list.element(e[0]));typeof i=="string"?Ph(i):i&&Ph(i.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=OR.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,r=this.state===OR.Idle?1:0;this.state=OR.Typing;for(let s=0;s<this.list.length;s++){const o=(i+s+r)%this.list.length,a=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(o)),l=a&&a.toString();if(this.list.options.typeNavigationEnabled){if(typeof l<"u"){if(S7(e,l)){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}const c=vpr(e,l);if(c&&c[0].end-c[0].start>1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}}}else if(typeof l>"u"||S7(e,l)){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Zmr{constructor(e,t){this.list=e,this.view=t,this.disposables=new Et;const i=rn.chain(this.disposables.add(new Yr(t.domNode,"keydown")).event,s=>s.filter(o=>!hE(o.target)).map(o=>new Io(o)));rn.chain(i,s=>s.filter(o=>o.keyCode===2&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey&&!o.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||!Lc(r)||r.tabIndex===-1)return;const s=Ti(r).getComputedStyle(r);s.visibility==="hidden"||s.display==="none"||(e.preventDefault(),e.stopPropagation(),r.focus())}dispose(){this.disposables.dispose()}}function ect(n){return zr?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function tct(n){return n.browserEvent.shiftKey}function Jmr(n){return kke(n)&&n.button===2}const dBe={isSelectionSingleChangeEvent:ect,isSelectionRangeChangeEvent:tct};class nct{constructor(e){this.list=e,this.disposables=new Et,this._onPointer=new Ue,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||dBe),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(dd.addTarget(e.getHTMLElement()))),rn.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||dBe))}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){eF(e.browserEvent.target)||Hu()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(hE(e.browserEvent.target)||eF(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||hE(e.browserEvent.target)||eF(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),Jmr(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(hE(e.browserEvent.target)||eF(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)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const r=Math.min(i,t),s=Math.max(i,t),o=Xh(r,s+1),a=this.list.getSelection(),l=n_r(Q_e(a,[i]),i);if(l.length===0)return;const c=Q_e(o,i_r(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const r=this.list.getSelection(),s=r.filter(o=>o!==t);this.list.setFocus([t]),this.list.setAnchor(t),r.length===s.length?this.list.setSelection([...s,t],e.browserEvent):this.list.setSelection(s,e.browserEvent)}}dispose(){this.disposables.dispose()}}class ict{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const r=uw(e.listFocusAndSelectionOutline,uw(e.listSelectionOutline,e.listFocusOutline??""));r&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } `);const s=uw(e.listSelectionOutline,e.listInactiveFocusOutline??"");s&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${s}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(` .monaco-list${t}.drop-target, .monaco-list${t} .monaco-list-rows.drop-target, .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } `),e.listDropBetweenBackground&&(i.push(` .monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before, .monaco-list${t} .monaco-list-row.drop-target-before::before { content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`),i.push(` .monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after, .monaco-list${t} .monaco-list-row.drop-target-after::after { content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`)),e.tableColumnsBorder&&i.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&&i.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=i.join(` `)}}const e_r={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:At.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:At.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:At.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,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},t_r={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function n_r(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 Q_e(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 i_r(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 hBe=(n,e)=>n-e;class r_r{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 s=0;for(const o of this.renderers)o.renderElement(e,t,i[s++],r)}disposeElement(e,t,i,r){var o;let s=0;for(const a of this.renderers)(o=a.disposeElement)==null||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 s_r{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new Et}}renderElement(e,t,i){const r=this.accessibilityProvider.getAriaLabel(e),s=r&&typeof r!="string"?r:vm(r);i.disposables.add(Gi(a=>{this.setAriaLabel(a.readObservable(s),i.container)}));const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.container.setAttribute("aria-level",`${o}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,r){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class o_r{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.call(i,e,t)}onDragOver(e,t,i,r,s){return this.dnd.onDragOver(e,t,i,r,s)}onDragLeave(e,t,i,r){var s,o;(o=(s=this.dnd).onDragLeave)==null||o.call(s,e,t,i,r)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}drop(e,t,i,r,s){this.dnd.drop(e,t,i,r,s)}dispose(){this.dnd.dispose()}}class Ig{get onDidChangeFocus(){return rn.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return rn.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=rn.chain(this.disposables.add(new Yr(this.view.domNode,"keydown")).event,s=>s.map(o=>new Io(o)).filter(o=>e=o.keyCode===58||o.shiftKey&&o.keyCode===68).map(o=>Jr.stop(o,!0)).filter(()=>!1)),i=rn.chain(this.disposables.add(new Yr(this.view.domNode,"keyup")).event,s=>s.forEach(()=>e=!1).map(o=>new Io(o)).filter(o=>o.keyCode===58||o.shiftKey&&o.keyCode===68).map(o=>Jr.stop(o,!0)).map(({browserEvent:o})=>{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:o}})),r=rn.chain(this.view.onContextMenu,s=>s.filter(o=>!e).map(({element:o,index:a,browserEvent:l})=>({element:o,index:a,anchor:new B_(Ti(this.view.domNode),l),browserEvent:l})));return rn.any(t,i,r)}get onKeyDown(){return this.disposables.add(new Yr(this.view.domNode,"keydown")).event}get onDidFocus(){return rn.signal(this.disposables.add(new Yr(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return rn.signal(this.disposables.add(new Yr(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,r,s=t_r){var c,u,d;this.user=e,this._options=s,this.focus=new CG("focused"),this.anchor=new CG("anchor"),this.eventBufferer=new V9,this._ariaLabel="",this.disposables=new Et,this._onDidDispose=new Ue,this.onDidDispose=this._onDidDispose.event;const o=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(c=this._options.accessibilityProvider)==null?void 0:c.getWidgetRole():"list";this.selection=new Kmr(o!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(a.push(new s_r(this.accessibilityProvider)),(d=(u=this.accessibilityProvider).onDidChangeActiveDescendant)==null||d.call(u,this.onDidChangeActiveDescendant,this,this.disposables)),r=r.map(f=>new r_r(f.templateId,[...a,f]));const l={...s,dnd:s.dnd&&new o_r(this,s.dnd)};if(this.view=this.createListView(t,i,r,l),this.view.domNode.setAttribute("role",o),s.styleController)this.styleController=s.styleController(this.view.domId);else{const f=_g(this.view.domNode);this.styleController=new ict(f,this.view.domId)}if(this.spliceable=new jmr([new Xce(this.focus,this.view,s.identityProvider),new Xce(this.selection,this.view,s.identityProvider),new Xce(this.anchor,this.view,s.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 Zmr(this,this.view)),(typeof s.keyboardSupport!="boolean"||s.keyboardSupport)&&(this.keyboardController=new Jlt(this,this.view,s),this.disposables.add(this.keyboardController)),s.keyboardNavigationLabelProvider){const f=s.keyboardNavigationDelegate||Qmr;this.typeNavigationController=new Xmr(this,this.view,s.keyboardNavigationLabelProvider,s.keyboardNavigationEventFilter??(()=>!0),f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(s),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 cv(e,t,i,r)}createMouseController(e){return new nct(this)}updateOptions(e={}){var t,i;this._options={...this._options,...e},(t=this.typeNavigationController)==null||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.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new BT(this.user,`Invalid start index: ${e}`);if(t<0)throw new BT(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new BT(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new BT(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return eke(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new BT(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,r){if(this.length===0)return;const s=this.focus.get(),o=this.findNextIndex(s.length>0?s[0]+e:0,t,r);o>-1&&this.setFocus([o],i)}focusPrevious(e=1,t=!1,i,r){if(this.length===0)return;const s=this.focus.get(),o=this.findPreviousIndex(s.length>0?s[0]-e:0,t,r);o>-1&&this.setFocus([o],i)}async focusNextPage(e,t){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 s=this.findPreviousIndex(i,!1,t);s>-1&&r!==s?this.setFocus([s],e):this.setFocus([i],e)}else{const s=this.view.getScrollTop();let o=s+this.view.renderHeight;i>r&&(o-=this.view.elementHeight(i)),this.view.setScrollTop(o),this.view.getScrollTop()!==s&&(this.setFocus([]),await Nw(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let r;const s=i(),o=this.view.getScrollTop()+s;o===0?r=this.view.indexAt(o):r=this.view.indexAfter(o-1);const a=this.getFocus()[0];if(a!==r&&(a===void 0||a>=r)){const l=this.findNextIndex(r,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([r],e)}else{const l=o;this.view.setScrollTop(o-this.view.renderHeight-s),this.view.getScrollTop()+i()!==l&&(this.setFocus([]),await Nw(0),await this.focusPreviousPage(e,t,i))}}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,i=0){if(e<0||e>=this.length)throw new BT(this.user,`Invalid index ${e}`);const r=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(zE(t)){const a=o-this.view.renderHeight+i;this.view.setScrollTop(a*hh(t,0,1)+s-i)}else{const a=s+o,l=r+this.view.renderHeight;s<r+i&&a>=l||(s<r+i||a>=l&&o>=this.view.renderHeight?this.view.setScrollTop(s-i):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new BT(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),r=this.view.elementTop(e),s=this.view.elementHeight(e);if(r<i+t||r+s>i+this.view.renderHeight)return null;const o=s-this.view.renderHeight+t;return Math.abs((i+t-r)/o)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(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 t;const e=this.focus.get();if(e.length>0){let i;(t=this.accessibilityProvider)!=null&&t.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(e[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()}}Ok([xl],Ig.prototype,"onDidChangeFocus",null);Ok([xl],Ig.prototype,"onDidChangeSelection",null);Ok([xl],Ig.prototype,"onContextMenu",null);Ok([xl],Ig.prototype,"onKeyDown",null);Ok([xl],Ig.prototype,"onDidFocus",null);Ok([xl],Ig.prototype,"onDidBlur",null);const K2=Jt,rct="selectOption.entry.template";class a_r{get templateId(){return rct}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Ot(e,K2(".option-text")),t.detail=Ot(e,K2(".option-detail")),t.decoratorRight=Ot(e,K2(".option-decorator-right")),t}renderElement(e,t,i){const r=i,s=e.text,o=e.detail,a=e.decoratorRight,l=e.isDisabled;r.text.textContent=s,r.detail.textContent=o||"",r.decoratorRight.innerText=a||"",l?r.root.classList.add("option-disabled"):r.root.classList.remove("option-disabled")}disposeTemplate(e){}}const q0=class q0 extends Ye{constructor(e,t,i,r,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=r,this.selectBoxOptions=s||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=q0.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 Ue,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(Jb().setupManagedHover(jh("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return rct}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=Jt(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Ot(this.selectDropDownContainer,K2(".select-box-details-pane"));const t=Ot(this.selectDropDownContainer,K2(".select-box-dropdown-container-width-control")),i=Ot(t,K2(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Ot(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=_g(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(_t(this.selectDropDownContainer,Xt.DRAG_START,r=>{Jr.stop(r,!0)}))}registerListeners(){this._register(Da(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.setTitle(this.options[this.selected].text)})),this._register(_t(this.selectElement,Xt.CLICK,t=>{Jr.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(_t(this.selectElement,Xt.MOUSE_DOWN,t=>{Jr.stop(t)}));let e;this._register(_t(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(_t(this.selectElement,"touchend",t=>{Jr.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(_t(this.selectElement,Xt.KEY_DOWN,t=>{const i=new Io(t);let r=!1;zr?(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(),Jr.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){fa(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.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.setTitle(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(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=uw(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,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:()=>{this.selectDropDownContainer.remove()}}}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=Ti(this.selectElement),i=al(this.selectElement),r=Ti(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(r.getPropertyValue("--dropdown-padding-top"))+parseFloat(r.getPropertyValue("--dropdown-padding-bottom")),o=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-q0.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),u=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=u,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const f=this._hasDetails?this._cachedMaxDetailsHeight:0,p=d+s+f,g=Math.floor((o-s-f)/this.getHeight()),m=Math.floor((a-s-f)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.top<q0.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||g<1&&m<1?!1:(g<q0.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&m>g&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),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.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.top<q0.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||this._dropDownPosition===0&&g<1||this._dropDownPosition===1&&m<1)return this.hideSelectDropDown(!0),!1;if(this._dropDownPosition===0){if(this._isVisible&&g+m<1)return this.hideSelectDropDown(!0),!1;p>o&&(d=g*this.getHeight())}else p>a&&(d=m*this.getHeight());return this.selectList.layout(d),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=d+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=u,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((s,o)=>{const a=s.detail?s.detail.length:0,l=s.decoratorRight?s.decoratorRight.length:0,c=s.text.length+a+l;c>r&&(i=o,r=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Vf(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Ot(e,K2(".select-box-dropdown-list-container")),this.listRenderer=new a_r,this.selectList=this._register(new Ig("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:r=>{let s=r.text;return r.detail&&(s+=`. ${r.detail}`),r.decoratorRight&&(s+=`. ${r.decoratorRight}`),r.description&&(s+=`. ${r.description}`),s},getWidgetAriaLabel:()=>A({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>zr?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new Yr(this.selectDropDownListContainer,"keydown")),i=rn.chain(t.event,r=>r.filter(()=>this.selectList.length>0).map(s=>new Io(s)));this._register(rn.chain(i,r=>r.filter(s=>s.keyCode===3))(this.onEnter,this)),this._register(rn.chain(i,r=>r.filter(s=>s.keyCode===2))(this.onEnter,this)),this._register(rn.chain(i,r=>r.filter(s=>s.keyCode===9))(this.onEscape,this)),this._register(rn.chain(i,r=>r.filter(s=>s.keyCode===16))(this.onUpArrow,this)),this._register(rn.chain(i,r=>r.filter(s=>s.keyCode===18))(this.onDownArrow,this)),this._register(rn.chain(i,r=>r.filter(s=>s.keyCode===12))(this.onPageDown,this)),this._register(rn.chain(i,r=>r.filter(s=>s.keyCode===11))(this.onPageUp,this)),this._register(rn.chain(i,r=>r.filter(s=>s.keyCode===14))(this.onHome,this)),this._register(rn.chain(i,r=>r.filter(s=>s.keyCode===13))(this.onEnd,this)),this._register(rn.chain(i,r=>r.filter(s=>s.keyCode>=21&&s.keyCode<=56||s.keyCode>=85&&s.keyCode<=113))(this.onCharacter,this)),this._register(_t(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(_t(this.selectDropDownContainer,Xt.FOCUS_OUT,r=>{!this._isVisible||kc(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;Jr.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")),s=i.classList.contains("option-disabled");r>=0&&r<this.options.length&&!s&&(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.setTitle(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=s=>{for(let o=0;o<s.childNodes.length;o++){const a=s.childNodes.item(o);(a.tagName&&a.tagName.toLowerCase())==="img"?a.remove():i(a)}},r=Lte({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){this.selectionDetailsPane.innerText="";const t=this.options[e],i=(t==null?void 0:t.description)??"",r=(t==null?void 0:t.descriptionIsMarkdown)??!1;if(i){if(r){const s=t.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(i,s))}else this.selectionDetailsPane.innerText=i;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){Jr.stop(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){Jr.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.setTitle(this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){Jr.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&&(Jr.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){Jr.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){Jr.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){Jr.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){Jr.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=DC.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]),Jr.stop(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}};q0.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32,q0.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2,q0.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;let X_e=q0;class l_r extends Ye{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 Ue),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(dd.addTarget(this.selectElement)),[Oo.Tap].forEach(e=>{this._register(_t(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Da(this.selectElement,"click",e=>{Jr.stop(e,!0)})),this._register(Da(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Da(this.selectElement,"keydown",e=>{let t=!1;zr?(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||!fa(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(){this.selectElement&&(this.selectElement.style.backgroundColor=this.styles.selectBackground??"",this.selectElement.style.color=this.styles.selectForeground??"",this.selectElement.style.borderColor=this.styles.selectBorder??"")}createOption(e,t,i){const r=document.createElement("option");return r.value=e,r.text=e,r.disabled=!!i,r}}class c_r extends Tg{constructor(e,t,i,r,s){super(),zr&&!(s!=null&&s.useCustomDrawn)?this.selectBoxDelegate=new l_r(e,t,r,s):this.selectBoxDelegate=new X_e(e,t,i,r,s),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 ab extends Ye{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Zf&&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 HL)),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(dd.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,Dm&&this._register(_t(e,Xt.DRAG_START,r=>{var s;return(s=r.dataTransfer)==null?void 0:s.setData(A7.TEXT,this._action.label)}))),this._register(_t(t,Oo.Tap,r=>this.onClick(r,!0))),this._register(_t(t,Xt.MOUSE_DOWN,r=>{i||Jr.stop(r,!0),this._action.enabled&&r.button===0&&t.classList.add("active")})),zr&&this._register(_t(t,Xt.CONTEXT_MENU,r=>{r.button===0&&r.ctrlKey===!0&&this.onClick(r)})),this._register(_t(t,Xt.CLICK,r=>{Jr.stop(r,!0),this.options&&this.options.isMenu||this.onClick(r)})),this._register(_t(t,Xt.DBLCLICK,r=>{Jr.stop(r,!0)})),[Xt.MOUSE_UP,Xt.MOUSE_OUT].forEach(r=>{this._register(_t(t,r,s=>{Jr.stop(s),t.classList.remove("active")}))})}onClick(e,t=!1){var r;Jr.stop(e,!0);const i=Gp(this._context)?(r=this.options)!=null&&r.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var t;if(!this.element)return;const e=this.getTooltip()??"";if(this.updateAriaLabel(),(t=this.options.hoverDelegate)!=null&&t.showNativeHover)this.element.title=e;else if(!this.customHover&&e!==""){const i=this.options.hoverDelegate??jh("element");this.customHover=this._store.add(Jb().setupManagedHover(i,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class yM extends ab{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),ys(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Ac.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"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=A({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.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)==null||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.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)==null||t.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class u_r extends ab{constructor(e,t,i,r,s,o,a){super(e,t),this.selectBox=new c_r(i,r,s,o,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.focus()}blur(){var e;(e=this.selectBox)==null||e.blur()}render(e){this.selectBox.render(e)}}class d_r extends HL{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new Ue),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Ot(e,Jt(".monaco-dropdown")),this._label=Ot(this._element,Jt(".dropdown-label"));let i=t.labelRenderer;i||(i=s=>(s.textContent=t.label||"",null));for(const s of[Xt.CLICK,Xt.MOUSE_DOWN,Oo.Tap])this._register(_t(this.element,s,o=>Jr.stop(o,!0)));for(const s of[Xt.MOUSE_DOWN,Oo.Tap])this._register(_t(this._label,s,o=>{kke(o)&&(o.detail>1||o.button!==0)||(this.visible?this.hide():this.show())}));this._register(_t(this._label,Xt.KEY_UP,s=>{const o=new Io(s);(o.equals(3)||o.equals(10))&&(Jr.stop(s,!0),this.visible?this.hide():this.show())}));const r=i(this._label);r&&this._register(r),this._register(dd.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 h_r extends d_r{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 wG extends ab{constructor(e,t,i,r=Object.create(null)){super(null,e,r),this.actionItem=null,this._onDidChangeVisibility=this._register(new Ue),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=s=>{this.element=Ot(s,Jt("a.action-label"));let o=[];return typeof this.options.classNames=="string"?o=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(o=this.options.classNames),o.find(a=>a==="icon")||o.push("codicon"),this.element.classList.add(...o),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(Jb().setupManagedHover(this.options.hoverDelegate??jh("mouse"),this.element,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 h_r(e,r)),this._register(this.dropdownMenu.onDidChangeVisibility(s=>{var o;(o=this.element)==null||o.setAttribute("aria-expanded",`${s}`),this._onDidChangeVisibility.fire(s)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const s=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return s.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.show()}updateEnabled(){var t,i;const e=!this.action.enabled;(t=this.actionItem)==null||t.classList.toggle("disabled",e),(i=this.element)==null||i.classList.toggle("disabled",e)}}function f_r(n){return n&&typeof n=="object"&&typeof n.original=="string"&&typeof n.value=="string"}function p_r(n){return n?n.condition!==void 0:!1}var FP;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(FP||(FP={}));var MR;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(MR||(MR={}));const VQ=class VQ extends Ye{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new ML),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=MR.None,this.cache=new Map,this.flushDelayer=this._register(new Pot(VQ.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.forEach((r,s)=>this.acceptExternal(s,r)),(i=e.deleted)==null||i.forEach(r=>this.acceptExternal(r,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===MR.Closed)return;let i=!1;Gp(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 Gp(i)?t:i}getBoolean(e,t){const i=this.get(e);return Gp(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Gp(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===MR.Closed)return;if(Gp(t))return this.delete(e,i);const r=zc(t)||Array.isArray(t)?Upr(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()}async delete(e,t=!1){if(!(this.state===MR.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}async flushPending(){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()})}async doFlush(e){return this.options.hint===FP.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}};VQ.DEFAULT_FLUSH_DELAY=100;let r6=VQ;class Zce{constructor(){this.onDidChangeItemsExternal=rn.None,this.items=new Map}async updateItems(e){var t,i;(t=e.insert)==null||t.forEach((r,s)=>this.items.set(s,r)),(i=e.delete)==null||i.forEach(r=>this.items.delete(r))}}const hU="__$__targetStorageMarker",yv=Ur("storageService");var D7;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(D7||(D7={}));function g_r(n){const e=n.get(hU);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const WQ=class WQ extends Ye{constructor(e={flushInterval:WQ.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new ML),this._onDidChangeTarget=this._register(new ML),this._onWillSaveState=this._register(new Ue),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return rn.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===hU){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?void 0:r.get(e,i)}getBoolean(e,t,i){var r;return(r=this.getStorage(t))==null?void 0:r.getBoolean(e,i)}getNumber(e,t,i){var r;return(r=this.getStorage(t))==null?void 0:r.getNumber(e,i)}store(e,t,i,r,s=!1){if(Gp(t)){this.remove(e,i,s);return}this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,i,r),(o=this.getStorage(i))==null||o.set(e,t,s)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,t,void 0),(r=this.getStorage(t))==null||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,a;const s=this.getKeyTargets(t);typeof i=="number"?s[e]!==i&&(s[e]=i,(o=this.getStorage(t))==null||o.set(hU,JSON.stringify(s),r)):typeof s[e]=="number"&&(delete s[e],(a=this.getStorage(t))==null||a.set(hU,JSON.stringify(s),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?g_r(t):Object.create(null)}};WQ.DEFAULT_FLUSH_INTERVAL=60*1e3;let Z_e=WQ;class m_r extends Z_e{constructor(){super(),this.applicationStorage=this._register(new r6(new Zce,{hint:FP.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new r6(new Zce,{hint:FP.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new r6(new Zce,{hint:FP.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 __r(n,e){const t={...e};for(const i in n){const r=n[i];t[i]=r!==void 0?kn(r):void 0}return t}const v_r={keybindingLabelBackground:kn(lfr),keybindingLabelForeground:kn(cfr),keybindingLabelBorder:kn(ufr),keybindingLabelBottomBorder:kn(dfr),keybindingLabelShadow:kn(q4)},b_r={buttonForeground:kn(hlt),buttonSeparator:kn(Ghr),buttonBackground:kn(Qj),buttonHoverBackground:kn(Yhr),buttonSecondaryForeground:kn(Xhr),buttonSecondaryBackground:kn(b_e),buttonSecondaryHoverBackground:kn(Zhr),buttonBorder:kn(Qhr)},y_r={progressBarBackground:kn(lhr)},xG={inputActiveOptionBorder:kn(Cte),inputActiveOptionForeground:kn(wte),inputActiveOptionBackground:kn(X9)};kn(Xj),kn(Jhr),kn(efr),kn(tfr),kn(nfr),kn(ifr),kn(rfr);kn(sfr),kn(afr),kn(ofr);kn(ig),kn(vte),kn(q4),kn(ls),kn(Lhr),kn(Ahr),kn(Nhr),kn(ohr);const SG={inputBackground:kn(v_e),inputForeground:kn(ult),inputBorder:kn(dlt),inputValidationInfoBorder:kn($hr),inputValidationInfoBackground:kn(Fhr),inputValidationInfoForeground:kn(Bhr),inputValidationWarningBorder:kn(Whr),inputValidationWarningBackground:kn(Hhr),inputValidationWarningForeground:kn(Vhr),inputValidationErrorBorder:kn(qhr),inputValidationErrorBackground:kn(zhr),inputValidationErrorForeground:kn(Uhr)},C_r={listFilterWidgetBackground:kn(Sfr),listFilterWidgetOutline:kn(Efr),listFilterWidgetNoMatchesOutline:kn(kfr),listFilterWidgetShadow:kn(Tfr),inputBoxStyles:SG,toggleStyles:xG},sct={badgeBackground:kn(lU),badgeForeground:kn(ahr),badgeBorder:kn(ls)};kn(Thr),kn(khr),kn(E7e),kn(E7e),kn(Ihr);const WA={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:kn(hfr),listFocusForeground:kn(ffr),listFocusOutline:kn(pfr),listActiveSelectionBackground:kn(WL),listActiveSelectionForeground:kn(y7),listActiveSelectionIconForeground:kn(flt),listFocusAndSelectionOutline:kn(gfr),listFocusAndSelectionBackground:kn(WL),listFocusAndSelectionForeground:kn(y7),listInactiveSelectionBackground:kn(mfr),listInactiveSelectionIconForeground:kn(vfr),listInactiveSelectionForeground:kn(_fr),listInactiveFocusBackground:kn(bfr),listInactiveFocusOutline:kn(yfr),listHoverBackground:kn(plt),listHoverForeground:kn(glt),listDropOverBackground:kn(Cfr),listDropBetweenBackground:kn(wfr),listSelectionOutline:kn(aa),listHoverOutline:kn(aa),treeIndentGuidesStroke:kn(mlt),treeInactiveIndentGuidesStroke:kn(Ifr),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:kn(qke),tableColumnsBorder:kn(Lfr),tableOddRowsBackgroundColor:kn(Afr)};function zA(n){return __r(n,WA)}const w_r={selectBackground:kn(xte),selectListBackground:kn(Khr),selectForeground:kn(Zke),decoratorRightForeground:kn(_lt),selectBorder:kn(Jke),focusBorder:kn(Yy),listFocusBackground:kn(w7),listInactiveSelectionIconForeground:kn(eTe),listFocusForeground:kn(C7),listFocusOutline:ehr(aa,At.transparent.toString()),listHoverBackground:kn(plt),listHoverForeground:kn(glt),listHoverOutline:kn(aa),selectListBorder:kn(Kke),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground: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,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},x_r={shadowColor:kn(q4),borderColor:kn(Nfr),foregroundColor:kn(Dfr),backgroundColor:kn(Rfr),selectionForegroundColor:kn(Pfr),selectionBackgroundColor:kn(Ofr),selectionBorderColor:kn(Mfr),separatorColor:kn(jfr),scrollbarShadow:kn(qke),scrollbarSliderBackground:kn(nlt),scrollbarSliderHoverBackground:kn(ilt),scrollbarSliderActiveBackground:kn(rlt)};var Mte=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},sf=function(n,e){return function(t,i){e(t,i,n)}};function S_r(n,e,t,i){let r,s,o;if(Array.isArray(n))o=n,r=e,s=t;else{const c=e;o=n.getActions(c),r=t,s=i}const a=UC.getInstance(),l=a.keyStatus.altKey||(Wu||Nh)&&a.keyStatus.shiftKey;oct(o,r,l,s?c=>c===s:c=>c==="navigation")}function jte(n,e,t,i,r,s){let o,a,l,c,u;if(Array.isArray(n))u=n,o=e,a=t,l=i,c=r;else{const f=e;u=n.getActions(f),o=t,a=i,l=r,c=s}oct(u,o,!1,typeof a=="string"?f=>f===a:a,l,c)}function oct(n,e,t,i=o=>o==="navigation",r=()=>!1,s=!1){let o,a;Array.isArray(e)?(o=e,a=e):(o=e.primary,a=e.secondary);const l=new Set;for(const[c,u]of n){let d;i(c)?(d=o,d.length>0&&s&&d.push(new Ac)):(d=a,d.length>0&&d.push(new Ac));for(let f of u){t&&(f=f instanceof Jf&&f.alt?f.alt:f);const p=d.push(f);f instanceof oM&&l.add({group:c,action:f,index:p-1})}}for(const{group:c,action:u,index:d}of l){const f=i(c)?o:a,p=u.actions;r(u,c,f.length)&&f.splice(d,1,...p)}}let nk=class extends yM{constructor(e,t,i,r,s,o,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._options=t,this._keybindingService=i,this._notificationService=r,this._contextKeyService=s,this._themeService=o,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Dc),this._altKey=UC.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await 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 s;const r=!!((s=this._menuItemAction.alt)!=null&&s.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);r!==this._wantsAltCommand&&(this._wantsAltCommand=r,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(_t(e,"mouseleave",r=>{t=!1,i()})),this._register(_t(e,"mouseenter",r=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var s;const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let r=t?A("titleAndKb","{0} ({1})",i,t):i;if(!this._wantsAltCommand&&((s=this._menuItemAction.alt)!=null&&s.enabled)){const o=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?A("titleAndKb","{0} ({1})",o,l):o;r=A("titleAndKbAndAlt",`{0} [{1}] {2}`,r,mTe.modifierLabels[Yf].altKey,c)}return r}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&&p_r(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(r)if(Ni.isThemeIcon(r)){const s=Ni.asClassNameArray(r);i.classList.add(...s),this._itemClassDispose.value=gi(()=>{i.classList.remove(...s)})}else i.style.backgroundImage=cM(this._themeService.getColorTheme().type)?Dw(r.dark):Dw(r.light),i.classList.add("icon"),this._itemClassDispose.value=U_(gi(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};nk=Mte([sf(2,Ws),sf(3,wl),sf(4,Oi),sf(5,mc),sf(6,up),sf(7,dp)],nk);class yTe extends nk{render(e){var t;this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",((t=this._options)==null?void 0:t.useComma)??!1)}updateLabel(){var t;const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const i=yTe._symbolPrintEnter(e);(t=this._options)!=null&&t.conversational?this.label.textContent=A({key:"content2",comment:['A label with keybindg like "ESC to dismiss"']},"{1} to {0}",this._action.label,i):this.label.textContent=A({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,i)}}static _symbolPrintEnter(e){var t;return(t=e.getLabel())==null?void 0:t.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let J_e=class extends wG{constructor(e,t,i,r,s){const o={...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!1,classNames:(t==null?void 0:t.classNames)??(Ni.isThemeIcon(e.item.icon)?Ni.asClassName(e.item.icon):void 0),keybindingProvider:(t==null?void 0:t.keybindingProvider)??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},r,o),this._keybindingService=i,this._contextMenuService=r,this._themeService=s}render(e){super.render(e),ys(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Ni.isThemeIcon(i)){this.element.classList.add("icon");const r=()=>{this.element&&(this.element.style.backgroundImage=cM(this._themeService.getColorTheme().type)?Dw(i.dark):Dw(i.light))};r(),this._register(this._themeService.onDidColorThemeChange(()=>{r()}))}}};J_e=Mte([sf(2,Ws),sf(3,up),sf(4,mc)],J_e);let eve=class extends ab{constructor(e,t,i,r,s,o,a,l){super(null,e),this._keybindingService=i,this._notificationService=r,this._contextMenuService=s,this._menuService=o,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c;const u=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;u&&(c=e.actions.find(f=>u===f.id)),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(nk,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const d={keybindingProvider:f=>this._keybindingService.lookupKeybinding(f.id),...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!0,classNames:(t==null?void 0:t.classNames)??["codicon","codicon-chevron-down"],actionRunner:(t==null?void 0:t.actionRunner)??new HL};this._dropdown=new wG(e,e.actions,this._contextMenuService,d),this._register(this._dropdown.actionRunner.onDidRun(f=>{f.action instanceof Jf&&this.update(f.action)}))}update(e){var t;(t=this._options)!=null&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(nk,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends HL{async runAction(i,r){await i.run(void 0)}},this._container&&this._defaultAction.render(Tke(this._container,Jt(".action-container")))}_getDefaultActionKeybindingLabel(e){var i;let t;if((i=this._options)!=null&&i.renderKeybindingWithDefaultActionLabel){const r=this._keybindingService.lookupKeybinding(e.id);r&&(t=`(${r.getLabel()})`)}return t}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=Jt(".action-container");this._defaultAction.render(Ot(this._container,t)),this._register(_t(t,Xt.KEY_DOWN,r=>{const s=new Io(r);s.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())}));const i=Jt(".dropdown-action-container");this._dropdown.render(Ot(this._container,i)),this._register(_t(i,Xt.KEY_DOWN,r=>{var o;const s=new Io(r);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)==null||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()}};eve=Mte([sf(2,Ws),sf(3,wl),sf(4,up),sf(5,Eg),sf(6,mi),sf(7,yv)],eve);let tve=class extends u_r{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Ac.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,w_r,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=kn(Jke)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};tve=Mte([sf(1,Zw)],tve);function act(n,e,t){return e instanceof Jf?n.createInstance(nk,e,t):e instanceof RP?e.item.isSelection?n.createInstance(tve,e):e.item.rememberDefaultAction?n.createInstance(eve,e,{...t,persistLastActionId:!0}):n.createInstance(J_e,e,t):void 0}class hg extends Ye{constructor(e,t={}){var s,o;super(),this._actionRunnerDisposables=this._register(new Et),this.viewItemDisposables=this._register(new lke),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new Ue),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new Ue({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new Ue),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new Ue),this.onWillRun=this._onWillRun.event,this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:((s=this.options.triggerKeys)==null?void 0:s.keyDown)??!1,keys:((o=this.options.triggerKeys)==null?void 0:o.keys)??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(bM()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new HL,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(a=>this._onDidRun.fire(a))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(a=>this._onWillRun.fire(a))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,r;switch(this._orientation){case 0:i=[15],r=[17];break;case 1:i=[16],r=[18],this.domNode.className+=" vertical";break}this._register(_t(this.domNode,Xt.KEY_DOWN,a=>{const l=new Io(a);let c=!0;const u=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(l.equals(i[0])||l.equals(i[1]))?c=this.focusPrevious():r&&(l.equals(r[0])||l.equals(r[1]))?c=this.focusNext():l.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():l.equals(14)?c=this.focusFirst():l.equals(13)?c=this.focusLast():l.equals(2)&&u instanceof ab&&u.trapsArrowNavigation?c=this.focusNext(void 0,!0):this.isTriggerKeyEvent(l)?this._triggerKeys.keyDown?this.doTrigger(l):this.triggerKeyDown=!0:c=!1,c&&(l.preventDefault(),l.stopPropagation())})),this._register(_t(this.domNode,Xt.KEY_UP,a=>{const l=new Io(a);this.isTriggerKeyEvent(l)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(l)),l.preventDefault(),l.stopPropagation()):(l.equals(2)||l.equals(1026)||l.equals(16)||l.equals(18)||l.equals(15)||l.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register($b(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Hu()===this.domNode||!kc(Hu(),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()>=1?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 ab&&i.isEnabled());t instanceof ab&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof ab&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){var e,t;for(let i=0;i<this.actionsList.children.length;i++){const r=this.actionsList.children[i];if(kc(Hu(),r)){this.focusedItem=i,(t=(e=this.viewItems[this.focusedItem])==null?void 0:e.showHover)==null||t.call(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?void 0:t.action;if(Lc(e)){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=zE(t.index)?t.index:null;i.forEach(s=>{const o=document.createElement("li");o.className="action-item",o.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(s,l)),a||(a=new yM(this.context,s,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,_t(o,Xt.CONTEXT_MENU,c=>{Jr.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(o),this.focusable&&a instanceof ab&&this.viewItems.length===0&&a.setFocusable(!0),r===null||r<0||r>=this.actionsList.children.length?(this.actionsList.appendChild(o),this.viewItems.push(a)):(this.actionsList.insertBefore(o,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=vo(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),mu(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(s=>s.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,t){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const i=this.focusedItem;let r;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=i,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,r=this.viewItems[this.focusedItem]}while(this.focusedItem!==i&&(this.options.focusOnlyEnabledItems&&!r.isEnabled()||r.action.id===Ac.ID));return this.updateFocus(void 0,void 0,t),!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===Ac.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var s,o;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((s=this.viewItems[this.previouslyFocusedItem])==null||s.blur());const r=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(r){let a=!0;J8(r.focus)||(a=!1),this.options.focusOnlyEnabledItems&&J8(r.isEnabled)&&!r.isEnabled()&&(a=!1),r.action.id===Ac.ID&&(a=!1),a?(i||this.previouslyFocusedItem!==this.focusedItem)&&(r.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((o=r.showHover)==null||o.call(r))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof ab){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=vo(this.viewItems),this.getContainer().remove(),super.dispose()}}const nve=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Jce=/(&)?(&)([^\s&])/g;var EG;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(EG||(EG={}));var ive;(function(n){n[n.Above=0]="Above",n[n.Below=1]="Below"})(ive||(ive={}));class BP extends hg{constructor(e,t,i,r){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...zr||Nh?[10]:[]],keyDown:!0}}),this.menuStyles=r,this.menuElement=s,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,r),this._register(dd.addTarget(s)),this._register(_t(s,Xt.KEY_DOWN,c=>{new Io(c).equals(2)&&c.preventDefault()})),i.enableMnemonics&&this._register(_t(s,Xt.KEY_DOWN,c=>{const u=c.key.toLocaleLowerCase();if(this.mnemonics.has(u)){Jr.stop(c,!0);const d=this.mnemonics.get(u);if(d.length===1&&(d[0]instanceof fBe&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(c)),d.length>1){const f=d.shift();f&&f.container&&(this.focusItemByElement(f.container),d.push(f)),this.mnemonics.set(u,d)}}})),Nh&&this._register(_t(s,Xt.KEY_DOWN,c=>{const u=new Io(c);u.equals(14)||u.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Jr.stop(c,!0)):(u.equals(13)||u.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Jr.stop(c,!0))})),this._register(_t(this.domNode,Xt.MOUSE_OUT,c=>{const u=c.relatedTarget;kc(u,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(_t(this.actionsList,Xt.MOUSE_OVER,c=>{let u=c.target;if(!(!u||!kc(u,this.actionsList)||u===this.actionsList)){for(;u.parentElement!==this.actionsList&&u.parentElement!==null;)u=u.parentElement;if(u.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(u),d!==this.focusedItem&&this.updateFocus()}}})),this._register(dd.addTarget(this.actionsList)),this._register(_t(this.actionsList,Oo.Tap,c=>{let u=c.initialTarget;if(!(!u||!kc(u,this.actionsList)||u===this.actionsList)){for(;u.parentElement!==this.actionsList&&u.parentElement!==null;)u=u.parentElement;if(u.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(u),d!==this.focusedItem&&this.updateFocus()}}}));const o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new Z9(s,{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(_t(s,Oo.Change,c=>{Jr.stop(c,!0);const u=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:u-c.translationY})})),this._register(_t(a,Xt.MOUSE_UP,c=>{c.preventDefault()}));const l=Ti(e);s.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,u)=>{var d;return(d=i.submenuIds)!=null&&d.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof Ac&&(u===t.length-1||u===0||t[u-1]instanceof Ac))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof pBe)).forEach((c,u,d)=>{c.updatePositionInSet(u+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(zK(e)?this.styleSheet=_g(e):(BP.globalStyleSheet||(BP.globalStyleSheet=_g()),this.styleSheet=BP.globalStyleSheet)),this.styleSheet.textContent=k_r(t,zK(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",r=t.backgroundColor??"",s=t.borderColor?`1px solid ${t.borderColor}`:"",o="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=s,e.style.borderRadius=o,e.style.color=i,e.style.backgroundColor=r,e.style.boxShadow=a}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 Ac)return new pBe(t.context,e,{icon:!0},this.menuStyles);if(e instanceof oM){const r=new fBe(e,e.actions,i,{...t,submenuIds:new Set([...t.submenuIds||[],e.id])},this.menuStyles);if(t.enableMnemonics){const s=r.getMnemonic();if(s&&r.isEnabled()){let o=[];this.mnemonics.has(s)&&(o=this.mnemonics.get(s)),o.push(r),this.mnemonics.set(s,o)}}return r}else{const r={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const o=t.getKeyBinding(e);if(o){const a=o.getLabel();a&&(r.keybinding=a)}}const s=new lct(t.context,e,r,this.menuStyles);if(t.enableMnemonics){const o=s.getMnemonic();if(o&&s.isEnabled()){let a=[];this.mnemonics.has(o)&&(a=this.mnemonics.get(o)),a.push(s),this.mnemonics.set(o,a)}}return s}}}class lct extends ab{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 s=this.action.label;if(s){const o=nve.exec(s);o&&(this.mnemonic=(o[1]?o[1]:o[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new ao(()=>{this.element&&(this._register(_t(this.element,Xt.MOUSE_UP,s=>{if(Jr.stop(s,!0),Dm){if(new B_(Ti(this.element),s).rightButton)return;this.onClick(s)}else setTimeout(()=>{this.onClick(s)},0)})),this._register(_t(this.element,Xt.CONTEXT_MENU,s=>{Jr.stop(s,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Ot(this.element,Jt("a.action-menu-item")),this._action.id===Ac.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Ot(this.item,Jt("span.menu-item-check"+Ni.asCSSSelector(Yt.menuSelection))),this.check.setAttribute("role","none"),this.label=Ot(this.item,Jt("span.action-label")),this.options.label&&this.options.keybinding&&(Ot(this.item,Jt("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.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){mu(this.label);let t=uTe(this.action.label);if(t){const i=E_r(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const r=nve.exec(t);if(r){t=QF(t),Jce.lastIndex=0;let s=Jce.exec(t);for(;s&&s[1];)s=Jce.exec(t);const o=a=>a.replace(/&&/g,"&");s?this.label.append(W9(o(t.substr(0,s.index))," "),Jt("u",{"aria-hidden":"true"},s[3]),Sot(o(t.substr(s.index+s[0].length))," ")):this.label.innerText=o(t).trim(),(e=this.item)==null||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}`:"",s=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=s),this.check&&(this.check.style.color=t??"")}}class fBe extends lct{constructor(e,t,i,r,s){super(e,e,r,s),this.submenuActions=t,this.parentData=i,this.submenuOptions=r,this.mysubmenu=null,this.submenuDisposables=this._register(new Et),this.mouseOver=!1,this.expandDirection=r&&r.expandDirection!==void 0?r.expandDirection:{horizontal:EG.Right,vertical:ive.Below},this.showScheduler=new ao(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new ao(()=>{this.element&&!kc(Hu(),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=Ot(this.item,Jt("span.submenu-indicator"+Ni.asCSSSelector(Yt.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(_t(this.element,Xt.KEY_UP,t=>{const i=new Io(t);(i.equals(17)||i.equals(3))&&(Jr.stop(t,!0),this.createSubmenu(!0))})),this._register(_t(this.element,Xt.KEY_DOWN,t=>{const i=new Io(t);Hu()===this.item&&(i.equals(17)||i.equals(3))&&Jr.stop(t,!0)})),this._register(_t(this.element,Xt.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(_t(this.element,Xt.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(_t(this.element,Xt.FOCUS_OUT,t=>{this.element&&!kc(Hu(),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){Jr.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 s={top:0,left:0};return s.left=RR(e.width,t.width,{position:r.horizontal===EG.Right?0:1,offset:i.left,size:i.width}),s.left>=i.left&&s.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(s.left=i.left+10),i.top+=10,i.height=0),s.top=RR(e.height,t.height,{position:0,offset:i.top,size:0}),s.top+t.height===i.top&&s.top+i.height+t.height<=e.height&&(s.top+=i.height),s}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=Ot(this.element,Jt("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=Ti(this.parentData.parent.domNode).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 BP(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new Fme],this.submenuOptions,this.menuStyle);const r=this.element.getBoundingClientRect(),s={top:r.top-i,left:r.left,height:r.height+2*i,width:r.width},o=this.submenuContainer.getBoundingClientRect(),a=Ti(this.element),{top:l,left:c}=this.calculateSubmenuMenuLayout(new Ys(a.innerWidth,a.innerHeight),Ys.lift(o),s,this.expandDirection);this.submenuContainer.style.left=`${c-o.left}px`,this.submenuContainer.style.top=`${l-o.top}px`,this.submenuDisposables.add(_t(this.submenuContainer,Xt.KEY_UP,u=>{new Io(u).equals(15)&&(Jr.stop(u,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(_t(this.submenuContainer,Xt.KEY_DOWN,u=>{new Io(u).equals(15)&&Jr.stop(u,!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.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 pBe extends yM{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 E_r(n){const e=nve,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function gBe(n){const e=vot()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function k_r(n,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } ${gBe(Yt.menuSelection)} ${gBe(Yt.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 .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; max-height: 100%; } .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 s=n.scrollbarSliderHoverBackground;s&&(t+=` .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${s}; } `);const o=n.scrollbarSliderActiveBackground;o&&(t+=` .monaco-scrollable-element > .scrollbar > .slider.active { background: ${o}; } `)}return t}class T_r{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=Hu();let i;const r=Lc(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{var u;this.lastContainer=s;const o=e.getMenuClassName?e.getMenuClassName():"";o&&(s.className+=" "+o),this.options.blockMouse&&(this.block=s.appendChild(Jt(".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",(u=this.blockDisposable)==null||u.dispose(),this.blockDisposable=_t(this.block,Xt.MOUSE_DOWN,d=>d.stopPropagation()));const a=new Et,l=e.actionRunner||new HL;l.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new BP(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},x_r),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=Ti(s);return a.add(_t(c,Xt.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(_t(c,Xt.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const f=new B_(c,d);let p=f.target;if(!f.rightButton){for(;p;){if(p===s)return;p=p.parentElement}this.contextViewService.hideContextView(!0)}})),U_(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:s=>{var o,a,l;(o=e.onHide)==null||o.call(e,!!s),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)==null||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Hu()===this.lastContainer||kc(Hu(),this.lastContainer))&&((l=this.focusToReturn)==null||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&&!Km(e.error)&&this.notificationService.error(e.error)}}var I_r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},PD=function(n,e){return function(t,i){e(t,i,n)}};let rve=class extends Ye{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new T_r(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,r,s,o){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=r,this.menuService=s,this.contextKeyService=o,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new Ue),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new Ue)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=sve.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)==null||i.call(e,t),this._onDidHideContextMenu.fire()}}),UC.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};rve=I_r([PD(0,md),PD(1,wl),PD(2,Zw),PD(3,Ws),PD(4,Eg),PD(5,Oi)],rve);var sve;(function(n){function e(i){return i&&i.menuId instanceof zn}function t(i,r,s){if(!e(i))return i;const{menuId:o,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{const c=[];if(o){const u=r.getMenuActions(o,l??s,a);S_r(u,c)}return i.getActions?Ac.join(i.getActions(),c):c}}}n.transform=t})(sve||(sve={}));var kG;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(kG||(kG={}));var CTe=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},TG=function(n,e){return function(t,i){e(t,i,n)}};let ove=class{constructor(e){this._commandService=e}async open(e,t){if(!Gee(e,ir.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=vi.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=k_e(decodeURIComponent(e.query))}catch{try{i=k_e(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};ove=CTe([TG(0,Fo)],ove);let ave=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=vi.parse(e));const{selection:i,uri:r}=tpr(e);return e=r,e.scheme===ir.file&&(e=jpr(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t!=null&&t.fromUserGesture?kG.USER:kG.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};ave=CTe([TG(0,Cs)],ave);let lve=class{constructor(e,t){this._openers=new Ch,this._validators=new Ch,this._resolvers=new Ch,this._resolvedUriTargets=new Yc(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Ch,this._defaultExternalOpener={openExternal:async i=>(Nme(i,ir.http,ir.https)?nat(i):bo.location.href=i,!0)},this._openers.push({open:async(i,r)=>r!=null&&r.openExternal||Nme(i,ir.mailto,ir.http,ir.https,ir.vsls)?(await this._doOpenExternal(i,r),!0):!1}),this._openers.push(new ove(t)),this._openers.push(new ave(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){const i=typeof e=="string"?vi.parse(e):e,r=this._resolvedUriTargets.get(i)??e;for(const s of this._validators)if(!await s.shouldOpen(r,t))return!1;for(const s of this._openers)if(await s.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const r=await 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())}async _doOpenExternal(e,t){const i=typeof e=="string"?vi.parse(e):e;let r;try{r=(await this.resolveExternalUri(i,t)).resolved}catch{r=i}let s;if(typeof e=="string"&&i.toString()===r.toString()?s=e:s=encodeURI(r.toString(!0)),t!=null&&t.allowContributedOpeners){const o=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(s,{sourceUri:i,preferredOpenerId:o},xr.None))return!0}return this._defaultExternalOpener.openExternal(s,{sourceUri:i},xr.None)}dispose(){this._validators.clear()}};lve=CTe([TG(0,Cs),TG(1,Fo)],lve);const Sf=Ur("editorWorkerService");var Ya;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Ya||(Ya={}));(function(n){function e(o,a){return a-o}n.compare=e;const t=Object.create(null);t[n.Error]=A("sev.error","Error"),t[n.Warning]=A("sev.warning","Warning"),t[n.Info]=A("sev.info","Info");function i(o){return t[o]||""}n.toString=i;function r(o){switch(o){case _l.Error:return n.Error;case _l.Warning:return n.Warning;case _l.Info:return n.Info;case _l.Ignore:return n.Hint}}n.fromSeverity=r;function s(o){switch(o){case n.Error:return _l.Error;case n.Warning:return _l.Warning;case n.Info:return _l.Info;case n.Hint:return _l.Ignore}}n.toSeverity=s})(Ya||(Ya={}));var IG;(function(n){const e="";function t(r){return i(r,!0)}n.makeKey=t;function i(r,s){const o=[e];return r.source?o.push(r.source.replace("¦","\\¦")):o.push(e),r.code?typeof r.code=="string"?o.push(r.code.replace("¦","\\¦")):o.push(r.code.value.replace("¦","\\¦")):o.push(e),r.severity!==void 0&&r.severity!==null?o.push(Ya.toString(r.severity)):o.push(e),r.message&&s?o.push(r.message.replace("¦","\\¦")):o.push(e),r.startLineNumber!==void 0&&r.startLineNumber!==null?o.push(r.startLineNumber.toString()):o.push(e),r.startColumn!==void 0&&r.startColumn!==null?o.push(r.startColumn.toString()):o.push(e),r.endLineNumber!==void 0&&r.endLineNumber!==null?o.push(r.endLineNumber.toString()):o.push(e),r.endColumn!==void 0&&r.endColumn!==null?o.push(r.endColumn.toString()):o.push(e),o.push(e),o.join("¦")}n.makeKeyOptionalMessage=i})(IG||(IG={}));const w1=Ur("markerService"),cct=ve("editor.lineHighlightBackground",null,A("lineHighlight","Background color for the highlight of line at the cursor position.")),mBe=ve("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ls},A("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));ve("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},A("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);ve("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:aa,hcLight:aa},A("rangeHighlightBorder","Background color of the border around highlighted ranges."));ve("editor.symbolHighlightBackground",{dark:KC,light:KC,hcDark:null,hcLight:null},A("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);ve("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:aa,hcLight:aa},A("symbolHighlightBorder","Background color of the border around highlighted symbols."));const Fte=ve("editorCursor.foreground",{dark:"#AEAFAD",light:At.black,hcDark:At.white,hcLight:"#0F4A85"},A("caret","Color of the editor cursor.")),wTe=ve("editorCursor.background",null,A("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),uct=ve("editorMultiCursor.primary.foreground",Fte,A("editorMultiCursorPrimaryForeground","Color of the primary editor cursor when multiple cursors are present.")),L_r=ve("editorMultiCursor.primary.background",wTe,A("editorMultiCursorPrimaryBackground","The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),dct=ve("editorMultiCursor.secondary.foreground",Fte,A("editorMultiCursorSecondaryForeground","Color of secondary editor cursors when multiple cursors are present.")),A_r=ve("editorMultiCursor.secondary.background",wTe,A("editorMultiCursorSecondaryBackground","The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),xTe=ve("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},A("editorWhitespaces","Color of whitespace characters in the editor.")),N_r=ve("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:At.white,hcLight:"#292929"},A("editorLineNumbers","Color of editor line numbers.")),D_r=ve("editorIndentGuide.background",xTe,A("editorIndentGuides","Color of the editor indentation guides."),!1,A("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),R_r=ve("editorIndentGuide.activeBackground",xTe,A("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,A("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),c$=ve("editorIndentGuide.background1",D_r,A("editorIndentGuides1","Color of the editor indentation guides (1).")),P_r=ve("editorIndentGuide.background2","#00000000",A("editorIndentGuides2","Color of the editor indentation guides (2).")),O_r=ve("editorIndentGuide.background3","#00000000",A("editorIndentGuides3","Color of the editor indentation guides (3).")),M_r=ve("editorIndentGuide.background4","#00000000",A("editorIndentGuides4","Color of the editor indentation guides (4).")),j_r=ve("editorIndentGuide.background5","#00000000",A("editorIndentGuides5","Color of the editor indentation guides (5).")),F_r=ve("editorIndentGuide.background6","#00000000",A("editorIndentGuides6","Color of the editor indentation guides (6).")),u$=ve("editorIndentGuide.activeBackground1",R_r,A("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),B_r=ve("editorIndentGuide.activeBackground2","#00000000",A("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),$_r=ve("editorIndentGuide.activeBackground3","#00000000",A("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),H_r=ve("editorIndentGuide.activeBackground4","#00000000",A("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),V_r=ve("editorIndentGuide.activeBackground5","#00000000",A("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),W_r=ve("editorIndentGuide.activeBackground6","#00000000",A("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),z_r=ve("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:aa,hcLight:aa},A("editorActiveLineNumber","Color of editor active line number"),!1,A("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));ve("editorLineNumber.activeForeground",z_r,A("editorActiveLineNumber","Color of editor active line number"));const U_r=ve("editorLineNumber.dimmedForeground",null,A("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));ve("editorRuler.foreground",{dark:"#5A5A5A",light:At.lightgrey,hcDark:At.white,hcLight:"#292929"},A("editorRuler","Color of the editor rulers."));ve("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},A("editorCodeLensForeground","Foreground color of editor CodeLens"));ve("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},A("editorBracketMatchBackground","Background color behind matching brackets"));ve("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ls,hcLight:ls},A("editorBracketMatchBorder","Color for matching brackets boxes"));const q_r=ve("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},A("editorOverviewRulerBorder","Color of the overview ruler border.")),K_r=ve("editorOverviewRuler.background",null,A("editorOverviewRulerBackground","Background color of the editor overview ruler."));ve("editorGutter.background",lv,A("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));ve("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:At.fromHex("#fff").transparent(.8),hcLight:ls},A("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const G_r=ve("editorUnnecessaryCode.opacity",{dark:At.fromHex("#000a"),light:At.fromHex("#0007"),hcDark:null,hcLight:null},A("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.`));ve("editorGhostText.border",{dark:null,light:null,hcDark:At.fromHex("#fff").transparent(.8),hcLight:At.fromHex("#292929").transparent(.8)},A("editorGhostTextBorder","Border color of ghost text in the editor."));const Y_r=ve("editorGhostText.foreground",{dark:At.fromHex("#ffffff56"),light:At.fromHex("#0007"),hcDark:null,hcLight:null},A("editorGhostTextForeground","Foreground color of the ghost text in the editor."));ve("editorGhostText.background",null,A("editorGhostTextBackground","Background color of the ghost text in the editor."));const Q_r=new At(new ds(0,122,204,.6)),hct=ve("editorOverviewRuler.rangeHighlightForeground",Q_r,A("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),X_r=ve("editorOverviewRuler.errorForeground",{dark:new At(new ds(255,18,18,.7)),light:new At(new ds(255,18,18,.7)),hcDark:new At(new ds(255,50,50,1)),hcLight:"#B5200D"},A("overviewRuleError","Overview ruler marker color for errors.")),Z_r=ve("editorOverviewRuler.warningForeground",{dark:Rw,light:Rw,hcDark:v7,hcLight:v7},A("overviewRuleWarning","Overview ruler marker color for warnings.")),J_r=ve("editorOverviewRuler.infoForeground",{dark:Qy,light:Qy,hcDark:b7,hcLight:b7},A("overviewRuleInfo","Overview ruler marker color for infos.")),fct=ve("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},A("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),pct=ve("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},A("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),gct=ve("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},A("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),mct=ve("editorBracketHighlight.foreground4","#00000000",A("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),_ct=ve("editorBracketHighlight.foreground5","#00000000",A("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),vct=ve("editorBracketHighlight.foreground6","#00000000",A("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),evr=ve("editorBracketHighlight.unexpectedBracket.foreground",{dark:new At(new ds(255,18,18,.8)),light:new At(new ds(255,18,18,.8)),hcDark:"new Color(new RGBA(255, 50, 50, 1))",hcLight:"#B5200D"},A("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),tvr=ve("editorBracketPairGuide.background1","#00000000",A("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),nvr=ve("editorBracketPairGuide.background2","#00000000",A("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),ivr=ve("editorBracketPairGuide.background3","#00000000",A("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),rvr=ve("editorBracketPairGuide.background4","#00000000",A("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),svr=ve("editorBracketPairGuide.background5","#00000000",A("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),ovr=ve("editorBracketPairGuide.background6","#00000000",A("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),avr=ve("editorBracketPairGuide.activeBackground1","#00000000",A("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),lvr=ve("editorBracketPairGuide.activeBackground2","#00000000",A("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),cvr=ve("editorBracketPairGuide.activeBackground3","#00000000",A("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),uvr=ve("editorBracketPairGuide.activeBackground4","#00000000",A("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),dvr=ve("editorBracketPairGuide.activeBackground5","#00000000",A("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),hvr=ve("editorBracketPairGuide.activeBackground6","#00000000",A("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));ve("editorUnicodeHighlight.border",Rw,A("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));ve("editorUnicodeHighlight.background",uhr,A("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));Gm((n,e)=>{const t=n.getColor(lv),i=n.getColor(cct),r=i&&!i.isTransparent()?i:t;r&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`)});function fvr(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 pvr(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var gvr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},_Be=function(n,e){return function(t,i){e(t,i,n)}};let cve=class extends Ye{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new Ue),this._markerDecorations=new Yc,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 mvr(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var i;const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===ir.inMemory||e.uri.scheme===ir.internal||e.uri.scheme===ir.vscode)&&((i=this._markerService)==null||i.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)}};cve=gvr([_Be(0,Xo),_Be(1,w1)],cve);class mvr extends Ye{constructor(e){super(),this.model=e,this._map=new _ur,this._register(gi(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=fvr(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)),s=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),o=this.model.deltaDecorations(r,s);for(const a of i)this._map.delete(a);for(let a=0;a<o.length;a++)this._map.set(t[a],o[a]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=ie.lift(t);if(t.severity===Ya.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 s=e.getWordAtPosition(i.getStartPosition());s&&(i=new ie(i.startLineNumber,s.startColumn,i.endLineNumber,s.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 ie(i.startLineNumber,r,i.endLineNumber,i.endColumn),t.startColumn=r)}return i}_createDecorationOption(e){let t,i,r,s,o;switch(e.severity){case Ya.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",r=0;break;case Ya.Info:t="squiggly-info",i=Ga(J_r),r=10,o={color:Ga(Dhr),position:1};break;case Ya.Warning:t="squiggly-warning",i=Ga(Z_r),r=20,o={color:Ga(Rhr),position:1};break;case Ya.Error:default:t="squiggly-error",i=Ga(X_r),r=30,o={color:Ga(Phr),position:1};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(s="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(s="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:ug.Right},minimap:o,zIndex:r,inlineClassName:s}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}}const STe=Ur("markerDecorationsService");class cc{static _nextVisibleColumn(e,t,i){return e===9?cc.nextRenderTabStop(t,i):YE(e)||vke(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const r=Math.min(t-1,e.length),s=e.substring(0,r),o=new $K(s);let a=0;for(;!o.eol();){const l=BK(s,r,o.offset);o.nextGraphemeLength(),a=this._nextVisibleColumn(l,a,i)}return a}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const r=e.length,s=new $K(e);let o=0,a=1;for(;!s.eol();){const l=BK(e,r,s.offset);s.nextGraphemeLength();const c=this._nextVisibleColumn(l,o,i),u=s.offset+1;if(c>=t){const d=t-o;return c-t<d?u:a}o=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)}}function _vr(n,e,t){let i=0;for(let s=0;s<n.length;s++)n.charAt(s)===" "?i=cc.nextIndentTabStop(i,e):i++;let r="";if(!t){const s=Math.floor(i/e);i=i%e;for(let o=0;o<s;o++)r+=" "}for(let s=0;s<i;s++)r+=" ";return r}function ETe(n,e,t){let i=Yd(n);return i===-1&&(i=n.length),_vr(n.substring(0,i),e,t)+n.substring(i)}class vBe{constructor(e,t,i,r){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=r}}class vvr{constructor(e,t,i,r,s,o){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=r,this.nestingLevelOfEqualBracketType=s,this.bracketPairNode=o}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class bvr extends vvr{constructor(e,t,i,r,s,o,a){super(e,t,i,r,s,o),this.minVisibleColumnIndentation=a}}function yvr(n,e,t,i){return n!==t?Ll(t-n,i):Ll(0,i-e)}const wh=0;function LG(n){return n===0}const rg=2**26;function Ll(n,e){return n*rg+e}function Em(n){const e=n,t=Math.floor(e/rg),i=e-t*rg;return new av(t,i)}function Cvr(n){return Math.floor(n/rg)}function Qa(n,e){let t=n+e;return e>=rg&&(t=t-n%rg),t}function wvr(n,e){return n.reduce((t,i)=>Qa(t,e(i)),wh)}function bct(n,e){return n===e}function R7(n,e){const t=n,i=e;if(i-t<=0)return wh;const s=Math.floor(t/rg),o=Math.floor(i/rg),a=i-o*rg;if(s===o){const l=t-s*rg;return Ll(0,a-l)}else return Ll(o-s,a)}function $P(n,e){return n<e}function HP(n,e){return n<=e}function tF(n,e){return n>=e}function jR(n){return Ll(n.lineNumber-1,n.column-1)}function hI(n,e){const t=n,i=Math.floor(t/rg),r=t-i*rg,s=e,o=Math.floor(s/rg),a=s-o*rg;return new ie(i+1,r+1,o+1,a+1)}function xvr(n){const e=_1(n);return Ll(e.length-1,e[e.length-1].length)}class GC{static fromModelContentChanges(e){return e.map(i=>{const r=ie.lift(i.range);return new GC(jR(r.getStartPosition()),jR(r.getEndPosition()),xvr(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Em(this.startOffset)}...${Em(this.endOffset)}) -> ${Em(this.newLength)}`}}class Svr{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>kTe.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:R7(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ll(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ll(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Em(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ll(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ll(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(HP(i,e)){this.nextEditIdx++;const r=Em(i),s=Em(this.translateOldToCur(t.endOffsetBeforeObj)),o=r.lineCount-s.lineCount;this.deltaOldToNewLineCount+=o;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=r.columnCount-s.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class kTe{static from(e){return new kTe(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=Em(t),this.endOffsetAfterObj=Em(Qa(e,i)),this.offsetObj=Em(e)}}const gW=[],Xg=class Xg{static create(e,t){if(e<=128&&t.length===0){let i=Xg.cache[e];return i||(i=new Xg(e,t),Xg.cache[e]=i),i}return new Xg(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 o=1<<i|this.items;return o===this.items?this:Xg.create(o,this.additionalItems)}r--;const s=this.additionalItems.slice(0);for(;s.length<r;)s.push(0);return s[r]|=1<<(i&31),Xg.create(this.items,s)}merge(e){const t=this.items|e.items;if(this.additionalItems===gW&&e.additionalItems===gW)return t===this.items?this:t===e.items?e:Xg.create(t,gW);const i=[];for(let r=0;r<Math.max(this.additionalItems.length,e.additionalItems.length);r++){const s=this.additionalItems[r]||0,o=e.additionalItems[r]||0;i.push(s|o)}return Xg.create(t,i)}intersects(e){if((this.items&e.items)!==0)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if((this.additionalItems[t]&e.additionalItems[t])!==0)return!0;return!1}};Xg.cache=new Array(129),Xg.empty=Xg.create(0,gW);let Kf=Xg;const bBe={getKey(n){return n}};class yct{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 TTe{get length(){return this._length}constructor(e){this._length=e}}class P7 extends TTe{static create(e,t,i){let r=e.length;return t&&(r=Qa(r,t.length)),i&&(r=Qa(r,i.length)),new P7(r,e,t,i,t?t.missingOpeningBracketIds:Kf.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,s){super(e),this.openingBracket=t,this.child=i,this.closingBracket=r,this.missingOpeningBracketIds=s}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new P7(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(Qa(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class Zy extends TTe{static create23(e,t,i,r=!1){let s=e.length,o=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(s=Qa(s,t.length),o=o.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");s=Qa(s,i.length),o=o.merge(i.missingOpeningBracketIds)}return r?new Evr(s,e.listHeight+1,e,t,i,o):new O7(s,e.listHeight+1,e,t,i,o)}static getEmpty(){return new kvr(wh,0,[],Kf.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 Ps;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 s=this.getChild(r);t=Qa(t,s.length),i=i.merge(s.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 s=0;s<this.childrenLength;s++){const o=this.getChild(s);o&&(i=Math.min(i,o.computeMinIndentation(r,t)),r=Qa(r,o.length))}return this.cachedMinIndentation=i,i}}class O7 extends Zy{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,s,o){super(e,t,o),this._item1=i,this._item2=r,this._item3=s}deepClone(){return new O7(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 Evr extends O7{toMutable(){return new O7(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class AG extends Zy{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 AG(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 kvr extends AG{toMutable(){return new AG(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const Tvr=[];class ITe extends TTe{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return Tvr}deepClone(){return this}}class x2 extends ITe{get kind(){return 0}get missingOpeningBracketIds(){return Kf.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=Em(e),r=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,s=Cvr(Qa(e,this.length))+1;let o=Number.MAX_SAFE_INTEGER;for(let a=r;a<=s;a++){const l=t.getLineFirstNonWhitespaceColumn(a),c=t.getLineContent(a);if(l===0)continue;const u=cc.visibleColumnFromColumn(c,l,t.getOptions().tabSize);o=Math.min(o,u)}return o}}class NG extends ITe{static create(e,t,i){return new NG(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return Kf.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 Ivr extends ITe{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 xS=class{constructor(e,t,i,r,s){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=r,this.astNode=s}};class Cct{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new Lvr(this.textModel,this.bracketTokens),this._offset=wh,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Ll(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Qa(this._offset,e);const t=Em(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=Qa(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class Lvr{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 s=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=s.length,s}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 s=this.lineTokens,o=s.getCount();let a=null;if(this.lineTokenOffset<o){const l=s.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<o&&l===s.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const c=rf.getTokenType(l)===0,u=rf.containsBalancedBrackets(l),d=s.getEndOffset(this.lineTokenOffset);if(u&&c&&this.lineCharOffset<d){const f=s.getLanguageId(this.lineTokenOffset),p=this.line.substring(this.lineCharOffset,d),g=this.bracketTokens.getSingleLanguageBracketTokens(f),m=g.regExpGlobal;if(m){m.lastIndex=0;const _=m.exec(p);_&&(a=g.getToken(_[0]),a&&(this.lineCharOffset+=_.index))}}if(i+=d-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=a.length,a;else this.lineTokenOffset++,this.lineCharOffset=d}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3))break;if(i>1500)break}const r=yvr(e,t,this.lineIdx,this.lineCharOffset);return new xS(r,0,-1,Kf.getEmpty(),new x2(r))}}class Avr{constructor(e,t){this.text=e,this._offset=wh,this.idx=0;const i=t.getRegExpStr(),r=i?new RegExp(i+`| `,"gi"):null,s=[];let o,a=0,l=0,c=0,u=0;const d=[];for(let g=0;g<60;g++)d.push(new xS(Ll(0,g),0,-1,Kf.getEmpty(),new x2(Ll(0,g))));const f=[];for(let g=0;g<60;g++)f.push(new xS(Ll(1,g),0,-1,Kf.getEmpty(),new x2(Ll(1,g))));if(r)for(r.lastIndex=0;(o=r.exec(e))!==null;){const g=o.index,m=o[0];if(m===` `)a++,l=g+1;else{if(c!==g){let _;if(u===a){const v=g-c;if(v<d.length)_=d[v];else{const b=Ll(0,v);_=new xS(b,0,-1,Kf.getEmpty(),new x2(b))}}else{const v=a-u,b=g-l;if(v===1&&b<f.length)_=f[b];else{const y=Ll(v,b);_=new xS(y,0,-1,Kf.getEmpty(),new x2(y))}}s.push(_)}s.push(t.getToken(m)),c=g+m.length,u=a}}const p=e.length;if(c!==p){const g=u===a?Ll(0,p-c):Ll(a-u,p-l);s.push(new xS(g,0,-1,Kf.getEmpty(),new x2(g)))}this.length=Ll(a,p-l),this.tokens=s}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new cor}}class LTe{static createFromLanguage(e,t){function i(s){return t.getKey(`${s.languageId}:::${s.bracketText}`)}const r=new Map;for(const s of e.bracketsNew.openingBrackets){const o=Ll(0,s.bracketText.length),a=i(s),l=Kf.getEmpty().add(a,bBe);r.set(s.bracketText,new xS(o,1,a,l,NG.create(o,s,l)))}for(const s of e.bracketsNew.closingBrackets){const o=Ll(0,s.bracketText.length);let a=Kf.getEmpty();const l=s.getOpeningBrackets();for(const c of l)a=a.add(i(c),bBe);r.set(s.bracketText,new xS(o,2,i(l[0]),a,NG.create(o,s,a)))}return new LTe(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=>Nvr(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 Nvr(n){let e=mg(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class wct{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=LTe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Dvr(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 o=e,a=n[o].listHeight;for(e++;e<n.length&&n[e].listHeight===a;)e++;return e-o>=2?xct(o===0&&e===n.length?n:n.slice(o,e),!1):n[o]}let i=t(),r=t();if(!r)return i;for(let o=t();o;o=t())yBe(i,r)<=yBe(r,o)?(i=eue(i,r),r=o):r=eue(r,o);return eue(i,r)}function xct(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 s=r<<1;n[r]=Zy.create23(n[s],n[s+1],s+3===t?n[s+2]:null,e)}t=i}return Zy.create23(n[0],n[1],t>=3?n[2]:null,e)}function yBe(n,e){return Math.abs(n.listHeight-e.listHeight)}function eue(n,e){return n.listHeight===e.listHeight?Zy.create23(n,e,null,!1):n.listHeight>e.listHeight?Rvr(n,e):Pvr(e,n)}function Rvr(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 s=i.length-1;s>=0;s--){const o=i[s];r?o.childrenLength>=3?r=Zy.create23(o.unappendChild(),r,null,!1):(o.appendChildOfSameHeight(r),r=void 0):o.handleChildrenChanged()}return r?Zy.create23(n,r,null,!1):n}function Pvr(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 s=i.length-1;s>=0;s--){const o=i[s];r?o.childrenLength>=3?r=Zy.create23(r,o.unprependChild(),null,!1):(o.prependChildOfSameHeight(r),r=void 0):o.handleChildrenChanged()}return r?Zy.create23(r,n,null,!1):n}class Ovr{constructor(e){this.lastOffset=wh,this.nextNodes=[e],this.offsets=[wh],this.idxs=[]}readLongestNodeAt(e,t){if($P(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=_j(this.nextNodes);if(!i)return;const r=_j(this.offsets);if($P(e,r))return;if($P(r,e))if(Qa(r,i.length)<=e)this.nextNodeAfterCurrent();else{const s=tue(i);s!==-1?(this.nextNodes.push(i.getChild(s)),this.offsets.push(r),this.idxs.push(s)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const s=tue(i);if(s===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(s)),this.offsets.push(r),this.idxs.push(s)}}}}nextNodeAfterCurrent(){for(;;){const e=_j(this.offsets),t=_j(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=_j(this.nextNodes),r=tue(i,this.idxs[this.idxs.length-1]);if(r!==-1){this.nextNodes.push(i.getChild(r)),this.offsets.push(Qa(e,t.length)),this.idxs[this.idxs.length-1]=r;break}else this.idxs.pop()}}}function tue(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function _j(n){return n.length>0?n[n.length-1]:void 0}function uve(n,e,t,i){return new Mvr(n,e,t,i).parseDocument()}class Mvr{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 Ovr(i):void 0,this.positionMapper=new Svr(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Kf.getEmpty(),0);return e||(e=Zy.getEmpty()),e}parseList(e,t){const i=[];for(;;){let s=this.tryReadChildFromCache(e);if(!s){const o=this.tokenizer.peek();if(!o||o.kind===2&&o.bracketIds.intersects(e))break;s=this.parseChild(e,t+1)}s.kind===4&&s.childrenLength===0||i.push(s)}return this.oldNodeReader?Dvr(i):xct(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!LG(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),r=>t!==null&&!$P(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 Ivr(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new x2(i.length);const r=e.merge(i.bracketIds),s=this.parseList(r,t+1),o=this.tokenizer.peek();return o&&o.kind===2&&(o.bracketId===i.bracketId||o.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),P7.create(i.astNode,s,o.astNode)):P7.create(i.astNode,s,null)}default:throw new Error("unexpected")}}}function DG(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new Lw(CBe(n)),i=CBe(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let r=t.dequeue();function s(c){if(c===void 0){const d=t.takeWhile(f=>!0)||[];return r&&d.unshift(r),d}const u=[];for(;r&&!LG(c);){const[d,f]=r.splitAt(c);u.push(d),c=R7(d.lengthAfter,c),r=f??t.dequeue()}return LG(c)||u.push(new WS(!1,c,c)),u}const o=[];function a(c,u,d){if(o.length>0&&bct(o[o.length-1].endOffset,c)){const f=o[o.length-1];o[o.length-1]=new GC(f.startOffset,u,Qa(f.newLength,d))}else o.push({startOffset:c,endOffset:u,newLength:d})}let l=wh;for(const c of i){const u=s(c.lengthBefore);if(c.modified){const d=wvr(u,p=>p.lengthBefore),f=Qa(l,d);a(l,f,c.lengthAfter),l=f}else for(const d of u){const f=l;l=Qa(l,d.lengthBefore),d.modified&&a(f,l,d.lengthAfter)}}return o}class WS{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=R7(e,this.lengthAfter);return bct(t,wh)?[this,void 0]:this.modified?[new WS(this.modified,this.lengthBefore,e),new WS(this.modified,wh,t)]:[new WS(this.modified,e,e),new WS(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Em(this.lengthBefore)} -> ${Em(this.lengthAfter)}`}}function CBe(n){const e=[];let t=wh;for(const i of n){const r=R7(t,i.startOffset);LG(r)||e.push(new WS(!1,r,r));const s=R7(i.startOffset,i.endOffset);e.push(new WS(!0,s,i.newLength)),t=i.endOffset}return e}class jvr extends Ye{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new Ue,this.denseKeyProvider=new yct,this.brackets=new wct(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 Avr(this.textModel.getValue(),i);this.initialAstWithoutTokens=uve(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 GC(Ll(i.fromLineNumber-1,0),Ll(i.toLineNumber,0),Ll(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=GC.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=DG(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=DG(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,s=new Cct(this.textModel,this.brackets);return uve(s,e,r,i)}getBracketsInRange(e,t){this.flushQueue();const i=Ll(e.startLineNumber-1,e.startColumn-1),r=Ll(e.endLineNumber-1,e.endColumn-1);return new aI(s=>{const o=this.initialAstWithoutTokens||this.astWithTokens;dve(o,wh,o.length,i,r,s,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=jR(e.getStartPosition()),r=jR(e.getEndPosition());return new aI(s=>{const o=this.initialAstWithoutTokens||this.astWithTokens,a=new Fvr(s,t,this.textModel);hve(o,wh,o.length,i,r,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Ect(t,wh,t.length,jR(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Sct(t,wh,t.length,jR(e))}}function Sct(n,e,t,i){if(n.kind===4||n.kind===2){const r=[];for(const s of n.children)t=Qa(e,s.length),r.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let s=r.length-1;s>=0;s--){const{nodeOffsetStart:o,nodeOffsetEnd:a}=r[s];if($P(o,i)){const l=Sct(n.children[s],o,a,i);if(l)return l}}return null}else{if(n.kind===3)return null;if(n.kind===1){const r=hI(e,t);return{bracketInfo:n.bracketInfo,range:r}}}return null}function Ect(n,e,t,i){if(n.kind===4||n.kind===2){for(const r of n.children){if(t=Qa(e,r.length),$P(i,t)){const s=Ect(r,e,t,i);if(s)return s}e=t}return null}else{if(n.kind===3)return null;if(n.kind===1){const r=hI(e,t);return{bracketInfo:n.bracketInfo,range:r}}}return null}function dve(n,e,t,i,r,s,o,a,l,c,u=!1){if(o>200)return!0;e:for(;;)switch(n.kind){case 4:{const d=n.childrenLength;for(let f=0;f<d;f++){const p=n.getChild(f);if(p){if(t=Qa(e,p.length),HP(e,r)&&tF(t,i)){if(tF(t,r)){n=p;continue e}if(!dve(p,e,t,i,r,s,o,0,l,c))return!1}e=t}}return!0}case 2:{const d=!c||!n.closingBracket||n.closingBracket.bracketInfo.closesColorized(n.openingBracket.bracketInfo);let f=0;if(l){let g=l.get(n.openingBracket.text);g===void 0&&(g=0),f=g,d&&(g++,l.set(n.openingBracket.text,g))}const p=n.childrenLength;for(let g=0;g<p;g++){const m=n.getChild(g);if(m){if(t=Qa(e,m.length),HP(e,r)&&tF(t,i)){if(tF(t,r)&&m.kind!==1){n=m,d?(o++,a=f+1):a=f;continue e}if((d||m.kind!==1||!n.closingBracket)&&!dve(m,e,t,i,r,s,d?o+1:o,d?f+1:f,l,c,!n.closingBracket))return!1}e=t}}return l==null||l.set(n.openingBracket.text,f),!0}case 3:{const d=hI(e,t);return s(new vBe(d,o-1,0,!0))}case 1:{const d=hI(e,t);return s(new vBe(d,o-1,a-1,u))}case 0:return!0}}class Fvr{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function hve(n,e,t,i,r,s,o,a){var c;if(o>200)return!0;let l=!0;if(n.kind===2){let u=0;if(a){let p=a.get(n.openingBracket.text);p===void 0&&(p=0),u=p,p++,a.set(n.openingBracket.text,p)}const d=Qa(e,n.openingBracket.length);let f=-1;if(s.includeMinIndentation&&(f=n.computeMinIndentation(e,s.textModel)),l=s.push(new bvr(hI(e,t),hI(e,d),n.closingBracket?hI(Qa(d,((c=n.child)==null?void 0:c.length)||wh),t):void 0,o,u,n,f)),e=d,l&&n.child){const p=n.child;if(t=Qa(e,p.length),HP(e,r)&&tF(t,i)&&(l=hve(p,e,t,i,r,s,o+1,a),!l))return!1}a==null||a.set(n.openingBracket.text,u)}else{let u=e;for(const d of n.children){const f=u;if(u=Qa(u,d.length),HP(f,r)&&HP(i,u)&&(l=hve(d,f,u,i,r,s,o,a),!l))return!1}}return l}class Bvr extends Ye{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Dc),this.onDidChangeEmitter=new Ue,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){var t;(!e.languageId||(t=this.bracketPairsTree.value)!=null&&t.object.didLanguageChange(e.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.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)==null||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)==null||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Et;this.bracketPairsTree.value=$vr(e.add(new jvr(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?void 0:t.object.getBracketPairsInRange(e,!1))||aI.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)==null?void 0:t.object.getBracketPairsInRange(e,!0))||aI.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)==null?void 0:i.object.getBracketsInRange(e,t))||aI.empty}findMatchingBracketUp(e,t,i){const r=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(r.lineNumber,r.column);if(this.canBuildAST){const o=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);if(!o)return null;const a=this.getBracketPairsInRange(ie.fromPositions(t,t)).findLast(l=>o.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const o=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!a)return null;const l=a.textIsBracket[o];return l?mW(this._findMatchingBracketUp(l,r,nue(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(ie.fromPositions(e,e)).filter(r=>r.closingBracketRange!==void 0&&(r.openingBracketRange.containsPosition(e)||r.closingBracketRange.containsPosition(e))).findLastMaxBy(kh(r=>r.openingBracketRange.containsPosition(e)?r.openingBracketRange:r.closingBracketRange,ie.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=nue(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,r){const s=t.getCount(),o=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(F0(t.getStandardTokenType(c))||t.getLanguageId(c)!==o){a=u;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=r+1;c<s;c++){const u=t.getStartOffset(c);if(u>=l)break;if(F0(t.getStandardTokenType(c))||t.getLanguageId(c)!==o){l=u;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,r=this.textModel.tokenization.getLineTokens(i),s=this.textModel.getLineContent(i),o=r.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(o)).brackets;if(a&&!F0(r.getStandardTokenType(o))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,a,o),u=null;for(;;){const d=S_.findNextBracketInRange(a.forwardRegex,i,s,l,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const f=s.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),p=this._matchFoundBracket(d,a.textIsBracket[f],a.textIsOpenBracket[f],t);if(p){if(p instanceof LC)return null;u=p}}l=d.endColumn-1}if(u)return u}if(o>0&&r.getStartOffset(o)===e.column-1){const l=o-1,c=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(l)).brackets;if(c&&!F0(r.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,r,c,l),f=S_.findPrevBracketInRange(c.reversedRegex,i,s,u,d);if(f&&f.startColumn<=e.column&&e.column<=f.endColumn){const p=s.substring(f.startColumn-1,f.endColumn-1).toLowerCase(),g=this._matchFoundBracket(f,c.textIsBracket[p],c.textIsOpenBracket[p],t);if(g)return g instanceof LC?null:g}}}return null}_matchFoundBracket(e,t,i,r){if(!t)return null;const s=i?this._findMatchingBracketDown(t,e.getEndPosition(),r):this._findMatchingBracketUp(t,e.getStartPosition(),r);return s?s instanceof LC?s:[e,s]:null}_findMatchingBracketUp(e,t,i){const r=e.languageId,s=e.reversedRegex;let o=-1,a=0;const l=(c,u,d,f)=>{for(;;){if(i&&++a%100===0&&!i())return LC.INSTANCE;const p=S_.findPrevBracketInRange(s,c,u,d,f);if(!p)break;const g=u.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(g)?o++:e.isClose(g)&&o--,o===0)return p;f=p.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),f=this.textModel.getLineContent(c);let p=d-1,g=f.length,m=f.length;c===t.lineNumber&&(p=u.findTokenIndexAtOffset(t.column-1),g=t.column-1,m=t.column-1);let _=!0;for(;p>=0;p--){const v=u.getLanguageId(p)===r&&!F0(u.getStandardTokenType(p));if(v)_?g=u.getStartOffset(p):(g=u.getStartOffset(p),m=u.getEndOffset(p));else if(_&&g!==m){const b=l(c,f,g,m);if(b)return b}_=v}if(_&&g!==m){const v=l(c,f,g,m);if(v)return v}}return null}_findMatchingBracketDown(e,t,i){const r=e.languageId,s=e.forwardRegex;let o=1,a=0;const l=(u,d,f,p)=>{for(;;){if(i&&++a%100===0&&!i())return LC.INSTANCE;const g=S_.findNextBracketInRange(s,u,d,f,p);if(!g)break;const m=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(m)?o++:e.isClose(m)&&o--,o===0)return g;f=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let u=t.lineNumber;u<=c;u++){const d=this.textModel.tokenization.getLineTokens(u),f=d.getCount(),p=this.textModel.getLineContent(u);let g=0,m=0,_=0;u===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),m=t.column-1,_=t.column-1);let v=!0;for(;g<f;g++){const b=d.getLanguageId(g)===r&&!F0(d.getStandardTokenType(g));if(b)v||(m=d.getStartOffset(g)),_=d.getEndOffset(g);else if(v&&m!==_){const y=l(u,p,m,_);if(y)return y}v=b}if(v&&m!==_){const b=l(u,p,m,_);if(b)return b}}return null}findPrevBracket(e){var o;const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((o=this.bracketPairsTree.value)==null?void 0:o.object.getFirstBracketBefore(t))||null;let i=null,r=null,s=null;for(let a=t.lineNumber;a>=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),u=this.textModel.getLineContent(a);let d=c-1,f=u.length,p=u.length;if(a===t.lineNumber){d=l.findTokenIndexAtOffset(t.column-1),f=t.column-1,p=t.column-1;const m=l.getLanguageId(d);i!==m&&(i=m,r=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let g=!0;for(;d>=0;d--){const m=l.getLanguageId(d);if(i!==m){if(r&&s&&g&&f!==p){const v=S_.findPrevBracketInRange(r.reversedRegex,a,u,f,p);if(v)return this._toFoundBracket(s,v);g=!1}i=m,r=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const _=!!r&&!F0(l.getStandardTokenType(d));if(_)g?f=l.getStartOffset(d):(f=l.getStartOffset(d),p=l.getEndOffset(d));else if(s&&r&&g&&f!==p){const v=S_.findPrevBracketInRange(r.reversedRegex,a,u,f,p);if(v)return this._toFoundBracket(s,v)}g=_}if(s&&r&&g&&f!==p){const m=S_.findPrevBracketInRange(r.reversedRegex,a,u,f,p);if(m)return this._toFoundBracket(s,m)}}return null}findNextBracket(e){var a;const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((a=this.bracketPairsTree.value)==null?void 0:a.object.getFirstBracketAfter(t))||null;const i=this.textModel.getLineCount();let r=null,s=null,o=null;for(let l=t.lineNumber;l<=i;l++){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let f=0,p=0,g=0;if(l===t.lineNumber){f=c.findTokenIndexAtOffset(t.column-1),p=t.column-1,g=t.column-1;const _=c.getLanguageId(f);r!==_&&(r=_,s=this.languageConfigurationService.getLanguageConfiguration(r).brackets,o=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let m=!0;for(;f<u;f++){const _=c.getLanguageId(f);if(r!==_){if(o&&s&&m&&p!==g){const b=S_.findNextBracketInRange(s.forwardRegex,l,d,p,g);if(b)return this._toFoundBracket(o,b);m=!1}r=_,s=this.languageConfigurationService.getLanguageConfiguration(r).brackets,o=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew}const v=!!s&&!F0(c.getStandardTokenType(f));if(v)m||(p=c.getStartOffset(f)),g=c.getEndOffset(f);else if(o&&s&&m&&p!==g){const b=S_.findNextBracketInRange(s.forwardRegex,l,d,p,g);if(b)return this._toFoundBracket(o,b)}m=v}if(o&&s&&m&&p!==g){const _=S_.findNextBracketInRange(s.forwardRegex,l,d,p,g);if(_)return this._toFoundBracket(o,_)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const p=ie.fromPositions(i),g=this.getBracketPairsInRange(ie.fromPositions(i,i)).findLast(m=>m.closingBracketRange!==void 0&&m.range.strictContainsRange(p));return g?[g.openingBracketRange,g.closingBracketRange]:null}const r=nue(t),s=this.textModel.getLineCount(),o=new Map;let a=[];const l=(p,g)=>{if(!o.has(p)){const m=[];for(let _=0,v=g?g.brackets.length:0;_<v;_++)m[_]=0;o.set(p,m)}a=o.get(p)};let c=0;const u=(p,g,m,_,v)=>{for(;;){if(r&&++c%100===0&&!r())return LC.INSTANCE;const b=S_.findNextBracketInRange(p.forwardRegex,g,m,_,v);if(!b)break;const y=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),C=p.textIsBracket[y];if(C&&(C.isOpen(y)?a[C.index]++:C.isClose(y)&&a[C.index]--,a[C.index]===-1))return this._matchFoundBracket(b,C,!1,r);_=b.endColumn-1}return null};let d=null,f=null;for(let p=i.lineNumber;p<=s;p++){const g=this.textModel.tokenization.getLineTokens(p),m=g.getCount(),_=this.textModel.getLineContent(p);let v=0,b=0,y=0;if(p===i.lineNumber){v=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,y=i.column-1;const S=g.getLanguageId(v);d!==S&&(d=S,f=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,f))}let C=!0;for(;v<m;v++){const S=g.getLanguageId(v);if(d!==S){if(f&&C&&b!==y){const I=u(f,p,_,b,y);if(I)return mW(I);C=!1}d=S,f=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,f)}const k=!!f&&!F0(g.getStandardTokenType(v));if(k)C||(b=g.getStartOffset(v)),y=g.getEndOffset(v);else if(f&&C&&b!==y){const I=u(f,p,_,b,y);if(I)return mW(I)}C=k}if(f&&C&&b!==y){const S=u(f,p,_,b,y);if(S)return mW(S)}}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 $vr(n,e){return{object:n,dispose:()=>e==null?void 0:e.dispose()}}function nue(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}const zQ=class zQ{constructor(){this._searchCanceledBrand=void 0}};zQ.INSTANCE=new zQ;let LC=zQ;function mW(n){return n instanceof LC?null:n}class Hvr extends Ye{constructor(e){super(),this.textModel=e,this.colorProvider=new kct,this.onDidChangeEmitter=new Ue,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(o=>({id:`bracket${o.range.toString()}-${o.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(o,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:o.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new ie(1,1,this.textModel.getLineCount(),1),e,t):[]}}class kct{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}`}}Gm((n,e)=>{const t=[fct,pct,gct,mct,_ct,vct],i=new kct;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(evr)}; }`);const r=t.map(s=>n.getColor(s)).filter(s=>!!s).filter(s=>!s.isTransparent());for(let s=0;s<30;s++){const o=r[s%r.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(s)} { color: ${o}; }`)}});function _W(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Pu{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} "${_W(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${_W(this.oldText)}")`:`(replace@${this.oldPosition} "${_W(this.oldText)}" with "${_W(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const r=t.length;Xv(e,r,i),i+=4;for(let s=0;s<r;s++)Icr(e,t.charCodeAt(s),i),i+=2;return i}static _readString(e,t){const i=Qv(e,t);return t+=4,Acr(e,t,i)}writeSize(){return 8+Pu._writeStringSize(this.oldText)+Pu._writeStringSize(this.newText)}write(e,t){return Xv(e,this.oldPosition,t),t+=4,Xv(e,this.newPosition,t),t+=4,t=Pu._writeString(e,this.oldText,t),t=Pu._writeString(e,this.newText,t),t}static read(e,t,i){const r=Qv(e,t);t+=4;const s=Qv(e,t);t+=4;const o=Pu._readString(e,t);t+=Pu._writeStringSize(o);const a=Pu._readString(e,t);return t+=Pu._writeStringSize(a),i.push(new Pu(r,o,s,a)),t}}function Vvr(n,e){return n===null||n.length===0?e:new W0(n,e).compress()}class W0{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]=W0._splitCurr(r,i.newPosition-r.oldPosition);this._acceptCurr(c),r=u;continue}if(i.newPosition<r.oldPosition){const[c,u]=W0._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]=W0._splitPrev(i,r.oldLength);a=c,l=r,i=u,r=this._getCurr(++t)}else{const[c,u]=W0._splitCurr(r,i.newLength);a=i,l=c,i=this._getPrev(++e),r=u}this._result[this._resultLen++]=new Pu(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const s=W0._merge(this._result);return W0._removeNoOps(s)}_acceptCurr(e){this._result[this._resultLen++]=W0._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++]=W0._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 Pu(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new Pu(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 Pu(e.oldPosition,e.oldText,e.newPosition,i),new Pu(e.oldEnd,"",e.newPosition+t,r)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),r=e.oldText.substr(t);return[new Pu(e.oldPosition,i,e.newPosition,e.newText),new Pu(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 s=1;s<e.length;s++){const o=e[s];r.oldEnd===o.oldPosition?r=new Pu(r.oldPosition,r.oldText+o.oldText,r.newPosition,r.newText+o.newText):(t[i++]=r,r=o)}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 s=e[r];s.oldText!==s.newText&&(t[i++]=s)}return t}}function OD(n){return n.toString()}class $c{static create(e,t){const i=e.getAlternativeVersionId(),r=fve(e);return new $c(i,i,r,r,t,t,[])}constructor(e,t,i,r,s,o,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=r,this.beforeCursorState=s,this.afterCursorState=o,this.changes=a}append(e,t,i,r,s){t.length>0&&(this.changes=Vvr(this.changes,t)),this.afterEOL=i,this.afterVersionId=r,this.afterCursorState=s}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Xv(e,t?t.length:0,i),i+=4,t)for(const r of t)Xv(e,r.selectionStartLineNumber,i),i+=4,Xv(e,r.selectionStartColumn,i),i+=4,Xv(e,r.positionLineNumber,i),i+=4,Xv(e,r.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const r=Qv(e,t);t+=4;for(let s=0;s<r;s++){const o=Qv(e,t);t+=4;const a=Qv(e,t);t+=4;const l=Qv(e,t);t+=4;const c=Qv(e,t);t+=4,i.push(new Yn(o,a,l,c))}return t}serialize(){let e=10+$c._writeSelectionsSize(this.beforeCursorState)+$c._writeSelectionsSize(this.afterCursorState)+4;for(const r of this.changes)e+=r.writeSize();const t=new Uint8Array(e);let i=0;Xv(t,this.beforeVersionId,i),i+=4,Xv(t,this.afterVersionId,i),i+=4,S8e(t,this.beforeEOL,i),i+=1,S8e(t,this.afterEOL,i),i+=1,i=$c._writeSelections(t,this.beforeCursorState,i),i=$c._writeSelections(t,this.afterCursorState,i),Xv(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=Qv(t,i);i+=4;const s=Qv(t,i);i+=4;const o=x8e(t,i);i+=1;const a=x8e(t,i);i+=1;const l=[];i=$c._readSelections(t,i,l);const c=[];i=$c._readSelections(t,i,c);const u=Qv(t,i);i+=4;const d=[];for(let f=0;f<u;f++)i=Pu.read(t,i,d);return new $c(r,s,o,a,l,c,d)}}class Tct{get type(){return 0}get resource(){return vi.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,r){this.label=e,this.code=t,this.model=i,this._data=$c.create(i,r)}toString(){return(this._data instanceof $c?this._data:$c.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(vi.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 $c}append(e,t,i,r,s){this._data instanceof $c&&this._data.append(e,t,i,r,s)}close(){this._data instanceof $c&&(this._data=this._data.serialize())}open(){this._data instanceof $c||(this._data=$c.deserialize(this._data))}undo(){if(vi.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof $c&&(this._data=this._data.serialize());const e=$c.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(vi.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof $c&&(this._data=this._data.serialize());const e=$c.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof $c&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Wvr{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 s=OD(r.resource);this._editStackElementsMap.set(s,r)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=OD(e);return this._editStackElementsMap.has(t)}setModel(e){const t=OD(vi.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=OD(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,r,s){const o=OD(e.uri);this._editStackElementsMap.get(o).append(e,t,i,r,s)}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=OD(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(`${Mm(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function fve(n){return n.getEOL()===` `?0:1}function AC(n){return n?n instanceof Tct||n instanceof Wvr:!1}class ATe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);AC(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);AC(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(AC(i)&&i.canAppend(this._model))return i;const r=new Tct(A("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,[],fve(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,r){const s=this._getOrCreateEditStackElement(e,r),o=this._model.applyEdits(t,!0),a=ATe._computeCursorState(i,o),l=o.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),s.append(this._model,l.map(c=>c.textChange),fve(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return tr(i),null}}}class Ict extends Ye{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function Bte(n,e){let t=0,i=0;const r=n.length;for(;i<r;){const s=n.charCodeAt(i);if(s===32)t++;else if(s===9)t=t-t%e+e;else break;i++}return i===r?-1:t}var fI;(function(n){n[n.Disabled=0]="Disabled",n[n.EnabledForActive=1]="EnabledForActive",n[n.Enabled=2]="Enabled"})(fI||(fI={}));class G2{constructor(e,t,i,r,s,o){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=r,this.forWrappedLinesAfterColumn=s,this.forWrappedLinesBeforeOrAtColumn=o,e!==-1==(t!==-1))throw new Error}}class s6{constructor(e,t){this.top=e,this.endColumn=t}}class zvr extends Ict{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return Bte(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 Ps("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=!!(s&&s.offSide);let a=-2,l=-1,c=-2,u=-1;const d=I=>{if(a!==-1&&(a===-2||a>I-1)){a=-1,l=-1;for(let L=I-2;L>=0;L--){const N=this._computeIndentLevel(L);if(N>=0){a=L,l=N;break}}}if(c===-2){c=-1,u=-1;for(let L=I;L<r;L++){const N=this._computeIndentLevel(L);if(N>=0){c=L,u=N;break}}}};let f=-2,p=-1,g=-2,m=-1;const _=I=>{if(f===-2){f=-1,p=-1;for(let L=I-2;L>=0;L--){const N=this._computeIndentLevel(L);if(N>=0){f=L,p=N;break}}}if(g!==-1&&(g===-2||g<I-1)){g=-1,m=-1;for(let L=I;L<r;L++){const N=this._computeIndentLevel(L);if(N>=0){g=L,m=N;break}}}};let v=0,b=!0,y=0,C=!0,S=0,k=0;for(let I=0;b||C;I++){const L=e-I,N=e+I;I>1&&(L<1||L<t)&&(b=!1),I>1&&(N>r||N>i)&&(C=!1),I>5e4&&(b=!1,C=!1);let P=-1;if(b&&L>=1){const F=this._computeIndentLevel(L-1);F>=0?(c=L-1,u=F,P=Math.ceil(F/this.textModel.getOptions().indentSize)):(d(L),P=this._getIndentLevelForWhitespaceLine(o,l,u))}let O=-1;if(C&&N<=r){const F=this._computeIndentLevel(N-1);F>=0?(f=N-1,p=F,O=Math.ceil(F/this.textModel.getOptions().indentSize)):(_(N),O=this._getIndentLevelForWhitespaceLine(o,p,m))}if(I===0){k=P;continue}if(I===1){if(N<=r&&O>=0&&k+1===O){b=!1,v=N,y=N,S=O;continue}if(L>=1&&P>=0&&P-1===k){C=!1,v=L,y=L,S=P;continue}if(v=e,y=e,S=k,S===0)return{startLineNumber:v,endLineNumber:y,indent:S}}b&&(P>=S?v=L:b=!1),C&&(O>=S?y=N:C=!1)}return{startLineNumber:v,endLineNumber:y,indent:S}}getLinesBracketGuides(e,t,i,r){var d;const s=[];for(let f=e;f<=t;f++)s.push([]);const o=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new ie(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let l;if(i&&a.length>0){const f=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(ie.fromPositions(i)).toArray()).filter(p=>ie.strictContainsPosition(p.range,i));l=(d=h7(f,p=>o))==null?void 0:d.range}const c=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new Lct;for(const f of a){if(!f.closingBracketRange)continue;const p=l&&f.range.equalsRange(l);if(!p&&!r.includeInactive)continue;const g=u.getInlineClassName(f.nestingLevel,f.nestingLevelOfEqualBracketType,c)+(r.highlightActive&&p?" "+u.activeClassName:""),m=f.openingBracketRange.getStartPosition(),_=f.closingBracketRange.getStartPosition(),v=r.horizontalGuides===fI.Enabled||r.horizontalGuides===fI.EnabledForActive&&p;if(f.range.startLineNumber===f.range.endLineNumber){v&&s[f.range.startLineNumber-e].push(new G2(-1,f.openingBracketRange.getEndPosition().column,g,new s6(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),y=this.getVisibleColumnFromPosition(f.openingBracketRange.getStartPosition()),C=Math.min(y,b,f.minVisibleColumnIndentation+1);let S=!1;Yd(this.textModel.getLineContent(f.closingBracketRange.startLineNumber))<f.closingBracketRange.startColumn-1&&(S=!0);const L=Math.max(m.lineNumber,e),N=Math.min(_.lineNumber,t),P=S?1:0;for(let O=L;O<N+P;O++)s[O-e].push(new G2(C,-1,g,null,O===m.lineNumber?m.column:-1,O===_.lineNumber?_.column:-1));v&&(m.lineNumber>=e&&y>C&&s[m.lineNumber-e].push(new G2(C,-1,g,new s6(!1,m.column),-1,-1)),_.lineNumber<=t&&b>C&&s[_.lineNumber-e].push(new G2(C,-1,g,new s6(!S,_.column),-1,-1)))}for(const f of s)f.sort((p,g)=>p.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return cc.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(),s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=!!(s&&s.offSide),a=new Array(t-e+1);let l=-2,c=-1,u=-2,d=-1;for(let f=e;f<=t;f++){const p=f-e,g=this._computeIndentLevel(f-1);if(g>=0){l=f-1,c=g,a[p]=Math.ceil(g/r.indentSize);continue}if(l===-2){l=-1,c=-1;for(let m=f-2;m>=0;m--){const _=this._computeIndentLevel(m);if(_>=0){l=m,c=_;break}}}if(u!==-1&&(u===-2||u<f-1)){u=-1,d=-1;for(let m=f;m<i;m++){const _=this._computeIndentLevel(m);if(_>=0){u=m,d=_;break}}}a[p]=this._getIndentLevelForWhitespaceLine(o,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 Lct{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 Uvr{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function qvr(n,e,t,i,r){r.spacesDiff=0,r.looksLikeAlignment=!1;let s;for(s=0;s<e&&s<i;s++){const f=n.charCodeAt(s),p=t.charCodeAt(s);if(f!==p)break}let o=0,a=0;for(let f=s;f<e;f++)n.charCodeAt(f)===32?o++:a++;let l=0,c=0;for(let f=s;f<i;f++)t.charCodeAt(f)===32?l++:c++;if(o>0&&a>0||l>0&&c>0)return;const u=Math.abs(a-c),d=Math.abs(o-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 wBe(n,e,t){const i=Math.min(n.getLineCount(),1e4);let r=0,s=0,o="",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 Uvr;for(let g=1;g<=i;g++){const m=n.getLineLength(g),_=n.getLineContent(g),v=m<=65536;let b=!1,y=0,C=0,S=0;for(let I=0,L=m;I<L;I++){const N=v?_.charCodeAt(I):n.getLineCharCode(g,I);if(N===9)S++;else if(N===32)C++;else{b=!0,y=I;break}}if(!b||(S>0?r++:C>1&&s++,qvr(o,a,_,y,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const k=d.spacesDiff;k<=c&&u[k]++,o=_,a=y}let f=t;r!==s&&(f=r<s);let p=e;if(f){let g=f?0:.1*i;l.forEach(m=>{const _=u[m];_>g&&(g=_,p=m)}),p===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(p=2)}return{insertSpaces:f,tabSize:p}}function Yh(n){return(n.metadata&1)>>>0}function ia(n,e){n.metadata=n.metadata&254|e<<0}function Vu(n){return(n.metadata&2)>>>1===1}function Go(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function Act(n){return(n.metadata&4)>>>2===1}function xBe(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function Nct(n){return(n.metadata&64)>>>6===1}function SBe(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function Kvr(n){return(n.metadata&24)>>>3}function EBe(n,e){n.metadata=n.metadata&231|e<<3}function Gvr(n){return(n.metadata&32)>>>5===1}function kBe(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class Dct{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,ia(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,xBe(this,!1),SBe(this,!1),EBe(this,1),kBe(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Go(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;xBe(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),SBe(this,this.options.glyphMarginClassName!==null),EBe(this,this.options.stickiness),kBe(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 Wr=new Dct(null,0,0);Wr.parent=Wr;Wr.left=Wr;Wr.right=Wr;ia(Wr,0);class iue{constructor(){this.root=Wr,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,r,s,o){return this.root===Wr?[]:nbr(this,e,t,i,r,s,o)}search(e,t,i,r){return this.root===Wr?[]:tbr(this,e,t,i,r)}collectNodesFromOwner(e){return Jvr(this,e)}collectNodesPostOrder(){return ebr(this)}insert(e){TBe(this,e),this._normalizeDeltaIfNecessary()}delete(e){IBe(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 s=i.start+r,o=i.end+r;i.setCachedOffsets(s,o,t)}acceptReplace(e,t,i,r){const s=Xvr(this,e,e+t);for(let o=0,a=s.length;o<a;o++){const l=s[o];IBe(this,l)}this._normalizeDeltaIfNecessary(),Zvr(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let o=0,a=s.length;o<a;o++){const l=s[o];l.start=l.cachedAbsoluteStart,l.end=l.cachedAbsoluteEnd,Qvr(l,e,e+t,i,r),l.maxEnd=l.end,TBe(this,l)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,Yvr(this))}}function Yvr(n){let e=n.root,t=0;for(;e!==Wr;){if(e.left!==Wr&&!Vu(e.left)){e=e.left;continue}if(e.right!==Wr&&!Vu(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,ik(e),Go(e,!0),Go(e.left,!1),Go(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}Go(n.root,!1)}function MD(n,e,t,i){return n<t?!0:n>t||i===1?!1:i===2?!0:e}function Qvr(n,e,t,i,r){const s=Kvr(n),o=s===0||s===2,a=s===1||s===2,l=t-e,c=i,u=Math.min(l,c),d=n.start;let f=!1;const p=n.end;let g=!1;e<=d&&p<=t&&Gvr(n)&&(n.start=e,f=!0,n.end=e,g=!0);{const _=r?1:l>0?2:0;!f&&MD(d,o,e,_)&&(f=!0),!g&&MD(p,a,e,_)&&(g=!0)}if(u>0&&!r){const _=l>c?2:0;!f&&MD(d,o,e+u,_)&&(f=!0),!g&&MD(p,a,e+u,_)&&(g=!0)}{const _=r?1:0;!f&&MD(d,o,t,_)&&(n.start=e+c,f=!0),!g&&MD(p,a,t,_)&&(n.end=e+c,g=!0)}const m=c-l;f||(n.start=Math.max(0,d+m)),g||(n.end=Math.max(0,p+m)),n.start>n.end&&(n.end=n.start)}function Xvr(n,e,t){let i=n.root,r=0,s=0,o=0,a=0;const l=[];let c=0;for(;i!==Wr;){if(Vu(i)){Go(i.left,!1),Go(i.right,!1),i===i.parent.right&&(r-=i.parent.delta),i=i.parent;continue}if(!Vu(i.left)){if(s=r+i.maxEnd,s<e){Go(i,!0);continue}if(i.left!==Wr){i=i.left;continue}}if(o=r+i.start,o>t){Go(i,!0);continue}if(a=r+i.end,a>=e&&(i.setCachedOffsets(o,a,0),l[c++]=i),Go(i,!0),i.right!==Wr&&!Vu(i.right)){r+=i.delta,i=i.right;continue}}return Go(n.root,!1),l}function Zvr(n,e,t,i){let r=n.root,s=0,o=0,a=0;const l=i-(t-e);for(;r!==Wr;){if(Vu(r)){Go(r.left,!1),Go(r.right,!1),r===r.parent.right&&(s-=r.parent.delta),ik(r),r=r.parent;continue}if(!Vu(r.left)){if(o=s+r.maxEnd,o<e){Go(r,!0);continue}if(r.left!==Wr){r=r.left;continue}}if(a=s+r.start,a>t){r.start+=l,r.end+=l,r.delta+=l,(r.delta<-1073741824||r.delta>1073741824)&&(n.requestNormalizeDelta=!0),Go(r,!0);continue}if(Go(r,!0),r.right!==Wr&&!Vu(r.right)){s+=r.delta,r=r.right;continue}}Go(n.root,!1)}function Jvr(n,e){let t=n.root;const i=[];let r=0;for(;t!==Wr;){if(Vu(t)){Go(t.left,!1),Go(t.right,!1),t=t.parent;continue}if(t.left!==Wr&&!Vu(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[r++]=t),Go(t,!0),t.right!==Wr&&!Vu(t.right)){t=t.right;continue}}return Go(n.root,!1),i}function ebr(n){let e=n.root;const t=[];let i=0;for(;e!==Wr;){if(Vu(e)){Go(e.left,!1),Go(e.right,!1),e=e.parent;continue}if(e.left!==Wr&&!Vu(e.left)){e=e.left;continue}if(e.right!==Wr&&!Vu(e.right)){e=e.right;continue}t[i++]=e,Go(e,!0)}return Go(n.root,!1),t}function tbr(n,e,t,i,r){let s=n.root,o=0,a=0,l=0;const c=[];let u=0;for(;s!==Wr;){if(Vu(s)){Go(s.left,!1),Go(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),s=s.parent;continue}if(s.left!==Wr&&!Vu(s.left)){s=s.left;continue}a=o+s.start,l=o+s.end,s.setCachedOffsets(a,l,i);let d=!0;if(e&&s.ownerId&&s.ownerId!==e&&(d=!1),t&&Act(s)&&(d=!1),r&&!Nct(s)&&(d=!1),d&&(c[u++]=s),Go(s,!0),s.right!==Wr&&!Vu(s.right)){o+=s.delta,s=s.right;continue}}return Go(n.root,!1),c}function nbr(n,e,t,i,r,s,o){let a=n.root,l=0,c=0,u=0,d=0;const f=[];let p=0;for(;a!==Wr;){if(Vu(a)){Go(a.left,!1),Go(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Vu(a.left)){if(c=l+a.maxEnd,c<e){Go(a,!0);continue}if(a.left!==Wr){a=a.left;continue}}if(u=l+a.start,u>t){Go(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,s);let g=!0;i&&a.ownerId&&a.ownerId!==i&&(g=!1),r&&Act(a)&&(g=!1),o&&!Nct(a)&&(g=!1),g&&(f[p++]=a)}if(Go(a,!0),a.right!==Wr&&!Vu(a.right)){l+=a.delta,a=a.right;continue}}return Go(n.root,!1),f}function TBe(n,e){if(n.root===Wr)return e.parent=Wr,e.left=Wr,e.right=Wr,ia(e,0),n.root=e,n.root;ibr(n,e),iS(e.parent);let t=e;for(;t!==n.root&&Yh(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Yh(i)===1?(ia(t.parent,0),ia(i,0),ia(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,o6(n,t)),ia(t.parent,0),ia(t.parent.parent,1),a6(n,t.parent.parent))}else{const i=t.parent.parent.left;Yh(i)===1?(ia(t.parent,0),ia(i,0),ia(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,a6(n,t)),ia(t.parent,0),ia(t.parent.parent,1),o6(n,t.parent.parent))}return ia(n.root,0),e}function ibr(n,e){let t=0,i=n.root;const r=e.start,s=e.end;for(;;)if(sbr(r,s,i.start+t,i.end+t)<0)if(i.left===Wr){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===Wr){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=Wr,e.right=Wr,ia(e,1)}function IBe(n,e){let t,i;if(e.left===Wr?(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===Wr?(t=e.left,i=e):(i=rbr(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,ia(t,0),e.detach(),rue(),ik(t),n.root.parent=Wr;return}const r=Yh(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,ia(i,Yh(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Wr&&(i.left.parent=i),i.right!==Wr&&(i.right.parent=i)),e.detach(),r){iS(t.parent),i!==e&&(iS(i),iS(i.parent)),rue();return}iS(t),iS(t.parent),i!==e&&(iS(i),iS(i.parent));let s;for(;t!==n.root&&Yh(t)===0;)t===t.parent.left?(s=t.parent.right,Yh(s)===1&&(ia(s,0),ia(t.parent,1),o6(n,t.parent),s=t.parent.right),Yh(s.left)===0&&Yh(s.right)===0?(ia(s,1),t=t.parent):(Yh(s.right)===0&&(ia(s.left,0),ia(s,1),a6(n,s),s=t.parent.right),ia(s,Yh(t.parent)),ia(t.parent,0),ia(s.right,0),o6(n,t.parent),t=n.root)):(s=t.parent.left,Yh(s)===1&&(ia(s,0),ia(t.parent,1),a6(n,t.parent),s=t.parent.left),Yh(s.left)===0&&Yh(s.right)===0?(ia(s,1),t=t.parent):(Yh(s.left)===0&&(ia(s.right,0),ia(s,1),o6(n,s),s=t.parent.left),ia(s,Yh(t.parent)),ia(t.parent,0),ia(s.left,0),a6(n,t.parent),t=n.root));ia(t,0),rue()}function rbr(n){for(;n.left!==Wr;)n=n.left;return n}function rue(){Wr.parent=Wr,Wr.delta=0,Wr.start=0,Wr.end=0}function o6(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!==Wr&&(t.left.parent=e),t.parent=e.parent,e.parent===Wr?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,ik(e),ik(t)}function a6(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!==Wr&&(t.right.parent=e),t.parent=e.parent,e.parent===Wr?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,ik(e),ik(t)}function Rct(n){let e=n.end;if(n.left!==Wr){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==Wr){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function ik(n){n.maxEnd=Rct(n)}function iS(n){for(;n!==Wr;){const e=Rct(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function sbr(n,e,t,i){return n===t?e-i:n-t}class pve{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!==mr)return NTe(this.right);let e=this;for(;e.parent!==mr&&e.parent.left!==e;)e=e.parent;return e.parent===mr?mr:e.parent}prev(){if(this.left!==mr)return Pct(this.left);let e=this;for(;e.parent!==mr&&e.parent.right!==e;)e=e.parent;return e.parent===mr?mr:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const mr=new pve(null,0);mr.parent=mr;mr.left=mr;mr.right=mr;mr.color=0;function NTe(n){for(;n.left!==mr;)n=n.left;return n}function Pct(n){for(;n.right!==mr;)n=n.right;return n}function DTe(n){return n===mr?0:n.size_left+n.piece.length+DTe(n.right)}function RTe(n){return n===mr?0:n.lf_left+n.piece.lineFeedCnt+RTe(n.right)}function sue(){mr.parent=mr}function l6(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!==mr&&(t.left.parent=e),t.parent=e.parent,e.parent===mr?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function c6(n,e){const t=e.left;e.left=t.right,t.right!==mr&&(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===mr?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function vW(n,e){let t,i;if(e.left===mr?(i=e,t=i.right):e.right===mr?(i=e,t=i.left):(i=NTe(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),sue(),n.root.parent=mr;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,nF(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,nF(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!==mr&&(i.left.parent=i),i.right!==mr&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,nF(n,i)),e.detach(),t.parent.left===t){const o=DTe(t),a=RTe(t);if(o!==t.parent.size_left||a!==t.parent.lf_left){const l=o-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=o,t.parent.lf_left=a,dC(n,t.parent,l,c)}}if(nF(n,t.parent),r){sue();return}let s;for(;t!==n.root&&t.color===0;)t===t.parent.left?(s=t.parent.right,s.color===1&&(s.color=0,t.parent.color=1,l6(n,t.parent),s=t.parent.right),s.left.color===0&&s.right.color===0?(s.color=1,t=t.parent):(s.right.color===0&&(s.left.color=0,s.color=1,c6(n,s),s=t.parent.right),s.color=t.parent.color,t.parent.color=0,s.right.color=0,l6(n,t.parent),t=n.root)):(s=t.parent.left,s.color===1&&(s.color=0,t.parent.color=1,c6(n,t.parent),s=t.parent.left),s.left.color===0&&s.right.color===0?(s.color=1,t=t.parent):(s.left.color===0&&(s.right.color=0,s.color=1,l6(n,s),s=t.parent.left),s.color=t.parent.color,t.parent.color=0,s.left.color=0,c6(n,t.parent),t=n.root));t.color=0,sue()}function LBe(n,e){for(nF(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,l6(n,e)),e.parent.color=0,e.parent.parent.color=1,c6(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,c6(n,e)),e.parent.color=0,e.parent.parent.color=1,l6(n,e.parent.parent))}n.root.color=0}function dC(n,e,t,i){for(;e!==n.root&&e!==mr;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function nF(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=DTe(e.left)-e.size_left,i=RTe(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 sC=65535;function Oct(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 obr{constructor(e,t,i,r,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=r,this.isBasicASCII=s}}function gC(n,e=!0){const t=[0];let i=1;for(let r=0,s=n.length;r<s;r++){const o=n.charCodeAt(r);o===13?r+1<s&&n.charCodeAt(r+1)===10?(t[i++]=r+2,r++):t[i++]=r+1:o===10&&(t[i++]=r+1)}return e?Oct(t):t}function abr(n,e){n.length=0,n[0]=0;let t=1,i=0,r=0,s=0,o=!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?(s++,n[t++]=l+2,l++):(i++,n[t++]=l+1):u===10?(r++,n[t++]=l+1):o&&u!==9&&(u<32||u>126)&&(o=!1)}const a=new obr(Oct(n),i,r,s,o);return n.length=0,a}class jf{constructor(e,t,i,r,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=r,this.length=s}}class S2{constructor(e,t){this.buffer=e,this.lineStarts=t}}class lbr{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==mr&&e.iterate(e.root,i=>(i!==mr&&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 cbr{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 s=i[r];if(s.node.parent===null||s.nodeStartOffset>=e){i[r]=null,t=!0;continue}}if(t){const r=[];for(const s of i)s!==null&&r.push(s);this._cache=r}}}class ubr{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new S2("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=mr,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let r=null;for(let s=0,o=e.length;s<o;s++)if(e[s].buffer.length>0){e[s].lineStarts||(e[s].lineStarts=gC(e[s].buffer));const a=new jf(s+1,{line:0,column:0},{line:e[s].lineStarts.length-1,column:e[s].buffer.length-e[s].lineStarts[e[s].lineStarts.length-1]},e[s].lineStarts.length-1,e[s].buffer.length);this._buffers.push(e[s]),r=this.rbInsertRight(r,a)}this._searchCache=new cbr(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=sC,i=t-Math.floor(t/3),r=i*2;let s="",o=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),u=c.length;if(o<=i||o+u<r)return s+=c,o+=u,!0;const d=s.replace(/\r\n|\r|\n/g,e);return a.push(new S2(d,gC(d))),s=c,o=u,!0}),o>0){const l=s.replace(/\r\n|\r|\n/g,e);a.push(new S2(l,gC(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 lbr(this,e)}getOffsetAt(e,t){let i=0,r=this.root;for(;r!==mr;)if(r.left!==mr&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){i+=r.size_left;const s=this.getAccumulatedValue(r,e-r.lf_left-2);return i+=s+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!==mr;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const s=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+s.index,s.index===0){const o=this.getOffsetAt(i+1,1),a=r-o;return new We(i+1,a+1)}return new We(i+1,s.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===mr){const s=this.getOffsetAt(i+1,1),o=r-e-s;return new We(i+1,o+1)}else t=t.right;return new We(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),s=this.getValueInRange2(i,r);return t?t!==this._EOL||!this._EOLNormalized?s.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?s:s.replace(/\r\n|\r|\n/g,t):s}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,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let o=r.substring(s+e.remainder,s+i.piece.length);for(i=i.next();i!==mr;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){o+=a.substring(l,l+t.remainder);break}else o+=a.substr(l,i.piece.length);i=i.next()}return o}getLinesContent(){const e=[];let t=0,i="",r=!1;return this.iterate(this.root,s=>{if(s===mr)return!0;const o=s.piece;let a=o.length;if(a===0)return!0;const l=this._buffers[o.bufferIndex].buffer,c=this._buffers[o.bufferIndex].lineStarts,u=o.start.line,d=o.end.line;let f=c[u]+o.start.column;if(r&&(l.charCodeAt(f)===10&&(f++,a--),e[t++]=i,i="",r=!1,a===0))return!0;if(u===d)return!this._EOLNormalized&&l.charCodeAt(f+a-1)===13?(r=!0,i+=l.substr(f,a-1)):i+=l.substr(f,a),!0;i+=this._EOLNormalized?l.substring(f,Math.max(f,c[u+1]-this._EOLLength)):l.substring(f,c[u+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let p=u+1;p<d;p++)i=this._EOLNormalized?l.substring(c[p],c[p+1]-this._EOLLength):l.substring(c[p],c[p+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return!this._EOLNormalized&&l.charCodeAt(c[d]+o.end.column-1)===13?(r=!0,o.end.column===0?t--:i=l.substr(c[d],o.end.column-1)):i=l.substr(c[d],o.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,s,o,a,l,c,u,d){const f=this._buffers[e.piece.bufferIndex],p=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,s),m=this.offsetInBuffer(e.piece.bufferIndex,o);let _;const v={line:0,column:0};let b,y;t._wordSeparators?(b=f.buffer.substring(g,m),y=C=>C+g,t.reset(0)):(b=f.buffer,y=C=>C,t.reset(g));do if(_=t.next(b),_){if(y(_.index)>=m)return u;this.positionInBuffer(e,y(_.index)-p,v);const C=this.getLineFeedCnt(e.piece.bufferIndex,s,v),S=v.line===s.line?v.column-s.column+r:v.column+1,k=S+_[0].length;if(d[u++]=v2(new ie(i+C,S,i+C,k),_,l),y(_.index)+_[0].length>=m||u>=c)return u}while(_);return u}findMatchesLineByLine(e,t,i,r){const s=[];let o=0;const a=new NR(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,o,s),s;let f=e.startLineNumber,p=l.node;for(;p!==c.node;){const m=this.getLineFeedCnt(p.piece.bufferIndex,u,p.piece.end);if(m>=1){const v=this._buffers[p.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(p.piece.bufferIndex,p.piece.start),y=v[u.line+m],C=f===e.startLineNumber?e.startColumn:1;if(o=this.findMatchesInNode(p,a,f,C,u,this.positionInBuffer(p,y-b),t,i,r,o,s),o>=r)return s;f+=m}const _=f===e.startLineNumber?e.startColumn-1:0;if(f===e.endLineNumber){const v=this.getLineContent(f).substring(_,e.endColumn-1);return o=this._findMatchesInLine(t,a,v,e.endLineNumber,_,o,s,i,r),s}if(o=this._findMatchesInLine(t,a,this.getLineContent(f).substr(_),f,_,o,s,i,r),o>=r)return s;f++,l=this.nodeAt2(f,1),p=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(f===e.endLineNumber){const m=f===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(f).substring(m,e.endColumn-1);return o=this._findMatchesInLine(t,a,_,e.endLineNumber,m,o,s,i,r),s}const g=f===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(c.node,a,f,g,u,d,t,i,r,o,s),s}_findMatchesInLine(e,t,i,r,s,o,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const f=e.simpleSearch,p=f.length,g=i.length;let m=-p;for(;(m=i.indexOf(f,m+p))!==-1;)if((!u||Pke(u,i,g,m,p))&&(a[o++]=new d7(new ie(r,m+1+s,r,m+1+p+s),null),o>=c))return o;return o}let d;t.reset(0);do if(d=t.next(i),d&&(a[o++]=v2(new ie(r,d.index+1+s,r,d.index+1+d[0].length+s),d,l),o>=c))return o;while(d);return o}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==mr){const{node:r,remainder:s,nodeStartOffset:o}=this.nodeAt(e),a=r.piece,l=a.bufferIndex,c=this.positionInBuffer(r,s);if(r.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&o+a.length===e&&t.length<sC){this.appendToNode(r,t),this.computeBufferMetadata();return}if(o===e)this.insertContentToNodeLeft(t,r),this._searchCache.validate(e);else if(o+r.piece.length>e){const u=[];let d=new jf(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,s)===10){const m={line:d.start.line+1,column:0};d=new jf(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,s-1)===13){const m=this.positionInBuffer(r,s-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 f=this.createNewPieces(t);d.length>0&&this.rbInsertRight(r,d);let p=r;for(let g=0;g<f.length;g++)p=this.rbInsertRight(p,f[g]);this.deleteNodes(u)}else this.insertContentToNodeRight(t,r)}else{const r=this.createNewPieces(t);let s=this.rbInsertLeft(null,r[0]);for(let o=1;o<r.length;o++)s=this.rbInsertRight(s,r[o])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===mr)return;const i=this.nodeAt(e),r=this.nodeAt(e+t),s=i.node,o=r.node;if(s===o){const f=this.positionInBuffer(s,i.remainder),p=this.positionInBuffer(s,r.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){const g=s.next();vW(this,s),this.validateCRLFWithPrevNode(g),this.computeBufferMetadata();return}this.deleteNodeHead(s,p),this._searchCache.validate(e),this.validateCRLFWithPrevNode(s),this.computeBufferMetadata();return}if(i.nodeStartOffset+s.piece.length===e+t){this.deleteNodeTail(s,f),this.validateCRLFWithNextNode(s),this.computeBufferMetadata();return}this.shrinkNode(s,f,p),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(s,i.remainder);this.deleteNodeTail(s,l),this._searchCache.validate(e),s.piece.length===0&&a.push(s);const c=this.positionInBuffer(o,r.remainder);this.deleteNodeHead(o,c),o.piece.length===0&&a.push(o);const u=s.next();for(let f=u;f!==mr&&f!==o;f=f.next())a.push(f);const d=s.piece.length===0?s.prev():s;this.deleteNodes(a),this.validateCRLFWithNextNode(d),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const o=t.piece,a={line:o.start.line+1,column:0},l=new jf(o.bufferIndex,a,o.end,this.getLineFeedCnt(o.bufferIndex,a,o.end),o.length-1);t.piece=l,e+=` `,dC(this,t,-1,-1),t.piece.length===0&&i.push(t)}const r=this.createNewPieces(e);let s=this.rbInsertLeft(t,r[r.length-1]);for(let o=r.length-2;o>=0;o--)s=this.rbInsertLeft(s,r[o]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` `);const i=this.createNewPieces(e),r=this.rbInsertRight(t,i[0]);let s=r;for(let o=1;o<i.length;o++)s=this.rbInsertRight(s,i[o]);this.validateCRLFWithPrevNode(r)}positionInBuffer(e,t,i){const r=e.piece,s=e.piece.bufferIndex,o=this._buffers[s].lineStarts,l=o[r.start.line]+r.start.column+t;let c=r.start.line,u=r.end.line,d=0,f=0,p=0;for(;c<=u&&(d=c+(u-c)/2|0,p=o[d],d!==u);)if(f=o[d+1],l<p)u=d-1;else if(l>=f)c=d+1;else break;return i?(i.line=d,i.column=l-p,null):{line:d,column:l-p}}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 s=r[i.line+1],o=r[i.line]+i.column;if(s>o+1)return i.line-t.line;const a=o-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++)vW(this,e[t])}createNewPieces(e){if(e.length>sC){const u=[];for(;e.length>sC;){const f=e.charCodeAt(sC-1);let p;f===13||f>=55296&&f<=56319?(p=e.substring(0,sC-1),e=e.substring(sC-1)):(p=e.substring(0,sC),e=e.substring(sC));const g=gC(p);u.push(new jf(this._buffers.length,{line:0,column:0},{line:g.length-1,column:p.length-g[g.length-1]},g.length-1,p.length)),this._buffers.push(new S2(p,g))}const d=gC(e);return u.push(new jf(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 S2(e,d)),u}let t=this._buffers[0].buffer.length;const i=gC(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 s=this._buffers[0].buffer.length,o=this._buffers[0].lineStarts.length-1,a=s-this._buffers[0].lineStarts[o],l={line:o,column:a},c=new jf(0,r,l,this.getLineFeedCnt(0,r,l),s-t);return this._lastChangeBufferPos=l,[c]}getLineRawContent(e,t=0){let i=this.root,r="";const s=this._searchCache.get2(e);if(s){i=s.node;const o=this.getAccumulatedValue(i,e-s.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(s.nodeStartLineNumber+i.piece.lineFeedCnt===e)r=a.substring(l+o,l+i.piece.length);else{const c=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return a.substring(l+o,l+c-t)}}else{let o=0;const a=e;for(;i!==mr;)if(i.left!==mr&&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 o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,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,o+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==mr;){const o=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+=o.substring(l,l+a-t),r}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);r+=o.substr(a,i.piece.length)}i=i.next()}return r}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==mr;)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),s=r.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const o=this.getLineFeedCnt(e.piece.bufferIndex,i.start,r);if(o!==s)return{index:o,remainder:0}}return{index:s,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,r=this._buffers[i.bufferIndex].lineStarts,s=i.start.line+t+1;return s>i.end.line?r[i.end.line]+i.end.column-r[i.start.line]-i.start.column:r[s]-r[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,r=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.end),o=t,a=this.offsetInBuffer(i.bufferIndex,o),l=this.getLineFeedCnt(i.bufferIndex,i.start,o),c=l-r,u=a-s,d=i.length+u;e.piece=new jf(i.bufferIndex,i.start,o,l,d),dC(this,e,u,c)}deleteNodeHead(e,t){const i=e.piece,r=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.start),o=t,a=this.getLineFeedCnt(i.bufferIndex,o,i.end),l=this.offsetInBuffer(i.bufferIndex,o),c=a-r,u=s-l,d=i.length+u;e.piece=new jf(i.bufferIndex,o,i.end,a,d),dC(this,e,u,c)}shrinkNode(e,t,i){const r=e.piece,s=r.start,o=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,s);e.piece=new jf(r.bufferIndex,r.start,c,u,d),dC(this,e,d-a,u-l);const f=new jf(r.bufferIndex,i,o,this.getLineFeedCnt(r.bufferIndex,i,o),this.offsetInBuffer(r.bufferIndex,o)-this.offsetInBuffer(r.bufferIndex,i)),p=this.rbInsertRight(e,f);this.validateCRLFWithPrevNode(p)}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 s=gC(t,!1);for(let p=0;p<s.length;p++)s[p]+=r;if(i){const p=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:r-p}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(s.slice(1));const o=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[o],l={line:o,column:a},c=e.piece.length+t.length,u=e.piece.lineFeedCnt,d=this.getLineFeedCnt(0,e.piece.start,l),f=d-u;e.piece=new jf(e.piece.bufferIndex,e.piece.start,l,d,c),this._lastChangeBufferPos=l,dC(this,e,t.length,f)}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!==mr;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){r+=t.size_left;const s={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(s),s}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!==mr;)if(i.left!==mr&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),o=this.getAccumulatedValue(i,e-i.lf_left-1);return r+=i.size_left,{node:i,remainder:Math.min(s+t-1,o),nodeStartOffset:r}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:r};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==mr;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),o=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:o}}else if(i.piece.length>=t-1){const s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}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===mr||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,s=i[r]+t.start.column;return r===i.length-1||i[r+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===mr||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 s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:r[e.piece.end.line]-r[e.piece.end.line-1]-1}:s={line:e.piece.end.line,column:e.piece.end.column-1};const o=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new jf(e.piece.bufferIndex,e.piece.start,s,a,o),dC(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 jf(t.piece.bufferIndex,l,t.piece.end,u,c),dC(this,t,-1,-1),t.piece.length===0&&i.push(t);const d=this.createNewPieces(`\r `);this.rbInsertRight(e,d[0]);for(let f=0;f<i.length;f++)vW(this,i[f])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+=` `,i.piece.length===1)vW(this,i);else{const r=i.piece,s={line:r.start.line+1,column:0},o=r.length-1,a=this.getLineFeedCnt(r.bufferIndex,s,r.end);i.piece=new jf(r.bufferIndex,s,r.end,a,o),dC(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===mr)return t(mr);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===mr)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,r=this.offsetInBuffer(i.bufferIndex,i.start),s=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(r,s)}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 pve(t,1);if(i.left=mr,i.right=mr,i.parent=mr,i.size_left=0,i.lf_left=0,this.root===mr)this.root=i,i.color=0;else if(e.right===mr)e.right=i,i.parent=e;else{const s=NTe(e.right);s.left=i,i.parent=s}return LBe(this,i),i}rbInsertLeft(e,t){const i=new pve(t,1);if(i.left=mr,i.right=mr,i.parent=mr,i.size_left=0,i.lf_left=0,this.root===mr)this.root=i,i.color=0;else if(e.left===mr)e.left=i,i.parent=e;else{const r=Pct(e.left);r.right=i,i.parent=r}return LBe(this,i),i}}class VP extends Ye{constructor(e,t,i,r,s,o,a){super(),this._onDidChangeContent=this._register(new Ue),this._BOM=t,this._mightContainNonBasicASCII=!o,this._mightContainRTL=r,this._mightContainUnusualLineTerminators=s,this._pieceTree=new ubr(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),s=this.getPositionAt(i);return new ie(r.lineNumber,r.column,s.lineNumber,s.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 s=0;const o=this._getEndOfLine(t),a=this.getEOL();if(o.length!==a.length){const l=o.length-a.length,c=e.endLineNumber-e.startLineNumber;s=l*c}return r-i+s}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const r=e.startLineNumber,s=e.endLineNumber;for(let o=r;o<=s;o++){const a=this.getLineContent(o),l=o===r?e.startColumn-1:0,c=o===s?e.endColumn-1:a.length;for(let u=l;u<c;u++)Ec(a.charCodeAt(u))?(i=i+1,u=u+1):i=i+1}return i+=this._getEndOfLine(t).length*(s-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=Yd(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Lb(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,s=this._mightContainUnusualLineTerminators,o=this._mightContainNonBasicASCII,a=!0,l=[];for(let m=0;m<e.length;m++){const _=e[m];a&&_._isTracked&&(a=!1);const v=_.range;if(_.text){let k=!0;o||(k=!U9(_.text),o=k),!r&&k&&(r=sM(_.text)),!s&&k&&(s=Iot(_.text))}let b="",y=0,C=0,S=0;if(_.text){let k;[y,C,S,k]=ek(_.text);const I=this.getEOL();k===0||k===(I===`\r `?2:1)?b=_.text:b=_.text.replace(/\r\n|\r|\n/g,I)}l[m]={sortIndex:m,identifier:_.identifier||null,range:v,rangeOffset:this.getOffsetAt(v.startLineNumber,v.startColumn),rangeLength:this.getValueLengthInRange(v),text:b,eolCount:y,firstLineLength:C,lastLineLength:S,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(VP._sortOpsAscending);let c=!1;for(let m=0,_=l.length-1;m<_;m++){const v=l[m].range.getEndPosition(),b=l[m+1].range.getStartPosition();if(b.isBeforeOrEqual(v)){if(b.isBefore(v))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const u=i||t?VP._getInverseEditRanges(l):[],d=[];if(t)for(let m=0;m<l.length;m++){const _=l[m],v=u[m];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let b=v.startLineNumber;b<=v.endLineNumber;b++){let y="";b===v.startLineNumber&&(y=this.getLineContent(_.range.startLineNumber),Yd(y)!==-1)||d.push({lineNumber:b,oldContent:y})}}let f=null;if(i){let m=0;f=[];for(let _=0;_<l.length;_++){const v=l[_],b=u[_],y=this.getValueInRange(v.range),C=v.rangeOffset+m;m+=v.text.length-y.length,f[_]={sortIndex:v.sortIndex,identifier:v.identifier,range:b,text:y,textChange:new Pu(v.rangeOffset,y,C,v.text)}}c||f.sort((_,v)=>_.sortIndex-v.sortIndex)}this._mightContainRTL=r,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=o;const p=this._doApplyEdits(l);let g=null;if(t&&d.length>0){d.sort((m,_)=>_.lineNumber-m.lineNumber),g=[];for(let m=0,_=d.length;m<_;m++){const v=d[m].lineNumber;if(m>0&&d[m-1].lineNumber===v)continue;const b=d[m].oldContent,y=this.getLineContent(v);y.length===0||y===b||Yd(y)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new Cur(f,p,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,s=new ie(i.startLineNumber,i.startColumn,r.endLineNumber,r.endColumn);let o=i.startLineNumber,a=i.startColumn;const l=[];for(let p=0,g=e.length;p<g;p++){const m=e[p],_=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new ie(o,a,_.startLineNumber,_.startColumn))),m.text.length>0&&l.push(m.text),o=_.endLineNumber,a=_.endColumn}const c=l.join(""),[u,d,f]=ek(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:u,firstLineLength:d,lastLineLength:f,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(VP._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const r=e[i],s=r.range.startLineNumber,o=r.range.startColumn,a=r.range.endLineNumber,l=r.range.endColumn;if(s===a&&o===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 ie(s,o,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,s=null;for(let o=0,a=e.length;o<a;o++){const l=e[o];let c,u;s?s.range.endLineNumber===l.range.startLineNumber?(c=i,u=r+(l.range.startColumn-s.range.endColumn)):(c=i+(l.range.startLineNumber-s.range.endLineNumber),u=l.range.startColumn):(c=l.range.startLineNumber,u=l.range.startColumn);let d;if(l.text.length>0){const f=l.eolCount+1;f===1?d=new ie(c,u,c,u+l.firstLineLength):d=new ie(c,u,c+f-1,l.lastLineLength+1)}else d=new ie(c,u,c,u);i=d.endLineNumber,r=d.endColumn,t.push(d),s=l}return t}static _sortOpsAscending(e,t){const i=ie.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=ie.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class dbr{constructor(e,t,i,r,s,o,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=r,this._crlf=s,this._containsRTL=o,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 s=0,o=i.length;s<o;s++){const a=i[s].buffer.replace(/\r\n|\r|\n/g,t),l=gC(a);i[s]=new S2(a,l)}const r=new VP(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:r,disposable:r}}}class Mct{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&&bke(e)&&(this.BOM=dar,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=abr(this._tmpLineStarts,e);this.chunks.push(new S2(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=sM(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Iot(e)))}finish(e=!0){return this._finish(),new dbr(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=gC(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class hbr{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),s=this._store.slice(e+t),o=fbr(i,this._default);this._store=r.concat(o,s)}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=Vee(this._store,e,i)}}function fbr(n,e){const t=[];for(let i=0;i<n;i++)t[i]=e;return t}class pbr{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 gve{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 pbr(e,[t]))}finalize(){return this._tokens}}class gbr{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new mve(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class mbr extends gbr{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 s=this._textModel.getLineContent(r.lineNumber),o=vj(this._languageIdCodec,i,this.tokenizationSupport,s,!0,r.startState);e.add(r.lineNumber,o.tokens),this.store.setEndState(r.lineNumber,o.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const r=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),o=s.substring(0,e.column-1)+t+s.substring(e.column-1),a=vj(this._languageIdCodec,r,this.tokenizationSupport,o,!0,i),l=new Xc(a.tokens,o,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,s=e.column,o=this.getStartState(r);if(!o)return null;const a=this._textModel.getLineContent(r),l=a.substring(0,s-1)+i+a.substring(s-1+t),c=this._textModel.getLanguageIdAtPosition(r,0),u=vj(this._languageIdCodec,c,this.tokenizationSupport,l,!0,o);return new Xc(u.tokens,l,this._languageIdCodec)}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e<t}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 s=this._textModel.getLanguageId();for(let o=t;o<=i;o++){const a=this._textModel.getLineContent(o),l=vj(this._languageIdCodec,s,this.tokenizationSupport,a,!0,r);e.add(o,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 s=this._textModel.getLanguageId();let o=r;for(const a of i)o=vj(this._languageIdCodec,s,this.tokenizationSupport,a,!1,o).endState;return o}}class mve{constructor(e){this.lineCount=e,this._tokenizationStateStore=new _br,this._invalidEndStatesLineNumbers=new vbr,this._invalidEndStatesLineNumbers.addRange(new Pr(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){if(!t)throw new Ps("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 Pr(e+1,e+2)),i}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new Pr(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(const t of e){const[i]=ek(t.text);this.acceptChange(new fr(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new Pr(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 Ps("Start state must be defined");return{lineNumber:t,startState:i}}}class _br{constructor(){this._lineEndStates=new hbr(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 vbr{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 Pr(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Pr(i.start,e):this._ranges.splice(t,1,new Pr(i.start,e),new Pr(e+1,i.endExclusive))}}addRange(e){Pr.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 s=t-e.length;for(let o=r;o<this._ranges.length;o++)this._ranges[o]=this._ranges[o].delta(s);if(i===r){const o=new Pr(e.start,e.start+t);o.isEmpty||this._ranges.splice(i,0,o)}else{const o=Math.min(e.start,this._ranges[i].start),a=Math.max(e.endExclusive,this._ranges[r-1].endExclusive),l=new Pr(o,a+s);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 vj(n,e,t,i,r,s){let o=null;if(t)try{o=t.tokenizeEncoded(i,r,s.clone())}catch(a){tr(a)}return o||(o=Ate(n.encodeLanguageId(e),s)),Xc.convertToEndOffset(o.tokens,i.length),o}class bbr{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,Oot(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?eot(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new gve,i=Qc.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 i;const t=(i=this._tokenizerWithStateStore)==null?void 0:i.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new fr(e,t))}}class ybr{constructor(){this._onDidChangeVisibleRanges=new Ue,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Cbr(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 Cbr{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(r=>new fr(r.startLineNumber,r.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class wbr extends Ye{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new ao(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){fa(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 jct extends Ye{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t,i){super(),this._languageIdCodec=e,this._textModel=t,this.getLanguageId=i,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new Ue),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._onDidChangeTokens=this._register(new Ue),this.onDidChangeTokens=this._onDidChangeTokens.event}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}}class ABe extends jct{constructor(e,t,i,r){super(t,i,r),this._treeSitterService=e,this._tokenizationSupport=null,this._initialize()}_initialize(){const e=this.getLanguageId();(!this._tokenizationSupport||this._lastLanguageId!==e)&&(this._lastLanguageId=e,this._tokenizationSupport=Nge.get(e))}getLineTokens(e){const t=this._textModel.getLineContent(e);if(this._tokenizationSupport){const i=this._tokenizationSupport.tokenizeEncoded(e,this._textModel);if(i)return new Xc(i,t,this._languageIdCodec)}return Xc.createEmpty(t,this._languageIdCodec)}resetTokenization(e=!0){e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]}),this._initialize()}handleDidChangeAttached(){}handleDidChangeContent(e){e.isFlush&&this.resetTokenization(!1)}forceTokenization(e){}hasAccurateTokensForLine(e){return!0}isCheapToTokenize(e){return!0}getTokenTypeIfInsertingCharacter(e,t,i){return 0}tokenizeLineWithEdit(e,t,i){return null}get hasTokens(){return this._treeSitterService.getParseResult(this._textModel)!==void 0}}const Fct=Ur("treeSitterParserService"),mC=new Uint32Array(0).buffer;class Z0{static deleteBeginning(e,t){return e===null||e===mC?e:Z0.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===mC)return e;const i=PC(e),r=i[i.length-2];return Z0.delete(e,t,r)}static delete(e,t,i){if(e===null||e===mC||t===i)return e;const r=PC(e),s=r.length>>>1;if(t===0&&r[r.length-2]===i)return mC;const o=Xc.findIndexInTokensArray(r,t),a=o>0?r[o-1<<1]:0,l=r[o<<1];if(i<l){const p=i-t;for(let g=o;g<s;g++)r[g<<1]-=p;return e}let c,u;a!==t?(r[o<<1]=t,c=o+1<<1,u=t):(c=o<<1,u=a);const d=i-t;for(let p=o+1;p<s;p++){const g=r[p<<1]-d;g>u&&(r[c++]=g,r[c++]=r[(p<<1)+1],u=g)}if(c===r.length)return e;const f=new Uint32Array(c);return f.set(r.subarray(0,c),0),f.buffer}static append(e,t){if(t===mC)return e;if(e===mC)return t;if(e===null)return e;if(t===null)return null;const i=PC(e),r=PC(t),s=r.length>>>1,o=new Uint32Array(i.length+r.length);o.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c<s;c++)o[a++]=r[c<<1]+l,o[a++]=r[(c<<1)+1];return o.buffer}static insert(e,t,i){if(e===null||e===mC)return e;const r=PC(e),s=r.length>>>1;let o=Xc.findIndexInTokensArray(r,t);o>0&&r[o-1<<1]===t&&o--;for(let a=o;a<s;a++)r[a<<1]+=i;return e}}function PC(n){return n instanceof Uint32Array?n:new Uint32Array(n)}class M7{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!==mC)return new Xc(PC(r),i,this._languageIdCodec);const s=new Uint32Array(2);return s[0]=i.length,s[1]=NBe(this._languageIdCodec.encodeLanguageId(e)),new Xc(s,i,this._languageIdCodec)}static _massageTokens(e,t,i){const r=i?PC(i):null;if(t===0){let s=!1;if(r&&r.length>1&&(s=rf.getLanguageId(r[1])!==e),!s)return mC}if(!r||r.length===0){const s=new Uint32Array(2);return s[0]=t,s[1]=NBe(e),s.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=Vee(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,r,s){const o=M7._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,r);this._ensureLine(t);const a=this._lineTokens[t];return this._lineTokens[t]=o,s?!M7._equals(a,o):!1}static _equals(e,t){if(!e||!t)return!e&&!t;const i=PC(e),r=PC(t);if(i.length!==r.length)return!1;for(let s=0,o=i.length;s<o;s++)if(i[s]!==r[s])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new We(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]=Z0.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Z0.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let r=null;i<this._len&&(r=Z0.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=Z0.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]=Z0.insert(this._lineTokens[r],e.column-1,i);return}this._lineTokens[r]=Z0.deleteEnding(this._lineTokens[r],e.column-1),this._lineTokens[r]=Z0.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,s=e.length;r<s;r++){const o=e[r];let a=0,l=0,c=!1;for(let u=o.startLineNumber;u<=o.endLineNumber;u++)c?(this.setTokens(t.getLanguageId(),u-1,t.getLineLength(u),o.getLineTokens(u),!1),l=u):this.setTokens(t.getLanguageId(),u-1,t.getLineLength(u),o.getLineTokens(u),!0)&&(c=!0,a=u,l=u);c&&i.push({fromLineNumber:a,toLineNumber:l})}return{changes:i}}}function NBe(n){return(n<<0|0|0|32768|2<<24|1024)>>>0}class PTe{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 s=t[0].getRange(),o=t[t.length-1].getRange();if(!s||!o)return e;i=e.plusRange(s).plusRange(o)}let r=null;for(let s=0,o=this._pieces.length;s<o;s++){const a=this._pieces[s];if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){r=r||{index:s};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(s,1),s--,o--;continue}if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){r=r||{index:s};continue}const[l,c]=a.split(i);if(l.isEmpty()){r=r||{index:s};continue}c.isEmpty()||(this._pieces.splice(s,1,l,c),s++,o++,r=r||{index:s})}return r=r||{index:this._pieces.length},t.length>0&&(this._pieces=Vee(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=PTe._findFirstPieceWithLine(i,e),s=i[r].getLineTokens(e);if(!s)return t;const o=t.getCount(),a=s.getCount();let l=0;const c=[];let u=0,d=0;const f=(p,g)=>{p!==d&&(d=p,c[u++]=p,c[u++]=g)};for(let p=0;p<a;p++){const g=s.getStartCharacter(p),m=s.getEndCharacter(p),_=s.getMetadata(p),v=((_&1?2048:0)|(_&2?4096:0)|(_&4?8192:0)|(_&8?16384:0)|(_&16?16744448:0)|(_&32?4278190080:0))>>>0,b=~v>>>0;for(;l<o&&t.getEndOffset(l)<=g;)f(t.getEndOffset(l),t.getMetadata(l)),l++;for(l<o&&t.getStartOffset(l)<g&&f(g,t.getMetadata(l));l<o&&t.getEndOffset(l)<m;)f(t.getEndOffset(l),t.getMetadata(l)&b|_&v),l++;if(l<o)f(m,t.getMetadata(l)&b|_&v),t.getEndOffset(l)===m&&l++;else{const y=Math.min(Math.max(0,l-1),o-1);f(m,t.getMetadata(y)&b|_&v)}}for(;l<o;)f(t.getEndOffset(l),t.getMetadata(l)),l++;return new Xc(new Uint32Array(c),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,r=e.length-1;for(;i<r;){let s=i+Math.floor((r-i)/2);if(e[s].endLineNumber<t)i=s+1;else if(e[s].startLineNumber>t)r=s-1;else{for(;s>i&&e[s-1].startLineNumber<=t&&t<=e[s-1].endLineNumber;)s--;return s}}return i}acceptEdit(e,t,i,r,s){for(const o of this._pieces)o.acceptEdit(e,t,i,r,s)}}var xbr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},oue=function(n,e){return function(t,i){e(t,i,n)}},fU;let _ve=fU=class extends Ict{constructor(e,t,i,r,s,o,a){super(),this._textModel=e,this._bracketPairsTextModelPart=t,this._languageId=i,this._attachedViews=r,this._languageService=s,this._languageConfigurationService=o,this._treeSitterService=a,this._semanticTokens=new PTe(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new Ue),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new Ue),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new Ue),this.onDidChangeTokens=this._onDidChangeTokens.event,this._tokensDisposables=this._register(new Et),this._register(this._languageConfigurationService.onDidChange(l=>{l.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(rn.filter(Nge.onDidChange,l=>l.changedLanguages.includes(this._languageId))(()=>{this.createPreferredTokenProvider()})),this.createPreferredTokenProvider()}createGrammarTokens(){return this._register(new DBe(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews))}createTreeSitterTokens(){return this._register(new ABe(this._treeSitterService,this._languageService.languageIdCodec,this._textModel,()=>this._languageId))}createTokens(e){var i;const t=this._tokens!==void 0;(i=this._tokens)==null||i.dispose(),this._tokens=e?this.createTreeSitterTokens():this.createGrammarTokens(),this._tokensDisposables.clear(),this._tokensDisposables.add(this._tokens.onDidChangeTokens(r=>{this._emitModelTokensChangedEvent(r)})),this._tokensDisposables.add(this._tokens.onDidChangeBackgroundTokenizationState(r=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})),t&&this._tokens.resetTokenization()}createPreferredTokenProvider(){Nge.get(this._languageId)?this._tokens instanceof ABe||this.createTokens(!0):this._tokens instanceof DBe||this.createTokens(!1)}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,r,s]=ek(t.text);this._semanticTokens.acceptEdit(t.range,i,r,s,t.text.length>0?t.text.charCodeAt(0):0)}this._tokens.handleDidChangeContent(e)}handleDidChangeAttached(){this._tokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this._tokens.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 Ps("Illegal value for lineNumber")}get hasTokens(){return this._tokens.hasTokens}resetTokenization(){this._tokens.resetTokenization()}get backgroundTokenizationState(){return this._tokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this._tokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this._tokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this._tokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this._tokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this._tokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this._tokens.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),s=r.findTokenIndexAtOffset(t.column-1),[o,a]=fU._findLanguageBoundaries(r,s),l=e7(t.column,this.getLanguageConfiguration(r.getLanguageId(s)).getWordDefinition(),i.substring(o,a),o);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(s>0&&o===t.column-1){const[c,u]=fU._findLanguageBoundaries(r,s-1),d=e7(t.column,this.getLanguageConfiguration(r.getLanguageId(s-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 o=t;o>=0&&e.getLanguageId(o)===i;o--)r=e.getStartOffset(o);let s=e.getLineContent().length;for(let o=t,a=e.getCount();o<a&&e.getLanguageId(o)===i;o++)s=e.getEndOffset(o);return[r,s]}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 We(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._tokens.resetTokenization(),this.createPreferredTokenProvider(),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}};_ve=fU=xbr([oue(4,pa),oue(5,wa),oue(6,Fct)],_ve);class DBe extends jct{constructor(e,t,i,r){super(e,t,i),this._tokenizer=null,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new Dc),this._tokens=new M7(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new Dc),this._attachedViewStates=this._register(new lke),this._register(Ka.onDidChange(s=>{const o=this.getLanguageId();s.changedLanguages.indexOf(o)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(r.onDidChangeVisibleRanges(({view:s,state:o})=>{if(o){let a=this._attachedViewStates.get(s);a||(a=new wbr(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(s,a)),a.handleStateChange(o)}else this._attachedViewStates.deleteAndDispose(s)}))}resetTokenization(e=!0){var s;this._tokens.flush(),(s=this._debugBackgroundTokens)==null||s.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new mve(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const t=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const o=Ka.get(this.getLanguageId());if(!o)return[null,null];let a;try{a=o.getInitialState()}catch(l){return tr(l),[null,null]}return[o,a]},[i,r]=t();if(i&&r?this._tokenizer=new mbr(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const o={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var u;if(!this._tokenizer)return;const c=this._tokenizer.store.getFirstInvalidEndStateLineNumber();c!==null&&a>=c&&((u=this._tokenizer)==null||u.store.setEndState(a,l))}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,o)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new bbr(this._tokenizer,o),this._defaultBackgroundTokenizer.handleChanges()),i!=null&&i.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new M7(this._languageIdCodec),this._debugBackgroundStates=new mve(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)==null||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)==null||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.handleChanges()}handleDidChangeContent(e){var t,i,r;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const s of e.changes){const[o,a]=ek(s.text);this._tokens.acceptEdit(s.range,o,a),(t=this._debugBackgroundTokens)==null||t.acceptEdit(s.range,o,a)}(i=this._debugBackgroundStates)==null||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(r=this._defaultBackgroundTokenizer)==null||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=fr.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 o,a;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new gve,{heuristicTokens:r}=this._tokenizer.tokenizeHeuristically(i,e,t),s=this.setTokens(i.finalize());if(r)for(const l of s.changes)(o=this._backgroundTokenizer.value)==null||o.requestTokens(l.fromLineNumber,l.toLineNumber+1);(a=this._defaultBackgroundTokenizer)==null||a.checkFinished()}forceTokenization(e){var i,r;const t=new gve;(i=this._tokenizer)==null||i.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),(r=this._defaultBackgroundTokenizer)==null||r.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}getLineTokens(e){var r;const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const s=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(s)&&((r=this._debugBackgroundTokenizer.value)!=null&&r.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const r=this._textModel.validatePosition(new We(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 Sbr{constructor(){this.changeType=1}}class Hb{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",r=0;for(const s of t)i+=e.substring(r,s.column-1),r=s.column-1,i+=s.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 Hb(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new Hb(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,s){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=r,this.order=s}}class RBe{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Ebr{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class kbr{constructor(e,t,i,r){this.changeType=4,this.injectedTexts=r,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Tbr{constructor(){this.changeType=5}}class WP{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,s=e.isUndoing||t.isUndoing,o=e.isRedoing||t.isRedoing;return new WP(i,r,s,o)}}class Bct{constructor(e){this.changes=e}}class pI{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=WP.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=pI._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new pI(t,i)}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),r=t.eol,s=t.versionId,o=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:s,isUndoing:o,isRedoing:a,isFlush:l}}}var Ibr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},bW=function(n,e){return function(t,i){e(t,i,n)}},s2;function Lbr(n){const e=new Mct;return e.acceptChunk(n),e.finish()}function Abr(n){const e=new Mct;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function PBe(n,e){let t;return typeof n=="string"?t=Lbr(n):bur(n)?t=Abr(n):t=n,t.create(e)}let yW=0;const Nbr=999,Dbr=1e4;class Rbr{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 bj=()=>{throw new Error("Invalid change accessor")};var lb;let yb=(lb=class extends Ye{static resolveOptions(e,t){if(t.detectIndentation){const i=wBe(e,t.tabSize,t.insertSpaces);return new iU({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new iU(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 U_(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,s,o,a,l){super(),this._undoRedoService=s,this._languageService=o,this._languageConfigurationService=a,this.instantiationService=l,this._onWillDispose=this._register(new Ue),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Bbr(g=>this.handleBeforeFireDecorationsChangedEvent(g))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new Ue),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new Ue),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new Ue),this._eventEmitter=this._register(new $br),this._languageSelectionListener=this._register(new Dc),this._deltaDecorationCallCnt=0,this._attachedViews=new ybr,yW++,this.id="$model"+yW,this.isForSimpleWidget=i.isForSimpleWidget,typeof r>"u"||r===null?this._associatedResource=vi.parse("inmemory://model/"+yW):this._associatedResource=r,this._attachedEditorCount=0;const{textBuffer:c,disposable:u}=PBe(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=u,this._options=s2.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Bvr(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new zvr(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Hvr(this)),this._tokenizationTextModelPart=this.instantiationService.createInstance(_ve,this,this._bracketPairs,d,this._attachedViews);const f=this._buffer.getLineCount(),p=this._buffer.getValueLengthInRange(new ie(1,1,f,this._buffer.getLineLength(f)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=p>s2.LARGE_FILE_SIZE_THRESHOLD||f>s2.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=p>s2.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=p>s2._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Lot(yW),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new OBe,this._commandManager=new ATe(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(d),this._register(this._languageConfigurationService.onDidChange(g=>{this._bracketPairs.handleLanguageConfigurationServiceChange(g),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(g)}))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new VP([],"",` `,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Ye.None}_assertNotDisposed(){if(this._isDisposed)throw new Ps("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new pI(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Sm();const{textBuffer:t,disposable:i}=PBe(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,r,s,o,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:r}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:s,isRedoing:o,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),r=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new OBe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new WP([new Sbr],this._versionId,!1,!1),this._createContentChanged2(new ie(1,1,s,o),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),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new WP([new Tbr],this._versionId,!1,!1),this._createContentChanged2(new ie(1,1,s,o),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 s=t[i],o=s.range,a=s.cachedAbsoluteStart-s.start,l=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),c=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);s.cachedAbsoluteStart=l,s.cachedAbsoluteEnd=c,s.cachedVersionId=e,s.start=l-a,s.end=c-a,ik(s)}}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 s=this._buffer.getLineLength(r);s>=Dbr?t+=s:e+=s}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,s=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new iU({tabSize:t,indentSize:i,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:o});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=wBe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),ETe(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(Tot.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 Ps("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 Rbr(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 Ps("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ps("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ps("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 Ps("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ps("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ps("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,r=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),o=Math.floor(typeof r=="number"&&!isNaN(r)?r:1);if(s<1)s=1,o=1;else if(s>t)s=t,o=this.getLineMaxColumn(s);else if(o<=1)o=1;else{const d=this.getLineMaxColumn(s);o>=d&&(o=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===s&&r===o&&a===c&&l===u&&e instanceof ie&&!(e instanceof Yn)?e:new ie(s,o,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 s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){const o=this._buffer.getLineCharCode(e,t-2);if(Ec(o))return!1}return!0}_validatePosition(e,t,i){const r=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),o=this._buffer.getLineCount();if(r<1)return new We(1,1);if(r>o)return new We(o,this.getLineMaxColumn(o));if(s<=1)return new We(r,1);const a=this.getLineMaxColumn(r);if(s>=a)return new We(r,a);if(i===1){const l=this._buffer.getLineCharCode(r,s-2);if(Ec(l))return new We(r,s-1)}return new We(r,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof We&&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,s=e.endLineNumber,o=e.endColumn;if(!this._isValidPosition(i,r,0)||!this._isValidPosition(s,o,0))return!1;if(t===1){const a=r>1?this._buffer.getLineCharCode(i,r-2):0,l=o>1&&o<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,o-2):0,c=Ec(a),u=Ec(l);return!c&&!u}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof ie&&!(e instanceof Yn)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),r=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,o=i.column,a=r.lineNumber,l=r.column;{const c=o>1?this._buffer.getLineCharCode(s,o-2):0,u=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,d=Ec(c),f=Ec(u);return!d&&!f?new ie(s,o,a,l):s===a&&o===l?new ie(s,o-1,a,l-1):d&&f?new ie(s,o-1,a,l+1):d?new ie(s,o-1,a,l):new ie(s,o,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 ie(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,r){return this._buffer.findMatchesLineByLine(e,t,i,r)}findMatches(e,t,i,r,s,o,a=Nbr){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>ie.isIRange(d))&&(l=t.map(d=>this.validateRange(d)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((d,f)=>d.startLineNumber-f.startLineNumber||d.startColumn-f.startColumn);const c=[];c.push(l.reduce((d,f)=>ie.areIntersecting(d,f)?d.plusRange(f):(c.push(d),f)));let u;if(!i&&e.indexOf(` `)<0){const f=new r2(e,i,r,s).parseSearchRequest();if(!f)return[];u=p=>this.findMatchesLineByLine(p,f,o,a)}else u=d=>eW.findMatches(this,new r2(e,i,r,s),d,o,a);return c.map(u).reduce((d,f)=>d.concat(f),[])}findNextMatch(e,t,i,r,s,o){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` `)<0){const c=new r2(e,i,r,s).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new ie(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),f=this.findMatchesLineByLine(d,c,o,1);return eW.findNextMatch(this,new r2(e,i,r,s),a,o),f.length>0||(d=new ie(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),f=this.findMatchesLineByLine(d,c,o,1),f.length>0)?f[0]:null}return eW.findNextMatch(this,new r2(e,i,r,s),a,o)}findPreviousMatch(e,t,i,r,s,o){this._assertNotDisposed();const a=this.validatePosition(t);return eW.findPreviousMatch(this,new r2(e,i,r,s),a,o)}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 Rce?e:new Rce(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 s=t.map(a=>({range:this.validateRange(a.range),text:a.text}));let o=!0;if(e)for(let a=0,l=e.length;a<l;a++){const c=e[a];let u=!1;for(let d=0,f=s.length;d<f;d++){const p=s[d].range,g=p.startLineNumber>c.endLineNumber,m=c.startLineNumber>p.endLineNumber;if(!g&&!m){u=!0;break}}if(!u){o=!1;break}}if(o)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 f=0,p=s.length;f<p;f++){const g=s[f].range,m=s[f].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 f=new ie(c,1,c,u);t.push(new Rce(null,f,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 s=e.map(o=>{const a=this.getPositionAt(o.newPosition),l=this.getPositionAt(o.newEnd);return{range:new ie(a.lineNumber,a.column,l.lineNumber,l.column),text:o.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,r)}_applyRedo(e,t,i,r){const s=e.map(o=>{const a=this.getPositionAt(o.oldPosition),l=this.getPositionAt(o.oldEnd);return{range:new ie(a.lineNumber,a.column,l.lineNumber,l.column),text:o.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,r)}_applyUndoRedoEdits(e,t,i,r,s,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=r,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),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),s=this._buffer.getLineCount(),o=r.changes;if(this._trimAutoWhitespaceLines=r.trimAutoWhitespaceLineNumbers,o.length!==0){for(let c=0,u=o.length;c<u;c++){const d=o[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=o.length;c<u;c++){const d=o[c],[f]=ek(d.text);this._onDidChangeDecorations.fire();const p=d.range.startLineNumber,g=d.range.endLineNumber,m=g-p,_=f,v=Math.min(m,_),b=_-m,y=s-l-b+p,C=y,S=y+_,k=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new We(C,1)),this.getOffsetAt(new We(S,this.getLineMaxColumn(S))),0),I=Hb.fromDecorations(k),L=new Lw(I);for(let N=v;N>=0;N--){const P=p+N,O=y+N;L.takeFromEndWhile(V=>V.lineNumber>O);const F=L.takeFromEndWhile(V=>V.lineNumber===O);a.push(new RBe(P,this.getLineContent(O),F))}if(v<m){const N=p+v;a.push(new Ebr(N+1,g))}if(v<_){const N=new Lw(I),P=p+v,O=_-v,F=s-l-O+P+1,V=[],M=[];for(let B=0;B<O;B++){const W=F+B;M[B]=this.getLineContent(W),N.takeWhile(q=>q.lineNumber<W),V[B]=N.takeWhile(q=>q.lineNumber===W)}a.push(new kbr(P+1,p+_,M,V))}l+=b}this._emitContentChangedEvent(new WP(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,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 RBe(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new Bct(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:(s,o)=>this._deltaDecorationsImpl(e,[],[{range:s,options:o}])[0],changeDecoration:(s,o)=>{this._changeDecorationImpl(s,o)},changeDecorationOptions:(s,o)=>{this._changeDecorationOptionsImpl(s,jBe(o))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,o)=>s.length===0&&o.length===0?[]:this._deltaDecorationsImpl(e,s,o)};let r=null;try{r=t(i)}catch(s){tr(s)}return i.addDecoration=bj,i.changeDecoration=bj,i.changeDecorationOptions=bj,i.removeDecoration=bj,i.deltaDecorations=bj,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."),tr(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:MBe[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(r),delete this._decorations[r.id],null;const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),a=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);return this._decorationsTree.delete(r),r.reset(this.getVersionId(),o,a,s),r.setOptions(MBe[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 s=t[i];this._decorationsTree.delete(s),delete this._decorations[s.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,s=!1){const o=this.getLineCount(),a=Math.min(o,Math.max(1,e)),l=Math.min(o,Math.max(1,t)),c=this.getLineMaxColumn(l),u=new ie(a,1,l,c),d=this._getDecorationsInRange(u,i,r,s);return mge(d,this._decorationProvider.getDecorationsInRange(u,i,r)),d}getDecorationsInRange(e,t=0,i=!1,r=!1,s=!1){const o=this.validateRange(e),a=this._getDecorationsInRange(o,t,i,s);return mge(a,this._decorationProvider.getDecorationsInRange(o,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 Hb.fromDecorations(r).filter(s=>s.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 s=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,s,o,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),s=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),o=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),s,o,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),s=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(i.options.before||t.before){const l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}const o=r!==s,a=Obr(t)!==pU(i);o||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,r=!1){const s=this.getVersionId(),o=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const u=new Array(l);for(;a<o||c<l;){let d=null;if(a<o){do d=this._decorations[t[a++]];while(!d&&a<o);if(d){if(d.options.after){const f=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.endLineNumber)}if(d.options.before){const f=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.startLineNumber)}this._decorationsTree.delete(d),r||this._onDidChangeDecorations.checkAffectedAndFire(d.options)}}if(c<l){if(!d){const v=++this._lastDecorationId,b=`${this._instanceId};${v}`;d=new Dct(b,0,0),this._decorations[b]=d}const f=i[c],p=this._validateRangeRelaxedNoAllocations(f.range),g=jBe(f.options),m=this._buffer.getOffsetAt(p.startLineNumber,p.startColumn),_=this._buffer.getOffsetAt(p.endLineNumber,p.endColumn);d.ownerId=e,d.reset(s,m,_,p),d.setOptions(g),d.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(p.endLineNumber),d.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(p.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 Pbr(this.getLineContent(e))+1}},s2=lb,lb._MODEL_SYNC_LIMIT=50*1024*1024,lb.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,lb.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,lb.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,lb.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:id.tabSize,indentSize:id.indentSize,insertSpaces:id.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:id.trimAutoWhitespace,largeFileOptimizations:id.largeFileOptimizations,bracketPairColorizationOptions:id.bracketPairColorizationOptions},lb);yb=s2=Ibr([bW(4,Hke),bW(5,pa),bW(6,wa),bW(7,mi)],yb);function Pbr(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function aue(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function Obr(n){return!!n.after||!!n.before}function pU(n){return!!n.options.after||!!n.options.before}class OBe{constructor(){this._decorationsTree0=new iue,this._decorationsTree1=new iue,this._injectedTextDecorationsTree=new iue}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,s,o){const a=e.getVersionId(),l=this._intervalSearch(t,i,r,s,a,o);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,r,s,o){const a=this._decorationsTree0.intervalSearch(e,t,i,r,s,o),l=this._decorationsTree1.intervalSearch(e,t,i,r,s,o),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,r,s,o);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,r){const s=e.getVersionId(),o=this._injectedTextDecorationsTree.intervalSearch(t,i,r,!1,s,!1);return this._ensureNodesHaveRanges(e,o).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(s=>s.options.showIfCollapsed||!s.range.isEmpty())}getAll(e,t,i,r,s){const o=e.getVersionId(),a=this._search(t,i,r,o,s);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,r,s){if(i)return this._decorationsTree1.search(e,t,r,s);{const o=this._decorationsTree0.search(e,t,r,s),a=this._decorationsTree1.search(e,t,r,s),l=this._injectedTextDecorationsTree.search(e,t,r,s);return o.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){pU(e)?this._injectedTextDecorationsTree.insert(e):aue(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){pU(e)?this._injectedTextDecorationsTree.delete(e):aue(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){pU(e)?this._injectedTextDecorationsTree.resolveNode(e,t):aue(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 R0(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class $ct{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Mbr extends $ct{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:ug.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 jbr{constructor(e){this.position=(e==null?void 0:e.position)??ov.Center,this.persistLane=e==null?void 0:e.persistLane}}class Fbr extends $ct{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}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"?At.fromHex(e):t.getColor(e.id)}}class rk{static from(e){return e instanceof rk?e:new rk(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 ur{static register(e){return new ur(e)}static createDynamic(e){return new ur(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?R0(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?R0(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Mbr(e.overviewRuler):null,this.minimap=e.minimap?new Fbr(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new jbr(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?R0(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?R0(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?R0(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?tar(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?R0(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?R0(e.marginClassName):null,this.inlineClassName=e.inlineClassName?R0(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?R0(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?R0(e.afterContentClassName):null,this.after=e.after?rk.from(e.after):null,this.before=e.before?rk.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}ur.EMPTY=ur.register({description:"empty"});const MBe=[ur.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),ur.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),ur.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),ur.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function jBe(n){return n instanceof ur?n:ur.createDynamic(n)}class Bbr extends Ye{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new Ue),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)==null||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){var t,i;this._affectsMinimap||(this._affectsMinimap=!!((t=e.minimap)!=null&&t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!((i=e.overviewRuler)!=null&&i.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this._affectsLineNumber||(this._affectsLineNumber=!!e.lineNumberClassName),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,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class $br extends Ye{constructor(){super(),this._fastEmitter=this._register(new Ue),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new Ue),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)}}var Hbr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},CW=function(n,e){return function(t,i){e(t,i,n)}},sR;function HT(n){return n.toString()}let Vbr=class{constructor(e,t,i){this.model=e,this._modelEventListeners=new Et,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(r=>i(e,r)))}dispose(){this._modelEventListeners.dispose()}};const Wbr=Nh||zr?1:2;class zbr{constructor(e,t,i,r,s,o,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=r,this.heapSize=s,this.sha1=o,this.versionId=a,this.alternativeVersionId=l}}var wI;let vve=(wI=class extends Ye{constructor(e,t,i,r){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._instantiationService=r,this._onModelAdded=this._register(new Ue),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new Ue),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new Ue),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 f;let i=id.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const p=parseInt(e.editor.tabSize,10);isNaN(p)||(i=p),i<1&&(i=1)}let r="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const p=parseInt(e.editor.indentSize,10);isNaN(p)||(r=Math.max(p,1))}let s=id.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let o=Wbr;const a=e.eol;a===`\r `?o=2:a===` `&&(o=1);let l=id.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=id.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=id.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let d=id.bracketPairColorizationOptions;return(f=e.editor)!=null&&f.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(d={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:r,insertSpaces:s,detectIndentation:c,defaultEOL:o,trimAutoWhitespace:l,largeFileOptimizations:u,bracketPairColorizationOptions:d}}_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:Yf===3||Yf===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 s=this._modelCreationOptionsByLanguageAndResource[r+t];if(!s){const o=this._configurationService.getValue("editor",{overrideIdentifier:r,resource:t}),a=this._getEOL(t,r);s=sR._readModelOptions({editor:o,eol:a},i),this._modelCreationOptionsByLanguageAndResource[r+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let r=0,s=i.length;r<s;r++){const o=i[r],a=this._models[o],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);sR._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&&Xf(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(HT(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(HT(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(HT(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 s=this.getCreationOptions(t,i,r),o=this._instantiationService.createInstance(yb,e,t,s,i);if(i&&this._disposedModels.has(HT(i))){const c=this._removeDisposedModel(i),u=this._undoRedoService.getElements(i),d=this._getSHA1Computer(),f=d.canComputeSHA1(o)?d.computeSHA1(o)===c.sha1:!1;if(f||c.sharesUndoRedoStack){for(const p of u.past)AC(p)&&p.matchesResource(i)&&p.setModel(o);for(const p of u.future)AC(p)&&p.matchesResource(i)&&p.setModel(o);this._undoRedoService.setElementsValidFlag(i,!0,p=>AC(p)&&p.matchesResource(i)),f&&(o._overwriteVersionId(c.versionId),o._overwriteAlternativeVersionId(c.alternativeVersionId),o._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=HT(o.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new Vbr(o,c=>this._onWillDispose(c),(c,u)=>this._onDidChangeLanguage(c,u));return this._models[a]=l,l}createModel(e,t,i,r=!1){let s;return t?s=this._createModelData(e,t,i,r):s=this._createModelData(e,Ih,i,r),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,r=t.length;i<r;i++){const s=t[i];e.push(this._models[s].model)}return e}getModel(e){const t=HT(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===ir.file||e.scheme===ir.vscodeRemote||e.scheme===ir.vscodeUserData||e.scheme===ir.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=HT(e.uri),i=this._models[t],r=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let s=!1,o=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)AC(u)&&u.matchesResource(e.uri)&&(s=!0,o+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)AC(u)&&u.matchesResource(e.uri)&&(s=!0,o+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=sR.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(s)if(!r&&(o>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-o),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>AC(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new zbr(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),r,o,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(),s=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),o=this.getCreationOptions(r,e.uri,e.isForSimpleWidget);sR._setModelOptionsForModel(e,o,s),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new bve}},sR=wI,wI.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,wI);vve=sR=Hbr([CW(0,Dr),CW(1,Mat),CW(2,Hke),CW(3,mi)],vve);const UQ=class UQ{canComputeSHA1(e){return e.getValueLength()<=UQ.MAX_MODEL_SIZE}computeSHA1(e){const t=new Pme,i=e.createSnapshot();let r;for(;r=i.read();)t.update(r);return t.digest()}};UQ.MAX_MODEL_SIZE=10*1024*1024;let bve=UQ;var yve;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(yve||(yve={}));const UA={Quickaccess:"workbench.contributions.quickaccess"};class Ubr{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),gi(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return iv([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}Ca.add(UA.Quickaccess,new Ubr);const qbr={ctrlCmd:!1,alt:!1};var CM;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(CM||(CM={}));var tb;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(tb||(tb={}));var Wo;(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",n[n.NextSeparator=8]="NextSeparator",n[n.PreviousSeparator=9]="PreviousSeparator"})(Wo||(Wo={}));var RG;(function(n){n[n.Title=1]="Title",n[n.Inline=2]="Inline"})(RG||(RG={}));const Ym=Ur("quickInputService");var Kbr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},FBe=function(n,e){return function(t,i){e(t,i,n)}};let Cve=class extends Ye{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Ca.as(UA.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 g,m;const[r,s]=this.getOrInstantiateProvider(e,i==null?void 0:i.enabledProviderPrefixes),o=this.visibleQuickAccess,a=o==null?void 0:o.descriptor;if(o&&s&&a===s){e!==s.prefix&&!(i!=null&&i.preserveValue)&&(o.picker.value=e),this.adjustValueSelection(o.picker,s,i);return}if(s&&!(i!=null&&i.preserveValue)){let _;if(o&&a&&a!==s){const v=o.value.substr(a.prefix.length);v&&(_=`${s.prefix}${v}`)}if(!_){const v=r==null?void 0:r.defaultFilterValue;v===yve.LAST?_=this.lastAcceptedPickerValues.get(s):typeof v=="string"&&(_=`${s.prefix}${v}`)}typeof _=="string"&&(e=_)}const l=(g=o==null?void 0:o.picker)==null?void 0:g.valueSelection,c=(m=o==null?void 0:o.picker)==null?void 0:m.value,u=new Et,d=u.add(this.quickInputService.createQuickPick({useSeparators:!0}));d.value=e,this.adjustValueSelection(d,s,i),d.placeholder=(i==null?void 0:i.placeholder)??(s==null?void 0:s.placeholder),d.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!o,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(d.itemActivation=(i==null?void 0:i.itemActivation)??tb.SECOND),d.contextKey=s==null?void 0:s.contextKey,d.filterValue=_=>_.substring(s?s.prefix.length:0);let f;t&&(f=new $4,u.add(rn.once(d.onWillAccept)(_=>{_.veto(),d.hide()}))),u.add(this.registerPickerListeners(d,r,s,e,i));const p=u.add(new ba);if(r&&u.add(r.provide(d,p.token,i==null?void 0:i.providerOptions)),rn.once(d.onDidHide)(()=>{d.selectedItems.length===0&&p.cancel(),u.dispose(),f==null||f.complete(d.selectedItems.slice(0))}),d.show(),l&&c===e&&(d.valueSelection=l),t)return f==null?void 0:f.p}adjustValueSelection(e,t,i){let r;i!=null&&i.preserveValue?r=[e.value.length,e.value.length]:r=[(t==null?void 0:t.prefix.length)??0,e.value.length],e.valueSelection=r}registerPickerListeners(e,t,i,r,s){const o=new Et,a=this.visibleQuickAccess={picker:e,descriptor:i,value:r};return o.add(gi(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),o.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l,s==null?void 0:s.enabledProviderPrefixes);c!==t?this.show(l,{enabledProviderPrefixes:s==null?void 0:s.enabledProviderPrefixes,preserveValue:!0,providerOptions:s==null?void 0:s.providerOptions}):a.value=l})),i&&o.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),o}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!(t!=null&&t.includes(i.prefix)))return[void 0,void 0];let r=this.mapProviderToDescriptor.get(i);return r||(r=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,r)),[r,i]}};Cve=Kbr([FBe(0,Ym),FBe(1,mi)],Cve);class J4 extends Tg{constructor(e){super(),this._onChange=this._register(new Ue),this.onChange=this._onChange.event,this._onKeyDown=this._register(new Ue),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(...Ni.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(Jb().setupManagedHover(e.hoverDelegate??jh("mouse"),this.domNode,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 22}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))}}var Gbr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s};class Hct{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Gbr([xl],Hct.prototype,"toString",null);const Ybr=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function Qbr(n){const e=[];let t=0,i;for(;i=Ybr.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,r,s,,o]=i;o?e.push({label:r,href:s,title:o}):e.push({label:r,href:s}),t=i.index+i[0].length}return t<n.length&&e.push(n.substring(t)),new Hct(e)}const lue={},Xbr=new dTe("quick-input-button-icon-");function Zbr(n){if(!n)return;let e;const t=n.dark.toString();return lue[t]?e=lue[t]:(e=Xbr.nextId(),UK(`.${e}, .hc-light .${e}`,`background-image: ${Dw(n.light||n.dark)}`),UK(`.vs-dark .${e}, .hc-black .${e}`,`background-image: ${Dw(n.dark)}`),lue[t]=e),e}function u6(n,e,t){let i=n.iconClass||Zbr(n.iconPath);return n.alwaysVisible&&(i=i?`${i} always-visible`:"always-visible"),{id:e,label:"",tooltip:n.tooltip||"",class:i,enabled:!0,run:t}}function Jbr(n,e,t){_u(e);const i=Qbr(n);let r=0;for(const s of i.nodes)if(typeof s=="string")e.append(...uE(s));else{let o=s.title;!o&&s.href.startsWith("command:")?o=A("executeCommand","Click to execute command '{0}'",s.href.substring(8)):o||(o=s.href);const a=Jt("a",{href:s.href,title:o,tabIndex:r++},s.label);a.style.textDecoration="underline";const l=p=>{Clr(p)&&Jr.stop(p,!0),t.callback(s.href)},c=t.disposables.add(new Yr(a,Xt.CLICK)).event,u=t.disposables.add(new Yr(a,Xt.KEY_DOWN)).event,d=rn.chain(u,p=>p.filter(g=>{const m=new Io(g);return m.equals(10)||m.equals(3)}));t.disposables.add(dd.addTarget(a));const f=t.disposables.add(new Yr(a,Oo.Tap)).event;rn.any(c,f,d)(l,null,t.disposables),e.appendChild(a)}}var e0r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},BBe=function(n,e){return function(t,i){e(t,i,n)}};const Vct="inQuickInput",t0r=new yn(Vct,!1,A("inQuickInput","Whether keyboard focus is inside the quick input control")),n0r=It.has(Vct),Wct="quickInputType",i0r=new yn(Wct,void 0,A("quickInputType","The type of the currently visible quick input")),zct="cursorAtEndOfQuickInputBox",r0r=new yn(zct,!1,A("cursorAtEndOfQuickInputBox","Whether the cursor in the quick input is at the end of the input box")),s0r=It.has(zct),wve={iconClass:Ni.asClassName(Yt.quickInputBack),tooltip:A("quickInput.back","Back")},qQ=class qQ extends Ye{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=qQ.noPromptMessage,this._severity=_l.Ignore,this.onDidTriggerButtonEmitter=this._register(new Ue),this.onDidHideEmitter=this._register(new Ue),this.onWillHideEmitter=this._register(new Ue),this.onDisposeEmitter=this._register(new Ue),this.visibleDisposables=this._register(new Et),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&&!Fb;this._ignoreFocusOut=e&&!Fb,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(t=>t===wve),this._rightButtons=e.filter(t=>t!==wve&&t.location!==RG.Inline),this._inlineButtons=e.filter(t=>t.location===RG.Inline),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=CM.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=CM.Other){this.onWillHideEmitter.fire({reason:e})}update(){var r;if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?_u(this.ui.widget,this._widget):_u(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new vv,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._leftButtons.map((l,c)=>u6(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(s,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this._rightButtons.map((l,c)=>u6(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(o,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const a=this._inlineButtons.map((l,c)=>u6(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.inlineActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=((r=this.toggles)==null?void 0:r.filter(o=>o instanceof J4))??[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,_u(this.ui.message),Jbr(i,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?A("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==_l.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()}};qQ.noPromptMessage=A("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");let PG=qQ;const KQ=class KQ extends PG{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new Ue),this.onWillAcceptEmitter=this._register(new Ue),this.onDidAcceptEmitter=this._register(new Ue),this.onDidCustomEmitter=this._register(new Ue),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._keepScrollPosition=!1,this._itemActivation=tb.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new Ue),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new Ue),this.onDidTriggerItemButtonEmitter=this._register(new Ue),this.onDidTriggerSeparatorButtonEmitter=this._register(new Ue),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new V9,this.type="quickPick",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 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?qbr:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}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.canSelectMany||this.ui.list.focus(Wo.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&fa(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&&fa(e,this._selectedItems,(i,r)=>i===r)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(kke(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&fa(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 _t(this.ui.container,Xt.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Io(e),i=t.keyCode;this._quickNavigate.keybindings.some(o=>{const a=o.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.titleButtons.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;!r&&i.inputBox&&(r=this.placeholder||KQ.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&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case tb.NONE:this._itemActivation=tb.FIRST;break;case tb.SECOND:this.ui.list.focus(Wo.Second),this._itemActivation=tb.FIRST;break;case tb.LAST:this.ui.list.focus(Wo.Last),this._itemActivation=tb.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(Wo.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(e??!1))}};KQ.DEFAULT_ARIA_LABEL=A("quickInputBox.ariaLabel","Type to narrow down results.");let OG=KQ,o0r=class extends PG{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new Ue),this.onDidAcceptEmitter=this._register(new Ue),this.type="inputBox",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.titleButtons.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)}},xve=class extends hM{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(Lc(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` `);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};xve=e0r([BBe(0,Dr),BBe(1,C1)],xve);At.white.toString(),At.white.toString();class MG extends Ye{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new Ue),this._onDidEscape=this._register(new Ue),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")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(dd.addTarget(this._element)),[Xt.CLICK,Oo.Tap].forEach(s=>{this._register(_t(this._element,s,o=>{if(!this.enabled){Jr.stop(o);return}this._onDidClick.fire(o)}))}),this._register(_t(this._element,Xt.KEY_DOWN,s=>{const o=new Io(s);let a=!1;this.enabled&&(o.equals(3)||o.equals(10))?(this._onDidClick.fire(s),a=!0):o.equals(9)&&(this._onDidEscape.fire(s),this._element.blur(),a=!0),a&&Jr.stop(o,!0)})),this._register(_t(this._element,Xt.MOUSE_OVER,s=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(_t(this._element,Xt.MOUSE_OUT,s=>{this.updateBackground(!1)})),this.focusTracker=this._register($b(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 uE(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 r;if(this._label===e||Rb(this._label)&&Rb(e)&&Bpr(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(Rb(e)){const s=Lte(e,{inline:!0});s.dispose();const o=(r=s.element.querySelector("p"))==null?void 0:r.innerHTML;if(o){const a=Vot(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=a}else _u(t)}else this.options.supportIcons?_u(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=Qpr(e)),this.setTitle(i),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",i),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...Ni.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(Jb().setupManagedHover(this.options.hoverDelegate??jh("mouse"),this._element,e)):this._hover&&this._hover.update(e)}}class Sve{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=Ot(e,Jt(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=jL(this.countFormat,this.count),this.element.title=jL(this.titleFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const $Be="done",HBe="active",cue="infinite",uue="infinite-long-running",VBe="discrete",GQ=class GQ extends Ye{constructor(e,t){super(),this.progressSignal=this._register(new Dc),this.workedVal=0,this.showDelayedScheduler=this._register(new ao(()=>qf(this.element),0)),this.longRunningScheduler=this._register(new ao(()=>this.infiniteLongRunning(),GQ.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(HBe,cue,uue,VBe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add($Be),this.element.classList.contains(cue)?(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(VBe,$Be,uue),this.element.classList.add(HBe,cue),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(uue)}getContainer(){return this.element}};GQ.LONG_RUNNING_INFINITE_THRESHOLD=1e4;let Eve=GQ;const a0r=A("caseDescription","Match Case"),l0r=A("wordsDescription","Match Whole Word"),c0r=A("regexDescription","Use Regular Expression");class Uct extends J4{constructor(e){super({icon:Yt.caseSensitive,title:a0r+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??jh("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class qct extends J4{constructor(e){super({icon:Yt.wholeWord,title:l0r+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??jh("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Kct extends J4{constructor(e){super({icon:Yt.regex,title:c0r+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??jh("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class u0r{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 d0r{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 u0r(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 yj=Jt;class h0r extends Tg{constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new Ue),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new Ue),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Ot(e,yj(".monaco-inputbox.idle"));const r=this.options.flexibleHeight?"textarea":"input",s=Ot(this.element,yj(".ibwrapper"));if(this.input=Ot(s,yj(r+".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=Ot(s,yj("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new blt(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Ot(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(l=>this.input.scrollTop=l.scrollTop));const o=this._register(new Yr(e.ownerDocument,"selectionchange")),a=rn.filter(o.event,()=>{const l=e.ownerDocument.getSelection();return(l==null?void 0:l.anchorNode)===s});this._register(a(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 hg(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.hover?this.hover.update(e):this.hover=this._register(Jb().setupManagedHover(jh("mouse"),this.input,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:zC(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return ete(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}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}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"&&Xf(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 ${uw(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=Vf(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:r=>{if(!this.message)return null;e=Ot(r,yj(".monaco-inputbox-container")),t();const s={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?ipr(this.message.content,s):npr(this.message.content,s);o.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return o.style.backgroundColor=a.background??"",o.style.color=a.foreground??"",o.style.border=a.border?`1px solid ${a.border}`:"",Ot(e,o),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=A("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=A("alertWarningMessage","Warning: {0}",this.message.content):i=A("alertInfoMessage","Info: {0}",this.message.content),Ph(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(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",r=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${uw(r,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=zC(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,s=t.value;i!==null&&r!==null&&(this.value=s.substr(0,i)+e+s.substr(r),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)==null||e.dispose(),super.dispose()}}class Gct extends h0r{constructor(e,t,i){const r=A({key:"history.inputbox.hint.suffix.noparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field ends in a closing parenthesis ")", for example "Filter (e.g. text, !exclude)". The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," or {0} for history","⇅"),s=A({key:"history.inputbox.hint.suffix.inparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field does NOT end in a closing parenthesis (eg. "Find"). The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new Ue),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Ue),this.onDidBlur=this._onDidBlur.event,this.history=new d0r(i.history,100);const o=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?r:s,l=this.placeholder+a;i.showPlaceholderOnFocus&&!ete(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||o()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>o()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return i.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(s)||a(r)})}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??"",Xy(this.value?this.value:A("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,Xy(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}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 f0r=A("defaultLabel","input");class Yct extends Tg{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Dc),this.additionalToggles=[],this._onDidOptionChange=this._register(new Ue),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new Ue),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new Ue),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new Ue),this._onKeyUp=this._register(new Ue),this._onCaseSensitiveKeyDown=this._register(new Ue),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new Ue),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||f0r,this.showCommonFindToggles=!!i.showCommonFindToggles;const r=i.appendCaseSensitiveLabel||"",s=i.appendWholeWordsLabel||"",o=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,u=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new Gct(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}));const d=this._register(bM());if(this.showCommonFindToggles){this.regex=this._register(new Kct({appendTitle:o,isChecked:!1,hoverDelegate:d,...i.toggleStyles})),this._register(this.regex.onChange(p=>{this._onDidOptionChange.fire(p),!p&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(p=>{this._onRegexKeyDown.fire(p)})),this.wholeWords=this._register(new qct({appendTitle:s,isChecked:!1,hoverDelegate:d,...i.toggleStyles})),this._register(this.wholeWords.onChange(p=>{this._onDidOptionChange.fire(p),!p&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new Uct({appendTitle:r,isChecked:!1,hoverDelegate:d,...i.toggleStyles})),this._register(this.caseSensitive.onChange(p=>{this._onDidOptionChange.fire(p),!p&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(p=>{this._onCaseSensitiveKeyDown.fire(p)}));const f=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,p=>{if(p.equals(15)||p.equals(17)||p.equals(9)){const g=f.indexOf(this.domNode.ownerDocument.activeElement);if(g>=0){let m=-1;p.equals(17)?m=(g+1)%f.length:p.equals(15)&&(g===0?m=f.length-1:m=g-1),p.equals(9)?(f[g].blur(),this.inputBox.focus()):m>=0&&f[m].focus(),Jr.stop(p,!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(_t(this.inputBox.inputElement,"compositionstart",f=>{this.imeSessionInProgress=!0})),this._register(_t(this.inputBox.inputElement,"compositionend",f=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,f=>this._onKeyDown.fire(f)),this.onkeyup(this.inputBox.inputElement,f=>this._onKeyUp.fire(f)),this.oninput(this.inputBox.inputElement,f=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,f=>this._onMouseDown.fire(f))}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.enable(),(t=this.wholeWords)==null||t.enable(),(i=this.caseSensitive)==null||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.disable(),(t=this.wholeWords)==null||t.disable(),(i=this.caseSensitive)==null||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 Et;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;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(((t=this.caseSensitive)==null?void 0:t.width())??0)+(((i=this.wholeWords)==null?void 0:i.width())??0)+(((r=this.regex)==null?void 0:r.width())??0)+this.additionalToggles.reduce((s,o)=>s+o.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;return((e=this.caseSensitive)==null?void 0:e.checked)??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e;return((e=this.wholeWords)==null?void 0:e.checked)??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e;return((e=this.regex)==null?void 0:e.checked)??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)==null||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()}}const p0r=Jt;class g0r extends Ye{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=s=>Da(this.findInput.inputBox.inputElement,Xt.KEY_DOWN,s),this.onDidChange=s=>this.findInput.onDidChange(s),this.container=Ot(this.parent,p0r(".quick-input-box")),this.findInput=this._register(new Yct(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)}getSelection(){return this.findInput.inputBox.getSelection()}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===_l.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===_l.Info?1:e===_l.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===_l.Info?1:e===_l.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class m0r{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Ye.None}}renderElement(e,t,i,r){var l;if((l=i.disposable)==null||l.dispose(),!i.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,i.data,r);const o=new ba,a=s.resolve(e,o.token);i.disposable={dispose:()=>o.cancel()},this.renderer.renderPlaceholder(e,i.data),a.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 _0r{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 v0r(n,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new _0r(n,e.accessibilityProvider)}}class b0r{constructor(e,t,i,r,s={}){const o=()=>this.model,a=r.map(l=>new m0r(l,o));this.list=new Ig(e,t,i,a,v0r(o,s))}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 rn.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 rn.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 rn.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,Xh(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 e3=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s};const y0r=!1;var jG;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(jG||(jG={}));let C0r=4;const w0r=new Ue;let x0r=300;const S0r=new Ue;class OTe{constructor(e){this.el=e,this.disposables=new Et}get onPointerMove(){return this.disposables.add(new Yr(Ti(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new Yr(Ti(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}e3([xl],OTe.prototype,"onPointerMove",null);e3([xl],OTe.prototype,"onPointerUp",null);class MTe{get onPointerMove(){return this.disposables.add(new Yr(this.el,Oo.Change)).event}get onPointerUp(){return this.disposables.add(new Yr(this.el,Oo.End)).event}constructor(e){this.el=e,this.disposables=new Et}dispose(){this.disposables.dispose()}}e3([xl],MTe.prototype,"onPointerMove",null);e3([xl],MTe.prototype,"onPointerUp",null);class FG{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}e3([xl],FG.prototype,"onPointerMove",null);e3([xl],FG.prototype,"onPointerUp",null);const WBe="pointer-events-disabled";class td extends Ye{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=Ot(this.el,Jt(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(gi(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new Yr(this._orthogonalStartDragHandle,"mouseenter")).event(()=>td.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Yr(this._orthogonalStartDragHandle,"mouseleave")).event(()=>td.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=Ot(this.el,Jt(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(gi(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new Yr(this._orthogonalEndDragHandle,"mouseenter")).event(()=>td.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Yr(this._orthogonalEndDragHandle,"mouseleave")).event(()=>td.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=x0r,this.hoverDelayer=this._register(new Rm(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new Ue),this._onDidStart=this._register(new Ue),this._onDidChange=this._register(new Ue),this._onDidReset=this._register(new Ue),this._onDidEnd=this._register(new Ue),this.orthogonalStartSashDisposables=this._register(new Et),this.orthogonalStartDragHandleDisposables=this._register(new Et),this.orthogonalEndSashDisposables=this._register(new Et),this.orthogonalEndDragHandleDisposables=this._register(new Et),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=Ot(e,Jt(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),zr&&this.el.classList.add("mac");const r=this._register(new Yr(this.el,"mousedown")).event;this._register(r(d=>this.onPointerStart(d,new OTe(e)),this));const s=this._register(new Yr(this.el,"dblclick")).event;this._register(s(this.onPointerDoublePress,this));const o=this._register(new Yr(this.el,"mouseenter")).event;this._register(o(()=>td.onMouseEnter(this)));const a=this._register(new Yr(this.el,"mouseleave")).event;this._register(a(()=>td.onMouseLeave(this))),this._register(dd.addTarget(this.el));const l=this._register(new Yr(this.el,Oo.Start)).event;this._register(l(d=>this.onPointerStart(d,new MTe(this.el)),this));const c=this._register(new Yr(this.el,Oo.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=C0r,this._register(w0r.event(d=>{this.size=d,this.layout()}))),this._register(S0r.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",y0r),this.layout()}onPointerStart(e,t){Jr.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new FG(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new FG(t))),!this.state)return;const r=this.el.ownerDocument.getElementsByTagName("iframe");for(const g of r)g.classList.add(WBe);const s=e.pageX,o=e.pageY,a=e.altKey,l={startX:s,currentX:s,startY:o,currentY:o,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=_g(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=zr?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=zr?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},d=new Et;u(),i||this.onDidEnablementChange.event(u,null,d);const f=g=>{Jr.stop(g,!1);const m={startX:s,currentX:g.pageX,startY:o,currentY:g.pageY,altKey:a};this._onDidChange.fire(m)},p=g=>{Jr.stop(g,!1),c.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const m of r)m.classList.remove(WBe)};t.onPointerMove(f,null,d),t.onPointerUp(p,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&&td.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&td.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){td.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){const t=e.initialTarget??e.target;if(!(!t||!Lc(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const E0r={separatorBorder:At.transparent};class Qct{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,r;if(e!==this.visible){e?(this.size=hh(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);try{(r=(i=this.view).setVisible)==null||r.call(i,e)}catch(s){console.error("Splitview: Failed to set visible view"),console.error(s)}}}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(){return this.view.proportionalLayout??!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);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class k0r extends Qct{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class T0r extends Qct{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var _C;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(_C||(_C={}));var BG;(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})(BG||(BG={}));class Xct extends Ye{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={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=_C.Idle,this._onDidSashChange=this._register(new Ue),this._onDidSashReset=this._register(new Ue),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!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=Ot(this.el,Jt(".sash-container")),this.viewContainer=Jt(".split-view-container"),this.scrollable=this._register(new G4({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:r=>lp(Ti(this.el),r)})),this.scrollableElement=this._register(new Ste(this.viewContainer,{vertical:this.orientation===0?t.scrollbarVisibility??1:2,horizontal:this.orientation===1?t.scrollbarVisibility??1:2},this.scrollable));const i=this._register(new Yr(this.viewContainer,"scroll")).event;this._register(i(r=>{const s=this.scrollableElement.getScrollPosition(),o=Math.abs(this.viewContainer.scrollLeft-s.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-s.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(o!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:o,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(r=>{r.scrollTopChanged&&(this.viewContainer.scrollTop=r.scrollTop),r.scrollLeftChanged&&(this.viewContainer.scrollLeft=r.scrollLeft)})),Ot(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||E0r),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((r,s)=>{const o=Kd(r.visible)||r.visible?r.size:{type:"invisible",cachedVisibleSize:r.size},a=r.view;this.doAddView(a,o,s,!0)}),this._contentSize=this.viewItems.reduce((r,s)=>r+s.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 s=0;s<this.viewItems.length;s++){const o=this.viewItems[s],a=this.proportions[s];typeof a=="number"?r+=a:e-=o.size}for(let s=0;s<this.viewItems.length;s++){const o=this.viewItems[s],a=this.proportions[s];typeof a=="number"&&r>0&&(o.size=hh(Math.round(a*e/r),o.minimumSize,o.maximumSize))}}else{const r=Xh(this.viewItems.length),s=r.filter(a=>this.viewItems[a].priority===1),o=r.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,s,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?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),s=U_(_t(this.el.ownerDocument.body,"keydown",a=>o(this.sashDragState.current,a.altKey)),_t(this.el.ownerDocument.body,"keyup",()=>o(this.sashDragState.current,!1))),o=(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 f,p;if(!l){const g=Xh(r,-1),m=Xh(r+1,this.viewItems.length),_=g.reduce((L,N)=>L+(this.viewItems[N].minimumSize-c[N]),0),v=g.reduce((L,N)=>L+(this.viewItems[N].viewMaximumSize-c[N]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((L,N)=>L+(c[N]-this.viewItems[N].minimumSize),0),y=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((L,N)=>L+(c[N]-this.viewItems[N].viewMaximumSize),0),C=Math.max(_,y),S=Math.min(b,v),k=this.findFirstSnapIndex(g),I=this.findFirstSnapIndex(m);if(typeof k=="number"){const L=this.viewItems[k],N=Math.floor(L.viewMinimumSize/2);f={index:k,limitDelta:L.visible?C-N:C+N,size:L.size}}if(typeof I=="number"){const L=this.viewItems[I],N=Math.floor(L.viewMinimumSize/2);p={index:I,limitDelta:L.visible?S+N:S-N,size:L.size}}}this.sashDragState={start:a,current:a,index:r,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:f,snapAfter:p,disposable:s}};o(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:r,alt:s,minDelta:o,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,o,a,l,c);if(s){const f=t===this.sashItems.length-1,p=this.viewItems.map(y=>y.size),g=f?t:t+1,m=this.viewItems[g],_=m.size-m.maximumSize,v=m.size-m.minimumSize,b=f?t-1:t+1;this.resize(b,-d,p,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=hh(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(!(e<0||e>=this.viewItems.length)){if(this.state!==_C.Idle)throw new Error("Cant modify splitview");this.state=_C.Busy;try{const i=Xh(this.viewItems.length).filter(a=>a!==e),r=[...i.filter(a=>this.viewItems[a].priority===1),e],s=i.filter(a=>this.viewItems[a].priority===2),o=this.viewItems[e];t=Math.round(t),t=hh(t,o.minimumSize,Math.min(o.maximumSize,this.size)),o.size=t,this.relayout(r,s)}finally{this.state=_C.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=hh(i,a.minimumSize,a.maximumSize);const r=Xh(this.viewItems.length),s=r.filter(a=>this.viewItems[a].priority===1),o=r.filter(a=>this.viewItems[a].priority===2);this.relayout(s,o)}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!==_C.Idle)throw new Error("Cant modify splitview");this.state=_C.Busy;try{const s=Jt(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(i));const o=e.onDidChange(f=>this.onViewChange(u,f)),a=gi(()=>s.remove()),l=U_(o,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 k0r(s,e,c,l):new T0r(s,e,c,l);if(this.viewItems.splice(i,0,u),this.viewItems.length>1){const f={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},p=this.orientation===0?new td(this.sashContainer,{getHorizontalSashTop:L=>this.getSashPosition(L),getHorizontalSashWidth:this.getSashOrthogonalSize},{...f,orientation:1}):new td(this.sashContainer,{getVerticalSashLeft:L=>this.getSashPosition(L),getVerticalSashHeight:this.getSashOrthogonalSize},{...f,orientation:0}),g=this.orientation===0?L=>({sash:p,start:L.startY,current:L.currentY,alt:L.altKey}):L=>({sash:p,start:L.startX,current:L.currentX,alt:L.altKey}),_=rn.map(p.onDidStart,g)(this.onSashStart,this),b=rn.map(p.onDidChange,g)(this.onSashChange,this),C=rn.map(p.onDidEnd,()=>this.sashItems.findIndex(L=>L.sash===p))(this.onSashEnd,this),S=p.onDidReset(()=>{const L=this.sashItems.findIndex(V=>V.sash===p),N=Xh(L,-1),P=Xh(L+1,this.viewItems.length),O=this.findFirstSnapIndex(N),F=this.findFirstSnapIndex(P);typeof O=="number"&&!this.viewItems[O].visible||typeof F=="number"&&!this.viewItems[F].visible||this._onDidSashReset.fire(L)}),k=U_(_,b,C,S,p),I={sash:p,disposable:k};this.sashItems.splice(i-1,0,I)}s.appendChild(e.element);let d;typeof t!="number"&&t.type==="split"&&(d=[t.index]),r||this.relayout([i],d),!r&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=_C.Idle}}relayout(e,t){const i=this.viewItems.reduce((r,s)=>r+s.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,s,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const u=Xh(e,-1),d=Xh(e+1,this.viewItems.length);if(s)for(const I of s)sce(u,I),sce(d,I);if(r)for(const I of r)zV(u,I),zV(d,I);const f=u.map(I=>this.viewItems[I]),p=u.map(I=>i[I]),g=d.map(I=>this.viewItems[I]),m=d.map(I=>i[I]),_=u.reduce((I,L)=>I+(this.viewItems[L].minimumSize-i[L]),0),v=u.reduce((I,L)=>I+(this.viewItems[L].maximumSize-i[L]),0),b=d.length===0?Number.POSITIVE_INFINITY:d.reduce((I,L)=>I+(i[L]-this.viewItems[L].minimumSize),0),y=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((I,L)=>I+(i[L]-this.viewItems[L].maximumSize),0),C=Math.max(_,y,o),S=Math.min(b,v,a);let k=!1;if(l){const I=this.viewItems[l.index],L=t>=l.limitDelta;k=L!==I.visible,I.setVisible(L,l.size)}if(!k&&c){const I=this.viewItems[c.index],L=t<c.limitDelta;k=L!==I.visible,I.setVisible(L,c.size)}if(k)return this.resize(e,t,i,r,s,o,a);t=hh(t,C,S);for(let I=0,L=t;I<f.length;I++){const N=f[I],P=hh(p[I]+L,N.minimumSize,N.maximumSize),O=P-p[I];L-=O,N.size=P}for(let I=0,L=t;I<g.length;I++){const N=g[I],P=hh(m[I]-L,N.minimumSize,N.maximumSize),O=P-m[I];L+=O,N.size=P}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((a,l)=>a+l.size,0);let i=this.size-t;const r=Xh(this.viewItems.length-1,-1),s=r.filter(a=>this.viewItems[a].priority===1),o=r.filter(a=>this.viewItems[a].priority===2);for(const a of o)sce(r,a);for(const a of s)zV(r,a);typeof e=="number"&&zV(r,e);for(let a=0;i!==0&&a<r.length;a++){const l=this.viewItems[r[a]],c=hh(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 s=r.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const o=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]&&o[l+1]),f=!(i[l]&&s[l+1]);if(d&&f){const p=Xh(l,-1),g=Xh(l+1,this.viewItems.length),m=this.findFirstSnapIndex(p),_=this.findFirstSnapIndex(g),v=typeof m=="number"&&!this.viewItems[m].visible,b=typeof _=="number"&&!this.viewItems[_].visible;v&&s[l]&&(a>0||this.startSnappingEnabled)?c.state=1:b&&t[l]&&(a<this._contentSize||this.endSnappingEnabled)?c.state=2:c.state=0}else d&&!f?c.state=1:!d&&f?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.disposable.dispose(),vo(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}const YQ=class YQ{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=YQ.TemplateId,this.renderedTemplates=new Set;const r=new Map(t.map(s=>[s.templateId,s]));this.renderers=[];for(const s of e){const o=r.get(s.templateId);if(!o)throw new Error(`Table cell renderer for template id ${s.templateId} not found.`);this.renderers.push(o)}}renderTemplate(e){const t=Ot(e,Jt(".monaco-table-tr")),i=[],r=[];for(let o=0;o<this.columns.length;o++){const a=this.renderers[o],l=Ot(t,Jt(".monaco-table-td",{"data-col-index":o}));l.style.width=`${this.getColumnSize(o)}px`,i.push(l),r.push(a.renderTemplate(l))}const s={container:e,cellContainers:i,cellTemplateData:r};return this.renderedTemplates.add(s),s}renderElement(e,t,i,r){for(let s=0;s<this.columns.length;s++){const a=this.columns[s].project(e);this.renderers[s].renderElement(a,t,i.cellTemplateData[s],r)}}disposeElement(e,t,i,r){for(let s=0;s<this.columns.length;s++){const o=this.renderers[s];if(o.disposeElement){const l=this.columns[s].project(e);o.disposeElement(l,t,i.cellTemplateData[s],r)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);mu(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}};YQ.TemplateId="row";let $G=YQ;function I0r(n){return{getHeight(e){return n.getHeight(e)},getTemplateId(){return $G.TemplateId}}}class L0r extends Ye{get minimumSize(){return this.column.minimumWidth??120}get maximumSize(){return this.column.maximumWidth??Number.POSITIVE_INFINITY}get onDidChange(){return this.column.onDidChangeWidthConstraints??rn.None}constructor(e,t){super(),this.column=e,this.index=t,this._onDidLayout=new Ue,this.onDidLayout=this._onDidLayout.event,this.element=Jt(".monaco-table-th",{"data-col-index":t},e.label),e.tooltip&&this._register(Jb().setupManagedHover(jh("mouse"),this.element,e.tooltip))}layout(e){this._onDidLayout.fire([this.index,e])}}const QQ=class QQ{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,s,o){this.virtualDelegate=i,this.columns=r,this.domId=`table_id_${++QQ.InstanceCount}`,this.disposables=new Et,this.cachedWidth=0,this.cachedHeight=0,this.domNode=Ot(t,Jt(`.monaco-table.${this.domId}`));const a=r.map((u,d)=>this.disposables.add(new L0r(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 Xct(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 $G(r,s,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new Ig(e,this.domNode,I0r(i),[c],o)),rn.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=r.reduce((p,g)=>p+g.weight,0),f=r[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,f)},null,this.disposables),this.styleElement=_g(this.domNode),this.style(e_r)}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()}};QQ.InstanceCount=0;let kve=QQ;var Hp;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Hp||(Hp={}));var Y2;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(Y2||(Y2={}));class Qp extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class jTe{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 FTe(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function j7(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function due(n){return typeof n.collapsible=="boolean"}class A0r{constructor(e,t,i,r={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new V9,this._onDidChangeCollapseState=new Ue,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new Ue,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new Ue,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Rm(Rot),this.collapseByDefault=typeof r.collapseByDefault>"u"?!1:r.collapseByDefault,this.allowNonCollapsibleParents=r.allowNonCollapsibleParents??!1,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=ss.empty(),r={}){if(e.length===0)throw new Qp(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=ss.empty(),s,o=s.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,r,s);const l=[...r],c=t[t.length-1],u=new my({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(m=>e.getId(m.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,s);const d=t.slice(0,-1),f=(m,_,v)=>{if(o>0)for(let b=0;b<v;b++)m--,_--,this.spliceSmart(e,[...d,m,0],Number.MAX_SAFE_INTEGER,l[_].children,s,o-1)};let p=Math.min(a.children.length,c+i),g=l.length;for(const m of u.changes.sort((_,v)=>v.originalStart-_.originalStart))f(p,g,p-(m.originalStart+m.originalLength)),p=m.originalStart,g=m.modifiedStart-c,this.spliceSimple([...d,p],m.originalLength,ss.slice(l,g,g+m.modifiedLength),s);f(p,g,p)}spliceSimple(e,t,i=ss.empty(),{onDidCreateNode:r,onDidDeleteNode:s,diffIdentityProvider:o}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],f=ss.map(i,S=>this.createTreeNode(S,a,a.visible?1:0,c,d,r)),p=e[e.length-1];let g=0;for(let S=p;S>=0&&S<a.children.length;S--){const k=a.children[S];if(k.visible){g=k.visibleChildIndex;break}}const m=[];let _=0,v=0;for(const S of f)m.push(S),v+=S.renderNodeCount,S.visible&&(S.visibleChildIndex=g+_++);const b=H6e(a.children,p,t,m);o?a.lastDiffIds?H6e(a.lastDiffIds,p,t,m.map(S=>o.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>o.getId(S.element).toString()):a.lastDiffIds=void 0;let y=0;for(const S of b)S.visible&&y++;if(y!==0)for(let S=p+m.length;S<a.children.length;S++){const k=a.children[S];k.visible&&(k.visibleChildIndex-=y)}if(a.visibleChildrenCount+=_-y,c&&u){const S=b.reduce((k,I)=>k+(I.visible?I.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,v-S),this.list.splice(l,S,d)}if(b.length>0&&s){const S=k=>{s(k),k.children.forEach(S)};b.forEach(S)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:b});let C=a;for(;C;){if(C.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}C=C.parent}}rerender(e){if(e.length===0)throw new Qp(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 s={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}_setCollapseState(e,t){const{node:i,listIndex:r,revealed:s}=this.getTreeNodeWithListIndex(e),o=this._setListNodeCollapseState(i,r,s,t);if(i!==this.root&&this.autoExpandSingleChildren&&o&&!due(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 o}_setListNodeCollapseState(e,t,i,r){const s=this._setNodeCollapseState(e,r,!1);if(!i||!e.visible||!s)return s;const o=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=o-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),s}_setNodeCollapseState(e,t,i){let r;if(e===this.root?r=!1:(due(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})),!due(t)&&t.recursive)for(const s of e.children)r=this._setNodeCollapseState(s,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,s,o){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&&s.push(a);const c=e.children||ss.empty(),u=r&&l!==0&&!a.collapsed;let d=0,f=1;for(const p of c){const g=this.createTreeNode(p,a,l,u,s,o);a.children.push(g),f+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=d++)}return this.allowNonCollapsibleParents||(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=f):(a.renderNodeCount=0,r&&s.pop()),o==null||o(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 s;if(e!==this.root){if(s=this._filterNode(e,t),s===0)return e.visible=!1,e.renderNodeCount=0,!1;r&&i.push(e)}const o=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||s!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,s,i,r&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=s===2?a:s===1,e.visibility=s),e.visible?e.collapsed||(e.renderNodeCount+=i.length-o):(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):FTe(i)?(e.filterData=i.data,j7(i.visibility)):(e.filterData=void 0,j7(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 Qp(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:s}=this.getParentNodeWithListIndex(e),o=e[e.length-1];if(o<0||o>t.children.length)throw new Qp(this.user,"Invalid tree location");const a=t.children[o];return{node:a,listIndex:i,revealed:r,visible:s&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,r=!0,s=!0){const[o,...a]=e;if(o<0||o>t.children.length)throw new Qp(this.user,"Invalid tree location");for(let l=0;l<o;l++)i+=t.children[l].renderNodeCount;return r=r&&!t.collapsed,s=s&&t.visible,a.length===0?{parentNode:t,listIndex:i,revealed:r,visible:s}:this.getParentNodeWithListIndex(a,t.children[o],i+1,r,s)}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?[]:Wrr(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(t.children.length!==0)return t.children[0].element}}class N0r extends a${constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function hue(n){return n instanceof a$?new N0r(n):n}class D0r{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Ye.None,this.disposables=new Et}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.call(i,hue(e),t)}onDragOver(e,t,i,r,s,o=!0){const a=this.dnd.onDragOver(hue(e),t&&t.element,i,r,s),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=XE(()=>{const p=this.modelProvider(),g=p.getNodeLocation(t);p.isCollapsed(g)&&p.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!o){const p=typeof a=="boolean"?a:a.accept,g=typeof a=="boolean"?void 0:a.effect;return{accept:p,effect:g,feedback:[i]}}return a}if(a.bubble===1){const p=this.modelProvider(),g=p.getNodeLocation(t),m=p.getParentNodeLocation(g),_=p.getNode(m),v=m&&p.getListIndex(m);return this.onDragOver(e,_,v,r,s,!1)}const c=this.modelProvider(),u=c.getNodeLocation(t),d=c.getListIndex(u),f=c.getListRenderCount(u);return{...a,feedback:Xh(d,d+f)}}drop(e,t,i,r,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(hue(e),t&&t.element,i,r,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function R0r(n,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new D0r(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const i=n(),r=i.getNodeLocation(t),s=i.getParentNodeLocation(r);return i.getNode(s).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&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class BTe{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.call(i,e.element,t)}}var wM;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(wM||(wM={}));class P0r{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Et,this.onDidChange=rn.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const V6=class V6{constructor(e,t,i,r,s,o={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=r,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=V6.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Ye.None,this.disposables=new Et,this.templateId=e.templateId,this.updateOptions(o),rn.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)==null||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=hh(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!==wM.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 Et;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=Ot(e,Jt(".monaco-tl-row")),i=Ot(t,Jt(".monaco-tl-indent")),r=Ot(t,Jt(".monaco-tl-twistie")),s=Ot(t,Jt(".monaco-tl-contents")),o=this.renderer.renderTemplate(s);return{container:e,indent:i,twistie:r,indentGuidesDisposable:Ye.None,templateData:o}}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 s,o;i.indentGuidesDisposable.dispose(),(o=(s=this.renderer).disposeElement)==null||o.call(s,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=V6.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(...Ni.asClassNameArray(Yt.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(...Ni.asClassNameArray(Yt.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(mu(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Et,r=this.modelProvider();for(;;){const s=r.getNodeLocation(e),o=r.getParentNodeLocation(s);if(!o)break;const a=r.getNode(o),l=Jt(".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(gi(()=>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 s=i.getNodeLocation(r);try{const o=i.getParentNodeLocation(s);r.collapsible&&r.children.length>0&&!r.collapsed?t.add(r):o&&t.add(i.getNode(o))}catch{}}),this.activeIndentNodes.forEach(r=>{t.has(r)||this.renderedIndentGuides.forEach(r,s=>s.classList.remove("active"))}),t.forEach(r=>{this.activeIndentNodes.has(r)||this.renderedIndentGuides.forEach(r,s=>s.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),vo(this.disposables)}};V6.DefaultIndent=8;let Tve=V6;class O0r{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 Et,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const o=this._filter.filter(e,t);if(typeof o=="boolean"?i=o?1:0:FTe(o)?i=j7(o.visibility):i=o,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:Db.Default,visibility:i};const r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(r)?r:[r];for(const o of s){const a=o&&o.toString();if(typeof a>"u")return{data:Db.Default,visibility:i};let l;if(this.tree.findMatchType===YL.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=UL(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,s.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===YC.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:Db.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){vo(this.disposables)}}var YC;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(YC||(YC={}));var YL;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(YL||(YL={}));let M0r=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,s,o={}){this.tree=e,this.view=i,this.filter=r,this.contextViewProvider=s,this.options=o,this._pattern="",this.width=0,this._onDidChangeMode=new Ue,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new Ue,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new Ue,this._onDidChangeOpenState=new Ue,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Et,this.disposables=new Et,this._mode=e.options.defaultFindMode??YC.Highlight,this._matchType=e.options.defaultFindMatchType??YL.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 t,i,r;const e=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&e?(Ph(A("replFindNoResults","No results")),this.tree.options.showNotFoundMessage??!0?(t=this.widget)==null||t.showMessage({type:2,content:A("not found","No elements found.")}):(i=this.widget)==null||i.showMessage({type:2})):((r=this.widget)==null||r.clearMessage(),this.pattern&&Ph(A("replFindResults","{0} results",this.filter.matchCount)))}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!Db.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)==null||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function j0r(n,e){return n.position===e.position&&Zct(n,e)}function Zct(n,e){return n.node.element===e.node.element&&n.startIndex===e.startIndex&&n.height===e.height&&n.endIndex===e.endIndex}class F0r{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return fa(this.stickyNodes,e.stickyNodes,j0r)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!fa(this.stickyNodes,e.stickyNodes,Zct)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class B0r{constrainStickyScrollNodes(e,t,i){for(let r=0;r<e.length;r++){const s=e[r];if(s.position+s.height>i||r>=t)return e.slice(0,r)}return e}}let zBe=class extends Ye{constructor(e,t,i,r,s,o={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=s,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(o);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=o.stickyScrollDelegate??new B0r,this._widget=this._register(new $0r(i.getScrollableElement(),i,e,r,s,o.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}get height(){return this._widget.height}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,r=0,s=this.getNextStickyNode(i,void 0,r);for(;s&&(t.push(s),r+=s.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(s),!i)));)s=this.getNextStickyNode(i,s.node,r);const o=this.constrainStickyNodes(t);return o.length?new F0r(o):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const r=this.getAncestorUnderPrevious(e,t);if(r&&!(r===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(r,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),r=this.view.getElementTop(i),s=t;return this.view.scrollTop===r-s}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:r,endIndex:s}=this.getNodeRange(e),o=this.calculateStickyNodePosition(s,t,i);return{node:e,position:o,height:i,startIndex:r,endIndex:s}}getAncestorUnderPrevious(e,t=void 0){let i=e,r=this.getParentNode(i);for(;r;){if(r===t)return i;i=r,r=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let r=this.view.getRelativeTop(e);if(r===null&&this.view.firstVisibleIndex===e&&e+1<this.view.length){const c=this.treeDelegate.getHeight(this.view.element(e)),u=this.view.getRelativeTop(e+1);r=u?u-c/this.view.renderHeight:null}if(r===null)return t;const s=this.view.element(e),o=this.treeDelegate.getHeight(s),l=r*this.view.renderHeight+o;return t+i>l&&t<=l?l-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const r=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!r.length)return[];const s=r[r.length-1];if(r.length>this.stickyScrollMaxItemCount||s.position+s.height>t)throw new Error("stickyScrollDelegate violates constraints");return r}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const r=this.model.getListRenderCount(t),s=i+r-1;return{startIndex:i,endIndex:s}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let r=0;for(let s=0;s<t.length&&s<this.stickyScrollMaxItemCount;s++)r+=this.treeDelegate.getHeight(t[s]);return r}domFocus(){this._widget.domFocus()}focusedLast(){return this._widget.focusedLast()}updateOptions(e={}){if(!e.stickyScrollMaxItemCount)return;const t=this.validateStickySettings(e);this.stickyScrollMaxItemCount!==t.stickyScrollMaxItemCount&&(this.stickyScrollMaxItemCount=t.stickyScrollMaxItemCount,this.update())}validateStickySettings(e){let t=7;return typeof e.stickyScrollMaxItemCount=="number"&&(t=Math.max(e.stickyScrollMaxItemCount,1)),{stickyScrollMaxItemCount:t}}},$0r=class{constructor(e,t,i,r,s,o){this.view=t,this.tree=i,this.treeRenderers=r,this.treeDelegate=s,this.accessibilityProvider=o,this._previousElements=[],this._previousStateDisposables=new Et,this._rootDomNode=Jt(".monaco-tree-sticky-container.empty"),e.appendChild(this._rootDomNode);const a=Jt(".monaco-tree-sticky-container-shadow");this._rootDomNode.appendChild(a),this.stickyScrollFocus=new H0r(this._rootDomNode,t),this.onDidChangeHasFocus=this.stickyScrollFocus.onDidChangeHasFocus,this.onContextMenu=this.stickyScrollFocus.onContextMenu}get height(){if(!this._previousState)return 0;const e=this._previousState.stickyNodes[this._previousState.count-1];return e.position+e.height}setState(e){const t=!!this._previousState&&this._previousState.count>0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const r=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${r.position}px`;else{this._previousStateDisposables.clear();const s=Array(e.count);for(let o=e.count-1;o>=0;o--){const a=e.stickyNodes[o],{element:l,disposable:c}=this.createElement(a,o,e.count);s[o]=l,this._rootDomNode.appendChild(l),this._previousStateDisposables.add(c)}this.stickyScrollFocus.updateElements(s,e),this._previousElements=s}this._previousState=e,this._rootDomNode.style.height=`${r.position+r.height}px`}createElement(e,t,i){const r=e.startIndex,s=document.createElement("div");s.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(s.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(s.style.lineHeight=`${e.height}px`),s.classList.add("monaco-tree-sticky-row"),s.classList.add("monaco-list-row"),s.setAttribute("data-index",`${r}`),s.setAttribute("data-parity",r%2===0?"even":"odd"),s.setAttribute("id",this.view.getElementID(r));const o=this.setAccessibilityAttributes(s,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),l=this.treeRenderers.find(f=>f.templateId===a);if(!l)throw new Error(`No renderer found for template id ${a}`);let c=e.node;c===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(c=new Proxy(e.node,{}));const u=l.renderTemplate(s);l.renderElement(c,e.startIndex,u,e.height);const d=gi(()=>{o.dispose(),l.disposeElement(c,e.startIndex,u,e.height),l.disposeTemplate(u),s.remove()});return{element:s,disposable:d}}setAccessibilityAttributes(e,t,i,r){if(!this.accessibilityProvider)return Ye.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,r))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const s=this.accessibilityProvider.getAriaLabel(t),o=s&&typeof s!="string"?s:vm(s),a=Gi(c=>{const u=c.readObservable(o);u?e.setAttribute("aria-label",u):e.removeAttribute("aria-label")});typeof s=="string"||s&&e.setAttribute("aria-label",s.get());const l=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof l=="number"&&e.setAttribute("aria-level",`${l}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class H0r extends Ye{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new Ue,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new Ue,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(_t(this.container,"focus",()=>this.onFocus())),this._register(_t(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!N7(t)&&!i6(t)){this.focusedLast()&&this.view.domFocus();return}if(!IC(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const o=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)==null?void 0:l.element)});if(o===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(o);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const r=this.state.stickyNodes[this.focusedIndex].node.element,s=this.elements[this.focusedIndex];this._onContextMenu.fire({element:r,anchor:s,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!N7(t)&&!i6(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const r=hh(i,0,t.count-1);this.setFocus(r)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e<t.count-1)&&t.lastNodePartiallyVisible()){const i=t.stickyNodes[e];this.scrollNodeUnderWidget(i.endIndex+1,t)}}scrollNodeUnderWidget(e,t){const i=t.stickyNodes[t.count-1],r=t.count>1?t.stickyNodes[t.count-2]:void 0,s=this.view.getElementTop(e),o=r?r.position+r.height+i.height:i.height;this.view.scrollTop=s-o}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function wW(n){let e=Y2.Unknown;return yce(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Y2.Twistie:yce(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=Y2.Element:yce(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=Y2.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function V0r(n){const e=N7(n.browserEvent.target);return{element:n.element?n.element.element:null,browserEvent:n.browserEvent,anchor:n.anchor,isStickyScroll:e}}function gU(n,e){e(n),n.children.forEach(t=>gU(t,e))}class fue{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 Ue,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&fa(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=>gU(u,c)),this.set([...l.values()]);return}const i=new Set,r=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>gU(l,r));const s=new Map,o=l=>s.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>gU(l,o));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=s.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 W0r extends nct{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(Zlt(e.browserEvent.target)||hE(e.browserEvent.target)||eF(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,s=i6(e.browserEvent.target);let o=!1;if(s?o=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,s)this.handleStickyScrollMouseEvent(e,t);else{if(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&&(!s||r)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),r){e.browserEvent.isHandledByList=!0;return}}s||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(Gmr(e.browserEvent.target)||Ymr(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const r=this.list.indexOf(t),s=this.list.getElementTop(r),o=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=s-o,this.list.domFocus(),this.list.setFocus([r]),this.list.setSelection([r])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!N7(t)&&!i6(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!N7(t)&&!i6(t)){super.onContextMenu(e);return}}}class z0r extends Ig{constructor(e,t,i,r,s,o,a,l){super(e,t,i,r,l),this.focusTrait=s,this.selectionTrait=o,this.anchorTrait=a}createMouseController(e){return new W0r(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const r=[],s=[];let o;i.forEach((a,l)=>{this.focusTrait.has(a)&&r.push(e+l),this.selectionTrait.has(a)&&s.push(e+l),this.anchorTrait.has(a)&&(o=e+l)}),r.length>0&&super.setFocus(Iw([...super.getFocus(),...r])),s.length>0&&super.setSelection(Iw([...super.getSelection(),...s])),typeof o=="number"&&super.setAnchor(o)}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 Jct{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 rn.filter(rn.map(this.view.onMouseDblClick,wW),e=>e.target!==Y2.Filter)}get onMouseOver(){return rn.map(this.view.onMouseOver,wW)}get onMouseOut(){return rn.map(this.view.onMouseOut,wW)}get onContextMenu(){var e;return rn.any(rn.filter(rn.map(this.view.onContextMenu,V0r),t=>!t.isStickyScroll),((e=this.stickyScrollController)==null?void 0:e.onContextMenu)??rn.None)}get onPointer(){return rn.map(this.view.onPointer,wW)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return rn.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e;return((e=this.findController)==null?void 0:e.mode)??YC.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e;return((e=this.findController)==null?void 0:e.matchType)??YL.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,s={}){this._user=e,this._options=s,this.eventBufferer=new V9,this.onDidChangeFindOpenState=rn.None,this.onDidChangeStickyScrollFocused=rn.None,this.disposables=new Et,this._onWillRefilter=new Ue,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new Ue,this.treeDelegate=new BTe(i);const o=new G6e,a=new G6e,l=this.disposables.add(new P0r(a.event)),c=new Rke;this.renderers=r.map(g=>new Tve(g,()=>this.model,o.event,l,c,s));for(const g of this.renderers)this.disposables.add(g);let u;s.keyboardNavigationLabelProvider&&(u=new O0r(this,s.keyboardNavigationLabelProvider,s.filter),s={...s,filter:u},this.disposables.add(u)),this.focus=new fue(()=>this.view.getFocusedElements()[0],s.identityProvider),this.selection=new fue(()=>this.view.getSelectedElements()[0],s.identityProvider),this.anchor=new fue(()=>this.view.getAnchorElement(),s.identityProvider),this.view=new z0r(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...R0r(()=>this.model,s),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,s),o.input=this.model.onDidChangeCollapseState;const d=rn.forEach(this.model.onDidSplice,g=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(g),this.selection.onDidModelSplice(g)})},this.disposables);d(()=>null,null,this.disposables);const f=this.disposables.add(new Ue),p=this.disposables.add(new Rm(0));if(this.disposables.add(rn.any(d,this.focus.onDidChange,this.selection.onDidChange)(()=>{p.trigger(()=>{const g=new Set;for(const m of this.focus.getNodes())g.add(m);for(const m of this.selection.getNodes())g.add(m);f.fire([...g.values()])})})),a.input=f.event,s.keyboardSupport!==!1){const g=rn.chain(this.view.onKeyDown,m=>m.filter(_=>!hE(_.target)).map(_=>new Io(_)));rn.chain(g,m=>m.filter(_=>_.keyCode===15))(this.onLeftArrow,this,this.disposables),rn.chain(g,m=>m.filter(_=>_.keyCode===17))(this.onRightArrow,this,this.disposables),rn.chain(g,m=>m.filter(_=>_.keyCode===10))(this.onSpace,this,this.disposables)}if((s.findWidgetEnabled??!0)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider){const g=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new M0r(this,this.model,this.view,u,s.contextViewProvider,g),this.focusNavigationFilter=m=>this.findController.shouldAllowFocus(m),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=rn.None,this.onDidChangeFindMatchType=rn.None;s.enableStickyScroll&&(this.stickyScrollController=new zBe(this,this.model,this.view,this.renderers,this.treeDelegate,s),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=_g(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===wM.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)==null||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===wM.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new zBe(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=rn.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)==null||t.updateOptions(e)}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}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){var e;(e=this.stickyScrollController)!=null&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),zE(t)&&((i=this.findController)==null||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}; }`));const r=e.treeStickyScrollBackground??e.listBackground;r&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${r}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${r}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const s=uw(e.listFocusAndSelectionOutline,uw(e.listSelectionOutline,e.listFocusOutline??""));s&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),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){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);const r=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(r,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);const r=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(r,t,!0)})}focusNext(e=1,t=!1,i,r=IC(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,r)}focusPrevious(e=1,t=!1,i,r=IC(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,r)}focusNextPage(e,t=IC(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=IC(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i;return((i=this.stickyScrollController)==null?void 0:i.height)??0})}focusLast(e,t=IC(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=IC(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const r=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,r)}}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 o=this.model.getParentNodeLocation(r);if(!o)return;const a=this.model.getListIndex(o);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[o]=this.view.getFocus(),a=o+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),s=e.browserEvent.altKey;this.model.setCollapsed(r,void 0,s)}dispose(){var e;vo(this.disposables),(e=this.stickyScrollController)==null||e.dispose(),this.view.dispose()}}class $Te{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new A0r(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,s){return i.sorter.compare(r.element,s.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=ss.empty(),i={}){const r=this.getElementLocation(e);this._setChildren(r,this.preserveCollapseState(t),i)}_setChildren(e,t=ss.empty(),i){const r=new Set,s=new Set,o=l=>{var u;if(l.element===null)return;const c=l;if(r.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const d=this.identityProvider.getId(c.element).toString();s.add(d),this.nodesByIdentity.set(d,c)}(u=i.onDidCreateNode)==null||u.call(i,c)},a=l=>{var u;if(l.element===null)return;const c=l;if(r.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const d=this.identityProvider.getId(c.element).toString();s.has(d)||this.nodesByIdentity.delete(d)}(u=i.onDidDeleteNode)==null||u.call(i,c)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:o,onDidDeleteNode:a})}preserveCollapseState(e=ss.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),ss.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const o=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(o)}if(!i){let o;return typeof t.collapsed>"u"?o=void 0:t.collapsed===Hp.Collapsed||t.collapsed===Hp.PreserveOrCollapsed?o=!0:t.collapsed===Hp.Expanded||t.collapsed===Hp.PreserveOrExpanded?o=!1:o=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:o}}const r=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let s;return typeof t.collapsed>"u"||t.collapsed===Hp.PreserveOrCollapsed||t.collapsed===Hp.PreserveOrExpanded?s=i.collapsed:t.collapsed===Hp.Collapsed?s=!0:t.collapsed===Hp.Expanded?s=!1:s=!!t.collapsed,{...t,collapsible:r,collapsed:s,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 Qp(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Qp(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Qp(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 Qp(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function mU(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:ss.map(ss.from(n.children),mU),collapsible:n.collapsible,collapsed:n.collapsed}}function _U(n){const e=[n.element],t=n.incompressible||!1;let i,r;for(;[r,i]=ss.consume(ss.from(n.children),2),!(r.length!==1||r[0].incompressible);)n=r[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:ss.map(ss.concat(r,i),_U),collapsible:n.collapsible,collapsed:n.collapsed}}function Ive(n,e=0){let t;return e<n.element.elements.length-1?t=[Ive(n,e+1)]:t=ss.map(ss.from(n.children),i=>Ive(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 UBe(n){return Ive(n,0)}function eut(n,e,t){return n.element===e?{...n,children:t}:{...n,children:ss.map(ss.from(n.children),i=>eut(i,e,t))}}const U0r=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class q0r{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 $Te(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=ss.empty(),i){const r=i.diffIdentityProvider&&U0r(i.diffIdentityProvider);if(e===null){const g=ss.map(t,this.enabled?_U:mU);this._setChildren(null,g,{diffIdentityProvider:r,diffDepth:1/0});return}const s=this.nodes.get(e);if(!s)throw new Qp(this.user,"Unknown compressed tree node");const o=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),c=UBe(o),u=eut(c,e,t),d=(this.enabled?_U:mU)(u),f=i.diffIdentityProvider?(g,m)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(m):void 0;if(fa(d.element.elements,o.element.elements,f)){this._setChildren(s,d.children||ss.empty(),{diffIdentityProvider:r,diffDepth:1});return}const p=l.children.map(g=>g===o?d:g);this._setChildren(l.element,p,{diffIdentityProvider:r,diffDepth:o.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,r=ss.map(i,UBe),s=ss.map(r,e?_U:mU);this._setChildren(null,s,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const r=new Set,s=a=>{for(const l of a.element.elements)r.add(l),this.nodes.set(l,a.element)},o=a=>{for(const l of a.element.elements)r.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...i,onDidCreateNode:s,onDidDeleteNode:o})}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 Qp(this.user,`Tree element not found: ${e}`);return t}}const K0r=n=>n[n.length-1];class HTe{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new HTe(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 G0r(n,e){return{splice(t,i,r){e.splice(t,i,r.map(s=>n.map(s)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function Y0r(n,e){return{...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 Q0r{get onDidSplice(){return rn.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 rn.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return rn.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||K0r;const r=s=>this.elementMapper(s.elements);this.nodeMapper=new jTe(s=>new HTe(r,s)),this.model=new q0r(e,G0r(this.nodeMapper,t),Y0r(r,i))}setChildren(e,t=ss.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}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 X0r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s};class VTe extends Jct{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,r,s={}){super(e,t,i,r,s),this.user=e}setChildren(e,t=ss.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 $Te(e,t,i)}}class tut{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,r){let s=this.stickyScrollDelegate.getCompressedNode(e);s||(s=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),s.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,r)):(i.compressedTreeNode=s,this.renderer.renderCompressedElements(s,t,i.data,r))}disposeElement(e,t,i,r){var s,o,a,l;i.compressedTreeNode?(o=(s=this.renderer).disposeCompressedElements)==null||o.call(s,i.compressedTreeNode,t,i.data,r):(l=(a=this.renderer).disposeElement)==null||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}}X0r([xl],tut.prototype,"compressedTreeNodeProvider",null);class Z0r{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let r=0;r<e.length;r++){const s=e[r],o=s.position+s.height;if(r+1<e.length&&o+e[r+1].height>i||r>=t-1&&t<e.length){const l=e.slice(0,r),c=e.slice(r),u=this.compressStickyNodes(c);return[...l,u]}}return e}compressStickyNodes(e){if(e.length===0)throw new Error("Can't compress empty sticky nodes");const t=this.modelProvider();if(!t.isCompressionEnabled())return e[0];const i=[];for(let c=0;c<e.length;c++){const u=e[c],d=t.getCompressedTreeNode(u.node.element);if(d.element){if(c!==0&&d.element.incompressible)break;i.push(...d.element.elements)}}if(i.length<2)return e[0];const r=e[e.length-1],s={elements:i,incompressible:!1},o={...r.node,children:[],element:s},a=new Proxy(e[0].node,{}),l={node:a,startIndex:e[0].startIndex,endIndex:r.endIndex,position:e[0].position,height:e[0].height};return this.compressedStickyNodes.set(a,o),l}}function J0r(n,e){return e&&{...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 nut extends VTe{constructor(e,t,i,r,s={}){const o=()=>this,a=new Z0r(()=>this.model),l=r.map(c=>new tut(o,a,c));super(e,t,i,l,{...J0r(o,s),stickyScrollDelegate:a})}setChildren(e,t=ss.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new Q0r(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)}}function pue(n){return{...n,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function Lve(n,e){return e.parent?e.parent===n?!0:Lve(n,e.parent):!1}function eyr(n,e){return n===e||Lve(n,e)||Lve(e,n)}class WTe{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new WTe(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 tyr{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(...Ni.asClassNameArray(Yt.treeItemLoading)),!0):(t.classList.remove(...Ni.asClassNameArray(Yt.treeItemLoading)),!1)}disposeElement(e,t,i,r){var s,o;(o=(s=this.renderer).disposeElement)==null||o.call(s,this.nodeMapper.map(e),t,i.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function qBe(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function KBe(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class nyr extends a${constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function gue(n){return n instanceof a$?new nyr(n):n}class iyr{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.call(i,gue(e),t)}onDragOver(e,t,i,r,s,o=!0){return this.dnd.onDragOver(gue(e),t&&t.element,i,r,s)}drop(e,t,i,r,s){this.dnd.drop(gue(e),t&&t.element,i,r,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}dispose(){this.dnd.dispose()}}function iut(n){return n&&{...n,collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new iyr(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:n.accessibilityProvider&&{...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.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&&{...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 Ave(n,e){e(n),n.children.forEach(t=>Ave(t,e))}class rut{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return rn.map(this.tree.onDidChangeFocus,qBe)}get onDidChangeSelection(){return rn.map(this.tree.onDidChangeSelection,qBe)}get onMouseDblClick(){return rn.map(this.tree.onMouseDblClick,KBe)}get onPointer(){return rn.map(this.tree.onPointer,KBe)}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 onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,r,s,o={}){this.user=e,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new Ue,this._onDidChangeNodeSlowState=new Ue,this.nodeMapper=new jTe(a=>new WTe(a)),this.disposables=new Et,this.identityProvider=o.identityProvider,this.autoExpandSingleChildren=typeof o.autoExpandSingleChildren>"u"?!1:o.autoExpandSingleChildren,this.sorter=o.sorter,this.getDefaultCollapseState=a=>o.collapseByDefault?o.collapseByDefault(a)?Hp.PreserveOrCollapsed:Hp.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,r,o),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=pue({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,r,s){const o=new BTe(i),a=r.map(c=>new tyr(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=iut(s)||{};return new VTe(e,t,o,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}async setInput(e,t){this.refreshPromises.forEach(r=>r.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await 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)}async _updateChildren(e=this.root.element,t=!0,i=!1,r,s){if(typeof this.root.element>"u")throw new Qp(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await rn.toPromise(this._onDidRender.event));const o=this.getDataNode(e);if(await this.refreshAndRenderNode(o,t,r,s),i)try{this.tree.rerender(o)}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)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new Qp(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await rn.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await this.root.refreshPromise,await rn.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&&(await this.root.refreshPromise,await rn.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 Qp(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,r){await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,r)}async refreshNode(e,t,i){let r;if(this.subTreeRefreshPromises.forEach((s,o)=>{!r&&eyr(o,e)&&(r=s.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,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){let r;e.refreshPromise=new Promise(s=>r=s),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const s=await this.doRefreshNode(e,t,i);e.stale=!1,await Ime.settled(s.map(o=>this.doRefreshSubTree(o,t,i)))}finally{r()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let r;if(!e.hasChildren)r=Promise.resolve(ss.empty());else{const s=this.doGetChildren(e);if(V6e(s))r=Promise.resolve(s);else{const o=Nw(800);o.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),r=s.finally(()=>o.cancel())}}try{const s=await r;return this.setChildren(e,s,t,i)}catch(s){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Km(s))return[];throw s}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 V6e(i)?this.processChildren(i):(t=Ic(async()=>this.processChildren(await 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(tr))}setChildren(e,t,i,r){const s=[...t];if(e.children.length===0&&s.length===0)return[];const o=new Map,a=new Map;for(const u of e.children)o.set(u.element,u),this.identityProvider&&a.set(u.id,{node:u,collapsed:this.tree.hasElement(u)&&this.tree.isCollapsed(u)});const l=[],c=s.map(u=>{const d=!!this.dataSource.hasChildren(u);if(!this.identityProvider){const m=pue({element:u,parent:e,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return d&&m.defaultCollapseState===Hp.PreserveOrExpanded&&l.push(m),m}const f=this.identityProvider.getId(u).toString(),p=a.get(f);if(p){const m=p.node;return o.delete(m.element),this.nodes.delete(m.element),this.nodes.set(u,m),m.element=u,m.hasChildren=d,i?p.collapsed?(m.children.forEach(_=>Ave(_,v=>this.nodes.delete(v.element))),m.children.splice(0,m.children.length),m.stale=!0):l.push(m):d&&!p.collapsed&&l.push(m),m}const g=pue({element:u,parent:e,id:f,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return r&&r.viewState.focus&&r.viewState.focus.indexOf(f)>-1&&r.focus.push(g),r&&r.viewState.selection&&r.viewState.selection.indexOf(f)>-1&&r.selection.push(g),(r&&r.viewState.expanded&&r.viewState.expanded.indexOf(f)>-1||d&&g.defaultCollapseState===Hp.PreserveOrExpanded)&&l.push(g),g});for(const u of o.values())Ave(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].forceExpanded=!0,l.push(c[0])),l}render(e,t,i){const r=e.children.map(o=>this.asTreeElement(o,t)),s=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(o){return i.diffIdentityProvider.getId(o.element)}}};this.tree.setChildren(e===this.root?null:e,r,s),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:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?ss.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 zTe{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 zTe(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 ryr{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(...Ni.asClassNameArray(Yt.treeItemLoading)),!0):(t.classList.remove(...Ni.asClassNameArray(Yt.treeItemLoading)),!1)}disposeElement(e,t,i,r){var s,o;(o=(s=this.renderer).disposeElement)==null||o.call(s,this.nodeMapper.map(e),t,i.templateData,r)}disposeCompressedElements(e,t,i,r){var s,o;(o=(s=this.renderer).disposeCompressedElements)==null||o.call(s,this.compressibleNodeMapperProvider().map(e),t,i.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=vo(this.disposables)}}function syr(n){const e=n&&iut(n);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class oyr extends rut{constructor(e,t,i,r,s,o,a={}){super(e,t,i,s,o,a),this.compressionDelegate=r,this.compressibleNodeMapper=new jTe(l=>new zTe(l)),this.filter=a.filter}createTree(e,t,i,r,s){const o=new BTe(i),a=r.map(c=>new ryr(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=syr(s)||{};return new nut(e,t,o,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const r=p=>this.identityProvider.getId(p).toString(),s=p=>{const g=new Set;for(const m of p){const _=this.tree.getCompressedTreeNode(m===this.root?null:m);if(_.element)for(const v of _.element.elements)g.add(r(v.element))}return g},o=s(this.tree.getSelection()),a=s(this.tree.getFocus());super.render(e,t,i);const l=this.getSelection();let c=!1;const u=this.getFocus();let d=!1;const f=p=>{const g=p.element;if(g)for(let m=0;m<g.elements.length;m++){const _=r(g.elements[m].element),v=g.elements[g.elements.length-1].element;o.has(_)&&l.indexOf(v)===-1&&(l.push(v),c=!0),a.has(_)&&u.indexOf(v)===-1&&(u.push(v),d=!0)}p.children.forEach(f)};f(this.tree.getCompressedTreeNode(e===this.root?null:e)),c&&this.setSelection(l),d&&this.setFocus(u)}processChildren(e){return this.filter&&(e=ss.filter(e,t=>{const i=this.filter.filter(t,1),r=ayr(i);if(r===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return r===1})),super.processChildren(e)}}function ayr(n){return typeof n=="boolean"?n?1:0:FTe(n)?j7(n.visibility):j7(n)}class lyr extends Jct{constructor(e,t,i,r,s,o={}){super(e,t,i,r,o),this.user=e,this.dataSource=s,this.identityProvider=o.identityProvider}createModel(e,t,i){return new $Te(e,t,i)}}new yn("isMac",zr,A("isMac","Whether the operating system is macOS"));new yn("isLinux",Nh,A("isLinux","Whether the operating system is Linux"));const $te=new yn("isWindows",Wu,A("isWindows","Whether the operating system is Windows")),sut=new yn("isWeb",FA,A("isWeb","Whether the platform is a web browser"));new yn("isMacNative",zr&&!FA,A("isMacNative","Whether the operating system is macOS on a non-browser platform"));new yn("isIOS",Fb,A("isIOS","Whether the operating system is iOS"));new yn("isMobile",Jst,A("isMobile","Whether the platform is a mobile web browser"));new yn("isDevelopment",!1,!0);new yn("productQualityType","",A("productQualityType","Quality type of VS Code"));const out="inputFocus",aut=new yn(out,!1,A("inputFocus","Whether keyboard focus is inside an input box"));var ex=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Yo=function(n,e){return function(t,i){e(t,i,n)}};const Qm=Ur("listService");class cyr{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Et,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)==null||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)==null||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new ict(_g(),"").style(WA)),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),ete(e.getHTMLElement())&&this.setLastFocusedList(e),U_(e.onDidFocus(()=>this.setLastFocusedList(e)),gi(()=>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 F7=new yn("listScrollAtBoundary","none");It.or(F7.isEqualTo("top"),F7.isEqualTo("both"));It.or(F7.isEqualTo("bottom"),F7.isEqualTo("both"));const lut=new yn("listFocus",!0),cut=new yn("treestickyScrollFocused",!1),Hte=new yn("listSupportsMultiselect",!0),uut=It.and(lut,It.not(out),cut.negate()),UTe=new yn("listHasSelectionOrFocus",!1),qTe=new yn("listDoubleSelection",!1),KTe=new yn("listMultiSelection",!1),Vte=new yn("listSelectionNavigation",!1),uyr=new yn("listSupportsFind",!0),GTe=new yn("treeElementCanCollapse",!1),dyr=new yn("treeElementHasParent",!1),YTe=new yn("treeElementCanExpand",!1),hyr=new yn("treeElementHasChild",!1),fyr=new yn("treeFindOpen",!1),dut="listTypeNavigationMode",hut="listAutomaticKeyboardNavigation";function Wte(n,e){const t=n.createScoped(e.getHTMLElement());return lut.bindTo(t),t}function zte(n,e){const t=F7.bindTo(n),i=()=>{const r=e.scrollTop===0,s=e.scrollHeight-e.renderHeight-e.scrollTop<1;r&&s?t.set("both"):r?t.set("top"):s?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const qA="workbench.list.multiSelectModifier",vU="workbench.list.openMode",km="workbench.list.horizontalScrolling",QTe="workbench.list.defaultFindMode",XTe="workbench.list.typeNavigationMode",HG="workbench.list.keyboardNavigation",Vb="workbench.list.scrollByPage",ZTe="workbench.list.defaultFindMatchType",B7="workbench.tree.indent",VG="workbench.tree.renderIndentGuides",Wb="workbench.list.smoothScrolling",Jy="workbench.list.mouseWheelScrollSensitivity",e1="workbench.list.fastScrollSensitivity",WG="workbench.tree.expandMode",zG="workbench.tree.enableStickyScroll",UG="workbench.tree.stickyScrollMaxItemCount";function t1(n){return n.getValue(qA)==="alt"}class pyr extends Ye{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=t1(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(qA)&&(this.useAltAsMultipleSelectionModifier=t1(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:ect(e)}isSelectionRangeChangeEvent(e){return tct(e)}}function Ute(n,e){const t=n.get(Dr),i=n.get(Ws),r=new Et;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(o){return i.mightProducePrintableCharacter(o)}},smoothScrolling:!!t.getValue(Wb),mouseWheelScrollSensitivity:t.getValue(Jy),fastScrollSensitivity:t.getValue(e1),multipleSelectionController:e.multipleSelectionController??r.add(new pyr(t)),keyboardNavigationEventFilter:_yr(i),scrollByPage:!!t.getValue(Vb)},r]}let GBe=class extends Ig{constructor(e,t,i,r,s,o,a,l,c){const u=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!l.getValue(km),[d,f]=c.invokeFunction(Ute,s);super(e,t,i,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables.add(f),this.contextKeyService=Wte(o,this),this.disposables.add(zte(this.contextKeyService,this)),this.listSupportsMultiSelect=Hte.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),Vte.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=UTe.bindTo(this.contextKeyService),this.listDoubleSelection=qTe.bindTo(this.contextKeyService),this.listMultiSelection=KTe.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=t1(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.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(qA)&&(this._useAltAsMultipleSelectionModifier=t1(l));let m={};if(g.affectsConfiguration(km)&&this.horizontalScrolling===void 0){const _=!!l.getValue(km);m={...m,horizontalScrolling:_}}if(g.affectsConfiguration(Vb)){const _=!!l.getValue(Vb);m={...m,scrollByPage:_}}if(g.affectsConfiguration(Wb)){const _=!!l.getValue(Wb);m={...m,smoothScrolling:_}}if(g.affectsConfiguration(Jy)){const _=l.getValue(Jy);m={...m,mouseWheelScrollSensitivity:_}}if(g.affectsConfiguration(e1)){const _=l.getValue(e1);m={...m,fastScrollSensitivity:_}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new fut(this,{configurationService:l,...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?zA(e):WA)}};GBe=ex([Yo(5,Oi),Yo(6,Qm),Yo(7,Dr),Yo(8,mi)],GBe);let YBe=class extends b0r{constructor(e,t,i,r,s,o,a,l,c){const u=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!l.getValue(km),[d,f]=c.invokeFunction(Ute,s);super(e,t,i,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables=new Et,this.disposables.add(f),this.contextKeyService=Wte(o,this),this.disposables.add(zte(this.contextKeyService,this.widget)),this.horizontalScrolling=s.horizontalScrolling,this.listSupportsMultiSelect=Hte.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),Vte.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this._useAltAsMultipleSelectionModifier=t1(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(qA)&&(this._useAltAsMultipleSelectionModifier=t1(l));let m={};if(g.affectsConfiguration(km)&&this.horizontalScrolling===void 0){const _=!!l.getValue(km);m={...m,horizontalScrolling:_}}if(g.affectsConfiguration(Vb)){const _=!!l.getValue(Vb);m={...m,scrollByPage:_}}if(g.affectsConfiguration(Wb)){const _=!!l.getValue(Wb);m={...m,smoothScrolling:_}}if(g.affectsConfiguration(Jy)){const _=l.getValue(Jy);m={...m,mouseWheelScrollSensitivity:_}}if(g.affectsConfiguration(e1)){const _=l.getValue(e1);m={...m,fastScrollSensitivity:_}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new fut(this,{configurationService:l,...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?zA(e):WA)}dispose(){this.disposables.dispose(),super.dispose()}};YBe=ex([Yo(5,Oi),Yo(6,Qm),Yo(7,Dr),Yo(8,mi)],YBe);let QBe=class extends kve{constructor(e,t,i,r,s,o,a,l,c,u){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(km),[f,p]=u.invokeFunction(Ute,o);super(e,t,i,r,s,{keyboardSupport:!1,...f,horizontalScrolling:d}),this.disposables.add(p),this.contextKeyService=Wte(a,this),this.disposables.add(zte(this.contextKeyService,this)),this.listSupportsMultiSelect=Hte.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Vte.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=UTe.bindTo(this.contextKeyService),this.listDoubleSelection=qTe.bindTo(this.contextKeyService),this.listMultiSelection=KTe.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=t1(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||_.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||_.length>0)})),this.disposables.add(c.onDidChangeConfiguration(m=>{m.affectsConfiguration(qA)&&(this._useAltAsMultipleSelectionModifier=t1(c));let _={};if(m.affectsConfiguration(km)&&this.horizontalScrolling===void 0){const v=!!c.getValue(km);_={..._,horizontalScrolling:v}}if(m.affectsConfiguration(Vb)){const v=!!c.getValue(Vb);_={..._,scrollByPage:v}}if(m.affectsConfiguration(Wb)){const v=!!c.getValue(Wb);_={..._,smoothScrolling:v}}if(m.affectsConfiguration(Jy)){const v=c.getValue(Jy);_={..._,mouseWheelScrollSensitivity:v}}if(m.affectsConfiguration(e1)){const v=c.getValue(e1);_={..._,fastScrollSensitivity:v}}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new gyr(this,{configurationService:c,...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?zA(e):WA)}dispose(){this.disposables.dispose(),super.dispose()}};QBe=ex([Yo(6,Oi),Yo(7,Qm),Yo(8,Dr),Yo(9,mi)],QBe);class JTe extends Ye{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new Ue),this.onDidOpen=this._onDidOpen.event,this._register(rn.filter(this.widget.onDidChangeSelection,i=>IC(i.browserEvent))(i=>this.onSelectionFromKeyboard(i))),this._register(this.widget.onPointer(i=>this.onPointer(i.element,i.browserEvent))),this._register(this.widget.onMouseDblClick(i=>this.onMouseDblClick(i.element,i.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(vU))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(vU)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(vU))!=="doubleClick")}))):this.openOnSingleClick=(t==null?void 0:t.openOnSingleClick)??!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;this._open(this.getSelectedElement(),i,r,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const r=t.button===1,s=!0,o=r,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,s,o,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 s=!1,o=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,s,o,a,t)}_open(e,t,i,r,s){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:r,element:e,browserEvent:s})}}class fut extends JTe{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class gyr extends JTe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class myr extends JTe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function _yr(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 Nve=class extends VTe{constructor(e,t,i,r,s,o,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:f}=o.invokeFunction(d$,s);super(e,t,i,r,u),this.disposables.add(f),this.internals=new QL(this,s,d,s.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Nve=ex([Yo(5,mi),Yo(6,Oi),Yo(7,Qm),Yo(8,Dr)],Nve);let XBe=class extends nut{constructor(e,t,i,r,s,o,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:f}=o.invokeFunction(d$,s);super(e,t,i,r,u),this.disposables.add(f),this.internals=new QL(this,s,d,s.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)}};XBe=ex([Yo(5,mi),Yo(6,Oi),Yo(7,Qm),Yo(8,Dr)],XBe);let ZBe=class extends lyr{constructor(e,t,i,r,s,o,a,l,c,u){const{options:d,getTypeNavigationMode:f,disposable:p}=a.invokeFunction(d$,o);super(e,t,i,r,s,d),this.disposables.add(p),this.internals=new QL(this,o,f,o.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)}};ZBe=ex([Yo(6,mi),Yo(7,Oi),Yo(8,Qm),Yo(9,Dr)],ZBe);let Dve=class extends rut{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,r,s,o,a,l,c,u){const{options:d,getTypeNavigationMode:f,disposable:p}=a.invokeFunction(d$,o);super(e,t,i,r,s,d),this.disposables.add(p),this.internals=new QL(this,o,f,o.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)}};Dve=ex([Yo(6,mi),Yo(7,Oi),Yo(8,Qm),Yo(9,Dr)],Dve);let JBe=class extends oyr{constructor(e,t,i,r,s,o,a,l,c,u,d){const{options:f,getTypeNavigationMode:p,disposable:g}=l.invokeFunction(d$,a);super(e,t,i,r,s,o,f),this.disposables.add(g),this.internals=new QL(this,a,p,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};JBe=ex([Yo(7,mi),Yo(8,Oi),Yo(9,Qm),Yo(10,Dr)],JBe);function put(n){const e=n.getValue(QTe);if(e==="highlight")return YC.Highlight;if(e==="filter")return YC.Filter;const t=n.getValue(HG);if(t==="simple"||t==="highlight")return YC.Highlight;if(t==="filter")return YC.Filter}function gut(n){const e=n.getValue(ZTe);if(e==="fuzzy")return YL.Fuzzy;if(e==="contiguous")return YL.Contiguous}function d$(n,e){const t=n.get(Dr),i=n.get(Zw),r=n.get(Oi),s=n.get(mi),o=()=>{const f=r.getContextKeyValue(dut);if(f==="automatic")return _y.Automatic;if(f==="trigger"||r.getContextKeyValue(hut)===!1)return _y.Trigger;const g=t.getValue(XTe);if(g==="automatic")return _y.Automatic;if(g==="trigger")return _y.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(km),[l,c]=s.invokeFunction(Ute,e),u=e.paddingBottom,d=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(VG);return{getTypeNavigationMode:o,disposable:c,options:{keyboardSupport:!1,...l,indent:typeof t.getValue(B7)=="number"?t.getValue(B7):void 0,renderIndentGuides:d,smoothScrolling:!!t.getValue(Wb),defaultFindMode:put(t),defaultFindMatchType:gut(t),horizontalScrolling:a,scrollByPage:!!t.getValue(Vb),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(WG)==="doubleClick",contextViewProvider:i,findWidgetStyles:C_r,enableStickyScroll:!!t.getValue(zG),stickyScrollMaxItemCount:Number(t.getValue(UG))}}}let QL=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,r,s,o,a){this.tree=e,this.disposables=[],this.contextKeyService=Wte(s,e),this.disposables.push(zte(this.contextKeyService,e)),this.listSupportsMultiSelect=Hte.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),Vte.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=uyr.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=UTe.bindTo(this.contextKeyService),this.hasDoubleSelection=qTe.bindTo(this.contextKeyService),this.hasMultiSelection=KTe.bindTo(this.contextKeyService),this.treeElementCanCollapse=GTe.bindTo(this.contextKeyService),this.treeElementHasParent=dyr.bindTo(this.contextKeyService),this.treeElementCanExpand=YTe.bindTo(this.contextKeyService),this.treeElementHasChild=hyr.bindTo(this.contextKeyService),this.treeFindOpen=fyr.bindTo(this.contextKeyService),this.treeStickyScrollFocused=cut.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=t1(a),this.updateStyleOverrides(r);const c=()=>{const d=e.getFocus()[0];if(!d)return;const f=e.getNode(d);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(d)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(d))},u=new Set;u.add(dut),u.add(hut),this.disposables.push(this.contextKeyService,o.register(e),e.onDidChangeSelection(()=>{const d=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(d.length>0||f.length>0),this.hasMultiSelection.set(d.length>1),this.hasDoubleSelection.set(d.length===2)})}),e.onDidChangeFocus(()=>{const d=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(d.length>0||f.length>0),c()}),e.onDidChangeCollapseState(c),e.onDidChangeModel(c),e.onDidChangeFindOpenState(d=>this.treeFindOpen.set(d)),e.onDidChangeStickyScrollFocused(d=>this.treeStickyScrollFocused.set(d)),a.onDidChangeConfiguration(d=>{let f={};if(d.affectsConfiguration(qA)&&(this._useAltAsMultipleSelectionModifier=t1(a)),d.affectsConfiguration(B7)){const p=a.getValue(B7);f={...f,indent:p}}if(d.affectsConfiguration(VG)&&t.renderIndentGuides===void 0){const p=a.getValue(VG);f={...f,renderIndentGuides:p}}if(d.affectsConfiguration(Wb)){const p=!!a.getValue(Wb);f={...f,smoothScrolling:p}}if(d.affectsConfiguration(QTe)||d.affectsConfiguration(HG)){const p=put(a);f={...f,defaultFindMode:p}}if(d.affectsConfiguration(XTe)||d.affectsConfiguration(HG)){const p=i();f={...f,typeNavigationMode:p}}if(d.affectsConfiguration(ZTe)){const p=gut(a);f={...f,defaultFindMatchType:p}}if(d.affectsConfiguration(km)&&t.horizontalScrolling===void 0){const p=!!a.getValue(km);f={...f,horizontalScrolling:p}}if(d.affectsConfiguration(Vb)){const p=!!a.getValue(Vb);f={...f,scrollByPage:p}}if(d.affectsConfiguration(WG)&&t.expandOnlyOnTwistieClick===void 0&&(f={...f,expandOnlyOnTwistieClick:a.getValue(WG)==="doubleClick"}),d.affectsConfiguration(zG)){const p=a.getValue(zG);f={...f,enableStickyScroll:p}}if(d.affectsConfiguration(UG)){const p=Math.max(1,a.getValue(UG));f={...f,stickyScrollMaxItemCount:p}}if(d.affectsConfiguration(Jy)){const p=a.getValue(Jy);f={...f,mouseWheelScrollSensitivity:p}}if(d.affectsConfiguration(e1)){const p=a.getValue(e1);f={...f,fastScrollSensitivity:p}}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(d=>{d.affectsSome(u)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new myr(e,{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?zA(e):WA)}dispose(){this.disposables=vo(this.disposables)}};QL=ex([Yo(4,Oi),Yo(5,Qm),Yo(6,Dr)],QL);const vyr=Ca.as(bv.Configuration);vyr.registerConfiguration({id:"workbench",order:7,title:A("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[qA]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[A("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),A("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:A({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.")},[vU]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:A({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.")},[km]:{type:"boolean",default:!1,description:A("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Vb]:{type:"boolean",default:!1,description:A("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[B7]:{type:"number",default:8,minimum:4,maximum:40,description:A("tree indent setting","Controls tree indentation in pixels.")},[VG]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:A("render tree indent guides","Controls whether the tree should render indent guides.")},[Wb]:{type:"boolean",default:!1,description:A("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Jy]:{type:"number",default:1,markdownDescription:A("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[e1]:{type:"number",default:5,markdownDescription:A("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[QTe]:{type:"string",enum:["highlight","filter"],enumDescriptions:[A("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),A("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:A("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[HG]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[A("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),A("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),A("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:A("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:A("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[ZTe]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[A("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),A("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:A("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[WG]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:A("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.")},[zG]:{type:"boolean",default:!0,description:A("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},[UG]:{type:"number",minimum:1,default:7,markdownDescription:A("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[XTe]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:A("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.")}}});class fE extends Ye{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(t==null?void 0:t.supportIcons)??!1,this.domNode=Ot(e,Jt("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",r){e||(e=""),r&&(e=fE.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Xf(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){var i,r,s;const e=[];let t=0;for(const o of this.highlights){if(o.end===o.start)continue;if(t<o.start){const c=this.text.substring(t,o.start);this.supportIcons?e.push(...uE(c)):e.push(c),t=o.start}const a=this.text.substring(t,o.end),l=Jt("span.highlight",void 0,...this.supportIcons?uE(a):[a]);o.extraClasses&&l.classList.add(...o.extraClasses),e.push(l),t=o.end}if(t<this.text.length){const o=this.text.substring(t);this.supportIcons?e.push(...uE(o)):e.push(o)}if(_u(this.domNode,...e),(r=(i=this.options)==null?void 0:i.hoverDelegate)!=null&&r.showNativeHover)this.domNode.title=this.title;else if(!this.customHover&&this.title!==""){const o=((s=this.options)==null?void 0:s.hoverDelegate)??jh("mouse");this.customHover=this._register(Jb().setupManagedHover(o,this.domNode,this.title))}else this.customHover&&this.customHover.update(this.title);this.didEverRender=!0}static escapeNewLines(e,t){let i=0,r=0;return e.replace(/\r\n|\r|\n/g,(s,o)=>{r=s===`\r `?-1:0,o+=i;for(const a of t)a.end<=o||(a.start>=o&&(a.start+=r),a.end>=o&&(a.end+=r));return i+=r,"⏎"})}}class Cj{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||Xf(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class qG extends Ye{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new Cj(Ot(e,Jt(".monaco-icon-label")))),this.labelContainer=Ot(this.domNode.element,Jt(".monaco-icon-label-container")),this.nameContainer=Ot(this.labelContainer,Jt("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=this._register(new Cyr(this.nameContainer,!!t.supportIcons)):this.nameNode=new byr(this.nameContainer),this.hoverDelegate=(t==null?void 0:t.hoverDelegate)??jh("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const r=["monaco-icon-label"],s=["monaco-icon-label-container"];let o="";i&&(i.extraClasses&&r.push(...i.extraClasses),i.italic&&r.push("italic"),i.strikethrough&&r.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&(typeof i.title=="string"?o+=i.title:o+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i!=null&&i.iconPath){let l;!a||!Lc(a)?(l=Jt(".monaco-icon-label-iconpath"),this.domNode.element.prepend(l)):l=a,l.style.backgroundImage=Dw(i==null?void 0:i.iconPath)}else a&&a.remove();if(this.domNode.classNames=r,this.domNode.element.setAttribute("aria-label",o),this.labelContainer.classList.value="",this.labelContainer.classList.add(...s),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 l=this.getOrCreateDescriptionNode();l instanceof fE?(l.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(l.element,i==null?void 0:i.descriptionTitle)):(l.textContent=t&&(i!=null&&i.labelEscapeNewLines)?fE.escapeNewLines(t,[]):t||"",this.setupHover(l.element,(i==null?void 0:i.descriptionTitle)||""),l.empty=!t)}if(i!=null&&i.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=(i==null?void 0:i.suffix)??""}}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.showNativeHover)(function(s,o){cf(o)?s.title=uTe(o):o!=null&&o.markdownNotSupportedFallback?s.title=o.markdownNotSupportedFallback:s.removeAttribute("title")})(e,t);else{const r=Jb().setupManagedHover(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()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new Cj(Slr(this.nameContainer,Jt("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new Cj(Ot(e.element,Jt("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new Cj(Ot(this.labelContainer,Jt("span.monaco-icon-description-container"))));(e=this.creationOptions)!=null&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new fE(Ot(t.element,Jt("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new Cj(Ot(t.element,Jt("span.label-description"))))}return this.descriptionNode}}class byr{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Xf(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=Ot(this.container,Jt("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],s=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${i}`;Ot(this.container,Jt("a.label-name",{id:s,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},r)),i<e.length-1&&Ot(this.container,Jt("span.label-separator",void 0,(t==null?void 0:t.separator)||"/"))}}}}function yyr(n,e,t){if(!t)return;let i=0;return n.map(r=>{const s={start:i,end:i+r.length},o=t.map(a=>ed.intersect(s,a)).filter(a=>!ed.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=s.end+e.length,o})}class Cyr extends Ye{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Xf(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=this._register(new fE(Ot(this.container,Jt("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=yyr(e,i,t==null?void 0:t.matches);for(let s=0;s<e.length;s++){const o=e[s],a=r?r[s]:void 0,l=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${s}`,c=Jt("a.label-name",{id:l,"data-icon-label-count":e.length,"data-icon-label-index":s,role:"treeitem"});this._register(new fE(Ot(this.container,c),{supportIcons:this.supportIcons})).set(o,a,void 0,t==null?void 0:t.labelEscapeNewLines),s<e.length-1&&Ot(c,Jt("span.label-separator",void 0,i))}}}}const xW=Jt,mut={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class t3 extends Ye{constructor(e,t,i){super(),this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const r=this.options.keybindingLabelForeground;this.domNode=Ot(e,xW(".monaco-keybinding")),r&&(this.domNode.style.color=r),this.hover=this._register(Jb().setupManagedHover(jh("mouse"),this.domNode,"")),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&t3.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){const e=this.keybinding.getChords();e[0]&&this.renderChord(this.domNode,e[0],this.matches?this.matches.firstPart:null);for(let i=1;i<e.length;i++)Ot(this.domNode,xW("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,e[i],this.matches?this.matches.chordPart:null);const t=this.options.disableTitle??!1?void 0:this.keybinding.getAriaLabel()||void 0;this.hover.update(t),this.domNode.setAttribute("aria-label",t||"")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){mu(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const r=mTe.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 s=t.keyLabel;s&&this.renderKey(e,s,!!(i!=null&&i.keyCode),"")}renderKey(e,t,i,r){Ot(e,this.createKeyElement(t,i?".highlight":"")),r&&Ot(e,xW("span.monaco-keybinding-key-separator",void 0,r))}renderUnbound(e){Ot(e,this.createKeyElement(A("unbound","Unbound")))}createKeyElement(e,t=""){const i=xW("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&&Xf(e.firstPart,t.firstPart)&&Xf(e.chordPart,t.chordPart)}}const e9e=new Bb(()=>{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function wyr(n,e,t=!1){const i=n||"",r=e||"",s=e9e.value.collator.compare(i,r);return e9e.value.collatorIsNumeric&&s===0&&i!==r?i<r?-1:1:s}function xyr(n,e,t){const i=n.toLowerCase(),r=e.toLowerCase(),s=Syr(n,e,t);if(s)return s;const o=i.endsWith(t),a=r.endsWith(t);if(o!==a)return o?-1:1;const l=wyr(i,r);return l!==0?l:i.localeCompare(r)}function Syr(n,e,t){const i=n.toLowerCase(),r=e.toLowerCase(),s=i.startsWith(t),o=r.startsWith(t);if(s!==o)return s?-1:1;if(s&&o){if(i.length<r.length)return-1;if(i.length>r.length)return 1}return 0}var qte=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Rve=function(n,e){return function(t,i){e(t,i,n)}},Pve;const Vv=Jt;class _ut{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new Bb(()=>{const r=i.label??"",s=Zj(r).text.trim(),o=i.ariaLabel||[r,this.saneDescription,this.saneDetail].map(a=>Dpr(a)).filter(a=>!!a).join(", ");return{saneLabel:r,saneSortLabel:s,saneAriaLabel:o}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}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 saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=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 Au extends _ut{constructor(e,t,i,r,s,o){var a,l,c;super(e,t,s),this.fireButtonTriggered=i,this._onChecked=r,this.item=s,this._separator=o,this._checked=!1,this.onChecked=t?rn.map(rn.filter(this._onChecked.event,u=>u.element===this),u=>u.checked):rn.None,this._saneDetail=s.detail,this._labelHighlights=(a=s.highlights)==null?void 0:a.label,this._descriptionHighlights=(l=s.highlights)==null?void 0:l.description,this._detailHighlights=(c=s.highlights)==null?void 0:c.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var J0;(function(n){n[n.NONE=0]="NONE",n[n.MOUSE_HOVER=1]="MOUSE_HOVER",n[n.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(J0||(J0={}));class o2 extends _ut{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=J0.NONE}}class Eyr{getHeight(e){return e instanceof o2?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof Au?KG.ID:GG.ID}}class kyr{getWidgetAriaLabel(){return A("quickInput","Quick Input")}getAriaLabel(e){var t;return(t=e.separator)!=null&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof Au)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class vut{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Et,t.toDisposeTemplate=new Et,t.entry=Ot(e,Vv(".quick-input-list-entry"));const i=Ot(t.entry,Vv("label.quick-input-list-label"));t.toDisposeTemplate.add(Da(i,Xt.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=Ot(i,Vv("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const r=Ot(i,Vv(".quick-input-list-rows")),s=Ot(r,Vv(".quick-input-list-row")),o=Ot(r,Vv(".quick-input-list-row"));t.label=new qG(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=Tke(t.label.element,Vv(".quick-input-list-icon"));const a=Ot(s,Vv(".quick-input-list-entry-keybinding"));t.keybinding=new t3(a,Yf),t.toDisposeTemplate.add(t.keybinding);const l=Ot(o,Vv(".quick-input-list-label-meta"));return t.detail=new qG(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=Ot(t.entry,Vv(".quick-input-list-separator")),t.actionBar=new hg(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}var xI;let KG=(xI=class extends vut{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return Pve.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Da(t.checkbox,Xt.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){var f;const r=e.element;i.element=r,r.element=i.entry??void 0;const s=r.item;i.checkbox.checked=r.checked,i.toDisposeElement.add(r.onChecked(p=>i.checkbox.checked=p)),i.checkbox.disabled=r.checkboxDisabled;const{labelHighlights:o,descriptionHighlights:a,detailHighlights:l}=r;if(s.iconPath){const p=cM(this.themeService.getColorTheme().type)?s.iconPath.dark:s.iconPath.light??s.iconPath.dark,g=vi.revive(p);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Dw(g)}else i.icon.style.backgroundImage="",i.icon.className=s.iconClass?`quick-input-list-icon ${s.iconClass}`:"";let c;!r.saneTooltip&&r.saneDescription&&(c={markdown:{value:r.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:r.saneDescription});const u={matches:o||[],descriptionTitle:c,descriptionMatches:a||[],labelEscapeNewLines:!0};if(u.extraClasses=s.iconClasses,u.italic=s.italic,u.strikethrough=s.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(r.saneLabel,r.saneDescription,u),i.keybinding.set(s.keybinding),r.saneDetail){let p;r.saneTooltip||(p={markdown:{value:r.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:r.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(r.saneDetail,void 0,{matches:l,title:p,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";(f=r.separator)!=null&&f.label?(i.separator.textContent=r.separator.label,i.separator.style.display="",this.addItemWithSeparator(r)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!r.separator);const d=s.buttons;d&&d.length?(i.actionBar.push(d.map((p,g)=>u6(p,`id-${g}`,()=>r.fireButtonTriggered({button:p,item:r.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}},Pve=xI,xI.ID="quickpickitem",xI);KG=Pve=qte([Rve(1,mc)],KG);const XQ=class XQ extends vut{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return XQ.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderTemplate(e){const t=super.renderTemplate(e);return t.checkbox.style.display="none",t}renderElement(e,t,i){const r=e.element;i.element=r,r.element=i.entry??void 0,r.element.classList.toggle("focus-inside",!!r.focusInsideSeparator);const s=r.separator,{labelHighlights:o,descriptionHighlights:a,detailHighlights:l}=r;i.icon.style.backgroundImage="",i.icon.className="";let c;!r.saneTooltip&&r.saneDescription&&(c={markdown:{value:r.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:r.saneDescription});const u={matches:o||[],descriptionTitle:c,descriptionMatches:a||[],labelEscapeNewLines:!0};if(i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(r.saneLabel,r.saneDescription,u),r.saneDetail){let f;r.saneTooltip||(f={markdown:{value:r.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:r.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(r.saneDetail,void 0,{matches:l,title:f,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const d=s.buttons;d&&d.length?(i.actionBar.push(d.map((f,p)=>u6(f,`id-${p}`,()=>r.fireSeparatorButtonTriggered({button:f,separator:r.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(r)}disposeElement(e,t,i){var r;this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||(r=e.element.element)==null||r.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}};XQ.ID="quickpickseparator";let GG=XQ,$7=class extends Ye{constructor(e,t,i,r,s,o){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=o,this._onKeyDown=new Ue,this._onLeave=new Ue,this.onLeave=this._onLeave.event,this._visibleCountObservable=Ar("VisibleCount",0),this.onChangedVisibleCount=rn.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=Ar("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=rn.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=Ar("CheckedCount",0),this.onChangedCheckedCount=rn.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=K_e({equalsFn:fa},new Array),this.onChangedCheckedElements=rn.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new Ue,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new Ue,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new Ue,this._elementCheckedEventBufferer=new V9,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Et),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=Ot(this.parent,Vv(".quick-input-list")),this._separatorRenderer=new GG(t),this._itemRenderer=s.createInstance(KG,t),this._tree=this._register(s.createInstance(Nve,"QuickInput",this._container,new Eyr,[this._itemRenderer,this._separatorRenderer],{filter:{filter(a){return a.hidden?0:a instanceof o2?2:1}},sorter:{compare:(a,l)=>{if(!this.sortByLabel||!this._lastQueryString)return 0;const c=this._lastQueryString.toLowerCase();return Iyr(a,l,c)}},accessibilityProvider:new kyr,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:wM.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=r,this._registerListeners()}get onDidChangeFocus(){return rn.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof Au).map(t=>t.item),this._store)}get onDidChangeSelection(){return rn.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof Au).map(t=>t.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new Io(e);switch(t.keyCode){case 10:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(_t(this._container,Xt.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(_t(this._container,Xt.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(t=>!t.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new Pot(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{var i;if(h8e(t.browserEvent.target)){e.cancel();return}if(!(!h8e(t.browserEvent.relatedTarget)&&kc(t.browserEvent.relatedTarget,(i=t.element)==null?void 0:i.element)))try{await e.trigger(async()=>{t.element instanceof Au&&this.showHover(t.element)})}catch(r){if(!Km(r))throw r}})),this._register(this._tree.onMouseOut(t=>{var i;kc(t.browserEvent.relatedTarget,(i=t.element)==null?void 0:i.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const r=i===t;!!(i.focusInsideSeparator&J0.ACTIVE_ITEM)!==r&&(r?i.focusInsideSeparator|=J0.ACTIVE_ITEM:i.focusInsideSeparator&=~J0.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&J0.MOUSE_HOVER)||(i.focusInsideSeparator|=J0.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&J0.MOUSE_HOVER)&&(i.focusInsideSeparator&=~J0.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof Au);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof o2&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let t;this._itemElements=new Array,this._elementTree=e.reduce((i,r,s)=>{let o;if(r.type==="separator"){if(!r.buttons)return i;t=new o2(s,a=>this._onSeparatorButtonTriggered.fire(a),r),o=t}else{const a=s>0?e[s-1]:void 0;let l;a&&a.type==="separator"&&!a.buttons&&(t=void 0,l=a);const c=new Au(s,this._hasCheckboxes,u=>this._onButtonTriggered.fire(u),this._elementChecked,r,l);if(this._itemElements.push(c),t)return t.children.push(c),i;o=c}return i.push(o),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const i=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),r=i==null?void 0:i.parentNode;if(i&&r){const s=i.nextSibling;i.remove(),r.insertBefore(i,s)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(r=>r.item===i)).filter(i=>!!i).filter(i=>!i.hidden);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(r=>r.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)})}focus(e){var t;if(this._itemElements.length)switch(e===Wo.Second&&this._itemElements.length<2&&(e=Wo.First),e){case Wo.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,i=>i.element instanceof Au);break;case Wo.Second:{this._tree.scrollTop=0;let i=!1;this._tree.focusFirst(void 0,r=>r.element instanceof Au?i?!0:(i=!i,!1):!1);break}case Wo.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,i=>i.element instanceof Au);break;case Wo.Next:{const i=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,s=>s.element instanceof Au?(this._tree.reveal(s.element),!0):!1);const r=this._tree.getFocus();i.length&&i[0]===r[0]&&i[0]===this._itemElements[this._itemElements.length-1]&&this._onLeave.fire();break}case Wo.Previous:{const i=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,s=>{if(!(s.element instanceof Au))return!1;const o=this._tree.getParentElement(s.element);return o===null||o.children[0]!==s.element?this._tree.reveal(s.element):this._tree.reveal(o),!0});const r=this._tree.getFocus();i.length&&i[0]===r[0]&&i[0]===this._itemElements[0]&&this._onLeave.fire();break}case Wo.NextPage:this._tree.focusNextPage(void 0,i=>i.element instanceof Au?(this._tree.reveal(i.element),!0):!1);break;case Wo.PreviousPage:this._tree.focusPreviousPage(void 0,i=>{if(!(i.element instanceof Au))return!1;const r=this._tree.getParentElement(i.element);return r===null||r.children[0]!==i.element?this._tree.reveal(i.element):this._tree.reveal(r),!0});break;case Wo.NextSeparator:{let i=!1;const r=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,o=>{if(i)return!0;if(o.element instanceof o2)i=!0,this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element.children[0]):this._tree.reveal(o.element,0);else if(o.element instanceof Au){if(o.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),!0;if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1});const s=this._tree.getFocus()[0];r===s&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,o=>o.element instanceof Au));break}case Wo.PreviousSeparator:{let i,r=!!((t=this._tree.getFocus()[0])!=null&&t.separator);this._tree.focusPrevious(void 0,!0,void 0,s=>{if(s.element instanceof o2)r?i||(this._separatorRenderer.isSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),i=s.element.children[0]):r=!0;else if(s.element instanceof Au&&!i){if(s.element.separator)this._itemRenderer.isItemWithSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),i=s.element;else if(s.element===this._elementTree[0])return this._tree.reveal(s.element,0),!0}return!1}),i&&this._tree.setFocus([i]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(i=>{i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!1;const r=i.index&&this._inputElements[i.index-1];i.item&&(i.separator=r&&r.type==="separator"&&!r.buttons?r:void 0)});else{let i;this._itemElements.forEach(r=>{let s;this.matchOnLabelMode==="fuzzy"?s=this.matchOnLabel?Kce(e,Zj(r.saneLabel))??void 0:void 0:s=this.matchOnLabel?Tyr(t,Zj(r.saneLabel))??void 0:void 0;const o=this.matchOnDescription?Kce(e,Zj(r.saneDescription||""))??void 0:void 0,a=this.matchOnDetail?Kce(e,Zj(r.saneDetail||""))??void 0:void 0;if(s||o||a?(r.labelHighlights=s,r.descriptionHighlights=o,r.detailHighlights=a,r.hidden=!1):(r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=r.item?!r.item.alwaysShow:!0),r.item?r.separator=void 0:r.separator&&(r.hidden=!0),!this.sortByLabel){const l=r.index&&this._inputElements[r.index-1]||void 0;(l==null?void 0:l.type)==="separator"&&!l.buttons&&(i=l),i&&!r.hidden&&(r.separator=i,i=void 0)}})}return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof Au),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!(e!=null&&e.saneTooltip)||!(e instanceof Au))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new Et;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof Au&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof o2?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(r=>({element:r,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,r=e.length;i<r;i++){const s=e[i];if(!s.hidden)if(s.checked)t=!0;else return!1}return t}_updateCheckedObservables(){va(e=>{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);const t=this._itemElements.filter(i=>i.checked).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)})}showHover(e){var t,i,r;this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.hoverDelegate).onDidHideHover)==null||i.call(t),(r=this._lastHover)==null||r.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:s=>{this.linkOpenerDelegate(s)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};qte([xl],$7.prototype,"onDidChangeFocus",null);qte([xl],$7.prototype,"onDidChangeSelection",null);$7=qte([Rve(4,mi),Rve(5,dp)],$7);function Tyr(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return t9e(n,t);const r=W9(t," "),s=t.length-r.length,o=t9e(n,r);if(o)for(const a of o){const l=i[a.start+s]+s;a.start+=l,a.end+=l}return o}function t9e(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function Iyr(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:xyr(n.saneSortLabel,e.saneSortLabel,t)}const but={weight:200,when:It.and(It.equals(Wct,"quickPick"),n0r),metadata:{description:A("quickPick","Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")}};function Wf(n,e={}){Rh.registerCommandAndKeybindingRule({...but,...n,secondary:Lyr(n.primary,n.secondary??[],e)})}const YG=zr?256:2048;function Lyr(n,e,t={}){return t.withAltMod&&e.push(512+n),t.withCtrlMod&&(e.push(YG+n),t.withAltMod&&e.push(512+YG+n)),t.withCmdMod&&zr&&(e.push(2048+n),t.withCtrlMod&&e.push(2304+n),t.withAltMod&&(e.push(2560+n),t.withCtrlMod&&e.push(2816+n))),e}function Vp(n,e){return t=>{const i=t.get(Ym).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(n)}}Wf({id:"quickInput.pageNext",primary:12,handler:Vp(Wo.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Wf({id:"quickInput.pagePrevious",primary:11,handler:Vp(Wo.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Wf({id:"quickInput.first",primary:YG+14,handler:Vp(Wo.First)},{withAltMod:!0,withCmdMod:!0});Wf({id:"quickInput.last",primary:YG+13,handler:Vp(Wo.Last)},{withAltMod:!0,withCmdMod:!0});Wf({id:"quickInput.next",primary:18,handler:Vp(Wo.Next)},{withCtrlMod:!0});Wf({id:"quickInput.previous",primary:16,handler:Vp(Wo.Previous)},{withCtrlMod:!0});const n9e=A("quickInput.nextSeparatorWithQuickAccessFallback","If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),i9e=A("quickInput.previousSeparatorWithQuickAccessFallback","If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");zr?(Wf({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:Vp(Wo.NextSeparator,Wo.Next),metadata:{description:n9e}}),Wf({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:Vp(Wo.NextSeparator)},{withCtrlMod:!0}),Wf({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:Vp(Wo.PreviousSeparator,Wo.Previous),metadata:{description:i9e}}),Wf({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:Vp(Wo.PreviousSeparator)},{withCtrlMod:!0})):(Wf({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:Vp(Wo.NextSeparator,Wo.Next),metadata:{description:n9e}}),Wf({id:"quickInput.nextSeparator",primary:2578,handler:Vp(Wo.NextSeparator)}),Wf({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:Vp(Wo.PreviousSeparator,Wo.Previous),metadata:{description:i9e}}),Wf({id:"quickInput.previousSeparator",primary:2576,handler:Vp(Wo.PreviousSeparator)}));Wf({id:"quickInput.acceptInBackground",when:It.and(but.when,It.or(aut.negate(),s0r)),primary:17,weight:250,handler:n=>{const e=n.get(Ym).currentQuickInput;e==null||e.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var Ayr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},mue=function(n,e){return function(t,i){e(t,i,n)}},Ove;const Ff=Jt;var SI;let Mve=(SI=class extends Ye{get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,r){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.contextKeyService=r,this.enabled=!0,this.onDidAcceptEmitter=this._register(new Ue),this.onDidCustomEmitter=this._register(new Ue),this.onDidTriggerButtonEmitter=this._register(new Ue),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new Ue),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new Ue),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=t0r.bindTo(this.contextKeyService),this.quickInputTypeContext=i0r.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=r0r.bindTo(this.contextKeyService),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(rn.runAndSubscribe(Zee,({window:s,disposables:o})=>this.registerKeyModsListeners(s,o),{window:bo,disposables:this._store})),this._register(alr(s=>{this.ui&&Ti(this.ui.container)===s&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=r=>{this.keyMods.ctrlCmd=r.ctrlKey||r.metaKey,this.keyMods.alt=r.altKey};for(const r of[Xt.KEY_DOWN,Xt.KEY_UP,Xt.MOUSE_DOWN])t.add(_t(e,r,i,!0))}getUI(e){if(this.ui)return e&&Ti(this._container)!==Ti(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=Ot(this._container,Ff(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=_g(t),r=Ot(t,Ff(".quick-input-titlebar")),s=this._register(new hg(r,{hoverDelegate:this.options.hoverDelegate}));s.domNode.classList.add("quick-input-left-action-bar");const o=Ot(r,Ff(".quick-input-title")),a=this._register(new hg(r,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=Ot(t,Ff(".quick-input-header")),c=Ot(l,Ff("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",A("quickInput.checkAll","Toggle all checkboxes")),this._register(Da(c,Xt.CHANGE,M=>{const B=c.checked;F.setAllVisibleChecked(B)})),this._register(_t(c,Xt.CLICK,M=>{(M.x||M.y)&&p.setFocus()}));const u=Ot(l,Ff(".quick-input-description")),d=Ot(l,Ff(".quick-input-and-message")),f=Ot(d,Ff(".quick-input-filter")),p=this._register(new g0r(f,this.styles.inputBox,this.styles.toggle));p.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Ot(f,Ff(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const m=new Sve(g,{countFormat:A({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),_=Ot(f,Ff(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new Sve(_,{countFormat:A({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=this._register(new hg(l,{hoverDelegate:this.options.hoverDelegate}));b.domNode.classList.add("quick-input-inline-action-bar");const y=Ot(l,Ff(".quick-input-action")),C=this._register(new MG(y,this.styles.button));C.label=A("ok","OK"),this._register(C.onDidClick(M=>{this.onDidAcceptEmitter.fire()}));const S=Ot(l,Ff(".quick-input-action")),k=this._register(new MG(S,{...this.styles.button,supportIcons:!0}));k.label=A("custom","Custom"),this._register(k.onDidClick(M=>{this.onDidCustomEmitter.fire()}));const I=Ot(d,Ff(`#${this.idPrefix}message.quick-input-message`)),L=this._register(new Eve(t,this.styles.progressBar));L.getContainer().classList.add("quick-input-progress");const N=Ot(t,Ff(".quick-input-html-widget"));N.tabIndex=-1;const P=Ot(t,Ff(".quick-input-description")),O=this.idPrefix+"list",F=this._register(this.instantiationService.createInstance($7,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,O));p.setAttribute("aria-controls",O),this._register(F.onDidChangeFocus(()=>{p.setAttribute("aria-activedescendant",F.getActiveDescendant()??"")})),this._register(F.onChangedAllVisibleChecked(M=>{c.checked=M})),this._register(F.onChangedVisibleCount(M=>{m.setCount(M)})),this._register(F.onChangedCheckedCount(M=>{v.setCount(M)})),this._register(F.onLeave(()=>{setTimeout(()=>{this.controller&&(p.setFocus(),this.controller instanceof OG&&this.controller.canSelectMany&&F.clearFocus())},0)}));const V=$b(t);return this._register(V),this._register(_t(t,Xt.FOCUS,M=>{const B=this.getUI();if(kc(M.relatedTarget,B.inputContainer)){const W=B.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==W&&this.endOfQuickInputBoxContext.set(W)}kc(M.relatedTarget,B.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Lc(M.relatedTarget)?M.relatedTarget:void 0)},!0)),this._register(V.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(CM.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(p.onKeyDown(M=>{const B=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==B&&this.endOfQuickInputBoxContext.set(B)})),this._register(_t(t,Xt.FOCUS,M=>{p.setFocus()})),this._register(Da(t,Xt.KEY_DOWN,M=>{if(!kc(M.target,N))switch(M.keyCode){case 3:Jr.stop(M,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:Jr.stop(M,!0),this.hide(CM.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(t.classList.contains("show-checkboxes")?B.push("input"):B.push("input[type=text]"),this.getUI().list.displayed&&B.push(".monaco-list"),this.getUI().message&&B.push(".quick-input-message a"),this.getUI().widget){if(kc(M.target,this.getUI().widget))break;B.push(".quick-input-html-widget")}const W=t.querySelectorAll(B.join(", "));M.shiftKey&&M.target===W[0]?(Jr.stop(M,!0),F.clearFocus()):!M.shiftKey&&kc(M.target,W[W.length-1])&&(Jr.stop(M,!0),W[0].focus())}break;case 10:M.ctrlKey&&(Jr.stop(M,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:s,titleBar:r,title:o,description1:P,description2:u,widget:N,rightActionBar:a,inlineActionBar:b,checkAll:c,inputContainer:d,filterContainer:f,inputBox:p,visibleCountContainer:g,visibleCount:m,countContainer:_,count:v,okContainer:y,ok:C,message:I,customButtonContainer:S,customButton:k,list:F,progressBar:L,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}reparentUI(e){this.ui&&(this._container=e,Ot(this._container,this.ui.container))}pick(e,t={},i=xr.None){return new Promise((r,s)=>{let o=u=>{var d;o=r,(d=t.onKeyMods)==null||d.call(t,a.keyMods),r(u)};if(i.isCancellationRequested){o(void 0);return}const a=this.createQuickPick({useSeparators:!0});let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)o(a.selectedItems.slice()),a.hide();else{const u=a.activeItems[0];u&&(o(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&&(o(d),a.hide())}}),a.onDidTriggerItemButton(u=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...u,removeItem:()=>{const d=a.items.indexOf(u.item);if(d!==-1){const f=a.items.slice(),p=f.splice(d,1),g=a.activeItems.filter(_=>_!==p[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=f,g&&(a.activeItems=g),a.keepScrollPosition=m}}})),a.onDidTriggerSeparatorButton(u=>{var d;return(d=t.onDidTriggerSeparatorButton)==null?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(()=>{vo(c),o(void 0)})];a.title=t.title,t.value&&(a.value=t.value),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.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(f=>f.type!=="separator"&&f.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,u=>{s(u),a.hide()})})}createQuickPick(e={useSeparators:!1}){const t=this.getUI(!0);return new OG(t)}createInputBox(){const e=this.getUI(!0);return new o0r(e)}show(e){const t=this.getUI(!0);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="",_u(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(_l.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),_u(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();wve.tooltip=r?A("quickInput.backWithKeybinding","Back ({0})",r):A("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}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.displayed=!!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 s;const t=this.controller;if(!t)return;t.willHide(e);const i=(s=this.ui)==null?void 0:s.container,r=i&&!Xot(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!r){let o=this.previousFocusElement;for(;o&&!o.offsetParent;)o=o.parentElement??void 0;o!=null&&o.offsetParent?(o.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,Ove.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:s}=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=s?`0 0 8px 2px ${s}`:"",this.ui.list.style(this.styles.list);const o=[];this.styles.pickerGroup.pickerGroupBorder&&o.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.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)&&(o.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&o.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&o.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&o.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&o.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&o.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),o.push("}"));const a=o.join(` `);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}},Ove=SI,SI.MAX_WIDTH=600,SI);Mve=Ove=Ayr([mue(1,Nk),mue(2,mi),mue(3,Oi)],Mve);var Nyr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},wj=function(n,e){return function(t,i){e(t,i,n)}};let jve=class extends wdr{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Cve))),this._quickAccess}constructor(e,t,i,r,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=r,this.configurationService=s,this._onShow=this._register(new Ue),this._onHide=this._register(new Ue),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:s=>this.setContextKey(s),linkOpenerDelegate:s=>{this.instantiationService.invokeFunction(o=>{o.get(xf).open(s,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(xve))},r=this._register(this.instantiationService.createInstance(Mve,{...i,...t}));return r.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(s=>{Ti(e.activeContainer)===Ti(r.container)&&r.layout(s,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{r.isVisible()||r.layout(e.activeContainerDimension,e.activeContainerOffset.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 yn(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=xr.None){return this.controller.pick(e,t,i)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:kn(A7e),quickInputForeground:kn(Ffr),quickInputTitleBackground:kn(Bfr),widgetBorder:kn(alt),widgetShadow:kn(q4)},inputBox:SG,toggle:xG,countBadge:sct,button:b_r,progressBar:y_r,keybindingLabel:v_r,list:zA({listBackground:A7e,listFocusBackground:w7,listFocusForeground:C7,listInactiveFocusForeground:C7,listInactiveSelectionIconForeground:eTe,listInactiveFocusBackground:w7,listFocusOutline:aa,listInactiveFocusOutline:aa}),pickerGroup:{pickerGroupBorder:kn($fr),pickerGroupForeground:kn(_lt)}}}};jve=Nyr([wj(0,mi),wj(1,Oi),wj(2,mc),wj(3,Nk),wj(4,Dr)],jve);var yut=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},E2=function(n,e){return function(t,i){e(t,i,n)}};let Fve=class extends jve{constructor(e,t,i,r,s,o){super(t,i,r,new r_e(e.getContainerDomNode(),s),o),this.host=void 0;const a=H7.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return rn.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return rn.None},get onDidAddContainer(){return rn.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};Fve=yut([E2(1,mi),E2(2,Oi),E2(3,mc),E2(4,Cs),E2(5,Dr)],Fve);let Bve=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(Fve,e);this.mapEditorToService.set(e,t),qE(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,i=xr.None){return this.activeService.pick(e,t,i)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}};Bve=yut([E2(0,mi),E2(1,Cs)],Bve);const ZQ=class ZQ{static get(e){return e.getContribution(ZQ.ID)}constructor(e){this.editor=e,this.widget=new $ve(this.editor)}dispose(){this.widget.dispose()}};ZQ.ID="editor.controller.quickInput";let H7=ZQ;const JQ=class JQ{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return JQ.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}};JQ.ID="editor.contrib.quickInputWidget";let $ve=JQ;cs(H7.ID,H7,4);class Dyr{constructor(e,t,i,r,s){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=r,this.background=s}}function Ryr(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,r=n.length;i<r;i++){const s=n[i];let o=-1;if(typeof s.fontStyle=="string"){o=0;const c=s.fontStyle.split(" ");for(let u=0,d=c.length;u<d;u++)switch(c[u]){case"italic":o=o|1;break;case"bold":o=o|2;break;case"underline":o=o|4;break;case"strikethrough":o=o|8;break}}let a=null;typeof s.foreground=="string"&&(a=s.foreground);let l=null;typeof s.background=="string"&&(l=s.background),e[t++]=new Dyr(s.token||"",i,o,a,l)}return e}function Pyr(n,e){n.sort((u,d)=>{const f=Byr(u.token,d.token);return f!==0?f: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 s=new Myr;for(const u of e)s.getId(u);const o=s.getId(i),a=s.getId(r),l=new e2e(t,o,a),c=new t2e(l);for(let u=0,d=n.length;u<d;u++){const f=n[u];c.insert(f.token,f.fontStyle,s.getId(f.foreground),s.getId(f.background))}return new Cut(s,c)}const Oyr=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class Myr{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(e===null)return 0;const t=e.match(Oyr);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]=At.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class Cut{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(Ryr(e),t)}static createFromParsedTokenTheme(e,t){return Pyr(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),s=Fyr(t);i=(r.metadata|s<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const jyr=/\b(comment|string|regex|regexp)\b/;function Fyr(n){const e=n.match(jyr);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 Byr(n,e){return n<e?-1:n>e?1:0}class e2e{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 e2e(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 t2e{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 s=this._children.get(i);return typeof s<"u"?s.match(r):this._mainRule}insert(e,t,i,r){if(e===""){this._mainRule.acceptOverwrite(t,i,r);return}const s=e.indexOf(".");let o,a;s===-1?(o=e,a=""):(o=e.substring(0,s),a=e.substring(s+1));let l=this._children.get(o);typeof l>"u"&&(l=new t2e(this._mainRule.clone()),this._children.set(o,l)),l.insert(a,t,i,r)}}function $yr(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 Hyr={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:{[lv]:"#FFFFFE",[y1]:"#000000",[slt]:"#E5EBF1",[c$]:"#D3D3D3",[u$]:"#939393",[Gke]:"#ADD6FF4D"}},Vyr={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:{[lv]:"#1E1E1E",[y1]:"#D4D4D4",[slt]:"#3A3D41",[c$]:"#404040",[u$]:"#707070",[Gke]:"#ADD6FF26"}},Wyr={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:{[lv]:"#000000",[y1]:"#FFFFFF",[c$]:"#FFFFFF",[u$]:"#FFFFFF"}},zyr={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:{[lv]:"#FFFFFF",[y1]:"#292929",[c$]:"#292929",[u$]:"#292929"}},Uyr={IconContribution:"base.contributions.icons"};var r9e;(function(n){function e(t,i){let r=t.defaults;for(;Ni.isThemeIcon(r);){const s=KA.getIcon(r.id);if(!s)return;r=s.defaults}return r}n.getDefinition=e})(r9e||(r9e={}));var s9e;(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=s=>cf(s)?s:void 0;if(i&&Array.isArray(i.src)&&i.src.every(s=>cf(s.format)&&cf(s.location)))return{weight:r(i.weight),style:r(i.style),src:i.src.map(s=>({format:s.format,location:vi.parse(s.location)}))}}n.fromJSONObject=t})(s9e||(s9e={}));class qyr{constructor(){this._onDidChange=new Ue,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:A("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:A("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Ni.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,r){const s=this.iconsById[e];if(s){if(i&&!s.description){s.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 s}const o={id:e,description:i,defaults:t,deprecationMessage:r};this.iconsById[e]=o;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=(s,o)=>s.id.localeCompare(o.id),t=s=>{for(;Ni.isThemeIcon(s.defaults);)s=this.iconsById[s.defaults.id];return`codicon codicon-${s?s.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const r=Object.keys(this.iconsById).map(s=>this.iconsById[s]);for(const s of r.filter(o=>!!o.description).sort(e))i.push(`|<i class="${t(s)}"></i>|${s.id}|${Ni.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const s of r.filter(o=>!Ni.isThemeIcon(o.defaults)).sort(e))i.push(`|<i class="${t(s)}"></i>|${s.id}|`);return i.join(` `)}}const KA=new qyr;Ca.add(Uyr.IconContribution,KA);function Zo(n,e,t,i){return KA.registerIcon(n,e,t,i)}function wut(){return KA}function Kyr(){const n=vot();for(const e in n){const t="\\"+n[e].toString(16);KA.registerIcon(e,{fontCharacter:t})}}Kyr();const xut="vscode://schemas/icons",Sut=Ca.as(fte.JSONContribution);Sut.registerSchema(xut,KA.getIconSchema());const o9e=new ao(()=>Sut.notifySchemaChanged(xut),200);KA.onDidChange(()=>{o9e.isScheduled()||o9e.schedule()});const Eut=Zo("widget-close",Yt.close,A("widgetClose","Icon for the close action in widgets."));Zo("goto-previous-location",Yt.arrowUp,A("previousChangeIcon","Icon for goto previous editor location."));Zo("goto-next-location",Yt.arrowDown,A("nextChangeIcon","Icon for goto next editor location."));Ni.modify(Yt.sync,"spin");Ni.modify(Yt.loading,"spin");function Gyr(n){const e=new Et,t=e.add(new Ue),i=wut();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 kut,s={},o=[],a=[];for(const l of i.getIcons()){const c=r.getIcon(l);if(!c)continue;const u=c.font,d=`--vscode-icon-${l.id}-font-family`,f=`--vscode-icon-${l.id}-content`;u?(s[u.id]=u.definition,a.push(`${d}: ${wce(u.id)};`,`${f}: '${c.fontCharacter}';`),o.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${wce(u.id)}; }`)):(a.push(`${f}: '${c.fontCharacter}'; ${d}: 'codicon';`),o.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`))}for(const l in s){const c=s[l],u=c.weight?`font-weight: ${c.weight};`:"",d=c.style?`font-style: ${c.style};`:"",f=c.src.map(p=>`${Dw(p.location)} format('${p.format}')`).join(", ");o.push(`@font-face { src: ${f}; font-family: ${wce(l)};${u}${d} font-display: block; }`)}return o.push(`:root { ${a.join(" ")} }`),o.join(` `)}}}class kut{getIcon(e){const t=wut();let i=e.defaults;for(;Ni.isThemeIcon(i);){const r=t.getIcon(i.id);if(!r)return;i=r.defaults}return i}}const OC="vs",zP="vs-dark",gI="hc-black",mI="hc-light",Tut=Ca.as(Jat.ColorContribution),Yyr=Ca.as(jat.ThemingContribution);class Iut{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(bU(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,At.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=Hve(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,At.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=Tut.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case OC:return _m.LIGHT;case gI:return _m.HIGH_CONTRAST_DARK;case mI:return _m.HIGH_CONTRAST_LIGHT;default:return _m.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=Hve(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],r=this.themeData.colors["editor.background"];if(i||r){const s={token:""};i&&(s.foreground=i),r&&(s.background=r),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=Cut.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=rf.getForeground(s),a=rf.getFontStyle(s);return{foreground:o,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function bU(n){return n===OC||n===zP||n===gI||n===mI}function Hve(n){switch(n){case OC:return Hyr;case zP:return Vyr;case gI:return Wyr;case mI:return zyr}}function SW(n){const e=Hve(n);return new Iut(n,e)}class Qyr extends Ye{constructor(){super(),this._onColorThemeChange=this._register(new Ue),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new Ue),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new kut,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(OC,SW(OC)),this._knownThemes.set(zP,SW(zP)),this._knownThemes.set(gI,SW(gI)),this._knownThemes.set(mI,SW(mI));const e=this._register(Gyr(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(OC),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Not(bo,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return zK(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=_g(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),Ye.None}_registerShadowDomContainer(e){const t=_g(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(!bU(t.base)&&!bU(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new Iut(e,t)),bU(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(OC),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=bo.matchMedia("(forced-colors: active)").matches;if(e!==Ab(this._theme.type)){let t;cM(this._theme.type)?t=e?gI:zP:t=e?mI:OC,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:o=>{t[o]||(e.push(o),t[o]=!0)}};Yyr.getThemingParticipants().forEach(o=>o(this._theme,i,this._environment));const r=[];for(const o of Tut.getColors()){const a=this._theme.getColor(o.id,!0);a&&r.push(`${Uke(o.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${r.join(` `)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule($yr(s)),this._themeCSS=e.join(` `),this._updateCSS(),Ka.setColorMap(s),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 Lg=Ur("themeService");var Xyr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},_ue=function(n,e){return function(t,i){e(t,i,n)}};let Vve=class extends Ye{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new Ue,this._onDidChangeReducedMotion=new Ue,this._onDidChangeLinkUnderline=new Ue,this._accessibilityModeEnabledContext=e$.bindTo(this._contextKeyService);const r=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration("editor.accessibilitySupport")&&(r(),this._onDidChangeScreenReaderOptimized.fire()),o.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),r(),this._register(this.onDidChangeScreenReaderOptimized(()=>r()));const s=bo.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(s),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(_t(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}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}};Vve=Xyr([_ue(0,Oi),_ue(1,Nk),_ue(2,Dr)],Vve);var Kte=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Fy=function(n,e){return function(t,i){e(t,i,n)}},oR,iF;let Wve=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new zve(i)}createMenu(e,t,i){return new QG(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const r=new QG(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),s=r.getActions(i);return r.dispose(),s}resetHiddenStates(e){this._hiddenStates.reset(e)}};Wve=Kte([Fy(0,Fo),Fy(1,Ws),Fy(2,yv)],Wve);var EI;let zve=(EI=class{constructor(e){this._storageService=e,this._disposables=new Et,this._onDidChange=new Ue,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(oR._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,oR._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(oR._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){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var s;const i=this._isHiddenByDefault(e,t),r=((s=this._data[e.id])==null?void 0:s.includes(t))??!1;return i?!r:r}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const s=this._data[e.id];if(i)s?s.indexOf(t)<0&&s.push(t):this._data[e.id]=[t];else if(s){const o=s.indexOf(t);o>=0&&zrr(s,o),s.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(oR._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}},oR=EI,EI._key="menu.hiddenCommands",EI);zve=oR=Kte([Fy(0,yv)],zve);class d6{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=this._sort(Uc.getMenuItems(this._id));let t;for(const i of e){const r=i.group||"";(!t||t[0]!==r)&&(t=[r,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeysAndSubmenuIds(i)}this._allMenuIds.add(this._id)}_sort(e){return e}_collectContextKeysAndSubmenuIds(e){if(d6._fillInKbExprKeys(e.when,this._structureContextKeys),DP(e)){if(e.command.precondition&&d6._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;d6._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(Uc.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(e.submenu))}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let Uve=iF=class extends d6{constructor(e,t,i,r,s,o){super(e,i),this._hiddenStates=t,this._commandService=r,this._keybindingService=s,this._contextKeyService=o,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[r,s]=i;let o;for(const a of s)if(this._contextKeyService.contextMatchesRules(a.when)){const l=DP(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=Zyr(this._id,l?a.command:a,this._hiddenStates);if(l){const u=Lut(this._commandService,this._keybindingService,a.command.id,a.when);(o??(o=[])).push(new Jf(a.command,a.alt,e,c,u,this._contextKeyService,this._commandService))}else{const u=new iF(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),d=Ac.join(...u.map(f=>f[1]));d.length>0&&(o??(o=[])).push(new RP(a,c,d))}}o&&o.length>0&&t.push([r,o])}return t}_sort(e){return e.sort(iF._compareMenuItems)}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 s=e.order||0,o=t.order||0;return s<o?-1:s>o?1:iF._compareTitles(DP(e)?e.command.title:e.title,DP(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)}};Uve=iF=Kte([Fy(3,Fo),Fy(4,Ws),Fy(5,Oi)],Uve);let QG=class{constructor(e,t,i,r,s,o){this._disposables=new Et,this._menuInfo=new Uve(e,t,i.emitEventsForSubmenuChanges,r,s,o);const a=new ao(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(Uc.onDidChangeMenu(d=>{for(const f of this._menuInfo.allMenuIds)if(d.has(f)){a.schedule();break}}));const l=this._disposables.add(new Et),c=d=>{let f=!1,p=!1,g=!1;for(const m of d)if(f=f||m.isStructuralChange,p=p||m.isEnablementChange,g=g||m.isToggleChange,f&&p&&g)break;return{menu:this,isStructuralChange:f,isEnablementChange:p,isToggleChange:g}},u=()=>{l.add(o.onDidChangeContext(d=>{const f=d.affectsSome(this._menuInfo.structureContextKeys),p=d.affectsSome(this._menuInfo.preconditionContextKeys),g=d.affectsSome(this._menuInfo.toggledContextKeys);(f||p||g)&&this._onDidChange.fire({menu:this,isStructuralChange:f,isEnablementChange:p,isToggleChange:g})})),l.add(t.onDidChange(d=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new lot({onWillAddFirstListener:u,onDidRemoveLastListener:l.clear.bind(l),delay:i.eventDebounceDelay,merge:c}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};QG=Kte([Fy(3,Fo),Fy(4,Ws),Fy(5,Oi)],QG);function Zyr(n,e,t){const i=rcr(e)?e.submenu.id:e.id,r=typeof e.title=="string"?e.title:e.title.value,s=uI({id:`hide/${n.id}/${i}`,label:A("hide.label","Hide '{0}'",r),run(){t.updateHidden(n,i,!0)}}),o=uI({id:`toggle/${n.id}/${i}`,label:r,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:s,toggle:o,get isHidden(){return!o.checked}}}function Lut(n,e,t,i=void 0,r=!0){return uI({id:`configureKeybinding/${t}`,label:A("configure keybinding","Configure Keybinding"),enabled:r,run(){const o=!!!e.lookupKeybinding(t)&&i?i.serialize():void 0;n.executeCommand("workbench.action.openGlobalKeybindings",`@command:${t}`+(o?` +when:${o}`:""))}})}var Jyr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},a9e=function(n,e){return function(t,i){e(t,i,n)}},qve;const l9e="application/vnd.code.resources";var kI;let Kve=(kI=class extends Ye{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(QE||Dot)&&this.installWebKitWriteTextWorkaround(),this._register(rn.runAndSubscribe(Zee,({window:i,disposables:r})=>{r.add(_t(i.document,"copy",()=>this.clearResourcesState()))},{window:bo,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new $4;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,Gj().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(rn.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(_t(t,"click",e)),i.add(_t(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.clearResourcesState(),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await Gj().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=H4(),i=t.activeElement,r=t.body.appendChild(Jt("textarea",{"aria-hidden":!0}));r.style.height="1px",r.style.width="1px",r.style.position="absolute",r.value=e,r.focus(),r.select(),t.execCommand("copy"),Lc(i)&&i.focus(),r.remove()}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await Gj().navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async readResources(){try{const t=await Gj().navigator.clipboard.read();for(const i of t)if(i.types.includes(`web ${l9e}`)){const r=await i.getType(`web ${l9e}`);return JSON.parse(await r.text()).map(o=>vi.from(o))}}catch{}const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return Qee(e.substring(0,qve.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}},qve=kI,kI.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,kI);Kve=qve=Jyr([a9e(0,Nk),a9e(1,Uu)],Kve);const tx=Ur("clipboardService");var e1r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},t1r=function(n,e){return function(t,i){e(t,i,n)}};const h6="data-keybinding-context";let n2e=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...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}};const eX=class eX extends n2e{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}};eX.INSTANCE=new eX;let xM=eX;const W6=class W6 extends n2e{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=jP.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(r=>{if(r.source===7){const s=Array.from(this._values,([o])=>o);this._values.clear(),i.fire(new u9e(s))}else{const s=[];for(const o of r.affectedKeys){const a=`config.${o}`,l=this._values.findSuperstr(a);l!==void 0&&(s.push(...ss.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(s.push(a),this._values.delete(a))}i.fire(new u9e(s))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(W6._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(W6._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)}};W6._keyPrefix="config.";let Gve=W6;class n1r{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 c9e{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class u9e{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 i1r{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 r1r(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class Aut extends Ye{constructor(e){super(),this._onDidChangeContext=this._register(new ML({merge:t=>new i1r(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 n1r(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 s1r(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 c9e(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new c9e(e))}getContext(e){return this._isDisposed?xM.INSTANCE:this.getContextValuesContainer(o1r(e))}dispose(){super.dispose(),this._isDisposed=!0}}let Yve=class extends Aut{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new Gve(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?xM.INSTANCE:this._contexts.get(e)||xM.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 n2e(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};Yve=e1r([t1r(0,Dr)],Yve);class s1r extends Aut{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Dc),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(h6)){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(h6,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;r1r(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(h6),super.dispose())}getContextValuesContainer(e){return this._isDisposed?xM.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 o1r(n){for(;n;){if(n.hasAttribute(h6)){const e=n.getAttribute(h6);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function a1r(n,e,t){n.get(Oi).createKey(String(e),l1r(t))}function l1r(n){return Gst(n,e=>{if(typeof e=="object"&&e.$mid===1)return vi.revive(e).toString();if(e instanceof vi)return e.toString()})}os.registerCommand("_setContext",a1r);os.registerCommand({id:"getContextKeyInfo",handler(){return[...yn.all()].sort((n,e)=>n.key.localeCompare(e.key))},metadata:{description:A("getContextKeyInfo","A command that returns information about context keys"),args:[]}});os.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of yn.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 c1r=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class d9e{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 c1r(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 s=this._findCycle(r,t);if(s)return s;t.delete(i)}}}class n3{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)}}const u1r=!1;class h9e extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: ${e.toString()}`}}class XG{constructor(e=new n3,t=!1,i,r=u1r){this._services=e,this._strict=t,this._parent=i,this._enableTracing=r,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(mi,this),this._globalGraph=r?(i==null?void 0:i._globalGraph)??new d9e(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,vo(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)Uee(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,r=new class extends XG{dispose(){i._children.delete(r),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(r),t==null||t.add(r),r}invokeFunction(e,...t){this._throwIfDisposed();const i=f6.traceInvocation(this._enableTracing,e);let r=!1;try{return e({get:o=>{if(r)throw ake("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(o,i);if(!a)throw new Error(`[invokeFunction] unknown service '${o}'`);return a}},...t)}finally{r=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,r;return e instanceof ay?(i=f6.traceCreation(this._enableTracing,e.ctor),r=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=f6.traceCreation(this._enableTracing,e),r=this._createInstance(e,t,i)),i.stop(),r}_createInstance(e,t=[],i){const r=vb.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];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),s.push(l)}const o=r.length>0?r[0].index:t.length;if(t.length!==o){console.trace(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);const a=o-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,o)}return Reflect.construct(e,t.concat(s))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof ay)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(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 ay?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 l;const r=new d9e(c=>c.id.toString());let s=0;const o=[{id:e,desc:t,_trace:i}],a=new Set;for(;o.length;){const c=o.pop();if(!a.has(String(c.id))){if(a.add(String(c.id)),r.lookupOrInsertNode(c),s++>1e3)throw new h9e(r);for(const u of vb.getServiceDependencies(c.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(u.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${u.id} which is NOT registered.`,!0),(l=this._globalGraph)==null||l.insertEdge(String(c.id),String(u.id)),d instanceof ay){const f={id:u.id,desc:d,_trace:c._trace.branch(u.id,!0)};r.insertEdge(c,f),o.push(f)}}}}for(;;){const c=r.roots();if(c.length===0){if(!r.isEmpty())throw new h9e(r);break}for(const{data:u}of c){if(this._getServiceInstanceOrDescriptor(u.id)instanceof ay){const f=this._createServiceInstanceWithOwner(u.id,u.desc.ctor,u.desc.staticArguments,u.desc.supportsDelayedInstantiation,u._trace);this._setCreatedServiceInstance(u.id,f)}r.removeNode(u)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],r,s){if(this._services.get(e)instanceof ay)return this._createServiceInstance(e,t,i,r,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,r,s);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],r,s,o){if(r){const a=new XG(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const l=new Map,c=new Nar(()=>{const u=a._createInstance(t,i,s);for(const[d,f]of l){const p=u[d];if(typeof p=="function")for(const g of f)g.disposable=p.apply(u,g.listener)}return l.clear(),o.add(u),u});return new Proxy(Object.create(null),{get(u,d){if(!c.isInitialized&&typeof d=="string"&&(d.startsWith("onDid")||d.startsWith("onWill"))){let g=l.get(d);return g||(g=new Ch,l.set(d,g)),(_,v,b)=>{if(c.isInitialized)return c.value[d](_,v,b);{const y={listener:[_,v,b],disposable:void 0},C=g.push(y);return gi(()=>{var k;C(),(k=y.disposable)==null||k.dispose()})}}}if(d in u)return u[d];const f=c.value;let p=f[d];return typeof p!="function"||(p=p.bind(f),u[d]=p),p},set(u,d,f){return c.value[d]=f,!0},getPrototypeOf(u){return t.prototype}})}else{const a=this._createInstance(t,i,s);return o.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}const Fp=class Fp{static traceInvocation(e,t){return e?new Fp(2,t.name||new Error().stack.split(` `).slice(3,4).join(` `)):Fp._None}static traceCreation(e,t){return e?new Fp(1,t.name):Fp._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Fp(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Fp._totals+=e;let t=!1;function i(s,o){const a=[],l=new Array(s+1).join(" ");for(const[c,u,d]of o._dep)if(u&&d){t=!0,a.push(`${l}CREATES -> ${c}`);const f=i(s+1,d);f&&a.push(f)}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 ${Fp._totals.toFixed(2)}ms)`];(e>2||t)&&Fp.all.add(r.join(` `))}};Fp.all=new Set,Fp._None=new class extends Fp{constructor(){super(0,null)}stop(){}branch(){return this}},Fp._totals=0;let f6=Fp;const d1r=new Set([ir.inMemory,ir.vscodeSourceControl,ir.walkThrough,ir.walkThroughSnippet,ir.vscodeChatCodeBlock]);class h1r{constructor(){this._byResource=new Yc,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 s=this._byOwner.get(t);s||(s=new Yc,this._byOwner.set(t,s)),s.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 s=this._byResource.get(e);s&&(i=s.delete(t));const o=this._byOwner.get(t);if(o&&(r=o.delete(e)),i!==r)throw new Error("illegal state");return i&&r}values(e){var t,i;return typeof e=="string"?((t=this._byOwner.get(e))==null?void 0:t.values())??ss.empty():vi.isUri(e)?((i=this._byResource.get(e))==null?void 0:i.values())??ss.empty():ss.map(ss.concat(...this._byOwner.values()),r=>r[1])}}class f1r{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Yc,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(d1r.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Ya.Error?t.errors+=1:i===Ya.Warning?t.warnings+=1:i===Ya.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 lS{constructor(){this._onMarkerChanged=new lot({delay:0,merge:lS._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new h1r,this._stats=new f1r(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(Wst(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const r=[];for(const s of i){const o=lS._toMarker(e,t,s);o&&r.push(o)}this._data.set(t,e,r),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:r,severity:s,message:o,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:f,tags:p}=i;if(o)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:s,message:o,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:f,tags:p}}changeAll(e,t){const i=[],r=this._data.values(e);if(r)for(const s of r){const o=ss.first(s);o&&(i.push(o.resource),this._data.delete(o.resource,e))}if(Gd(t)){const s=new Yc;for(const{resource:o,marker:a}of t){const l=lS._toMarker(e,o,a);if(!l)continue;const c=s.get(o);c?c.push(l):(s.set(o,[l]),i.push(o))}for(const[o,a]of s)this._data.set(o,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:r,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const o=this._data.get(i,t);if(o){const a=[];for(const l of o)if(lS._accept(l,r)){const c=a.push(l);if(s>0&&c===s)break}return a}else return[]}else if(!t&&!i){const o=[];for(const a of this._data.values())for(const l of a)if(lS._accept(l,r)){const c=o.push(l);if(s>0&&c===s)return o}return o}else{const o=this._data.values(i??t),a=[];for(const l of o)for(const c of l)if(lS._accept(c,r)){const u=a.push(c);if(s>0&&u===s)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Yc;for(const i of e)for(const r of i)t.set(r,!0);return Array.from(t.keys())}}class p1r extends Ye{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=hu.createEmptyModel(this.logService)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=hu.createEmptyModel(this.logService);const e=Ca.as(bv.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const r of e){const s=i[r],o=t[r];s!==void 0?this._configurationModel.setValue(r,s):o?this._configurationModel.setValue(r,o.default):this._configurationModel.removeValue(r)}}}const Mk=Ur("accessibilitySignalService"),Ss=class Ss{static register(e){return new Ss(e.fileName)}constructor(e){this.fileName=e}};Ss.error=Ss.register({fileName:"error.mp3"}),Ss.warning=Ss.register({fileName:"warning.mp3"}),Ss.success=Ss.register({fileName:"success.mp3"}),Ss.foldedArea=Ss.register({fileName:"foldedAreas.mp3"}),Ss.break=Ss.register({fileName:"break.mp3"}),Ss.quickFixes=Ss.register({fileName:"quickFixes.mp3"}),Ss.taskCompleted=Ss.register({fileName:"taskCompleted.mp3"}),Ss.taskFailed=Ss.register({fileName:"taskFailed.mp3"}),Ss.terminalBell=Ss.register({fileName:"terminalBell.mp3"}),Ss.diffLineInserted=Ss.register({fileName:"diffLineInserted.mp3"}),Ss.diffLineDeleted=Ss.register({fileName:"diffLineDeleted.mp3"}),Ss.diffLineModified=Ss.register({fileName:"diffLineModified.mp3"}),Ss.chatRequestSent=Ss.register({fileName:"chatRequestSent.mp3"}),Ss.chatResponseReceived1=Ss.register({fileName:"chatResponseReceived1.mp3"}),Ss.chatResponseReceived2=Ss.register({fileName:"chatResponseReceived2.mp3"}),Ss.chatResponseReceived3=Ss.register({fileName:"chatResponseReceived3.mp3"}),Ss.chatResponseReceived4=Ss.register({fileName:"chatResponseReceived4.mp3"}),Ss.clear=Ss.register({fileName:"clear.mp3"}),Ss.save=Ss.register({fileName:"save.mp3"}),Ss.format=Ss.register({fileName:"format.mp3"}),Ss.voiceRecordingStarted=Ss.register({fileName:"voiceRecordingStarted.mp3"}),Ss.voiceRecordingStopped=Ss.register({fileName:"voiceRecordingStopped.mp3"}),Ss.progress=Ss.register({fileName:"progress.mp3"});let da=Ss;class g1r{constructor(e){this.randomOneOf=e}}const Lr=class Lr{constructor(e,t,i,r,s,o){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=r,this.legacyAnnouncementSettingsKey=s,this.announcementMessage=o}static register(e){const t=new g1r("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Lr(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return Lr._signals.add(i),i}};Lr._signals=new Set,Lr.errorAtPosition=Lr.register({name:A("accessibilitySignals.positionHasError.name","Error at Position"),sound:da.error,announcementMessage:A("accessibility.signals.positionHasError","Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),Lr.warningAtPosition=Lr.register({name:A("accessibilitySignals.positionHasWarning.name","Warning at Position"),sound:da.warning,announcementMessage:A("accessibility.signals.positionHasWarning","Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),Lr.errorOnLine=Lr.register({name:A("accessibilitySignals.lineHasError.name","Error on Line"),sound:da.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:A("accessibility.signals.lineHasError","Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),Lr.warningOnLine=Lr.register({name:A("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:da.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:A("accessibility.signals.lineHasWarning","Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),Lr.foldedArea=Lr.register({name:A("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:da.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:A("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),Lr.break=Lr.register({name:A("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:da.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:A("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),Lr.inlineSuggestion=Lr.register({name:A("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:da.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),Lr.terminalQuickFix=Lr.register({name:A("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:da.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:A("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),Lr.onDebugBreak=Lr.register({name:A("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:da.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:A("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),Lr.noInlayHints=Lr.register({name:A("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:da.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:A("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),Lr.taskCompleted=Lr.register({name:A("accessibilitySignals.taskCompleted","Task Completed"),sound:da.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:A("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),Lr.taskFailed=Lr.register({name:A("accessibilitySignals.taskFailed","Task Failed"),sound:da.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:A("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),Lr.terminalCommandFailed=Lr.register({name:A("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:da.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:A("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),Lr.terminalCommandSucceeded=Lr.register({name:A("accessibilitySignals.terminalCommandSucceeded","Terminal Command Succeeded"),sound:da.success,announcementMessage:A("accessibility.signals.terminalCommandSucceeded","Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),Lr.terminalBell=Lr.register({name:A("accessibilitySignals.terminalBell","Terminal Bell"),sound:da.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:A("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),Lr.notebookCellCompleted=Lr.register({name:A("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:da.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:A("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),Lr.notebookCellFailed=Lr.register({name:A("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:da.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:A("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),Lr.diffLineInserted=Lr.register({name:A("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:da.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),Lr.diffLineDeleted=Lr.register({name:A("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:da.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),Lr.diffLineModified=Lr.register({name:A("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:da.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),Lr.chatRequestSent=Lr.register({name:A("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:da.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:A("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),Lr.chatResponseReceived=Lr.register({name:A("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[da.chatResponseReceived1,da.chatResponseReceived2,da.chatResponseReceived3,da.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),Lr.progress=Lr.register({name:A("accessibilitySignals.progress","Progress"),sound:da.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:A("accessibility.signals.progress","Progress"),settingsKey:"accessibility.signals.progress"}),Lr.clear=Lr.register({name:A("accessibilitySignals.clear","Clear"),sound:da.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:A("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"}),Lr.save=Lr.register({name:A("accessibilitySignals.save","Save"),sound:da.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:A("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"}),Lr.format=Lr.register({name:A("accessibilitySignals.format","Format"),sound:da.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:A("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"}),Lr.voiceRecordingStarted=Lr.register({name:A("accessibilitySignals.voiceRecordingStarted","Voice Recording Started"),sound:da.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),Lr.voiceRecordingStopped=Lr.register({name:A("accessibilitySignals.voiceRecordingStopped","Voice Recording Stopped"),sound:da.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let Up=Lr;class m1r extends Ye{constructor(e,t=[]){super(),this.logger=new ocr([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 Nut=[];function i3(n){Nut.push(n)}function _1r(){return Nut.slice(0)}class v1r{getParseResult(e){}}var x1=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Pl=function(n,e){return function(t,i){e(t,i,n)}};class b1r{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new Ue}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let Qve=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new dor(new b1r(t))):Promise.reject(new Error("Model not found"))}};Qve=x1([Pl(0,Xo)],Qve);const tX=class tX{show(){return tX.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};tX.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let Xve=tX;class y1r{withProgress(e,t,i){return t({report:()=>{}})}}class C1r{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class w1r{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` `+t),bo.confirm(i)}async prompt(e){var r;let t;if(this.doConfirm(e.message,e.detail)){const s=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),t=await((r=s[0])==null?void 0:r.run({checkboxChecked:!1}))}return{result:t}}async error(e,t){await this.prompt({type:_l.Error,message:e,detail:t})}}const z6=class z6{info(e){return this.notify({severity:_l.Info,message:e})}warn(e){return this.notify({severity:_l.Warning,message:e})}error(e){return this.notify({severity:_l.Error,message:e})}notify(e){switch(e.severity){case _l.Error:console.error(e.message);break;case _l.Warning:console.warn(e.message);break;default:console.log(e.message);break}return z6.NO_OP}prompt(e,t,i,r){return z6.NO_OP}status(e,t){return Ye.None}};z6.NO_OP=new kdr;let Zve=z6,Jve=class{constructor(e){this._onWillExecuteCommand=new Ue,this._onDidExecuteCommand=new Ue,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=os.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)}}};Jve=x1([Pl(0,mi)],Jve);let SM=class extends Wgr{constructor(e,t,i,r,s,o){super(e,t,i,r,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=p=>{const g=new Et;g.add(_t(p,Xt.KEY_DOWN,m=>{const _=new Io(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(_t(p,Xt.KEY_UP,m=>{const _=new Io(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new x1r(p,g))},l=p=>{for(let g=0;g<this._domNodeListeners.length;g++){const m=this._domNodeListeners[g];m.domNode===p&&(this._domNodeListeners.splice(g,1),m.dispose())}},c=p=>{p.getOption(61)||a(p.getContainerDomNode())},u=p=>{p.getOption(61)||l(p.getContainerDomNode())};this._register(o.onCodeEditorAdd(c)),this._register(o.onCodeEditorRemove(u)),o.listCodeEditors().forEach(c);const d=p=>{a(p.getContainerDomNode())},f=p=>{l(p.getContainerDomNode())};this._register(o.onDiffEditorAdd(d)),this._register(o.onDiffEditorRemove(f)),o.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,i,r){return U_(os.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:r}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:kme(i.keybinding,Yf),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),gi(()=>{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(Rh.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new n6(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return bo.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let r=0;for(const s of e){const o=s.when||void 0,a=s.keybinding;if(!a)i[r++]=new eBe(void 0,s.command,s.commandArgs,o,t,null,!1);else{const l=T7.resolveKeybinding(a,Yf);for(const c of l)i[r++]=new eBe(c,s.command,s.commandArgs,o,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Aw(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new T7([t],Yf)}};SM=x1([Pl(0,Oi),Pl(1,Fo),Pl(2,md),Pl(3,wl),Pl(4,Uu),Pl(5,Cs)],SM);class x1r extends Ye{constructor(e,t){super(),this.domNode=e,this._register(t)}}function f9e(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof vi)}let ZG=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new Ue,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new p1r(e);this._configuration=new Nte(t.reload(),hu.createEmptyModel(e),hu.createEmptyModel(e),hu.createEmptyModel(e),hu.createEmptyModel(e),hu.createEmptyModel(e),new Yc,hu.createEmptyModel(e),new Yc,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,r=f9e(e)?e:f9e(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[s,o]=r;this.getValue(s)!==o&&(this._configuration.updateValue(s,o),i.push(s))}if(i.length>0){const r=new Fgr({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);r.source=8,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)}};ZG=x1([Pl(0,Uu)],ZG);let ebe=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new Ue,this.configurationService.onDidChangeConfiguration(r=>{this._onDidChangeConfiguration.fire({affectedKeys:r.affectedKeys,affectsConfiguration:(s,o)=>r.affectsConfiguration(o)})})}getValue(e,t,i){const r=We.isIPosition(t)?t:null,s=r?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,o=e?this.getLanguage(e,r):void 0;return typeof s>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:o}):this.configurationService.getValue(s,{resource:e,overrideIdentifier:o})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};ebe=x1([Pl(0,Dr),Pl(1,Xo),Pl(2,pa)],ebe);let tbe=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:Nh||zr?` `:`\r `}};tbe=x1([Pl(0,Dr)],tbe);class S1r{publicLog2(){}}const U6=class U6{constructor(){const e=vi.from({scheme:U6.SCHEME,authority:"model",path:"/"});this.workspace={id:$lt,folders:[new imr({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===U6.SCHEME?this.workspace.folders[0]:null}};U6.SCHEME="inmemory";let nbe=U6;function JG(n,e,t){if(!e||!(n instanceof ZG))return;const i=[];Object.keys(e).forEach(r=>{Rgr(r)&&i.push([`editor.${r}`,e[r]]),t&&Pgr(r)&&i.push([`diffEditor.${r}`,e[r]])}),i.length>0&&n.updateValues(i)}let ibe=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:gTe.convert(e),r=new Map;for(const a of i){if(!(a instanceof dE))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(ma.replaceMove(ie.lift(a.textEdit.range),a.textEdit.text))}let s=0,o=0;for(const[a,l]of r)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),o+=1,s+=l.length;return{ariaSummary:jL(V_e.bulkEditServiceSummary,s,o),isApplied:s>0}}};ibe=x1([Pl(0,Xo)],ibe);class E1r{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Mm(e)}}let rbe=class extends Igr{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)}};rbe=x1([Pl(0,Nk),Pl(1,Cs)],rbe);class k1r{constructor(){this._neverEmitter=new Ue,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class T1r extends G_e{constructor(){super()}}class I1r extends m1r{constructor(){super(new scr)}}let sbe=class extends rve{constructor(e,t,i,r,s,o){super(e,t,i,r,s,o),this.configure({blockMouse:!1})}};sbe=x1([Pl(0,md),Pl(1,wl),Pl(2,Zw),Pl(3,Ws),Pl(4,Eg),Pl(5,Oi)],sbe);const obe={amdModuleId:"vs/editor/common/services/editorSimpleWorker",esmModuleLocation:void 0,label:"editorWorkerService"};let abe=class extends e_e{constructor(e,t,i,r,s){super(obe,e,t,i,r,s)}};abe=x1([Pl(0,Xo),Pl(1,pte),Pl(2,Uu),Pl(3,wa),Pl(4,Fn)],abe);class L1r{async playSignal(e,t){}}ns(Uu,I1r,0);ns(Dr,ZG,0);ns(pte,ebe,0);ns(Mat,tbe,0);ns(qL,nbe,0);ns(_M,E1r,0);ns(md,S1r,0);ns(Q9,w1r,0);ns(Vke,C1r,0);ns(wl,Zve,0);ns(w1,lS,0);ns(pa,T1r,0);ns(Lg,Qyr,0);ns(Xo,vve,0);ns(STe,cve,0);ns(Oi,Yve,0);ns(Blt,y1r,0);ns(Rk,Xve,0);ns(yv,m_r,0);ns(Sf,abe,0);ns(t$,ibe,0);ns(Hlt,k1r,0);ns(Cf,Qve,0);ns(dp,Vve,0);ns(Qm,cyr,0);ns(Fo,Jve,0);ns(Ws,SM,0);ns(Ym,Bve,0);ns(Zw,rbe,0);ns(xf,lve,0);ns(tx,Kve,0);ns(up,sbe,0);ns(Eg,Wve,0);ns(Mk,L1r,0);ns(Fct,v1r,0);var Hi;(function(n){const e=new n3;for(const[l,c]of k8e())e.set(l,c);const t=new XG(e,!0);e.set(mi,t);function i(l){r||o({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof ay?t.invokeFunction(u=>u.get(l)):c}n.get=i;let r=!1;const s=new Ue;function o(l){if(r)return t;r=!0;for(const[u,d]of k8e())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=Ur(u);e.get(d)instanceof ay&&e.set(d,l[u])}const c=_1r();for(const u of c)try{t.createInstance(u)}catch(d){tr(d)}return s.fire(),t}n.initialize=o;function a(l){if(r)return l();const c=new Et,u=c.add(s.event(()=>{u.dispose(),c.add(l())}));return c}n.withServices=a})(Hi||(Hi={}));function A1r(n,e){return new N1r(n,e)}class N1r extends nG{constructor(e,t){const i={amdModuleId:obe.amdModuleId,esmModuleLocation:obe.esmModuleLocation,label:t.label};super(i,t.keepIdleModels||!1,e),this._foreignModuleId=t.moduleId,this._foreignModuleCreateData=t.createData||null,this._foreignModuleHost=t.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?vge(this._foreignModuleHost):[];return e.$loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const r=(a,l)=>e.$fmr(a,l),s=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},o={};for(const a of i)o[a]=s(a,r);return o})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this.workerWithSyncedResources(e).then(t=>this.getProxy())}}const h$={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};class xh{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 s=0;s<i;s++)if(!xh._equals(e[s],t[s]))return!1;return!0}static extractWrapped(e,t,i){if(e.length===0)return e;const r=t+1,s=i+1,o=i-t,a=[];let l=0;for(const c of e)c.endColumn<=r||c.startColumn>=s||(a[l++]=new xh(Math.max(1,c.startColumn-r+1),Math.min(o+1,c.endColumn-r+1),c.className,c.type));return a}static filter(e,t,i,r){if(e.length===0)return[];const s=[];let o=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,f=u.endLineNumber===t?u.endColumn:r;s[o++]=new xh(d,f,c.inlineClassName,c.type)}return s}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=xh._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className<t.className?-1:1:0}}class p9e{constructor(e,t,i,r){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=r}}class eY{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 p9e(t,this.stopOffsets[r],this.classNames.join(" "),eY._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 p9e(t,e-1,this.classNames.join(" "),eY._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 D1r{static normalize(e,t){if(t.length===0)return[];const i=[],r=new eY;let s=0;for(let o=0,a=t.length;o<a;o++){const l=t[o];let c=l.startColumn,u=l.endColumn;const d=l.className,f=l.type===1?2:l.type===2?4:0;if(c>1){const m=e.charCodeAt(c-2);Ec(m)&&c--}if(u>1){const m=e.charCodeAt(u-2);Ec(m)&&u--}const p=c-1,g=u-2;s=r.consumeLowerThan(p,s,i),r.count===0&&(s=p),r.insert(g,d,f)}return r.consumeLowerThan(1073741824,s,i),i}}class Wc{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 Dut{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class jk{constructor(e,t,i,r,s,o,a,l,c,u,d,f,p,g,m,_,v,b,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=r,this.isBasicASCII=s,this.containsRTL=o,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(xh.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=f,this.stopRenderingLineAfter=m,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=b,this.selectionsOnLine=y&&y.sort((k,I)=>k.startOffset<I.startOffset?-1:1);const C=Math.abs(g-f),S=Math.abs(p-f);C<S?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=p,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&&xh.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class Rut{constructor(e,t){this.partIndex=e,this.charIndex=t}}class ly{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 s=(t<<16|i<<0)>>>0;this._data[e-1]=s,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=ly.getPartIndex(t),r=ly.getCharIndex(t);return new Rut(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 s=0,o=this.length-1;for(;s+1<o;){const m=s+o>>>1,_=this._data[m];if(_===r)return m;_>r?o=m:s=m}if(s===o)return s;const a=this._data[s],l=this._data[o];if(a===r)return s;if(l===r)return o;const c=ly.getPartIndex(a),u=ly.getCharIndex(a),d=ly.getPartIndex(l);let f;c!==d?f=t:f=ly.getCharIndex(l);const p=i-u,g=f-i;return p<=g?s:o}}class lbe{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function f$(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("<span>");let t=0,i=0,r=0;for(const o of n.lineDecorations)(o.type===1||o.type===2)&&(e.appendString('<span class="'),e.appendString(o.className),e.appendString('"></span>'),o.type===1&&(r|=1,t++),o.type===2&&(r|=2,i++));e.appendString("</span>");const s=new ly(1,t+i);return s.setColumnInfo(1,t,0,0),new lbe(s,!1,r)}return e.appendString("<span><span></span></span>"),new lbe(new ly(0,0),!1,0)}return H1r(O1r(n),e)}class R1r{constructor(e,t,i,r){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=r}}function Gte(n){const e=new z4(1e4),t=f$(n,e);return new R1r(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class P1r{constructor(e,t,i,r,s,o,a,l,c,u,d,f,p,g,m,_){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=r,this.isOverflowing=s,this.overflowingCharCount=o,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=f,this.spaceWidth=p,this.renderSpaceCharCode=g,this.renderWhitespace=m,this.renderControlCharacters=_}}function O1r(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 s=M1r(e,n.containsRTL,n.lineTokens,n.fauxIndentLength,r);n.renderControlCharacters&&!n.isBasicASCII&&(s=F1r(e,s)),(n.renderWhitespace===4||n.renderWhitespace===1||n.renderWhitespace===2&&n.selectionsOnLine||n.renderWhitespace===3&&!n.continuesWithWrappedLine)&&(s=B1r(n,e,r,s));let o=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?o|=1:c.type===2&&(o|=2)}s=$1r(e,r,s,n.lineDecorations)}return n.containsRTL||(s=j1r(e,s,!n.isBasicASCII||n.fontLigatures)),new P1r(n.useMonospaceOptimizations,n.canUseHalfwidthRightwardsArrow,e,r,t,i,s,o,n.fauxIndentLength,n.tabSize,n.startVisibleColumn,n.containsRTL,n.spaceWidth,n.renderSpaceCharCode,n.renderWhitespace,n.renderControlCharacters)}function M1r(n,e,t,i,r){const s=[];let o=0;i>0&&(s[o++]=new Wc(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 p=e?sM(n.substring(a,r)):!1;s[o++]=new Wc(r,d,0,p);break}const f=e?sM(n.substring(a,u)):!1;s[o++]=new Wc(u,d,0,f),a=u}return s}function j1r(n,e,t){let i=0;const r=[];let s=0;if(t)for(let o=0,a=e.length;o<a;o++){const l=e[o],c=l.endIndex;if(i+50<c){const u=l.type,d=l.metadata,f=l.containsRTL;let p=-1,g=i;for(let m=i;m<c;m++)n.charCodeAt(m)===32&&(p=m),p!==-1&&m-g>=50&&(r[s++]=new Wc(p+1,u,d,f),g=p+1,p=-1);g!==c&&(r[s++]=new Wc(c,u,d,f))}else r[s++]=l;i=c}else for(let o=0,a=e.length;o<a;o++){const l=e[o],c=l.endIndex,u=c-i;if(u>50){const d=l.type,f=l.metadata,p=l.containsRTL,g=Math.ceil(u/50);for(let m=1;m<g;m++){const _=i+m*50;r[s++]=new Wc(_,d,f,p)}r[s++]=new Wc(c,d,f,p)}else r[s++]=l;i=c}return r}function Put(n){return n<32?n!==9:n===127||n>=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function F1r(n,e){const t=[];let i=new Wc(0,"",0,!1),r=0;for(const s of e){const o=s.endIndex;for(;r<o;r++){const a=n.charCodeAt(r);Put(a)&&(r>i.endIndex&&(i=new Wc(r,s.type,s.metadata,s.containsRTL),t.push(i)),i=new Wc(r+1,"mtkcontrol",s.metadata,!1),t.push(i))}r>i.endIndex&&(i=new Wc(o,s.type,s.metadata,s.containsRTL),t.push(i))}return t}function B1r(n,e,t,i){const r=n.continuesWithWrappedLine,s=n.fauxIndentLength,o=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,u=n.renderWhitespace===1,d=n.renderWhitespace===3,f=n.renderSpaceWidth!==n.spaceWidth,p=[];let g=0,m=0,_=i[m].type,v=i[m].containsRTL,b=i[m].endIndex;const y=i.length;let C=!1,S=Yd(e),k;S===-1?(C=!0,S=t,k=t):k=Lb(e);let I=!1,L=0,N=c&&c[L],P=a%o;for(let F=s;F<t;F++){const V=e.charCodeAt(F);N&&F>=N.endOffset&&(L++,N=c&&c[L]);let M;if(F<S||F>k)M=!0;else if(V===9)M=!0;else if(V===32)if(u)if(I)M=!0;else{const B=F+1<t?e.charCodeAt(F+1):0;M=B===32||B===9}else M=!0;else M=!1;if(M&&c&&(M=!!N&&N.startOffset<=F&&N.endOffset>F),M&&d&&(M=C||F>k),M&&v&&F>=S&&F<=k&&(M=!1),I){if(!M||!l&&P>=o){if(f){const B=g>0?p[g-1].endIndex:s;for(let W=B+1;W<=F;W++)p[g++]=new Wc(W,"mtkw",1,!1)}else p[g++]=new Wc(F,"mtkw",1,!1);P=P%o}}else(F===b||M&&F>s)&&(p[g++]=new Wc(F,_,0,v),P=P%o);for(V===9?P=o:YE(V)?P+=2:P++,I=M;F===b&&(m++,m<y);)_=i[m].type,v=i[m].containsRTL,b=i[m].endIndex}let O=!1;if(I)if(r&&u){const F=t>0?e.charCodeAt(t-1):0,V=t>1?e.charCodeAt(t-2):0;F===32&&V!==32&&V!==9||(O=!0)}else O=!0;if(O)if(f){const F=g>0?p[g-1].endIndex:s;for(let V=F+1;V<=t;V++)p[g++]=new Wc(V,"mtkw",1,!1)}else p[g++]=new Wc(t,"mtkw",1,!1);else p[g++]=new Wc(t,_,0,v);return p}function $1r(n,e,t,i){i.sort(xh.compare);const r=D1r.normalize(n,i),s=r.length;let o=0;const a=[];let l=0,c=0;for(let d=0,f=t.length;d<f;d++){const p=t[d],g=p.endIndex,m=p.type,_=p.metadata,v=p.containsRTL;for(;o<s&&r[o].startOffset<g;){const b=r[o];if(b.startOffset>c&&(c=b.startOffset,a[l++]=new Wc(c,m,_,v)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new Wc(c,m+" "+b.className,_|b.metadata,v),o++;else{c=g,a[l++]=new Wc(c,m+" "+b.className,_|b.metadata,v);break}}g>c&&(c=g,a[l++]=new Wc(c,m,_,v))}const u=t[t.length-1].endIndex;if(o<s&&r[o].startOffset===u)for(;o<s&&r[o].startOffset===u;){const d=r[o];a[l++]=new Wc(c,d.className,d.metadata,!1),o++}return a}function H1r(n,e){const t=n.fontIsMonospace,i=n.canUseHalfwidthRightwardsArrow,r=n.containsForeignElements,s=n.lineContent,o=n.len,a=n.isOverflowing,l=n.overflowingCharCount,c=n.parts,u=n.fauxIndentLength,d=n.tabSize,f=n.startVisibleColumn,p=n.containsRTL,g=n.spaceWidth,m=n.renderSpaceCharCode,_=n.renderWhitespace,v=n.renderControlCharacters,b=new ly(o+1,c.length);let y=!1,C=0,S=f,k=0,I=0,L=0;p?e.appendString('<span dir="ltr">'):e.appendString("<span>");for(let N=0,P=c.length;N<P;N++){const O=c[N],F=O.endIndex,V=O.type,M=O.containsRTL,B=_!==0&&O.isWhitespace(),W=B&&!t&&(V==="mtkw"||!r),q=C===F&&O.isPseudoAfter();if(k=0,e.appendString("<span "),M&&e.appendString('style="unicode-bidi:isolate" '),e.appendString('class="'),e.appendString(W?"mtkz":V),e.appendASCIICharCode(34),B){let U=0;{let G=C,H=S;for(;G<F;G++){const Z=(s.charCodeAt(G)===9?d-H%d:1)|0;U+=Z,G>=u&&(H+=Z)}}for(W&&(e.appendString(' style="width:'),e.appendString(String(g*U)),e.appendString('px"')),e.appendASCIICharCode(62);C<F;C++){b.setColumnInfo(C+1,N-L,k,I),L=0;const G=s.charCodeAt(C);let H,z;if(G===9){H=d-S%d|0,z=H,!i||z>1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Z=2;Z<=z;Z++)e.appendCharCode(160)}else H=2,z=1,e.appendCharCode(m),e.appendCharCode(8204);k+=H,I+=z,C>=u&&(S+=z)}}else for(e.appendASCIICharCode(62);C<F;C++){b.setColumnInfo(C+1,N-L,k,I),L=0;const U=s.charCodeAt(C);let G=1,H=1;switch(U){case 9:G=d-S%d,H=G;for(let z=1;z<=G;z++)e.appendCharCode(160);break;case 32:e.appendCharCode(160);break;case 60:e.appendString("<");break;case 62:e.appendString(">");break;case 38:e.appendString("&");break;case 0:v?e.appendCharCode(9216):e.appendString("�");break;case 65279:case 8232:case 8233:case 133:e.appendCharCode(65533);break;default:YE(U)&&H++,v&&U<32?e.appendCharCode(9216+U):v&&U===127?e.appendCharCode(9249):v&&Put(U)?(e.appendString("[U+"),e.appendString(V1r(U)),e.appendString("]"),G=8,H=G):e.appendCharCode(U)}k+=G,I+=H,C>=u&&(S+=H)}q?L++:L=0,C>=o&&!y&&O.isPseudoAfter()&&(y=!0,b.setColumnInfo(C+1,N,k,I)),e.appendString("</span>")}return y||b.setColumnInfo(o+1,c.length-1,k,I),a&&(e.appendString('<span class="mtkoverflow">'),e.appendString(A("showMore","Show more ({0})",W1r(l))),e.appendString("</span>")),e.appendString("</span>"),new lbe(b,p,r)}function V1r(n){return n.toString(16).toUpperCase().padStart(4,"0")}function W1r(n){return n<1024?A("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}class g9e{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 z1r{constructor(e,t){this.tabSize=e,this.data=t}}class i2e{constructor(e,t,i,r,s,o,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=r,this.startVisibleColumn=s,this.tokens=o,this.inlineDecorations=a}}class bg{constructor(e,t,i,r,s,o,a,l,c,u){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=r,this.isBasicASCII=bg.isBasicASCII(i,o),this.containsRTL=bg.containsRTL(i,this.isBasicASCII,s),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?U9(e):!0}static containsRTL(e,t,i){return!t&&i?sM(e):!1}}class p6{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class U1r{constructor(e,t,i,r){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=r}toInlineDecoration(e){return new p6(new ie(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Out{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class V7{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&&fa(e.data,t.data)}static equalsArr(e,t){return fa(e,t,V7.equals)}}function q1r(n){return Array.isArray(n)}function K1r(n){return!q1r(n)}function Mut(n){return typeof n=="string"}function m9e(n){return!Mut(n)}function k2(n){return!n}function hw(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function _9e(n){return n.replace(/[&<>'"_]/g,"-")}function G1r(n,e){console.log(`${n.languageId}: ${e}`)}function ra(n,e){return new Error(`${n.languageId}: ${e}`)}function SS(n,e,t,i,r){const s=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let o=null;return e.replace(s,function(a,l,c,u,d,f,p,g,m){return k2(c)?k2(u)?!k2(d)&&d<i.length?hw(n,i[d]):!k2(p)&&n&&typeof n[p]=="string"?n[p]:(o===null&&(o=r.split("."),o.unshift(r)),!k2(f)&&f<o.length?hw(n,o[f]):""):hw(n,t):"$"})}function Y1r(n,e,t){const i=/\$[sS](\d\d?)/g;let r=null;return e.replace(i,function(s,o){return r===null&&(r=t.split("."),r.unshift(t)),!k2(o)&&o<r.length?hw(n,r[o]):""})}function EW(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 Q1r(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 X1r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Z1r=function(n,e){return function(t,i){e(t,i,n)}},cbe;const jut=5,nX=class nX{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 UP(e,t);let i=UP.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let r=this._entries[i];return r||(r=new UP(e,t),this._entries[i]=r,r)}};nX._INSTANCE=new nX(jut);let W7=nX;class UP{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 UP._equals(this,e)}push(e){return W7.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return W7.create(this.parent,e)}}class FR{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 FR(this.languageId,this.state)}}const iX=class iX{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 g6(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new g6(e,t);const i=UP.getStackElementId(e);let r=this._entries[i];return r||(r=new g6(e,null),this._entries[i]=r,r)}};iX._INSTANCE=new iX(jut);let ES=iX;class g6{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:ES.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof g6)||!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 J1r{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 n7(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,r){const s=i.languageId,o=i.state,a=Ka.get(s);if(!a)return this.enterLanguage(s),this.emit(r,""),o;const l=a.tokenize(e,t,o);if(r!==0)for(const c of l.tokens)this._tokens.push(new n7(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 hke(this._tokens,e)}}class tY{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,s=t.length,o=i!==null?i.length:0;if(r===0&&s===0&&o===0)return new Uint32Array(0);if(r===0&&s===0)return i;if(s===0&&o===0)return e;const a=new Uint32Array(r+s+o);e!==null&&a.set(e);for(let l=0;l<s;l++)a[r+l]=t[l];return i!==null&&a.set(i,r+s),a}nestedLanguageTokenize(e,t,i,r){const s=i.languageId,o=i.state,a=Ka.get(s);if(!a)return this.enterLanguage(s),this.emit(r,""),o;const l=a.tokenizeEncoded(e,t,o);if(r!==0)for(let c=0,u=l.tokens.length;c<u;c+=2)l.tokens[c]+=r;return this._prependTokens=tY._merge(this._prependTokens,this._tokens,l.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,l.endState}finalize(e){return new qee(tY._merge(this._prependTokens,this._tokens,null),e)}}let z7=cbe=class extends Ye{constructor(e,t,i,r,s){super(),this._configurationService=s,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=r,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let o=!1;this._register(Ka.onDidChange(a=>{if(o)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&&(o=!0,Ka.handleChange([this._languageId]),o=!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=Ka.get(t);if(i){if(i instanceof cbe){const r=i.getLoadStatus();r.loaded===!1&&e.push(r.promise)}continue}Ka.isResolved(t)||e.push(Ka.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=W7.create(null,this._lexer.start);return ES.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return fTe(this._languageId,i);const r=new J1r,s=this._tokenize(e,t,i,r);return r.finalize(s)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return Ate(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const r=new tY(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,r);return r.finalize(s)}_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=EW(this._lexer,t.stack.state),!i))throw ra(this._lexer,"tokenizer state is not defined: "+t.stack.state);let r=-1,s=!1;for(const o of i){if(!m9e(o.action)||o.action.nextEmbedded!=="@pop")continue;s=!0;let a=o.resolveRegex(t.stack.state);const l=a.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&&o.matchOnlyAtLineStart||(r===-1||c<r)&&(r=c)}if(!s)throw ra(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return r}_nestedTokenize(e,t,i,r,s){const o=this._findLeavingNestedLanguageOffset(e,i);if(o===-1){const c=s.nestedLanguageTokenize(e,t,i.embeddedLanguageData,r);return ES.create(i.stack,new FR(i.embeddedLanguageData.languageId,c))}const a=e.substring(0,o);a.length>0&&s.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,r);const l=e.substring(o);return this._myTokenize(l,t,i,r+o,s)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,r,s){s.enterLanguage(this._languageId);const o=e.length,a=t&&this._lexer.includeLF?e+` `:e,l=a.length;let c=i.embeddedLanguageData,u=i.stack,d=0,f=null,p=!0;for(;p||d<l;){const g=d,m=u.depth,_=f?f.groups.length:0,v=u.state;let b=null,y=null,C=null,S=null,k=null;if(f){b=f.matches;const N=f.groups.shift();y=N.matched,C=N.action,S=f.rule,f.groups.length===0&&(f=null)}else{if(!p&&d>=l)break;p=!1;let N=this._lexer.tokenizer[v];if(!N&&(N=EW(this._lexer,v),!N))throw ra(this._lexer,"tokenizer state is not defined: "+v);const P=a.substr(d);for(const O of N)if((d===0||!O.matchOnlyAtLineStart)&&(b=P.match(O.resolveRegex(v)),b)){y=b[0],C=O.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;K1r(C)&&m9e(C)&&C.test;)C=C.test(y,b,v,d===l);let I=null;if(typeof C=="string"||Array.isArray(C))I=C;else if(C.group)I=C.group;else if(C.token!==null&&C.token!==void 0){if(C.tokenSubst?I=SS(this._lexer,C.token,y,b,v):I=C.token,C.nextEmbedded)if(C.nextEmbedded==="@pop"){if(!c)throw ra(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw ra(this._lexer,"cannot enter embedded language from within an embedded language");k=SS(this._lexer,C.nextEmbedded,y,b,v)}if(C.goBack&&(d=Math.max(0,d-C.goBack)),C.switchTo&&typeof C.switchTo=="string"){let N=SS(this._lexer,C.switchTo,y,b,v);if(N[0]==="@"&&(N=N.substr(1)),EW(this._lexer,N))u=u.switchTo(N);else throw ra(this._lexer,"trying to switch to a state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}else{if(C.transform&&typeof C.transform=="function")throw ra(this._lexer,"action.transform not supported");if(C.next)if(C.next==="@push"){if(u.depth>=this._lexer.maxStack)throw ra(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(v)}else if(C.next==="@pop"){if(u.depth<=1)throw ra(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));u=u.pop()}else if(C.next==="@popall")u=u.popall();else{let N=SS(this._lexer,C.next,y,b,v);if(N[0]==="@"&&(N=N.substr(1)),EW(this._lexer,N))u=u.push(N);else throw ra(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}}C.log&&typeof C.log=="string"&&G1r(this._lexer,this._lexer.languageId+": "+SS(this._lexer,C.log,y,b,v))}if(I===null)throw ra(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const L=N=>{const P=this._languageService.getLanguageIdByLanguageName(N)||this._languageService.getLanguageIdByMimeType(N)||N,O=this._getNestedEmbeddedLanguageData(P);if(d<l){const F=e.substr(d);return this._nestedTokenize(F,t,ES.create(u,O),r+d,s)}else return ES.create(u,O)};if(Array.isArray(I)){if(f&&f.groups.length>0)throw ra(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==I.length+1)throw ra(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let N=0;for(let P=1;P<b.length;P++)N+=b[P].length;if(N!==y.length)throw ra(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(S));f={rule:S,matches:b,groups:[]};for(let P=0;P<I.length;P++)f.groups[P]={action:I[P],matched:b[P+1]};d-=y.length;continue}else{if(I==="@rematch"&&(d-=y.length,y="",b=null,I="",k!==null))return L(k);if(y.length===0){if(l===0||m!==u.depth||v!==u.state||(f?f.groups.length:0)!==_)continue;throw ra(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(S))}let N=null;if(Mut(I)&&I.indexOf("@brackets")===0){const P=I.substr(9),O=eCr(this._lexer,y);if(!O)throw ra(this._lexer,"@brackets token returned but no bracket defined as: "+y);N=_9e(O.token+P)}else{const P=I===""?"":I+this._lexer.tokenPostfix;N=_9e(P)}g<o&&s.emit(g+r,N)}if(k!==null)return L(k)}return ES.create(u,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new FR(e,mM);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),Ka.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=Ka.get(e);return t?new FR(e,t.getInitialState()):new FR(e,mM)}};z7=cbe=X1r([Z1r(4,Dr)],z7);function eCr(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}const vue=Xw("standaloneColorizer",{createHTML:n=>n});class r2e{static colorizeElement(e,t,i,r){r=r||{};const s=r.theme||"vs",o=r.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!o)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(o)||o;e.setTheme(s);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+s;const c=u=>{const d=(vue==null?void 0:vue.createHTML(u))??u;i.innerHTML=d};return this.colorize(t,l||"",a,r).then(c,u=>console.error(u))}static async colorize(e,t,i,r){const s=e.languageIdCodec;let o=4;r&&typeof r.tabSize=="number"&&(o=r.tabSize),bke(t)&&(t=t.substr(1));const a=_1(t);if(!e.isRegisteredLanguageId(i))return v9e(a,o,s);const l=await Ka.getOrCreate(i);return l?tCr(a,o,l,s):v9e(a,o,s)}static colorizeLine(e,t,i,r,s=4){const o=bg.isBasicASCII(e,t),a=bg.containsRTL(e,o,i);return Gte(new jk(!1,!0,e,!1,o,a,0,r,[],s,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 o=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function tCr(n,e,t,i){return new Promise((r,s)=>{const o=()=>{const a=nCr(n,e,t,i);if(t instanceof z7){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(o,s);return}}r(a)};o()})}function v9e(n,e,t){let i=[];const s=new Uint32Array(2);s[0]=0,s[1]=33587200;for(let o=0,a=n.length;o<a;o++){const l=n[o];s[0]=l.length;const c=new Xc(s,l,t),u=bg.isBasicASCII(l,!0),d=bg.containsRTL(l,u,!0),f=Gte(new jk(!1,!0,l,!1,u,d,0,c,[],e,0,0,0,0,-1,"none",!1,!1,null));i=i.concat(f.html),i.push("<br/>")}return i.join("")}function nCr(n,e,t,i){let r=[],s=t.getInitialState();for(let o=0,a=n.length;o<a;o++){const l=n[o],c=t.tokenizeEncoded(l,!0,s);Xc.convertToEndOffset(c.tokens,l.length);const u=new Xc(c.tokens,l,i),d=bg.isBasicASCII(l,!0),f=bg.containsRTL(l,d,!0),p=Gte(new jk(!1,!0,l,!1,d,f,0,u.inflate(),[],e,0,0,0,0,-1,"none",!1,!1,null));r=r.concat(p.html),r.push("<br/>"),s=c.endState}return r.join("")}var iCr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},rCr=function(n,e){return function(t,i){e(t,i,n)}},tO;let nY=(tO=class{constructor(e,t){}dispose(){}},tO.ID="editor.contrib.markerDecorations",tO);nY=iCr([rCr(1,STe)],nY);cs(nY.ID,nY,0);class Fut extends Ye{constructor(e,t){super(),this._onDidChange=this._register(new Ue),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 s=()=>{if(i&&!r)try{i=!1,r=!0,t()}finally{lp(Ti(this._referenceDomElement),()=>{r=!1,s()})}};this._resizeObserver=new ResizeObserver(o=>{o&&o[0]&&o[0].contentRect?e={width:o[0].contentRect.width,height:o[0].contentRect.height}:e=null,i=!0,s()}),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())}}const sP=class sP{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=sP._read(e,this.key),i=s=>sP._read(e,s),r=(s,o)=>sP._write(e,s,o);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 s=t.substring(0,r);e[s]=e[s]||{},this._write(e[s],t.substring(r+1),i);return}e[t]=i}};sP.items=[];let U7=sP;function e0(n,e){U7.items.push(new U7(n,e))}function hp(n,e){e0(n,(t,i,r)=>{if(typeof t<"u"){for(const[s,o]of e)if(t===s){r(n,o);return}}})}function sCr(n){U7.items.forEach(e=>e.apply(n))}hp("wordWrap",[[!0,"on"],[!1,"off"]]);hp("lineNumbers",[[!0,"on"],[!1,"off"]]);hp("cursorBlinking",[["visible","solid"]]);hp("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);hp("renderLineHighlight",[[!0,"line"],[!1,"none"]]);hp("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);hp("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);hp("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);hp("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);hp("autoIndent",[[!1,"advanced"],[!0,"full"]]);hp("matchBrackets",[[!0,"always"],[!1,"never"]]);hp("renderFinalNewline",[[!0,"on"],[!1,"off"]]);hp("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);hp("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);hp("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);e0("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});e0("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});e0("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const oCr={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"};e0("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(oCr))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});e0("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});e0("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});e0("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});e0("codeActionsOnSave",(n,e,t)=>{if(n&&typeof n=="object"){let i=!1;const r={};for(const s of Object.entries(n))typeof s[1]=="boolean"?(i=!0,r[s[0]]=s[1]?"explicit":"never"):r[s[0]]=s[1];i&&t("codeActionsOnSave",r)}});e0("codeActionWidget.includeNearbyQuickfixes",(n,e,t)=>{typeof n=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",n))});e0("lightbulb.enabled",(n,e,t)=>{typeof n=="boolean"&&t("lightbulb.enabled",n?void 0:"off")});class aCr{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new Ue,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const EM=new aCr;var lCr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},cCr=function(n,e){return function(t,i){e(t,i,n)}};let ube=class extends Ye{constructor(e,t,i,r,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new Ue),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new Ue),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new sot,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new Fut(r,i.dimension)),this._targetWindowId=Ti(r).vscodeWindowId,this._rawOptions=b9e(i),this._validatedOptions=kS.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(lm.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(EM.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(jme.onDidChange(()=>this._recomputeOptions())),this._register(c7.getInstance(Ti(r)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=kS.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=cI.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:EM.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return kS.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:dCr(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:Kee||Dm,pixelRatio:c7.getInstance(d8e(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return jme.readFontInfo(d8e(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=b9e(e);kS.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=kS.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=uCr(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())}};ube=lCr([cCr(4,dp)],ube);function uCr(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function dCr(){let n="";return!QE&&!Dot&&(n+="no-user-select "),QE&&(n+="no-minimap-shadow ",n+="enable-user-select "),zr&&(n+="mac "),n}class hCr{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class fCr{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 kS{static validateOptions(e){const t=new hCr;for(const i of TR){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 fCr;for(const r of TR)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)?fa(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!kS._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let r=!1;for(const s of TR){const o=!kS._deepEquals(e._read(s.id),t._read(s.id));i[s.id]=o,o&&(r=!0)}return r?new rot(i):null}static applyUpdate(e,t){let i=!1;for(const r of TR)if(t.hasOwnProperty(r.name)){const s=r.applyUpdate(e[r.name],t[r.name]);e[r.name]=s.newValue,i=i||s.didChange}return i}}function b9e(n){const e=TC(n);return sCr(e),e}var zS;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},r={...e};let s=0;const o={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),o.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){o.keydown===1&&(performance.mark("keydown/end"),o.keydown=2)}function c(){performance.mark("input/start"),o.input=1,_()}n.onBeforeInput=c;function u(){o.input===0&&c(),queueMicrotask(d)}n.onInput=u;function d(){o.input===1&&(performance.mark("input/end"),o.input=2)}function f(){v()}n.onKeyUp=f;function p(){v()}n.onSelectionChange=p;function g(){o.keydown===2&&o.input===2&&o.render===0&&(performance.mark("render/start"),o.render=1,queueMicrotask(m),_())}n.onRenderStart=g;function m(){o.render===1&&(performance.mark("render/end"),o.render=2)}function _(){setTimeout(v)}function v(){o.keydown===2&&o.input===2&&o.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),s++,y())}function b(I,L){const N=performance.getEntriesByName(I)[0].duration;L.total+=N,L.min=Math.min(L.min,N),L.max=Math.max(L.max,N)}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"),o.keydown=0,o.input=0,o.render=0}function C(){if(s===0)return;const I={keydown:S(e),input:S(t),render:S(i),total:S(r),sampleCount:s};return k(e),k(t),k(i),k(r),s=0,I}n.getAndClearMeasurements=C;function S(I){return{average:I.total/s,max:I.max,min:I.min}}function k(I){I.total=0,I.min=Number.MAX_VALUE,I.max=0}})(zS||(zS={}));class Yte{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new But(this.x-e.scrollX,this.y-e.scrollY)}}class But{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new Yte(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class pCr{constructor(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r,this._editorPagePositionBrand=void 0}}class gCr{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function s2e(n){const e=al(n);return new pCr(e.left,e.top,e.width,e.height)}function o2e(n,e,t){const i=e.width/n.offsetWidth,r=e.height/n.offsetHeight,s=(t.x-e.x)/i,o=(t.y-e.y)/r;return new gCr(s,o)}class sk extends B_{constructor(e,t,i){super(Ti(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new Yte(this.posx,this.posy),this.editorPos=s2e(i),this.relativePos=o2e(i,this.editorPos,this.pos)}}class mCr{constructor(e){this._editorViewDomNode=e}_create(e){return new sk(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return _t(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return _t(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return _t(e,Xt.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return _t(e,Xt.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return _t(e,Xt.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return _t(e,"mousemove",i=>t(this._create(i)))}}class _Cr{constructor(e){this._editorViewDomNode=e}_create(e){return new sk(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return _t(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return _t(e,Xt.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return _t(e,Xt.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return _t(e,"pointermove",i=>t(this._create(i)))}}class vCr extends Ye{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new K4),this._keydownListener=null}startMonitoring(e,t,i,r,s){this._keydownListener=Da(e.ownerDocument,"keydown",o=>{o.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,o.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,o=>{r(new sk(o,!0,this._editorViewDomNode))},o=>{this._keydownListener.dispose(),s(o)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const rX=class rX{constructor(e){this._editor=e,this._instanceId=++rX._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new ao(()=>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 bCr(t,`dyn-rule-${this._instanceId}-${r}`,zK(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())}};rX._idPool=0;let iY=rX;class bCr{constructor(e,t,i,r){this.key=e,this.className=t,this.properties=r,this._referenceCount=0,this._styleElementDisposables=new Et,this._styleElement=_g(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const r in t){const s=t[r];let o;typeof s=="object"?o=kn(s.id):o=s;const a=yCr(r);i+=` ${a}: ${o};`}return i+=` }`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function yCr(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class p$ extends Ye{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 s=e[i];switch(s.type){case 0:this.onCompositionStart(s)&&(t=!0);break;case 1:this.onCompositionEnd(s)&&(t=!0);break;case 2:this.onConfigurationChanged(s)&&(t=!0);break;case 3:this.onCursorStateChanged(s)&&(t=!0);break;case 4:this.onDecorationsChanged(s)&&(t=!0);break;case 5:this.onFlushed(s)&&(t=!0);break;case 6:this.onFocusChanged(s)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(s)&&(t=!0);break;case 8:this.onLineMappingChanged(s)&&(t=!0);break;case 9:this.onLinesChanged(s)&&(t=!0);break;case 10:this.onLinesDeleted(s)&&(t=!0);break;case 11:this.onLinesInserted(s)&&(t=!0);break;case 12:this.onRevealRangeRequest(s)&&(t=!0);break;case 13:this.onScrollChanged(s)&&(t=!0);break;case 15:this.onTokensChanged(s)&&(t=!0);break;case 14:this.onThemeChanged(s)&&(t=!0);break;case 16:this.onTokensColorsChanged(s)&&(t=!0);break;case 17:this.onZonesChanged(s)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(s)}}t&&(this._shouldRender=!0)}}class fp extends p${constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class zb{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 s=new Uint8Array(r);for(let o=0;o<r;o++)s[o]=i[r-o-1];return s}}class CCr{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 wCr extends CCr{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 xCr{constructor(e,t,i,r){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=r}}class Qte{static from(e){const t=new Array(e.length);for(let i=0,r=e.length;i<r;i++){const s=e[i];t[i]=new Qte(s.left,s.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 _I{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 SCr{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class y9e{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class yU{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,r,s){const o=this._createRange();try{return o.setStart(e,t),o.setEnd(i,r),o.getClientRects()}catch{return null}finally{this._detachRange(o,s)}}static _mergeAdjacentRanges(e){if(e.length===1)return e;e.sort(_I.compare);const t=[];let i=0,r=e[0];for(let s=1,o=e.length;s<o;s++){const a=e[s];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 s=0,o=e.length;s<o;s++){const a=e[s];r[s]=new _I(Math.max(0,(a.left-t)/i),a.width/i)}return this._mergeAdjacentRanges(r)}static readHorizontalRanges(e,t,i,r,s,o){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===s&&i===0&&!e.children[t].firstChild){const f=e.children[t].getClientRects();return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(f,o.clientRectDeltaLeft,o.clientRectScale)}t!==r&&r>0&&s===0&&(r--,s=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&&s===0&&r>0&&(u=e.children[r-1].firstChild,s=1073741824)),!c||!u)return null;i=Math.min(c.textContent.length,Math.max(0,i)),s=Math.min(u.textContent.length,Math.max(0,s));const d=this._readClientRects(c,i,u,s,o.endNode);return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,o.clientRectDeltaLeft,o.clientRectScale)}}const ECr=function(){return qy?!0:!(Nh||Dm||QE)}();let qP=!0;class C9e{constructor(e,t){this.themeType=t;const i=e.options,r=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(100):this.renderWhitespace="none",this.renderControlCharacters=i.get(95),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(67),this.stopRenderingLineAfter=i.get(118),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}}const sX=class sX{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=Hs(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 Ab(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,r,s){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=r.getViewLineRenderingData(e),a=this._options,l=xh.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let c=null;if(Ab(a.themeType)||this._options.renderWhitespace==="selection"){const p=r.selections;for(const g of p){if(g.endLineNumber<e||g.startLineNumber>e)continue;const m=g.startLineNumber===e?g.startColumn:o.minColumn,_=g.endLineNumber===e?g.endColumn:o.maxColumn;m<_&&(Ab(a.themeType)&&l.push(new xh(m,_,"inline-selected-text",0)),this._options.renderWhitespace==="selection"&&(c||(c=[]),c.push(new Dut(m-1,_-1))))}}const u=new jk(a.useMonospaceOptimizations,a.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,l,o.tabSize,o.startVisibleColumn,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,a.stopRenderingLineAfter,a.renderWhitespace,a.renderControlCharacters,a.fontLigatures!==UE.OFF,c);if(this._renderedViewLine&&this._renderedViewLine.input.equals(u))return!1;s.appendString('<div style="top:'),s.appendString(String(t)),s.appendString("px;height:"),s.appendString(String(i)),s.appendString('px;" class="'),s.appendString(sX.CLASS_NAME),s.appendString('">');const d=f$(u,s);s.appendString("</div>");let f=null;return qP&&ECr&&o.isBasicASCII&&a.useMonospaceOptimizations&&d.containsForeignElements===0&&(f=new kW(this._renderedViewLine?this._renderedViewLine.domNode:null,u,d.characterMapping)),f||(f=Hut(this._renderedViewLine?this._renderedViewLine.domNode:null,u,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=f,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i))}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 kW:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof kW?this._renderedViewLine.monospaceAssumptionsAreValid():qP}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof kW&&(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 s=this._renderedViewLine.input.stopRenderingLineAfter;if(s!==-1&&t>s+1&&i>s+1)return new y9e(!0,[new _I(this.getWidth(r),0)]);s!==-1&&t>s+1&&(t=s+1),s!==-1&&i>s+1&&(i=s+1);const o=this._renderedViewLine.getVisibleRangesForRange(e,t,i,r);return o&&o.length>0?new y9e(!1,o):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};sX.CLASS_NAME="view-line";let MC=sX;class kW{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 s=0;s<r;s++)this._keyColumnPixelOffsetCache[s]=-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 qP;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!"),qP=!1)}return qP}toSlowRenderedLine(){return Hut(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,r){const s=this._getColumnPixelOffset(e,t,r),o=this._getColumnPixelOffset(e,i,r);return[new _I(s,o-s)]}_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,s=(r+1)*300+1;let o=-1;if(this._keyColumnPixelOffsetCache&&(o=this._keyColumnPixelOffsetCache[r],o===-1&&(o=this._actualReadPixelOffset(e,s,i),this._keyColumnPixelOffsetCache[r]=o)),o===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(s),l=this._characterMapping.getHorizontalOffset(t);return o+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),s=yU.readHorizontalRanges(this._getReadingTarget(this.domNode),r.partIndex,r.charIndex,r.partIndex,r.charIndex,i);return!s||s.length===0?-1:s[0].left}getColumnOfNodeOffset(e,t){return a2e(this._characterMapping,e,t)}}class $ut{constructor(e,t,i,r,s){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=s,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let o=0,a=this._characterMapping.length;o<=a;o++)this._pixelOffsetCache[o]=-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 s=this._readPixelOffset(this.domNode,e,t,r);if(s===-1)return null;const o=this._readPixelOffset(this.domNode,e,i,r);return o===-1?null:[new _I(s,o-s)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,r)}_readVisibleRangesForRange(e,t,i,r,s){if(i===r){const o=this._readPixelOffset(e,t,i,s);return o===-1?null:[new _I(o,0)]}else return this._readRawVisibleRangesForRange(e,i,r,s)}_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 s=this._getReadingTarget(e);return s.firstChild?(r.markDidDomLayout(),s.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const s=this._pixelOffsetCache[i];if(s!==-1)return s;const o=this._actualReadPixelOffset(e,t,i,r);return this._pixelOffsetCache[i]=o,o}return this._actualReadPixelOffset(e,t,i,r)}_actualReadPixelOffset(e,t,i,r){if(this._characterMapping.length===0){const l=yU.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 s=this._characterMapping.getDomPosition(i),o=yU.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,s.partIndex,s.charIndex,r);if(!o||o.length===0)return-1;const a=o[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 _I(0,this.getWidth(r))];const s=this._characterMapping.getDomPosition(t),o=this._characterMapping.getDomPosition(i);return yU.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,o.partIndex,o.charIndex,r)}getColumnOfNodeOffset(e,t){return a2e(this._characterMapping,e,t)}}class kCr extends $ut{_readVisibleRangesForRange(e,t,i,r,s){const o=super._readVisibleRangesForRange(e,t,i,r,s);if(!o||o.length===0||i===r||i===1&&r===this._characterMapping.length)return o;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,r,s);if(a!==-1){const l=o[o.length-1];l.left<a&&(l.width=a-l.left)}}return o}}const Hut=function(){return Kee?TCr:ICr}();function TCr(n,e,t,i,r){return new kCr(n,e,t,i,r)}function ICr(n,e,t,i,r){return new $ut(n,e,t,i,r)}function a2e(n,e,t){const i=e.textContent.length;let r=-1;for(;e;)e=e.previousSibling,r++;return n.getColumn(new Rut(r,t),i)}class q7{static whitespaceVisibleColumn(e,t,i){const r=e.length;let s=0,o=-1,a=-1;for(let l=0;l<r;l++){if(l===t)return[o,a,s];switch(s%i===0&&(o=l,a=s),e.charCodeAt(l)){case 32:s+=1;break;case 9:s=cc.nextRenderTabStop(s,i);break;default:return[-1,-1,-1]}}return t===r?[o,a,s]:[-1,-1,-1]}static atomicPosition(e,t,i,r){const s=e.length,[o,a,l]=q7.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(o===-1)return-1;let f=a;for(let p=o;p<s;++p){if(f===a+i)return o;switch(e.charCodeAt(p)){case 32:f+=1;break;case 9:f=cc.nextRenderTabStop(f,i);break;default:return-1}}return f===a+i?o:-1}const u=cc.nextRenderTabStop(l,i);let d=l;for(let f=t;f<s;f++){if(d===u)return f;switch(e.charCodeAt(f)){case 32:d+=1;break;case 9:d=cc.nextRenderTabStop(d,i);break;default:return-1}}return d===u?s:-1}}class rS{constructor(e=null){this.hitTarget=e,this.type=0}}class Vut{get hitTarget(){return this.spanNode}constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var T2;(function(n){function e(t,i,r){const s=t.getPositionFromDOMInfo(i,r);return s?new Vut(s,i,null):new rS(i)}n.createFromDOMInfo=e})(T2||(T2={}));class LCr{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class jd{static _deduceRage(e,t=null){return!t&&e?new ie(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,s,o){return{type:e,element:t,mouseColumn:i,position:r,range:s,detail:o}}static createViewZone(e,t,i,r,s){return{type:e,element:t,mouseColumn:i,position:r,range:this._deduceRage(r),detail:s}}static createContentText(e,t,i,r,s){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,r),detail:s}}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 oh{static isTextArea(e){return e.length===2&&e[0]===3&&e[1]===7}static isChildOfViewLines(e){return e.length>=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}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}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}}class kM{constructor(e,t,i){this.viewModel=e.viewModel;const r=e.configuration.options;this.layoutInfo=r.get(146),this.viewDomNode=t.viewDomNode,this.lineHeight=r.get(67),this.stickyTabStops=r.get(117),this.typicalHalfwidthCharacterWidth=r.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return kM.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const r=i.verticalOffset+i.height/2,s=e.viewModel.getLineCount();let o=null,a,l=null;return i.afterLineNumber!==s&&(l=new We(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(o=new We(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=o:o===null?a=l:t<r?a=o:a=l,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:o,positionAfter:l,position:a}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const r=this._context.viewModel.getLineCount(),s=this._context.viewModel.getLineMaxColumn(r);return{range:new ie(r,s,r,s),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new ie(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 kM._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 ACr{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,Pd._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class NCr extends ACr{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=zb.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,r,s){super(e,t,i,r),this.hitTestResult=new Bb(()=>Pd.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=s;const o=!!this._eventTarget;this._useHitTestTarget=!o}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}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?cc.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return jd.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return jd.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,r){return jd.createMargin(e,this.target,this._getMouseColumn(t),t,i,r)}fulfillViewZone(e,t,i){return jd.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return jd.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return jd.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return jd.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return jd.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return jd.createOverlayWidget(this.target,this._getMouseColumn(),e)}}const w9e={isAfterLines:!0};function bue(n){return{isAfterLines:!1,horizontalDistanceToText:n}}class Pd{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=zb.collect(t,this._viewHelper.viewDomNode);return!!(oh.isChildOfContentWidgets(i)||oh.isChildOfOverflowingContentWidgets(i)||oh.isChildOfOverlayWidgets(i)||oh.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,r,s){const o=new kM(this._context,this._viewHelper,e),a=new NCr(o,t,i,r,s);try{const l=Pd._createMouseTarget(o,a);if(l.type===6&&o.stickyTabStops&&l.position!==null){const c=Pd._snapToSoftTabBoundary(l.position,o.viewModel),u=ie.fromPositions(c,c).plusRange(l.range);return a.fulfillContentText(c,u,l.detail)}return l}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t){if(t.target===null)return t.fulfillUnknown();const i=t;let r=null;return!oh.isChildOfOverflowGuard(t.targetPath)&&!oh.isChildOfOverflowingContentWidgets(t.targetPath)&&!oh.isChildOfOverflowingOverlayWidgets(t.targetPath)&&(r=r||t.fulfillUnknown()),r=r||Pd._hitTestContentWidget(e,i),r=r||Pd._hitTestOverlayWidget(e,i),r=r||Pd._hitTestMinimap(e,i),r=r||Pd._hitTestScrollbarSlider(e,i),r=r||Pd._hitTestViewZone(e,i),r=r||Pd._hitTestMargin(e,i),r=r||Pd._hitTestViewCursor(e,i),r=r||Pd._hitTestTextArea(e,i),r=r||Pd._hitTestViewLines(e,i),r=r||Pd._hitTestScrollbar(e,i),r||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(oh.isChildOfContentWidgets(t.targetPath)||oh.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(oh.isChildOfOverlayWidgets(t.targetPath)||oh.isChildOfOverflowingOverlayWidgets(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,s=t.mouseVerticalOffset;for(const o of i){if(r<o.contentLeft||r>o.contentLeft+o.width)continue;const a=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(a<=s&&s<=a+o.height)return t.fulfillContentText(o.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 oh.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 s=Math.abs(t.relativePos.x);const o={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:s};if(s-=e.layoutInfo.glyphMarginLeft,s<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return o.glyphMarginLane=l[Math.floor(s/e.lineHeight)],t.fulfillMargin(2,r,i.range,o)}return s-=e.layoutInfo.glyphMarginWidth,s<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,r,i.range,o):(s-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,r,i.range,o))}return null}static _hitTestViewLines(e,t){if(!oh.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new We(1,1),w9e);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const r=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(r);return t.fulfillContentEmpty(new We(r,s),w9e)}if(oh.isStrictChildOfViewLines(t.targetPath)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(r)===0){const o=e.getLineWidth(r),a=bue(t.mouseContentHorizontalOffset-o);return t.fulfillContentEmpty(new We(r,1),a)}const s=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>=s){const o=bue(t.mouseContentHorizontalOffset-s),a=new We(r,e.viewModel.getLineMaxColumn(r));return t.fulfillContentEmpty(a,o)}}const i=t.hitTestResult.value;return i.type===1?Pd.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(oh.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new We(i,r))}return null}static _hitTestScrollbarSlider(e,t){if(oh.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),s=e.viewModel.getLineMaxColumn(r);return t.fulfillScrollbar(new We(r,s))}}return null}static _hitTestScrollbar(e,t){if(oh.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new We(i,r))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(146),r=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return Pd._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,s){const o=r.lineNumber,a=r.column,l=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>l){const v=bue(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(r,v)}const c=e.visibleRangeForPosition(o,a);if(!c)return t.fulfillUnknown(r);const u=c.left;if(Math.abs(t.mouseContentHorizontalOffset-u)<1)return t.fulfillContentText(r,null,{mightBeForeignElement:!!s,injectedText:s});const d=[];if(d.push({offset:c.left,column:a}),a>1){const v=e.visibleRangeForPosition(o,a-1);v&&d.push({offset:v.left,column:a-1})}const f=e.viewModel.getLineMaxColumn(o);if(a<f){const v=e.visibleRangeForPosition(o,a+1);v&&d.push({offset:v.left,column:a+1})}d.sort((v,b)=>v.offset-b.offset);const p=t.pos.toClientCoordinates(Ti(e.viewDomNode)),g=i.getBoundingClientRect(),m=g.left<=p.clientX&&p.clientX<=g.right;let _=null;for(let v=1;v<d.length;v++){const b=d[v-1],y=d[v];if(b.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=y.offset){_=new ie(o,b.column,o,y.column);const C=Math.abs(b.offset-t.mouseContentHorizontalOffset),S=Math.abs(y.offset-t.mouseContentHorizontalOffset);r=C<S?new We(o,b.column):new We(o,y.column);break}}return t.fulfillContentText(r,_,{mightBeForeignElement:!m||!!s,injectedText:s})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.getVerticalOffsetForLineNumber(i),s=r+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>s)){const a=Math.floor((r+s)/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 Yte(t.pos.x,l),u=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(Ti(e.viewDomNode)));if(u.type===1)return u}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(Ti(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=$L(e.viewDomNode);let r;if(i?typeof i.caretRangeFromPoint>"u"?r=DCr(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 rS;const s=r.startContainer;if(s.nodeType===s.TEXT_NODE){const o=s.parentNode,a=o?o.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===MC.CLASS_NAME?T2.createFromDOMInfo(e,o,r.startOffset):new rS(s.parentNode)}else if(s.nodeType===s.ELEMENT_NODE){const o=s.parentNode,a=o?o.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===MC.CLASS_NAME?T2.createFromDOMInfo(e,s,s.textContent.length):new rS(s)}return new rS}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,s=r?r.parentNode:null,o=s?s.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===MC.CLASS_NAME?T2.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new rS(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const r=i.offsetNode.parentNode,s=r&&r.nodeType===r.ELEMENT_NODE?r.className:null,o=r?r.parentNode:null,a=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(s===MC.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return T2.createFromDOMInfo(e,l,0)}else if(a===MC.CLASS_NAME)return T2.createFromDOMInfo(e,i.offsetNode,0)}return new rS(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),s=q7.atomicPosition(i,e.column-1,r,2);return s!==-1?new We(e.lineNumber,s+1):e}static doHitTest(e,t){let i=new rS;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(Ti(e.viewDomNode)))),i.type===1){const r=e.viewModel.getInjectedTextAt(i.position),s=e.viewModel.normalizePosition(i.position,2);(r||!s.equals(i.position))&&(i=new Vut(s,i.spanNode,r))}return i}}function DCr(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 s=r.getBoundingClientRect(),o=Ti(r),a=o.getComputedStyle(r,null).getPropertyValue("font-style"),l=o.getComputedStyle(r,null).getPropertyValue("font-variant"),c=o.getComputedStyle(r,null).getPropertyValue("font-weight"),u=o.getComputedStyle(r,null).getPropertyValue("font-size"),d=o.getComputedStyle(r,null).getPropertyValue("line-height"),f=o.getComputedStyle(r,null).getPropertyValue("font-family"),p=`${a} ${l} ${c} ${u}/${d} ${f}`,g=r.innerText;let m=s.left,_=0,v;if(e>s.left+s.width)_=g.length;else{const b=dbe.getInstance();for(let y=0;y<g.length+1;y++){if(v=b.getCharWidth(g.charAt(y),p)/2,m+=v,e<m){_=y;break}m+=v}}i.setStart(r.firstChild,_),i.setEnd(r.firstChild,_)}return i}const P2=class P2{static getInstance(){return P2._INSTANCE||(P2._INSTANCE=new P2),P2._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 o=r.measureText(e).width;return this._cache[i]=o,o}};P2._INSTANCE=null;let dbe=P2;class l2e extends p${constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Pd(this._context,i),this._mouseDownOperation=this._register(new RCr(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(o,a)=>this._createMouseTarget(o,a),o=>this._getMouseColumn(o))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(146).height;const r=new mCr(this.viewHelper.viewDomNode);this._register(r.onContextMenu(this.viewHelper.viewDomNode,o=>this._onContextMenu(o,!0))),this._register(r.onMouseMove(this.viewHelper.viewDomNode,o=>{this._onMouseMove(o),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=_t(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new sk(a,!1,this.viewHelper.viewDomNode))}))})),this._register(r.onMouseUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(r.onMouseLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o)));let s=0;this._register(r.onPointerDown(this.viewHelper.viewDomNode,(o,a)=>{s=a})),this._register(_t(this.viewHelper.viewDomNode,Xt.POINTER_UP,o=>{this._mouseDownOperation.onPointerUp()})),this._register(r.onMouseDown(this.viewHelper.viewDomNode,o=>this._onMouseDown(o,s))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=uG.INSTANCE;let t=0,i=lm.getZoomLevel(),r=!1,s=0;const o=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(76))return;const c=new BL(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=lm.getZoomLevel(),d=c.deltaY>0?1:-1;lm.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=lm.getZoomLevel(),r=a(l),s=0),t=Date.now(),s+=c.deltaY,r&&(lm.setZoomLevel(i+s/5),c.preventDefault(),c.stopPropagation())};this._register(_t(this.viewHelper.viewDomNode,Xt.MOUSE_WHEEL,o,{capture:!0,passive:!1}));function a(l){return zr?(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(146)){const t=this._context.configuration.options.get(146).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 But(e,t).toPageCoordinates(Ti(this.viewHelper.viewDomNode)),s=s2e(this.viewHelper.viewDomNode);if(r.y<s.y||r.y>s.y+s.height||r.x<s.x||r.x>s.x+s.width)return null;const o=o2e(this.viewHelper.viewDomNode,s,r);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),s,r,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const r=$L(this.viewHelper.viewDomNode);r&&(i=r.elementsFromPoint(e.posx,e.posy).find(s=>this.viewHelper.viewDomNode.contains(s)))}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,s=i.type===2||i.type===3||i.type===4,o=i.type===3,a=this._context.configuration.options.get(110),l=i.type===8||i.type===5,c=i.type===9;let u=e.leftButton||e.middleButton;zr&&e.leftButton&&e.ctrlKey&&(u=!1);const d=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(r||o&&a))d(),this._mouseDownOperation.start(i.type,e,t);else if(s)e.preventDefault();else if(l){const f=i.detail;u&&this.viewHelper.shouldSuppressMouseDownOnViewZone(f.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 RCr extends Ye{constructor(e,t,i,r,s,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=r,this._createMouseTarget=s,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new vCr(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new PCr(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new hbe,this._currentSelection=new Yn(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 s=this._context.configuration.options;if(!s.get(92)&&s.get(35)&&!s.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,o=>this._onMouseDownThenMove(o),o=>{const a=this._findMousePosition(this._lastMouseEvent,!1);IC(o)?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,o=>this._onMouseDownThenMove(o),()=>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,s=this._getMouseColumn(e);if(e.posy<t.y){const a=t.y-e.posy,l=Math.max(r.getCurrentScrollTop()-a,0),c=kM.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return jd.createOutsideEditor(s,d,"above",a)}const u=r.getLineNumberAtVerticalOffset(l);return jd.createOutsideEditor(s,new We(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=kM.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return jd.createOutsideEditor(s,d,"below",a)}const u=r.getLineNumberAtVerticalOffset(l);return jd.createOutsideEditor(s,new We(u,i.getLineMaxColumn(u)),"below",a)}const o=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+e.relativePos.y);if(e.posx<t.x){const a=t.x-e.posx;return jd.createOutsideEditor(s,new We(o,1),"left",a)}if(e.posx>t.x+t.width){const a=e.posx-t.x-t.width;return jd.createOutsideEditor(s,new We(o,i.getLineMaxColumn(o)),"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 o=this._helpPositionJumpOverViewZone(r.detail);if(o)return jd.createViewZone(r.type,r.element,r.mouseColumn,o,r.detail)}return r}_helpPositionJumpOverViewZone(e){const t=new We(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 PCr extends Ye{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 OCr(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class OCr extends Ye{constructor(e,t,i,r,s,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=r,this._position=s,this._mouseEvent=o,this._lastTime=Date.now(),this._animationFrameDisposable=lp(Ti(o.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.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(67),t=this._context.configuration.options.get(146).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(67),t=this._getScrollSpeed(),i=this._tick(),r=t*(i/1e3)*e,s=this._position.outsidePosition==="above"?-r:r;this._context.viewModel.viewLayout.deltaScrollNow(0,s),this._viewHelper.renderNow();const o=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?o.startLineNumber:o.endLineNumber;let l;{const c=s2e(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(146).horizontalScrollbarHeight,d=new Yte(this._mouseEvent.pos.x,c.y+c.height-u-.1),f=o2e(this._viewHelper.viewDomNode,c,d);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,d,f,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=jd.createOutsideEditor(this._position.mouseColumn,new We(a,1),"above",this._position.outsideDistance):l=jd.createOutsideEditor(this._position.mouseColumn,new We(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=lp(Ti(l.element),()=>this._execute())}}const oX=class oX{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>oX.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)}};oX.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let hbe=oX;const oP=class oP{constructor(e,t,i,r,s){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=r,this.newlineCountBeforeSelection=s}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),r=e.getSelectionStart(),s=e.getSelectionEnd();let o;if(t){const a=i.substring(0,r),l=t.value.substring(0,t.selectionStart);a===l&&(o=t.newlineCountBeforeSelection)}return new oP(i,r,s,null,o)}collapseSelection(){return this.selectionStart===this.value.length?this:new oP(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 r,s,o,a;if(e<=this.selectionStart){const l=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(((r=this.selection)==null?void 0:r.getStartPosition())??null,l,-1)}if(e>=this.selectionEnd){const l=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(((s=this.selection)==null?void 0:s.getEndPosition())??null,l,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(((o=this.selection)==null?void 0:o.getStartPosition())??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(((a=this.selection)==null?void 0:a.getEndPosition())??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let r=0,s=-1;for(;(s=t.indexOf(` `,s+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(GE(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(FK(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(r,e.value.length-s);const o=t.value.substring(r,t.value.length-s),a=e.selectionStart-r,l=e.selectionEnd-r,c=t.selectionStart-r,u=t.selectionEnd-r;if(c===u){const f=e.selectionStart-r;return{text:o,replacePrevCharCnt:f,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:o,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(GE(e.value,t.value),e.selectionEnd),r=Math.min(FK(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-r),o=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:o,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-o.length}}};oP.EMPTY=new oP("",0,0,null,void 0);let Fd=oP;class BR{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,r=i+1,s=i+t;return new ie(r,1,s+1,1)}static fromEditorSelection(e,t,i,r){const o=BR._getPageOfLine(t.startLineNumber,i),a=BR._getRangeForPage(o,i),l=BR._getPageOfLine(t.endLineNumber,i),c=BR._getRangeForPage(l,i);let u=a.intersectRanges(new ie(1,1,t.startLineNumber,t.startColumn));if(r&&e.getValueLengthInRange(u,1)>500){const v=e.modifyPosition(u.getEndPosition(),-500);u=ie.fromPositions(v,u.getEndPosition())}const d=e.getValueInRange(u,1),f=e.getLineCount(),p=e.getLineMaxColumn(f);let g=c.intersectRanges(new ie(t.endLineNumber,t.endColumn,f,p));if(r&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=ie.fromPositions(g.getStartPosition(),v)}const m=e.getValueInRange(g,1);let _;if(o===l||o+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=c.intersectRanges(t);_=e.getValueInRange(v,1)+"…"+e.getValueInRange(b,1)}return r&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new Fd(d+_+m,d.length,d.length+_.length,t,u.endLineNumber-u.startLineNumber)}}var MCr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},x9e=function(n,e){return function(t,i){e(t,i,n)}},rY;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(rY||(rY={}));const fbe={forceCopyWithSyntaxHighlighting:!1},aX=class aX{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)}};aX.INSTANCE=new aX;let K7=aX;class jCr{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}}let pbe=class extends Ye{get textAreaState(){return this._textAreaState}constructor(e,t,i,r,s,o){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=r,this._accessibilityService=s,this._logService=o,this._onFocus=this._register(new Ue),this.onFocus=this._onFocus.event,this._onBlur=this._register(new Ue),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new Ue),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new Ue),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new Ue),this.onCut=this._onCut.event,this._onPaste=this._register(new Ue),this.onPaste=this._onPaste.event,this._onType=this._register(new Ue),this.onType=this._onType.event,this._onCompositionStart=this._register(new Ue),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new Ue),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new Ue),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new Ue),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Dc),this._asyncTriggerCut=this._register(new ao(()=>this._onCut.fire(),0)),this._textAreaState=Fd.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(rn.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new ao(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{const c=new Io(l);(c.keyCode===114||this._currentComposition&&c.keyCode===1)&&c.stopPropagation(),c.equals(9)&&c.preventDefault(),a=c,this._onKeyDown.fire(c)})),this._register(this._textArea.onKeyUp(l=>{const c=new Io(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{const c=new jCr;if(this._currentComposition){this._currentComposition=c;return}if(this._currentComposition=c,this._OS===2&&a&&a.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===l.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){c.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:l.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:l.data});return}this._onCompositionStart.fire({data:l.data})})),this._register(this._textArea.onCompositionUpdate(l=>{const c=this._currentComposition;if(!c)return;if(this._browser.isAndroid){const d=Fd.readFromTextArea(this._textArea,this._textAreaState),f=Fd.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(f),this._onCompositionUpdate.fire(l);return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Fd.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(u),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{const c=this._currentComposition;if(!c)return;if(this._currentComposition=null,this._browser.isAndroid){const d=Fd.readFromTextArea(this._textArea,this._textAreaState),f=Fd.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(f),this._onCompositionEnd.fire();return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Fd.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(u),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const c=Fd.readFromTextArea(this._textArea,this._textAreaState),u=Fd.deduceInput(this._textAreaState,c,this._OS===2);u.replacePrevCharCnt===0&&u.text.length===1&&(Ec(u.text.charCodeAt(0))||u.text.charCodeAt(0)===127)||(this._textAreaState=c,(u.text!==""||u.replacePrevCharCnt!==0||u.replaceNextCharCnt!==0||u.positionDelta!==0)&&this._onType.fire(u))})),this._register(this._textArea.onCut(l=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[c,u]=gbe.getTextData(l.clipboardData);c&&(u=u||K7.INSTANCE.get(c),this._onPaste.fire({text:c,metadata:u}))})),this._register(this._textArea.onFocus(()=>{const l=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!l&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new ao(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return _t(this._textArea.ownerDocument,"selectionchange",t=>{if(zS.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),r=i-e;if(e=i,r<5)return;const s=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),s<100||!this._textAreaState.selection)return;const o=this._textArea.getValue();if(this._textAreaState.value!==o)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),f=this._host.deduceModelPosition(d[0],d[1],d[2]),p=new Yn(u.lineNumber,u.column,f.lineNumber,f.column);this._onSelectionChangeRequest.fire(p)})}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.writeNativeTextAreaContent("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}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),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};K7.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` `):t.text,i),e.preventDefault(),e.clipboardData&&gbe.setTextData(e.clipboardData,t.text,t.html,i)}};pbe=MCr([x9e(4,dp),x9e(5,Uu)],pbe);const gbe={getTextData(n){const e=n.getData(ol.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(s=>s.name).join(` `),null]:[e,t]},setTextData(n,e,t,i){n.setData(ol.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class FCr extends Ye{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Yr(this._actual,"keydown")).event,this.onKeyUp=this._register(new Yr(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Yr(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Yr(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Yr(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Yr(this._actual,"beforeinput")).event,this.onInput=this._register(new Yr(this._actual,"input")).event,this.onCut=this._register(new Yr(this._actual,"cut")).event,this.onCopy=this._register(new Yr(this._actual,"copy")).event,this.onPaste=this._register(new Yr(this._actual,"paste")).event,this.onFocus=this._register(new Yr(this._actual,"focus")).event,this.onBlur=this._register(new Yr(this._actual,"blur")).event,this._onSyntheticTap=this._register(new Ue),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>zS.onKeyDown())),this._register(this.onBeforeInput(()=>zS.onBeforeInput())),this._register(this.onInput(()=>zS.onInput())),this._register(this.onKeyUp(()=>zS.onKeyUp())),this._register(_t(this._actual,rY.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=$L(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Hu()===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 s=null;const o=$L(r);o?s=o.activeElement:s=Hu();const a=Ti(s),l=s===r,c=r.selectionStart,u=r.selectionEnd;if(l&&c===t&&u===i){Dm&&a.parent!==a&&r.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,i),Dm&&a.parent!==a&&r.focus();return}try{const d=wlr(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,i),xlr(r,d)}catch{}}}class BCr extends l2e{constructor(e,t,i){super(e,t,i),this._register(dd.addTarget(this.viewHelper.linesContentDomNode)),this._register(_t(this.viewHelper.linesContentDomNode,Oo.Tap,s=>this.onTap(s))),this._register(_t(this.viewHelper.linesContentDomNode,Oo.Change,s=>this.onChange(s))),this._register(_t(this.viewHelper.linesContentDomNode,Oo.Contextmenu,s=>this._onContextMenu(new sk(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(_t(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const o=s.pointerType;if(o==="mouse"){this._lastPointerType="mouse";return}else o==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const r=new _Cr(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(s,o)=>this._onMouseDown(s,o)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new sk(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===6&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class $Cr extends l2e{constructor(e,t,i){super(e,t,i),this._register(dd.addTarget(this.viewHelper.linesContentDomNode)),this._register(_t(this.viewHelper.linesContentDomNode,Oo.Tap,r=>this.onTap(r))),this._register(_t(this.viewHelper.linesContentDomNode,Oo.Change,r=>this.onChange(r))),this._register(_t(this.viewHelper.linesContentDomNode,Oo.Contextmenu,r=>this._onContextMenu(new sk(r,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new sk(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(rY.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 HCr extends Ye{constructor(e,t,i){super(),(Fb||fsr&&Jst)&&yke.pointerEvents?this.handler=this._register(new BCr(e,t,i)):bo.TouchEvent?this.handler=this._register(new $Cr(e,t,i)):this.handler=this._register(new l2e(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class GA extends p${}const lX=class lX extends GA{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new We(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(67);const t=e.get(68);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(96);const i=e.get(146);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}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new We(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)}if(this._renderLineNumbers===3){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const r=this._context.viewModel.getLineCount();return i===r?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Nh?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,s=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);s.sort((c,u)=>ie.compareRangesUsingEnds(c.range,u.range));let o=0;const a=this._context.viewModel.getLineCount(),l=[];for(let c=i;c<=r;c++){const u=c-i;let d=this._getLineRenderLineNumber(c),f="";for(;o<s.length&&s[o].range.endLineNumber<c;)o++;for(let p=o;p<s.length;p++){const{range:g,options:m}=s[p];g.startLineNumber<=c&&(f+=" "+m.lineNumberClassName)}if(!d&&!f){l[u]="";continue}c===a&&this._context.viewModel.getLineLength(c)===0&&(this._renderFinalNewline==="off"&&(d=""),this._renderFinalNewline==="dimmed"&&(f+=" dimmed-line-number")),c===this._activeLineNumber&&(f+=" active-line-number"),l[u]=`<div class="${lX.CLASS_NAME}${t}${f}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${d}</div>`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};lX.CLASS_NAME="line-numbers";let sY=lX;Gm((n,e)=>{const t=n.getColor(N_r),i=n.getColor(U_r);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)}; }`)});const aP=class aP extends fp{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(146);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=Hs(document.createElement("div")),this._domNode.setClassName(aP.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Hs(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(aP.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(146);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)}};aP.CLASS_NAME="glyph-margin",aP.OUTER_CLASS_NAME="margin";let oY=aP;const KP="monaco-mouse-cursor-text";var VCr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},S9e=function(n,e){return function(t,i){e(t,i,n)}};class WCr{constructor(e,t,i,r,s){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=r,this.distanceToModelLineEnd=s,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new We(this.modelLineNumber,this.distanceToModelLineStart+1),i=new We(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 yue=Dm;let mbe=class extends fp{constructor(e,t,i,r,s){super(e),this._keybindingService=r,this._instantiationService=s,this._primaryCursorPosition=new We(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,a=o.get(146);this._setAccessibilityOptions(o),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=o.get(50),this._lineHeight=o.get(67),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new Yn(1,1,1,1)],this._modelSelections=[new Yn(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Hs(document.createElement("textarea")),zb.write(this.textArea,7),this.textArea.setClassName(`inputarea ${KP}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${l*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(125))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",A("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(92)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Hs(document.createElement("div")),this.textAreaCover.setPosition("absolute");const c={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:f=>this._context.viewModel.getLineMaxColumn(f),getValueInRange:(f,p)=>this._context.viewModel.getValueInRange(f,p),getValueLengthInRange:(f,p)=>this._context.viewModel.getValueLengthInRange(f,p),modifyPosition:(f,p)=>this._context.viewModel.modifyPosition(f,p)},u={getDataToCopy:()=>{const f=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Wu),p=this._context.viewModel.model.getEOL(),g=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),m=Array.isArray(f)?f:null,_=Array.isArray(f)?f.join(p):f;let v,b=null;if(fbe.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&_.length<65536){const y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(v=y.html,b=y.mode)}return{isFromEmptySelection:g,multicursorText:m,text:_,html:v,mode:b}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const f=this._selections[0];if(zr&&f.isEmpty()){const g=f.getStartPosition();let m=this._getWordBeforePosition(g);if(m.length===0&&(m=this._getCharacterBeforePosition(g)),m.length>0)return new Fd(m,m.length,m.length,ie.fromPositions(g),0)}if(zr&&!f.isEmpty()&&c.getValueLengthInRange(f,0)<500){const g=c.getValueInRange(f,0);return new Fd(g,0,g.length,f,0)}if(QE&&!f.isEmpty()){const g="vscode-placeholder";return new Fd(g,0,g.length,null,void 0)}return Fd.EMPTY}if(e8e){const f=this._selections[0];if(f.isEmpty()){const p=f.getStartPosition(),[g,m]=this._getAndroidWordAtPosition(p);if(g.length>0)return new Fd(g,m,m,ie.fromPositions(p),0)}return Fd.EMPTY}return BR.fromEditorSelection(c,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(f,p,g)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(f,p,g)},d=this._register(new FCr(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(pbe,u,d,Yf,{isAndroid:e8e,isChrome:q9,isFirefox:Dm,isSafari:QE})),this._register(this._textAreaInput.onKeyDown(f=>{this._viewController.emitKeyDown(f)})),this._register(this._textAreaInput.onKeyUp(f=>{this._viewController.emitKeyUp(f)})),this._register(this._textAreaInput.onPaste(f=>{let p=!1,g=null,m=null;f.metadata&&(p=this._emptySelectionClipboard&&!!f.metadata.isFromEmptySelection,g=typeof f.metadata.multicursorText<"u"?f.metadata.multicursorText:null,m=f.metadata.mode),this._viewController.paste(f.text,p,g,m)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(f=>{f.replacePrevCharCnt||f.replaceNextCharCnt||f.positionDelta?this._viewController.compositionType(f.text,f.replacePrevCharCnt,f.replaceNextCharCnt,f.positionDelta):this._viewController.type(f.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(f=>{this._viewController.setSelection(f)})),this._register(this._textAreaInput.onCompositionStart(f=>{const p=this.textArea.domNode,g=this._modelSelections[0],{distanceToModelLineStart:m,widthOfHiddenTextBefore:_}=(()=>{const b=p.value.substring(0,Math.min(p.selectionStart,p.selectionEnd)),y=b.lastIndexOf(` `),C=b.substring(y+1),S=C.lastIndexOf(" "),k=C.length-S-1,I=g.getStartPosition(),L=Math.min(I.column-1,k),N=I.column-1-L,P=C.substring(0,C.length-L),{tabSize:O}=this._context.viewModel.model.getOptions(),F=zCr(this.textArea.domNode.ownerDocument,P,this._fontInfo,O);return{distanceToModelLineStart:N,widthOfHiddenTextBefore:F}})(),{distanceToModelLineEnd:v}=(()=>{const b=p.value.substring(Math.max(p.selectionStart,p.selectionEnd)),y=b.indexOf(` `),C=y===-1?b:b.substring(0,y),S=C.indexOf(" "),k=S===-1?C.length:C.length-S-1,I=g.getEndPosition(),L=Math.min(this._context.viewModel.model.getLineMaxColumn(I.lineNumber)-I.column,k);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(I.lineNumber)-I.column-L}})();this._context.viewModel.revealRange("keyboard",!0,ie.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new WCr(this._context,g.startLineNumber,m,_,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${KP} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(f=>{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 ${KP}`),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(t6.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),r=Om(t,[]);let s=!0,o=e.column,a=!0,l=e.column,c=0;for(;c<50&&(s||a);){if(s&&o<=1&&(s=!1),s){const u=i.charCodeAt(o-2);r.get(u)!==0?s=!1:o--}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(o-1,l-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Om(this._context.configuration.options.get(132),[]);let r=e.column,s=0;for(;r>1;){const o=t.charCodeAt(r-2);if(i.get(o)!==0||s>50)return t.substring(r-1,e.column-1);s++,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(!Ec(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var i,r,s;if(e.get(2)===1){const o=(i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))==null?void 0:i.getAriaLabel(),a=(r=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))==null?void 0:r.getAriaLabel(),l=(s=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))==null?void 0:s.getAriaLabel(),c=A("accessibilityModeOff","The editor is not accessible at this time.");return o?A("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,o):a?A("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?A("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===Xb.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const r=e.get(146).wrappingColumn;if(r!==-1&&this._accessibilitySupport!==1){const s=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(r*s.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=yue?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(146);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(67),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(125))),(e.hasChanged(34)||e.hasChanged(92))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("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;!t6.enabled||e.get(34)&&e.get(92)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new We(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)==null||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const i=this._visibleTextArea.visibleTextareaStart,r=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,o=this._visibleTextArea.endPosition;if(s&&o&&i&&r&&r.left>=this._scrollLeft&&i.left<=this._scrollLeft+this._contentWidth){const a=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,l=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let c=this._visibleTextArea.widthOfHiddenLineTextBefore,u=this._contentLeft+i.left-this._scrollLeft,d=r.left-i.left+1;if(u<this._contentLeft){const v=this._contentLeft-u;u+=v,c+=v,d-=v}d>this._contentWidth&&(d=this._contentWidth);const f=this._context.viewModel.getViewLineData(s.lineNumber),p=f.tokens.findTokenIndexAtOffset(s.column-1),g=f.tokens.findTokenIndexAtOffset(o.column-1),m=p===g,_=this._visibleTextArea.definePresentation(m?f.tokens.getPresentation(p):null);this.textArea.domNode.scrollTop=l*this._lineHeight,this.textArea.domNode.scrollLeft=c,this._doRender({lastRenderPosition:null,top:a,left:u,width:d,height:this._lineHeight,useCover:!1,color:(Ka.getColorMap()||[])[_.foreground],italic:_.italic,bold:_.bold,underline:_.underline,strikethrough:_.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(zr||this._accessibilitySupport===2){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const i=this._textAreaInput.textAreaState.newlineCountBeforeSelection??this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=i*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:yue?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:yue?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;vu(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?At.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 "+oY.OUTER_CLASS_NAME):r.get(68).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+sY.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};mbe=VCr([S9e(3,Ws),S9e(4,mi)],mbe);function zCr(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 s=n.createElement("span");vu(s,t),s.style.whiteSpace="pre",s.style.tabSize=`${i*t.spaceWidth}px`,s.append(e),r.appendChild(s),n.body.appendChild(r);const o=s.offsetWidth;return r.remove(),o}const UCr=()=>!0,qCr=()=>!1,KCr=n=>n===" "||n===" ";class jD{static shouldRecreate(e){return e.hasChanged(146)||e.hasChanged(132)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(129)||e.hasChanged(50)||e.hasChanged(92)||e.hasChanged(131)}constructor(e,t,i,r){this.languageConfigurationService=r,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,o=s.get(146),a=s.get(50);this.readOnly=s.get(92),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(117),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=s.get(129),this.wordSeparators=s.get(132),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(77),this.multiCursorPaste=s.get(79),this.multiCursorLimit=s.get(80),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.wordSegmenterLocales=s.get(131),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 l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const u of l)this.surroundingPairs[u.open]=u.close;const c=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(c==null?void 0:c.blockCommentStartToken)??null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)==null?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const r=q2(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;return s?s.onElectricCharacter(e,r,i-r.firstCharOffset):null}normalizeIndentation(e){return ETe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return KCr;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return UCr;case"never":return qCr}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return r=>i.indexOf(r)!==-1}visibleColumnFromColumn(e,t){return cc.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const r=cc.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),s=e.getLineMinColumn(t);if(r<s)return s;const o=e.getLineMaxColumn(t);return r>o?o:r}}let vs=class Wut{static fromModelState(e){return new GCr(e)}static fromViewState(e){return new YCr(e)}static fromModelSelection(e){const t=Yn.liftSelection(e),i=new cu(ie.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Wut.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 GCr{constructor(e){this.modelState=e,this.viewState=null}}class YCr{constructor(e){this.modelState=null,this.viewState=e}}class cu{constructor(e,t,i,r,s){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=r,this.leftoverVisibleColumns=s,this._singleCursorStateBrand=void 0,this.selection=cu._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 cu(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new We(t,i),r):new cu(new ie(t,i,t,i),0,r,new We(t,i),r)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?Yn.fromPositions(e.getStartPosition(),t):Yn.fromPositions(e.getEndPosition(),t)}}class hf{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function ok(n){return n==="'"||n==='"'||n==="`"}class I2{static columnSelect(e,t,i,r,s,o){const a=Math.abs(s-i)+1,l=i>s,c=r>o,u=r<o,d=[];for(let f=0;f<a;f++){const p=i+(l?-f:f),g=e.columnFromVisibleColumn(t,p,r),m=e.columnFromVisibleColumn(t,p,o),_=e.visibleColumnFromColumn(t,new We(p,g)),v=e.visibleColumnFromColumn(t,new We(p,m));u&&(_>o||v<r)||c&&(v>r||_<o)||d.push(new cu(new ie(p,g,p,g),0,0,new We(p,m),0))}if(d.length===0)for(let f=0;f<a;f++){const p=i+(l?-f:f),g=t.getLineMaxColumn(p);d.push(new cu(new ie(p,g,p,g),0,0,new We(p,g),0))}return{viewStates:d,reversed:l,fromLineNumber:i,fromVisualColumn:r,toLineNumber:s,toVisualColumn:o}}static columnSelectLeft(e,t,i){let r=i.toViewVisualColumn;return r>0&&r--,I2.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectRight(e,t,i){let r=0;const s=Math.min(i.fromViewLineNumber,i.toViewLineNumber),o=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=s;l<=o;l++){const c=t.getLineMaxColumn(l),u=e.visibleColumnFromColumn(t,new We(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 s=r?e.pageSize:1,o=Math.max(1,i.toViewLineNumber-s);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,o,i.toViewVisualColumn)}static columnSelectDown(e,t,i,r){const s=r?e.pageSize:1,o=Math.min(t.getLineCount(),i.toViewLineNumber+s);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,o,i.toViewVisualColumn)}}class Bu{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 Yn.fromPositions(r.getEndPosition())}}class QCr{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 Yn.fromRange(r,0)}}class CU{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 Yn.fromPositions(r.getStartPosition())}}class aY{constructor(e,t,i,r,s=!1){this._range=e,this._text=t,this._columnDeltaOffset=r,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=s}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return Yn.fromPositions(r.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class c2e{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 Cue{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class Ks{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-kot(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new We(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),s=e.getLineContent(t.lineNumber),o=q7.atomicPosition(s,t.column-1,i,0);if(o!==-1&&o+1>=r)return new We(t.lineNumber,o+1)}return this.leftPosition(e,t)}static left(e,t,i){const r=e.stickyTabStops?Ks.leftPositionAtomicSoftTabs(t,i,e.tabSize):Ks.leftPosition(t,i);return new Cue(r.lineNumber,r.column,0)}static moveLeft(e,t,i,r,s){let o,a;if(i.hasSelection()&&!r)o=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(s-1)),c=t.normalizePosition(Ks.clipPositionColumn(l,t),0),u=Ks.left(e,t,c);o=u.lineNumber,a=u.column}return i.move(r,o,a,0)}static clipPositionColumn(e,t){return new We(e.lineNumber,Ks.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+_ke(e.getLineContent(t),i-1):t<e.getLineCount()&&(t=t+1,i=e.getLineMinColumn(t)),new We(t,i)}static rightPositionAtomicSoftTabs(e,t,i,r,s){if(i<e.getLineIndentColumn(t)){const o=e.getLineContent(t),a=q7.atomicPosition(o,i-1,r,1);if(a!==-1)return new We(t,a+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const r=e.stickyTabStops?Ks.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):Ks.rightPosition(t,i.lineNumber,i.column);return new Cue(r.lineNumber,r.column,0)}static moveRight(e,t,i,r,s){let o,a;if(i.hasSelection()&&!r)o=i.selection.endLineNumber,a=i.selection.endColumn;else{const l=i.position.delta(void 0,s-1),c=t.normalizePosition(Ks.clipPositionColumn(l,t),1),u=Ks.right(e,t,c);o=u.lineNumber,a=u.column}return i.move(r,o,a,0)}static vertical(e,t,i,r,s,o,a,l){const c=cc.visibleColumnFromColumn(t.getLineContent(i),r,e.tabSize)+s,u=t.getLineCount(),d=i===1&&r===1,f=i===u&&r===t.getLineMaxColumn(i),p=o<i?d:f;if(i=o,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),p?s=0:s=c-cc.visibleColumnFromColumn(t.getLineContent(i),r,e.tabSize),l!==void 0){const g=new We(i,r),m=t.normalizePosition(g,l);s=s+(r-m.column),i=m.lineNumber,r=m.column}return new Cue(i,r,s)}static down(e,t,i,r,s,o,a){return this.vertical(e,t,i,r,s,i+o,a,4)}static moveDown(e,t,i,r,s){let o,a;i.hasSelection()&&!r?(o=i.selection.endLineNumber,a=i.selection.endColumn):(o=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=Ks.down(e,t,o+l,a,i.leftoverVisibleColumns,s,!0),t.normalizePosition(new We(c.lineNumber,c.column),2).lineNumber>o)break;while(l++<10&&o+l<t.getLineCount());return i.move(r,c.lineNumber,c.column,c.leftoverVisibleColumns)}static translateDown(e,t,i){const r=i.selection,s=Ks.down(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),o=Ks.down(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new cu(new ie(s.lineNumber,s.column,s.lineNumber,s.column),0,s.leftoverVisibleColumns,new We(o.lineNumber,o.column),o.leftoverVisibleColumns)}static up(e,t,i,r,s,o,a){return this.vertical(e,t,i,r,s,i-o,a,3)}static moveUp(e,t,i,r,s){let o,a;i.hasSelection()&&!r?(o=i.selection.startLineNumber,a=i.selection.startColumn):(o=i.position.lineNumber,a=i.position.column);const l=Ks.up(e,t,o,a,i.leftoverVisibleColumns,s,!0);return i.move(r,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateUp(e,t,i){const r=i.selection,s=Ks.up(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),o=Ks.up(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new cu(new ie(s.lineNumber,s.column,s.lineNumber,s.column),0,s.leftoverVisibleColumns,new We(o.lineNumber,o.column),o.leftoverVisibleColumns)}static _isBlankLine(e,t){return e.getLineFirstNonWhitespaceColumn(t)===0}static moveToPrevBlankLine(e,t,i,r){let s=i.position.lineNumber;for(;s>1&&this._isBlankLine(t,s);)s--;for(;s>1&&!this._isBlankLine(t,s);)s--;return i.move(r,s,t.getLineMinColumn(s),0)}static moveToNextBlankLine(e,t,i,r){const s=t.getLineCount();let o=i.position.lineNumber;for(;o<s&&this._isBlankLine(t,o);)o++;for(;o<s&&!this._isBlankLine(t,o);)o++;return i.move(r,o,t.getLineMinColumn(o),0)}static moveToBeginningOfLine(e,t,i,r){const s=i.position.lineNumber,o=t.getLineMinColumn(s),a=t.getLineFirstNonWhitespaceColumn(s)||o;let l;return i.position.column===a?l=o:l=a,i.move(r,s,l,0)}static moveToEndOfLine(e,t,i,r,s){const o=i.position.lineNumber,a=t.getLineMaxColumn(o);return i.move(r,o,a,s?1073741824-a:0)}static moveToBeginningOfBuffer(e,t,i,r){return i.move(r,1,1,0)}static moveToEndOfBuffer(e,t,i,r){const s=t.getLineCount(),o=t.getLineMaxColumn(s);return i.move(r,s,o,0)}}class XL{static deleteRight(e,t,i,r){const s=[];let o=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(),f=Ks.right(t,i,d);u=new ie(f.lineNumber,f.column,d.lineNumber,d.column)}if(u.isEmpty()){s[a]=null;continue}u.startLineNumber!==u.endLineNumber&&(o=!0),s[a]=new Bu(u,"")}return[o,s]}static isAutoClosingPairDelete(e,t,i,r,s,o,a){if(t==="never"&&i==="never"||e==="never")return!1;for(let l=0,c=o.length;l<c;l++){const u=o[l],d=u.getPosition();if(!u.isEmpty())return!1;const f=s.getLineContent(d.lineNumber);if(d.column<2||d.column>=f.length+1)return!1;const p=f.charAt(d.column-2),g=r.get(p);if(!g)return!1;if(ok(p)){if(i==="never")return!1}else if(t==="never")return!1;const m=f.charAt(d.column-1);let _=!1;for(const v of g)v.open===p&&v.close===m&&(_=!0);if(!_)return!1;if(e==="auto"){let v=!1;for(let b=0,y=a.length;b<y;b++){const C=a[b];if(d.lineNumber===C.startLineNumber&&d.column===C.startColumn){v=!0;break}}if(!v)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const r=[];for(let s=0,o=i.length;s<o;s++){const a=i[s].getPosition(),l=new ie(a.lineNumber,a.column-1,a.lineNumber,a.column+1);r[s]=new Bu(l,"")}return[!0,r]}static deleteLeft(e,t,i,r,s){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,r,s))return this._runAutoClosingPairDelete(t,i,r);const o=[];let a=e!==2;for(let l=0,c=r.length;l<c;l++){const u=XL.getDeleteRange(r[l],i,t);if(u.isEmpty()){o[l]=null;continue}u.startLineNumber!==u.endLineNumber&&(a=!0),o[l]=new Bu(u,"")}return[a,o]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const r=e.getPosition();if(i.useTabStops&&r.column>1){const s=t.getLineContent(r.lineNumber),o=Yd(s),a=o===-1?s.length+1:o+1;if(r.column<=a){const l=i.visibleColumnFromColumn(t,r),c=cc.prevIndentTabStop(l,i.indentSize),u=i.columnFromVisibleColumn(t,r.lineNumber,c);return new ie(r.lineNumber,u,r.lineNumber,r.column)}}return ie.fromPositions(XL.getPositionAfterDeleteLeft(r,t),r)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=par(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 We(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const r=[];let s=null;i.sort((o,a)=>We.compare(o.getStartPosition(),a.getEndPosition()));for(let o=0,a=i.length;o<a;o++){const l=i[o];if(l.isEmpty())if(e.emptySelectionClipboard){const c=l.getPosition();let u,d,f,p;c.lineNumber<t.getLineCount()?(u=c.lineNumber,d=1,f=c.lineNumber+1,p=1):c.lineNumber>1&&(s==null?void 0:s.endLineNumber)!==c.lineNumber?(u=c.lineNumber-1,d=t.getLineMaxColumn(c.lineNumber-1),f=c.lineNumber,p=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,f=c.lineNumber,p=t.getLineMaxColumn(c.lineNumber));const g=new ie(u,d,f,p);s=g,g.isEmpty()?r[o]=null:r[o]=new Bu(g,"")}else r[o]=null;else r[o]=new Bu(l,"")}return new hf(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class $s{static _createWord(e,t,i,r,s){return{start:r,end:s,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:1,nextCharClass:t}}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;const s=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let o=i.column-2;o>=0;o--){const a=e.charCodeAt(o),l=t.get(a);if(s&&o===s.index)return this._createIntlWord(s,l);if(l===0){if(r===2)return this._createWord(e,r,l,o+1,this._findEndOfWord(e,t,r,o+1));r=1}else if(l===2){if(r===1)return this._createWord(e,r,l,o+1,this._findEndOfWord(e,t,r,o+1));r=2}else if(l===1&&r!==0)return this._createWord(e,r,l,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 s=t.findNextIntlWordAtOrAfterOffset(e,r),o=e.length;for(let a=r;a<o;a++){const l=e.charCodeAt(a),c=t.get(l);if(s&&a===s.index+s.segment.length||c===1||i===1&&c===2||i===2&&c===0)return a}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 s=e.length,o=t.findNextIntlWordAtOrAfterOffset(e,i.column-1);for(let a=i.column-1;a<s;a++){const l=e.charCodeAt(a),c=t.get(l);if(o&&a===o.index)return this._createIntlWord(o,c);if(c===0){if(r===2)return this._createWord(e,r,c,this._findStartOfWord(e,t,r,a-1),a);r=1}else if(c===2){if(r===1)return this._createWord(e,r,c,this._findStartOfWord(e,t,r,a-1),a);r=2}else if(c===1&&r!==0)return this._createWord(e,r,c,this._findStartOfWord(e,t,r,a-1),a)}return r!==0?this._createWord(e,r,1,this._findStartOfWord(e,t,r,s-1),s):null}static _findStartOfWord(e,t,i,r){const s=t.findPrevIntlWordBeforeOrAtOffset(e,r);for(let o=r;o>=0;o--){const a=e.charCodeAt(o),l=t.get(a);if(s&&o===s.index)return o;if(l===1||i===1&&l===2||i===2&&l===0)return o+1}return 0}static moveWordLeft(e,t,i,r,s){let o=i.lineNumber,a=i.column;a===1&&o>1&&(o=o-1,a=t.getLineMaxColumn(o));let l=$s._findPreviousWordOnLine(e,t,new We(o,a));if(r===0)return new We(o,l?l.start+1:1);if(r===1)return!s&&l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=$s._findPreviousWordOnLine(e,t,new We(o,l.start+1))),new We(o,l?l.start+1:1);if(r===3){for(;l&&l.wordType===2;)l=$s._findPreviousWordOnLine(e,t,new We(o,l.start+1));return new We(o,l?l.start+1:1)}return l&&a<=l.end+1&&(l=$s._findPreviousWordOnLine(e,t,new We(o,l.start+1))),new We(o,l?l.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,r=e.getLineMaxColumn(i);if(t.column===1)return i>1?new We(i-1,e.getLineMaxColumn(i-1)):t;const s=e.getLineContent(i);for(let o=t.column-1;o>1;o--){const a=s.charCodeAt(o-2),l=s.charCodeAt(o-1);if(a===95&&l!==95)return new We(i,o);if(a===45&&l!==45)return new We(i,o);if((jS(a)||GV(a))&&oy(l))return new We(i,o);if(oy(a)&&oy(l)&&o+1<r){const c=s.charCodeAt(o);if(jS(c)||GV(c))return new We(i,o)}}return new We(i,1)}static moveWordRight(e,t,i,r){let s=i.lineNumber,o=i.column,a=!1;o===t.getLineMaxColumn(s)&&s<t.getLineCount()&&(a=!0,s=s+1,o=1);let l=$s._findNextWordOnLine(e,t,new We(s,o));if(r===2)l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=$s._findNextWordOnLine(e,t,new We(s,l.end+1))),l?o=l.end+1:o=t.getLineMaxColumn(s);else if(r===3){for(a&&(o=0);l&&(l.wordType===2||l.start+1<=o);)l=$s._findNextWordOnLine(e,t,new We(s,l.end+1));l?o=l.start+1:o=t.getLineMaxColumn(s)}else l&&!a&&o>=l.start+1&&(l=$s._findNextWordOnLine(e,t,new We(s,l.end+1))),l?o=l.start+1:o=t.getLineMaxColumn(s);return new We(s,o)}static _moveWordPartRight(e,t){const i=t.lineNumber,r=e.getLineMaxColumn(i);if(t.column===r)return i<e.getLineCount()?new We(i+1,1):t;const s=e.getLineContent(i);for(let o=t.column+1;o<r;o++){const a=s.charCodeAt(o-2),l=s.charCodeAt(o-1);if(a!==95&&l===95)return new We(i,o);if(a!==45&&l===45)return new We(i,o);if((jS(a)||GV(a))&&oy(l))return new We(i,o);if(oy(a)&&oy(l)&&o+1<r){const c=s.charCodeAt(o);if(jS(c)||GV(c))return new We(i,o)}}return new We(i,r)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),r=t.column-2,s=Lb(i,r);return s+1<r?new ie(t.lineNumber,s+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,r=e.model,s=e.selection,o=e.whitespaceHeuristics;if(!s.isEmpty())return s;if(XL.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const d=e.selection.getPosition();return new ie(d.lineNumber,d.column-1,d.lineNumber,d.column+1)}const a=new We(s.positionLineNumber,s.positionColumn);let l=a.lineNumber,c=a.column;if(l===1&&c===1)return null;if(o){const d=this._deleteWordLeftWhitespace(r,a);if(d)return d}let u=$s._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=$s._findPreviousWordOnLine(i,r,new We(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l))),new ie(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const r=new We(i.positionLineNumber,i.positionColumn),s=this._deleteInsideWordWhitespace(t,r);return s||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 s=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,s))return null;let o=Math.min(t.column-1,r-1);if(!this._charAtIsWhitespace(i,o))return null;for(;s>0&&this._charAtIsWhitespace(i,s-1);)s--;for(;o+1<r&&this._charAtIsWhitespace(i,o+1);)o++;return new ie(t.lineNumber,s+1,t.lineNumber,o+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const r=t.getLineContent(i.lineNumber),s=r.length;if(s===0)return i.lineNumber>1?new ie(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new ie(i.lineNumber,1,i.lineNumber+1,1):new ie(i.lineNumber,1,i.lineNumber,1);const o=d=>d.start+1<=i.column&&i.column<=d.end+1,a=(d,f)=>(d=Math.min(d,i.column),f=Math.max(f,i.column),new ie(i.lineNumber,d,i.lineNumber,f)),l=d=>{let f=d.start+1,p=d.end+1,g=!1;for(;p-1<s&&this._charAtIsWhitespace(r,p-1);)g=!0,p++;if(!g)for(;f>1&&this._charAtIsWhitespace(r,f-2);)f--;return a(f,p)},c=$s._findPreviousWordOnLine(e,t,i);if(c&&o(c))return l(c);const u=$s._findNextWordOnLine(e,t,i);return u&&o(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,s+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),r=$s._moveWordPartLeft(e,i);return new ie(i.lineNumber,i.column,r.lineNumber,r.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let r=t;r<i;r++){const s=e.charAt(r);if(s!==" "&&s!==" ")return r}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),r=t.column-1,s=this._findFirstNonWhitespaceChar(i,r);return r+1<s?new ie(t.lineNumber,t.column,t.lineNumber,s+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,r=e.model,s=e.selection,o=e.whitespaceHeuristics;if(!s.isEmpty())return s;const a=new We(s.positionLineNumber,s.positionColumn);let l=a.lineNumber,c=a.column;const u=r.getLineCount(),d=r.getLineMaxColumn(l);if(l===u&&c===d)return null;if(o){const p=this._deleteWordRightWhitespace(r,a);if(p)return p}let f=$s._findNextWordOnLine(i,r,a);return t===2?f?c=f.end+1:c<d||l===u?c=d:(l++,f=$s._findNextWordOnLine(i,r,new We(l,1)),f?c=f.start+1:c=r.getLineMaxColumn(l)):(f&&c>=f.start+1&&(f=$s._findNextWordOnLine(i,r,new We(l,f.end+1))),f?c=f.start+1:c<d||l===u?c=d:(l++,f=$s._findNextWordOnLine(i,r,new We(l,1)),f?c=f.start+1:c=r.getLineMaxColumn(l))),new ie(l,c,a.lineNumber,a.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),r=$s._moveWordPartRight(e,i);return new ie(i.lineNumber,i.column,r.lineNumber,r.column)}static _createWordAtPosition(e,t,i){const r=new ie(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(r),startColumn:r.startColumn,endColumn:r.endColumn}}static getWordAtPosition(e,t,i,r){const s=Om(t,i),o=$s._findPreviousWordOnLine(s,e,r);if(o&&o.wordType===1&&o.start<=r.column-1&&r.column-1<=o.end)return $s._createWordAtPosition(e,r.lineNumber,o);const a=$s._findNextWordOnLine(s,e,r);return a&&a.wordType===1&&a.start<=r.column-1&&r.column-1<=a.end?$s._createWordAtPosition(e,r.lineNumber,a):null}static word(e,t,i,r,s){const o=Om(e.wordSeparators,e.wordSegmenterLocales),a=$s._findPreviousWordOnLine(o,t,s),l=$s._findNextWordOnLine(o,t,s);if(!r){let p,g;return a&&a.wordType===1&&a.start<=s.column-1&&s.column-1<=a.end?(p=a.start+1,g=a.end+1):l&&l.wordType===1&&l.start<=s.column-1&&s.column-1<=l.end?(p=l.start+1,g=l.end+1):(a?p=a.end+1:p=1,l?g=l.start+1:g=t.getLineMaxColumn(s.lineNumber)),new cu(new ie(s.lineNumber,p,s.lineNumber,g),1,0,new We(s.lineNumber,g),0)}let c,u;a&&a.wordType===1&&a.start<s.column-1&&s.column-1<a.end?(c=a.start+1,u=a.end+1):l&&l.wordType===1&&l.start<s.column-1&&s.column-1<l.end?(c=l.start+1,u=l.end+1):(c=s.column,u=s.column);const d=s.lineNumber;let f;if(i.selectionStart.containsPosition(s))f=i.selectionStart.endColumn;else if(s.isBeforeOrEqual(i.selectionStart.getStartPosition())){f=c;const p=new We(d,f);i.selectionStart.containsPosition(p)&&(f=i.selectionStart.endColumn)}else{f=u;const p=new We(d,f);i.selectionStart.containsPosition(p)&&(f=i.selectionStart.startColumn)}return i.move(!0,d,f,0)}}class Xte extends $s{static deleteWordPartLeft(e){const t=TW([$s.deleteWordLeft(e,0),$s.deleteWordLeft(e,2),$s._deleteWordPartLeft(e.model,e.selection)]);return t.sort(ie.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=TW([$s.deleteWordRight(e,0),$s.deleteWordRight(e,2),$s._deleteWordPartRight(e.model,e.selection)]);return t.sort(ie.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i,r){const s=TW([$s.moveWordLeft(e,t,i,0,r),$s.moveWordLeft(e,t,i,2,r),$s._moveWordPartLeft(t,i)]);return s.sort(We.compare),s[2]}static moveWordPartRight(e,t,i){const r=TW([$s.moveWordRight(e,t,i,0),$s.moveWordRight(e,t,i,2),$s._moveWordPartRight(t,i)]);return r.sort(We.compare),r[0]}}function TW(n){return n.filter(e=>!!e)}class ou{static addCursorDown(e,t,i){const r=[];let s=0;for(let o=0,a=t.length;o<a;o++){const l=t[o];r[s++]=new vs(l.modelState,l.viewState),i?r[s++]=vs.fromModelState(Ks.translateDown(e.cursorConfig,e.model,l.modelState)):r[s++]=vs.fromViewState(Ks.translateDown(e.cursorConfig,e,l.viewState))}return r}static addCursorUp(e,t,i){const r=[];let s=0;for(let o=0,a=t.length;o<a;o++){const l=t[o];r[s++]=new vs(l.modelState,l.viewState),i?r[s++]=vs.fromModelState(Ks.translateUp(e.cursorConfig,e.model,l.modelState)):r[s++]=vs.fromViewState(Ks.translateUp(e.cursorConfig,e,l.viewState))}return r}static moveToBeginningOfLine(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s];r[s]=this._moveToLineStart(e,a,i)}return r}static _moveToLineStart(e,t,i){const r=t.viewState.position.column,s=t.modelState.position.column,o=r===s,a=t.viewState.position.lineNumber,l=e.getLineFirstNonWhitespaceColumn(a);return!o&&!(r===l)?this._moveToLineStartByView(e,t,i):this._moveToLineStartByModel(e,t,i)}static _moveToLineStartByView(e,t,i){return vs.fromViewState(Ks.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return vs.fromModelState(Ks.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,r){const s=[];for(let o=0,a=t.length;o<a;o++){const l=t[o];s[o]=this._moveToLineEnd(e,l,i,r)}return s}static _moveToLineEnd(e,t,i,r){const s=t.viewState.position,o=e.getLineMaxColumn(s.lineNumber),a=s.column===o,l=t.modelState.position,c=e.model.getLineMaxColumn(l.lineNumber),u=o-s.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 vs.fromViewState(Ks.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,r))}static _moveToLineEndByModel(e,t,i,r){return vs.fromModelState(Ks.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,r))}static expandLineSelection(e,t){const i=[];for(let r=0,s=t.length;r<s;r++){const o=t[r],a=o.modelState.selection.startLineNumber,l=e.model.getLineCount();let c=o.modelState.selection.endLineNumber,u;c===l?u=e.model.getLineMaxColumn(l):(c++,u=1),i[r]=vs.fromModelState(new cu(new ie(a,1,a,1),0,0,new We(c,u),0))}return i}static moveToBeginningOfBuffer(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s];r[s]=vs.fromModelState(Ks.moveToBeginningOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return r}static moveToEndOfBuffer(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s];r[s]=vs.fromModelState(Ks.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 vs.fromModelState(new cu(new ie(1,1,1,1),0,0,new We(i,r),0))}static line(e,t,i,r,s){const o=e.model.validatePosition(r),a=s?e.coordinatesConverter.validateViewPosition(new We(s.lineNumber,s.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);if(!i){const c=e.model.getLineCount();let u=o.lineNumber+1,d=1;return u>c&&(u=c,d=e.model.getLineMaxColumn(u)),vs.fromModelState(new cu(new ie(o.lineNumber,1,u,d),2,0,new We(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumber<l)return vs.fromViewState(t.viewState.move(!0,a.lineNumber,1,0));if(o.lineNumber>l){const c=e.getLineCount();let u=a.lineNumber+1,d=1;return u>c&&(u=c,d=e.getLineMaxColumn(u)),vs.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return vs.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,r){const s=e.model.validatePosition(r);return vs.fromModelState($s.word(e.cursorConfig,e.model,t.modelState,i,s))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new vs(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,r=t.viewState.position.column;return vs.fromViewState(new cu(new ie(i,r,i,r),0,0,new We(i,r),0))}static moveTo(e,t,i,r,s){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,s)}const o=e.model.validatePosition(r),a=s?e.coordinatesConverter.validateViewPosition(new We(s.lineNumber,s.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);return vs.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,r,s,o){switch(i){case 0:return o===4?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,s);case 1:return o===4?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,s);case 2:return o===2?this._moveUpByViewLines(e,t,r,s):this._moveUpByModelLines(e,t,r,s);case 3:return o===2?this._moveDownByViewLines(e,t,r,s):this._moveDownByModelLines(e,t,r,s);case 4:return o===2?t.map(a=>vs.fromViewState(Ks.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>vs.fromModelState(Ks.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 5:return o===2?t.map(a=>vs.fromViewState(Ks.moveToNextBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>vs.fromModelState(Ks.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,s){const o=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(o);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,s),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,s),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,o,r)}return l}default:return null}}static findPositionInViewportIfOutside(e,t,i,r){const s=t.viewState.position.lineNumber;if(i.startLineNumber<=s&&s<=i.endLineNumber-1)return new vs(t.modelState,t.viewState);{let o;s>i.endLineNumber-1?o=i.endLineNumber-1:s<i.startLineNumber?o=i.startLineNumber:o=s;const a=Ks.vertical(e.cursorConfig,e,s,t.viewState.position.column,t.viewState.leftoverVisibleColumns,o,!1);return vs.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(s=>vs.fromViewState(Ks.moveLeft(e.cursorConfig,e,s.viewState,i,r)))}static _moveHalfLineLeft(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],l=a.viewState.position.lineNumber,c=Math.round(e.getLineLength(l)/2);r[s]=vs.fromViewState(Ks.moveLeft(e.cursorConfig,e,a.viewState,i,c))}return r}static _moveRight(e,t,i,r){return t.map(s=>vs.fromViewState(Ks.moveRight(e.cursorConfig,e,s.viewState,i,r)))}static _moveHalfLineRight(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],l=a.viewState.position.lineNumber,c=Math.round(e.getLineLength(l)/2);r[s]=vs.fromViewState(Ks.moveRight(e.cursorConfig,e,a.viewState,i,c))}return r}static _moveDownByViewLines(e,t,i,r){const s=[];for(let o=0,a=t.length;o<a;o++){const l=t[o];s[o]=vs.fromViewState(Ks.moveDown(e.cursorConfig,e,l.viewState,i,r))}return s}static _moveDownByModelLines(e,t,i,r){const s=[];for(let o=0,a=t.length;o<a;o++){const l=t[o];s[o]=vs.fromModelState(Ks.moveDown(e.cursorConfig,e.model,l.modelState,i,r))}return s}static _moveUpByViewLines(e,t,i,r){const s=[];for(let o=0,a=t.length;o<a;o++){const l=t[o];s[o]=vs.fromViewState(Ks.moveUp(e.cursorConfig,e,l.viewState,i,r))}return s}static _moveUpByModelLines(e,t,i,r){const s=[];for(let o=0,a=t.length;o<a;o++){const l=t[o];s[o]=vs.fromModelState(Ks.moveUp(e.cursorConfig,e.model,l.modelState,i,r))}return s}static _moveToViewPosition(e,t,i,r,s){return vs.fromViewState(t.viewState.move(i,r,s,0))}static _moveToModelPosition(e,t,i,r,s){return vs.fromModelState(t.modelState.move(i,r,s,0))}static _moveToViewMinColumn(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],l=a.viewState.position.lineNumber,c=e.getLineMinColumn(l);r[s]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],l=a.viewState.position.lineNumber,c=e.getLineFirstNonWhitespaceColumn(l);r[s]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewCenterColumn(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],l=a.viewState.position.lineNumber,c=Math.round((e.getLineMaxColumn(l)+e.getLineMinColumn(l))/2);r[s]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewMaxColumn(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],l=a.viewState.position.lineNumber,c=e.getLineMaxColumn(l);r[s]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewLastNonWhitespaceColumn(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],l=a.viewState.position.lineNumber,c=e.getLineLastNonWhitespaceColumn(l);r[s]=this._moveToViewPosition(e,a,i,l,c)}return r}}var lY;(function(n){const e=function(i){if(!zc(i))return!1;const r=i;return!(!cf(r.to)||!Kd(r.select)&&!qst(r.select)||!Kd(r.by)&&!cf(r.by)||!Kd(r.value)&&!zE(r.value))};n.metadata={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 s=0;switch(i.by){case n.RawUnit.Line:s=1;break;case n.RawUnit.WrappedLine:s=2;break;case n.RawUnit.Character:s=3;break;case n.RawUnit.HalfLine:s=4;break}return{direction:r,unit:s,select:!!i.select,value:i.value||1}}n.parse=t})(lY||(lY={}));class u2e{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new zut(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class d2e{constructor(e,t){this.model=e,this.indentationLineProcessor=new zut(e,t)}getProcessedTokenContextAroundRange(e){const t=this._getProcessedTokensBeforeRange(e),i=this._getProcessedTokensAfterRange(e),r=this._getProcessedPreviousLineTokens(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:i,previousLineProcessedTokens:r}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=q2(t,e.startColumn-1);let r;if(h2e(this.model,e.getStartPosition())){const o=e.startColumn-1-i.firstCharOffset,a=i.firstCharOffset,l=a+o;r=t.sliceAndInflate(a,l,0)}else{const o=e.startColumn-1;r=t.sliceAndInflate(0,o,0)}return this.indentationLineProcessor.getProcessedTokens(r)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),r=q2(i,t.column-1),s=t.column-1-r.firstCharOffset,o=r.firstCharOffset+s,a=r.firstCharOffset+r.getLineLength(),l=i.sliceAndInflate(o,a,0);return this.indentationLineProcessor.getProcessedTokens(l)}_getProcessedPreviousLineTokens(e){const t=p=>{this.model.tokenization.forceTokenization(p);const g=this.model.tokenization.getLineTokens(p),m=this.model.getLineMaxColumn(p)-1;return q2(g,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),r=q2(i,e.startColumn-1),s=Xc.createEmpty("",r.languageIdCodec),o=e.startLineNumber-1;if(o===0||!(r.firstCharOffset===0))return s;const c=t(o);if(!(r.languageId===c.languageId))return s;const d=c.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(d)}}class zut{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){var o,a;const i=(l,c)=>{const u=_o(l);return c+l.substring(u.length)};(a=(o=this.model.tokenization).forceTokenization)==null||a.call(o,e);const r=this.model.tokenization.getLineTokens(e);let s=this.getProcessedTokens(r).getLineContent();return t!==void 0&&(s=i(s,t)),s}getProcessedTokens(e){const t=l=>l===2||l===3||l===1,i=e.getLanguageId(0),s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),o=[];return e.forEach(l=>{const c=e.getStandardTokenType(l);let u=e.getTokenText(l);t(c)&&(u=u.replace(s,""));const d=e.getMetadata(l);o.push({text:u,metadata:d})}),Xc.createFromTextAndMetadata(o,e.languageIdCodec)}}function h2e(n,e){n.tokenization.forceTokenization(e.lineNumber);const t=n.tokenization.getLineTokens(e.lineNumber),i=q2(t,e.column-1),r=i.firstCharOffset===0,s=t.getLanguageId(0)===i.languageId;return!r&&!s}function GP(n,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const r=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),s=i.getLanguageConfiguration(r);if(!s)return null;const a=new d2e(e,i).getProcessedTokenContextAroundRange(t),l=a.previousLineProcessedTokens.getLineContent(),c=a.beforeRangeProcessedTokens.getLineContent(),u=a.afterRangeProcessedTokens.getLineContent(),d=s.onEnter(n,l,c,u);if(!d)return null;const f=d.indentAction;let p=d.appendText;const g=d.removeText||0;p?f===Ul.Indent&&(p=" "+p):f===Ul.Indent||f===Ul.IndentOutdent?p=" ":p="";let m=Eat(e,t.startLineNumber,t.startColumn);return g&&(m=m.substring(0,m.length-g)),{indentAction:f,appendText:p,removeText:g,indentation:m}}var XCr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},ZCr=function(n,e){return function(t,i){e(t,i,n)}},wU;const wue=Object.create(null);function VT(n,e){if(e<=0)return"";wue[n]||(wue[n]=["",n]);const t=wue[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let jm=wU=class{static unshiftIndent(e,t,i,r,s){const o=cc.visibleColumnFromColumn(e,t,i);if(s){const a=VT(" ",r),c=cc.prevIndentTabStop(o,r)/r;return VT(a,c)}else{const a=" ",c=cc.prevRenderTabStop(o,i)/i;return VT(a,c)}}static shiftIndent(e,t,i,r,s){const o=cc.visibleColumnFromColumn(e,t,i);if(s){const a=VT(" ",r),c=cc.nextIndentTabStop(o,r)/r;return VT(a,c)}else{const a=" ",c=cc.nextRenderTabStop(o,i)/i;return VT(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:s,indentSize:o,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 f=e.getLineContent(d);let p=Yd(f);if(this._opts.isUnshift&&(f.length===0||p===0)||!l&&!this._opts.isUnshift&&f.length===0)continue;if(p===-1&&(p=f.length),d>1&&cc.visibleColumnFromColumn(f,p+1,s)%o!==0&&e.tokenization.isCheapToTokenize(d-1)){const _=GP(this._opts.autoIndent,e,new ie(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(_){if(u=c,_.appendText)for(let v=0,b=_.appendText.length;v<b&&u<o&&_.appendText.charCodeAt(v)===32;v++)u++;_.removeText&&(u=Math.max(0,u-_.removeText));for(let v=0;v<u&&!(p===0||f.charCodeAt(p-1)!==32);v++)p--}}if(this._opts.isUnshift&&p===0)continue;let g;this._opts.isUnshift?g=wU.unshiftIndent(f,p+1,s,o,a):g=wU.shiftIndent(f,p+1,s,o,a),this._addEditOperation(t,new ie(d,1,d,p+1),g),d===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn<=p+1)}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&e.getLineLength(i)===0&&(this._useLastEditRangeForCursorEndPosition=!0);const c=a?VT(" ",o):" ";for(let u=i;u<=r;u++){const d=e.getLineContent(u);let f=Yd(d);if(!(this._opts.isUnshift&&(d.length===0||f===0))&&!(!l&&!this._opts.isUnshift&&d.length===0)&&(f===-1&&(f=d.length),!(this._opts.isUnshift&&f===0)))if(this._opts.isUnshift){f=Math.min(f,o);for(let p=0;p<f;p++)if(d.charCodeAt(p)===9){f=p+1;break}this._addEditOperation(t,new ie(u,1,u,f+1),"")}else this._addEditOperation(t,new ie(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 Yn(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 Yn(i.startLineNumber,r,i.endLineNumber,i.endColumn):new Yn(i.endLineNumber,i.endColumn,i.startLineNumber,r)}return i}};jm=wU=XCr([ZCr(2,wa)],jm);class JCr{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new ie(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new ie(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,s=i[1].range;return new Yn(r.endLineNumber,r.endColumn,s.endLineNumber,s.endColumn-this._charAfterSelection.length)}}class ewr{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new ie(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 Yn(r.endLineNumber,r.startColumn,r.endLineNumber,r.endColumn-this._charAfter.length)}}function twr(n,e,t){const i=n.tokenization.getLanguageIdAtPosition(e,0);if(e>1){let r,s=-1;for(r=e-1;r>=1;r--){if(n.tokenization.getLanguageIdAtPosition(r,0)!==i)return s;const o=n.getLineContent(r);if(t.shouldIgnore(r)||/^\s+$/.test(o)||o===""){s=r;continue}return r}}return-1}function G7(n,e,t,i=!0,r){if(n<4)return null;const s=r.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;const o=new u2e(e,s,r);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 a=twr(e,t,o);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(o.shouldIncrease(a)||o.shouldIndentNextLine(a)){const l=e.getLineContent(a);return{indentation:_o(l),action:Ul.Indent,line:a}}else if(o.shouldDecrease(a)){const l=e.getLineContent(a);return{indentation:_o(l),action:null,line:a}}else{if(a===1)return{indentation:_o(e.getLineContent(a)),action:null,line:a};const l=a-1,c=s.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let u=0;for(let d=l-1;d>0;d--)if(!o.shouldIndentNextLine(d)){u=d;break}return{indentation:_o(e.getLineContent(u+1)),action:null,line:u+1}}if(i)return{indentation:_o(e.getLineContent(a)),action:null,line:a};for(let u=a;u>0;u--){if(o.shouldIncrease(u))return{indentation:_o(e.getLineContent(u)),action:Ul.Indent,line:u};if(o.shouldIndentNextLine(u)){let d=0;for(let f=u-1;f>0;f--)if(!o.shouldIndentNextLine(u)){d=f;break}return{indentation:_o(e.getLineContent(d+1)),action:null,line:d+1}}else if(o.shouldDecrease(u))return{indentation:_o(e.getLineContent(u)),action:null,line:u}}return{indentation:_o(e.getLineContent(1)),action:null,line:1}}}function m6(n,e,t,i,r,s){if(n<4)return null;const o=s.getLanguageConfiguration(t);if(!o)return null;const a=s.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=new u2e(e,a,s),c=G7(n,e,i,void 0,s);if(c){const u=c.line;if(u!==void 0){let d=!0;for(let f=u;f<i-1;f++)if(!/^\s*$/.test(e.getLineContent(f))){d=!1;break}if(d){const f=o.onEnter(n,"",e.getLineContent(u),"");if(f){let p=_o(e.getLineContent(u));return f.removeText&&(p=p.substring(0,p.length-f.removeText)),f.indentAction===Ul.Indent||f.indentAction===Ul.IndentOutdent?p=r.shiftIndent(p):f.indentAction===Ul.Outdent&&(p=r.unshiftIndent(p)),l.shouldDecrease(i)&&(p=r.unshiftIndent(p)),f.appendText&&(p+=f.appendText),_o(p)}}}return l.shouldDecrease(i)?c.action===Ul.Indent?c.indentation:r.unshiftIndent(c.indentation):c.action===Ul.Indent?r.shiftIndent(c.indentation):c.indentation}return null}function nwr(n,e,t,i,r){if(n<4)return null;const s=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),o=r.getLanguageConfiguration(s).indentRulesSupport;if(!o)return null;e.tokenization.forceTokenization(t.startLineNumber);const l=new d2e(e,r).getProcessedTokenContextAroundRange(t),c=l.afterRangeProcessedTokens,u=l.beforeRangeProcessedTokens,d=_o(u.getLineContent()),f=rwr(e,t.startLineNumber,u),p=h2e(e,t.getStartPosition()),g=e.getLineContent(t.startLineNumber),m=_o(g),_=G7(n,f,t.startLineNumber+1,void 0,r);if(!_){const b=p?m:d;return{beforeEnter:b,afterEnter:b}}let v=p?m:_.indentation;return _.action===Ul.Indent&&(v=i.shiftIndent(v)),o.shouldDecrease(c.getLineContent())&&(v=i.unshiftIndent(v)),{beforeEnter:p?m:d,afterEnter:v}}function iwr(n,e,t,i,r,s){const o=n.autoIndent;if(o<4||h2e(e,t.getStartPosition()))return null;const l=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),c=s.getLanguageConfiguration(l).indentRulesSupport;if(!c)return null;const d=new d2e(e,s).getProcessedTokenContextAroundRange(t),f=d.beforeRangeProcessedTokens.getLineContent(),p=d.afterRangeProcessedTokens.getLineContent(),g=f+p,m=f+i+p;if(!c.shouldDecrease(g)&&c.shouldDecrease(m)){const v=G7(o,e,t.startLineNumber,!1,s);if(!v)return null;let b=v.indentation;return v.action!==Ul.Indent&&(b=r.unshiftIndent(b)),b}const _=t.startLineNumber-1;if(_>0){const v=e.getLineContent(_);if(c.shouldIndentNextLine(v)&&c.shouldIncrease(m)){const b=G7(o,e,t.startLineNumber,!1,s),y=b==null?void 0:b.indentation;if(y!==void 0){const C=e.getLineContent(t.startLineNumber),S=_o(C),I=r.shiftIndent(y)===S,L=/^\s*$/.test(g),N=n.autoClosingPairs.autoClosingPairsOpenByEnd.get(i),O=N&&N.length>0&&L;if(I&&O)return y}}}return null}function Uut(n,e,t){const i=t.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;return!i||e<1||e>n.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}function rwr(n,e,t){return{tokenization:{getLineTokens:r=>r===e?t:n.tokenization.getLineTokens(r),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(r,s)=>n.getLanguageIdAtPosition(r,s)},getLineContent:r=>r===e?t.getLineContent():n.getLineContent(r)}}class swr{static getEdits(e,t,i,r,s){if(!s&&this._isAutoIndentType(e,t,i)){const o=[];for(const l of i){const c=this._findActualIndentationForSelection(e,t,l,r);if(c===null)return;o.push({selection:l,indentation:c})}const a=_be.getAutoClosingPairClose(e,t,i,r,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,o,r,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let r=0,s=i.length;r<s;r++)if(!t.tokenization.isCheapToTokenize(i[r].getEndPosition().lineNumber))return!1;return!0}static _findActualIndentationForSelection(e,t,i,r){const s=iwr(e,t,i,r,{shiftIndent:a=>g2e(e,a),unshiftIndent:a=>cY(e,a)},e.languageConfigurationService);if(s===null)return null;const o=Eat(t,i.startLineNumber,i.startColumn);return s===e.normalizeIndentation(o)?null:s}static _getIndentationAndAutoClosingPairEdits(e,t,i,r,s){const o=i.map(({selection:l,indentation:c})=>{if(s!==null){const u=this._getEditFromIndentationAndSelection(e,t,c,l,r,!1);return new mwr(u,l,r,s)}else{const u=this._getEditFromIndentationAndSelection(e,t,c,l,r,!0);return a2(u.range,u.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new hf(4,o,a)}static _getEditFromIndentationAndSelection(e,t,i,r,s,o=!0){const a=r.startLineNumber,l=t.getLineFirstNonWhitespaceColumn(a);let c=e.normalizeIndentation(i);if(l!==0){const d=t.getLineContent(a);c+=d.substring(l-1,r.startColumn-1)}return c+=o?s:"",{range:new ie(a,1,r.endLineNumber,r.endColumn),text:c}}}class owr{static getEdits(e,t,i,r,s,o){if(qut(t,i,r,s,o))return this._runAutoClosingOvertype(e,r,o)}static _runAutoClosingOvertype(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const l=t[s].getPosition(),c=new ie(l.lineNumber,l.column,l.lineNumber,l.column+1);r[s]=new Bu(c,i)}return new hf(4,r,{shouldPushStackElementBefore:Jte(e,4),shouldPushStackElementAfter:!1})}}class awr{static getEdits(e,t,i,r,s){if(qut(e,t,i,r,s)){const o=i.map(a=>new Bu(new ie(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new hf(4,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class _be{static getEdits(e,t,i,r,s,o){if(!o){const a=this.getAutoClosingPairClose(e,t,i,r,s);if(a!==null)return this._runAutoClosingOpenCharType(i,r,s,a)}}static _runAutoClosingOpenCharType(e,t,i,r){const s=[];for(let o=0,a=e.length;o<a;o++){const l=e[o];s[o]=new gwr(l,t,!i,r)}return new hf(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static getAutoClosingPairClose(e,t,i,r,s){for(const g of i)if(!g.isEmpty())return null;const o=i.map(g=>{const m=g.getPosition();return s?{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,o.map(g=>new We(g.lineNumber,g.beforeColumn)),r);if(!a)return null;let l,c;if(ok(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),f=d?d.close:"";let p=!0;for(const g of o){const{lineNumber:m,beforeColumn:_,afterColumn:v}=g,b=t.getLineContent(m),y=b.substring(0,_-1),C=b.substring(v-1);if(C.startsWith(f)||(p=!1),C.length>0){const L=C.charAt(0);if(!this._isBeforeClosingBrace(e,C)&&!c(L))return null}if(a.open.length===1&&(r==="'"||r==='"')&&l!=="always"){const L=Om(e.wordSeparators,[]);if(y.length>0){const N=y.charCodeAt(y.length-1);if(L.get(N)===0)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const S=t.tokenization.getLineTokens(m),k=q2(S,_-1);if(!a.shouldAutoClose(k,_-k.firstCharOffset))return null;const I=a.findNeutralCharacter();if(I){const L=t.tokenization.getTokenTypeIfInsertingCharacter(m,_,I);if(!a.isOK(L))return null}}return p?a.close.substring(0,a.close.length-f.length):a.close}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 s=null;for(const o of r)o.open!==t.open&&t.open.includes(o.open)&&t.close.endsWith(o.close)&&(!s||o.open.length>s.open.length)&&(s=o);return s}static _findAutoClosingPairOpen(e,t,i,r){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(r);if(!s)return null;let o=null;for(const a of s)if(o===null||a.open.length>o.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new ie(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+r!==a.open){l=!1;break}l&&(o=a)}return o}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),r=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],s=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],o=r.some(l=>t.startsWith(l.open)),a=s.some(l=>t.startsWith(l.close));return!o&&a}}class lwr{static getEdits(e,t,i,r,s){if(!s&&this._isSurroundSelectionType(e,t,i,r))return this._runSurroundSelectionType(e,i,r)}static _runSurroundSelectionType(e,t,i){const r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],l=e.surroundingPairs[i];r[s]=new JCr(a,i,l)}return new hf(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isSurroundSelectionType(e,t,i,r){if(!Kut(e,r)||!e.surroundingPairs.hasOwnProperty(r))return!1;const s=ok(r);for(const o of i){if(o.isEmpty())return!1;let a=!0;for(let l=o.startLineNumber;l<=o.endLineNumber;l++){const c=t.getLineContent(l),u=l===o.startLineNumber?o.startColumn-1:0,d=l===o.endLineNumber?o.endColumn-1:c.length,f=c.substring(u,d);if(/[^ \t]/.test(f)){a=!1;break}}if(a)return!1;if(s&&o.startLineNumber===o.endLineNumber&&o.startColumn+1===o.endColumn){const l=t.getValueInRange(o);if(ok(l))return!1}}return!0}}class cwr{static getEdits(e,t,i,r,s,o){if(!o&&this._isTypeInterceptorElectricChar(t,i,r)){const a=this._typeInterceptorElectricChar(e,t,i,r[0],s);if(a)return a}}static _isTypeInterceptorElectricChar(e,t,i){return!!(i.length===1&&t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,r,s){if(!t.electricChars.hasOwnProperty(s)||!r.isEmpty())return null;const o=r.getPosition();i.tokenization.forceTokenization(o.lineNumber);const a=i.tokenization.getLineTokens(o.lineNumber);let l;try{l=t.onElectricCharacter(s,a,o.column)}catch(c){return tr(c),null}if(!l)return null;if(l.matchOpenBracket){const c=(a.getLineContent()+s).lastIndexOf(l.matchOpenBracket)+1,u=i.bracketPairs.findMatchingBracketUp(l.matchOpenBracket,{lineNumber:o.lineNumber,column:c},500);if(u){if(u.startLineNumber===o.lineNumber)return null;const d=i.getLineContent(u.startLineNumber),f=_o(d),p=t.normalizeIndentation(f),g=i.getLineContent(o.lineNumber),m=i.getLineFirstNonWhitespaceColumn(o.lineNumber)||o.column,_=g.substring(m-1,o.column-1),v=p+_+s,b=new ie(o.lineNumber,1,o.lineNumber,o.column),y=new Bu(b,v);return new hf(p2e(v,e),[y],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}}class uwr{static getEdits(e,t,i){const r=[];for(let o=0,a=t.length;o<a;o++)r[o]=new Bu(t[o],i);const s=p2e(i,e);return new hf(s,r,{shouldPushStackElementBefore:Jte(e,s),shouldPushStackElementAfter:!1})}}class Zte{static getEdits(e,t,i,r,s){if(!s&&r===` `){const o=[];for(let a=0,l=i.length;a<l;a++)o[a]=this._enter(e,t,!1,i[a]);return new hf(4,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}static _enter(e,t,i,r){if(e.autoIndent===0)return a2(r,` `,i);if(!t.tokenization.isCheapToTokenize(r.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(r.startLineNumber),c=_o(l).substring(0,r.startColumn-1);return a2(r,` `+e.normalizeIndentation(c),i)}const s=GP(e.autoIndent,t,r,e.languageConfigurationService);if(s){if(s.indentAction===Ul.None)return a2(r,` `+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Ul.Indent)return a2(r,` `+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Ul.IndentOutdent){const l=e.normalizeIndentation(s.indentation),c=e.normalizeIndentation(s.indentation+s.appendText),u=` `+c+` `+l;return i?new CU(r,u,!0):new aY(r,u,-1,c.length-l.length,!0)}else if(s.indentAction===Ul.Outdent){const l=cY(e,s.indentation);return a2(r,` `+e.normalizeIndentation(l+s.appendText),i)}}const o=t.getLineContent(r.startLineNumber),a=_o(o).substring(0,r.startColumn-1);if(e.autoIndent>=4){const l=nwr(e.autoIndent,t,r,{unshiftIndent:c=>cY(e,c),shiftIndent:c=>g2e(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),f=Yd(d);if(f>=0?r=r.setEndPosition(r.endLineNumber,Math.max(r.endColumn,f+1)):r=r.setEndPosition(r.endLineNumber,t.getLineMaxColumn(r.endLineNumber)),i)return new CU(r,` `+e.normalizeIndentation(l.afterEnter),!0);{let p=0;return u<=f+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),p=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new aY(r,` `+e.normalizeIndentation(l.afterEnter),0,p,!0)}}}return a2(r,` `+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const r=[];for(let s=0,o=i.length;s<o;s++){let a=i[s].positionLineNumber;if(a===1)r[s]=new CU(new ie(1,1,1,1),` `);else{a--;const l=t.getLineMaxColumn(a);r[s]=this._enter(e,t,!1,new ie(a,l,a,l))}}return r}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const r=[];for(let s=0,o=i.length;s<o;s++){const a=i[s].positionLineNumber,l=t.getLineMaxColumn(a);r[s]=this._enter(e,t,!1,new ie(a,l,a,l))}return r}static lineBreakInsert(e,t,i){const r=[];for(let s=0,o=i.length;s<o;s++)r[s]=this._enter(e,t,!0,i[s]);return r}}class dwr{static getEdits(e,t,i,r,s,o){const a=this._distributePasteToCursors(e,i,r,s,o);return a?(i=i.sort(ie.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,r,s)}static _distributePasteToCursors(e,t,i,r,s){if(r||t.length===1)return null;if(s&&s.length===t.length)return s;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substring(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substring(0,i.length-1));const o=_1(i);if(o.length===t.length)return o}return null}static _distributedPaste(e,t,i,r){const s=[];for(let o=0,a=i.length;o<a;o++)s[o]=new Bu(i[o],r[o]);return new hf(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,r,s){const o=[];for(let a=0,l=i.length;a<l;a++){const c=i[a],u=c.getPosition();if(s&&!c.isEmpty()&&(s=!1),s&&r.indexOf(` `)!==r.length-1&&(s=!1),s){const d=new ie(u.lineNumber,1,u.lineNumber,1);o[a]=new c2e(d,r,c,!0)}else o[a]=new Bu(c,r)}return new hf(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class hwr{static getEdits(e,t,i,r,s,o,a,l){const c=r.map(u=>this._compositionType(i,u,s,o,a,l));return new hf(4,c,{shouldPushStackElementBefore:Jte(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,r,s,o){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+s),u=new ie(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(u)===i&&o===0?null:new aY(u,i,0,o)}}class fwr{static getEdits(e,t,i){const r=[];for(let o=0,a=t.length;o<a;o++)r[o]=new Bu(t[o],i);const s=p2e(i,e);return new hf(s,r,{shouldPushStackElementBefore:Jte(e,s),shouldPushStackElementAfter:!1})}}class pwr{static getCommands(e,t,i){const r=[];for(let s=0,o=i.length;s<o;s++){const a=i[s];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[s]=new Bu(new ie(a.startLineNumber,1,a.startLineNumber,l.length+1),u,!0);continue}}r[s]=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[s]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}r[s]=new jm(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return r}static _goodIndentForLine(e,t,i){let r=null,s="";const o=G7(e.autoIndent,t,i,!1,e.languageConfigurationService);if(o)r=o.action,s=o.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const u=t.getLineContent(a);if(Lb(u)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=GP(e.autoIndent,t,new ie(a,l,a,l),e.languageConfigurationService);c&&(s=c.indentation+c.appendText)}return r&&(r===Ul.Indent&&(s=g2e(e,s)),r===Ul.Outdent&&(s=cY(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,r){let s="";const o=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,o),l=e.indentSize,c=l-a%l;for(let u=0;u<c;u++)s+=" "}else s=" ";return new Bu(i,s,r)}}class f2e extends aY{constructor(e,t,i,r,s,o){super(e,t,i,r),this._openCharacter=s,this._closeCharacter=o,this.closeCharacterRange=null,this.enclosingRange=null}_computeCursorStateWithRange(e,t,i){return this.closeCharacterRange=new ie(t.startLineNumber,t.endColumn-this._closeCharacter.length,t.endLineNumber,t.endColumn),this.enclosingRange=new ie(t.startLineNumber,t.endColumn-this._openCharacter.length-this._closeCharacter.length,t.endLineNumber,t.endColumn),super.computeCursorState(e,i)}}class gwr extends f2e{constructor(e,t,i,r){const s=(i?t:"")+r,o=0,a=-r.length;super(e,s,o,a,t,r)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return this._computeCursorStateWithRange(e,r,t)}}class mwr extends f2e{constructor(e,t,i,r){const s=i+r,o=0,a=i.length;super(t,s,o,a,i,r),this._autoIndentationEdit=e,this._autoClosingEdit={range:t,text:s}}getEditOperations(e,t){t.addTrackedEditOperation(this._autoIndentationEdit.range,this._autoIndentationEdit.text),t.addTrackedEditOperation(this._autoClosingEdit.range,this._autoClosingEdit.text)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length!==2)throw new Error("There should be two inverse edit operations!");const r=i[0].range,s=i[1].range,o=r.plusRange(s);return this._computeCursorStateWithRange(e,o,t)}}function p2e(n,e){return n===" "?e===5||e===6?6:5:4}function Jte(n,e){return k9e(n)&&!k9e(e)?!0:n===5?!1:E9e(n)!==E9e(e)}function E9e(n){return n===6||n===5?"space":n}function k9e(n){return n===4||n===5||n===6}function qut(n,e,t,i,r){if(n.autoClosingOvertype==="never"||!n.autoClosingPairs.autoClosingPairsCloseSingleChar.has(r))return!1;for(let s=0,o=t.length;s<o;s++){const a=t[s];if(!a.isEmpty())return!1;const l=a.getPosition(),c=e.getLineContent(l.lineNumber);if(c.charAt(l.column-1)!==r)return!1;const d=ok(r);if((l.column>2?c.charCodeAt(l.column-2):0)===92&&d)return!1;if(n.autoClosingOvertype==="auto"){let p=!1;for(let g=0,m=i.length;g<m;g++){const _=i[g];if(l.lineNumber===_.startLineNumber&&l.column===_.startColumn){p=!0;break}}if(!p)return!1}}return!0}function a2(n,e,t){return t?new CU(n,e,!0):new Bu(n,e,!0)}function g2e(n,e,t){return t=t||1,jm.shiftIndent(e,e.length+t,n.tabSize,n.indentSize,n.insertSpaces)}function cY(n,e,t){return t=t||1,jm.unshiftIndent(e,e.length+t,n.tabSize,n.indentSize,n.insertSpaces)}function Kut(n,e){return ok(e)?n.autoSurround==="quotes"||n.autoSurround==="languageDefined":n.autoSurround==="brackets"||n.autoSurround==="languageDefined"}class TS{static indent(e,t,i){if(t===null||i===null)return[];const r=[];for(let s=0,o=i.length;s<o;s++)r[s]=new jm(i[s],{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 s=0,o=i.length;s<o;s++)r[s]=new jm(i[s],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return r}static paste(e,t,i,r,s,o){return dwr.getEdits(e,t,i,r,s,o)}static tab(e,t,i){return pwr.getCommands(e,t,i)}static compositionType(e,t,i,r,s,o,a,l){return hwr.getEdits(e,t,i,r,s,o,a,l)}static compositionEndWithInterceptors(e,t,i,r,s,o){if(!r)return null;let a=null;for(const f of r)if(a===null)a=f.insertedText;else if(a!==f.insertedText)return null;if(!a||a.length!==1)return null;const l=a;let c=!1;for(const f of r)if(f.deletedText.length!==0){c=!0;break}if(c){if(!Kut(t,l)||!t.surroundingPairs.hasOwnProperty(l))return null;const f=ok(l);for(const m of r)if(m.deletedSelectionStart!==0||m.deletedSelectionEnd!==m.deletedText.length||/^[ \t]+$/.test(m.deletedText)||f&&ok(m.deletedText))return null;const p=[];for(const m of s){if(!m.isEmpty())return null;p.push(m.getPosition())}if(p.length!==r.length)return null;const g=[];for(let m=0,_=p.length;m<_;m++)g.push(new ewr(p[m],r[m].deletedText,t.surroundingPairs[l]));return new hf(4,g,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const u=awr.getEdits(t,i,s,o,l);if(u!==void 0)return u;const d=_be.getEdits(t,i,s,l,!0,!1);return d!==void 0?d:null}static typeWithInterceptors(e,t,i,r,s,o,a){const l=Zte.getEdits(i,r,s,a,e);if(l!==void 0)return l;const c=swr.getEdits(i,r,s,a,e);if(c!==void 0)return c;const u=owr.getEdits(t,i,r,s,o,a);if(u!==void 0)return u;const d=_be.getEdits(i,r,s,a,!1,e);if(d!==void 0)return d;const f=lwr.getEdits(i,r,s,a,e);if(f!==void 0)return f;const p=cwr.getEdits(t,i,r,s,a,e);return p!==void 0?p:uwr.getEdits(t,s,a)}static typeWithoutInterceptors(e,t,i,r,s){return fwr.getEdits(e,r,s)}}class _wr{constructor(e,t,i,r,s,o){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=r,this.insertedSelectionStart=s,this.insertedSelectionEnd=o}}var me;(function(n){n.editorSimpleInput=new yn("editorSimpleInput",!1,!0),n.editorTextFocus=new yn("editorTextFocus",!1,A("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),n.focus=new yn("editorFocus",!1,A("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),n.textInputFocus=new yn("textInputFocus",!1,A("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),n.readOnly=new yn("editorReadonly",!1,A("editorReadonly","Whether the editor is read-only")),n.inDiffEditor=new yn("inDiffEditor",!1,A("inDiffEditor","Whether the context is a diff editor")),n.isEmbeddedDiffEditor=new yn("isEmbeddedDiffEditor",!1,A("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),n.inMultiDiffEditor=new yn("inMultiDiffEditor",!1,A("inMultiDiffEditor","Whether the context is a multi diff editor")),n.multiDiffEditorAllCollapsed=new yn("multiDiffEditorAllCollapsed",void 0,A("multiDiffEditorAllCollapsed","Whether all files in multi diff editor are collapsed")),n.hasChanges=new yn("diffEditorHasChanges",!1,A("diffEditorHasChanges","Whether the diff editor has changes")),n.comparingMovedCode=new yn("comparingMovedCode",!1,A("comparingMovedCode","Whether a moved code block is selected for comparison")),n.accessibleDiffViewerVisible=new yn("accessibleDiffViewerVisible",!1,A("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),n.diffEditorRenderSideBySideInlineBreakpointReached=new yn("diffEditorRenderSideBySideInlineBreakpointReached",!1,A("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),n.diffEditorInlineMode=new yn("diffEditorInlineMode",!1,A("diffEditorInlineMode","Whether inline mode is active")),n.diffEditorOriginalWritable=new yn("diffEditorOriginalWritable",!1,A("diffEditorOriginalWritable","Whether modified is writable in the diff editor")),n.diffEditorModifiedWritable=new yn("diffEditorModifiedWritable",!1,A("diffEditorModifiedWritable","Whether modified is writable in the diff editor")),n.diffEditorOriginalUri=new yn("diffEditorOriginalUri","",A("diffEditorOriginalUri","The uri of the original document")),n.diffEditorModifiedUri=new yn("diffEditorModifiedUri","",A("diffEditorModifiedUri","The uri of the modified document")),n.columnSelection=new yn("editorColumnSelection",!1,A("editorColumnSelection","Whether `editor.columnSelection` is enabled")),n.writable=n.readOnly.toNegated(),n.hasNonEmptySelection=new yn("editorHasSelection",!1,A("editorHasSelection","Whether the editor has text selected")),n.hasOnlyEmptySelection=n.hasNonEmptySelection.toNegated(),n.hasMultipleSelections=new yn("editorHasMultipleSelections",!1,A("editorHasMultipleSelections","Whether the editor has multiple selections")),n.hasSingleSelection=n.hasMultipleSelections.toNegated(),n.tabMovesFocus=new yn("editorTabMovesFocus",!1,A("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),n.tabDoesNotMoveFocus=n.tabMovesFocus.toNegated(),n.isInEmbeddedEditor=new yn("isInEmbeddedEditor",!1,!0),n.canUndo=new yn("canUndo",!1,!0),n.canRedo=new yn("canRedo",!1,!0),n.hoverVisible=new yn("editorHoverVisible",!1,A("editorHoverVisible","Whether the editor hover is visible")),n.hoverFocused=new yn("editorHoverFocused",!1,A("editorHoverFocused","Whether the editor hover is focused")),n.stickyScrollFocused=new yn("stickyScrollFocused",!1,A("stickyScrollFocused","Whether the sticky scroll is focused")),n.stickyScrollVisible=new yn("stickyScrollVisible",!1,A("stickyScrollVisible","Whether the sticky scroll is visible")),n.standaloneColorPickerVisible=new yn("standaloneColorPickerVisible",!1,A("standaloneColorPickerVisible","Whether the standalone color picker is visible")),n.standaloneColorPickerFocused=new yn("standaloneColorPickerFocused",!1,A("standaloneColorPickerFocused","Whether the standalone color picker is focused")),n.inCompositeEditor=new yn("inCompositeEditor",void 0,A("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),n.notInCompositeEditor=n.inCompositeEditor.toNegated(),n.languageId=new yn("editorLangId","",A("editorLangId","The language identifier of the editor")),n.hasCompletionItemProvider=new yn("editorHasCompletionItemProvider",!1,A("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),n.hasCodeActionsProvider=new yn("editorHasCodeActionsProvider",!1,A("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),n.hasCodeLensProvider=new yn("editorHasCodeLensProvider",!1,A("editorHasCodeLensProvider","Whether the editor has a code lens provider")),n.hasDefinitionProvider=new yn("editorHasDefinitionProvider",!1,A("editorHasDefinitionProvider","Whether the editor has a definition provider")),n.hasDeclarationProvider=new yn("editorHasDeclarationProvider",!1,A("editorHasDeclarationProvider","Whether the editor has a declaration provider")),n.hasImplementationProvider=new yn("editorHasImplementationProvider",!1,A("editorHasImplementationProvider","Whether the editor has an implementation provider")),n.hasTypeDefinitionProvider=new yn("editorHasTypeDefinitionProvider",!1,A("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),n.hasHoverProvider=new yn("editorHasHoverProvider",!1,A("editorHasHoverProvider","Whether the editor has a hover provider")),n.hasDocumentHighlightProvider=new yn("editorHasDocumentHighlightProvider",!1,A("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),n.hasDocumentSymbolProvider=new yn("editorHasDocumentSymbolProvider",!1,A("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),n.hasReferenceProvider=new yn("editorHasReferenceProvider",!1,A("editorHasReferenceProvider","Whether the editor has a reference provider")),n.hasRenameProvider=new yn("editorHasRenameProvider",!1,A("editorHasRenameProvider","Whether the editor has a rename provider")),n.hasSignatureHelpProvider=new yn("editorHasSignatureHelpProvider",!1,A("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),n.hasInlayHintsProvider=new yn("editorHasInlayHintsProvider",!1,A("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),n.hasDocumentFormattingProvider=new yn("editorHasDocumentFormattingProvider",!1,A("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),n.hasDocumentSelectionFormattingProvider=new yn("editorHasDocumentSelectionFormattingProvider",!1,A("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),n.hasMultipleDocumentFormattingProvider=new yn("editorHasMultipleDocumentFormattingProvider",!1,A("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),n.hasMultipleDocumentSelectionFormattingProvider=new yn("editorHasMultipleDocumentSelectionFormattingProvider",!1,A("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(me||(me={}));const Fs=0;class tl extends pc{runEditorCommand(e,t,i){const r=t._getViewModel();r&&this.runCoreEditorCommand(r,i||{})}}var Nu;(function(n){const e=function(i){if(!zc(i))return!1;const r=i;return!(!cf(r.to)||!Kd(r.by)&&!cf(r.by)||!Kd(r.value)&&!zE(r.value)||!Kd(r.revealCursor)&&!qst(r.revealCursor))};n.metadata={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 s;switch(i.by){case n.RawUnit.Line:s=1;break;case n.RawUnit.WrappedLine:s=2;break;case n.RawUnit.Page:s=3;break;case n.RawUnit.HalfPage:s=4;break;case n.RawUnit.Editor:s=5;break;case n.RawUnit.Column:s=6;break;default:s=2}const o=Math.floor(i.value||1),a=!!i.revealCursor;return{direction:r,unit:s,value:o,revealCursor:a,select:!!i.select}}n.parse=t})(Nu||(Nu={}));var $R;(function(n){const e=function(t){if(!zc(t))return!1;const i=t;return!(!zE(i.lineNumber)&&!cf(i.lineNumber)||!Kd(i.at)&&!cf(i.at))};n.metadata={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"}})($R||($R={}));class vbe{constructor(e){e.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(Cs).getFocusedCodeEditor();return r&&r.hasTextFocus()?this._runEditorCommand(t,r,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const r=Hu();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(Cs).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 Bc;(function(n){class e extends tl{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;b.model.pushStackElement(),b.setCursorStates(y.source,3,[ou.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&b.revealAllCursors(y.source,!0,!0)}}n.MoveTo=gn(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=gn(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends tl{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(S=>vs.fromViewState(S))),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=gn(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,y,C){if(typeof C.position>"u"||typeof C.viewPosition>"u"||typeof C.mouseColumn>"u")return null;const S=v.model.validatePosition(C.position),k=v.coordinatesConverter.validateViewPosition(new We(C.viewPosition.lineNumber,C.viewPosition.column),S),I=C.doColumnSelect?y.fromViewLineNumber:k.lineNumber,L=C.doColumnSelect?y.fromViewVisualColumn:C.mouseColumn-1;return I2.columnSelect(v.cursorConfig,v,I,L,k.lineNumber,C.mouseColumn-1)}}),n.CursorColumnSelectLeft=gn(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,y,C){return I2.columnSelectLeft(v.cursorConfig,v,y)}}),n.CursorColumnSelectRight=gn(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,y,C){return I2.columnSelectRight(v.cursorConfig,v,y)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,C,S){return I2.columnSelectUp(b.cursorConfig,b,C,this._isPaged)}}n.CursorColumnSelectUp=gn(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=gn(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:3595,linux:{primary:0}}}));class r extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,C,S){return I2.columnSelectDown(b.cursorConfig,b,C,this._isPaged)}}n.CursorColumnSelectDown=gn(new r({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=gn(new r({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends tl{constructor(){super({id:"cursorMove",precondition:void 0,metadata:lY.metadata})}runCoreEditorCommand(b,y){const C=lY.parse(y);C&&this._runCursorMove(b,y.source,C)}_runCursorMove(b,y,C){b.model.pushStackElement(),b.setCursorStates(y,3,s._move(b,b.getCursorStates(),C)),b.revealAllCursors(y,!0)}static _move(b,y,C){const S=C.select,k=C.value;switch(C.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return ou.simpleMove(b,y,C.direction,S,k,C.unit);case 11:case 13:case 12:case 14:return ou.viewportMove(b,y,C.direction,S,k);default:return null}}}n.CursorMoveImpl=s,n.CursorMove=gn(new s);class o extends tl{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,ou.simpleMove(b,b.getCursorStates(),C.direction,C.select,C.value,C.unit)),b.revealAllCursors(y.source,!0)}}n.CursorLeft=gn(new o({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=gn(new o({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:1039}})),n.CursorRight=gn(new o({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=gn(new o({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:1041}})),n.CursorUp=gn(new o({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=gn(new o({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=gn(new o({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:11}})),n.CursorPageUpSelect=gn(new o({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:1035}})),n.CursorDown=gn(new o({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=gn(new o({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=gn(new o({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:12}})),n.CursorPageDownSelect=gn(new o({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:1036}})),n.CreateCursor=gn(new class extends tl{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let y;b.wholeLine?y=ou.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):y=ou.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const C=v.getCursorStates();if(C.length>1){const S=y.modelState?y.modelState.position:null,k=y.viewState?y.viewState.position:null;for(let I=0,L=C.length;I<L;I++){const N=C[I];if(!(S&&!N.modelState.selection.containsPosition(S))&&!(k&&!N.viewState.selection.containsPosition(k))){C.splice(I,1),v.model.pushStackElement(),v.setCursorStates(b.source,3,C);return}}}C.push(y),v.model.pushStackElement(),v.setCursorStates(b.source,3,C)}}),n.LastCursorMoveToSelect=gn(new class extends tl{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;const y=v.getLastAddedCursorIndex(),C=v.getCursorStates(),S=C.slice(0);S[y]=ou.moveTo(v,C[y],!0,b.position,b.viewPosition),v.model.pushStackElement(),v.setCursorStates(b.source,3,S)}});class a extends tl{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,ou.moveToBeginningOfLine(b,b.getCursorStates(),this._inSelectionMode)),b.revealAllCursors(y.source,!0)}}n.CursorHome=gn(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),n.CursorHomeSelect=gn(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends tl{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,this._exec(b.getCursorStates())),b.revealAllCursors(y.source,!0)}_exec(b){const y=[];for(let C=0,S=b.length;C<S;C++){const k=b[C],I=k.modelState.position.lineNumber;y[C]=vs.fromModelState(k.modelState.move(this._inSelectionMode,I,1,0))}return y}}n.CursorLineStart=gn(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:0,mac:{primary:287}}})),n.CursorLineStartSelect=gn(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:0,mac:{primary:1311}}}));class c extends tl{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,ou.moveToEndOfLine(b,b.getCursorStates(),this._inSelectionMode,y.sticky||!1)),b.revealAllCursors(y.source,!0)}}n.CursorEnd=gn(new c({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:Fs,kbExpr:me.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},metadata:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:A("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),n.CursorEndSelect=gn(new c({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:Fs,kbExpr:me.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},metadata:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:A("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class u extends tl{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.revealAllCursors(y.source,!0)}_exec(b,y){const C=[];for(let S=0,k=y.length;S<k;S++){const I=y[S],L=I.modelState.position.lineNumber,N=b.model.getLineMaxColumn(L);C[S]=vs.fromModelState(I.modelState.move(this._inSelectionMode,L,N,0))}return C}}n.CursorLineEnd=gn(new u({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:0,mac:{primary:291}}})),n.CursorLineEndSelect=gn(new u({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:0,mac:{primary:1315}}}));class d extends tl{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,ou.moveToBeginningOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealAllCursors(y.source,!0)}}n.CursorTop=gn(new d({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:2062,mac:{primary:2064}}})),n.CursorTopSelect=gn(new d({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:3086,mac:{primary:3088}}}));class f extends tl{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,ou.moveToEndOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealAllCursors(y.source,!0)}}n.CursorBottom=gn(new f({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:2061,mac:{primary:2066}}})),n.CursorBottomSelect=gn(new f({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:3085,mac:{primary:3090}}}));class p extends tl{constructor(){super({id:"editorScroll",precondition:void 0,metadata:Nu.metadata})}determineScrollMethod(b){const y=[6],C=[1,2,3,4,5,6],S=[4,2],k=[1,3];return y.includes(b.unit)&&S.includes(b.direction)?this._runHorizontalEditorScroll.bind(this):C.includes(b.unit)&&k.includes(b.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(b,y){const C=Nu.parse(y);if(!C)return;const S=this.determineScrollMethod(C);S&&S(b,y.source,C)}_runVerticalEditorScroll(b,y,C){const S=this._computeDesiredScrollTop(b,C);if(C.revealCursor){const k=b.getCompletelyVisibleViewRangeAtScrollTop(S);b.setCursorStates(y,3,[ou.findPositionInViewportIfOutside(b,b.getPrimaryCursorState(),k,C.select)])}b.viewLayout.setScrollPosition({scrollTop:S},0)}_computeDesiredScrollTop(b,y){if(y.unit===1){const k=b.viewLayout.getFutureViewport(),I=b.getCompletelyVisibleViewRangeAtScrollTop(k.top),L=b.coordinatesConverter.convertViewRangeToModelRange(I);let N;y.direction===1?N=Math.max(1,L.startLineNumber-y.value):N=Math.min(b.model.getLineCount(),L.startLineNumber+y.value);const P=b.coordinatesConverter.convertModelPositionToViewPosition(new We(N,1));return b.viewLayout.getVerticalOffsetForLineNumber(P.lineNumber)}if(y.unit===5){let k=0;return y.direction===3&&(k=b.model.getLineCount()-b.cursorConfig.pageSize),b.viewLayout.getVerticalOffsetForLineNumber(k)}let C;y.unit===3?C=b.cursorConfig.pageSize*y.value:y.unit===4?C=Math.round(b.cursorConfig.pageSize/2)*y.value:C=y.value;const S=(y.direction===1?-1:1)*C;return b.viewLayout.getCurrentScrollTop()+S*b.cursorConfig.lineHeight}_runHorizontalEditorScroll(b,y,C){const S=this._computeDesiredScrollLeft(b,C);b.viewLayout.setScrollPosition({scrollLeft:S},0)}_computeDesiredScrollLeft(b,y){const C=(y.direction===4?-1:1)*y.value;return b.viewLayout.getCurrentScrollLeft()+C*b.cursorConfig.typicalHalfwidthCharacterWidth}}n.EditorScrollImpl=p,n.EditorScroll=gn(new p),n.ScrollLineUp=gn(new class extends tl{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:Nu.RawDirection.Up,by:Nu.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollPageUp=gn(new class extends tl{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:Nu.RawDirection.Up,by:Nu.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollEditorTop=gn(new class extends tl{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:Nu.RawDirection.Up,by:Nu.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollLineDown=gn(new class extends tl{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:Nu.RawDirection.Down,by:Nu.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollPageDown=gn(new class extends tl{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:Nu.RawDirection.Down,by:Nu.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollEditorBottom=gn(new class extends tl{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:Nu.RawDirection.Down,by:Nu.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollLeft=gn(new class extends tl{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:Nu.RawDirection.Left,by:Nu.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollRight=gn(new class extends tl{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:Nu.RawDirection.Right,by:Nu.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:b.source})}});class g extends tl{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){y.position&&(b.model.pushStackElement(),b.setCursorStates(y.source,3,[ou.word(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position)]),y.revealType!==2&&b.revealAllCursors(y.source,!0,!0))}}n.WordSelect=gn(new g({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),n.WordSelectDrag=gn(new g({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),n.LastCursorWordSelect=gn(new class extends tl{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;const y=v.getLastAddedCursorIndex(),C=v.getCursorStates(),S=C.slice(0),k=C[y];S[y]=ou.word(v,k,k.modelState.hasSelection(),b.position),v.model.pushStackElement(),v.setCursorStates(b.source,3,S)}});class m extends tl{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){y.position&&(b.model.pushStackElement(),b.setCursorStates(y.source,3,[ou.line(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)]),y.revealType!==2&&b.revealAllCursors(y.source,!1,!0))}}n.LineSelect=gn(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),n.LineSelectDrag=gn(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class _ extends tl{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;const C=b.getLastAddedCursorIndex(),S=b.getCursorStates(),k=S.slice(0);k[C]=ou.line(b,S[C],this._inSelectionMode,y.position,y.viewPosition),b.model.pushStackElement(),b.setCursorStates(y.source,3,k)}}n.LastCursorLineSelect=gn(new _({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),n.LastCursorLineSelectDrag=gn(new _({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),n.CancelSelection=gn(new class extends tl{constructor(){super({id:"cancelSelection",precondition:me.hasNonEmptySelection,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates(b.source,3,[ou.cancelSelection(v,v.getPrimaryCursorState())]),v.revealAllCursors(b.source,!0)}}),n.RemoveSecondaryCursors=gn(new class extends tl{constructor(){super({id:"removeSecondaryCursors",precondition:me.hasMultipleSelections,kbOpts:{weight:Fs+1,kbExpr:me.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates(b.source,3,[v.getPrimaryCursorState()]),v.revealAllCursors(b.source,!0),Xy(A("removedCursor","Removed secondary cursors"))}}),n.RevealLine=gn(new class extends tl{constructor(){super({id:"revealLine",precondition:void 0,metadata:$R.metadata})}runCoreEditorCommand(v,b){const y=b,C=y.lineNumber||0;let S=typeof C=="number"?C+1:parseInt(C)+1;S<1&&(S=1);const k=v.model.getLineCount();S>k&&(S=k);const I=new ie(S,1,S,v.model.getLineMaxColumn(S));let L=0;if(y.at)switch(y.at){case $R.RawAtArgument.Top:L=3;break;case $R.RawAtArgument.Center:L=1;break;case $R.RawAtArgument.Bottom:L=4;break}const N=v.coordinatesConverter.convertModelRangeToViewRange(I);v.revealRange(b.source,!1,N,L,0)}}),n.SelectAll=new class extends vbe{constructor(){super(ucr)}runDOMCommand(v){Dm&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,y){const C=b._getViewModel();C&&this.runCoreEditorCommand(C,y)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[ou.selectAll(v,v.getPrimaryCursorState())])}},n.SetSelection=gn(new class extends tl{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[vs.fromModelSelection(b.selection)]))}})})(Bc||(Bc={}));const vwr=It.and(me.textInputFocus,me.columnSelection);function r3(n,e){Rh.registerKeybindingRule({id:n,primary:e,when:vwr,weight:Fs+1})}r3(Bc.CursorColumnSelectLeft.id,1039);r3(Bc.CursorColumnSelectRight.id,1041);r3(Bc.CursorColumnSelectUp.id,1040);r3(Bc.CursorColumnSelectPageUp.id,1035);r3(Bc.CursorColumnSelectDown.id,1042);r3(Bc.CursorColumnSelectPageDown.id,1036);function T9e(n){return n.register(),n}var YP;(function(n){class e extends pc{runEditorCommand(i,r,s){const o=r._getViewModel();o&&this.runCoreEditingCommand(r,o,s||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=gn(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:me.writable,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,Zte.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection)))}}),n.Outdent=gn(new class extends e{constructor(){super({id:"outdent",precondition:me.writable,kbOpts:{weight:Fs,kbExpr:It.and(me.editorTextFocus,me.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,TS.outdent(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection))),t.pushUndoStop()}}),n.Tab=gn(new class extends e{constructor(){super({id:"tab",precondition:me.writable,kbOpts:{weight:Fs,kbExpr:It.and(me.editorTextFocus,me.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,TS.tab(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=gn(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,r){const[s,o]=XL.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());s&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(2)}}),n.DeleteRight=gn(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Fs,kbExpr:me.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,r){const[s,o]=XL.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));s&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(3)}}),n.Undo=new class extends vbe{constructor(){super(hat)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,r){if(!(!i.hasModel()||i.getOption(92)===!0))return i.getModel().undo()}},n.Redo=new class extends vbe{constructor(){super(fat)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,r){if(!(!i.hasModel()||i.getOption(92)===!0))return i.getModel().redo()}}})(YP||(YP={}));class I9e extends ute{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Cs).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function YA(n,e){T9e(new I9e("default:"+n,n)),T9e(new I9e(n,n,e))}YA("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});YA("replacePreviousChar");YA("compositionType");YA("compositionStart");YA("compositionEnd");YA("paste");YA("cut");class bwr{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){Bc.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new We(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(78)){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(78)){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=Nh&&t.get(108),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){Bc.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Bc.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Bc.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Bc.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Bc.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Bc.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Bc.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Bc.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Bc.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Bc.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Bc.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Bc.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Bc.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 Gut{constructor(e){this._lineFactory=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 Ps("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 s=0,o=0;for(let l=i;l<=r;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(o===0?(s=c,o=1):o++)}if(e<i){let l=0;t<i?l=t-e+1:l=i-e,this._rendLineNumberStart-=l}return this._lines.splice(s,o)}onLinesChanged(e,t){const i=e+t-1;if(this.getCount()===0)return!1;const r=this.getStartLineNumber(),s=this.getEndLineNumber();let o=!1;for(let a=e;a<=i;a++)a>=r&&a<=s&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,r=this.getStartLineNumber(),s=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=i,null;if(e>s)return null;if(i+e>s)return this._lines.splice(e-this._rendLineNumberStart,s-e+1);const o=[];for(let d=0;d<i;d++)o[d]=this._lineFactory.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(o).concat(c),u}onTokensChanged(e){if(this.getCount()===0)return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let r=!1;for(let s=0,o=e.length;s<o;s++){const a=e[s];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 Yut{constructor(e){this._lineFactory=e,this.domNode=this._createDomNode(),this._linesCollection=new Gut(this._lineFactory)}_createDomNode(){const e=Hs(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(146)}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 s=t[i].getDomNode();s==null||s.remove()}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 s=t[i].getDomNode();s==null||s.remove()}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 bbe(this.domNode.domNode,this._lineFactory,e),r={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},s=i.render(r,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(s.rendLineNumberStart,s.lines)}}const SC=class SC{constructor(e,t,i){this._domNode=e,this._lineFactory=t,this._viewportData=i}render(e,t,i,r){const s={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(s.rendLineNumberStart+s.linesLength-1<t||i<s.rendLineNumberStart){s.rendLineNumberStart=t,s.linesLength=i-t+1,s.lines=[];for(let o=t;o<=i;o++)s.lines[o-t]=this._lineFactory.createLine();return this._finishRendering(s,!0,r),s}if(this._renderUntouchedLines(s,Math.max(t-s.rendLineNumberStart,0),Math.min(i-s.rendLineNumberStart,s.linesLength-1),r,t),s.rendLineNumberStart>t){const o=t,a=Math.min(i,s.rendLineNumberStart-1);o<=a&&(this._insertLinesBefore(s,o,a,r,t),s.linesLength+=a-o+1)}else if(s.rendLineNumberStart<t){const o=Math.min(s.linesLength,t-s.rendLineNumberStart);o>0&&(this._removeLinesBefore(s,o),s.linesLength-=o)}if(s.rendLineNumberStart=t,s.rendLineNumberStart+s.linesLength-1<i){const o=s.rendLineNumberStart+s.linesLength,a=i;o<=a&&(this._insertLinesAfter(s,o,a,r,t),s.linesLength+=a-o+1)}else if(s.rendLineNumberStart+s.linesLength-1>i){const o=Math.max(0,i-s.rendLineNumberStart+1),l=s.linesLength-1-o+1;l>0&&(this._removeLinesAfter(s,l),s.linesLength-=l)}return this._finishRendering(s,!1,r),s}_renderUntouchedLines(e,t,i,r,s){const o=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=o+l;a[l].layoutLine(c,r[c-s],this._viewportData.lineHeight)}}_insertLinesBefore(e,t,i,r,s){const o=[];let a=0;for(let l=t;l<=i;l++)o[a++]=this._lineFactory.createLine();e.lines=o.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const r=e.lines[i].getDomNode();r==null||r.remove()}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,r,s){const o=[];let a=0;for(let l=t;l<=i;l++)o[a++]=this._lineFactory.createLine();e.lines=e.lines.concat(o)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let r=0;r<t;r++){const s=e.lines[i+r].getDomNode();s==null||s.remove()}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,r){SC._ttPolicy&&(i=SC._ttPolicy.createHTML(i));const s=this._domNode.lastChild;t||!s?this._domNode.innerHTML=i:s.insertAdjacentHTML("afterend",i);let o=this._domNode.lastChild;for(let a=e.linesLength-1;a>=0;a--){const l=e.lines[a];r[a]&&(l.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const r=document.createElement("div");SC._ttPolicy&&(t=SC._ttPolicy.createHTML(t)),r.innerHTML=t;for(let s=0;s<e.linesLength;s++){const o=e.lines[s];if(i[s]){const a=r.firstChild,l=o.getDomNode();l.parentNode.replaceChild(a,l),o.setDomNode(a)}}}_finishRendering(e,t,i){const r=SC._sb,s=e.linesLength,o=e.lines,a=e.rendLineNumberStart,l=[];{r.reset();let c=!1;for(let u=0;u<s;u++){const d=o[u];l[u]=!1,!(d.getDomNode()||!d.renderLine(u+a,i[u],this._viewportData.lineHeight,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<s;d++){const f=o[d];u[d]=!1,!(l[d]||!f.renderLine(d+a,i[d],this._viewportData.lineHeight,this._viewportData,r))&&(u[d]=!0,c=!0)}c&&this._finishRenderingInvalidLines(e,r.build(),u)}}};SC._ttPolicy=Xw("editorViewLayer",{createHTML:e=>e}),SC._sb=new z4(1e5);let bbe=SC;class Qut extends fp{constructor(e){super(e),this._dynamicOverlays=[],this._isFocused=!1,this._visibleLines=new Yut({createLine:()=>new ywr(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);vu(this.domNode,i),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}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const i=this._context.configuration.options.get(50);return vu(this.domNode,i),!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 s=t[i];s.prepareRender(e),s.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class ywr{constructor(e){this._dynamicOverlays=e,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=Hs(e)}onContentChanged(){}onTokensChanged(){}renderLine(e,t,i,r,s){let o="";for(let a=0,l=this._dynamicOverlays.length;a<l;a++){const c=this._dynamicOverlays[a];o+=c.render(r.startLineNumber,e)}return this._renderedContent===o?!1:(this._renderedContent=o,s.appendString('<div style="top:'),s.appendString(String(t)),s.appendString("px;height:"),s.appendString(String(i)),s.appendString('px;">'),s.appendString(o),s.appendString("</div>"),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class Cwr extends Qut{constructor(e){super(e);const i=this._context.configuration.options.get(146);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(146);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 wwr extends Qut{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(146);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),vu(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;vu(this.domNode,t.get(50));const i=t.get(146);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 ene{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.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)==null||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)==null||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)==null||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return ene.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...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 We(e.afterLineNumber,1)).lineNumber}}}class xwr extends fp{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=Hs(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(146),r=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==r&&(this.contentWidth=r,e=!0);const s=i.contentLeft;return this.contentLeft!==s&&(this.contentLeft=s,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){let t=0;const i=e.getDecorationsInViewport();for(const r of i){if(!r.options.blockClassName)continue;let s=this.blocks[t];s||(s=this.blocks[t]=Hs(document.createElement("div")),this.domNode.appendChild(s));let o,a;r.options.blockIsAfterEnd?(o=e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!0)):(o=e.getVerticalOffsetForLineNumber(r.range.startLineNumber,!0),a=r.range.isEmpty()&&!r.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(r.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!0));const[l,c,u,d]=r.options.blockPadding??[0,0,0,0];s.setClassName("blockDecorations-block "+r.options.blockClassName),s.setLeft(this.contentLeft-d),s.setWidth(this.contentWidth+d+c),s.setTop(o-e.scrollTop-l),s.setHeight(a-o+l+u),t++}for(let r=t;r<this.blocks.length;r++)this.blocks[r].domNode.remove();this.blocks.length=t}}class Swr extends fp{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Hs(document.createElement("div")),zb.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Hs(document.createElement("div")),zb.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 Ewr(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,s){this._widgets[e.getId()].setPosition(t,i,r,s),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.remove(),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 Ewr{constructor(e,t,i){this._primaryAnchor=new xj(null,null),this._secondaryAnchor=new xj(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=Hs(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,s=r.get(146);this._fixedOverflowWidgets=r.get(42),this._contentWidth=s.contentWidth,this._contentLeft=s.contentLeft,this._lineHeight=r.get(67),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(67),e.hasChanged(146)){const i=t.get(146);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(s,o,a){if(!s)return new xj(null,null);const l=o.model.validatePosition(s);if(o.coordinatesConverter.modelPositionIsVisible(l)){const c=o.coordinatesConverter.convertModelPositionToViewPosition(l,a??void 0);return new xj(s,c)}return new xj(s,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 s=e.top,o=s,a=e.top+e.height,l=r.viewportHeight-a,c=s-i,u=o>=i,d=a,f=l>=i;let p=e.left;return p+t>r.scrollLeft+r.viewportWidth&&(p=r.scrollLeft+r.viewportWidth-t),p<r.scrollLeft&&(p=r.scrollLeft),{fitsAbove:u,aboveTop:c,fitsBelow:f,belowTop:d,left:p}}_layoutHorizontalSegmentInPage(e,t,i,r){const a=Math.max(15,t.left-r),l=Math.min(t.left+t.width+r,e.width-15),u=this._viewDomNode.domNode.ownerDocument.defaultView;let d=t.left+i-((u==null?void 0:u.scrollX)??0);if(d+r>l){const f=d-(l-r);d-=f,i-=f}if(d<a){const f=d-a;d-=f,i-=f}return[i,d]}_layoutBoxInPage(e,t,i,r){const s=e.top-i,o=e.top+e.height,a=al(this._viewDomNode.domNode),l=this._viewDomNode.domNode.ownerDocument,c=l.defaultView,u=a.top+s-((c==null?void 0:c.scrollY)??0),d=a.top+o-((c==null?void 0:c.scrollY)??0),f=ZE(l.body),[p,g]=this._layoutHorizontalSegmentInPage(f,a,e.left-r.scrollLeft+this._contentLeft,t),m=22,_=22,v=u>=m,b=d+i<=f.height-_;return this._fixedOverflowWidgets?{fitsAbove:v,aboveTop:Math.max(u,m),fitsBelow:b,belowTop:d,left:g}:{fitsAbove:v,aboveTop:s,fitsBelow:b,belowTop:o,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Sj(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var o,a;const t=s(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),i=((o=this._secondaryAnchor.viewPosition)==null?void 0:o.lineNumber)===((a=this._primaryAnchor.viewPosition)==null?void 0:a.lineNumber)?this._secondaryAnchor.viewPosition:null,r=s(i,this._affinity,this._lineHeight);return{primary:t,secondary:r};function s(l,c,u){if(!l)return null;const d=e.visibleRangeForPosition(l);if(!d)return null;const f=l.column===1&&c===3?0:d.left,p=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new L9e(p,f,u)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const r=this._context.configuration.options.get(50);let s=t.left;return s<e.left?s=Math.max(s,e.left-i+r.typicalFullwidthCharacterWidth):s=Math.min(s,e.left+i-r.typicalFullwidthCharacterWidth),new L9e(e.top,s,e.height)}_prepareRenderWidget(e){if(!this._preference||this._preference.length===0)return null;const{primary:t,secondary:i}=this._getAnchorsCoordinates(e);if(!t)return{kind:"offViewport",preserveFocus:this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)};if(this._cachedDomNodeOffsetWidth===-1||this._cachedDomNodeOffsetHeight===-1){let o=null;if(typeof this._actual.beforeRender=="function"&&(o=xue(this._actual.beforeRender,this._actual)),o)this._cachedDomNodeOffsetWidth=o.width,this._cachedDomNodeOffsetHeight=o.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 s;this.allowEditorOverflow?s=this._layoutBoxInPage(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):s=this._layoutBoxInViewport(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let o=1;o<=2;o++)for(const a of this._preference)if(a===1){if(!s)return null;if(o===2||s.fitsAbove)return{kind:"inViewport",coordinate:new Sj(s.aboveTop,s.left),position:1}}else if(a===2){if(!s)return null;if(o===2||s.fitsBelow)return{kind:"inViewport",coordinate:new Sj(s.belowTop,s.left),position:2}}else return this.allowEditorOverflow?{kind:"inViewport",coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new Sj(r.top,r.left)),position:0}:{kind:"inViewport",coordinate:new Sj(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){var t;if(!this._renderData||this._renderData.kind==="offViewport"){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,((t=this._renderData)==null?void 0:t.kind)==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&xue(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"&&xue(this._actual.afterRender,this._actual,this._renderData.position)}}class xj{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class Sj{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class L9e{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function xue(n,e,...t){try{return n.call(e,...t)}catch{return null}}class Xut extends GA{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(146);this._renderLineHighlight=t.get(97),this._renderLineHighlightOnlyWhenFocus=t.get(98),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Yn(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const s of this._selections)t.add(s.positionLineNumber);const i=Array.from(t);i.sort((s,o)=>s-o),fa(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const r=this._selections.every(s=>s.isEmpty());return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(146);return this._renderLineHighlight=t.get(97),this._renderLineHighlightOnlyWhenFocus=t.get(98),this._wordWrap=i.isViewportWrapping,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=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,r=[];for(let o=t;o<=i;o++){const a=o-t;r[a]=""}if(this._wordWrap){const o=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new We(a,1)).lineNumber,u=l.convertModelPositionToViewPosition(new We(c,1)).lineNumber,d=l.convertModelPositionToViewPosition(new We(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,f=Math.max(u,t),p=Math.min(d,i);for(let g=f;g<=p;g++){const m=g-t;r[m]=o}}}const s=this._renderOne(e,!0);for(const o of this._cursorLineNumbers){if(o<t||o>i)continue;const a=o-t;r[a]=s}this._renderData=r}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 kwr extends Xut{_renderOne(e,t){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-both":"")+(t?" current-line-exact":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Twr extends Xut{_renderOne(e,t){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")+(this._shouldRenderInMargin()&&t?" current-line-exact-margin":"")}" style="width:${this._contentLeft}px"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Gm((n,e)=>{const t=n.getColor(cct);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(mBe)){const i=n.getColor(mBe);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),Ab(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});class Iwr extends GA{constructor(e){super(),this._context=e;const t=this._context.configuration.options;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._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:ie.compareRangesUsingStarts(l.range,c.range)});const s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,a=[];for(let l=s;l<=o;l++){const c=l-s;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let o=0,a=t.length;o<a;o++){const l=t[o];if(!l.options.isWholeLine)continue;const c='<div class="cdr '+l.options.className+'" style="left:0;width:100%;"></div>',u=Math.max(l.range.startLineNumber,r),d=Math.min(l.range.endLineNumber,s);for(let f=u;f<=d;f++){const p=f-r;i[p]+=c}}}_renderNormalDecorations(e,t,i){const r=e.visibleRange.startLineNumber;let s=null,o=!1,a=null,l=!1;for(let c=0,u=t.length;c<u;c++){const d=t[c];if(d.options.isWholeLine)continue;const f=d.options.className,p=!!d.options.showIfCollapsed;let g=d.range;if(p&&g.endColumn===1&&g.endLineNumber!==g.startLineNumber&&(g=new ie(g.startLineNumber,g.startColumn,g.endLineNumber-1,this._context.viewModel.getLineMaxColumn(g.endLineNumber-1))),s===f&&o===p&&ie.areIntersectingOrTouching(a,g)){a=ie.plusRange(a,g);continue}s!==null&&this._renderNormalDecoration(e,a,s,l,o,r,i),s=f,o=p,a=g,l=d.options.shouldFillLineOnLineBreak??!1}s!==null&&this._renderNormalDecoration(e,a,s,l,o,r,i)}_renderNormalDecoration(e,t,i,r,s,o,a){const l=e.linesVisibleRangesForRange(t,i==="findMatch");if(l)for(let c=0,u=l.length;c<u;c++){const d=l[c];if(d.outsideRenderedLine)continue;const f=d.lineNumber-o;if(s&&d.ranges.length===1){const p=d.ranges[0];if(p.width<this._typicalHalfwidthCharacterWidth){const g=Math.round(p.left+p.width/2),m=Math.max(0,Math.round(g-this._typicalHalfwidthCharacterWidth/2));d.ranges[0]=new Qte(m,this._typicalHalfwidthCharacterWidth)}}for(let p=0,g=d.ranges.length;p<g;p++){const m=r&&d.continuesOnNextLine&&g===1,_=d.ranges[p],v='<div class="cdr '+i+'" style="left:'+String(_.left)+"px;width:"+(m?"100%;":String(_.width)+"px;")+'"></div>';a[f]+=v}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Lwr extends fp{constructor(e,t,i,r){super(e);const s=this._context.configuration.options,o=s.get(104),a=s.get(75),l=s.get(40),c=s.get(107),u={listenOnDomNode:i.domNode,className:"editor-scrollable "+n_e(e.theme.type),useShadows:!1,lazyRender:!0,vertical:o.vertical,horizontal:o.horizontal,verticalHasArrows:o.verticalHasArrows,horizontalHasArrows:o.horizontalHasArrows,verticalScrollbarSize:o.verticalScrollbarSize,verticalSliderSize:o.verticalSliderSize,horizontalScrollbarSize:o.horizontalScrollbarSize,horizontalSliderSize:o.horizontalSliderSize,handleMouseWheel:o.handleMouseWheel,alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel,arrowSize:o.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:o.scrollByPage};this.scrollbar=this._register(new Ste(t.domNode,u,this._context.viewLayout.getScrollable())),zb.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=Hs(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(f,p,g)=>{const m={};{const _=f.scrollTop;_&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,f.scrollTop=0)}if(g){const _=f.scrollLeft;_&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,f.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,1)};this._register(_t(i.domNode,"scroll",f=>d(i.domNode,!0,!0))),this._register(_t(t.domNode,"scroll",f=>d(t.domNode,!0,!1))),this._register(_t(r.domNode,"scroll",f=>d(r.domNode,!0,!1))),this._register(_t(this.scrollbarDomNode.domNode,"scroll",f=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(146);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(73).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(104)||e.hasChanged(75)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(104),r=t.get(75),s=t.get(40),o=t.get(107),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:r,fastScrollSensitivity:s,scrollPredominantAxis:o};this.scrollbar.updateOptions(a)}return e.hasChanged(146)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+n_e(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class ybe{constructor(e,t,i,r,s){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=r,this._decorationToRenderBrand=void 0,this.zIndex=s??0}}class Awr{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class Nwr{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Zut extends GA{_render(e,t,i){const r=[];for(let a=e;a<=t;a++){const l=a-e;r[l]=new Nwr}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 s=null,o=0;for(let a=0,l=i.length;a<l;a++){const c=i[a],u=c.className,d=c.zIndex;let f=Math.max(c.startLineNumber,e)-e;const p=Math.min(c.endLineNumber,t)-e;s===u?(f=Math.max(o+1,f),o=Math.max(o,p)):(s=u,o=p);for(let g=f;g<=o;g++)r[g].add(new Awr(u,d,c.tooltip))}return r}}class Dwr extends fp{constructor(e){super(e),this._widgets={},this._context=e;const t=this._context.configuration.options,i=t.get(146);this.domNode=Hs(document.createElement("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=t.get(67),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(146);return this._lineHeight=t.get(67),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=Hs(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&&ie.equalsRange(i.preference.range,t.range)?!1:(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets[t]){const r=this._widgets[t].domNode.domNode;delete this._widgets[t],r.remove(),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){var o;const i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,s=e.getDecorationsInViewport();for(const a of s){const l=a.options.glyphMarginClassName;if(!l)continue;const c=Math.max(a.range.startLineNumber,i),u=Math.min(a.range.endLineNumber,r),d=((o=a.options.glyphMargin)==null?void 0:o.position)??ov.Center,f=a.options.zIndex??0;for(let p=c;p<=u;p++){const g=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new We(p,0)),m=this._context.viewModel.glyphLanes.getLanesAtLine(g.lineNumber).indexOf(d);t.push(new Rwr(p,m,f,l))}}}_collectWidgetBasedGlyphRenderRequest(e,t){const i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(const s of Object.values(this._widgets)){const o=s.preference.range,{startLineNumber:a,endLineNumber:l}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(ie.lift(o));if(!a||!l||l<i||a>r)continue;const c=Math.max(a,i),u=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new We(c,0)),d=this._context.viewModel.glyphLanes.getLanesAtLine(u.lineNumber).indexOf(s.preference.lane);t.push(new Pwr(c,d,s.preference.zIndex,s))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,r)=>i.lineNumber===r.lineNumber?i.laneIndex===r.laneIndex?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.laneIndex-r.laneIndex: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 Lw(this._collectSortedGlyphRenderRequests(e)),i=[];for(;t.length>0;){const r=t.peek();if(!r)break;const s=t.takeWhile(a=>a.lineNumber===r.lineNumber&&a.laneIndex===r.laneIndex);if(!s||s.length===0)break;const o=s[0];if(o.type===0){const a=[];for(const l of s){if(l.zIndex!==o.zIndex||l.type!==o.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(o.accept(a.join(" ")))}else o.widget.renderInfo={lineNumber:o.lineNumber,laneIndex:o.laneIndex}}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],s=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(r),i.domNode.setLeft(s),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;i<this._decorationGlyphsToRender.length;i++){const r=this._decorationGlyphsToRender[i],s=e.viewportData.relativeVerticalOffset[r.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+r.laneIndex*this._lineHeight;let a;i<this._managedDomNodes.length?a=this._managedDomNodes[i]:(a=Hs(document.createElement("div")),this._managedDomNodes.push(a),this.domNode.appendChild(a)),a.setClassName("cgmr codicon "+r.combinedClassName),a.setPosition("absolute"),a.setTop(s),a.setLeft(o),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 Rwr{constructor(e,t,i,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=r,this.type=0}accept(e){return new Owr(this.lineNumber,this.laneIndex,e)}}class Pwr{constructor(e,t,i,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=r,this.type=1}}class Owr{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}class Mwr extends GA{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(147),r=t.get(50);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(147),r=t.get(50);return this._spaceWidth=r.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){var r;const i=e.selections[0].getPosition();return(r=this._primaryPosition)!=null&&r.equals(i)?!1:(this._primaryPosition=i,!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 l,c;if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,r=e.scrollWidth,s=this._primaryPosition,o=this.getGuidesByLine(t,Math.min(i+1,this._context.viewModel.getLineCount()),s),a=[];for(let u=t;u<=i;u++){const d=u-t,f=o[d];let p="";const g=((l=e.visibleRangeForPosition(new We(u,1)))==null?void 0:l.left)??0;for(const m of f){const _=m.column===-1?g+(m.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new We(u,m.column)).left;if(_>r||this._maxIndentLeft>0&&_>this._maxIndentLeft)break;const v=m.horizontalLine?m.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",b=m.horizontalLine?(((c=e.visibleRangeForPosition(new We(u,m.horizontalLine.endColumn)))==null?void 0:c.left)??_+this._spaceWidth)-_:this._spaceWidth;p+=`<div class="core-guide ${m.className} ${v}" style="left:${_}px;width:${b}px"></div>`}a[d]=p}this._renderResult=a}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?fI.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?fI.EnabledForActive:fI.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,s=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let o=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const d=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);o=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 f=new Array;u.push(f);const p=r?r[d-e]:[],g=new Lw(p),m=s?s[d-e]:0;for(let _=1;_<=m;_++){const v=(_-1)*c+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||p.length===0)&&o<=d&&d<=a&&_===l;f.push(...g.takeWhile(C=>C.visibleColumn<v)||[]);const y=g.peek();(!y||y.visibleColumn!==v||y.horizontalLine)&&f.push(new G2(v,-1,`core-guide-indent lvl-${(_-1)%30}`+(b?" indent-active":""),null,-1,-1))}f.push(...g.takeWhile(_=>!0)||[])}return u}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function FD(n){if(!(n&&n.isTransparent()))return n}Gm((n,e)=>{const t=[{bracketColor:fct,guideColor:tvr,guideColorActive:avr},{bracketColor:pct,guideColor:nvr,guideColorActive:lvr},{bracketColor:gct,guideColor:ivr,guideColorActive:cvr},{bracketColor:mct,guideColor:rvr,guideColorActive:uvr},{bracketColor:_ct,guideColor:svr,guideColorActive:dvr},{bracketColor:vct,guideColor:ovr,guideColorActive:hvr}],i=new Lct,r=[{indentColor:c$,indentColorActive:u$},{indentColor:P_r,indentColorActive:B_r},{indentColor:O_r,indentColorActive:$_r},{indentColor:M_r,indentColorActive:H_r},{indentColor:j_r,indentColorActive:V_r},{indentColor:F_r,indentColorActive:W_r}],s=t.map(a=>{const l=n.getColor(a.bracketColor),c=n.getColor(a.guideColor),u=n.getColor(a.guideColorActive),d=FD(FD(c)??(l==null?void 0:l.transparent(.3))),f=FD(FD(u)??l);if(!(!d||!f))return{guideColor:d,guideColorActive:f}}).filter(Oy),o=r.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),u=FD(l),d=FD(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(Oy);if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.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(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.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 Sue{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 jwr{constructor(){this._currentVisibleRange=new ie(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Fwr{constructor(e,t,i,r,s,o,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=r,this.startScrollTop=s,this.stopScrollTop=o,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Bwr{constructor(e,t,i,r,s){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=r,this.scrollType=s,this.type="selections";let o=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l<c;l++){const u=t[l];o=Math.min(o,u.startLineNumber),a=Math.max(a,u.endLineNumber)}this.minLineNumber=o,this.maxLineNumber=a}}const cX=class cX extends fp{constructor(e,t){super(e);const i=this._context.configuration,r=this._context.configuration.options,s=r.get(50),o=r.get(147);this._lineHeight=r.get(67),this._typicalHalfwidthCharacterWidth=s.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.isViewportWrapping,this._revealHorizontalRightPadding=r.get(101),this._cursorSurroundingLines=r.get(29),this._cursorSurroundingLinesStyle=r.get(30),this._canUseLayerHinting=!r.get(32),this._viewLineOptions=new C9e(i,this._context.theme.type),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new Yut({createLine:()=>new MC(this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,zb.write(this.domNode,8),this.domNode.setClassName(`view-lines ${KP}`),vu(this.domNode,s),this._maxLineWidth=0,this._asyncUpdateLineWidths=new ao(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new ao(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new jwr,this._horizontalRevealRequest=null,this._stickyScrollEnabled=r.get(116).enabled,this._maxNumberStickyLines=r.get(116).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(147)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),r=t.get(147);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(101),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(116).enabled,this._maxNumberStickyLines=t.get(116).maxLineCount,vu(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(146)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new C9e(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let s=i;s<=r;s++)this._visibleLines.getVisibleLine(s).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let r=!1;for(let s=t;s<=i;s++)r=this._visibleLines.getVisibleLine(s).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 Fwr(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 Bwr(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const s=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,s),!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 We(r,1);const s=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(r<s||r>o)return null;let a=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(r);return a<l&&(a=l),new We(r,a)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===MC.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 s=this._visibleLines.getVisibleLine(r);if(e===s.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 Sue(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),s}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,r=ie.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;const s=[];let o=0;const a=new Sue(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new We(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 f=d===r.startLineNumber?r.startColumn:1,p=d!==r.endLineNumber,g=p?this._context.viewModel.getLineMaxColumn(d):r.endColumn,m=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,f,g,a);if(m){if(t&&d<i){const _=l;l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new We(d+1,1)).lineNumber,_!==l&&(m.ranges[m.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}s[o++]=new xCr(m.outsideRenderedLine,d,Qte.from(m.ranges),p)}}return this._updateLineWidthsSlowIfDomDidLayout(a),o===0?null:s}_visibleRangesForLineRange(e,t,i){if(this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;const r=new Sue(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,r);return this._updateLineWidthsSlowIfDomDidLayout(r),s}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new SCr(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,s=!0;for(let o=t;o<=i;o++){const a=this._visibleLines.getVisibleLine(o);if(e&&!a.getWidthIsFast()){s=!1;continue}r=Math.max(r,a.getWidth(null))}return s&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),s}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let s=i;s<=r;s++){const o=this._visibleLines.getVisibleLine(s);if(o.needsMonospaceFontCheck()){const a=o.getWidth(null);a>t&&(t=a,e=s)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let s=i;s<=r;s++)this._visibleLines.getVisibleLine(s).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(),Nh&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let s=i;s<=r;s++)if(this._visibleLines.getVisibleLine(s).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,s,o){const a=e.top,l=e.height,c=a+l;let u,d,f;if(s&&s.length>0){let v=s[0].startLineNumber,b=s[0].endLineNumber;for(let y=1,C=s.length;y<C;y++){const S=s[y];v=Math.min(v,S.startLineNumber),b=Math.max(b,S.endLineNumber)}u=!1,d=this._context.viewLayout.getVerticalOffsetForLineNumber(v),f=this._context.viewLayout.getVerticalOffsetForLineNumber(b)+this._lineHeight}else if(r)u=!0,d=this._context.viewLayout.getVerticalOffsetForLineNumber(r.startLineNumber),f=this._context.viewLayout.getVerticalOffsetForLineNumber(r.endLineNumber)+this._lineHeight;else return-1;const p=(t==="mouse"||i)&&this._cursorSurroundingLinesStyle==="default";let g=0,m=0;if(p)i||(g=this._lineHeight);else{const v=l/this._lineHeight,b=Math.max(this._cursorSurroundingLines,this._stickyScrollEnabled?this._maxNumberStickyLines:0),y=Math.min(v/2,b);g=y*this._lineHeight,m=Math.max(0,y-1)*this._lineHeight}i||(o===0||o===4)&&(m+=this._lineHeight),d-=g,f+=m;let _;if(f-d>l){if(!u)return-1;_=d}else if(o===5||o===6)if(o===6&&a<=d&&f<=c)_=a;else{const v=Math.max(5*this._lineHeight,l*.2),b=d-v,y=f-l;_=Math.max(y,b)}else if(o===1||o===2)if(o===2&&a<=d&&f<=c)_=a;else{const v=(d+f)/2;_=Math.max(0,v-l/2)}else _=this._computeMinimumScrolling(a,c,d,f,o===3,o===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(146),r=t.left,s=r+t.width-i.verticalScrollbarWidth;let o=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)o=Math.min(o,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)o=Math.min(o,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}return e.minimalReveal||(o=Math.max(0,o-cX.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-o>t.width?null:{scrollLeft:this._computeMinimumScrolling(r,s,o,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,r,s,o){e=e|0,t=t|0,i=i|0,r=r|0,s=!!s,o=!!o;const a=t-e;if(r-i<a){if(s)return i;if(o)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}};cX.HORIZONTAL_EXTRA_PX=30;let Cbe=cX;class $wr extends Zut{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(146);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(146);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 s=0,o=t.length;s<o;s++){const a=t[s],l=a.options.linesDecorationsClassName,c=a.options.zIndex;l&&(i[r++]=new ybe(a.range.startLineNumber,a.range.endLineNumber,l,a.options.linesDecorationsTooltip??null,c));const u=a.options.firstLineDecorationClassName;u&&(i[r++]=new ybe(a.range.startLineNumber,a.range.startLineNumber,u,a.options.linesDecorationsTooltip??null,c))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,r=this._render(t,i,this._getDecorations(e)),s=this._decorationsLeft.toString(),o=this._decorationsWidth.toString(),a='" style="left:'+s+"px;width:"+o+'px;"></div>',l=[];for(let c=t;c<=i;c++){const u=c-t,d=r[u].getDecorations();let f="";for(const p of d){let g='<div class="cldr '+p.className;p.tooltip!==null&&(g+='" title="'+p.tooltip),g+=a,f+=g}l[u]=f}this._renderResult=l}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Hwr extends Zut{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 s=0,o=t.length;s<o;s++){const a=t[s],l=a.options.marginClassName,c=a.options.zIndex;l&&(i[r++]=new ybe(a.range.startLineNumber,a.range.endLineNumber,l,null,c))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,r=this._render(t,i,this._getDecorations(e)),s=[];for(let o=t;o<=i;o++){const a=o-t,l=r[a].getDecorations();let c="";for(const u of l)c+='<div class="cmdr '+u.className+'" style=""></div>';s[a]=c}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}const dS=class dS{constructor(e,t,i,r){this._rgba8Brand=void 0,this.r=dS._clamp(e),this.g=dS._clamp(t),this.b=dS._clamp(i),this.a=dS._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}};dS.Empty=new dS(0,0,0,0);let fw=dS;const uX=class uX extends Ye{static getInstance(){return this._INSTANCE||(this._INSTANCE=new uX),this._INSTANCE}constructor(){super(),this._onDidChange=new Ue,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Ka.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Ka.getColorMap();if(!e){this._colors=[fw.Empty],this._backgroundIsLight=!0;return}this._colors=[fw.Empty];for(let i=1;i<e.length;i++){const r=e[i].rgba;this._colors[i]=new fw(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}};uX._INSTANCE=null;let uY=uX;const Vwr=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),Wwr=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:95:n);class Y7{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Y7.soften(e,12/15),this.charDataLight=Y7.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let r=0,s=e.length;r<s;r++)i[r]=QK(e[r]*t);return i}renderChar(e,t,i,r,s,o,a,l,c,u,d){const f=1*this.scale,p=2*this.scale,g=d?1:p;if(t+f>e.width||i+g>e.height){console.warn("bad render request outside image data");return}const m=u?this.charDataLight:this.charDataNormal,_=Wwr(r,c),v=e.width*4,b=a.r,y=a.g,C=a.b,S=s.r-b,k=s.g-y,I=s.b-C,L=Math.max(o,l),N=e.data;let P=_*f*p,O=i*v+t*4;for(let F=0;F<g;F++){let V=O;for(let M=0;M<f;M++){const B=m[P++]/255*(o/255);N[V++]=b+S*B,N[V++]=y+k*B,N[V++]=C+I*B,N[V++]=L}O+=v}}blockRenderChar(e,t,i,r,s,o,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 f=e.width*4,p=.5*(s/255),g=o.r,m=o.g,_=o.b,v=r.r-g,b=r.g-m,y=r.b-_,C=g+v*p,S=m+b*p,k=_+y*p,I=Math.max(s,a),L=e.data;let N=i*f+t*4;for(let P=0;P<d;P++){let O=N;for(let F=0;F<c;F++)L[O++]=C,L[O++]=S,L[O++]=k,L[O++]=I;N+=f}}}const A9e={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},N9e=n=>{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t<n.length;t+=2)e[t>>1]=A9e[n[t]]<<4|A9e[n[t+1]]&15;return e},D9e={1:qE(()=>N9e("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:qE(()=>N9e("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class _6{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return D9e[e]?i=new Y7(D9e[e](),e):i=_6.createFromSampleData(_6.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 s of Vwr)i.fillText(String.fromCharCode(s),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=_6._downsample(e,t);return new Y7(r,t)}static _downsampleChar(e,t,i,r,s){const o=1*s,a=2*s;let l=r,c=0;for(let u=0;u<a;u++){const d=u/a*16,f=(u+1)/a*16;for(let p=0;p<o;p++){const g=p/o*10,m=(p+1)/o*10;let _=0,v=0;for(let y=d;y<f;y++){const C=t+Math.floor(y)*3840,S=1-(y-Math.floor(y));for(let k=g;k<m;k++){const I=1-(k-Math.floor(k)),L=C+Math.floor(k)*4,N=I*S;v+=N,_+=e[L]*e[L+3]/255*N}}const b=_/v;c=Math.max(c,b),i[l++]=QK(b)}}return c}static _downsample(e,t){const i=2*t*1*t,r=i*96,s=new Uint8ClampedArray(r);let o=0,a=0,l=0;for(let c=0;c<96;c++)l=Math.max(l,this._downsampleChar(e,a,s,o,t)),o+=i,a+=10*4;if(l>0){const c=255/l;for(let u=0;u<r;u++)s[u]*=c}return s}}const Jut=Wu?'"Segoe WPC", "Segoe UI", sans-serif':zr?"-apple-system, BlinkMacSystemFont, sans-serif":'system-ui, "Ubuntu", "Droid Sans", sans-serif',zwr=140,Uwr=2;class QP{constructor(e,t,i){const r=e.options,s=r.get(144),o=r.get(146),a=o.minimap,l=r.get(50),c=r.get(73);this.renderMinimap=a.renderMinimap,this.size=c.size,this.minimapHeightIsEditorHeight=a.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=r.get(106),this.paddingTop=r.get(84).top,this.paddingBottom=r.get(84).bottom,this.showSlider=c.showSlider,this.autohide=c.autohide,this.pixelRatio=s,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.lineHeight=r.get(67),this.minimapLeft=a.minimapLeft,this.minimapWidth=a.minimapWidth,this.minimapHeight=o.height,this.canvasInnerWidth=a.minimapCanvasInnerWidth,this.canvasInnerHeight=a.minimapCanvasInnerHeight,this.canvasOuterWidth=a.minimapCanvasOuterWidth,this.canvasOuterHeight=a.minimapCanvasOuterHeight,this.isSampling=a.minimapIsSampling,this.editorHeight=o.height,this.fontScale=a.minimapScale,this.minimapLineHeight=a.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.sectionHeaderFontFamily=Jut,this.sectionHeaderFontSize=c.sectionHeaderFontSize*s,this.sectionHeaderLetterSpacing=c.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=QP._getSectionHeaderColor(t,i.getColor(1)),this.charRenderer=qE(()=>_6.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=QP._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=QP._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Ohr);return i?new fw(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Mhr);return t?fw._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(y1);return i?new fw(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}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.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class v6{constructor(e,t,i,r,s,o,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=r,this.sliderTop=s,this.sliderHeight=o,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,s,o,a,l,c,u,d){const f=e.pixelRatio,p=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/p),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let k=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(k+=Math.max(0,s-e.lineHeight-e.paddingBottom));const I=Math.max(1,Math.floor(s*s/k)),L=Math.max(0,e.minimapHeight-I),N=L/(u-s),P=c*N,O=L>0,F=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),V=Math.floor(e.paddingTop/e.lineHeight);return new v6(c,u,O,N,P,I,V,1,Math.min(a,F))}let _;if(o&&i!==a){const k=i-t+1;_=Math.floor(k*p/f)}else{const k=s/m;_=Math.floor(k*p/f)}const v=Math.floor(e.paddingTop/m);let b=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const k=s/m;b=Math.max(b,k-1)}let y;if(b>0){const k=s/m;y=(v+a+b-k-1)*p/f}else y=Math.max(0,(v+a)*p/f-_);y=Math.min(e.minimapHeight-_,y);const C=y/(u-s),S=c*C;if(g>=v+a+b){const k=y>0;return new v6(c,u,k,C,S,_,v,1,a)}else{let k;t>1?k=t+v:k=Math.max(1,c/m);let I,L=Math.max(1,Math.floor(k-S*f/p));L<v?(I=v-L+1,L=1):(I=0,L=Math.max(1,L-v)),d&&d.scrollHeight===u&&(d.scrollTop>c&&(L=Math.min(L,d.startLineNumber),I=Math.max(I,d.topPaddingLineCount)),d.scrollTop<c&&(L=Math.max(L,d.startLineNumber),I=Math.min(I,d.topPaddingLineCount)));const N=Math.min(a,L-I+g-1),P=(c-r)/m;let O;return c>=e.paddingTop?O=(t-L+I+P)*p/f:O=c/e.paddingTop*(I+P)*p/f,new v6(c,u,!0,C,O,_,I,L,N)}}}const dX=class dX{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};dX.INVALID=new dX(-1);let dY=dX;class R9e{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Gut({createLine:()=>dY.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,s=i.length;r<s;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 m2e{constructor(e,t,i,r){this._backgroundFillData=m2e._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,s=i.g,o=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]=s,l[c+2]=o,l[c+3]=a,c+=4;return l}}class Q7{static compute(e,t,i){if(e.renderMinimap===0||!e.isSampling)return[null,[]];const{minimapLineCount:r}=LP.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),s=t/r,o=s/2;if(!i||i.minimapLines.length===0){const _=[];if(_[0]=1,r>1){for(let v=0,b=r-1;v<b;v++)_[v]=Math.round(v*s+o);_[r-1]=t}return[new Q7(s,_),[]]}const a=i.minimapLines,l=a.length,c=[];let u=0,d=0,f=1;const p=10;let g=[],m=null;for(let _=0;_<r;_++){const v=Math.max(f,Math.round(_*s)),b=Math.max(v,Math.round((_+1)*s));for(;u<l&&a[u]<v;){if(g.length<p){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(_===0?y=1:_+1===r?y=t:y=Math.round(_*s+o),g.length<p){const C=u+1+d;m&&m.type==="inserted"&&m._i===_-1?m.insertToLineNumber++:(m={type:"inserted",_i:_,insertFromLineNumber:C,insertToLineNumber:C},g.push(m)),d++}c[_]=y,f=y}if(g.length<p)for(;u<l;){const _=u+1+d;m&&m.type==="deleted"&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:u,deleteFromLineNumber:_,deleteToLineNumber:_},g.push(m)),d--,u++}else g=[{type:"flush"}];return[new Q7(s,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 s=this.minimapLines[i];if(s<e||s>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 s=this.minimapLines.length-1;s>=0&&!(this.minimapLines[s]<e.fromLineNumber);s--)this.minimapLines[s]<=e.toLineNumber?(this.minimapLines[s]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,s),r=Math.max(r,s)):this.minimapLines[s]-=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 qwr extends fp{constructor(e){super(e),this._sectionHeaderCache=new b1(10,1.5),this.tokensColorTracker=uY.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new QP(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=Q7.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new HR(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new QP(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]=Q7.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 s=0,o=t-e+1;s<o;s++)i[s]?r[s]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+s-1]):r[s]=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 Yn(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){const i=this._getMinimapDecorationsInViewport(e,t).filter(r=>{var s;return!((s=r.options.minimap)!=null&&s.sectionHeaderStyle)});if(this._samplingState){const r=[];for(const s of i){if(!s.options.minimap)continue;const o=s.range,a=this._samplingState.modelLineToMinimapLine(o.startLineNumber),l=this._samplingState.modelLineToMinimapLine(o.endLineNumber);r.push(new Out(new ie(a,o.startColumn,l,o.endColumn),s.options))}return r}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,s=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-s)),this._getMinimapDecorationsInViewport(e,t).filter(o=>{var a;return!!((a=o.options.minimap)!=null&&a.sectionHeaderStyle)})}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const r=this._samplingState.minimapLines[e-1],s=this._samplingState.minimapLines[t-1];i=new ie(r,1,s,this._context.viewModel.getLineMaxColumn(s))}else i=new ie(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(i)}getSectionHeaderText(e,t){var o;const i=(o=e.options.minimap)==null?void 0:o.sectionHeaderText;if(!i)return null;const r=this._sectionHeaderCache.get(i);if(r)return r;const s=t(i);return this._sectionHeaderCache.set(i,s),s}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new ie(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class HR extends Ye{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(L7e),this._domNode=Hs(document.createElement("div")),zb.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=Hs(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=Hs(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=Hs(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=Hs(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=Hs(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Da(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=al(this._slider.domNode),u=c.top+c.height/2;this._startSliderDragging(i,u,this._lastRenderData.renderedLayout)}return}const s=this._model.options.minimapLineHeight,o=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(o/s)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new K4,this._sliderPointerDownListener=Da(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=dd.addTarget(this._domNode.domNode),this._sliderTouchStartListener=_t(this._domNode.domNode,Oo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=_t(this._domNode.domNode,Oo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Da(this._domNode.domNode,Oo.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 s=(o,a)=>{const l=al(this._domNode.domNode),c=Math.min(Math.abs(a-r),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Wu&&c>zwr){this._model.setScrollTop(i.scrollTop);return}const u=o-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(u))};e.pageY!==t&&s(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>s(o.pageY,o.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 m2e(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.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)==null||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(L7e),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=v6.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(ie.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((f,p)=>(f.options.zIndex||0)-(p.options.zIndex||0));const{canvasInnerWidth:r,canvasInnerHeight:s}=this._model.options,o=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,s);const u=new P9e(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,o),this._renderDecorationsLineHighlights(c,i,u,e,o);const d=new P9e(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,d,e,o,l,a,r),this._renderDecorationsHighlights(c,i,d,e,o,l,a,r),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,r,s){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let o=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 f=r.getYForLineNumber(u,s),p=r.getYForLineNumber(d,s);a>=f||(a>o&&e.fillRect(j0,o,e.canvas.width,a-o),o=f),a=p}a>o&&e.fillRect(j0,o,e.canvas.width,a-o)}_renderDecorationsLineHighlights(e,t,i,r,s){const o=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==1)continue;const u=r.intersectWithViewport(l.range);if(!u)continue;const[d,f]=u,p=c.getColor(this._theme.value);if(!p||p.isTransparent())continue;let g=o.get(p.toString());g||(g=p.transparent(.5).toString(),o.set(p.toString(),g)),e.fillStyle=g;for(let m=d;m<=f;m++){if(i.has(m))continue;i.set(m,!0);const _=r.getYForLineNumber(d,s);e.fillRect(j0,_,e.canvas.width,s)}}}_renderSelectionsHighlights(e,t,i,r,s,o,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const u=r.intersectWithViewport(c);if(!u)continue;const[d,f]=u;for(let p=d;p<=f;p++)this.renderDecorationOnLine(e,i,c,this._selectionColor,r,p,s,s,o,a,l)}}_renderDecorationsHighlights(e,t,i,r,s,o,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[f,p]=d,g=u.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let m=f;m<=p;m++)switch(u.position){case 1:this.renderDecorationOnLine(e,i,c.range,g,r,m,s,s,o,a,l);continue;case 2:{const _=r.getYForLineNumber(m,s);this.renderDecoration(e,g,2,_,Uwr,s);continue}}}}renderDecorationOnLine(e,t,i,r,s,o,a,l,c,u,d){const f=s.getYForLineNumber(o,l);if(f+a<0||f>this._model.options.canvasInnerHeight)return;const{startLineNumber:p,endLineNumber:g}=i,m=p===o?i.startColumn:1,_=g===o?i.endColumn:this._model.getLineMaxColumn(o),v=this.getXOffsetForPosition(t,o,m,c,u,d),b=this.getXOffsetForPosition(t,o,_,c,u,d);this.renderDecoration(e,r,v,f,b-v,a)}getXOffsetForPosition(e,t,i,r,s,o){if(i===1)return j0;if((i-1)*s>=o)return o;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[j0];let u=j0;for(let d=1;d<c.length+1;d++){const f=c.charCodeAt(d-1),p=f===9?r*s:YE(f)?2*s:s,g=u+p;if(g>=o){l[d]=o;break}l[d]=g,u=g}e.set(t,l)}return i-1<l.length?l[i-1]:o}renderDecoration(e,t,i,r,s,o){e.fillStyle=t&&t.toString()||"",e.fillRect(i,r,s,o)}_renderSectionHeaders(e){var m;const t=this._model.options.minimapLineHeight,i=this._model.options.sectionHeaderFontSize,r=this._model.options.sectionHeaderLetterSpacing,s=i*1.5,{canvasInnerWidth:o}=this._model.options,a=this._model.options.backgroundColor,l=`rgb(${a.r} ${a.g} ${a.b} / .7)`,c=this._model.options.sectionHeaderFontColor,u=`rgb(${c.r} ${c.g} ${c.b})`,d=u,f=this._decorationsCanvas.domNode.getContext("2d");f.letterSpacing=r+"px",f.font="500 "+i+"px "+this._model.options.sectionHeaderFontFamily,f.strokeStyle=d,f.lineWidth=.2;const p=this._model.getSectionHeaderDecorationsInViewport(e.startLineNumber,e.endLineNumber);p.sort((_,v)=>_.range.startLineNumber-v.range.startLineNumber);const g=HR._fitSectionHeader.bind(null,f,o-j0);for(const _ of p){const v=e.getYForLineNumber(_.range.startLineNumber,t)+i,b=v-i,y=b+2,C=this._model.getSectionHeaderText(_,g);HR._renderSectionLabel(f,C,((m=_.options.minimap)==null?void 0:m.sectionHeaderStyle)===2,l,u,o,b,s,v,y)}}static _fitSectionHeader(e,t,i){if(!i)return i;const r="…",s=e.measureText(i).width,o=e.measureText(r).width;if(s<=t||s<=o)return i;const a=i.length,l=s/i.length,c=Math.floor((t-o)/l)-1;let u=Math.ceil(c/2);for(;u>0&&/\s/.test(i[u-1]);)--u;return i.substring(0,u)+r+i.substring(a-(c-u))}static _renderSectionLabel(e,t,i,r,s,o,a,l,c,u){t&&(e.fillStyle=r,e.fillRect(0,a,o,l),e.fillStyle=s,e.fillText(t,j0,c)),i&&(e.beginPath(),e.moveTo(0,u),e.lineTo(o,u),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,r=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const B=this._lastRenderData._get();return new R9e(e,B.imageData,B.lines)}const s=this._getBuffer();if(!s)return null;const[o,a,l]=HR._renderUntouchedLines(s,e.topPaddingLineCount,t,i,r,this._lastRenderData),c=this._model.getMinimapLinesRenderingData(t,i,l),u=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,f=this._model.options.backgroundColor,p=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),_=this._model.options.renderMinimap,v=this._model.options.charRenderer(),b=this._model.options.fontScale,y=this._model.options.minimapCharWidth,S=(_===1?2:3)*b,k=r>S?Math.floor((r-S)/2):0,I=f.a/255,L=new fw(Math.round((f.r-d.r)*I+d.r),Math.round((f.g-d.g)*I+d.g),Math.round((f.b-d.b)*I+d.b),255);let N=e.topPaddingLineCount*r;const P=[];for(let B=0,W=i-t+1;B<W;B++)l[B]&&HR._renderLine(s,L,f.a,m,_,y,g,p,v,N,k,u,c[B],b,r),P[B]=new dY(N),N+=r;const O=o===-1?0:o,V=(a===-1?s.height:a)-O;return this._canvas.domNode.getContext("2d").putImageData(s,0,0,0,O,s.width,V),new R9e(e,s,P)}static _renderUntouchedLines(e,t,i,r,s,o){const a=[];if(!o){for(let N=0,P=r-i+1;N<P;N++)a[N]=!0;return[-1,-1,a]}const l=o._get(),c=l.imageData.data,u=l.rendLineNumberStart,d=l.lines,f=d.length,p=e.width,g=e.data,m=(r-i+1)*s*p*4;let _=-1,v=-1,b=-1,y=-1,C=-1,S=-1,k=t*s;for(let N=i;N<=r;N++){const P=N-i,O=N-u,F=O>=0&&O<f?d[O].dy:-1;if(F===-1){a[P]=!0,k+=s;continue}const V=F*p*4,M=(F+s)*p*4,B=k*p*4,W=(k+s)*p*4;y===V&&S===B?(y=M,S=W):(b!==-1&&(g.set(c.subarray(b,y),C),_===-1&&b===0&&b===C&&(_=y),v===-1&&y===m&&b===C&&(v=b)),b=V,y=M,C=B,S=W),a[P]=!1,k+=s}b!==-1&&(g.set(c.subarray(b,y),C),_===-1&&b===0&&b===C&&(_=y),v===-1&&y===m&&b===C&&(v=b));const I=_===-1?-1:_/(p*4),L=v===-1?-1:v/(p*4);return[I,L,a]}static _renderLine(e,t,i,r,s,o,a,l,c,u,d,f,p,g,m){const _=p.content,v=p.tokens,b=e.width-o,y=m===1;let C=j0,S=0,k=0;for(let I=0,L=v.getCount();I<L;I++){const N=v.getEndOffset(I),P=v.getForeground(I),O=a.getColor(P);for(;S<N;S++){if(C>b)return;const F=_.charCodeAt(S);if(F===9){const V=f-(S+k)%f;k+=V-1,C+=V*o}else if(F===32)C+=o;else{const V=YE(F)?2:1;for(let M=0;M<V;M++)if(s===2?c.blockRenderChar(e,C,u+d,O,l,t,i,y):c.renderChar(e,C,u+d,F,O,l,t,i,g,r,y),C+=o,C>b)return}}}}}class P9e{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let r=0,s=this._endLineNumber-this._startLineNumber+1;r<s;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 Kwr extends fp{constructor(e,t){super(e),this._viewDomNode=t;const r=this._context.configuration.options.get(146);this._widgets={},this._verticalScrollbarWidth=r.verticalScrollbarWidth,this._minimapWidth=r.minimap.minimapWidth,this._horizontalScrollbarHeight=r.horizontalScrollbarHeight,this._editorHeight=r.height,this._editorWidth=r.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=Hs(document.createElement("div")),zb.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=Hs(document.createElement("div")),zb.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(146);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=Hs(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],r=t?t.preference:null,s=t==null?void 0:t.stackOridinal;return i.preference===r&&i.stack===s?(this._updateMaxMinWidth(),!1):(i.preference=r,i.stack=s,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.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var i,r;let e=0;const t=Object.keys(this._widgets);for(let s=0,o=t.length;s<o;s++){const a=t[s],c=(r=(i=this._widgets[a].widget).getMinContentWidthInPx)==null?void 0:r.call(i);typeof c<"u"&&(e=Math.max(e,c))}this._context.viewLayout.setOverlayWidgetsMinWidth(e)}_renderWidget(e,t){const i=e.domNode;if(e.preference===null){i.setTop("");return}const r=2*this._verticalScrollbarWidth+this._minimapWidth;if(e.preference===0||e.preference===1){if(e.preference===1){const s=i.domNode.clientHeight;i.setTop(this._editorHeight-s-2*this._horizontalScrollbarHeight)}else i.setTop(0);e.stack!==void 0?(i.setTop(t[e.preference]),t[e.preference]+=i.domNode.clientWidth):i.setRight(r)}else if(e.preference===2)i.domNode.style.right="50%",e.stack!==void 0?(i.setTop(t[2]),t[2]+=i.domNode.clientHeight):i.setTop(0);else{const{top:s,left:o}=e.preference;if(this._context.configuration.options.get(42)&&e.widget.allowEditorOverflow){const l=this._viewDomNodeRect;i.setTop(s+l.top),i.setLeft(o+l.left),i.setPosition("fixed")}else i.setTop(s),i.setLeft(o),i.setPosition("absolute")}}prepareRender(e){this._viewDomNodeRect=al(this._viewDomNode.domNode)}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets),i=Array.from({length:3},()=>0);t.sort((r,s)=>(this._widgets[r].stack||0)-(this._widgets[s].stack||0));for(let r=0,s=t.length;r<s;r++){const o=t[r];this._renderWidget(this._widgets[o],i)}}}class Gwr{constructor(e,t){const i=e.options;this.lineHeight=i.get(67),this.pixelRatio=i.get(144),this.overviewRulerLanes=i.get(83),this.renderBorder=i.get(82);const r=t.getColor(q_r);this.borderColor=r?r.toString():null,this.hideCursor=i.get(59);const s=t.getColor(Fte);this.cursorColorSingle=s?s.transparent(.7).toString():null;const o=t.getColor(uct);this.cursorColorPrimary=o?o.transparent(.7).toString():null;const a=t.getColor(dct);this.cursorColorSecondary=a?a.transparent(.7).toString():null,this.themeType=t.type;const l=i.get(73),c=l.enabled,u=l.side,d=t.getColor(K_r),f=Ka.getDefaultBackground();d?this.backgroundColor=d:c&&u==="right"?this.backgroundColor=f:this.backgroundColor=null;const g=i.get(146).overviewRuler;this.top=g.top,this.right=g.right,this.domWidth=g.width,this.domHeight=g.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[m,_]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=m,this.w=_}_initLanes(e,t,i){const r=t-e;if(i>=3){const s=Math.floor(r/3),o=Math.floor(r/3),a=r-s-o,l=e,c=l+s,u=l+s+a;return[[0,l,c,l,u,l,c,l],[0,s,a,s+a,o,s+a+o,a+o,s+a+o]]}else if(i===2){const s=Math.floor(r/2),o=r-s,a=e,l=a+s;return[[0,a,a,a,l,a,a,a],[0,s,s,s,o,s+o,s+o,s+o]]}else{const s=e,o=r;return[[0,s,s,s,s,s,s,s],[0,o,o,o,o,o,o,o]]}}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.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&At.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 Ywr extends fp{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Hs(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=Ka.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new We(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Gwr(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++){let r=this._settings.cursorColorSingle;i>1&&(r=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:r})}return this._cursorPositions.sort((t,i)=>We.compare(t.position,i.position)),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?At.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(V7.compareByRenderingProps),this._actualShouldRender===1&&!V7.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!fa(this._renderedCursorPositions,this._cursorPositions,(g,m)=>g.position.lineNumber===m.position.lineNumber&&g.color===m.color)&&(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,s=this._settings.lineHeight,o=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=At.Format.CSS.formatHexA(e),d.fillRect(0,0,i,r)):(d.clearRect(0,0,i,r),d.fillStyle=At.Format.CSS.formatHexA(e),d.fillRect(0,0,i,r)):d.clearRect(0,0,i,r);const f=this._settings.x,p=this._settings.w;for(const g of t){const m=g.color,_=g.data;d.fillStyle=m;let v=0,b=0,y=0;for(let C=0,S=_.length/3;C<S;C++){const k=_[3*C],I=_[3*C+1],L=_[3*C+2];let N=o.getVerticalOffsetForLineNumber(I)*l|0,P=(o.getVerticalOffsetForLineNumber(L)+s)*l|0;if(P-N<c){let F=(N+P)/2|0;F<u?F=u:F+u>r&&(F=r-u),N=F-u,P=F+u}N>y+1||k!==v?(C!==0&&d.fillRect(f[v],b,p[v],y-b),v=k,b=N,y=P):P>y&&(y=P)}d.fillRect(f[v],b,p[v],y-b)}if(!this._settings.hideCursor){const g=2*this._settings.pixelRatio|0,m=g/2|0,_=this._settings.x[7],v=this._settings.w[7];let b=-100,y=-100,C=null;for(let S=0,k=this._cursorPositions.length;S<k;S++){const I=this._cursorPositions[S].color;if(!I)continue;const L=this._cursorPositions[S].position;let N=o.getVerticalOffsetForLineNumber(L.lineNumber)*l|0;N<m?N=m:N+m>r&&(N=r-m);const P=N-m,O=P+g;P>y+1||I!==C?(S!==0&&C&&d.fillRect(_,b,v,y-b),b=P,y=O):O>y&&(y=O),C=I,d.fillStyle=I}C&&d.fillRect(_,b,v,y-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,r),d.moveTo(1,0),d.lineTo(i,0),d.stroke())}}class O9e{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 edt{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 Qwr{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(edt.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),s=i/r,o=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),f=u.heightInLines===0?this._getVerticalOffsetForLine(u.endLineNumber)+t:d+u.heightInLines*t,p=Math.floor(s*d),g=Math.floor(s*f);let m=Math.floor((p+g)/2),_=g-m;_<o&&(_=o),m-_<0&&(m=_),m+_>i&&(m=i-_);const v=u.color;let b=this._color2Id[v];b||(b=++this._lastAssignedId,this._color2Id[v]=b,this._id2Color[b]=v);const y=new O9e(m-_,m+_,b);u.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(O9e.compare),a}}class Xwr extends p${constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Hs(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Qwr(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(67)),this._zoneManager.setPixelRatio(i.get(144)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(67)&&(this._zoneManager.setLineHeight(t.get(67)),this._render()),e.hasChanged(144)&&(this._zoneManager.setPixelRatio(t.get(144)),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(),s=this._domNode.domNode.getContext("2d");return s.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(s,i,r,e),!0}_renderOneLane(e,t,i,r){let s=0,o=0,a=0;for(const l of t){const c=l.colorId,u=l.from,d=l.to;c!==s?(e.fillRect(0,o,r,a-o),s=c,e.fillStyle=i[s],o=u,a=d):a>=u?a=Math.max(a,d):(e.fillRect(0,o,r,a-o),o=u,a=d)}e.fillRect(0,o,r,a-o)}}class Zwr extends fp{constructor(e){super(e),this.domNode=Hs(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(103),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(103),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(),s=r;let o=t-e;for(;o>0;){const a=Hs(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(s),this.domNode.appendChild(a),this._renderedRulers.push(a),o--}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],s=this._rulers[t];r.setBoxShadow(s.color?`1px 0 0 0 ${s.color} inset`:""),r.setHeight(Math.min(e.scrollHeight,1e6)),r.setLeft(s.column*this._typicalHalfwidthCharacterWidth)}}}class Jwr extends fp{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const i=this._context.configuration.options.get(104);this._useShadows=i.useShadows,this._domNode=Hs(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(146);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(104);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 exr{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class txr{constructor(e,t){this.lineNumber=e,this.ranges=t}}function nxr(n){return new exr(n)}function ixr(n){return new txr(n.lineNumber,n.ranges.map(nxr))}const gl=class gl extends GA{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(102),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._roundedSelection=t.get(102),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 s=null,o=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!s&&c<i.length;c++)i[c].lineNumber===a&&(s=i[c].ranges[0]);const l=t[t.length-1].lineNumber;if(l===e.endLineNumber)for(let c=i.length-1;!o&&c>=0;c--)i[c].lineNumber===l&&(o=i[c].ranges[0]);s&&!s.startStyle&&(s=null),o&&!o.startStyle&&(o=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,f={top:0,bottom:0},p={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;IW(u-g)<r?f.top=2:u>g&&(f.top=1),IW(d-m)<r?p.top=2:g<d&&d<m&&(p.top=1)}else s&&(f.top=s.startStyle.top,p.top=s.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;IW(u-g)<r?f.bottom=2:g<u&&u<m&&(f.bottom=1),IW(d-m)<r?p.bottom=2:d<m&&(p.bottom=1)}else o&&(f.bottom=o.startStyle.bottom,p.bottom=o.endStyle.bottom);c.startStyle=f,c.endStyle=p}}_getVisibleRangesWithStyle(e,t,i){const s=(t.linesVisibleRangesForRange(e,!0)||[]).map(ixr);return!this._visibleRangesHaveGaps(s)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,s,i),s}_createSelectionPiece(e,t,i,r,s){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;bottom:"+t.toString()+"px;left:"+r.toString()+"px;width:"+s.toString()+'px;"></div>'}_actualRenderOneSelection(e,t,i,r){if(r.length===0)return;const s=!!r[0].ranges[0].startStyle,o=r[0].lineNumber,a=r[r.length-1].lineNumber;for(let l=0,c=r.length;l<c;l++){const u=r[l],d=u.lineNumber,f=d-t,p=i&&d===o?1:0,g=i&&d!==o&&d===a?1:0;let m="",_="";for(let v=0,b=u.ranges.length;v<b;v++){const y=u.ranges[v];if(s){const S=y.startStyle,k=y.endStyle;if(S.top===1||S.bottom===1){m+=this._createSelectionPiece(p,g,gl.SELECTION_CLASS_NAME,y.left-gl.ROUNDED_PIECE_WIDTH,gl.ROUNDED_PIECE_WIDTH);let I=gl.EDITOR_BACKGROUND_CLASS_NAME;S.top===1&&(I+=" "+gl.SELECTION_TOP_RIGHT),S.bottom===1&&(I+=" "+gl.SELECTION_BOTTOM_RIGHT),m+=this._createSelectionPiece(p,g,I,y.left-gl.ROUNDED_PIECE_WIDTH,gl.ROUNDED_PIECE_WIDTH)}if(k.top===1||k.bottom===1){m+=this._createSelectionPiece(p,g,gl.SELECTION_CLASS_NAME,y.left+y.width,gl.ROUNDED_PIECE_WIDTH);let I=gl.EDITOR_BACKGROUND_CLASS_NAME;k.top===1&&(I+=" "+gl.SELECTION_TOP_LEFT),k.bottom===1&&(I+=" "+gl.SELECTION_BOTTOM_LEFT),m+=this._createSelectionPiece(p,g,I,y.left+y.width,gl.ROUNDED_PIECE_WIDTH)}}let C=gl.SELECTION_CLASS_NAME;if(s){const S=y.startStyle,k=y.endStyle;S.top===0&&(C+=" "+gl.SELECTION_TOP_LEFT),S.bottom===0&&(C+=" "+gl.SELECTION_BOTTOM_LEFT),k.top===0&&(C+=" "+gl.SELECTION_TOP_RIGHT),k.bottom===0&&(C+=" "+gl.SELECTION_BOTTOM_RIGHT)}_+=this._createSelectionPiece(p,g,C,y.left,y.width)}e[f][0]+=m,e[f][1]+=_}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let o=i;o<=r;o++){const a=o-i;t[a]=["",""]}const s=[];for(let o=0,a=this._selections.length;o<a;o++){const l=this._selections[o];if(l.isEmpty()){s[o]=null;continue}const c=this._getVisibleRangesWithStyle(l,e,this._previousFrameVisibleRangesWithStyle[o]);s[o]=c,this._actualRenderOneSelection(t,i,this._selections.length>1,c)}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t.map(([o,a])=>o+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};gl.SELECTION_CLASS_NAME="selected-text",gl.SELECTION_TOP_LEFT="top-left-radius",gl.SELECTION_BOTTOM_LEFT="bottom-left-radius",gl.SELECTION_TOP_RIGHT="top-right-radius",gl.SELECTION_BOTTOM_RIGHT="bottom-right-radius",gl.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",gl.ROUNDED_PIECE_WIDTH=10;let wbe=gl;Gm((n,e)=>{const t=n.getColor(fhr);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function IW(n){return n<0?-n:n}class M9e{constructor(e,t,i,r,s,o,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=r,this.height=s,this.textContent=o,this.textContentClassName=a}}var QC;(function(n){n[n.Single=0]="Single",n[n.MultiPrimary=1]="MultiPrimary",n[n.MultiSecondary=2]="MultiSecondary"})(QC||(QC={}));class j9e{constructor(e,t){this._context=e;const i=this._context.configuration.options,r=i.get(50);this._cursorStyle=i.get(28),this._lineHeight=i.get(67),this._typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Hs(document.createElement("div")),this._domNode.setClassName(`cursor ${KP}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),vu(this._domNode,r),this._domNode.setDisplay("none"),this._position=new We(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case QC.Single:this._pluralityClass="";break;case QC.MultiPrimary:this._pluralityClass="cursor-primary";break;case QC.MultiSecondary:this._pluralityClass="cursor-secondary";break}}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(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),vu(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,s]=lar(i,t-1);return[new We(e,r+1),i.substring(r,s)]}_prepareRender(e){let t="",i="";const[r,s]=this._getGraphemeAwarePosition();if(this._cursorStyle===du.Line||this._cursorStyle===du.LineThin){const f=e.visibleRangeForPosition(r);if(!f||f.outsideRenderedLine)return null;const p=Ti(this._domNode.domNode);let g;this._cursorStyle===du.Line?(g=f8e(p,this._lineCursorWidth>0?this._lineCursorWidth:2),g>2&&(t=s,i=this._getTokenClassName(r))):g=f8e(p,1);let m=f.left,_=0;g>=2&&m>=1&&(_=1,m-=_);const v=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta;return new M9e(v,m,_,g,this._lineHeight,t,i)}const o=e.linesVisibleRangesForRange(new ie(r.lineNumber,r.column,r.lineNumber,r.column+s.length),!1);if(!o||o.length===0)return null;const a=o[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=s===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===du.Block&&(t=s,i=this._getTokenClassName(r));let u=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===du.Underline||this._cursorStyle===du.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new M9e(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 ${this._pluralityClass} ${KP} ${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)}}const q6=class q6 extends fp{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(92),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 j9e(this._context,QC.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=Hs(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 vv,this._cursorFlatBlinkInterval=new Ske,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(92),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.setPlurality(t.length?QC.MultiPrimary:QC.Single),this._primaryCursor.onCursorPositionChanged(e,r),this._updateBlinking(),this._secondaryCursors.length<t.length){const s=t.length-this._secondaryCursors.length;for(let o=0;o<s;o++){const a=new j9e(this._context,QC.MultiSecondary);this._domNode.domNode.insertBefore(a.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(a)}}else if(this._secondaryCursors.length>t.length){const s=this._secondaryCursors.length-t.length;for(let o=0;o<s;o++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let s=0;s<t.length;s++)this._secondaryCursors[s].onCursorPositionChanged(t[s],r)}onCursorStateChanged(e){const t=[];for(let r=0,s=e.selections.length;r<s;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,s=e.ranges.length;r<s;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()},q6.BLINK_INTERVAL,Ti(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},q6.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case du.Line:e+=" cursor-line-style";break;case du.Block:e+=" cursor-block-style";break;case du.Underline:e+=" cursor-underline-style";break;case du.LineThin:e+=" cursor-line-thin-style";break;case du.BlockOutline:e+=" cursor-block-outline-style";break;case du.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 s=0,o=this._secondaryCursors.length;s<o;s++){const a=this._secondaryCursors[s].render(e);a&&(t[i++]=a)}this._renderData=t}getLastRenderData(){return this._renderData}};q6.BLINK_INTERVAL=500;let xbe=q6;Gm((n,e)=>{const t=[{class:".cursor",foreground:Fte,background:wTe},{class:".cursor-primary",foreground:uct,background:L_r},{class:".cursor-secondary",foreground:dct,background:A_r}];for(const i of t){const r=n.getColor(i.foreground);if(r){let s=n.getColor(i.background);s||(s=r.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${r}; border-color: ${r}; color: ${s}; }`),Ab(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${s}; border-right: 1px solid ${s}; }`)}}});const Eue=()=>{throw new Error("Invalid change accessor")};class rxr extends fp{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(146);this._lineHeight=t.get(67),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Hs(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=Hs(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 s=Object.keys(this._zones);for(let o=0,a=s.length;o<a;o++){const l=s[o],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(146);return this._lineHeight=t.get(67),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(67)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return e.ordinal??e.afterColumn??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 o=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new We(o,this._context.viewModel.model.getLineMaxColumn(o))}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),s=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!s,afterViewLineNumber:r.lineNumber,heightInPx:s?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(i=>{const r={addZone:s=>(t=!0,this._addZone(i,s)),removeZone:s=>{s&&(t=this._removeZone(i,s)||t)},layoutZone:s=>{s&&(t=this._layoutZone(i,s)||t)}};sxr(e,r),r.addZone=Eue,r.removeZone=Eue,r.layoutZone=Eue}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),s={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:Hs(t.domNode),marginDomNode:t.marginDomNode?Hs(t.marginDomNode):null};return this._safeCallOnComputedHeight(s.delegate,i.heightInPx),s.domNode.setPosition("absolute"),s.domNode.domNode.style.width="100%",s.domNode.setDisplay("none"),s.domNode.setAttribute("monaco-view-zone",s.whitespaceId),this.domNode.appendChild(s.domNode),s.marginDomNode&&(s.marginDomNode.setPosition("absolute"),s.marginDomNode.domNode.style.width="100%",s.marginDomNode.setDisplay("none"),s.marginDomNode.setAttribute("monaco-view-zone",s.whitespaceId),this.marginDomNode.appendChild(s.marginDomNode)),this._zones[s.whitespaceId]=s,this.setShouldRender(),s.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.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),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){tr(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){tr(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let r=!1;for(const o of t)this._zones[o.id].isInHiddenArea||(i[o.id]=o,r=!0);const s=Object.keys(this._zones);for(let o=0,a=s.length;o<a;o++){const l=s[o],c=this._zones[l];let u=0,d=0,f="none";i.hasOwnProperty(l)?(u=i[l].verticalOffset-e.bigNumbersDelta,d=i[l].height,f="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(f),c.marginDomNode&&(c.marginDomNode.setTop(u),c.marginDomNode.setHeight(d),c.marginDomNode.setDisplay(f))}r&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}function sxr(n,e){try{return n(e)}catch(t){tr(t)}}class oxr extends GA{constructor(e){super(),this._context=e,this._options=new F9e(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 F9e(this._context.configuration);return this._options.equals(t)?e.hasChanged(146):(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,s=new Array(r);for(let a=0;a<r;a++)s[a]=!0;const o=this._context.viewModel.getMinimapLinesRenderingData(e.viewportData.startLineNumber,e.viewportData.endLineNumber,s);this._renderResult=[];for(let a=e.viewportData.startLineNumber;a<=e.viewportData.endLineNumber;a++){const l=a-e.viewportData.startLineNumber,c=o.data[l];let u=null;if(this._options.renderWhitespace==="selection"){const d=this._selection;for(const f of d){if(f.endLineNumber<a||f.startLineNumber>a)continue;const p=f.startLineNumber===a?f.startColumn:c.minColumn,g=f.endLineNumber===a?f.endColumn:c.maxColumn;p<g&&(u||(u=[]),u.push(new Dut(p-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 s=this._context.theme.getColor(xTe),o=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",f=this._options.renderWhitespace==="trailing",p=this._options.lineHeight,g=this._options.middotWidth,m=this._options.wsmiddotWidth,_=this._options.spaceWidth,v=Math.abs(m-_),b=Math.abs(g-_),y=v<b?11825:183,C=this._options.canUseHalfwidthRightwardsArrow;let S="",k=!1,I=Yd(a),L;I===-1?(k=!0,I=l,L=l):L=Lb(a);let N=0,P=i&&i[N],O=0;for(let F=u;F<l;F++){const V=a.charCodeAt(F);if(P&&F>=P.endOffset&&(N++,P=i&&i[N]),V!==9&&V!==32||f&&!k&&F<=L)continue;if(d&&F>=I&&F<=L&&V===32){const B=F-1>=0?a.charCodeAt(F-1):0,W=F+1<l?a.charCodeAt(F+1):0;if(B!==32&&W!==32)continue}if(d&&c&&F===l-1){const B=F-1>=0?a.charCodeAt(F-1):0;if(V===32&&B!==32&&B!==9)continue}if(i&&(!P||P.startOffset>F||P.endOffset<=F))continue;const M=e.visibleRangeForPosition(new We(t,F+1));M&&(o?(O=Math.max(O,M.left),V===9?S+=this._renderArrow(p,_,M.left):S+=`<circle cx="${(M.left+_/2).toFixed(2)}" cy="${(p/2).toFixed(2)}" r="${(_/7).toFixed(2)}" />`):V===9?S+=`<div class="mwh" style="left:${M.left}px;height:${p}px;">${C?"→":"→"}</div>`:S+=`<div class="mwh" style="left:${M.left}px;height:${p}px;">${String.fromCharCode(y)}</div>`)}return o?(O=Math.round(O+_),`<svg style="bottom:0;position:absolute;width:${O}px;height:${p}px" viewBox="0 0 ${O} ${p}" xmlns="http://www.w3.org/2000/svg" fill="${s}">`+S+"</svg>"):S}_renderArrow(e,t,i){const r=t/7,s=t,o=e/2,a=i,l={x:0,y:r/2},c={x:100/125*s,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},f={x:d.x+.35*c.x,y:d.y-.35*c.x},p={x:f.x,y:-f.y},g={x:d.x,y:-d.y},m={x:u.x,y:-u.y},_={x:c.x,y:-c.y},v={x:l.x,y:-l.y};return`<path d="M ${[l,c,u,d,f,p,g,m,_,v].map(C=>`${(a+C.x).toFixed(2)} ${(o+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 F9e{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(100),this.renderWithSVG=!0):(this.renderWhitespace=t.get(100),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(118)}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}}class axr{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.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=r,this.visibleRange=new ie(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 lxr{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 cxr{constructor(e,t,i){this.configuration=e,this.theme=new lxr(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var uxr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},dxr=function(n,e){return function(t,i){e(t,i,n)}};let Sbe=class extends p${constructor(e,t,i,r,s,o,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new Yn(1,1,1,1)],this._renderAnimationFrame=null;const l=new bwr(t,r,s,e);this._context=new cxr(t,i,r),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(mbe,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Hs(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Hs(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Hs(document.createElement("div")),zb.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Lwr(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Cbe(this._context,this._linesContent),this._viewZones=new rxr(this._context),this._viewParts.push(this._viewZones);const c=new Ywr(this._context);this._viewParts.push(c);const u=new Jwr(this._context);this._viewParts.push(u);const d=new Cwr(this._context);this._viewParts.push(d),d.addDynamicOverlay(new kwr(this._context)),d.addDynamicOverlay(new wbe(this._context)),d.addDynamicOverlay(new Mwr(this._context)),d.addDynamicOverlay(new Iwr(this._context)),d.addDynamicOverlay(new oxr(this._context));const f=new wwr(this._context);this._viewParts.push(f),f.addDynamicOverlay(new Twr(this._context)),f.addDynamicOverlay(new Hwr(this._context)),f.addDynamicOverlay(new $wr(this._context)),f.addDynamicOverlay(new sY(this._context)),this._glyphMarginWidgets=new Dwr(this._context),this._viewParts.push(this._glyphMarginWidgets);const p=new oY(this._context);p.getDomNode().appendChild(this._viewZones.marginDomNode),p.getDomNode().appendChild(f.getDomNode()),p.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(p),this._contentWidgets=new Swr(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new xbe(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Kwr(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const g=new Zwr(this._context);this._viewParts.push(g);const m=new xwr(this._context);this._viewParts.push(m);const _=new qwr(this._context);if(this._viewParts.push(_),c){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(c.getDomNode(),v.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(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(p.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),o?(o.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),o.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new HCr(this._context,l,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],r=0;i=i.concat(e.getAllMarginDecorations().map(s=>{var a,l;const o=((a=s.options.glyphMargin)==null?void 0:a.position)??ov.Center;return r=Math.max(r,s.range.endLineNumber),{range:s.range,lane:o,persist:(l=s.options.glyphMargin)==null?void 0:l.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(s=>{const o=e.validateRange(s.preference.range);return r=Math.max(r,o.endLineNumber),{range:o,lane:s.preference.lane}})),i.sort((s,o)=>ie.compareRangesUsingStarts(s.range,o.range)),t.reset(r);for(const s of i)t.push(s.lane,s.range,s.persist);return t}_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 LCr(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 We(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(146);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(143)+" "+n_e(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(){var e;if(this._store.isDisposed)throw new Ps;if(this._renderAnimationFrame===null){const t=this._createCoordinatedRendering();this._renderAnimationFrame=Ebe.INSTANCE.scheduleCoordinatedRendering({window:Ti((e=this.domNode)==null?void 0:e.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Ps;try{return t.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Ps;return t.renderText()},prepareRender:(i,r)=>{if(this._store.isDisposed)throw new Ps;return t.prepareRender(i,r)},render:(i,r)=>{if(this._store.isDisposed)throw new Ps;return t.render(i,r)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();US(()=>e.prepareRenderText());const t=US(()=>e.renderText());if(t){const[i,r]=t;US(()=>e.prepareRender(i,r)),US(()=>e.render(i,r))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}zS.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new axr(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new wCr(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.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 s=this._viewLines.visibleRangeForPosition(new We(r.lineNumber,r.column));return s?s.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?ene.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Xwr(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,s;this._contentWidgets.setWidgetPosition(e.widget,((t=e.position)==null?void 0:t.position)??null,((i=e.position)==null?void 0:i.secondaryPosition)??null,((r=e.position)==null?void 0:r.preference)??null,((s=e.position)==null?void 0:s.positionAffinity)??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){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&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()}};Sbe=uxr([dxr(6,mi)],Sbe);function US(n){try{return n()}catch(e){return tr(e),null}}const hX=class hX{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[i,r]of this._animationFrameRunners)r.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,WK(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)US(()=>i.prepareRenderText());const t=[];for(let i=0,r=e.length;i<r;i++){const s=e[i];t[i]=US(()=>s.renderText())}for(let i=0,r=e.length;i<r;i++){const s=e[i],o=t[i];if(!o)continue;const[a,l]=o;US(()=>s.prepareRender(a,l))}for(let i=0,r=e.length;i<r;i++){const s=e[i],o=t[i];if(!o)continue;const[a,l]=o;US(()=>s.render(a,l))}}};hX.INSTANCE=new hX;let Ebe=hX;class b6{constructor(e,t,i,r,s){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=r,this.wrappedTextIndentLength=s}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 s=0;s<this.injectionOffsets.length&&r>this.injectionOffsets[s];s++)r<this.injectionOffsets[s]+this.injectionOptions[s].content.length?r=this.injectionOffsets[s]:r-=this.injectionOptions[s].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,s=0,o=0;for(;i<=r;){s=i+(r-i)/2|0;const l=this.breakOffsets[s];if(o=s>0?this.breakOffsets[s-1]:0,t===0)if(e<=o)r=s-1;else if(e>l)i=s+1;else break;else if(e<o)r=s-1;else if(e>=l)i=s+1;else break}let a=e-o;return s>0&&(a+=this.wrappedTextIndentLength),new LW(s,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const r=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.normalizeOffsetInInputWithInjectionsAroundInjections(r,i);if(s!==r)return this.offsetInInputWithInjectionsToOutputPosition(s,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new LW(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const r=this.getOutputLineCount()-1;if(e<r&&t===this.getMaxOutputOffset(e))return new LW(e+1,this.getMinOutputOffset(e+1))}return new LW(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&&B9e(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let r=i.offsetInInputWithInjections;if($9e(this.injectionOptions[i.injectedTextIndex].cursorStops))return r;let s=i.injectedTextIndex-1;for(;s>=0&&this.injectionOffsets[s]===this.injectionOffsets[i.injectedTextIndex]&&!(B9e(this.injectionOptions[s].cursorStops)||(r-=this.injectionOptions[s].content.length,$9e(this.injectionOptions[s].cursorStops)));)s--;return r}}else if(t===1||t===4){let r=i.offsetInInputWithInjections+i.length,s=i.injectedTextIndex;for(;s+1<this.injectionOffsets.length&&this.injectionOffsets[s+1]===this.injectionOffsets[s];)r+=this.injectionOptions[s+1].content.length,s++;return r}else if(t===0||t===3){let r=i.offsetInInputWithInjections,s=i.injectedTextIndex;for(;s-1>=0&&this.injectionOffsets[s-1]===this.injectionOffsets[s];)r-=this.injectionOptions[s-1].content.length,s--;return r}cte()}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 s=0;s<t.length;s++){const o=i[s].content.length,a=t[s]+r,l=t[s]+r+o;if(a>e)break;if(e<=l)return{injectedTextIndex:s,offsetInInputWithInjections:a,length:o};r+=o}}}}function B9e(n){return n==null?!0:n===$_.Right||n===$_.Both}function $9e(n){return n==null?!0:n===$_.Left||n===$_.Both}class LW{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new We(e+this.outputLineIndex,this.outputOffset+1)}}const kue=Xw("domLineBreaksComputer",{createHTML:n=>n});class _2e{static create(e){return new _2e(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,r,s){const o=[],a=[];return{addRequest:(l,c,u)=>{o.push(l),a.push(c)},finalize:()=>hxr(MS(this.targetWindow.deref()),o,e,t,i,r,s,a)}}}function hxr(n,e,t,i,r,s,o,a){function l(N){const P=a[N];if(P){const O=Hb.applyInjectedText(e[N],P),F=P.map(M=>M.options),V=P.map(M=>M.column-1);return new b6(V,F,[O.length],[],0)}else return null}if(r===-1){const N=[];for(let P=0,O=e.length;P<O;P++)N[P]=l(P);return N}const c=Math.round(r*t.typicalHalfwidthCharacterWidth),d=Math.round(i*(s===3?2:s===2?1:0)),f=Math.ceil(t.spaceWidth*d),p=document.createElement("div");vu(p,t);const g=new z4(1e4),m=[],_=[],v=[],b=[],y=[];for(let N=0;N<e.length;N++){const P=Hb.applyInjectedText(e[N],a[N]);let O=0,F=0,V=c;if(s!==0)if(O=Yd(P),O===-1)O=0;else{for(let q=0;q<O;q++){const U=P.charCodeAt(q)===9?i-F%i:1;F+=U}const W=Math.ceil(t.spaceWidth*F);W+t.typicalFullwidthCharacterWidth>c?(O=0,F=0):V=c-W}const M=P.substr(O),B=fxr(M,F,i,V,g,f);m[N]=O,_[N]=F,v[N]=M,b[N]=B[0],y[N]=B[1]}const C=g.build(),S=(kue==null?void 0:kue.createHTML(C))??C;p.innerHTML=S,p.style.position="absolute",p.style.top="10000",o==="keepAll"?(p.style.wordBreak="keep-all",p.style.overflowWrap="anywhere"):(p.style.wordBreak="inherit",p.style.overflowWrap="break-word"),n.document.body.appendChild(p);const k=document.createRange(),I=Array.prototype.slice.call(p.children,0),L=[];for(let N=0;N<e.length;N++){const P=I[N],O=pxr(k,P,v[N],b[N]);if(O===null){L[N]=l(N);continue}const F=m[N],V=_[N]+d,M=y[N],B=[];for(let G=0,H=O.length;G<H;G++)B[G]=M[O[G]];if(F!==0)for(let G=0,H=O.length;G<H;G++)O[G]+=F;let W,q;const U=a[N];U?(W=U.map(G=>G.options),q=U.map(G=>G.column-1)):(W=null,q=null),L[N]=new b6(q,W,O,B,V)}return p.remove(),L}function fxr(n,e,t,i,r,s){if(s!==0){const f=String(s);r.appendString('<div style="text-indent: -'),r.appendString(f),r.appendString("px; padding-left: "),r.appendString(f),r.appendString("px; box-sizing: border-box; width:")}else r.appendString('<div style="width:');r.appendString(String(i)),r.appendString('px;">');const o=n.length;let a=e,l=0;const c=[],u=[];let d=0<o?n.charCodeAt(0):0;r.appendString("<span>");for(let f=0;f<o;f++){f!==0&&f%16384===0&&r.appendString("</span><span>"),c[f]=l,u[f]=a;const p=d;d=f+1<o?n.charCodeAt(f+1):0;let g=1,m=1;switch(p){case 9:g=t-a%t,m=g;for(let _=1;_<=g;_++)_<g?r.appendCharCode(160):r.appendASCIICharCode(32);break;case 32:d===32?r.appendCharCode(160):r.appendASCIICharCode(32);break;case 60:r.appendString("<");break;case 62:r.appendString(">");break;case 38:r.appendString("&");break;case 0:r.appendString("�");break;case 65279:case 8232:case 8233:case 133:r.appendCharCode(65533);break;default:YE(p)&&m++,p<32?r.appendCharCode(9216+p):r.appendCharCode(p)}l+=g,a+=m}return r.appendString("</span>"),c[n.length]=l,u[n.length]=a,r.appendString("</div>"),[c,u]}function pxr(n,e,t,i){if(t.length<=1)return null;const r=Array.prototype.slice.call(e.children,0),s=[];try{kbe(n,r,i,0,null,t.length-1,null,s)}catch(o){return console.log(o),null}return s.length===0?null:(s.push(t.length),s)}function kbe(n,e,t,i,r,s,o,a){if(i===s||(r=r||Tue(n,e,t[i],t[i+1]),o=o||Tue(n,e,t[s],t[s+1]),Math.abs(r[0].top-o[0].top)<=.1))return;if(i+1===s){a.push(s);return}const l=i+(s-i)/2|0,c=Tue(n,e,t[l],t[l+1]);kbe(n,e,t,i,r,l,c,a),kbe(n,e,t,l,c,s,o,a)}function Tue(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 gxr extends Ye{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new lke),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)){tr(new Error(`Cannot have two contributions with the same id ${r.id}`));continue}this._pending.set(r.id,r)}this._instantiateSome(0),this._register(Kj(Ti(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(Kj(Ti(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(Kj(Ti(this._editor.getDomNode()),()=>{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(){var e;return Kj(Ti((e=this._editor)==null?void 0:e.getDomNode()),()=>{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){tr(i)}}}}class tdt{constructor(e,t,i,r,s,o,a){this.id=e,this.label=t,this.alias=i,this.metadata=r,this._precondition=s,this._run=o,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}class v2e{static create(e){return new v2e(e.get(135),e.get(134))}constructor(e,t){this.classifier=new mxr(e,t)}createLineBreaksComputer(e,t,i,r,s){const o=[],a=[],l=[];return{addRequest:(c,u,d)=>{o.push(c),a.push(u),l.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,u=[];for(let d=0,f=o.length;d<f;d++){const p=a[d],g=l[d];g&&!g.injectionOptions&&!p?u[d]=_xr(this.classifier,g,o[d],t,i,c,r,s):u[d]=vxr(this.classifier,o[d],p,t,i,c,r,s)}return Tbe.length=0,Ibe.length=0,u}}}}class mxr extends U4{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 Tbe=[],Ibe=[];function _xr(n,e,t,i,r,s,o,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,f=ndt(t,i,r,s,o),p=r-f,g=Tbe,m=Ibe;let _=0,v=0,b=0,y=r;const C=u.length;let S=0;if(S>=0){let k=Math.abs(d[S]-y);for(;S+1<C;){const I=Math.abs(d[S+1]-y);if(I>=k)break;k=I,S++}}for(;S<C;){let k=S<0?0:u[S],I=S<0?0:d[S];v>k&&(k=v,I=b);let L=0,N=0,P=0,O=0;if(I<=y){let V=I,M=k===0?0:t.charCodeAt(k-1),B=k===0?0:n.get(M),W=!0;for(let q=k;q<l;q++){const U=q,G=t.charCodeAt(q);let H,z;if(Ec(G)?(q++,H=0,z=2):(H=n.get(G),z=y6(G,V,i,s)),U>v&&Lbe(M,B,G,H,c)&&(L=U,N=V),V+=z,V>y){U>v?(P=U,O=V-z):(P=q+1,O=V),V-N>p&&(L=0),W=!1;break}M=G,B=H}if(W){_>0&&(g[_]=u[u.length-1],m[_]=d[u.length-1],_++);break}}if(L===0){let V=I,M=t.charCodeAt(k),B=n.get(M),W=!1;for(let q=k-1;q>=v;q--){const U=q+1,G=t.charCodeAt(q);if(G===9){W=!0;break}let H,z;if(FL(G)?(q--,H=0,z=2):(H=n.get(G),z=YE(G)?s:1),V<=y){if(P===0&&(P=U,O=V),V<=y-p)break;if(Lbe(G,H,M,B,c)){L=U,N=V;break}}V-=z,M=G,B=H}if(L!==0){const q=p-(O-N);if(q<=i){const U=t.charCodeAt(P);let G;Ec(U)?G=2:G=y6(U,O,i,s),q-G<0&&(L=0)}}if(W){S--;continue}}if(L===0&&(L=P,N=O),L<=v){const V=t.charCodeAt(v);Ec(V)?(L=v+2,N=b+2):(L=v+1,N=b+y6(V,b,i,s))}for(v=L,g[_]=L,b=N,m[_]=N,_++,y=N+p;S<0||S<C&&d[S]<N;)S++;let F=Math.abs(d[S]-y);for(;S+1<C;){const V=Math.abs(d[S+1]-y);if(V>=F)break;F=V,S++}}return _===0?null:(g.length=_,m.length=_,Tbe=e.breakOffsets,Ibe=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=f,e)}function vxr(n,e,t,i,r,s,o,a){const l=Hb.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(N=>N.options),u=t.map(N=>N.column-1)):(c=null,u=null),r===-1)return c?new b6(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new b6(u,c,[l.length],[],0):null;const f=a==="keepAll",p=ndt(l,i,r,s,o),g=r-p,m=[],_=[];let v=0,b=0,y=0,C=r,S=l.charCodeAt(0),k=n.get(S),I=y6(S,0,i,s),L=1;Ec(S)&&(I+=1,S=l.charCodeAt(1),k=n.get(S),L++);for(let N=L;N<d;N++){const P=N,O=l.charCodeAt(N);let F,V;Ec(O)?(N++,F=0,V=2):(F=n.get(O),V=y6(O,I,i,s)),Lbe(S,k,O,F,f)&&(b=P,y=I),I+=V,I>C&&((b===0||I-y>g)&&(b=P,y=I-V),m[v]=b,_[v]=y,v++,C=y+g,b=0),S=O,k=F}return v===0&&(!t||t.length===0)?null:(m[v]=d,_[v]=I,new b6(u,c,m,_,p))}function y6(n,e,t,i){return n===9?t-e%t:YE(n)||n<32?i:1}function H9e(n,e){return e-n%e}function Lbe(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 ndt(n,e,t,i,r){let s=0;if(r!==0){const o=Yd(n);if(o!==-1){for(let l=0;l<o;l++){const c=n.charCodeAt(l)===9?H9e(s,e):1;s+=c}const a=r===3?2:r===2?1:0;for(let l=0;l<a;l++){const c=H9e(s,e);s+=c}s+i>t&&(s=0)}}return s}class hY{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new cu(new ie(1,1,1,1),0,0,new We(1,1),0),new cu(new ie(1,1,1,1),0,0,new We(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 vs(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Yn.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Yn.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(),s=t.selectionStart.getEndPosition(),o=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,r,i,o),l=this._validatePositionWithCache(e,s,r,a);return i.equals(o)&&r.equals(a)&&s.equals(l)?t:new cu(ie.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+r.column-a.column,o,t.leftoverVisibleColumns+i.column-o.column)}_setState(e,t,i){if(i&&(i=hY._validateViewState(e.viewModel,i)),t){const r=e.model.validateRange(t.selectionStart),s=t.selectionStart.equalsRange(r)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),a=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new cu(r,t.selectionStartKind,s,o,a)}else{if(!i)return;const r=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),s=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new cu(r,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,s,i.leftoverVisibleColumns)}if(i){const r=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),s=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new cu(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}else{const r=e.coordinatesConverter.convertModelPositionToViewPosition(new We(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),s=e.coordinatesConverter.convertModelPositionToViewPosition(new We(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),o=new ie(r.lineNumber,r.column,s.lineNumber,s.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new cu(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class V9e{constructor(e){this.context=e,this.cursors=[new hY(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 Aur(this.cursors,kh(e=>e.viewState.position,We.compare)).viewState.position}getBottomMostViewPosition(){return Lur(this.cursors,kh(e=>e.viewState.position,We.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(vs.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 s=0;s<r;s++)this._addSecondaryCursor()}else if(t>i){const r=t-i;for(let s=0;s<r;s++)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 hY(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(kh(i=>i.selection,ie.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const r=t[i],s=t[i+1],o=r.selection,a=s.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let l;if(a.isEmpty()||o.isEmpty()?l=a.getStartPosition().isBeforeOrEqual(o.getEndPosition()):l=a.getStartPosition().isBefore(o.getEndPosition()),l){const c=r.index<s.index?i:i+1,u=r.index<s.index?i+1:i,d=t[u].index,f=t[c].index,p=t[u].selection,g=t[c].selection;if(!p.equalsSelection(g)){const m=p.plusRange(g),_=p.selectionStartLineNumber===p.startLineNumber&&p.selectionStartColumn===p.startColumn,v=g.selectionStartLineNumber===g.startLineNumber&&g.selectionStartColumn===g.startColumn;let b;d===this.lastAddedCursorIndex?(b=_,this.lastAddedCursorIndex=f):b=v;let y;b?y=new Yn(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn):y=new Yn(m.endLineNumber,m.endColumn,m.startLineNumber,m.startColumn),t[c].selection=y;const C=vs.fromModelSelection(y);e[f].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 W9e{constructor(e,t,i,r){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=r}}class bxr{constructor(){this.type=0}}class yxr{constructor(){this.type=1}}class Cxr{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class wxr{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class WT{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class AW{constructor(){this.type=5}}class xxr{constructor(e){this.type=6,this.isFocused=e}}class Sxr{constructor(){this.type=7}}class NW{constructor(){this.type=8}}class idt{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class Abe{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Nbe{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class C6{constructor(e,t,i,r,s,o,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=r,this.verticalType=s,this.revealHorizontal=o,this.scrollType=a,this.type=12}}class Exr{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 kxr{constructor(e){this.theme=e,this.type=14}}class Txr{constructor(e){this.type=15,this.ranges=e}}class Ixr{constructor(){this.type=16}}let Lxr=class{constructor(){this.type=17}};class Axr extends Ye{constructor(){super(),this._onEvent=this._register(new Ue),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 Nxr),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 Nxr{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class b2e{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 b2e(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class y2e{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 y2e(this.oldHasFocus,e.hasFocus)}}class C2e{constructor(e,t,i,r,s,o,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=r,this.scrollWidth=s,this.scrollLeft=o,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 C2e(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Dxr{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Rxr{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class fY{constructor(e,t,i,r,s,o,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=r,this.source=s,this.reason=o,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 s=0;s<i;s++)if(!e[s].equalsSelection(t[s]))return!1;return!0}isNoOp(){return fY._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new fY(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class Pxr{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Oxr{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}}class Mxr{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class jxr{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class Fxr{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class Bxr{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class $xr{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class Hxr extends Ye{constructor(e,t,i,r){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new W9e(this._model,this._viewModel,this._coordinatesConverter,r),this._cursors=new V9e(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=vo(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new W9e(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 s=!1;const o=this.context.cursorConfig.multiCursorLimit;r!==null&&r.length>o&&(r=r.slice(0,o),s=!0);const a=w6.from(this._model,this);return this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,s)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,r,s,o){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=ie.fromPositions(a[0],a[0]),e.emitViewEvent(new C6(t,i,l,c,r,s,o))}revealPrimary(e,t,i,r,s,o){const l=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new C6(t,i,null,l,r,s,o))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,r=t.length;i<r;i++){const s=t[i];e.push({inSelectionMode:!s.isEmpty(),selectionStart:{lineNumber:s.selectionStartLineNumber,column:s.selectionStartColumn},position:{lineNumber:s.positionLineNumber,column:s.positionColumn}})}return e}restoreState(e,t){const i=[];for(let r=0,s=t.length;r<s;r++){const o=t[r];let a=1,l=1;o.position&&o.position.lineNumber&&(a=o.position.lineNumber),o.position&&o.position.column&&(l=o.position.column);let c=a,u=l;o.selectionStart&&o.selectionStart.lineNumber&&(c=o.selectionStart.lineNumber),o.selectionStart&&o.selectionStart.column&&(u=o.selectionStart.column),i.push({selectionStartLineNumber:c,selectionStartColumn:u,positionLineNumber:a,positionColumn:l})}this.setStates(e,"restoreState",0,vs.fromModelSelections(i)),this.revealAll(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof Bct){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 V9e(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const s=vs.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,s)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{const s=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,vs.fromModelSelections(s))}}}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,vs.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 s=this._model.deltaDecorations([],i),o=this._model.deltaDecorations([],r);this._autoClosedActions.push(new z9e(this._model,s,o))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=Vxr.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const i=[],r=[];for(let s=0;s<e.commands.length;s++){const o=e.commands[s];o instanceof f2e&&o.enclosingRange&&o.closeCharacterRange&&(i.push(o.closeCharacterRange),r.push(o.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,s){const o=w6.from(this._model,this);if(o.equals(r))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new wxr(l,a,i)),!r||r.cursorState.length!==o.cursorState.length||o.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 fY(c,a,u,o.modelVersionId,t||"keyboard",i,s))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,r=e.length;i<r;i++){const s=e[i];if(!s.text||s.text.indexOf(` `)>=0)return null;const o=s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const a=o[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,u=s.text.length-o[2].length-1,d=s.text.lastIndexOf(c,u-1);if(d===-1)return null;t.push([d,u])}return t}executeEdits(e,t,i,r){let s=null;t==="snippet"&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const o=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(s)for(let d=0,f=s.length;d<f;d++){const[p,g]=s[d],m=c[d],_=m.range.startLineNumber,v=m.range.startColumn-1+p,b=m.range.startColumn-1+g;o.push(new ie(_,b+1,_,b+2)),a.push(new ie(_,v+1,_,b+2))}const u=r(c);return u&&(this._isHandling=!0),u});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),o.length>0&&this._pushAutoClosedAction(o,a)}_executeEdit(e,t,i,r=0){if(this.context.cursorConfig.readOnly)return;const s=w6.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(o){tr(o)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,r,s,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return z9e.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new x6(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(TS.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 s=0;for(;s<r;){const o=_ke(t,s),a=t.substr(s,o);this._executeEditOperation(TS.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),s+=o}}else this._executeEditOperation(TS.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,r,s,o){if(t.length===0&&i===0&&r===0){if(s!==0){const a=this.getSelections().map(l=>{const c=l.getPosition();return new Yn(c.lineNumber,c.column+s,c.lineNumber,c.column+s)});this.setSelections(e,o,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(TS.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,r,s))},e,o)}paste(e,t,i,r,s){this._executeEdit(()=>{this._executeEditOperation(TS.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,r||[]))},e,s,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(XL.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new hf(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new hf(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class w6{static from(e,t){return new w6(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 z9e{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(ie.compareRangesUsingStarts),e.sort(ie.compareRangesUsingStarts);for(let i=0;i<e.length;i++)if(i>=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class Vxr{static executeCommands(e,t,i){const r={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},s=this._innerExecuteCommands(r,i);for(let o=0,a=r.trackedRanges.length;o<a;o++)r.model._setTrackedRange(r.trackedRanges[o],null,0);return s}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,s=this._getLoserCursorMap(r);if(s.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const o=[];for(let c=0,u=r.length;c<u;c++)s.hasOwnProperty(r[c].identifier.major.toString())||o.push(r[c]);i.hadTrackedEditOperation&&o.length>0&&(o[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,o,c=>{const u=[];for(let p=0;p<e.selectionsBefore.length;p++)u[p]=[];for(const p of c)p.identifier&&u[p.identifier.major].push(p);const d=(p,g)=>p.identifier.minor-g.identifier.minor,f=[];for(let p=0;p<e.selectionsBefore.length;p++)u[p].length>0?(u[p].sort(d),f[p]=t[p].computeCursorState(e.model,{getInverseEditOperations:()=>u[p],getTrackedSelection:g=>{const m=parseInt(g,10),_=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new Yn(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new Yn(_.endLineNumber,_.endColumn,_.startLineNumber,_.startColumn)}})):f[p]=e.selectionsBefore[p];return f});a||(a=e.selectionsBefore);const l=[];for(const c in s)s.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 s=0,o=t.length;s<o;s++){const a=t[s];if(a){const l=this._getEditOperationsFromCommand(e,s,a);i=i.concat(l.operations),r=r||l.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:r}}static _getEditOperationsFromCommand(e,t,i){const r=[];let s=0;const o=(d,f,p=!1)=>{ie.isEmpty(d)&&f===""||r.push({identifier:{major:t,minor:s++},range:d,text:f,forceMoveMarkers:p,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:o,addTrackedEditOperation:(d,f,p)=>{a=!0,o(d,f,p)},trackSelection:(d,f)=>{const p=Yn.liftSelection(d);let g;if(p.isEmpty())if(typeof f=="boolean")f?g=2:g=3;else{const v=e.model.getLineMaxColumn(p.startLineNumber);p.startColumn===v?g=2:g=3}else g=1;const m=e.trackedRanges.length,_=e.model._setTrackedRange(null,p,g);return e.trackedRanges[m]=_,e.trackedRangesDirection[m]=p.getDirection(),m.toString()}};try{i.getEditOperations(e.model,u)}catch(d){return tr(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:r,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,r)=>-ie.compareRangesUsingEnds(i.range,r.range));const t={};for(let i=1;i<e.length;i++){const r=e[i-1],s=e[i];if(ie.getStartPosition(r.range).isBefore(ie.getEndPosition(s.range))){let o;r.identifier.major>s.identifier.major?o=r.identifier.major:o=s.identifier.major,t[o.toString()]=!0;for(let a=0;a<e.length;a++)e[a].identifier.major===o&&(e.splice(a,1),a<i&&i--,a--);i>0&&i--}}return t}}class Wxr{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class x6{static _capture(e,t){const i=[];for(const r of t){if(r.startLineNumber!==r.endLineNumber)return null;i.push(new Wxr(e.getLineContent(r.startLineNumber),r.startColumn-1,r.endColumn-1))}return i}constructor(e,t){this._original=x6._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=x6._capture(e,t);if(!i||this._original.length!==i.length)return null;const r=[];for(let s=0,o=this._original.length;s<o;s++)r.push(x6._deduceOutcome(this._original[s],i[s]));return r}static _deduceOutcome(e,t){const i=Math.min(e.startSelection,t.startSelection,GE(e.text,t.text)),r=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,FK(e.text,t.text)),s=e.text.substring(i,e.text.length-r),o=t.text.substring(i,t.text.length-r);return new _wr(s,e.startSelection-i,e.endSelection-i,o,t.startSelection-i,t.endSelection-i)}}class zxr{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 Uxr{constructor(e,t,i,r,s){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=r,this.minWidth=s,this.prefixSum=0}}var gE;let qxr=(gE=class{constructor(e,t,i,r){this._instanceId=Lot(++gE.INSTANCE_COUNT),this._pendingChanges=new zxr,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,s=e.length;for(;r<s;){const o=r+s>>>1;t===e[o].afterLineNumber?i<e[o].ordinal?s=o:r=o+1:t<e[o].afterLineNumber?s=o:r=o+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,s,o,a)=>{t=!0,r=r|0,s=s|0,o=o|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Uxr(l,r,s,o,a)),l},changeOneWhitespace:(r,s,o)=>{t=!0,s=s|0,o=o|0,this._pendingChanges.change({id:r,newAfterLineNumber:s,newHeight:o})},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 s=new Map;for(const l of t)s.set(l.id,l);const o=l=>{const c=[];for(const u of l)if(!r.has(u.id)){if(s.has(u.id)){const d=s.get(u.id);u.afterLineNumber=d.newAfterLineNumber,u.height=d.newHeight}c.push(u)}return c},a=o(this._arr).concat(o(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=gE.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 s=this._arr[r];this._removeWhitespace(r),s.afterLineNumber=t,this._insertWhitespace(s)}}_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 s=this._arr[i].afterLineNumber;e<=s&&s<=t?this._arr[i].afterLineNumber=e-1:s>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 s=this._arr[i].afterLineNumber;e<=s&&(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 o=(r-i|0)/2|0,a=i+o|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,s=t;for(;r<s;){const o=(r+s)/2|0,a=this.getVerticalOffsetForLineNumber(o)|0;if(e>=a+i)r=o+1;else{if(e>=a)return o;s=o}}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,s=this.getVerticalOffsetForLineNumber(r)|0;let o=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(r)|0;const l=this.getWhitespacesCount()|0;let c,u;a===-1?(a=l,u=o+1,c=0):(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let d=s,f=d;const p=5e5;let g=0;s>=p&&(g=Math.floor(s/p)*p,g=Math.floor(g/i)*i,f-=g);const m=[],_=e+(t-e)/2;let v=-1;for(let S=r;S<=o;S++){if(v===-1){const k=d,I=d+i;(k<=_&&_<I||k>_)&&(v=S)}for(d+=i,m[S-r]=f,f+=i;u===S;)f+=c,d+=c,a++,a>=l?u=o+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){o=S;break}}v===-1&&(v=o);const b=this.getVerticalOffsetForLineNumber(o)|0;let y=r,C=o;return y<C&&s<e&&y++,y<C&&b+i>t&&C--,{bigNumbersDelta:g,startLineNumber:r,endLineNumber:o,relativeVerticalOffset:m,centeredLineNumber:v,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:C,lineHeight:this._lineHeight}}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),s=this.getHeightForWhitespaceIndex(i);if(e>=r+s)return-1;for(;t<i;){const o=Math.floor((t+i)/2),a=this.getVerticalOffsetForWhitespaceIndex(o),l=this.getHeightForWhitespaceIndex(o);if(e>=a+l)t=o+1;else{if(e>=a)return o;i=o}}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),s=this.getIdForWhitespaceIndex(t),o=this.getAfterLineNumberForWhitespaceIndex(t);return{id:s,afterLineNumber:o,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 s=[];for(let o=i;o<=r;o++){const a=this.getVerticalOffsetForWhitespaceIndex(o),l=this.getHeightForWhitespaceIndex(o);if(a>=t)break;s.push({id:this.getIdForWhitespaceIndex(o),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(o),verticalOffset:a,height:l})}return s}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}},gE.INSTANCE_COUNT=0,gE);const Kxr=125;class rF{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 Gxr extends Ye{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new Ue),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new rF(0,0,0,0),this._scrollable=this._register(new G4({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 b2e(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 Yxr extends Ye{constructor(e,t,i){super(),this._configuration=e;const r=this._configuration.options,s=r.get(146),o=r.get(84);this._linesLayout=new qxr(t,r.get(67),o.top,o.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new Gxr(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new rF(s.contentWidth,0,s.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(115)?Kxr:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){const i=t.get(84);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(146)){const i=t.get(146),r=i.contentWidth,s=i.height,o=this._scrollable.getScrollDimensions(),a=o.contentWidth;this._scrollable.setScrollDimensions(new rF(r,o.contentWidth,s,this._getContentHeight(r,s,a)))}else this._updateHeight();e.hasChanged(115)&&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(104);return r.horizontal===2||e>=t?0:r.horizontalScrollbarSize}_getContentHeight(e,t,i){const r=this._configuration.options;let s=this._linesLayout.getLinesTotalHeight();return r.get(106)?s+=Math.max(0,t-r.get(67)-r.get(84).bottom):r.get(104).ignoreHorizontalScrollbarInContentHeight||(s+=this._getHorizontalScrollbarHeight(e,i)),s}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,r=e.contentWidth;this._scrollable.setScrollDimensions(new rF(t,e.contentWidth,i,this._getContentHeight(t,i,r)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new g9e(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new g9e(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(147),r=e.get(50),s=e.get(146);if(i.isViewportWrapping){const o=e.get(73);return t>s.contentWidth+r.typicalHalfwidthCharacterWidth&&o.enabled&&o.side==="right"?t+s.verticalScrollbarWidth:t}else{const o=e.get(105)*r.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+o+s.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 rF(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 Qxr{constructor(e,t,i,r,s){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=r,this._coordinatesConverter=s,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,s=e.options;let o;if(s.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new We(r.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new We(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)),1);o=new ie(a.lineNumber,a.column,l.lineNumber,l.column)}else o=this._coordinatesConverter.convertModelRangeToViewRange(r,1);i=new Out(o,s),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 ie(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,AK(this.configuration.options),t,i),s=e.startLineNumber,o=e.endLineNumber,a=[];let l=0;const c=[];for(let u=s;u<=o;u++)c[u-s]=[];for(let u=0,d=r.length;u<d;u++){const f=r[u],p=f.options;if(!w2e(this.model,f))continue;const g=this._getOrCreateViewModelDecoration(f),m=g.range;if(a[l++]=g,p.inlineClassName){const _=new p6(m,p.inlineClassName,p.inlineClassNameAffectsLetterSpacing?3:0),v=Math.max(s,m.startLineNumber),b=Math.min(o,m.endLineNumber);for(let y=v;y<=b;y++)c[y-s].push(_)}if(p.beforeContentClassName&&s<=m.startLineNumber&&m.startLineNumber<=o){const _=new p6(new ie(m.startLineNumber,m.startColumn,m.startLineNumber,m.startColumn),p.beforeContentClassName,1);c[m.startLineNumber-s].push(_)}if(p.afterContentClassName&&s<=m.endLineNumber&&m.endLineNumber<=o){const _=new p6(new ie(m.endLineNumber,m.endColumn,m.endLineNumber,m.endColumn),p.afterContentClassName,2);c[m.endLineNumber-s].push(_)}}return{decorations:a,inlineDecorations:c}}}function w2e(n,e){return!(e.options.hideInCommentTokens&&x2e(n,e)||e.options.hideInStringTokens&&S2e(n,e))}function x2e(n,e){return rdt(n,e.range,t=>t===1)}function S2e(n,e){return rdt(n,e.range,t=>t===2)}function rdt(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const r=n.tokenization.getLineTokens(i),s=i===e.startLineNumber,o=i===e.endLineNumber;let a=s?r.findTokenIndexAtOffset(e.startColumn-1):0;for(;a<r.getCount()&&!(o&&r.getStartOffset(a)>e.endColumn-1);){if(!t(r.getStandardTokenType(a)))return!1;a++}}return!0}function Iue(n,e){return n===null?e?pY.INSTANCE:gY.INSTANCE:new Xxr(n,e)}class Xxr{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,s=this._projectionData.breakOffsets[i];let o;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,u)=>new Hb(0,0,c+1,this._projectionData.injectionOptions[u],0));o=Hb.applyInjectedText(e.getLineContent(t),a).substring(r,s)}else o=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:s+1});return i>0&&(o=U9e(this._projectionData.wrappedTextIndentLength)+o),o}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,s,o,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,u=l.injectionOptions;let d=null;if(c){d=[];let p=0,g=0;for(let m=0;m<l.getOutputLineCount();m++){const _=new Array;d[m]=_;const v=m>0?l.breakOffsets[m-1]:0,b=l.breakOffsets[m];for(;g<c.length;){const y=u[g].content.length,C=c[g]+p,S=C+y;if(C>b)break;if(v<S){const k=u[g];if(k.inlineClassName){const I=m>0?l.wrappedTextIndentLength:0,L=I+Math.max(C-v,0),N=I+Math.min(S-v,b-v);L!==N&&_.push(new U1r(L,N,k.inlineClassName,k.inlineClassNameAffectsLetterSpacing))}}if(S<=b)p+=y,g++;else break}}}let f;c?f=e.tokenization.getLineTokens(t).withInserted(c.map((p,g)=>({offset:p,text:u[g].content,tokenMetadata:Xc.defaultTokenMetadata}))):f=e.tokenization.getLineTokens(t);for(let p=i;p<i+r;p++){const g=s+p-i;if(!o[g]){a[g]=null;continue}a[g]=this._getViewLineData(f,d?d[p]:null,p)}}_getViewLineData(e,t,i){this._assertVisible();const r=this._projectionData,s=i>0?r.wrappedTextIndentLength:0,o=i>0?r.breakOffsets[i-1]:0,a=r.breakOffsets[i],l=e.sliceAndInflate(o,a,s);let c=l.getLineContent();i>0&&(c=U9e(r.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(i)+1,d=c.length+1,f=i+1<this.getViewLineCount(),p=i===0?0:r.breakOffsetsVisibleColumn[i-1];return new i2e(c,f,u,d,p,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")}}const fX=class fX{constructor(){}isVisible(){return!0}setVisible(e){return e?this:gY.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),s=r.getLineContent();return new i2e(s,!1,1,s.length+1,0,r.inflate(),null)}getViewLinesData(e,t,i,r,s,o,a){if(!o[s]){a[s]=null;return}a[s]=this.getViewLineData(e,t,0)}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new We(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}};fX.INSTANCE=new fX;let pY=fX;const pX=class pX{constructor(){}isVisible(){return!1}setVisible(e){return e?pY.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,s,o,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")}};pX.INSTANCE=new pX;let gY=pX;const Lue=[""];function U9e(n){if(n>=Lue.length)for(let e=1;e<=n;e++)Lue[e]=Zxr(e);return Lue[n]}function Zxr(n){return new Array(n+1).join(" ")}class Jxr{constructor(e,t,i,r,s,o,a,l,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=r,this.fontInfo=s,this.tabSize=o,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 tSr(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),s=i.length,o=this.createLineBreaksComputer(),a=new Lw(Hb.fromDecorations(r));for(let m=0;m<s;m++){const _=a.takeWhile(v=>v.lineNumber===m+1);o.addRequest(i[m],_,t?t[m]:null)}const l=o.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(ie.compareRangesUsingStarts);let d=1,f=0,p=-1,g=p+1<u.length?f+1:s+2;for(let m=0;m<s;m++){const _=m+1;_===g&&(p++,d=u[p].startLineNumber,f=u[p].endLineNumber,g=p+1<u.length?f+1:s+2);const v=_>=d&&_<=f,b=Iue(l[m],!v);c[m]=b.getViewLineCount(),this.modelLineProjections[m]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new pdr(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(f=>this.model.validateRange(f)),i=eSr(t),r=this.hiddenAreasDecorationIds.map(f=>this.model.getDecorationRange(f)).sort(ie.compareRangesUsingStarts);if(i.length===r.length){let f=!1;for(let p=0;p<i.length;p++)if(!i[p].equalsRange(r[p])){f=!0;break}if(!f)return!1}const s=i.map(f=>({range:f,options:ur.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,s);const o=i;let a=1,l=0,c=-1,u=c+1<o.length?l+1:this.modelLineProjections.length+2,d=!1;for(let f=0;f<this.modelLineProjections.length;f++){const p=f+1;p===u&&(c++,a=o[c].startLineNumber,l=o[c].endLineNumber,u=c+1<o.length?l+1:this.modelLineProjections.length+2);let g=!1;if(p>=a&&p<=l?this.modelLineProjections[f].isVisible()&&(this.modelLineProjections[f]=this.modelLineProjections[f].setVisible(!1),g=!0):(d=!0,this.modelLineProjections[f].isVisible()||(this.modelLineProjections[f]=this.modelLineProjections[f].setVisible(!0),g=!0)),g){const m=this.modelLineProjections[f].getViewLineCount();this.projectedModelLineLineCounts.setValue(f,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,s){const o=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===r,u=this.wordBreak===s;if(o&&a&&l&&c&&u)return!1;const d=o&&a&&!l&&c&&u;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=r,this.wordBreak=s;let f=null;if(d){f=[];for(let p=0,g=this.modelLineProjections.length;p<g;p++)f[p]=this.modelLineProjections[p].getProjectionData()}return this._constructLines(!1,f),!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,s=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new Abe(r,s)}onModelLinesInserted(e,t,i,r){if(!e||e<=this._validModelVersionId)return null;const s=t>2&&!this.modelLineProjections[t-2].isVisible(),o=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 f=Iue(r[u],!s);l.push(f);const p=f.getViewLineCount();a+=p,c[u]=p}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(l).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,c),new Nbe(o,o+a-1)}onModelLineChanged(e,t,i){if(e!==null&&e<=this._validModelVersionId)return[!1,null,null,null];const r=t-1,s=this.modelLineProjections[r].getViewLineCount(),o=this.modelLineProjections[r].isVisible(),a=Iue(i,o);this.modelLineProjections[r]=a;const l=this.modelLineProjections[r].getViewLineCount();let c=!1,u=0,d=-1,f=0,p=-1,g=0,m=-1;s>l?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,g=d+1,m=g+(s-l)-1,c=!0):s<l?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+s-1,f=d+1,p=f+(l-s)-1,c=!0):(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1),this.projectedModelLineLineCounts.setValue(r,l);const _=u<=d?new idt(u,d-u+1):null,v=f<=p?new Nbe(f,p):null,b=g<=m?new Abe(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)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),o=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(r.lineNumber,s.lineNumber,o.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 q9e(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 We(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 We(e.modelLineNumber,r)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),r=this.getViewLineInfo(t),s=new Array;let o=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 f=u;f<d;f++)a.push(new q9e(l,f))}if(!c.isVisible()&&o){const u=new We(l-1,this.model.getLineMaxColumn(l-1)+1),d=ie.fromPositions(o,u);s.push(new K9e(d,a)),a=[],o=null}else c.isVisible()&&!o&&(o=new We(l,1))}if(o){const l=ie.fromPositions(o,this.getModelEndPositionOfViewLine(r));s.push(new K9e(l,a))}return s}getViewLinesBracketGuides(e,t,i,r){const s=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,o=[];for(const a of this.getViewLineInfosGroupedByModelRanges(e,t)){const l=a.modelRange.startLineNumber,c=this.model.guides.getLinesBracketGuides(l,a.modelRange.endLineNumber,s,r);for(const u of a.viewLines){const f=c[u.modelLineNumber-l].map(p=>{if(p.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,p.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||p.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,p.forWrappedLinesBeforeOrAtColumn).lineNumber<u.modelLineWrappedLineIdx)return;if(!p.horizontalLine)return p;let g=-1;if(p.column!==-1){const v=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,p.column);if(v.lineNumber===u.modelLineWrappedLineIdx)g=v.column;else if(v.lineNumber<u.modelLineWrappedLineIdx)g=this.getMinColumnOfViewLine(u);else if(v.lineNumber>u.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(u.modelLineNumber,p.horizontalLine.endColumn),_=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,p.horizontalLine.endColumn);return _.lineNumber===u.modelLineWrappedLineIdx?new G2(p.visibleColumn,g,p.className,new s6(p.horizontalLine.top,m.column),-1,-1):_.lineNumber<u.modelLineWrappedLineIdx||p.visibleColumn!==-1?void 0:new G2(p.visibleColumn,g,p.className,new s6(p.horizontalLine.top,this.getMaxColumnOfViewLine(u)),-1,-1)});o.push(f.filter(p=>!!p))}}return o}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 s=[];const o=[],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 _=m.getViewLineNumberOfModelPosition(0,g===l?i.column:1),v=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),b=v-_+1;let y=0;b>1&&m.getViewLineMinColumn(this.model,g+1,v)===1&&(y=_===0?1:2),o.push(b),a.push(y),u===null&&(u=new We(g+1,0))}else u!==null&&(s=s.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,g)),u=null)}u!==null&&(s=s.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,r.lineNumber)),u=null);const d=t-e+1,f=new Array(d);let p=0;for(let g=0,m=s.length;g<m;g++){let _=s[g];const v=Math.min(d-p,o[g]),b=a[g];let y;b===2?y=0:b===1?y=1:y=v;for(let C=0;C<v;C++)C===y&&(_=0),f[p++]=_}return f}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 s=e;const o=r.index,a=r.remainder,l=[];for(let c=o,u=this.model.getLineCount();c<u;c++){const d=this.modelLineProjections[c];if(!d.isVisible())continue;const f=c===o?a:0;let p=d.getViewLineCount()-f,g=!1;if(s+p>t&&(g=!0,p=t-s+1),d.getViewLinesData(this.model,c+1,f,p,s-e,i,l),s+=p,g)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const r=this.projectedModelLineLineCounts.getIndexOf(e-1),s=r.index,o=r.remainder,a=this.modelLineProjections[s],l=a.getViewLineMinColumn(this.model,s+1,o),c=a.getViewLineMaxColumn(this.model,s+1,o);t<l&&(t=l),t>c&&(t=c);const u=a.getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new We(s+1,u)).equals(i)?new We(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 ie(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 We(i.modelLineNumber,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new ie(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,r=!1,s=!1){const o=this.model.validatePosition(new We(e,t)),a=o.lineNumber,l=o.column;let c=a-1,u=!1;if(s)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 We(r?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(c);let f;return u?s?f=this.modelLineProjections[c].getViewPositionOfModelPosition(d,1,i):f=this.modelLineProjections[c].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(c+1),i):f=this.modelLineProjections[a-1].getViewPositionOfModelPosition(d,l,i),f}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return ie.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),r=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new ie(i.lineNumber,i.column,r.lineNumber,r.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,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,s){const o=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-o.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new ie(o.lineNumber,1,a.lineNumber,a.column),t,i,r,s);let l=[];const c=o.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 We(m+1,m===c?o.column:1));else if(d!==null){const v=this.model.getLineMaxColumn(m);l=l.concat(this.model.getDecorationsInRange(new ie(d.lineNumber,d.column,m,v),t,i,r)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new ie(d.lineNumber,d.column,a.lineNumber,a.column),t,i,r)),d=null),l.sort((m,_)=>{const v=ie.compareRangesUsingStarts(m.range,_.range);return v===0?m.id<_.id?-1:m.id>_.id?1:0:v});const f=[];let p=0,g=null;for(const m of l){const _=m.id;g!==_&&(g=_,f[p++]=m)}return f}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 eSr(n){if(n.length===0)return[];const e=n.slice();e.sort(ie.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,r=e[0].endLineNumber;for(let s=1,o=e.length;s<o;s++){const a=e[s];a.startLineNumber>r+1?(t.push(new ie(i,1,r,1)),i=a.startLineNumber,r=a.endLineNumber):a.endLineNumber>r&&(r=a.endLineNumber)}return t.push(new ie(i,1,r,1)),t}class q9e{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class K9e{constructor(e,t){this.modelRange=e,this.viewLines=t}}class tSr{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 nSr{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new iSr(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 Abe(t,i)}onModelLinesInserted(e,t,i,r){return new Nbe(t,i)}onModelLineChanged(e,t,i){return[!1,new idt(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 s=0;s<i;s++)r[s]=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 i2e(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 s=[];for(let o=e;o<=t;o++){const a=o-e;s[a]=i[a]?this.getViewLineData(o):null}return s}getDecorationsInRange(e,t,i,r,s){return this.model.getDecorationsInRange(e,t,i,r,s)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class iSr{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}}const zT=ov.Right;class rSr{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*zT/8))}reset(e){const t=Math.ceil((e+1)*zT/8);this.lanes.length<t?this.lanes=new Uint8Array(t):this.lanes.fill(0),this._requiredLanes=1}get requiredLanes(){return this._requiredLanes}push(e,t,i){i&&(this.persist|=1<<e-1);for(let r=t.startLineNumber;r<=t.endLineNumber;r++){const s=zT*r+(e-1);this.lanes[s>>>3]|=1<<s%8,this._requiredLanes=Math.max(this._requiredLanes,this.countAtLine(r))}}getLanesAtLine(e){const t=[];let i=zT*e;for(let r=0;r<zT;r++)(this.persist&1<<r||this.lanes[i>>>3]&1<<i%8)&&t.push(r+1),i++;return t.length?t:[ov.Center]}countAtLine(e){let t=zT*e,i=0;for(let r=0;r<zT;r++)(this.persist&1<<r||this.lanes[t>>>3]&1<<t%8)&&i++,t++;return i}}let sSr=class extends Ye{constructor(e,t,i,r,s,o,a,l,c,u){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this._transactionalTarget=u,this.hiddenAreasModel=new aSr,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new Axr,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new jD(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new ao(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=E2e.create(this.model),this.glyphLanes=new rSr(0),this.model.isTooLargeForTokenization())this._lines=new nSr(this.model);else{const d=this._configuration.options,f=d.get(50),p=d.get(140),g=d.get(147),m=d.get(139),_=d.get(130);this._lines=new Jxr(this._editorId,this.model,r,s,f,this.model.getOptions().tabSize,p,g.wrappingColumn,m,_)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Hxr(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Yxr(this._configuration,this.getLineCount(),o)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Exr(d)),this._eventDispatcher.emitOutgoingEvent(new C2e(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new Qxr(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const f=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(f,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(uY.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Ixr)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new kxr(d))})),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 ie(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 xxr(e)),this._eventDispatcher.emitOutgoingEvent(new y2e(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new bxr)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new yxr)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new We(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new Y9e(t,this._viewportStart.startLineDelta)}return new Y9e(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),r=this._configuration.options,s=r.get(50),o=r.get(140),a=r.get(147),l=r.get(139),c=r.get(130);this._lines.setWrappingSettings(s,o,a.wrappingColumn,l,c)&&(e.emitViewEvent(new AW),e.emitViewEvent(new NW),e.emitViewEvent(new WT(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(92)&&(this._decorations.reset(),e.emitViewEvent(new WT(null))),t.hasChanged(99)&&(this._decorations.reset(),e.emitViewEvent(new WT(null))),e.emitViewEvent(new Cxr(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),jD.shouldRecreate(t)&&(this.cursorConfig=new jD(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,s=!1;const o=e instanceof pI?e.rawContentChangedEvent.changes:e.changes,a=e instanceof pI?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const d of o)switch(d.changeType){case 4:{for(let f=0;f<d.detail.length;f++){const p=d.detail[f];let g=d.injectedTexts[f];g&&(g=g.filter(m=>!m.ownerId||m.ownerId===this._editorId)),l.addRequest(p,g,null)}break}case 2:{let f=null;d.injectedText&&(f=d.injectedText.filter(p=>!p.ownerId||p.ownerId===this._editorId)),l.addRequest(d.detail,f,null);break}}const c=l.finalize(),u=new Lw(c);for(const d of o)switch(d.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new AW),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),r=!0;break}case 3:{const f=this._lines.onModelLinesDeleted(a,d.fromLineNumber,d.toLineNumber);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesDeleted(f.fromLineNumber,f.toLineNumber)),r=!0;break}case 4:{const f=u.takeCount(d.detail.length),p=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,f);p!==null&&(i.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),r=!0;break}case 2:{const f=u.dequeue(),[p,g,m,_]=this._lines.onModelLineChanged(a,d.lineNumber,f);s=p,g&&i.emitViewEvent(g),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),_&&(i.emitViewEvent(_),this.viewLayout.onLinesDeleted(_.fromLineNumber,_.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!r&&s&&(i.emitViewEvent(new NW),i.emitViewEvent(new WT(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()),s=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber);this.viewLayout.setScrollPosition({scrollTop:s+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof pI&&i.emitOutgoingEvent(new Fxr(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 s=e.ranges[i],o=this.coordinatesConverter.convertModelPositionToViewPosition(new We(s.fromLineNumber,1)).lineNumber,a=this.coordinatesConverter.convertModelPositionToViewPosition(new We(s.toLineNumber,this.model.getLineMaxColumn(s.toLineNumber))).lineNumber;t[i]={fromLineNumber:o,toLineNumber:a}}this._eventDispatcher.emitSingleViewEvent(new Txr(t)),this._eventDispatcher.emitOutgoingEvent(new $xr(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new Sxr),this.cursorConfig=new jD(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new jxr(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new jD(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Mxr(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new AW),t.emitViewEvent(new NW),t.emitViewEvent(new WT(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new jD(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Bxr(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new WT(e)),this._eventDispatcher.emitOutgoingEvent(new Oxr(e))}))}setHiddenAreas(e,t){var o;this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const r=this._captureStableViewport();let s=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(i),s&&(a.emitViewEvent(new AW),a.emitViewEvent(new NW),a.emitViewEvent(new WT(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const l=(o=r.viewportStartModelPosition)==null?void 0:o.lineNumber;l&&i.some(u=>u.startLineNumber<=l&&l<=u.endLineNumber)||r.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new Rxr)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(146),t=this._configuration.options.get(67),i=Math.max(20,Math.round(e.height/t)),r=this.viewLayout.getLinesViewportData(),s=Math.max(1,r.completelyVisibleStartLineNumber-i),o=Math.min(this.getLineCount(),r.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new ie(s,this.getLineMinColumn(s),o,this.getLineMaxColumn(o)))}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 s=0,o=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let u=0,d=i.length;u<d;u++){const f=i[u].startLineNumber,p=i[u].endLineNumber;p<o||f>l||(o<f&&(r[s++]=new ie(o,a,f-1,this.model.getLineMaxColumn(f-1))),o=p+1,a=1)}return(o<l||o===l&&a<c)&&(r[s++]=new ie(o,a,l,c)),r}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new ie(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,r=t.completelyVisibleEndLineNumber;return new ie(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 We(i,this.getLineMinColumn(i))),s=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:r,firstPositionDeltaTop:s}}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=Yd(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Lb(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(),s=this.getTabSize(),o=this._lines.getViewLineData(e);return o.inlineDecorations&&(t=[...t,...o.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new bg(o.minColumn,o.maxColumn,o.content,o.continuesWithWrappedLine,i,r,o.tokens,t,s,o.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const r=this._lines.getViewLinesData(e,t,i);return new z1r(this.getTabSize(),r)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,AK(this._configuration.options)),i=new oSr;for(const r of t){const s=r.options,o=s.overviewRuler;if(!o)continue;const a=o.position;if(a===0)continue;const l=o.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,s.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),r=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(r)}deduceModelPositionRelativeToViewPosition(e,t,i){const r=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(r)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){const r=i?`\r `:this.model.getEOL();e=e.slice(0),e.sort(ie.compareRangesUsingStarts);let s=!1,o=!1;for(const l of e)l.isEmpty()?s=!0:o=!0;if(!o){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(s&&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===Ih||e.length!==1)return null;let r=e[0];if(r.isEmpty()){if(!t)return null;const u=r.startLineNumber;r=new ie(u,this.model.getLineMinColumn(u),u,this.model.getLineMaxColumn(u))}const s=this._configuration.options.get(50),o=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===Th.fontFamily;let c;return l?c=Th.fontFamily:(c=s.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Th.fontFamily}`),{mode:i,html:`<div style="color: ${o[1]};background-color: ${o[2]};font-family: ${c};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(r,o)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,r=e.startColumn,s=e.endLineNumber,o=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=s;c++){const u=this.model.tokenization.getLineTokens(c),d=u.getLineContent(),f=c===i?r-1:0,p=c===s?o-1:d.length;d===""?l+="<br>":l+=vgr(d,u.inflate(),t,f,p,a,Wu)}return l}_getColorMap(){const e=Ka.getColorMap(),t=["#000000"];if(e)for(let i=1,r=e.length;i<r;i++)t[i]=At.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 Pxr);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,s){this._executeCursorEdit(o=>this._cursor.compositionType(o,e,t,i,r,s))}paste(e,t,i,r){this._executeCursorEdit(s=>this._cursor.paste(s,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))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(r=>this._cursor.revealAll(r,e,i,0,t,0))}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 ie(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new C6(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new ie(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new C6(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,r,s){this._withViewEventsCollector(o=>o.emitViewEvent(new C6(e,!1,i,null,r,t,s)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Lxr),this._eventDispatcher.emitOutgoingEvent(new Dxr))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}})}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class E2e{static create(e){const t=e._setTrackedRange(null,new ie(1,1,1,1),1);return new E2e(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,s){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=r,this._startLineDelta=s}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new We(t,e.getLineMinColumn(t))),r=e.model._setTrackedRange(this._modelTrackedRange,new ie(i.lineNumber,i.column,i.lineNumber,i.column),1),s=e.viewLayout.getVerticalOffsetForLineNumber(t),o=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=r,this._startLineDelta=o-s}invalidate(){this._isValid=!1}}class oSr{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,r,s){const o=this._asMap[e];if(o){const a=o.data,l=a[a.length-3],c=a[a.length-1];if(l===s&&c+1>=i){r>c&&(a[a.length-1]=r);return}a.push(s,i,r)}else{const a=new V7(e,t,[s,i,r]);this._asMap[e]=a,this.asArray.push(a)}}}class aSr{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&G9e(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)=>lSr(t,i),[]);return G9e(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function lSr(n,e){const t=[];let i=0,r=0;for(;i<n.length&&r<e.length;){const s=n[i],o=e[r];if(s.endLineNumber<o.startLineNumber-1)t.push(n[i++]);else if(o.endLineNumber<s.startLineNumber-1)t.push(e[r++]);else{const a=Math.min(s.startLineNumber,o.startLineNumber),l=Math.max(s.endLineNumber,o.endLineNumber);t.push(new ie(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 G9e(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 Y9e{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)}}var cSr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},oC=function(n,e){return function(t,i){e(t,i,n)}},l2,TI;let X7=(TI=class extends Ye{get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}constructor(e,t,i,r,s,o,a,l,c,u,d,f){super(),this.languageConfigurationService=d,this._deliveryQueue=vor(),this._contributions=this._register(new gxr),this._onDidDispose=this._register(new Ue),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new Q9e({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new Q9e({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Ld(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new Ue({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onBeginUpdate=this._register(new Ue),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new Ue),this.onEndUpdate=this._onEndUpdate.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),s.willCreateCodeEditor();const p={...t};this._domElement=e,this._overflowWidgetsDomNode=p.overflowWidgetsDomNode,delete p.overflowWidgetsDomNode,this._id=++uSr,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,i.contextMenuId??(i.isSimpleWidget?zn.SimpleEditorContext:zn.EditorContext),p,u)),this._register(this._configuration.onDidChange(_=>{this._onDidChangeConfiguration.fire(_);const v=this._configuration.options;if(_.hasChanged(146)){const b=v.get(146);this._onDidLayoutChange.fire(b)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=s,this._commandService=o,this._themeService=l,this._register(new hSr(this,this._contextKeyService)),this._register(new fSr(this,this._contextKeyService,f)),this._instantiationService=this._register(r.createChild(new n3([Oi,this._contextKeyService]))),this._modelData=null,this._focusTracker=new pSr(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let g;Array.isArray(i.contributions)?g=i.contributions:g=dI.getEditorContributions(),this._contributions.initialize(this,g,this._instantiationService);for(const _ of dI.getEditorActions()){if(this._actions.has(_.id)){tr(new Error(`Cannot have two actions with the same id ${_.id}`));continue}const v=new tdt(_.id,_.label,_.alias,_.metadata,_.precondition??void 0,b=>this._instantiationService.invokeFunction(y=>Promise.resolve(_.runEditorCommand(y,this,b))),this._contextKeyService);this._actions.set(v.id,v)}const m=()=>!this._configuration.options.get(92)&&this._configuration.options.get(36).enabled;this._register(new Alr(this._domElement,{onDragOver:_=>{if(!m())return;const v=this.getTargetAtClientPoint(_.clientX,_.clientY);v!=null&&v.position&&this.showDropIndicatorAt(v.position)},onDrop:async _=>{if(!m()||(this.removeDropIndicator(),!_.dataTransfer))return;const v=this.getTargetAtClientPoint(_.clientX,_.clientY);v!=null&&v.position&&this._onDropIntoEditor.fire({position:v.position,event:_})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)==null||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,r){return new ube(e,t,i,this._domElement,r)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return h$.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?$s.getWordAtPosition(this._modelData.model,this._configuration.options.get(132),this._configuration.options.get(131),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){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;try{this._beginUpdate();const i=e;if(this._modelData===null&&i===null||this._modelData&&this._modelData.model===i)return;const r={oldModelUrl:((t=this._modelData)==null?void 0:t.model.uri)||null,newModelUrl:(i==null?void 0:i.uri)||null};this._onWillChangeModel.fire(r);const s=this.hasTextFocus(),o=this._detachModel();this._attachModel(i),s&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(r),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_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 s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber,r)}getTopForLineNumber(e,t=!1){return this._modelData?l2._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?l2._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,r=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber,r)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return-1;const i=this._modelData.model.getLineMaxColumn(e);return l2._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}setHiddenAreas(e,t){var i;(i=this._modelData)==null||i.viewModel.setHiddenAreas(e.map(r=>ie.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 cc.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(!We.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(!ie.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,o,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 ie(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(!We.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new ie(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=Yn.isISelection(e),r=ie.isIRange(e);if(!i&&!r)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(r){const s={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(s,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new Yn(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 ie(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(!ie.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(ie.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,s=e.length;r<s;r++)if(!Yn.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.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){i=i||{};try{switch(this._beginUpdate(),t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const s=i;this._type(e,s.text||"");return}case"replacePreviousChar":{const s=i;this._compositionType(e,s.text||"",s.replaceCharCnt||0,0,0);return}case"compositionType":{const s=i;this._compositionType(e,s.text||"",s.replacePrevCharCnt||0,s.replaceNextCharCnt||0,s.positionDelta||0);return}case"paste":{const s=i;this._paste(e,s.text||"",s.pasteOnNewLine||!1,s.multicursorText||null,s.mode||null,s.clipboardEvent);return}case"cut":this._cut(e);return}const r=this.getAction(t);if(r){Promise.resolve(r.run(i)).then(void 0,tr);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_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,s){this._modelData&&this._modelData.viewModel.compositionType(t,i,r,s,e)}_paste(e,t,i,r,s,o){if(!this._modelData)return;const a=this._modelData.viewModel,l=a.getSelection().getStartPosition();a.paste(t,i,r,e);const c=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:o,range:new ie(l.lineNumber,l.column,c.lineNumber,c.column),languageId:s})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const r=dI.getEditorCommand(t);return r?(i=i||{},i.source=e,this._instantiationService.invokeFunction(s=>{Promise.resolve(r.runEditorCommand(s,this,i)).then(void 0,tr)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(92)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(92)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(92))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 gSr(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,AK(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,AK(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.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(146)}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,t=!1){this._configuration.observeContainer(e),t||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:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const 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(146),s=l2._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),o=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+r.glyphMarginWidth+r.lineNumbersWidth+r.decorationsWidth-this.getScrollLeft();return{top:s,left:o,height:i.get(67)}}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.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){vu(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),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 sSr(this._id,this._configuration,e,_2e.create(Ti(this._domElement)),v2e.create(this._configuration.options),a=>lp(Ti(this._domElement),a),this.languageConfigurationService,this._themeService,i,{batchChanges:a=>{try{return this._beginUpdate(),a()}finally{this._endUpdate()}}});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(80),f=A("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(gte.Warning,f,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:A("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let d=0,f=a.selections.length;d<f;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[s,o]=this._createView(r);if(o){this._domElement.appendChild(s.domNode.domNode);let a=Object.keys(this._contentWidgets);for(let l=0,c=a.length;l<c;l++){const u=a[l];s.addContentWidget(this._contentWidgets[u])}a=Object.keys(this._overlayWidgets);for(let l=0,c=a.length;l<c;l++){const u=a[l];s.addOverlayWidget(this._overlayWidgets[u])}a=Object.keys(this._glyphMarginWidgets);for(let l=0,c=a.length;l<c;l++){const u=a[l];s.addGlyphMarginWidget(this._glyphMarginWidgets[u])}s.render(!1,!0),s.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new dSr(e,r,s,o,t,i)}_createView(e){let t;this.isSimpleWidget?t={paste:(s,o,a,l)=>{this._paste("keyboard",s,o,a,l)},type:s=>{this._type("keyboard",s)},compositionType:(s,o,a,l)=>{this._compositionType("keyboard",s,o,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(s,o,a,l)=>{const c={text:s,pasteOnNewLine:o,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:s=>{const o={text:s};this._commandService.executeCommand("type",o)},compositionType:(s,o,a,l)=>{if(a||l){const c={text:s,replacePrevCharCnt:o,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:s,replaceCharCnt:o};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new ene(e.coordinatesConverter);return i.onKeyDown=s=>this._onKeyDown.fire(s),i.onKeyUp=s=>this._onKeyUp.fire(s),i.onContextMenu=s=>this._onContextMenu.fire(s),i.onMouseMove=s=>this._onMouseMove.fire(s),i.onMouseLeave=s=>this._onMouseLeave.fire(s),i.onMouseDown=s=>this._onMouseDown.fire(s),i.onMouseUp=s=>this._onMouseUp.fire(s),i.onMouseDrag=s=>this._onMouseDrag.fire(s),i.onMouseDrop=s=>this._onMouseDrop.fire(s),i.onMouseDropCanceled=s=>this._onMouseDropCanceled.fire(s),i.onMouseWheel=s=>this._onMouseWheel.fire(s),[new Sbe(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var i;if((i=this._contributionsDisposable)==null||i.dispose(),this._contributionsDisposable=void 0,!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)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new ie(e.lineNumber,e.column,e.lineNumber,e.column),options:l2.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}},l2=TI,TI.dropIntoEditorDecorationOptions=ur.register({description:"workbench-dnd-target",className:"dnd-target"}),TI);X7=l2=cSr([oC(3,mi),oC(4,Cs),oC(5,Fo),oC(6,Oi),oC(7,mc),oC(8,wl),oC(9,dp),oC(10,wa),oC(11,Fn)],X7);let uSr=0;class dSr{constructor(e,t,i,r,s,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=r,this.listenersToRemove=s,this.attachedView=o}dispose(){vo(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}class Q9e extends Ye{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new Ue(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new Ue(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 Ld extends Ue{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class hSr extends Ye{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=me.editorSimpleInput.bindTo(t),this._editorFocus=me.focus.bindTo(t),this._textInputFocus=me.textInputFocus.bindTo(t),this._editorTextFocus=me.editorTextFocus.bindTo(t),this._tabMovesFocus=me.tabMovesFocus.bindTo(t),this._editorReadonly=me.readOnly.bindTo(t),this._inDiffEditor=me.inDiffEditor.bindTo(t),this._editorColumnSelection=me.columnSelection.bindTo(t),this._hasMultipleSelections=me.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=me.hasNonEmptySelection.bindTo(t),this._canUndo=me.canUndo.bindTo(t),this._canRedo=me.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(EM.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(EM.getTabFocusMode()),this._editorReadonly.set(e.get(92)),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 fSr extends Ye{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=me.languageId.bindTo(t),this._hasCompletionItemProvider=me.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=me.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=me.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=me.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=me.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=me.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=me.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=me.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=me.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=me.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=me.hasReferenceProvider.bindTo(t),this._hasRenameProvider=me.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=me.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=me.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=me.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=me.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=me.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=me.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=me.isInEmbeddedEditor.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._isInEmbeddedEditor.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._isInEmbeddedEditor.set(e.uri.scheme===ir.walkThroughSnippet||e.uri.scheme===ir.vscodeChatCodeBlock)})}}class pSr extends Ye{constructor(e,t){super(),this._onChange=this._register(new Ue),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register($b(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register($b(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}}class gSr{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}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const mSr=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='"),_Sr=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 Aue(n){return mSr+encodeURIComponent(n.toString())+_Sr}const vSr=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),bSr=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 ySr(n){return vSr+encodeURIComponent(n.toString())+bSr}Gm((n,e)=>{const t=n.getColor(bte);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${Aue(t)}") repeat-x bottom left; }`);const i=n.getColor(Rw);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${Aue(i)}") repeat-x bottom left; }`);const r=n.getColor(Qy);r&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${Aue(r)}") repeat-x bottom left; }`);const s=n.getColor(dhr);s&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${ySr(s)}") no-repeat bottom left; }`);const o=n.getColor(G_r);o&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${o.rgba.a}; }`)});class Ub{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Ub(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 s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new Ub(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,r,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=r,this._cursorPosition=s}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,1)}}function CSr(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const r=[];let s=0,o=0;for(;s<n.length&&o<e.length;){const a=n[s],l=e[o],c=t(a),u=t(l);c<u?(r.push(a),s++):c>u?(r.push(l),o++):(r.push(i(a,l)),s++,o++)}for(;s<n.length;)r.push(n[s]),s++;for(;o<e.length;)r.push(e[o]),o++;return r}function mY(n,e){const t=new Et,i=n.createDecorationsCollection();return t.add(r$({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const s=e.read(r);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}function VR(n,e){return n.appendChild(e),gi(()=>{e.remove()})}function wSr(n,e){return n.prepend(e),gi(()=>{e.remove()})}class sdt extends Ye{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new Fut(e,t)),this._width=Ar(this,this.elementSizeObserver.getWidth()),this._height=Ar(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>va(r=>{this._width.set(this.elementSizeObserver.getWidth(),r),this._height.set(this.elementSizeObserver.getHeight(),r)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function X9e(n,e,t){let i=e.get(),r=i,s=i;const o=Ar("animatedValue",i);let a=-1;const l=300;let c;t.add(s$({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,f)=>(d.didChange(e)&&(f.animate=f.animate||d.change),!0)},(d,f)=>{c!==void 0&&(n.cancelAnimationFrame(c),c=void 0),r=s,i=e.read(d),a=Date.now()-(f.animate?0:l),u()}));function u(){const d=Date.now()-a;s=Math.floor(xSr(d,r,i-r,l)),d<l?c=n.requestAnimationFrame(u):s=i,o.set(s,void 0)}return o}function xSr(n,e,t,i){return n===i?e+t:t*(-Math.pow(2,-10*n/i)+1)+e}class k2e extends Ye{constructor(e,t,i){super(),this._register(new Dbe(e,i)),this._register(Ow(i,{height:t.actualHeight,top:t.actualTop}))}}class WR{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=Ar(this,void 0),this._actualHeight=Ar(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)}}}const gX=class gX{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${gX._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};gX._counter=0;let Dbe=gX;function Ow(n,e){return Gi(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,s=>"-"+s.toLowerCase()),n.style[i]=r})}function _Y(n,e,t,i){const r=new Et,s=[];return r.add(uf((o,a)=>{const l=e.read(o),c=new Map,u=new Map;t&&t(!0),n.changeViewZones(d=>{for(const f of s)d.removeZone(f),i==null||i.delete(f);s.length=0;for(const f of l){const p=d.addZone(f);f.setZoneId&&f.setZoneId(p),s.push(p),i==null||i.add(p),c.set(f,p)}}),t&&t(!1),a.add(s$({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(d,f){const p=u.get(d.changedObservable);return p!==void 0&&f.zoneIds.push(p),!0}},(d,f)=>{for(const p of l)p.onChange&&(u.set(p.onChange,c.get(p)),p.onChange.read(d));t&&t(!0),n.changeViewZones(p=>{for(const g of f.zoneIds)p.layoutZone(g)}),t&&t(!1)}))})),r.add({dispose(){t&&t(!0),n.changeViewZones(o=>{for(const a of s)o.removeZone(a)}),i==null||i.clear(),t&&t(!1)}}),r}class SSr extends ba{dispose(){super.dispose(!0)}}function Z9e(n,e){const t=h7(e,r=>r.original.startLineNumber<=n.lineNumber);if(!t)return ie.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const r=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return ie.fromPositions(new We(r,n.column))}if(!t.innerChanges)return ie.fromPositions(new We(t.modified.startLineNumber,1));const i=h7(t.innerChanges,r=>r.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const r=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return ie.fromPositions(new We(r,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const r=ESr(i.originalRange.getEndPosition(),n);return ie.fromPositions(r.addToPosition(i.modifiedRange.getEndPosition()))}}function ESr(n,e){return n.lineNumber===e.lineNumber?new av(0,e.column-n.column):new av(e.lineNumber-n.lineNumber,e.column-1)}function kSr(n,e){let t;return n.filter(i=>{const r=e(i,t);return t=i,r})}class vY{static create(e,t=void 0){return new J9e(e,e,t)}static createWithDisposable(e,t,i=void 0){const r=new Et;return r.add(t),r.add(e),new J9e(e,r,i)}}class J9e extends vY{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new TSr(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class TSr extends vY{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}var T2e=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},I2e=function(n,e){return function(t,i){e(t,i,n)}};const ISr=Zo("diff-review-insert",Yt.add,A("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),LSr=Zo("diff-review-remove",Yt.remove,A("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),ASr=Zo("diff-review-close",Yt.close,A("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));var nO;let Q2=(nO=class extends Ye{constructor(e,t,i,r,s,o,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=r,this._width=s,this._height=o,this._diffs=a,this._models=l,this._instantiationService=c,this._state=Pk(this,(u,d)=>{const f=this._visible.read(u);if(this._parentNode.style.visibility=f?"visible":"hidden",!f)return null;const p=d.add(this._instantiationService.createInstance(Rbe,this._diffs,this._models,this._setVisible,this._canClose)),g=d.add(this._instantiationService.createInstance(Pbe,this._parentNode,p,this._width,this._height,this._models));return{model:p,view:g}}).recomputeInitiallyAndOnChange(this._store)}next(){va(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){va(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){va(e=>{this._setVisible(!1,e)})}},nO._ttPolicy=Xw("diffReview",{createHTML:e=>e}),nO);Q2=T2e([I2e(8,mi)],Q2);let Rbe=class extends Ye{constructor(e,t,i,r,s){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=r,this._accessibilitySignalService=s,this._groups=Ar(this,[]),this._currentGroupIdx=Ar(this,0),this._currentElementIdx=Ar(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((o,a)=>this._groups.read(a)[o]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((o,a)=>{var l;return(l=this.currentGroup.read(a))==null?void 0:l.lines[o]}),this._register(Gi(o=>{const a=this._diffs.read(o);if(!a){this._groups.set([],void 0);return}const l=NSr(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());va(c=>{const u=this._models.getModifiedPosition();if(u){const d=l.findIndex(f=>(u==null?void 0:u.lineNumber)<f.range.modified.endLineNumberExclusive);d!==-1&&this._currentGroupIdx.set(d,c)}this._groups.set(l,c)})})),this._register(Gi(o=>{const a=this.currentElement.read(o);(a==null?void 0:a.type)===gh.Deleted?this._accessibilitySignalService.playSignal(Up.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===gh.Added&&this._accessibilitySignalService.playSignal(Up.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Gi(o=>{const a=this.currentElement.read(o);if(a&&a.type!==gh.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(ie.fromPositions(new We(l,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||KL(t,r=>{this._currentGroupIdx.set(Pr.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||va(i=>{this._currentElementIdx.set(Pr.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&&va(r=>{this._currentElementIdx.set(i,r)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===gh.Deleted?this._models.originalReveal(ie.fromPositions(new We(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==gh.Header?ie.fromPositions(new We(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};Rbe=T2e([I2e(4,Mk)],Rbe);const Ej=3;function NSr(n,e,t){const i=[];for(const r of JEe(n,(s,o)=>o.modified.startLineNumber-s.modified.endLineNumberExclusive<2*Ej)){const s=[];s.push(new RSr);const o=new fr(Math.max(1,r[0].original.startLineNumber-Ej),Math.min(r[r.length-1].original.endLineNumberExclusive+Ej,e+1)),a=new fr(Math.max(1,r[0].modified.startLineNumber-Ej),Math.min(r[r.length-1].modified.endLineNumberExclusive+Ej,t+1));Vst(r,(u,d)=>{const f=new fr(u?u.original.endLineNumberExclusive:o.startLineNumber,d?d.original.startLineNumber:o.endLineNumberExclusive),p=new fr(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);f.forEach(g=>{s.push(new MSr(g,p.startLineNumber+(g-f.startLineNumber)))}),d&&(d.original.forEach(g=>{s.push(new PSr(d,g))}),d.modified.forEach(g=>{s.push(new OSr(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 DSr(new Ud(l,c),s))}return i}var gh;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(gh||(gh={}));class DSr{constructor(e,t){this.range=e,this.lines=t}}class RSr{constructor(){this.type=gh.Header}}class PSr{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=gh.Deleted,this.modifiedLineNumber=void 0}}class OSr{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=gh.Added,this.originalLineNumber=void 0}}class MSr{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=gh.Unchanged}}let Pbe=class extends Ye{constructor(e,t,i,r,s,o){super(),this._element=e,this._model=t,this._width=i,this._height=r,this._models=s,this._languageService=o,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new hg(a)),this._register(Gi(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Zf("diffreview.close",A("label.close","Close"),"close-diff-review "+Ni.asClassName(ASr),!0,async()=>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 Z9(this._content,{})),_u(this.domNode,this._scrollbar.getDomNode(),a),this._register(Gi(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(gi(()=>{_u(this.domNode)})),this._register(Ow(this.domNode,{width:this._width,height:this._height})),this._register(Ow(this._content,{width:this._width,height:this._height})),this._register(uf((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Da(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._models.getOriginalOptions(),i=this._models.getModifiedOptions(),r=document.createElement("div");r.className="diff-review-table",r.setAttribute("role","list"),r.setAttribute("aria-label",A("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),vu(r,i.get(50)),_u(this._content,r);const s=this._models.getOriginalModel(),o=this._models.getModifiedModel();if(!s||!o)return;const a=s.getOptions(),l=o.getOptions(),c=i.get(67),u=this._model.currentGroup.get();for(const d of(u==null?void 0:u.lines)||[]){if(!u)break;let f;if(d.type===gh.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const m=u.range,_=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,b=k=>k===0?A("no_lines_changed","no lines changed"):k===1?A("one_line_changed","1 line changed"):A("more_lines_changed","{0} lines changed",k),y=b(m.original.length),C=b(m.modified.length);g.setAttribute("aria-label",A({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,v,m.original.startLineNumber,y,m.modified.startLineNumber,C));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${_+1}/${v}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),g.appendChild(S),f=g}else f=this._createRow(d,c,this._width.get(),t,s,a,i,o,l);r.appendChild(f);const p=ai(g=>this._model.currentElement.read(g)===d);e.add(Gi(g=>{const m=p.read(g);f.tabIndex=m?0:-1,m&&f.focus()})),e.add(_t(f,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,r,s,o,a,l,c){const u=r.get(146),d=u.glyphMarginWidth+u.lineNumbersWidth,f=a.get(146),p=10+f.glyphMarginWidth+f.lineNumbersWidth;let g="diff-review-row",m="";const _="diff-review-spacer";let v=null;switch(e.type){case gh.Added:g="diff-review-row line-insert",m=" char-insert",v=ISr;break;case gh.Deleted:g="diff-review-row line-delete",m=" char-delete",v=LSr;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 S=document.createElement("span");S.style.width=p+"px",S.style.minWidth=p+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",y.appendChild(S);const k=document.createElement("span");if(k.className=_,v){const N=document.createElement("span");N.className=Ni.asClassName(v),N.innerText=" ",k.appendChild(N)}else k.innerText=" ";y.appendChild(k);let I;if(e.modifiedLineNumber!==void 0){let N=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Q2._ttPolicy&&(N=Q2._ttPolicy.createHTML(N)),y.insertAdjacentHTML("beforeend",N),I=l.getLineContent(e.modifiedLineNumber)}else{let N=this._getLineHtml(s,r,o.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Q2._ttPolicy&&(N=Q2._ttPolicy.createHTML(N)),y.insertAdjacentHTML("beforeend",N),I=s.getLineContent(e.originalLineNumber)}I.length===0&&(I=A("blankLine","blank"));let L="";switch(e.type){case gh.Unchanged:e.originalLineNumber===e.modifiedLineNumber?L=A({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",I,e.originalLineNumber):L=A("equalLine","{0} original line {1} modified line {2}",I,e.originalLineNumber,e.modifiedLineNumber);break;case gh.Added:L=A("insertLine","+ {0} modified line {1}",I,e.modifiedLineNumber);break;case gh.Deleted:L=A("deleteLine","- {0} original line {1}",I,e.originalLineNumber);break}return b.setAttribute("aria-label",L),b}_getLineHtml(e,t,i,r,s){const o=e.getLineContent(r),a=t.get(50),l=Xc.createEmpty(o,s),c=bg.isBasicASCII(o,e.mightContainNonBasicASCII()),u=bg.containsRTL(o,c,e.mightContainRTL());return Gte(new jk(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,o,!1,c,u,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(118),t.get(100),t.get(95),t.get(51)!==UE.OFF,null)).html}};Pbe=T2e([I2e(5,pa)],Pbe);class jSr{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}ve("diffEditor.move.border","#8b8b8b9c",A("diffEditor.move.border","The border color for text that got moved in the diff editor."));ve("diffEditor.moveActive.border","#FFA500",A("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));ve("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},A("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets."));const FSr=Zo("diff-insert",Yt.add,A("diffInsertIcon","Line decoration for inserts in the diff editor.")),odt=Zo("diff-remove",Yt.remove,A("diffRemoveIcon","Line decoration for removals in the diff editor.")),bY=ur.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Ni.asClassName(FSr),marginClassName:"gutter-insert"}),Z7=ur.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Ni.asClassName(odt),marginClassName:"gutter-delete"}),e$e=ur.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),t$e=ur.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),yY=ur.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),L2e=ur.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),A2e=ur.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),TM=ur.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),N2e=ur.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),D2e=ur.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});var adt=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Obe=function(n,e){return function(t,i){e(t,i,n)}},c2;const g$=Ur("diffProviderFactoryService");let Mbe=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(jbe,e)}};Mbe=adt([Obe(0,mi)],Mbe);ns(g$,Mbe,1);var II;let jbe=(II=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new Ue,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)==null||e.dispose()}async computeDiff(e,t,i,r){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,r);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new dg(new fr(1,2),new fr(1,t.getLineCount()+1),[new zp(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const s=JSON.stringify([e.uri.toString(),t.uri.toString()]),o=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=c2.diffCache.get(s);if(a&&a.context===o)return a.result;const l=Qc.create(),c=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),u=l.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:u,timedOut:(c==null?void 0:c.quitEarly)??!0,detectedMoves:i.computeMoves?(c==null?void 0:c.moves.length)??0:-1}),r.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!c)throw new Error("no diff result available");return c2.diffCache.size>10&&c2.diffCache.delete(c2.diffCache.keys().next().value),c2.diffCache.set(s,{result:c,context:o}),c}setOptions(e){var i;let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((i=this.diffAlgorithmOnDidChangeSubscription)==null||i.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},c2=II,II.diffCache=new Map,II);jbe=c2=adt([Obe(1,Sf),Obe(2,md)],jbe);function tne(){return Ege&&!!Ege.VSCODE_DEV}function ldt(n){if(tne()){const e=BSr();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function BSr(){DW||(DW=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e},i=[];for(const r of DW){const s=r(t);s&&i.push(s)}if(i.length>0)return r=>{let s=!1;for(const o of i)o(r)&&(s=!0);return s}}),DW}let DW;tne()&&ldt(({oldExports:n,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{var r,s;for(const o in i){const a=i[o];if(console.log(`[hot-reload] Patching prototype methods of '${o}'`,{exportedItem:a}),typeof a=="function"&&a.prototype){const l=n[o];if(l){for(const c of Object.getOwnPropertyNames(a.prototype)){const u=Object.getOwnPropertyDescriptor(a.prototype,c),d=Object.getOwnPropertyDescriptor(l.prototype,c);((r=u==null?void 0:u.value)==null?void 0:r.toString())!==((s=d==null?void 0:d.value)==null?void 0:s.toString())&&console.log(`[hot-reload] Patching prototype method '${o}.${c}'`),Object.defineProperty(l.prototype,c,u)}i[o]=l}}}return!0}});function zf(n,e){return $Sr([n],e),n}function $Sr(n,e){tne()&&Fu("reload",i=>ldt(({oldExports:r})=>{if([...Object.values(r)].some(s=>n.includes(s)))return s=>(i(void 0),!0)})).read(e)}var HSr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},VSr=function(n,e){return function(t,i){e(t,i,n)}};let Fbe=class extends Ye{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=Ar(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Ar(this,void 0),this.diff=this._diff,this._unchangedRegions=Ar(this,void 0),this.unchangedRegions=ai(this,a=>{var l;return this._options.hideUnchangedRegions.read(a)?((l=this._unchangedRegions.read(a))==null?void 0:l.regions)??[]:(va(c=>{var u;for(const d of((u=this._unchangedRegions.get())==null?void 0:u.regions)||[])d.collapseAll(c)}),[])}),this.movedTextToCompare=Ar(this,void 0),this._activeMovedText=Ar(this,void 0),this._hoveredMovedText=Ar(this,void 0),this.activeMovedText=ai(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new ba,this._diffProvider=ai(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=Fu("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(gi(()=>this._cancellationTokenSource.cancel()));const r=X4("contentChangedSignal"),s=this._register(new ao(()=>r.trigger(void 0),200));this._register(Gi(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(g=>g.isDragged.read(a)))return;const c=l.originalDecorationIds.map(g=>e.original.getDecorationRange(g)).map(g=>g?fr.fromRangeInclusive(g):void 0),u=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?fr.fromRangeInclusive(g):void 0),d=l.regions.map((g,m)=>!c[m]||!u[m]?void 0:new qS(c[m].startLineNumber,u[m].startLineNumber,c[m].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(Oy),f=[];let p=!1;for(const g of JEe(d,(m,_)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===_.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){p=!0;const m=g.reduce((v,b)=>v+b.lineCount,0),_=new qS(g[0].originalLineNumber,g[0].modifiedLineNumber,m,g[0].visibleLineCountTop.get(),g[g.length-1].visibleLineCountBottom.get());f.push(_)}else f.push(g[0]);if(p){const g=e.original.deltaDecorations(l.originalDecorationIds,f.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(l.modifiedDecorationIds,f.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));va(_=>{this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:m},_)})}}));const o=(a,l,c)=>{const u=qS.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let d;const f=this._unchangedRegions.get();if(f){const _=f.originalDecorationIds.map(C=>e.original.getDecorationRange(C)).map(C=>C?fr.fromRangeInclusive(C):void 0),v=f.modifiedDecorationIds.map(C=>e.modified.getDecorationRange(C)).map(C=>C?fr.fromRangeInclusive(C):void 0);let y=kSr(f.regions.map((C,S)=>{if(!_[S]||!v[S])return;const k=_[S].length;return new qS(_[S].startLineNumber,v[S].startLineNumber,k,Math.min(C.visibleLineCountTop.get(),k),Math.min(C.visibleLineCountBottom.get(),k-C.visibleLineCountTop.get()))}).filter(Oy),(C,S)=>!S||C.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&C.originalLineNumber>=S.originalLineNumber+S.lineCount).map(C=>new Ud(C.getHiddenOriginalRange(c),C.getHiddenModifiedRange(c)));y=Ud.clip(y,fr.ofLength(1,e.original.getLineCount()),fr.ofLength(1,e.modified.getLineCount())),d=Ud.inverse(y,e.original.getLineCount(),e.modified.getLineCount())}const p=[];if(d)for(const _ of u){const v=d.filter(b=>b.original.intersectsStrict(_.originalUnchangedRange)&&b.modified.intersectsStrict(_.modifiedUnchangedRange));p.push(..._.setVisibleRanges(v,l))}else p.push(...u);const g=e.original.deltaDecorations((f==null?void 0:f.originalDecorationIds)||[],p.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations((f==null?void 0:f.modifiedDecorationIds)||[],p.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:p,originalDecorationIds:g,modifiedDecorationIds:m},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=GC.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=GC.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(uf(async(a,l)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),s.cancel(),r.read(a);const c=this._diffProvider.read(a);c.onChangeSignal.read(a),zf(Dat,a),zf(Zme,a),this._isDiffUpToDate.set(!1,void 0);let u=[];l.add(e.original.onDidChangeContent(p=>{const g=GC.fromModelContentChanges(p.changes);u=DG(u,g)}));let d=[];l.add(e.modified.onDidChangeContent(p=>{const g=GC.fromModelContentChanges(p.changes);d=DG(d,g)}));let f=await c.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(f=WSr(f,e.original,e.modified),f=(e.original,e.modified,void 0)??f,f=(e.original,e.modified,void 0)??f,va(p=>{o(f,p),this._lastDiff=f;const g=R2e.fromDiffResult(f);this._diff.set(g,p),this._isDiffUpToDate.set(!0,p);const m=this.movedTextToCompare.get();this.movedTextToCompare.set(m?this._lastDiff.moves.find(_=>_.lineRangeMapping.modified.intersect(m.lineRangeMapping.modified)):void 0,p)}))}))}ensureModifiedLineIsVisible(e,t,i){var s,o;if(((s=this.diff.get())==null?void 0:s.mappings.length)===0)return;const r=((o=this._unchangedRegions.get())==null?void 0:o.regions)||[];for(const a of r)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){var s,o;if(((s=this.diff.get())==null?void 0:s.mappings.length)===0)return;const r=((o=this._unchangedRegions.get())==null?void 0:o.regions)||[];for(const a of r)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,i);return}}async waitForDiff(){await Qlt(this.isDiffUpToDate,e=>e)}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:e==null?void 0:e.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var r;const t=(r=e.collapsedRegions)==null?void 0:r.map(s=>fr.deserialize(s.range)),i=this._unchangedRegions.get();!i||!t||va(s=>{for(const o of i.regions)for(const a of t)if(o.modifiedUnchangedRange.intersect(a)){o.setHiddenModifiedRange(a,s);break}})}};Fbe=HSr([VSr(2,g$)],Fbe);function WSr(n,e,t){return{changes:n.changes.map(i=>new dg(i.original,i.modified,i.innerChanges?i.innerChanges.map(r=>zSr(r,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function zSr(n,e,t){let i=n.originalRange,r=n.modifiedRange;return i.startColumn===1&&r.startColumn===1&&(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 zp(i,r)}class R2e{static fromDiffResult(e){return new R2e(e.changes.map(t=>new cdt(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 cdt{constructor(e){this.lineRangeMapping=e}}class qS{static fromDiffs(e,t,i,r,s){const o=dg.inverse(e,t,i),a=[];for(const l of o){let c=l.original.startLineNumber,u=l.modified.startLineNumber,d=l.original.length;const f=c===1&&u===1,p=c+d===t+1&&u+d===i+1;(f||p)&&d>=s+r?(f&&!p&&(d-=s),p&&!f&&(c+=s,u+=s,d-=s),a.push(new qS(c,u,d,0,0))):d>=s*2+r&&(c+=s,u+=s,d-=s*2,a.push(new qS(c,u,d,0,0)))}return a}get originalUnchangedRange(){return fr.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return fr.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,r,s){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Ar(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Ar(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=ai(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Ar(this,void 0);const o=Math.max(Math.min(r,this.lineCount),0),a=Math.max(Math.min(s,this.lineCount-r),0);_8e(r===o),_8e(s===a),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],r=new um(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let s=this.originalLineNumber,o=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(r.ranges.length===0)this.showAll(t),i.push(this);else{let l=0;for(const c of r.ranges){const u=l===r.ranges.length-1;l++;const d=(u?a:c.endLineNumberExclusive)-o,f=new qS(s,o,d,0,0);f.setHiddenModifiedRange(c,t),i.push(f),s=f.originalUnchangedRange.endLineNumberExclusive,o=f.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return fr.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return fr.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,i){const r=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&r<s||t===1?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+r,i):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+s,i)}showOriginalLine(e,t,i){const r=e-this.originalLineNumber,s=this.originalLineNumber+this.lineCount-e;t===0&&r<s||t===1?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+s-r,this.getMaxVisibleLineCountTop()),i):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+r-s,this.getMaxVisibleLineCountBottom()),i)}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)}}class USr extends Ye{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,s,o,a,l,c){super(),this._getViewZoneId=e,this._marginDomNode=t,this._modifiedEditor=i,this._diff=r,this._editor=s,this._viewLineCounts=o,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=Ni.asClassName(Yt.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const u=this._modifiedEditor.getOption(67);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 f=i.getOption(128)&&!Fb,p=(g,m)=>{this._contextMenuService.showContextMenu({domForShadowRoot:f?i.getDomNode()??void 0:void 0,getAnchor:()=>({x:g,y:m}),getActions:()=>{const _=[],v=r.modified.isEmpty;return _.push(new Zf("diff.clipboard.copyDeletedContent",v?r.original.length>1?A("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):A("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):r.original.length>1?A("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):A("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{const y=this._originalTextModel.getValueInRange(r.original.toExclusiveRange());await this._clipboardService.writeText(y)})),r.original.length>1&&_.push(new Zf("diff.clipboard.copyDeletedLineContent",v?A("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",r.original.startLineNumber+d):A("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",r.original.startLineNumber+d),void 0,!0,async()=>{let y=this._originalTextModel.getLineContent(r.original.startLineNumber+d);y===""&&(y=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r `),await this._clipboardService.writeText(y)})),i.getOption(92)||_.push(new Zf("diff.inline.revertChange",A("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),_},autoSelectFirstItem:!0})};this._register(Da(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;const{top:m,height:_}=al(this._diffActions),v=Math.floor(u/3);g.preventDefault(),p(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.leftButton&&(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),p(g.event.posx,g.event.posy+u))}))}_updateLightBulbPosition(e,t,i){const{top:r}=al(e),s=t-r,o=Math.floor(s/i),a=o*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],o<l)return c}return o}}const n$e=Xw("diffEditorWidget",{createHTML:n=>n});function qSr(n,e,t,i){vu(i,e.fontInfo);const r=t.length>0,s=new z4(1e4);let o=0,a=0;const l=[];for(let f=0;f<n.lineTokens.length;f++){const p=f+1,g=n.lineTokens[f],m=n.lineBreakData[f],_=xh.filter(t,p,1,Number.MAX_SAFE_INTEGER);if(m){let v=0;for(const b of m.breakOffsets){const y=g.sliceAndInflate(v,b,0);o=Math.max(o,i$e(a,y,xh.extractWrapped(_,v,b),r,n.mightContainNonBasicASCII,n.mightContainRTL,e,s)),a++,v=b}l.push(m.breakOffsets.length)}else l.push(1),o=Math.max(o,i$e(a,g,_,r,n.mightContainNonBasicASCII,n.mightContainRTL,e,s)),a++}o+=e.scrollBeyondLastColumn;const c=s.build(),u=n$e?n$e.createHTML(c):c;i.innerHTML=u;const d=o*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:d,viewLineCounts:l}}class KSr{constructor(e,t,i,r){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=r}}class P2e{static fromEditor(e){var s;const t=e.getOptions(),i=t.get(50),r=t.get(146);return new P2e(((s=e.getModel())==null?void 0:s.getOptions().tabSize)||0,i,t.get(33),i.typicalHalfwidthCharacterWidth,t.get(105),t.get(67),r.decorationsWidth,t.get(118),t.get(100),t.get(95),t.get(51))}constructor(e,t,i,r,s,o,a,l,c,u,d){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=r,this.scrollBeyondLastColumn=s,this.lineHeight=o,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=u,this.fontLigatures=d}}function i$e(n,e,t,i,r,s,o,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(n*o.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),c=bg.isBasicASCII(l,r),u=bg.containsRTL(l,c,s),d=f$(new jk(o.fontInfo.isMonospace&&!o.disableMonospaceOptimizations,o.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,u,0,e,t,o.tabSize,0,o.fontInfo.spaceWidth,o.fontInfo.middotWidth,o.fontInfo.wsmiddotWidth,o.stopRenderingLineAfter,o.renderWhitespace,o.renderControlCharacters,o.fontLigatures!==UE.OFF,null),a);return a.appendString("</div>"),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var GSr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},r$e=function(n,e){return function(t,i){e(t,i,n)}};let Bbe=class extends Ye{constructor(e,t,i,r,s,o,a,l,c,u){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=r,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=o,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=u,this._originalTopPadding=Ar(this,0),this._originalScrollOffset=Ar(this,0),this._originalScrollOffsetAnimated=X9e(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Ar(this,0),this._modifiedScrollOffset=Ar(this,0),this._modifiedScrollOffsetAnimated=X9e(this._targetWindow,this._modifiedScrollOffset,this._store);const d=Ar("invalidateAlignmentsState",0),f=this._register(new ao(()=>{d.set(d.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||f.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||f.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(147)||y.hasChanged(67))&&f.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(147)||y.hasChanged(67))&&f.schedule()}));const p=this._diffModel.map(y=>y?Gs(this,y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===2):void 0).map((y,C)=>y==null?void 0:y.read(C)),g=ai(y=>{const C=this._diffModel.read(y),S=C==null?void 0:C.diff.read(y);if(!C||!S)return null;d.read(y);const I=this._options.renderSideBySide.read(y);return s$e(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,I)}),m=ai(y=>{var k;const C=(k=this._diffModel.read(y))==null?void 0:k.movedTextToCompare.read(y);if(!C)return null;d.read(y);const S=C.changes.map(I=>new cdt(I));return s$e(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function _(){const y=document.createElement("div");return y.className="diagonal-fill",y}const v=this._register(new Et);this.viewZones=Pk(this,(y,C)=>{var G,H,z,Z;v.clear();const S=g.read(y)||[],k=[],I=[],L=this._modifiedTopPadding.read(y);L>0&&I.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:L,showInHiddenAreas:!0,suppressMouseDown:!0});const N=this._originalTopPadding.read(y);N>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:N,showInHiddenAreas:!0,suppressMouseDown:!0});const P=this._options.renderSideBySide.read(y),O=P||(G=this._editors.modified._getViewModel())==null?void 0:G.createLineBreaksComputer();if(O){const X=this._editors.original.getModel();for(const oe of S)if(oe.diff)for(let fe=oe.originalRange.startLineNumber;fe<oe.originalRange.endLineNumberExclusive;fe++){if(fe>X.getLineCount())return{orig:k,mod:I};O==null||O.addRequest(X.getLineContent(fe),null,null)}}const F=(O==null?void 0:O.finalize())??[];let V=0;const M=this._editors.modified.getOption(67),B=(H=this._diffModel.read(y))==null?void 0:H.movedTextToCompare.read(y),W=((z=this._editors.original.getModel())==null?void 0:z.mightContainNonBasicASCII())??!1,q=((Z=this._editors.original.getModel())==null?void 0:Z.mightContainRTL())??!1,U=P2e.fromEditor(this._editors.modified);for(const X of S)if(X.diff&&!P&&(!this._options.useTrueInlineDiffRendering.read(y)||!O2e(X.diff))){if(!X.originalRange.isEmpty){p.read(y);const fe=document.createElement("div");fe.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Se=this._editors.original.getModel();if(X.originalRange.endLineNumberExclusive-1>Se.getLineCount())return{orig:k,mod:I};const Me=new KSr(X.originalRange.mapToLineArray(Be=>Se.tokenization.getLineTokens(Be)),X.originalRange.mapToLineArray(Be=>F[V++]),W,q),Ie=[];for(const Be of X.diff.innerChanges||[])Ie.push(new p6(Be.originalRange.delta(-(X.diff.original.startLineNumber-1)),TM.className,0));const ge=qSr(Me,U,Ie,fe),ye=document.createElement("div");if(ye.className="inline-deleted-margin-view-zone",vu(ye,U.fontInfo),this._options.renderIndicators.read(y))for(let Be=0;Be<ge.heightInLines;Be++){const $e=document.createElement("div");$e.className=`delete-sign ${Ni.asClassName(odt)}`,$e.setAttribute("style",`position:absolute;top:${Be*M}px;width:${U.lineDecorationsWidth}px;height:${M}px;right:0;`),ye.appendChild($e)}let Pe;v.add(new USr(()=>MS(Pe),ye,this._editors.modified,X.diff,this._diffEditorWidget,ge.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Be=0;Be<ge.viewLineCounts.length;Be++){const $e=ge.viewLineCounts[Be];$e>1&&k.push({afterLineNumber:X.originalRange.startLineNumber+Be,domNode:_(),heightInPx:($e-1)*M,showInHiddenAreas:!0,suppressMouseDown:!0})}I.push({afterLineNumber:X.modifiedRange.startLineNumber-1,domNode:fe,heightInPx:ge.heightInLines*M,minWidthInPx:ge.minWidthInPx,marginDomNode:ye,setZoneId(Be){Pe=Be},showInHiddenAreas:!0,suppressMouseDown:!0})}const oe=document.createElement("div");oe.className="gutter-delete",k.push({afterLineNumber:X.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:X.modifiedHeightInPx,marginDomNode:oe,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const oe=X.modifiedHeightInPx-X.originalHeightInPx;if(oe>0){if(B!=null&&B.lineRangeMapping.original.delta(-1).deltaLength(2).contains(X.originalRange.endLineNumberExclusive-1))continue;k.push({afterLineNumber:X.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:oe,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let fe=function(){const Me=document.createElement("div");return Me.className="arrow-revert-change "+Ni.asClassName(Yt.arrowRight),C.add(_t(Me,"mousedown",Ie=>Ie.stopPropagation())),C.add(_t(Me,"click",Ie=>{Ie.stopPropagation(),s.revert(X.diff)})),Jt("div",{},Me)};if(B!=null&&B.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(X.modifiedRange.endLineNumberExclusive-1))continue;let Se;X.diff&&X.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(y)&&(Se=fe()),I.push({afterLineNumber:X.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-oe,marginDomNode:Se,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const X of m.read(y)??[]){if(!(B!=null&&B.lineRangeMapping.original.intersect(X.originalRange))||!(B!=null&&B.lineRangeMapping.modified.intersect(X.modifiedRange)))continue;const oe=X.modifiedHeightInPx-X.originalHeightInPx;oe>0?k.push({afterLineNumber:X.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:oe,showInHiddenAreas:!0,suppressMouseDown:!0}):I.push({afterLineNumber:X.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-oe,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:k,mod:I}});let b=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!b&&(b=!0,this._editors.modified.setScrollLeft(y.scrollLeft),b=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!b&&(b=!0,this._editors.original.setScrollLeft(y.scrollLeft),b=!1)})),this._originalScrollTop=Gs(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Gs(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Gi(y=>{const C=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));C!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(C,1)})),this._register(Gi(y=>{const C=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));C!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(C,1)})),this._register(Gi(y=>{var k;const C=(k=this._diffModel.read(y))==null?void 0:k.movedTextToCompare.read(y);let S=0;if(C){const I=this._editors.original.getTopForLineNumber(C.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();S=this._editors.modified.getTopForLineNumber(C.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-I}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,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()-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+S,void 0,!0)}))}};Bbe=GSr([r$e(8,tx),r$e(9,up)],Bbe);function s$e(n,e,t,i,r,s){const o=new Lw(o$e(n,i)),a=new Lw(o$e(e,r)),l=n.getOption(67),c=e.getOption(67),u=[];let d=0,f=0;function p(g,m){for(;;){let _=o.peek(),v=a.peek();if(_&&_.lineNumber>=g&&(_=void 0),v&&v.lineNumber>=m&&(v=void 0),!_&&!v)break;const b=_?_.lineNumber-d:Number.MAX_VALUE,y=v?v.lineNumber-f:Number.MAX_VALUE;b<y?(o.dequeue(),v={lineNumber:_.lineNumber-d+f,heightInPx:0}):b>y?(a.dequeue(),_={lineNumber:v.lineNumber-f+d,heightInPx:0}):(o.dequeue(),a.dequeue()),u.push({originalRange:fr.ofLength(_.lineNumber,1),modifiedRange:fr.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let y=function(C,S,k=!1){var O,F;if(C<b||S<v)return;if(_)_=!1;else if(!k&&(C===b||S===v))return;const I=new fr(b,C),L=new fr(v,S);if(I.isEmpty&&L.isEmpty)return;const N=((O=o.takeWhile(V=>V.lineNumber<C))==null?void 0:O.reduce((V,M)=>V+M.heightInPx,0))??0,P=((F=a.takeWhile(V=>V.lineNumber<S))==null?void 0:F.reduce((V,M)=>V+M.heightInPx,0))??0;u.push({originalRange:I,modifiedRange:L,originalHeightInPx:I.length*l+N,modifiedHeightInPx:L.length*c+P,diff:g.lineRangeMapping}),b=C,v=S};const m=g.lineRangeMapping;p(m.original.startLineNumber,m.modified.startLineNumber);let _=!0,v=m.modified.startLineNumber,b=m.original.startLineNumber;if(s)for(const C of m.innerChanges||[]){C.originalRange.startColumn>1&&C.modifiedRange.startColumn>1&&y(C.originalRange.startLineNumber,C.modifiedRange.startLineNumber);const S=n.getModel(),k=C.originalRange.endLineNumber<=S.getLineCount()?S.getLineMaxColumn(C.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;C.originalRange.endColumn<k&&y(C.originalRange.endLineNumber,C.modifiedRange.endLineNumber)}y(m.original.endLineNumberExclusive,m.modified.endLineNumberExclusive,!0),d=m.original.endLineNumberExclusive,f=m.modified.endLineNumberExclusive}return p(Number.MAX_VALUE,Number.MAX_VALUE),u}function o$e(n,e){const t=[],i=[],r=n.getOption(147).wrappingColumn!==-1,s=n._getViewModel().coordinatesConverter,o=n.getOption(67);if(r)for(let l=1;l<=n.getModel().getLineCount();l++){const c=s.getModelLineViewLineCount(l);c>1&&i.push({lineNumber:l,heightInPx:o*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:s.convertViewPositionToModelPosition(new We(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return CSr(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function O2e(n){return n.innerChanges?n.innerChanges.every(e=>a$e(e.modifiedRange)&&a$e(e.originalRange)||e.originalRange.equalsRange(new ie(1,1,1,1))):!1}function a$e(n){return n.startLineNumber===n.endLineNumber}const K6=class K6 extends Ye{constructor(e,t,i,r,s){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=r,this._editors=s,this._originalScrollTop=Gs(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Gs(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Fu("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Ar(this,0),this._modifiedViewZonesChangedSignal=Fu("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Fu("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Pk(this,(u,d)=>{var I;this._element.replaceChildren();const f=this._diffModel.read(u),p=(I=f==null?void 0:f.diff.read(u))==null?void 0:I.movedTexts;if(!p||p.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(u);const g=this._originalEditorLayoutInfo.read(u),m=this._modifiedEditorLayoutInfo.read(u);if(!g||!m){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(u),this._originalViewZonesChangedSignal.read(u);const _=p.map(L=>{function N(U,G){const H=G.getTopForLineNumber(U.startLineNumber,!0),z=G.getTopForLineNumber(U.endLineNumberExclusive,!0);return(H+z)/2}const P=N(L.lineRangeMapping.original,this._editors.original),O=this._originalScrollTop.read(u),F=N(L.lineRangeMapping.modified,this._editors.modified),V=this._modifiedScrollTop.read(u),M=P-O,B=F-V,W=Math.min(P,F),q=Math.max(P,F);return{range:new Pr(W,q),from:M,to:B,fromWithoutScroll:P,toWithoutScroll:F,move:L}});_.sort(Grr(kh(L=>L.fromWithoutScroll>L.toWithoutScroll,Yrr),kh(L=>L.fromWithoutScroll>L.toWithoutScroll?L.fromWithoutScroll:-L.toWithoutScroll,z_)));const v=M2e.compute(_.map(L=>L.range)),b=10,y=g.verticalScrollbarWidth,C=(v.getTrackCount()-1)*10+b*2,S=y+C+(m.contentLeft-K6.movedCodeBlockPadding);let k=0;for(const L of _){const N=v.getTrack(k),P=y+b+N*10,O=15,F=15,V=S,M=m.glyphMarginWidth+m.lineNumbersWidth,B=18,W=document.createElementNS("http://www.w3.org/2000/svg","rect");W.classList.add("arrow-rectangle"),W.setAttribute("x",`${V-M}`),W.setAttribute("y",`${L.to-B/2}`),W.setAttribute("width",`${M}`),W.setAttribute("height",`${B}`),this._element.appendChild(W);const q=document.createElementNS("http://www.w3.org/2000/svg","g"),U=document.createElementNS("http://www.w3.org/2000/svg","path");U.setAttribute("d",`M 0 ${L.from} L ${P} ${L.from} L ${P} ${L.to} L ${V-F} ${L.to}`),U.setAttribute("fill","none"),q.appendChild(U);const G=document.createElementNS("http://www.w3.org/2000/svg","polygon");G.classList.add("arrow"),d.add(Gi(H=>{U.classList.toggle("currentMove",L.move===f.activeMovedText.read(H)),G.classList.toggle("currentMove",L.move===f.activeMovedText.read(H))})),G.setAttribute("points",`${V-F},${L.to-O/2} ${V},${L.to} ${V-F},${L.to+O/2}`),q.appendChild(G),this._element.appendChild(q),k++}this.width.set(C,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(gi(()=>this._element.remove())),this._register(Gi(u=>{const d=this._originalEditorLayoutInfo.read(u),f=this._modifiedEditorLayoutInfo.read(u);!d||!f||(this._element.style.left=`${d.width-d.verticalScrollbarWidth}px`,this._element.style.height=`${d.height}px`,this._element.style.width=`${d.verticalScrollbarWidth+d.contentLeft-K6.movedCodeBlockPadding+this.width.read(u)}px`)})),this._register(Z4(this._state));const o=ai(u=>{const d=this._diffModel.read(u),f=d==null?void 0:d.diff.read(u);return f?f.movedTexts.map(p=>({move:p,original:new WR(vm(p.lineRangeMapping.original.startLineNumber-1),18),modified:new WR(vm(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(_Y(this._editors.original,o.map(u=>u.map(d=>d.original)))),this._register(_Y(this._editors.modified,o.map(u=>u.map(d=>d.modified)))),this._register(uf((u,d)=>{const f=o.read(u);for(const p of f)d.add(new l$e(this._editors.original,p.original,p.move,"original",this._diffModel.get())),d.add(new l$e(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=Fu("original.onDidFocusEditorWidget",u=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0))),l=Fu("modified.onDidFocusEditorWidget",u=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0)));let c="modified";this._register(s$({createEmptyChangeSummary:()=>{},handleChange:(u,d)=>(u.didChange(a)&&(c="original"),u.didChange(l)&&(c="modified"),!0)},u=>{a.read(u),l.read(u);const d=this._diffModel.read(u);if(!d)return;const f=d.diff.read(u);let p;if(f&&c==="original"){const g=this._editors.originalCursor.read(u);g&&(p=f.movedTexts.find(m=>m.lineRangeMapping.original.contains(g.lineNumber)))}if(f&&c==="modified"){const g=this._editors.modifiedCursor.read(u);g&&(p=f.movedTexts.find(m=>m.lineRangeMapping.modified.contains(g.lineNumber)))}p!==d.movedTextToCompare.get()&&d.movedTextToCompare.set(void 0,void 0),d.setActiveMovedText(p)}))}};K6.movedCodeBlockPadding=4;let XP=K6;class M2e{static compute(e){const t=[],i=[];for(const r of e){let s=t.findIndex(o=>!o.intersectsStrict(r));s===-1&&(t.length>=6?s=Nur(t,kh(a=>a.intersectWithRangeLength(r),z_)):(s=t.length,t.push(new Mke))),t[s].addRange(r),i.push(s)}return new M2e(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class l$e extends k2e{constructor(e,t,i,r,s){const o=jr("div.diff-hidden-lines-widget");super(e,t,o.root),this._editor=e,this._move=i,this._kind=r,this._diffModel=s,this._nodes=jr("div.diff-moved-code-block",{style:{marginRight:"4px"}},[jr("div.text-content@textContent"),jr("div.action-bar@actionBar")]),o.root.appendChild(this._nodes.root);const a=Gs(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Ow(this._nodes.root,{paddingRight:a.map(f=>f.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?A("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):A("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?A("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):A("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new hg(this._nodes.actionBar,{highlightToggledItems:!0})),u=new Zf("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new Zf("","Compare",Ni.asClassName(Yt.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(Gi(f=>{const p=this._diffModel.movedTextToCompare.read(f)===i;d.checked=p})),c.push(d,{icon:!1,label:!0})}}class YSr extends Ye{constructor(e,t,i,r){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=ai(this,s=>{const o=this._diffModel.read(s),a=o==null?void 0:o.diff.read(s);if(!a)return null;const l=this._diffModel.read(s).movedTextToCompare.read(s),c=this._options.renderIndicators.read(s),u=this._options.showEmptyDecorations.read(s),d=[],f=[];if(!l)for(const g of a.mappings)if(g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?Z7:t$e}),g.lineRangeMapping.modified.isEmpty||f.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?bY:e$e}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:N2e}),g.lineRangeMapping.modified.isEmpty||f.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:L2e});else{const m=this._options.useTrueInlineDiffRendering.read(s)&&O2e(g.lineRangeMapping);for(const _ of g.lineRangeMapping.innerChanges||[])if(g.lineRangeMapping.original.contains(_.originalRange.startLineNumber)&&d.push({range:_.originalRange,options:_.originalRange.isEmpty()&&u?D2e:TM}),g.lineRangeMapping.modified.contains(_.modifiedRange.startLineNumber)&&f.push({range:_.modifiedRange,options:_.modifiedRange.isEmpty()&&u&&!m?A2e:yY}),m){const v=o.model.original.getValueInRange(_.originalRange);f.push({range:_.modifiedRange,options:{description:"deleted-text",before:{content:v,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(l)for(const g of l.changes){const m=g.original.toInclusiveRange();m&&d.push({range:m,options:c?Z7:t$e});const _=g.modified.toInclusiveRange();_&&f.push({range:_,options:c?bY:e$e});for(const v of g.innerChanges||[])d.push({range:v.originalRange,options:TM}),f.push({range:v.modifiedRange,options:yY})}const p=this._diffModel.read(s).activeMovedText.read(s);for(const g of a.movedTexts)d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===p?" currentMove":""),blockPadding:[XP.movedCodeBlockPadding,0,XP.movedCodeBlockPadding,XP.movedCodeBlockPadding]}}),f.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===p?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:f}}),this._register(mY(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(mY(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class QSr{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=i$(this,i=>{const r=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(r,i)},(i,r)=>{const s=this.dimensions.width.get();this._sashRatio.set(i/s,r)}),this._sashRatio=Ar(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),r=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),s=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):r,o=100;return i<=o*2?r:s<o?o:s>i-o?i-o:s}}class udt extends Ye{constructor(e,t,i,r,s,o){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=r,this.sashLeft=s,this._resetSash=o,this._sash=this._register(new td(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>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(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(Gi(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(Gi(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class XSr extends Ye{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Gs(this,this._editor.onDidScrollChange,o=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(o=>o===0),this.modelAttached=Gs(this,this._editor.onDidChangeModel,o=>this._editor.hasModel()),this.editorOnDidChangeViewZones=Fu("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=Fu("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=X4("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const r=this._domNode.appendChild(jr("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),s=new ResizeObserver(()=>{va(o=>{this.domNodeSizeChanged.trigger(o)})});s.observe(this._domNode),this._register(gi(()=>s.disconnect())),this._register(Gi(o=>{r.className=this.isScrollTopZero.read(o)?"":"scroll-decoration"})),this._register(Gi(o=>this.render(o)))}dispose(){super.dispose(),_u(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),r=new Set(this.views.keys()),s=Pr.ofStartAndLength(0,this._domNode.clientHeight);if(!s.isEmpty)for(const o of i){const a=new fr(o.startLineNumber,o.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);va(c=>{for(const u of l){if(!u.range.intersect(a))continue;r.delete(u.id);let d=this.views.get(u.id);if(d)d.item.set(u,c);else{const m=document.createElement("div");this._domNode.appendChild(m);const _=Ar("item",u),v=this.itemProvider.createView(_,m);d=new ZSr(_,v,m),this.views.set(u.id,d)}const f=u.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(u.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(u.range.startLineNumber-1,!1)-t,g=(u.range.endLineNumberExclusive===1?Math.max(f,this._editor.getTopForLineNumber(u.range.startLineNumber,!1)-t):Math.max(f,this._editor.getBottomForLineNumber(u.range.endLineNumberExclusive-1,!0)-t))-f;d.domNode.style.top=`${f}px`,d.domNode.style.height=`${g}px`,d.gutterItemView.layout(Pr.ofStartAndLength(f,g),s)}})}for(const o of r){const a=this.views.get(o);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(o)}}}class ZSr{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class ddt extends HL{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class c$e extends Lat{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new av(e-1,t)}}class JSr extends Ye{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new yor),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Et),i.hoverDelegate=i.hoverDelegate??this._register(bM()),this.options=i,this.toggleMenuAction=this._register(new J7(()=>{var r;return(r=this.toggleMenuActionViewItem)==null?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 hg(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(r,s)=>{if(r.id===J7.ID)return this.toggleMenuActionViewItem=new wG(r,r.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Ni.asClassNameArray(i.moreIcon??Yt.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const o=i.actionViewItemProvider(r,s);if(o)return o}if(r instanceof oM){const o=new wG(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,hoverDelegate:this.options.hoverDelegate});return o.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(o),this.disposables.add(this._onDidChangeDropdownVisibility.add(o.onDidChangeVisibility)),o}}}))}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:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(r)})})}getKeybindingLabel(e){var i,r;const t=(r=(i=this.options).getKeyBinding)==null?void 0:r.call(i,e);return(t==null?void 0:t.getLabel())??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const mX=class mX extends Zf{constructor(e,t){t=t||A("moreActions","More Actions..."),super(mX.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};mX.ID="toolbar.toggle.more";let J7=mX;var hdt=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},D_=function(n,e){return function(t,i){e(t,i,n)}};let eB=class extends JSr{constructor(e,t,i,r,s,o,a,l){super(e,s,{getKeyBinding:u=>o.lookupKeybinding(u.id)??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=s,this._keybindingService=o,this._commandService=a,this._sessionDisposables=this._store.add(new Et);const c=t==null?void 0:t.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(u=>l.publicLog2("workbenchActionExecuted",{id:u.action.id,from:c})))}setActions(e,t=[],i){var u,d,f;this._sessionDisposables.clear();const r=e.slice(),s=t.slice(),o=[];let a=0;const l=[];let c=!1;if(((u=this._options)==null?void 0:u.hiddenItemStrategy)!==-1)for(let p=0;p<r.length;p++){const g=r[p];!(g instanceof Jf)&&!(g instanceof RP)||g.hideActions&&(o.push(g.hideActions.toggle),g.hideActions.toggle.checked&&a++,g.hideActions.isHidden&&(c=!0,r[p]=void 0,((d=this._options)==null?void 0:d.hiddenItemStrategy)!==0&&(l[p]=g)))}if(((f=this._options)==null?void 0:f.overflowBehavior)!==void 0){const p=pvr(new Set(this._options.overflowBehavior.exempted),ss.map(r,_=>_==null?void 0:_.id)),g=this._options.overflowBehavior.maxItems-p.size;let m=0;for(let _=0;_<r.length;_++){const v=r[_];v&&(m++,!p.has(v.id)&&m>=g&&(r[_]=void 0,l[_]=v))}}$6e(r),$6e(l),super.setActions(r,Ac.join(l,s)),(o.length>0||r.length>0)&&this._sessionDisposables.add(_t(this.getElement(),"contextmenu",p=>{var b,y,C,S,k;const g=new B_(Ti(this.getElement()),p),m=this.getItemAction(g.target);if(!m)return;g.preventDefault(),g.stopPropagation();const _=[];if(m instanceof Jf&&m.menuKeybinding)_.push(m.menuKeybinding);else if(!(m instanceof RP||m instanceof J7)){const I=!!this._keybindingService.lookupKeybinding(m.id);_.push(Lut(this._commandService,this._keybindingService,m.id,void 0,I))}if(o.length>0){let I=!1;if(a===1&&((b=this._options)==null?void 0:b.hiddenItemStrategy)===0){I=!0;for(let L=0;L<o.length;L++)if(o[L].checked){o[L]=uI({id:m.id,label:m.label,checked:!0,enabled:!1,run(){}});break}}if(!I&&(m instanceof Jf||m instanceof RP)){if(!m.hideActions)return;_.push(m.hideActions.hide)}else _.push(uI({id:"label",label:A("hide","Hide"),enabled:!1,run(){}}))}const v=Ac.join(_,o);(y=this._options)!=null&&y.resetMenu&&!i&&(i=[this._options.resetMenu]),c&&i&&(v.push(new Ac),v.push(uI({id:"resetThisMenu",label:A("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),v.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>g,getActions:()=>v,menuId:(C=this._options)==null?void 0:C.contextMenu,menuActionOptions:{renderShortTitle:!0,...(S=this._options)==null?void 0:S.menuOptions},skipTelemetry:typeof((k=this._options)==null?void 0:k.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};eB=hdt([D_(2,Eg),D_(3,Oi),D_(4,up),D_(5,Ws),D_(6,Fo),D_(7,md)],eB);let CY=class extends eB{constructor(e,t,i,r,s,o,a,l,c){super(e,{resetMenu:t,...i},r,s,o,a,l,c),this._onDidChangeMenuItems=this._store.add(new Ue),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const u=this._store.add(r.createMenu(t,s,{emitEventsForSubmenuChanges:!0})),d=()=>{var g,m,_;const f=[],p=[];jte(u,i==null?void 0:i.menuOptions,{primary:f,secondary:p},(g=i==null?void 0:i.toolbarOptions)==null?void 0:g.primaryGroup,(m=i==null?void 0:i.toolbarOptions)==null?void 0:m.shouldInlineSubmenu,(_=i==null?void 0:i.toolbarOptions)==null?void 0:_.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",f.length===0&&p.length===0),super.setActions(f,p)};this._store.add(u.onDidChange(()=>{d(),this._onDidChangeMenuItems.fire(this)})),d()}setActions(){throw new Ps("This toolbar is populated from a menu.")}};CY=hdt([D_(3,Eg),D_(4,Oi),D_(5,up),D_(6,Ws),D_(7,Fo),D_(8,md)],CY);var fdt=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},xU=function(n,e){return function(t,i){e(t,i,n)}};const Nue=[],RW=35;let $be=class extends Ye{constructor(e,t,i,r,s,o,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=r,this._sashLayout=s,this._boundarySashes=o,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(zn.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Gs(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(u=>u.length>0),this._showSash=ai(this,u=>this._options.renderSideBySide.read(u)&&this._hasActions.read(u)),this.width=ai(this,u=>this._hasActions.read(u)?RW:0),this.elements=jr("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:RW+"px"}},[]),this._currentDiff=ai(this,u=>{var g;const d=this._diffModel.read(u);if(!d)return;const f=(g=d.diff.read(u))==null?void 0:g.mappings,p=this._editors.modifiedCursor.read(u);if(p)return f==null?void 0:f.find(m=>m.lineRangeMapping.modified.contains(p.lineNumber))}),this._selectedDiffs=ai(this,u=>{const d=this._diffModel.read(u),f=d==null?void 0:d.diff.read(u);if(!f)return Nue;const p=this._editors.modifiedSelections.read(u);if(p.every(v=>v.isEmpty()))return Nue;const g=new um(p.map(v=>fr.fromRangeInclusive(v))),_=f.mappings.filter(v=>v.lineRangeMapping.innerChanges&&g.intersects(v.lineRangeMapping.modified)).map(v=>({mapping:v,rangeMappings:v.lineRangeMapping.innerChanges.filter(b=>p.some(y=>ie.areIntersecting(b.modifiedRange,y)))}));return _.length===0||_.every(v=>v.rangeMappings.length===0)?Nue:_}),this._register(wSr(e,this.elements.root)),this._register(_t(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(Ow(this.elements.root,{display:this._hasActions.map(u=>u?"block":"none")})),$d(this,u=>this._showSash.read(u)?new udt(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,i$(this,f=>this._sashLayout.sashLeft.read(f)-RW,(f,p)=>this._sashLayout.sashLeft.set(f+RW,p)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new XSr(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(u,d)=>{const f=this._diffModel.read(d);if(!f)return[];const p=f.diff.read(d);if(!p)return[];const g=this._selectedDiffs.read(d);if(g.length>0){const _=dg.fromRangeMappings(g.flatMap(v=>v.rangeMappings));return[new u$e(_,!0,zn.DiffEditorSelectionToolbar,void 0,f.model.original.uri,f.model.modified.uri)]}const m=this._currentDiff.read(d);return p.mappings.map(_=>new u$e(_.lineRangeMapping.withInnerChangesFromLineRanges(),_.lineRangeMapping===(m==null?void 0:m.lineRangeMapping),zn.DiffEditorHunkToolbar,void 0,f.model.original.uri,f.model.modified.uri))},createView:(u,d)=>this._instantiationService.createInstance(Hbe,u,d,this)})),this._register(_t(this.elements.gutter,Xt.MOUSE_WHEEL,u=>{this._editors.modified.getOption(104).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new c$e(this._editors.modifiedModel.get()),r=new c$e(this._editors.original.getModel());return new Fke(t.map(a=>a.toTextEdit(i))).apply(r)}layout(e){this.elements.gutter.style.left=e+"px"}};$be=fdt([xU(6,mi),xU(7,Oi),xU(8,Eg)],$be);class u$e{constructor(e,t,i,r,s,o){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=r,this.originalUri=s,this.modifiedUri=o}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let Hbe=class extends Ye{constructor(e,t,i,r){super(),this._item=e,this._elements=jr("div.gutterItem",{style:{height:"20px",width:"34px"}},[jr("div.background@background",{},[]),jr("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,o=>o.showAlways),this._menuId=this._item.map(this,o=>o.menuId),this._isSmall=Ar(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const s=this._register(r.createInstance(hM,"element",!0,{position:{hoverPosition:1}}));this._register(VR(t,this._elements.root)),this._register(Gi(o=>{const a=this._showAlways.read(o);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(uf((o,a)=>{this._elements.buttons.replaceChildren();const l=a.add(r.createInstance(CY,this._elements.buttons,this._menuId.read(o),{orientation:1,hoverDelegate:s,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(o)?1:3},hiddenItemStrategy:0,actionRunner:new ddt(()=>{const c=this._item.get(),u=c.mapping;return{mapping:u,originalWithModifiedChanges:i.computeStagedValue(u),originalUri:c.originalUri,modifiedUri:c.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const r=e.length/2-i/2,s=i;let o=e.start+r;const a=Pr.tryCreate(s,t.endExclusive-s-i),l=Pr.tryCreate(e.start+s,e.endExclusive-i-s);l&&a&&l.start<l.endExclusive&&(o=a.clip(o),o=l.clip(o)),this._elements.buttons.style.top=`${o-e.start}px`}};Hbe=fdt([xU(3,mi)],Hbe);function Gf(n){return Vbe.get(n)}const hS=class hS extends Ye{static get(e){let t=hS._map.get(e);if(!t){t=new hS(e),hS._map.set(e,t);const i=e.onDidDispose(()=>{const r=hS._map.get(e);r&&(hS._map.delete(e),r.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new Q4(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){var t;super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=Ar(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Gs(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(92)),this._versionId=K_e({owner:this,lazy:!0},((t=this.editor.getModel())==null?void 0:t.getVersionId())??null),this.versionId=this._versionId,this._selections=K_e({owner:this,equalsFn:z_e(bG(Yn.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.isFocused=Gs(this,i=>{const r=this.editor.onDidFocusEditorWidget(i),s=this.editor.onDidBlurEditorWidget(i);return{dispose(){r.dispose(),s.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=i$(this,i=>{var r;return this.versionId.read(i),((r=this.model.read(i))==null?void 0:r.getValue())??""},(i,r)=>{const s=this.model.get();s!==null&&i!==s.getValue()&&s.setValue(i)}),this.valueIsEmpty=ai(this,i=>{var r;return this.versionId.read(i),((r=this.editor.getModel())==null?void 0:r.getValueLength())===0}),this.cursorSelection=Yp({owner:this,equalsFn:z_e(Yn.selectionsEqual)},i=>{var r;return((r=this.selections.read(i))==null?void 0:r[0])??null}),this.onDidType=X4(this),this.scrollTop=Gs(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Gs(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Gs(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(i=>i.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(i=>i.decorationsLeft),this.contentWidth=Gs(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this._overlayWidgetCounter=0,this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(i=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,i)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(i=>{var r;this._beginUpdate();try{this._versionId.set(((r=this.editor.getModel())==null?void 0:r.getVersionId())??null,this._currentTransaction,i),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(i=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,i),this._forceUpdate()}finally{this._endUpdate()}}))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){var e;this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(((e=this.editor.getModel())==null?void 0:e.getVersionId())??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e){return Gs(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e))}setDecorations(e){const t=new Et,i=this.editor.createDecorationsCollection();return t.add(r$({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const s=e.read(r);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._overlayWidgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const r=Gi(s=>{e.position.read(s),e.minContentWidthInPx.read(s),this.editor.layoutOverlayWidget(i)});return gi(()=>{r.dispose(),this.editor.removeOverlayWidget(i)})}};hS._map=new Map;let Vbe=hS;function Wbe(n,e){return Smr({createEmptyChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(n)){const r=t.change;r!==void 0&&i.deltas.push(r),i.didChange=!0}return!0}},(t,i)=>{const r=n.read(t);i.didChange&&e(r,i.deltas)})}function eEr(n,e){const t=new Et,i=Wbe(n,(r,s)=>{t.clear(),e(r,s,t)});return{dispose(){i.dispose(),t.dispose()}}}var tEr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},nEr=function(n,e){return function(t,i){e(t,i,n)}},SU,LI;let wY=(LI=class extends Ye{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,r){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=r,this._modifiedOutlineSource=$d(this,l=>{const c=this._editors.modifiedModel.read(l),u=SU._breadcrumbsSourceFactory.read(l);return!c||!u?void 0:u(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();va(u=>{for(const d of this._editors.original.getSelections()||[])c==null||c.ensureOriginalLineIsVisible(d.getStartPosition().lineNumber,0,u),c==null||c.ensureOriginalLineIsVisible(d.getEndPosition().lineNumber,0,u)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();va(u=>{for(const d of this._editors.modified.getSelections()||[])c==null||c.ensureModifiedLineIsVisible(d.getStartPosition().lineNumber,0,u),c==null||c.ensureModifiedLineIsVisible(d.getEndPosition().lineNumber,0,u)})}));const s=this._diffModel.map((l,c)=>{var d;const u=(l==null?void 0:l.unchangedRegions.read(c))??[];return u.length===1&&u[0].modifiedLineNumber===1&&u[0].lineCount===((d=this._editors.modifiedModel.read(c))==null?void 0:d.getLineCount())?[]:u});this.viewZones=Pk(this,(l,c)=>{const u=this._modifiedOutlineSource.read(l);if(!u)return{origViewZones:[],modViewZones:[]};const d=[],f=[],p=this._options.renderSideBySide.read(l),g=this._options.compactMode.read(l),m=s.read(l);for(let _=0;_<m.length;_++){const v=m[_];if(!v.shouldHideControls(l)&&!(g&&(_===0||_===m.length-1)))if(g){{const b=ai(this,C=>v.getHiddenOriginalRange(C).startLineNumber-1),y=new WR(b,12);d.push(y),c.add(new d$e(this._editors.original,y,v,!p))}{const b=ai(this,C=>v.getHiddenModifiedRange(C).startLineNumber-1),y=new WR(b,12);f.push(y),c.add(new d$e(this._editors.modified,y,v))}}else{{const b=ai(this,C=>v.getHiddenOriginalRange(C).startLineNumber-1),y=new WR(b,24);d.push(y),c.add(new h$e(this._editors.original,y,v,v.originalUnchangedRange,!p,u,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,2,void 0),this._options))}{const b=ai(this,C=>v.getHiddenModifiedRange(C).startLineNumber-1),y=new WR(b,24);f.push(y),c.add(new h$e(this._editors.modified,y,v,v.modifiedUnchangedRange,!1,u,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,2,void 0),this._options))}}}return{origViewZones:d,modViewZones:f}});const o={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new rd(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(A("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Ni.asClassName(Yt.fold),zIndex:10001};this._register(mY(this._editors.original,ai(this,l=>{const c=s.read(l),u=c.map(d=>({range:d.originalUnchangedRange.toInclusiveRange(),options:o}));for(const d of c)d.shouldHideControls(l)&&u.push({range:ie.fromPositions(new We(d.originalLineNumber,1)),options:a});return u}))),this._register(mY(this._editors.modified,ai(this,l=>{const c=s.read(l),u=c.map(d=>({range:d.modifiedUnchangedRange.toInclusiveRange(),options:o}));for(const d of c)d.shouldHideControls(l)&&u.push({range:fr.ofLength(d.modifiedLineNumber,1).toInclusiveRange(),options:a});return u}))),this._register(Gi(l=>{const c=s.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(u=>u.getHiddenOriginalRange(l).toInclusiveRange()).filter(Oy)),this._editors.modified.setHiddenAreas(c.map(u=>u.getHiddenModifiedRange(l).toInclusiveRange()).filter(Oy))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const f=d.unchangedRegions.get().find(p=>p.modifiedUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const f=d.unchangedRegions.get().find(p=>p.originalUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}},SU=LI,LI._breadcrumbsSourceFactory=Ar(SU,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),LI);wY=SU=tEr([nEr(3,mi)],wY);class d$e extends k2e{constructor(e,t,i,r=!1){const s=jr("div.diff-hidden-lines-widget");super(e,t,s.root),this._unchangedRegion=i,this._hide=r,this._nodes=jr("div.diff-hidden-lines-compact",[jr("div.line-left",[]),jr("div.text@text",[]),jr("div.line-right",[])]),s.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(Gi(o=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(o).length,l=A("hiddenLines","{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class h$e extends k2e{constructor(e,t,i,r,s,o,a,l){const c=jr("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=r,this._hide=s,this._modifiedOutlineSource=o,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=jr("div.diff-hidden-lines",[jr("div.top@top",{title:A("diff.hiddenLines.top","Click or drag to show more above")}),jr("div.center@content",{style:{display:"flex"}},[jr("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[Jt("a",{title:A("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...uE("$(unfold)"))]),jr("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),jr("div.bottom@bottom",{title:A("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?_u(this._nodes.first):this._register(Ow(this._nodes.first,{width:Gf(this._editor).layoutInfoContentLeft})),this._register(Gi(d=>{const f=this._unchangedRegion.visibleLineCountTop.read(d)+this._unchangedRegion.visibleLineCountBottom.read(d)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(d)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(d)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const p=this._unchangedRegion.isDragged.read(d),g=this._editor.getDomNode();g&&(g.classList.toggle("draggingUnchangedRegion",!!p),p==="top"?(g.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(d)>0),g.classList.toggle("canMoveBottom",!f)):p==="bottom"?(g.classList.toggle("canMoveTop",!f),g.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(d)>0)):(g.classList.toggle("canMoveTop",!1),g.classList.toggle("canMoveBottom",!1)))}));const u=this._editor;this._register(_t(this._nodes.top,"mousedown",d=>{if(d.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),d.preventDefault();const f=d.clientY;let p=!1;const g=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const m=Ti(this._nodes.top),_=_t(m,"mousemove",b=>{const C=b.clientY-f;p=p||Math.abs(C)>2;const S=Math.round(C/u.getOption(67)),k=Math.max(0,Math.min(g+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(k,void 0)}),v=_t(m,"mouseup",b=>{p||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),_.dispose(),v.dispose()})})),this._register(_t(this._nodes.bottom,"mousedown",d=>{if(d.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),d.preventDefault();const f=d.clientY;let p=!1;const g=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const m=Ti(this._nodes.bottom),_=_t(m,"mousemove",b=>{const C=b.clientY-f;p=p||Math.abs(C)>2;const S=Math.round(C/u.getOption(67)),k=Math.max(0,Math.min(g-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),I=this._unchangedRegionRange.endLineNumberExclusive>u.getModel().getLineCount()?u.getContentHeight():u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(k,void 0);const L=this._unchangedRegionRange.endLineNumberExclusive>u.getModel().getLineCount()?u.getContentHeight():u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(L-I))}),v=_t(m,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!p){const y=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const C=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(C-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),v.dispose()})})),this._register(Gi(d=>{const f=[];if(!this._hide){const p=i.getHiddenModifiedRange(d).length,g=A("hiddenLines","{0} hidden lines",p),m=Jt("span",{title:A("diff.hiddenLines.expandAll","Double click to unfold")},g);m.addEventListener("dblclick",b=>{b.button===0&&(b.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(m);const _=this._unchangedRegion.getHiddenModifiedRange(d),v=this._modifiedOutlineSource.getBreadcrumbItems(_,d);if(v.length>0){f.push(Jt("span",void 0," | "));for(let b=0;b<v.length;b++){const y=v[b],C=OK.toIcon(y.kind),S=jr("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[zL(C)," ",y.name,...b===v.length-1?[]:[zL(Yt.chevronRight)]]).root;f.push(S),S.onclick=()=>{this._revealModifiedHiddenLine(y.startLineNumber)}}}}_u(this._nodes.others,...f)}))}}var iEr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},rEr=function(n,e){return function(t,i){e(t,i,n)}},Wv,ew;let tB=(ew=class extends Ye{constructor(e,t,i,r,s,o,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=r,this._rootHeight=s,this._modifiedEditorLayoutInfo=o,this._themeService=a,this.width=Wv.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=Gs(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=ai(f=>{const p=l.read(f),g=p.getColor(Shr)||(p.getColor(whr)||h_e).transparent(2),m=p.getColor(Ehr)||(p.getColor(xhr)||f_e).transparent(2);return{insertColor:g,removeColor:m}}),u=Hs(document.createElement("div"));u.setClassName("diffViewport"),u.setPosition("absolute");const d=jr("div.diffOverview",{style:{position:"absolute",top:"0px",width:Wv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(VR(d,u.domNode)),this._register(Da(d,Xt.POINTER_DOWN,f=>{this._editors.modified.delegateVerticalScrollbarPointerDown(f)})),this._register(_t(d,Xt.MOUSE_WHEEL,f=>{this._editors.modified.delegateScrollFromMouseWheelEvent(f)},{passive:!1})),this._register(VR(this._rootElement,d)),this._register(uf((f,p)=>{const g=this._diffModel.read(f),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(p.add(m),p.add(VR(d,m.getDomNode())));const _=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(_&&(p.add(_),p.add(VR(d,_.getDomNode()))),!m||!_)return;const v=Fu("viewZoneChanged",this._editors.original.onDidChangeViewZones),b=Fu("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=Fu("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),C=Fu("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);p.add(Gi(S=>{var O;v.read(S),b.read(S),y.read(S),C.read(S);const k=c.read(S),I=(O=g==null?void 0:g.diff.read(S))==null?void 0:O.mappings;function L(F,V,M){const B=M._getViewModel();return B?F.filter(W=>W.length>0).map(W=>{const q=B.coordinatesConverter.convertModelPositionToViewPosition(new We(W.startLineNumber,1)),U=B.coordinatesConverter.convertModelPositionToViewPosition(new We(W.endLineNumberExclusive,1)),G=U.lineNumber-q.lineNumber;return new edt(q.lineNumber,U.lineNumber,G,V.toString())}):[]}const N=L((I||[]).map(F=>F.lineRangeMapping.original),k.removeColor,this._editors.original),P=L((I||[]).map(F=>F.lineRangeMapping.modified),k.insertColor,this._editors.modified);m==null||m.setZones(N),_==null||_.setZones(P)})),p.add(Gi(S=>{const k=this._rootHeight.read(S),I=this._rootWidth.read(S),L=this._modifiedEditorLayoutInfo.read(S);if(L){const N=Wv.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Wv.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:k,right:N+Wv.ONE_OVERVIEW_WIDTH,width:Wv.ONE_OVERVIEW_WIDTH}),_.setLayout({top:0,height:k,right:0,width:Wv.ONE_OVERVIEW_WIDTH});const P=this._editors.modifiedScrollTop.read(S),O=this._editors.modifiedScrollHeight.read(S),F=this._editors.modified.getOption(104),V=new pM(F.verticalHasArrows?F.arrowSize:0,F.verticalScrollbarSize,0,L.height,O,P);u.setTop(V.getSliderPosition()),u.setHeight(V.getSliderSize())}else u.setTop(0),u.setHeight(0);d.style.height=k+"px",d.style.left=I-Wv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",u.setWidth(Wv.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},Wv=ew,ew.ONE_OVERVIEW_WIDTH=15,ew.ENTIRE_DIFF_OVERVIEW_WIDTH=ew.ONE_OVERVIEW_WIDTH*2,ew);tB=Wv=iEr([rEr(6,mc)],tB);const Due=[];class sEr extends Ye{constructor(e,t,i,r){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=r,this._selectedDiffs=ai(this,s=>{const o=this._diffModel.read(s),a=o==null?void 0:o.diff.read(s);if(!a)return Due;const l=this._editors.modifiedSelections.read(s);if(l.every(f=>f.isEmpty()))return Due;const c=new um(l.map(f=>fr.fromRangeInclusive(f))),d=a.mappings.filter(f=>f.lineRangeMapping.innerChanges&&c.intersects(f.lineRangeMapping.modified)).map(f=>({mapping:f,rangeMappings:f.lineRangeMapping.innerChanges.filter(p=>l.some(g=>ie.areIntersecting(p.modifiedRange,g)))}));return d.length===0||d.every(f=>f.rangeMappings.length===0)?Due:d}),this._register(uf((s,o)=>{if(!this._options.shouldRenderOldRevertArrows.read(s))return;const a=this._diffModel.read(s),l=a==null?void 0:a.diff.read(s);if(!a||!l||a.movedTextToCompare.read(s))return;const c=[],u=this._selectedDiffs.read(s),d=new Set(u.map(f=>f.mapping));if(u.length>0){const f=this._editors.modifiedSelections.read(s),p=o.add(new xY(f[f.length-1].positionLineNumber,this._widget,u.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(p),c.push(p)}for(const f of l.mappings)if(!d.has(f)&&!f.lineRangeMapping.modified.isEmpty&&f.lineRangeMapping.innerChanges){const p=o.add(new xY(f.lineRangeMapping.modified.startLineNumber,this._widget,f.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(p),c.push(p)}o.add(gi(()=>{for(const f of c)this._editors.modified.removeGlyphMarginWidget(f)}))}))}}const _X=class _X extends Ye{getId(){return this._id}constructor(e,t,i,r){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=r,this._id=`revertButton${_X.counter++}`,this._domNode=jr("div.revertButton",{title:this._revertSelection?A("revertSelectedChanges","Revert Selected Changes"):A("revertChange","Revert Change")},[zL(Yt.arrowRight)]).root,this._register(_t(this._domNode,Xt.MOUSE_DOWN,s=>{s.button!==2&&(s.stopPropagation(),s.preventDefault())})),this._register(_t(this._domNode,Xt.MOUSE_UP,s=>{s.stopPropagation(),s.preventDefault()})),this._register(_t(this._domNode,Xt.CLICK,s=>{this._diffs instanceof Ud?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),s.stopPropagation(),s.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:ov.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};_X.counter=0;let xY=_X;function oEr(n,e,t){return kmr({debugName:()=>`Configuration Key "${n}"`},i=>t.onDidChangeConfiguration(r=>{r.affectsConfiguration(n)&&i(r)}),()=>t.getValue(n)??e)}function Kv(n,e,t){const i=n.bindTo(e);return r$({debugName:()=>`Set Context Key "${n.key}"`},r=>{i.set(t(r))})}var aEr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},f$e=function(n,e){return function(t,i){e(t,i,n)}};let zbe=class extends Ye{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,r,s,o,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=r,this._createInnerEditor=s,this._instantiationService=o,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new Ue),this.modifiedScrollTop=Gs(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Gs(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=Gf(this.modified),this.originalObs=Gf(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Gs(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Yp({owner:this,equalsFn:We.equals},l=>{var c;return((c=this.modifiedSelections.read(l)[0])==null?void 0:c.getPosition())??new We(1,1)}),this.originalCursor=Gs(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new We(1,1)),this._argCodeEditorWidgetOptions=null,this._register(s$({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 s=this._createInnerEditor(e,t,i,r);return this._register(s.onDidContentSizeChange(o=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+tB.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:o.contentHeightChanged,contentWidthChanged:o.contentWidthChanged})})),s}_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}),i.glyphMargin=this._options.renderSideBySide.get(),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=Xb.revealHorizontalRightPadding.defaultValue+tB.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...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 i;e||(e="");const t=A("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(i=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))==null?void 0:i.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};zbe=aEr([f$e(5,mi),f$e(6,Ws)],zbe);const vX=class vX extends Ye{constructor(){super(...arguments),this._id=++vX.idCounter,this._onDidDispose=this._register(new Ue),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)}};vX.idCounter=0;let Ube=vX;var lEr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},cEr=function(n,e){return function(t,i){e(t,i,n)}};let qbe=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Ar(this,0),this._screenReaderMode=Gs(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=ai(this,r=>this._options.read(r).renderSideBySide&&this._diffEditorWidth.read(r)<=this._options.read(r).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=ai(this,r=>this._options.read(r).renderOverviewRuler),this.renderSideBySide=ai(this,r=>this.compactMode.read(r)&&this.shouldRenderInlineViewInSmartMode.read(r)?!1:this._options.read(r).renderSideBySide&&!(this._options.read(r).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(r)&&!this._screenReaderMode.read(r))),this.readOnly=ai(this,r=>this._options.read(r).readOnly),this.shouldRenderOldRevertArrows=ai(this,r=>!(!this._options.read(r).renderMarginRevertIcon||!this.renderSideBySide.read(r)||this.readOnly.read(r)||this.shouldRenderGutterMenu.read(r))),this.shouldRenderGutterMenu=ai(this,r=>this._options.read(r).renderGutterMenu),this.renderIndicators=ai(this,r=>this._options.read(r).renderIndicators),this.enableSplitViewResizing=ai(this,r=>this._options.read(r).enableSplitViewResizing),this.splitViewDefaultRatio=ai(this,r=>this._options.read(r).splitViewDefaultRatio),this.ignoreTrimWhitespace=ai(this,r=>this._options.read(r).ignoreTrimWhitespace),this.maxComputationTimeMs=ai(this,r=>this._options.read(r).maxComputationTime),this.showMoves=ai(this,r=>this._options.read(r).experimental.showMoves&&this.renderSideBySide.read(r)),this.isInEmbeddedEditor=ai(this,r=>this._options.read(r).isInEmbeddedEditor),this.diffWordWrap=ai(this,r=>this._options.read(r).diffWordWrap),this.originalEditable=ai(this,r=>this._options.read(r).originalEditable),this.diffCodeLens=ai(this,r=>this._options.read(r).diffCodeLens),this.accessibilityVerbose=ai(this,r=>this._options.read(r).accessibilityVerbose),this.diffAlgorithm=ai(this,r=>this._options.read(r).diffAlgorithm),this.showEmptyDecorations=ai(this,r=>this._options.read(r).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=ai(this,r=>this._options.read(r).onlyShowAccessibleDiffViewer),this.compactMode=ai(this,r=>this._options.read(r).compactMode),this.trueInlineDiffRenderingEnabled=ai(this,r=>this._options.read(r).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=ai(this,r=>!this.renderSideBySide.read(r)&&this.trueInlineDiffRenderingEnabled.read(r)),this.hideUnchangedRegions=ai(this,r=>this._options.read(r).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=ai(this,r=>this._options.read(r).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=ai(this,r=>this._options.read(r).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=ai(this,r=>this._options.read(r).hideUnchangedRegions.minimumLineCount),this._model=Ar(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,r=>Amr(this,s=>{const o=r==null?void 0:r.diff.read(s);return o?uEr(o,this.trueInlineDiffRenderingEnabled.read(s)):void 0})).flatten().map(this,r=>!!r),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...p$e(e,Iu)};this._options=Ar(this,i)}updateOptions(e){const t=p$e(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};qbe=lEr([cEr(1,dp)],qbe);function uEr(n,e){return n.mappings.every(t=>dEr(t.lineRangeMapping)||hEr(t.lineRangeMapping)||e&&O2e(t.lineRangeMapping))}function dEr(n){return n.original.length===0}function hEr(n){return n.modified.length===0}function p$e(n,e){var t,i,r,s,o,a,l,c;return{enableSplitViewResizing:ci(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:msr(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:ci(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:ci(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:t2(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:t2(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:ci(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:ci(n.renderIndicators,e.renderIndicators),originalEditable:ci(n.originalEditable,e.originalEditable),diffCodeLens:ci(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:ci(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:qa(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:qa(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:ci(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:ci((t=n.experimental)==null?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:ci((i=n.experimental)==null?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:ci((r=n.experimental)==null?void 0:r.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:ci(((s=n.hideUnchangedRegions)==null?void 0:s.enabled)??((o=n.experimental)==null?void 0:o.collapseUnchangedRegions),e.hideUnchangedRegions.enabled),contextLineCount:t2((a=n.hideUnchangedRegions)==null?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:t2((l=n.hideUnchangedRegions)==null?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:t2((c=n.hideUnchangedRegions)==null?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:ci(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:ci(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:t2(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:ci(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:ci(n.renderGutterMenu,e.renderGutterMenu),compactMode:ci(n.compactMode,e.compactMode)}}var fEr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},kj=function(n,e){return function(t,i){e(t,i,n)}};let Mw=class extends Ube{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,r,s,o,a,l){super(),this._domElement=e,this._parentContextKeyService=r,this._parentInstantiationService=s,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=jr("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[jr("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),jr("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),jr("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(L7(this,void 0)),this._diffModel=ai(this,C=>{var S;return(S=this._diffModelSrc.read(C))==null?void 0:S.object}),this.onDidChangeModel=rn.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new n3([Oi,this._contextKeyService]))),this._boundarySashes=Ar(this,void 0),this._accessibleDiffViewerShouldBeVisible=Ar(this,!1),this._accessibleDiffViewerVisible=ai(this,C=>this._options.onlyShowAccessibleDiffViewer.read(C)?!0:this._accessibleDiffViewerShouldBeVisible.read(C)),this._movedBlocksLinesPart=Ar(this,void 0),this._layoutInfo=ai(this,C=>{var q,U;const S=this._rootSizeObserver.width.read(C),k=this._rootSizeObserver.height.read(C);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=k+"px";const I=this._sash.read(C),L=this._gutter.read(C),N=(L==null?void 0:L.width.read(C))??0,P=((q=this._overviewRulerPart.read(C))==null?void 0:q.width)??0;let O,F,V,M,B;if(!!I){const G=I.sashLeft.read(C),H=((U=this._movedBlocksLinesPart.read(C))==null?void 0:U.width.read(C))??0;O=0,F=G-N-H,B=G-N,V=G,M=S-V-P}else{B=0;const G=this._options.inlineViewHideOriginalLineNumbers.read(C);O=N,G?F=0:F=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(C)),V=N+F,M=S-V-P}return this.elements.original.style.left=O+"px",this.elements.original.style.width=F+"px",this._editors.original.layout({width:F,height:k},!0),L==null||L.layout(B),this.elements.modified.style.left=V+"px",this.elements.modified.style.width=M+"px",this._editors.modified.layout({width:M,height:k},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((C,S)=>C==null?void 0:C.diff.read(S)),this.onDidUpdateDiff=rn.fromObservableLight(this._diffValue),o.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(gi(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new sdt(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(qbe,t),this._register(Gi(C=>{this._options.setWidth(this._rootSizeObserver.width.read(C))})),this._contextKeyService.createKey(me.isEmbeddedDiffEditor.key,!1),this._register(Kv(me.isEmbeddedDiffEditor,this._contextKeyService,C=>this._options.isInEmbeddedEditor.read(C))),this._register(Kv(me.comparingMovedCode,this._contextKeyService,C=>{var S;return!!((S=this._diffModel.read(C))!=null&&S.movedTextToCompare.read(C))})),this._register(Kv(me.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,C=>this._options.couldShowInlineViewBecauseOfSize.read(C))),this._register(Kv(me.diffEditorInlineMode,this._contextKeyService,C=>!this._options.renderSideBySide.read(C))),this._register(Kv(me.hasChanges,this._contextKeyService,C=>{var S,k;return(((k=(S=this._diffModel.read(C))==null?void 0:S.diff.read(C))==null?void 0:k.mappings.length)??0)>0})),this._editors=this._register(this._instantiationService.createInstance(zbe,this.elements.original,this.elements.modified,this._options,i,(C,S,k,I)=>this._createInnerEditor(C,S,k,I))),this._register(Kv(me.diffEditorOriginalWritable,this._contextKeyService,C=>this._options.originalEditable.read(C))),this._register(Kv(me.diffEditorModifiedWritable,this._contextKeyService,C=>!this._options.readOnly.read(C))),this._register(Kv(me.diffEditorOriginalUri,this._contextKeyService,C=>{var S;return((S=this._diffModel.read(C))==null?void 0:S.model.original.uri.toString())??""})),this._register(Kv(me.diffEditorModifiedUri,this._contextKeyService,C=>{var S;return((S=this._diffModel.read(C))==null?void 0:S.model.modified.uri.toString())??""})),this._overviewRulerPart=$d(this,C=>this._options.renderOverviewRuler.read(C)?this._instantiationService.createInstance(zf(tB,C),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(S=>S.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((C,S)=>{var k;return C-(((k=this._overviewRulerPart.read(S))==null?void 0:k.width)??0)})};this._sashLayout=new QSr(this._options,c),this._sash=$d(this,C=>{const S=this._options.renderSideBySide.read(C);return this.elements.root.classList.toggle("side-by-side",S),S?new udt(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const u=$d(this,C=>this._instantiationService.createInstance(zf(wY,C),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);$d(this,C=>this._instantiationService.createInstance(zf(YSr,C),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const d=new Set,f=new Set;let p=!1;const g=$d(this,C=>this._instantiationService.createInstance(zf(Bbe,C),Ti(this._domElement),this._editors,this._diffModel,this._options,this,()=>p||u.get().isUpdatingHiddenAreas,d,f)).recomputeInitiallyAndOnChange(this._store),m=ai(this,C=>{const S=g.read(C).viewZones.read(C).orig,k=u.read(C).viewZones.read(C).origViewZones;return S.concat(k)}),_=ai(this,C=>{const S=g.read(C).viewZones.read(C).mod,k=u.read(C).viewZones.read(C).modViewZones;return S.concat(k)});this._register(_Y(this._editors.original,m,C=>{p=C},d));let v;this._register(_Y(this._editors.modified,_,C=>{p=C,p?v=Ub.capture(this._editors.modified):(v==null||v.restore(this._editors.modified),v=void 0)},f)),this._accessibleDiffViewer=$d(this,C=>this._instantiationService.createInstance(zf(Q2,C),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(S,k)=>this._accessibleDiffViewerShouldBeVisible.set(S,k),this._options.onlyShowAccessibleDiffViewer.map(S=>!S),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((S,k)=>{var I;return(I=S==null?void 0:S.diff.read(k))==null?void 0:I.mappings.map(L=>L.lineRangeMapping)}),new jSr(this._editors))).recomputeInitiallyAndOnChange(this._store);const b=this._accessibleDiffViewerVisible.map(C=>C?"hidden":"visible");this._register(Ow(this.elements.modified,{visibility:b})),this._register(Ow(this.elements.original,{visibility:b})),this._createDiffEditorContributions(),o.addDiffEditor(this),this._gutter=$d(this,C=>this._options.shouldRenderGutterMenu.read(C)?this._instantiationService.createInstance(zf($be,C),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(Z4(this._layoutInfo)),$d(this,C=>new(zf(XP,C))(this.elements.root,this._diffModel,this._layoutInfo.map(S=>S.originalEditor),this._layoutInfo.map(S=>S.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,C=>{this._movedBlocksLinesPart.set(C,void 0)}),this._register(rn.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!0))),this._register(rn.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!1)));const y=this._diffModel.map(this,(C,S)=>{if(C)return C.diff.read(S)===void 0&&!C.isDiffUpToDate.read(S)});this._register(uf((C,S)=>{if(y.read(C)===!0){const k=this._editorProgressService.show(!0,1e3);S.add(gi(()=>k.done()))}})),this._register(uf((C,S)=>{S.add(new(zf(sEr,C))(this._editors,this._diffModel,this._options,this))})),this._register(uf((C,S)=>{const k=this._diffModel.read(C);if(k)for(const I of[k.model.original,k.model.modified])S.add(I.onWillDispose(L=>{tr(new Ps("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(Gi(C=>{this._options.setModel(this._diffModel.read(C))}))}_createInnerEditor(e,t,i,r){return e.createInstance(X7,t,i,r)}_createDiffEditorContributions(){const e=dI.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){tr(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return h$.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var i;const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:(i=this._diffModel.get())==null?void 0:i.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.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(Fbe,e,this._options)}getModel(){var e;return((e=this._diffModel.get())==null?void 0:e.model)??null}setModel(e){const t=e?"model"in e?vY.create(e).createNewRef(this):vY.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==(e==null?void 0:e.object)&&KL(t,r=>{var a;const s=e==null?void 0:e.object;Gs.batchEventsGlobally(r,()=>{this._editors.original.setModel(s?s.model.original:null),this._editors.modified.setModel(s?s.model.modified:null)});const o=(a=this._diffModelSrc.get())==null?void 0:a.createNewRef(this);this._diffModelSrc.set(e==null?void 0:e.createNewRef(this),r),setTimeout(()=>{o==null||o.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var t;const e=(t=this._diffModel.get())==null?void 0:t.diff.get();return e?pEr(e):null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(r=>({range:r.modifiedRange,text:t.model.original.getValueInRange(r.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new We(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var s,o;const t=(o=(s=this._diffModel.get())==null?void 0:s.diff.get())==null?void 0:o.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let r;e==="next"?r=t.find(a=>a.lineRangeMapping.modified.startLineNumber>i)??t[0]:r=h7(t,a=>a.lineRangeMapping.modified.startLineNumber<i)??t[t.length-1],this._goTo(r),r.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Up.diffLineDeleted,{source:"diffEditor.goToDiff"}):r.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Up.diffLineInserted,{source:"diffEditor.goToDiff"}):r&&this._accessibilitySignalService.playSignal(Up.diffLineModified,{source:"diffEditor.goToDiff"})}revealFirstDiff(){const e=this._diffModel.get();e&&this.waitForDiff().then(()=>{var i;const t=(i=e.diff.get())==null?void 0:i.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var o,a;const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let r;const s=t.getSelection();if(s){const l=(a=(o=this._diffModel.get())==null?void 0:o.diff.get())==null?void 0:a.mappings.map(c=>e?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=Z9e(s.getStartPosition(),l),u=Z9e(s.getEndPosition(),l);r=ie.plusRange(c,u)}}return{destination:i,destinationSelection:r}}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 t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&va(i=>{for(const r of e)r.collapseAll(i)})}showAllUnchangedRegions(){var t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&va(i=>{for(const r of e)r.showAll(i)})}_handleCursorPositionChange(e,t){var i,r;if((e==null?void 0:e.reason)===3){const s=(r=(i=this._diffModel.get())==null?void 0:i.diff.get())==null?void 0:r.mappings.find(o=>t?o.lineRangeMapping.modified.contains(e.position.lineNumber):o.lineRangeMapping.original.contains(e.position.lineNumber));s!=null&&s.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Up.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):s!=null&&s.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Up.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):s&&this._accessibilitySignalService.playSignal(Up.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};Mw=fEr([kj(3,Oi),kj(4,mi),kj(5,Cs),kj(6,Mk),kj(7,Rk)],Mw);function pEr(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,r,s,o,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?(s=t.modified.startLineNumber-1,o=0,a=void 0):(s=t.modified.startLineNumber,o=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:r,modifiedStartLineNumber:s,modifiedEndLineNumber:o,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 j2e=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Vo=function(n,e){return function(t,i){e(t,i,n)}};let gEr=0,g$e=!1;function mEr(n){if(!n){if(g$e)return;g$e=!0}Cgr(n||bo.document.body)}let SY=class extends X7{constructor(e,t,i,r,s,o,a,l,c,u,d,f,p){const g={...t};g.ariaLabel=g.ariaLabel||$_e.editorViewAccessibleLabel,super(e,g,{},i,r,s,o,c,u,d,f,p),l instanceof SM?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,mEr(g.ariaContainerElement),Omr((m,_)=>i.createInstance(hM,m,_,{})),Mmr(a)}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_"+ ++gEr,s=It.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,s),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"),Ye.None;const t=e.id,i=e.label,r=It.and(It.equals("editorId",this.getId()),It.deserialize(e.precondition)),s=e.keybindings,o=It.and(r,It.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(p,...g)=>Promise.resolve(e.run(this,...g)),u=new Et,d=this.getId()+":"+t;if(u.add(os.registerCommand(d,c)),a){const p={command:{id:d,title:i},when:r,group:a,order:l};u.add(Uc.appendMenuItem(zn.EditorContext,p))}if(Array.isArray(s))for(const p of s)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,p,c,o));const f=new tdt(d,i,i,void 0,r,(...p)=>Promise.resolve(e.run(this,...p)),this._contextKeyService);return this._actions.set(t,f),u.add(gi(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof iG)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};SY=j2e([Vo(2,mi),Vo(3,Cs),Vo(4,Fo),Vo(5,Oi),Vo(6,C1),Vo(7,Ws),Vo(8,mc),Vo(9,wl),Vo(10,dp),Vo(11,wa),Vo(12,Fn)],SY);let Kbe=class extends SY{constructor(e,t,i,r,s,o,a,l,c,u,d,f,p,g,m,_){const v={...t};JG(d,v,!1);const b=c.registerEditorContainer(e);typeof v.theme=="string"&&c.setTheme(v.theme),typeof v.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!v.autoDetectHighContrast);const y=v.model;delete v.model,super(e,v,i,r,s,o,a,l,c,u,f,m,_),this._configurationService=d,this._standaloneThemeService=c,this._register(b);let C;if(typeof y>"u"){const S=g.getLanguageIdByMimeType(v.language)||v.language||Ih;C=pdt(p,g,v.value||"",S,void 0),this._ownsModel=!0}else C=y,this._ownsModel=!1;if(this._attachModel(C),C){const S={oldModelUrl:null,newModelUrl:C.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){JG(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)}};Kbe=j2e([Vo(2,mi),Vo(3,Cs),Vo(4,Fo),Vo(5,Oi),Vo(6,C1),Vo(7,Ws),Vo(8,Lg),Vo(9,wl),Vo(10,Dr),Vo(11,dp),Vo(12,Xo),Vo(13,pa),Vo(14,wa),Vo(15,Fn)],Kbe);let Gbe=class extends Mw{constructor(e,t,i,r,s,o,a,l,c,u,d,f){const p={...t};JG(l,p,!0);const g=o.registerEditorContainer(e);typeof p.theme=="string"&&o.setTheme(p.theme),typeof p.autoDetectHighContrast<"u"&&o.setAutoDetectHighContrast(!!p.autoDetectHighContrast),super(e,p,{},r,i,s,f,u),this._configurationService=l,this._standaloneThemeService=o,this._register(g)}dispose(){super.dispose()}updateOptions(e){JG(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(SY,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)}};Gbe=j2e([Vo(2,mi),Vo(3,Oi),Vo(4,Cs),Vo(5,Lg),Vo(6,wl),Vo(7,Dr),Vo(8,up),Vo(9,Rk),Vo(10,tx),Vo(11,Mk)],Gbe);function pdt(n,e,t,i,r){if(t=t||"",!i){const s=t.indexOf(` `);let o=t;return s!==-1&&(o=t.substring(0,s)),m$e(n,t,e.createByFilepathOrFirstLine(r||null,o),r)}return m$e(n,t,e.createById(i),r)}function m$e(n,e,t,i){return n.createModel(e,t,i)}var _Er=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},_$e=function(n,e){return function(t,i){e(t,i,n)}};class vEr{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let EY=class extends Ye{constructor(e,t,i,r,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=r,this._viewModel=Ar(this,void 0),this._collapsed=ai(this,l=>{var c;return(c=this._viewModel.read(l))==null?void 0:c.collapsed.read(l)}),this._editorContentHeight=Ar(this,500),this.contentHeight=ai(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Ar(this,0),this._modifiedWidth=Ar(this,0),this._originalContentWidth=Ar(this,0),this._originalWidth=Ar(this,0),this.maxScroll=ai(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),u=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>u?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:u,width:this._originalWidth.read(l)}}),this._elements=jr("div.multiDiffEntry",[jr("div.header@header",[jr("div.header-content",[jr("div.collapse-button@collapseButton"),jr("div.file-path",[jr("div.title.modified.show-file-icons@primaryPath",[]),jr("div.status.deleted@status",["R"]),jr("div.title.original.show-file-icons@secondaryPath",[])]),jr("div.actions@actions")])]),jr("div.editorParent",[jr("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Mw,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=Gf(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Gf(this.editor.getOriginalEditor()).isFocused,this.isFocused=ai(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new Et),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new MG(this._elements.collapseButton,{});this._register(Gi(l=>{o.element.className="",o.icon=this._collapsed.read(l)?Yt.chevronRight:Yt.chevronDown})),this._register(o.onDidClick(()=>{var l;(l=this._viewModel.get())==null||l.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Gi(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{Jj(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(Gi(l=>{var u;const c=(u=this._viewModel.read(l))==null?void 0:u.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(s.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new n3([Oi,this._contextKeyService])));this._register(a.createInstance(CY,this._elements.actions,zn.MultiDiffEditorFileToolbar,{actionRunner:this._register(new ddt(()=>{var l;return(l=this._viewModel.get())==null?void 0:l.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>act(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(r){return{...r,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){Jj(r=>{this._viewModel.set(void 0,r),this.editor.setDiffModel(null,r),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(Jj(r=>{var c,u;(c=this._resourceLabel)==null||c.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let s=!1,o=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",s=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",o=!0),this._elements.status.classList.toggle("renamed",s),this._elements.status.classList.toggle("deleted",o),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,(u=this._resourceLabel2)==null||u.setUri(s?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,r),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,r),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,r=>{r||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[r,s]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(r,s)}render(e,t,i,r){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const s=e.length-this._headerHeight,o=Math.max(0,Math.min(r.start-e.start,s));this._elements.header.style.transform=`translateY(${o}px)`,Jj(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",o>0||i>0),this._elements.header.classList.toggle("collapsed",o===s)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};EY=_Er([_$e(3,mi),_$e(4,Oi)],EY);class bEr{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(r=>this._itemData.get(r).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var yEr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},v$e=function(n,e){return function(t,i){e(t,i,n)}};let Ybe=class extends Ye{constructor(e,t,i,r,s,o){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=r,this._parentContextKeyService=s,this._parentInstantiationService=o,this._scrollableElements=jr("div.scrollContent",[jr("div@content",{style:{overflow:"hidden"}}),jr("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new G4({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>lp(Ti(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new Ste(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=jr("div.monaco-component.multiDiffEditor",{},[jr("div",{},[this._scrollableElement.getDomNode()]),jr("div.placeholder@placeholder",{},[jr("div",[A("noChangedFiles","No Changed Files")])])]),this._sizeObserver=this._register(new sdt(this._element,void 0)),this._objectPool=this._register(new bEr(l=>{const c=this._instantiationService.createInstance(EY,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this.scrollTop=Gs(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Gs(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=Pk(this,(l,c)=>{const u=this._viewModel.read(l);if(!u)return{items:[],getItem:g=>{throw new Ps}};const d=u.items.read(l),f=new Map;return{items:d.map(g=>{var v;const m=c.add(new CEr(g,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),_=(v=this._lastDocStates)==null?void 0:v[m.getKey()];return _&&va(b=>{m.setViewState(_,b)}),f.set(g,m),m}),getItem:g=>f.get(g)}}),this._viewItems=this._viewItemsInfo.map(this,l=>l.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((u,d)=>u+d.contentHeight.read(c)+this._spaceBetweenPx,0)),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new n3([Oi,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(me.inMultiDiffEditor.key,!0),this._register(uf((l,c)=>{const u=this._viewModel.read(l);if(u&&u.contextKeys)for(const[d,f]of Object.entries(u.contextKeys)){const p=this._contextKeyService.createKey(d,void 0);p.set(f),c.add(gi(()=>p.reset()))}}));const a=this._parentContextKeyService.createKey(me.multiDiffEditorAllCollapsed.key,!1);this._register(Gi(l=>{const c=this._viewModel.read(l);if(c){const u=c.items.read(l).every(d=>d.collapsed.read(l));a.set(u)}})),this._register(Gi(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._register(Gi(l=>{const c=this._viewItems.read(l);this._elements.placeholder.classList.toggle("visible",c.length===0)})),this._scrollableElements.content.style.position="relative",this._register(Gi(l=>{const c=this._sizeObserver.height.read(l);this._scrollableElements.root.style.height=`${c}px`;const u=this._totalHeight.read(l);this._scrollableElements.content.style.height=`${u}px`;const d=this._sizeObserver.width.read(l);let f=d;const p=this._viewItems.read(l),g=jke(p,kh(m=>m.maxScroll.read(l).maxScroll,z_));if(g){const m=g.maxScroll.read(l);f=d+m.maxScroll}this._scrollableElement.setScrollDimensions({width:d,height:c,scrollHeight:u,scrollWidth:f})})),e.replaceChildren(this._elements.root),this._register(gi(()=>{e.replaceChildren()})),this._register(this._register(Gi(l=>{Jj(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let i=0,r=0,s=0;const o=this._sizeObserver.height.read(e),a=Pr.ofStartAndLength(t,o),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const u=c.contentHeight.read(e),d=Math.min(u,o),f=Pr.ofStartAndLength(r,d),p=Pr.ofStartAndLength(s,u);if(p.isBefore(a))i-=u-d,c.hide();else if(p.isAfter(a))c.hide();else{const g=Math.max(0,Math.min(a.start-p.start,u-d));i-=g;const m=Pr.ofStartAndLength(t+i,o);c.render(f,g,l,m)}r+=d+this._spaceBetweenPx,s+=u+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};Ybe=yEr([v$e(4,Oi),v$e(5,mi)],Ybe);class CEr extends Ye{constructor(e,t,i,r){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=r,this._templateRef=this._register(L7(this,void 0)),this.contentHeight=ai(this,s=>{var o,a;return((a=(o=this._templateRef.read(s))==null?void 0:o.object.contentHeight)==null?void 0:a.read(s))??this.viewModel.lastTemplateData.read(s).contentHeight}),this.maxScroll=ai(this,s=>{var o;return((o=this._templateRef.read(s))==null?void 0:o.object.maxScroll.read(s))??{maxScroll:0,scrollWidth:0}}),this.template=ai(this,s=>{var o;return(o=this._templateRef.read(s))==null?void 0:o.object}),this._isHidden=Ar(this,!1),this._isFocused=ai(this,s=>{var o;return((o=this.template.read(s))==null?void 0:o.isFocused.read(s))??!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(Gi(s=>{var a;const o=this._scrollLeft.read(s);(a=this._templateRef.read(s))==null||a.object.setScrollLeft(o)})),this._register(Gi(s=>{const o=this._templateRef.read(s);!o||!this._isHidden.read(s)||o.object.isFocused.read(s)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.documentDiffItem.modified)==null?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var o;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),r=(o=e.selections)==null?void 0:o.map(Yn.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:r},t);const s=this._templateRef.get();s&&r&&s.object.editor.setSelections(r)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&va(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,r){this._isHidden.set(!1,void 0);let s=this._templateRef.get();if(!s){s=this._objectPool.getUnusedObj(new vEr(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(s,void 0);const o=this.viewModel.lastTemplateData.get().selections;o&&s.object.editor.setSelections(o)}s.object.render(e,i,t,r)}}ve("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},A("multiDiffEditor.headerBackground","The background color of the diff editor's header"));ve("multiDiffEditor.background",lv,A("multiDiffEditor.background","The background color of the multi file diff editor"));ve("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},A("multiDiffEditor.border","The border color of the multi file diff editor"));var wEr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},xEr=function(n,e){return function(t,i){e(t,i,n)}};let Qbe=class extends Ye{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Ar(this,void 0),this._viewModel=Ar(this,void 0),this._widgetImpl=Pk(this,(r,s)=>(zf(EY,r),s.add(this._instantiationService.createInstance(zf(Ybe,r),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(Z4(this._widgetImpl))}};Qbe=wEr([xEr(2,mi)],Qbe);function SEr(n,e,t){return Hi.initialize(t||{}).createInstance(Kbe,n,e)}function EEr(n){return Hi.get(Cs).onCodeEditorAdd(t=>{n(t)})}function kEr(n){return Hi.get(Cs).onDiffEditorAdd(t=>{n(t)})}function TEr(){return Hi.get(Cs).listCodeEditors()}function IEr(){return Hi.get(Cs).listDiffEditors()}function LEr(n,e,t){return Hi.initialize(t||{}).createInstance(Gbe,n,e)}function AEr(n,e){const t=Hi.initialize(e||{});return new Qbe(n,{},t)}function NEr(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return os.registerCommand(n.id,n.run)}function DEr(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=It.deserialize(n.precondition),t=(r,...s)=>pc.runEditorCommand(r,s,e,(o,a,l)=>Promise.resolve(n.run(a,...l))),i=new Et;if(i.add(os.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(Uc.appendMenuItem(zn.EditorContext,r))}if(Array.isArray(n.keybindings)){const r=Hi.get(Ws);if(!(r instanceof SM))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const s=It.and(e,It.deserialize(n.keybindingContext));i.add(r.addDynamicKeybindings(n.keybindings.map(o=>({keybinding:o,command:n.id,when:s}))))}}return i}function REr(n){return gdt([n])}function gdt(n){const e=Hi.get(Ws);return e instanceof SM?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:It.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Ye.None)}function PEr(n,e,t){const i=Hi.get(pa),r=i.getLanguageIdByMimeType(e)||e;return pdt(Hi.get(Xo),i,n,r,t)}function OEr(n,e){const t=Hi.get(pa),i=t.getLanguageIdByMimeType(e)||e||Ih;n.setLanguage(t.createById(i))}function MEr(n,e,t){n&&Hi.get(w1).changeOne(e,n.uri,t)}function jEr(n){Hi.get(w1).changeAll(n,[])}function FEr(n){return Hi.get(w1).read(n)}function BEr(n){return Hi.get(w1).onMarkerChanged(n)}function $Er(n){return Hi.get(Xo).getModel(n)}function HEr(){return Hi.get(Xo).getModels()}function VEr(n){return Hi.get(Xo).onModelAdded(n)}function WEr(n){return Hi.get(Xo).onModelRemoved(n)}function zEr(n){return Hi.get(Xo).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function UEr(n){return A1r(Hi.get(Xo),n)}function qEr(n,e){const t=Hi.get(pa),i=Hi.get(Lg);return r2e.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function KEr(n,e,t){const i=Hi.get(pa);return Hi.get(Lg).registerEditorContainer(bo.document.body),r2e.colorize(i,n,e,t)}function GEr(n,e,t=4){return Hi.get(Lg).registerEditorContainer(bo.document.body),r2e.colorizeModelLine(n,e,t)}function YEr(n){const e=Ka.get(n);return e||{getInitialState:()=>mM,tokenize:(t,i,r)=>fTe(n,r)}}function QEr(n,e){Ka.getOrCreate(e);const t=YEr(e),i=_1(n),r=[];let s=t.getInitialState();for(let o=0,a=i.length;o<a;o++){const l=i[o],c=t.tokenize(l,!0,s);r[o]=c.tokens,s=c.endState}return r}function XEr(n,e){Hi.get(Lg).defineTheme(n,e)}function ZEr(n){Hi.get(Lg).setTheme(n)}function JEr(){jme.clearAllFontInfos()}function ekr(n,e){return os.registerCommand({id:n,handler:e})}function tkr(n){return Hi.get(xf).registerOpener({async open(t){return typeof t=="string"&&(t=vi.parse(t)),n.open(t)}})}function nkr(n){return Hi.get(Cs).registerCodeEditorOpenHandler(async(t,i,r)=>{var a;if(!i)return null;const s=(a=t.options)==null?void 0:a.selection;let o;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?o=s:s&&(o={lineNumber:s.startLineNumber,column:s.startColumn}),await n.openCodeEditor(i,t.resource,o)?i:null})}function ikr(){return{create:SEr,getEditors:TEr,getDiffEditors:IEr,onDidCreateEditor:EEr,onDidCreateDiffEditor:kEr,createDiffEditor:LEr,addCommand:NEr,addEditorAction:DEr,addKeybindingRule:REr,addKeybindingRules:gdt,createModel:PEr,setModelLanguage:OEr,setModelMarkers:MEr,getModelMarkers:FEr,removeAllMarkers:jEr,onDidChangeMarkers:BEr,getModels:HEr,getModel:$Er,onDidCreateModel:VEr,onWillDisposeModel:WEr,onDidChangeModelLanguage:zEr,createWebWorker:UEr,colorizeElement:qEr,colorize:KEr,colorizeModelLine:GEr,tokenize:QEr,defineTheme:XEr,setTheme:ZEr,remeasureFonts:JEr,registerCommand:ekr,registerLinkOpener:tkr,registerEditorOpener:nkr,AccessibilitySupport:Dge,ContentWidgetPositionPreference:Fge,CursorChangeReason:Bge,DefaultEndOfLine:$ge,EditorAutoIndentStrategy:Vge,EditorOption:Wge,EndOfLinePreference:zge,EndOfLineSequence:Uge,MinimapPosition:nme,MinimapSectionHeaderStyle:ime,MouseTargetType:rme,OverlayWidgetPositionPreference:ame,OverviewRulerLane:lme,GlyphMarginLane:qge,RenderLineNumbersType:dme,RenderMinimap:hme,ScrollbarVisibility:pme,ScrollType:fme,TextEditorCursorBlinkingStyle:yme,TextEditorCursorStyle:Cme,TrackedRangeStickiness:wme,WrappingIndent:xme,InjectedTextCursorStops:Yge,PositionAffinity:ume,ShowLightbulbIconMode:mme,ConfigurationChangedEvent:rot,BareFontInfo:cI,FontInfo:Mme,TextModelResolvedOptions:iU,FindMatch:d7,ApplyUpdateResult:YF,EditorZoom:lm,createMultiFileDiffEditor:AEr,EditorType:h$,EditorOptions:Xb}}function rkr(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function PW(n,e){return typeof n=="boolean"?n:e}function b$e(n,e){return typeof n=="string"?n:e}function skr(n){const e={};for(const t of n)e[t]=!0;return e}function y$e(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=skr(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 Xbe(n,e,t){e=e.replace(/@@/g,"");let i=0,r;do r=!1,e=e.replace(/@(\w+)/g,function(o,a){r=!0;let l="";if(typeof n[a]=="string")l=n[a];else if(n[a]&&n[a]instanceof RegExp)l=n[a].source;else throw n[a]===void 0?ra(n,"language definition does not contain attribute '"+a+"', used at: "+e):ra(n,"attribute reference '"+a+"' must be a string, used at: "+e);return k2(l)?"":"(?:"+l+")"}),i++;while(r&&i<5);e=e.replace(/\x01/g,"@");const s=(n.ignoreCase?"i":"")+(n.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(Y1r(n,e,c),s)),l)}return new RegExp(e,s)}function okr(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 akr(n,e,t,i){let r=-1,s=t,o=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);o&&(o[3]&&(r=parseInt(o[3]),o[2]&&(r=r+100)),s=o[4]);let a="~",l=s;!s||s.length===0?(a="!=",l=""):/^\w*$/.test(l)?a="==":(o=s.match(/^(@|!@|~|!~|==|!=)(.*)$/),o&&(a=o[1],l=o[2]));let c;if((a==="~"||a==="!~")&&/^(\w|\|)*$/.test(l)){const u=y$e(l.split("|"),n.ignoreCase);c=function(d){return a==="~"?u(d):!u(d)}}else if(a==="@"||a==="!@"){const u=n[l];if(!u)throw ra(n,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!rkr(function(f){return typeof f=="string"},u))throw ra(n,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);const d=y$e(u,n.ignoreCase);c=function(f){return a==="@"?d(f):!d(f)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){const u=Xbe(n,"^"+l+"$",!1);c=function(d){return a==="~"?u.test(d):!u.test(d)}}else c=function(u,d,f,p){return Xbe(n,"^"+SS(n,l,d,f,p)+"$",!1).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,f,p,g,m){const _=SS(n,u,f,p,g);return a==="=="?d===_:d!==_}}return r===-1?{name:t,value:i,test:function(u,d,f,p){return c(u,u,d,f,p)}}:{name:t,value:i,test:function(u,d,f,p){const g=okr(u,d,f,r);return c(g||"",u,d,f,p)}}}function Zbe(n,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw ra(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 ra(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw ra(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&&!Q1r(n,SS(n,r,"",[],""))))throw ra(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,s=t.length;r<s;r++)i[r]=Zbe(n,e,t[r]);return{group:i}}else if(t.cases){const i=[];for(const s in t.cases)if(t.cases.hasOwnProperty(s)){const o=Zbe(n,e,t.cases[s]);s==="@default"||s==="@"||s===""?i.push({test:void 0,value:o,name:s}):s==="@eos"?i.push({test:function(a,l,c,u){return u},value:o,name:s}):i.push(akr(n,e,s,o))}const r=n.defaultToken;return{test:function(s,o,a,l){for(const c of i)if(!c.test||c.test(s,o,a,l))return c.value;return r}}}else throw ra(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 lkr{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 ra(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=Xbe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=Zbe(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function mdt(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:n,includeLF:PW(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:PW(e.ignoreCase,!1),unicode:PW(e.unicode,!1),tokenPostfix:b$e(e.tokenPostfix,"."+n),defaultToken:b$e(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},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(o,a,l){for(const c of l){let u=c.include;if(u){if(typeof u!="string")throw ra(t,"an 'include' attribute must be a string at: "+o);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw ra(t,"include target '"+u+"' is not defined at: "+o);r(o+"."+u,a,e.tokenizer[u])}else{const d=new lkr(o);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 f=c[1];f.next=c[2],d.setAction(i,f)}else throw ra(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: "+o);else d.setAction(i,c[1]);else{if(!c.regex)throw ra(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+o);c.name&&typeof c.name=="string"&&(d.name=c.name),c.matchOnlyAtStart&&(d.matchOnlyAtLineStart=PW(c.matchOnlyAtLineStart,!1)),d.setRegex(i,c.regex),d.setAction(i,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw ra(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const o in e.tokenizer)if(e.tokenizer.hasOwnProperty(o)){t.start||(t.start=o);const a=e.tokenizer[o];t.tokenizer[o]=new Array,r("tokenizer."+o,t.tokenizer[o],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw ra(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 s=[];for(const o of e.brackets){let a=o;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw ra(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")s.push({token:a.token+t.tokenPostfix,open:hw(t,a.open),close:hw(t,a.close)});else throw ra(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function ckr(n){aM.registerLanguage(n)}function ukr(){let n=[];return n=n.concat(aM.getLanguages()),n}function dkr(n){return Hi.get(pa).languageIdCodec.encodeLanguageId(n)}function hkr(n,e){return Hi.withServices(()=>{const i=Hi.get(pa).onDidRequestRichLanguageFeatures(r=>{r===n&&(i.dispose(),e())});return i})}function fkr(n,e){return Hi.withServices(()=>{const i=Hi.get(pa).onDidRequestBasicLanguageFeatures(r=>{r===n&&(i.dispose(),e())});return i})}function pkr(n,e){if(!Hi.get(pa).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return Hi.get(wa).register(n,e,100)}class gkr{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 nB.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 qee(r.tokens,r.endState)}}class nB{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 s=0,o=e.length;s<o;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<r&&(l=r),i[s]=new n7(l,a.scopes,t),r=l}return i}static adaptTokenize(e,t,i,r){const s=t.tokenize(i,r),o=nB._toClassicTokens(s.tokens,e);let a;return s.endState.equals(r)?a=r:a=s.endState,new hke(o,a)}tokenize(e,t,i){return nB.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),r=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let o=0,a=0;for(let c=0,u=t.length;c<u;c++){const d=t[c],f=r.match(i,d.scopes)|1024;if(o>0&&s[o-1]===f)continue;let p=d.startIndex;c===0?p=0:p<a&&(p=a),s[o++]=p,s[o++]=f,a=p}const l=new Uint32Array(o);for(let c=0;c<o;c++)l[c]=s[c];return l}tokenizeEncoded(e,t,i){const r=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,r.tokens);let o;return r.endState.equals(i)?o=i:o=r.endState,new qee(s,o)}}function mkr(n){return typeof n.getInitialState=="function"}function _kr(n){return"tokenizeEncoded"in n}function _dt(n){return n&&typeof n.then=="function"}function vkr(n){const e=Hi.get(Lg);if(n){const t=[null];for(let i=1,r=n.length;i<r;i++)t[i]=At.fromHex(n[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function vdt(n,e){return _kr(e)?new gkr(n,e):new nB(n,e,Hi.get(pa),Hi.get(Lg))}function F2e(n,e){const t=new Qor(async()=>{const i=await Promise.resolve(e.create());return i?mkr(i)?vdt(n,i):new z7(Hi.get(pa),Hi.get(Lg),n,mdt(n,i),Hi.get(Dr)):null});return Ka.registerFactory(n,t)}function bkr(n,e){if(!Hi.get(pa).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return _dt(e)?F2e(n,{create:()=>e}):Ka.register(n,vdt(n,e))}function ykr(n,e){const t=i=>new z7(Hi.get(pa),Hi.get(Lg),n,mdt(n,i),Hi.get(Dr));return _dt(e)?F2e(n,{create:()=>e}):Ka.register(n,t(e))}function Ckr(n,e){return Hi.get(Fn).referenceProvider.register(n,e)}function wkr(n,e){return Hi.get(Fn).renameProvider.register(n,e)}function xkr(n,e){return Hi.get(Fn).newSymbolNamesProvider.register(n,e)}function Skr(n,e){return Hi.get(Fn).signatureHelpProvider.register(n,e)}function Ekr(n,e){return Hi.get(Fn).hoverProvider.register(n,{provideHover:async(i,r,s,o)=>{const a=i.getWordAtPosition(r);return Promise.resolve(e.provideHover(i,r,s,o)).then(l=>{if(l)return!l.range&&a&&(l.range=new ie(r.lineNumber,a.startColumn,r.lineNumber,a.endColumn)),l.range||(l.range=new ie(r.lineNumber,r.column,r.lineNumber,r.column)),l})}})}function kkr(n,e){return Hi.get(Fn).documentSymbolProvider.register(n,e)}function Tkr(n,e){return Hi.get(Fn).documentHighlightProvider.register(n,e)}function Ikr(n,e){return Hi.get(Fn).linkedEditingRangeProvider.register(n,e)}function Lkr(n,e){return Hi.get(Fn).definitionProvider.register(n,e)}function Akr(n,e){return Hi.get(Fn).implementationProvider.register(n,e)}function Nkr(n,e){return Hi.get(Fn).typeDefinitionProvider.register(n,e)}function Dkr(n,e){return Hi.get(Fn).codeLensProvider.register(n,e)}function Rkr(n,e,t){return Hi.get(Fn).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(r,s,o,a)=>{const c=Hi.get(w1).read({resource:r.uri}).filter(u=>ie.areIntersectingOrTouching(u,s));return e.provideCodeActions(r,s,{markers:c,only:o.only,trigger:o.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Pkr(n,e){return Hi.get(Fn).documentFormattingEditProvider.register(n,e)}function Okr(n,e){return Hi.get(Fn).documentRangeFormattingEditProvider.register(n,e)}function Mkr(n,e){return Hi.get(Fn).onTypeFormattingEditProvider.register(n,e)}function jkr(n,e){return Hi.get(Fn).linkProvider.register(n,e)}function Fkr(n,e){return Hi.get(Fn).completionProvider.register(n,e)}function Bkr(n,e){return Hi.get(Fn).colorProvider.register(n,e)}function $kr(n,e){return Hi.get(Fn).foldingRangeProvider.register(n,e)}function Hkr(n,e){return Hi.get(Fn).declarationProvider.register(n,e)}function Vkr(n,e){return Hi.get(Fn).selectionRangeProvider.register(n,e)}function Wkr(n,e){return Hi.get(Fn).documentSemanticTokensProvider.register(n,e)}function zkr(n,e){return Hi.get(Fn).documentRangeSemanticTokensProvider.register(n,e)}function Ukr(n,e){return Hi.get(Fn).inlineCompletionsProvider.register(n,e)}function qkr(n,e){return Hi.get(Fn).inlineEditProvider.register(n,e)}function Kkr(n,e){return Hi.get(Fn).inlayHintsProvider.register(n,e)}function Gkr(){return{register:ckr,getLanguages:ukr,onLanguage:hkr,onLanguageEncountered:fkr,getEncodedLanguageId:dkr,setLanguageConfiguration:pkr,setColorMap:vkr,registerTokensProviderFactory:F2e,setTokensProvider:bkr,setMonarchTokensProvider:ykr,registerReferenceProvider:Ckr,registerRenameProvider:wkr,registerNewSymbolNameProvider:xkr,registerCompletionItemProvider:Fkr,registerSignatureHelpProvider:Skr,registerHoverProvider:Ekr,registerDocumentSymbolProvider:kkr,registerDocumentHighlightProvider:Tkr,registerLinkedEditingRangeProvider:Ikr,registerDefinitionProvider:Lkr,registerImplementationProvider:Akr,registerTypeDefinitionProvider:Nkr,registerCodeLensProvider:Dkr,registerCodeActionProvider:Rkr,registerDocumentFormattingEditProvider:Pkr,registerDocumentRangeFormattingEditProvider:Okr,registerOnTypeFormattingEditProvider:Mkr,registerLinkProvider:jkr,registerColorProvider:Bkr,registerFoldingRangeProvider:$kr,registerDeclarationProvider:Hkr,registerSelectionRangeProvider:Vkr,registerDocumentSemanticTokensProvider:Wkr,registerDocumentRangeSemanticTokensProvider:zkr,registerInlineCompletionsProvider:Ukr,registerInlineEditProvider:qkr,registerInlayHintsProvider:Kkr,DocumentHighlightKind:Hge,CompletionItemKind:Oge,CompletionItemTag:Mge,CompletionItemInsertTextRule:Pge,SymbolKind:vme,SymbolTag:bme,IndentAction:Gge,CompletionTriggerKind:jge,SignatureHelpTriggerKind:_me,InlayHintKind:Qge,InlineCompletionTriggerKind:Xge,InlineEditTriggerKind:Zge,CodeActionTriggerType:Rge,NewSymbolNameTag:sme,NewSymbolNameTriggerKind:ome,PartialAcceptTriggerKind:cme,HoverVerbosityAction:Kge,FoldingRangeKind:KE,SelectedSuggestionInfo:yot}}const B2e=Ur("IEditorCancelService"),bdt=new yn("cancellableOperation",!1,A("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ns(B2e,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(r=>{const s=bdt.bindTo(r.get(Oi)),o=new Ch;return{key:s,tokens:o}}),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 Ykr extends ba{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(B2e).add(e,this))}dispose(){this._unregister(),super.dispose()}}gn(new class extends pc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:bdt})}runEditorCommand(n,e){n.get(B2e).cancel(e)}});let ydt=class Jbe{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?jL("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Jbe))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 Jbe(e,this.flags))}};class ak extends Ykr{constructor(e,t,i,r){super(e,r),this._listener=new Et,t&4&&this._listener.add(e.onDidChangeCursorPosition(s=>{(!i||!ie.containsPosition(i,s.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(s=>{(!i||!ie.containsRange(i,s.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(s=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(s=>this.cancel())),this._listener.add(e.onDidChangeModelContent(s=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class $2e extends ba{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function n1(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===h$.ICodeEditor:!1}function H2e(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===h$.IDiffEditor:!1}function Qkr(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function Cdt(n){return n1(n)?n:H2e(n)?n.getModifiedEditor():Qkr(n)&&n1(n.activeCodeEditor)?n.activeCodeEditor:null}class IM{static _handleEolEdits(e,t){let i;const r=[];for(const s of t)typeof s.eol=="number"&&(i=s.eol),s.range&&typeof s.text=="string"&&r.push(s);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=Ub.capture(e),s=IM._handleEolEdits(e,t);s.length===1&&IM._isFullModelReplaceEdit(e,s[0])?e.executeEdits("formatEditsCommand",s.map(o=>ma.replace(ie.lift(o.range),o.text))):e.executeEdits("formatEditsCommand",s.map(o=>ma.replaceMove(ie.lift(o.range),o.text))),i&&e.pushUndoStop(),r.restoreRelativeVerticalPositionOfCursor(e)}}class C$e{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class Xkr{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(C$e.toKey(e))}has(e){return this._set.has(C$e.toKey(e))}}function wdt(n,e,t){const i=[],r=new Xkr,s=n.ordered(t);for(const a of s)i.push(a),a.extensionId&&r.add(a.extensionId);const o=e.ordered(t);for(const a of o){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}const G6=class G6{static setFormatterSelector(e){return{dispose:G6._selectors.unshift(e)}}static async select(e,t,i,r){if(e.length===0)return;const s=ss.first(G6._selectors);if(s)return await s(e,t,i,r)}};G6._selectors=new Ch;let iB=G6;async function xdt(n,e,t,i,r,s,o){const a=n.get(mi),{documentRangeFormattingEditProvider:l}=n.get(Fn),c=n1(e)?e.getModel():e,u=l.ordered(c),d=await iB.select(u,c,i,2);d&&(r.report(d),await a.invokeFunction(Zkr,d,e,t,s,o))}async function Zkr(n,e,t,i,r,s){var v,b;const o=n.get(Sf),a=n.get(Uu),l=n.get(Mk);let c,u;n1(t)?(c=t.getModel(),u=new ak(t,5,void 0,r)):(c=t,u=new $2e(t,r));const d=[];let f=0;for(const y of tke(i).sort(ie.compareRangesUsingStarts))f>0&&ie.areIntersectingOrTouching(d[f-1],y)?d[f-1]=ie.fromPositions(d[f-1].getStartPosition(),y.getEndPosition()):f=d.push(y);const p=async y=>{var S,k;a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)==null?void 0:S.value,y);const C=await e.provideDocumentRangeFormattingEdits(c,y,c.getFormattingOptions(),u.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(k=e.extensionId)==null?void 0:k.value,C),C},g=(y,C)=>{if(!y.length||!C.length)return!1;const S=y.reduce((k,I)=>ie.plusRange(k,I.range),y[0].range);if(!C.some(k=>ie.intersectRanges(S,k.range)))return!1;for(const k of y)for(const I of C)if(ie.intersectRanges(k.range,I.range))return!0;return!1},m=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(v=e.extensionId)==null?void 0:v.value,d);const y=await e.provideDocumentRangesFormattingEdits(c,d,c.getFormattingOptions(),u.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(b=e.extensionId)==null?void 0:b.value,y),_.push(y)}else{for(const y of d){if(u.token.isCancellationRequested)return!0;_.push(await p(y))}for(let y=0;y<d.length;++y)for(let C=y+1;C<d.length;++C){if(u.token.isCancellationRequested)return!0;if(g(_[y],_[C])){const S=ie.plusRange(d[y],d[C]),k=await p(S);d.splice(C,1),d.splice(y,1),d.push(S),_.splice(C,1),_.splice(y,1),_.push(k),y=0,C=0}}}for(const y of _){if(u.token.isCancellationRequested)return!0;const C=await o.computeMoreMinimalEdits(c.uri,y);C&&m.push(...C)}}finally{u.dispose()}if(m.length===0)return!1;if(n1(t))IM.execute(t,m,!0),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:y}]=m,C=new Yn(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn);c.pushEditOperations([C],m.map(S=>({text:S.text,range:ie.lift(S.range),forceMoveMarkers:!0})),S=>{for(const{range:k}of S)if(ie.areIntersectingOrTouching(k,C))return[new Yn(k.startLineNumber,k.startColumn,k.endLineNumber,k.endColumn)];return null})}return l.playSignal(Up.format,{userGesture:s}),!0}async function Jkr(n,e,t,i,r,s){const o=n.get(mi),a=n.get(Fn),l=n1(e)?e.getModel():e,c=wdt(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),u=await iB.select(c,l,t,1);u&&(i.report(u),await o.invokeFunction(eTr,u,e,t,r,s))}async function eTr(n,e,t,i,r,s){const o=n.get(Sf),a=n.get(Mk);let l,c;n1(t)?(l=t.getModel(),c=new ak(t,5,void 0,r)):(l=t,c=new $2e(t,r));let u;try{const d=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(u=await o.computeMoreMinimalEdits(l.uri,d),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!u||u.length===0)return!1;if(n1(t))IM.execute(t,u,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:d}]=u,f=new Yn(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn);l.pushEditOperations([f],u.map(p=>({text:p.text,range:ie.lift(p.range),forceMoveMarkers:!0})),p=>{for(const{range:g}of p)if(ie.areIntersectingOrTouching(g,f))return[new Yn(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return a.playSignal(Up.format,{userGesture:s}),!0}async function tTr(n,e,t,i,r,s){const o=e.documentRangeFormattingEditProvider.ordered(t);for(const a of o){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,r,s)).catch(ll);if(Gd(l))return await n.computeMoreMinimalEdits(t.uri,l)}}async function nTr(n,e,t,i,r){const s=wdt(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const o of s){const a=await Promise.resolve(o.provideDocumentFormattingEdits(t,i,r)).catch(ll);if(Gd(a))return await n.computeMoreMinimalEdits(t.uri,a)}}function Sdt(n,e,t,i,r,s,o){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,s,o)).catch(ll).then(l=>n.computeMoreMinimalEdits(t.uri,l))}os.registerCommand("_executeFormatRangeProvider",async function(n,...e){const[t,i,r]=e;ys(vi.isUri(t)),ys(ie.isIRange(i));const s=n.get(Cf),o=n.get(Sf),a=n.get(Fn),l=await s.createModelReference(t);try{return tTr(o,a,l.object.textEditorModel,ie.lift(i),r,xr.None)}finally{l.dispose()}});os.registerCommand("_executeFormatDocumentProvider",async function(n,...e){const[t,i]=e;ys(vi.isUri(t));const r=n.get(Cf),s=n.get(Sf),o=n.get(Fn),a=await r.createModelReference(t);try{return nTr(s,o,a.object.textEditorModel,i,xr.None)}finally{a.dispose()}});os.registerCommand("_executeFormatOnTypeProvider",async function(n,...e){const[t,i,r,s]=e;ys(vi.isUri(t)),ys(We.isIPosition(i)),ys(typeof r=="string");const o=n.get(Cf),a=n.get(Sf),l=n.get(Fn),c=await o.createModelReference(t);try{return Sdt(a,l,c.object.textEditorModel,We.lift(i),r,s,xr.None)}finally{c.dispose()}});Xb.wrappingIndent.defaultValue=0;Xb.glyphMargin.defaultValue=!1;Xb.autoIndent.defaultValue=3;Xb.overviewRulerLanes.defaultValue=2;iB.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const Fh=Cot();Fh.editor=ikr();Fh.languages=Gkr();const Edt=Fh.CancellationTokenSource,kdt=Fh.Emitter,Tdt=Fh.KeyCode,Idt=Fh.KeyMod,Ldt=Fh.Position,Adt=Fh.Range,Ndt=Fh.Selection,Ddt=Fh.SelectionDirection,Rdt=Fh.MarkerSeverity,Pdt=Fh.MarkerTag,Odt=Fh.Uri,Mdt=Fh.Token,jdt=Fh.editor,Fdt=Fh.languages,Rue=globalThis.MonacoEnvironment;(Rue!=null&&Rue.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Fh);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 m$=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Edt,Emitter:kdt,KeyCode:Tdt,KeyMod:Idt,MarkerSeverity:Rdt,MarkerTag:Pdt,Position:Ldt,Range:Adt,Selection:Ndt,SelectionDirection:Ddt,Token:Mdt,Uri:Odt,editor:jdt,languages:Fdt},Symbol.toStringTag,{value:"Module"}));/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var iTr=Object.defineProperty,rTr=Object.getOwnPropertyDescriptor,sTr=Object.getOwnPropertyNames,oTr=Object.prototype.hasOwnProperty,aTr=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of sTr(e))!oTr.call(n,r)&&r!==t&&iTr(n,r,{get:()=>e[r],enumerable:!(i=rTr(e,r))||i.enumerable});return n},lTr=(n,e,t)=>(aTr(n,e,"default"),t),sF={};lTr(sF,m$);var Bdt={},Pue={},cTr=class $dt{static getOrCreate(e){return Pue[e]||(Pue[e]=new $dt(e)),Pue[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,Bdt[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Ii(n){const e=n.id;Bdt[e]=n,sF.languages.register(n);const t=cTr.getOrCreate(e);sF.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),sF.languages.onLanguageEncountered(e,async()=>{const i=await t.load();sF.languages.setLanguageConfiguration(e,i.conf)})}Ii({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>ue(()=>import("./abap-BrgZPUOV.js"),[])});Ii({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>ue(()=>import("./apex-DyP6w7ZV.js"),[])});Ii({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>ue(()=>import("./azcli-BaLxmfj-.js"),[])});Ii({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>ue(()=>import("./bat-CFOPXBzS.js"),[])});Ii({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>ue(()=>import("./bicep-BfEKNvv3.js"),[])});Ii({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>ue(()=>import("./cameligo-BFG1Mk7z.js"),[])});Ii({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>ue(()=>import("./clojure-DTECt2xU.js"),[])});Ii({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>ue(()=>import("./coffee-CDGzqUPQ.js"),[])});Ii({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>ue(()=>import("./cpp-CLLBncYj.js"),[])});Ii({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>ue(()=>import("./cpp-CLLBncYj.js"),[])});Ii({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>ue(()=>import("./csharp-dUCx_-0o.js"),[])});Ii({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>ue(()=>import("./csp-5Rap-vPy.js"),[])});Ii({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>ue(()=>import("./css-D3h14YRZ.js"),[])});Ii({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>ue(()=>import("./cypher-DrQuvNYM.js"),[])});Ii({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>ue(()=>import("./dart-CFKIUWau.js"),[])});Ii({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>ue(()=>import("./dockerfile-Zznr-cwX.js"),[])});Ii({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>ue(()=>import("./ecl-Ce3n6wWz.js"),[])});Ii({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>ue(()=>import("./elixir-deUWdS0T.js"),[])});Ii({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>ue(()=>import("./flow9-i9-g7ZhI.js"),[])});Ii({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>ue(()=>import("./fsharp-CzKuDChf.js"),[])});Ii({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>ue(()=>import("./freemarker2-y7u6w0Ay.js"),[]).then(n=>n.TagAutoInterpolationDollar)});Ii({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>ue(()=>import("./freemarker2-y7u6w0Ay.js"),[]).then(n=>n.TagAngleInterpolationDollar)});Ii({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>ue(()=>import("./freemarker2-y7u6w0Ay.js"),[]).then(n=>n.TagBracketInterpolationDollar)});Ii({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>ue(()=>import("./freemarker2-y7u6w0Ay.js"),[]).then(n=>n.TagAngleInterpolationBracket)});Ii({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>ue(()=>import("./freemarker2-y7u6w0Ay.js"),[]).then(n=>n.TagBracketInterpolationBracket)});Ii({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>ue(()=>import("./freemarker2-y7u6w0Ay.js"),[]).then(n=>n.TagAutoInterpolationDollar)});Ii({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>ue(()=>import("./freemarker2-y7u6w0Ay.js"),[]).then(n=>n.TagAutoInterpolationBracket)});Ii({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>ue(()=>import("./go-Cphgjts3.js"),[])});Ii({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>ue(()=>import("./graphql-Cg7bfA9N.js"),[])});Ii({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>ue(()=>import("./handlebars-S85RO9Wl.js"),[])});Ii({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>ue(()=>import("./hcl-0cvrggvQ.js"),[])});Ii({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:()=>ue(()=>import("./html-Dacsj3Wv.js"),[])});Ii({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>ue(()=>import("./ini-Drc7WvVn.js"),[])});Ii({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>ue(()=>import("./java-B_fMsGYe.js"),[])});Ii({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>ue(()=>import("./javascript-D9_7haWm.js"),__vite__mapDeps([239,240]))});Ii({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>ue(()=>import("./julia-Bqgm2twL.js"),[])});Ii({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>ue(()=>import("./kotlin-BSkB5QuD.js"),[])});Ii({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>ue(()=>import("./less-BsTHnhdd.js"),[])});Ii({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>ue(()=>import("./lexon-YWi4-JPR.js"),[])});Ii({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>ue(()=>import("./lua-nf6ki56Z.js"),[])});Ii({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>ue(()=>import("./liquid-BHc-pb31.js"),[])});Ii({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>ue(()=>import("./m3-Cpb6xl2v.js"),[])});Ii({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>ue(()=>import("./markdown-DSZPf7rp.js"),[])});Ii({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>ue(()=>import("./mdx-9Djz1Doq.js"),[])});Ii({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>ue(()=>import("./mips-B_c3zf-v.js"),[])});Ii({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>ue(()=>import("./msdax-rUNN04Wq.js"),[])});Ii({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>ue(()=>import("./mysql-DDwshQtU.js"),[])});Ii({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>ue(()=>import("./objective-c-B5zXfXm9.js"),[])});Ii({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>ue(()=>import("./pascal-CXOwvkN_.js"),[])});Ii({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>ue(()=>import("./pascaligo-Bc-ZgV77.js"),[])});Ii({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>ue(()=>import("./perl-CwNk8-XU.js"),[])});Ii({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>ue(()=>import("./pgsql-tGk8EFnU.js"),[])});Ii({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>ue(()=>import("./php-CpIb_Oan.js"),[])});Ii({id:"pla",extensions:[".pla"],loader:()=>ue(()=>import("./pla-B03wrqEc.js"),[])});Ii({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>ue(()=>import("./postiats-BKlk5iyT.js"),[])});Ii({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>ue(()=>import("./powerquery-Bhzvs7bI.js"),[])});Ii({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>ue(()=>import("./powershell-Dd3NCNK9.js"),[])});Ii({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>ue(()=>import("./protobuf-COyEY5Pt.js"),[])});Ii({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>ue(()=>import("./pug-BaJupSGV.js"),[])});Ii({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>ue(()=>import("./python-BfsFCJoe.js"),[])});Ii({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>ue(()=>import("./qsharp-DXyYeYxl.js"),[])});Ii({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>ue(()=>import("./r-CdQndTaG.js"),[])});Ii({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>ue(()=>import("./razor-EosmvnyS.js"),[])});Ii({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>ue(()=>import("./redis-CVwtpugi.js"),[])});Ii({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>ue(()=>import("./redshift-25W9uPmb.js"),[])});Ii({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>ue(()=>import("./restructuredtext-DfzH4Xui.js"),[])});Ii({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>ue(()=>import("./ruby-Cp1zYvxS.js"),[])});Ii({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>ue(()=>import("./rust-D5C2fndG.js"),[])});Ii({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>ue(()=>import("./sb-CDntyWJ8.js"),[])});Ii({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:()=>ue(()=>import("./scala-BoFRg7Ot.js"),[])});Ii({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>ue(()=>import("./scheme-Bio4gycK.js"),[])});Ii({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>ue(()=>import("./scss-4Ik7cdeQ.js"),[])});Ii({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>ue(()=>import("./shell-CX-rkNHf.js"),[])});Ii({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>ue(()=>import("./solidity-Tw7wswEv.js"),[])});Ii({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>ue(()=>import("./sophia-C5WLch3f.js"),[])});Ii({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>ue(()=>import("./sparql-DHaeiCBh.js"),[])});Ii({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>ue(()=>import("./sql-CCSDG5nI.js"),[])});Ii({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>ue(()=>import("./st-pnP8ivHi.js"),[])});Ii({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>ue(()=>import("./swift-DwJ7jVG9.js"),[])});Ii({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>ue(()=>import("./systemverilog-B9Xyijhd.js"),[])});Ii({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>ue(()=>import("./systemverilog-B9Xyijhd.js"),[])});Ii({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>ue(()=>import("./tcl-DnHyzjbg.js"),[])});Ii({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>ue(()=>import("./twig-CPajHgWi.js"),[])});Ii({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>ue(()=>import("./typescript-BP6bbBm4.js"),[])});Ii({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>ue(()=>import("./typespec-D-MeaMDU.js"),[])});Ii({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>ue(()=>import("./vb-DgyLZaXg.js"),[])});Ii({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>ue(()=>import("./wgsl-BIv9DU6q.js"),[])});Ii({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:()=>ue(()=>import("./xml-CzXAtCm1.js"),[])});Ii({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>ue(()=>import("./yaml-DxQCEjOw.js"),[])});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var uTr=Object.defineProperty,dTr=Object.getOwnPropertyDescriptor,hTr=Object.getOwnPropertyNames,fTr=Object.prototype.hasOwnProperty,pTr=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of hTr(e))!fTr.call(n,r)&&r!==t&&uTr(n,r,{get:()=>e[r],enumerable:!(i=dTr(e,r))||i.enumerable});return n},gTr=(n,e,t)=>(pTr(n,e,"default"),t),s3={};gTr(s3,m$);var V2e=class{constructor(e,t,i){this._onDidChange=new s3.Emitter,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)}},W2e={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}},z2e={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},Hdt=new V2e("css",W2e,z2e),Vdt=new V2e("scss",W2e,z2e),Wdt=new V2e("less",W2e,z2e);s3.languages.css={cssDefaults:Hdt,lessDefaults:Wdt,scssDefaults:Vdt};function U2e(){return ue(()=>import("./cssMode-BoHIq8nq.js"),[])}s3.languages.onLanguage("less",()=>{U2e().then(n=>n.setupMode(Wdt))});s3.languages.onLanguage("scss",()=>{U2e().then(n=>n.setupMode(Vdt))});s3.languages.onLanguage("css",()=>{U2e().then(n=>n.setupMode(Hdt))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var mTr=Object.defineProperty,_Tr=Object.getOwnPropertyDescriptor,vTr=Object.getOwnPropertyNames,bTr=Object.prototype.hasOwnProperty,yTr=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of vTr(e))!bTr.call(n,r)&&r!==t&&mTr(n,r,{get:()=>e[r],enumerable:!(i=_Tr(e,r))||i.enumerable});return n},CTr=(n,e,t)=>(yTr(n,e,"default"),t),nne={};CTr(nne,m$);var wTr=class{constructor(e,t,i){this._onDidChange=new nne.Emitter,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)}},xTr={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"},ine={format:xTr,suggest:{},data:{useDefaultDataProvider:!0}};function rne(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===S6,documentFormattingEdits:n===S6,documentRangeFormattingEdits:n===S6}}var S6="html",w$e="handlebars",x$e="razor",zdt=sne(S6,ine,rne(S6)),STr=zdt.defaults,Udt=sne(w$e,ine,rne(w$e)),ETr=Udt.defaults,qdt=sne(x$e,ine,rne(x$e)),kTr=qdt.defaults;nne.languages.html={htmlDefaults:STr,razorDefaults:kTr,handlebarDefaults:ETr,htmlLanguageService:zdt,handlebarLanguageService:Udt,razorLanguageService:qdt,registerHTMLLanguageService:sne};function TTr(){return ue(()=>import("./htmlMode-DGmvB-2z.js"),[])}function sne(n,e=ine,t=rne(n)){const i=new wTr(n,e,t);let r;const s=nne.languages.onLanguage(n,async()=>{r=(await TTr()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),r==null||r.dispose(),r=void 0}}}/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var ITr=Object.defineProperty,LTr=Object.getOwnPropertyDescriptor,ATr=Object.getOwnPropertyNames,NTr=Object.prototype.hasOwnProperty,DTr=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ATr(e))!NTr.call(n,r)&&r!==t&&ITr(n,r,{get:()=>e[r],enumerable:!(i=LTr(e,r))||i.enumerable});return n},RTr=(n,e,t)=>(DTr(n,e,"default"),t),_$={};RTr(_$,m$);var PTr=class{constructor(e,t,i){this._onDidChange=new _$.Emitter,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)}},OTr={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},MTr={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Kdt=new PTr("json",OTr,MTr),jTr=()=>Gdt().then(n=>n.getWorker());_$.languages.json={jsonDefaults:Kdt,getWorker:jTr};function Gdt(){return ue(()=>import("./jsonMode-BiEk0LHp.js"),[])}_$.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});_$.languages.onLanguage("json",()=>{Gdt().then(n=>n.setupMode(Kdt))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var FTr=Object.defineProperty,BTr=Object.getOwnPropertyDescriptor,$Tr=Object.getOwnPropertyNames,HTr=Object.prototype.hasOwnProperty,VTr=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $Tr(e))!HTr.call(n,r)&&r!==t&&FTr(n,r,{get:()=>e[r],enumerable:!(i=BTr(e,r))||i.enumerable});return n},WTr=(n,e,t)=>(VTr(n,e,"default"),t),zTr="5.4.5",LM={};WTr(LM,m$);var Ydt=(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))(Ydt||{}),Qdt=(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))(Qdt||{}),Xdt=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(Xdt||{}),Zdt=(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))(Zdt||{}),Jdt=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(Jdt||{}),eht=class{constructor(n,e,t,i,r){this._onDidChange=new LM.Emitter,this._onDidExtraLibsChange=new LM.Emitter,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)}},UTr=zTr,tht={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},nht=new eht({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},tht),iht=new eht({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},tht),qTr=()=>one().then(n=>n.getTypeScriptWorker()),KTr=()=>one().then(n=>n.getJavaScriptWorker());LM.languages.typescript={ModuleKind:Ydt,JsxEmit:Qdt,NewLineKind:Xdt,ScriptTarget:Zdt,ModuleResolutionKind:Jdt,typescriptVersion:UTr,typescriptDefaults:nht,javascriptDefaults:iht,getTypeScriptWorker:qTr,getJavaScriptWorker:KTr};function one(){return ue(()=>import("./tsMode-C-gXeZW2.js"),[])}LM.languages.onLanguage("typescript",()=>one().then(n=>n.setupTypeScript(nht)));LM.languages.onLanguage("javascript",()=>one().then(n=>n.setupJavaScript(iht)));class GTr extends Mh{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:$i("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Yt.map,toggled:It.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:It.has("isInDiffEditor"),menu:{when:It.has("isInDiffEditor"),id:zn.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Dr),r=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}class rht extends Mh{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:$i("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:It.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dr),r=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",r)}}class sht extends Mh{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:$i("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:It.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dr),r=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}const v$=$i("diffEditor","Diff Editor");class YTr extends Zb{constructor(){super({id:"diffEditor.switchSide",title:$i("switchSide","Switch Side"),icon:Yt.arrowSwap,precondition:It.has("isInDiffEditor"),f1:!0,category:v$})}runEditorCommand(e,t,i){const r=o3(e);if(r instanceof Mw){if(i&&i.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}class QTr extends Zb{constructor(){super({id:"diffEditor.exitCompareMove",title:$i("exitCompareMove","Exit Compare Move"),icon:Yt.close,precondition:me.comparingMovedCode,f1:!1,category:v$,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const r=o3(e);r instanceof Mw&&r.exitCompareMove()}}class XTr extends Zb{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:$i("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Yt.fold,precondition:It.has("isInDiffEditor"),f1:!0,category:v$})}runEditorCommand(e,t,...i){const r=o3(e);r instanceof Mw&&r.collapseAllUnchangedRegions()}}class ZTr extends Zb{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:$i("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Yt.unfold,precondition:It.has("isInDiffEditor"),f1:!0,category:v$})}runEditorCommand(e,t,...i){const r=o3(e);r instanceof Mw&&r.showAllUnchangedRegions()}}class e0e extends Mh{constructor(){super({id:"diffEditor.revert",title:$i("revert","Revert"),f1:!1,category:v$})}run(e,t){const i=JTr(e,t.originalUri,t.modifiedUri);i instanceof Mw&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const oht=$i("accessibleDiffViewer","Accessible Diff Viewer"),bX=class bX extends Mh{constructor(){super({id:bX.id,title:$i("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:oht,precondition:It.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=o3(e);t==null||t.accessibleDiffViewerNext()}};bX.id="editor.action.accessibleDiffViewer.next";let rB=bX;const yX=class yX extends Mh{constructor(){super({id:yX.id,title:$i("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:oht,precondition:It.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=o3(e);t==null||t.accessibleDiffViewerPrev()}};yX.id="editor.action.accessibleDiffViewer.prev";let kY=yX;function JTr(n,e,t){return n.get(Cs).listDiffEditors().find(s=>{var l,c;const o=s.getModifiedEditor(),a=s.getOriginalEditor();return o&&((l=o.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((c=a.getModel())==null?void 0:c.uri.toString())===e.toString()})||null}function o3(n){const t=n.get(Cs).listDiffEditors(),i=Hu();if(i)for(const r of t){const s=r.getContainerDomNode();if(e2r(s,i))return r}return null}function e2r(n,e){let t=e;for(;t;){if(t===n)return!0;t=t.parentElement}return!1}Ao(GTr);Ao(rht);Ao(sht);Uc.appendMenuItem(zn.EditorTitle,{command:{id:new sht().desc.id,title:A("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:It.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:It.has("isInDiffEditor")},order:11,group:"1_diff",when:It.and(me.diffEditorRenderSideBySideInlineBreakpointReached,It.has("isInDiffEditor"))});Uc.appendMenuItem(zn.EditorTitle,{command:{id:new rht().desc.id,title:A("showMoves","Show Moved Code Blocks"),icon:Yt.move,toggled:V4.create("config.diffEditor.experimental.showMoves",!0),precondition:It.has("isInDiffEditor")},order:10,group:"1_diff",when:It.has("isInDiffEditor")});Ao(e0e);for(const n of[{icon:Yt.arrowRight,key:me.diffEditorInlineMode.toNegated()},{icon:Yt.discard,key:me.diffEditorInlineMode}])Uc.appendMenuItem(zn.DiffEditorHunkToolbar,{command:{id:new e0e().desc.id,title:A("revertHunk","Revert Block"),icon:n.icon},when:It.and(me.diffEditorModifiedWritable,n.key),order:5,group:"primary"}),Uc.appendMenuItem(zn.DiffEditorSelectionToolbar,{command:{id:new e0e().desc.id,title:A("revertSelection","Revert Selection"),icon:n.icon},when:It.and(me.diffEditorModifiedWritable,n.key),order:5,group:"primary"});Ao(YTr);Ao(QTr);Ao(XTr);Ao(ZTr);Uc.appendMenuItem(zn.EditorTitle,{command:{id:rB.id,title:A("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:It.has("isInDiffEditor")},order:10,group:"2_diff",when:It.and(me.accessibleDiffViewerVisible.negate(),It.has("isInDiffEditor"))});os.registerCommandAlias("editor.action.diffReview.next",rB.id);Ao(rB);os.registerCommandAlias("editor.action.diffReview.prev",kY.id);Ao(kY);var t2r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},n2r=function(n,e){return function(t,i){e(t,i,n)}},t0e;const ane=new yn("selectionAnchorSet",!1);var AI;let lk=(AI=class{static get(e){return e.getContribution(t0e.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=ane.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(Yn.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new rd().appendText(A("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ph(A("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(Yn.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()}},t0e=AI,AI.ID="editor.contrib.selectionAnchorController",AI);lk=t0e=t2r([n2r(1,Oi)],lk);class i2r extends In{constructor(){super({id:"editor.action.setSelectionAnchor",label:A("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2080),weight:100}})}async run(e,t){var i;(i=lk.get(t))==null||i.setSelectionAnchor()}}class r2r extends In{constructor(){super({id:"editor.action.goToSelectionAnchor",label:A("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:ane})}async run(e,t){var i;(i=lk.get(t))==null||i.goToSelectionAnchor()}}class s2r extends In{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:A("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:ane,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2089),weight:100}})}async run(e,t){var i;(i=lk.get(t))==null||i.selectFromAnchorToCursor()}}class o2r extends In{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:A("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:ane,kbOpts:{kbExpr:me.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=lk.get(t))==null||i.cancelSelectionAnchor()}}cs(lk.ID,lk,4);zt(i2r);zt(r2r);zt(s2r);zt(o2r);const a2r=ve("editorOverviewRuler.bracketMatchForeground","#A0A0A0",A("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class l2r extends In{constructor(){super({id:"editor.action.jumpToBracket",label:A("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=ZL.get(t))==null||i.jumpToBracket()}}class c2r extends In{constructor(){super({id:"editor.action.selectToBracket",label:A("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:$i("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let r=!0;i&&i.selectBrackets===!1&&(r=!1),(s=ZL.get(t))==null||s.selectToBracket(r)}}class u2r extends In{constructor(){super({id:"editor.action.removeBrackets",label:A("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=ZL.get(t))==null||i.removeBrackets(this.id)}}class d2r{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const fS=class fS extends Ye{static get(e){return e.getContribution(fS.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ao(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),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(72)&&(this._matchBrackets=this._editor.getOption(72),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(),s=e.bracketPairs.matchBracket(r);let o=null;if(s)s[0].containsPosition(r)&&!s[1].containsPosition(r)?o=s[1].getStartPosition():s[1].containsPosition(r)&&(o=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)o=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(o=l.range.getStartPosition())}}return o?new Yn(o.lineNumber,o.column,o.lineNumber,o.column):new Yn(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 s=r.getStartPosition();let o=t.bracketPairs.matchBracket(s);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(s),!o)){const c=t.bracketPairs.findNextBracket(s);c&&c.range&&(o=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(o){o.sort(ie.compareRangesUsingStarts);const[c,u]=o;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(s)){const d=a;a=l,l=d}}a&&l&&i.push(new Yn(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 s=t.bracketPairs.matchBracket(r);s||(s=t.bracketPairs.findEnclosingBrackets(r)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[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 s=[];let o=0;for(let d=0,f=e.length;d<f;d++){const p=e[d];p.isEmpty()&&(s[o++]=p.getStartPosition())}s.length>1&&s.sort(We.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,f=s.length;d<f;d++){const p=s[d];for(;c<u&&r[c].position.isBefore(p);)c++;if(c<u&&r[c].position.equals(p))a[l++]=r[c];else{let g=t.bracketPairs.matchBracket(p,20),m=fS._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!g&&this._matchBrackets==="always"&&(g=t.bracketPairs.findEnclosingBrackets(p,20),m=fS._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new d2r(p,g,m)}}this._lastBracketsData=a,this._lastVersionId=i}};fS.ID="editor.contrib.bracketMatchingController",fS._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=ur.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Ga(a2r),position:ug.Center}}),fS._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=ur.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let ZL=fS;cs(ZL.ID,ZL,1);zt(c2r);zt(l2r);zt(u2r);Uc.appendMenuItem(zn.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:A({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class h2r{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,s=this._selection.endColumn;if(!(this._isMovingLeft&&r===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const o=new ie(i,r-1,i,r),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new ie(i,s,i,s),a)}else{const o=new ie(i,s,i,s+1),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new ie(i,r,i,r),a)}}computeCursorState(e,t){return this._isMovingLeft?new Yn(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Yn(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class aht extends In{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],r=t.getSelections();for(const s of r)i.push(new h2r(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class f2r extends aht{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:A("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:me.writable})}}class p2r extends aht{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:A("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:me.writable})}}zt(f2r);zt(p2r);class g2r extends In{constructor(){super({id:"editor.action.transposeLetters",label:A("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:me.writable,kbOpts:{kbExpr:me.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),r=[],s=t.getSelections();for(const o of s){if(!o.isEmpty())continue;const a=o.startLineNumber,l=o.startColumn,c=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&c===2))continue;const u=l===c?o.getPosition():Ks.rightPosition(i,o.getPosition().lineNumber,o.getPosition().column),d=Ks.leftPosition(i,u),f=Ks.leftPosition(i,d),p=i.getValueInRange(ie.fromPositions(f,d)),g=i.getValueInRange(ie.fromPositions(d,u)),m=ie.fromPositions(f,u);r.push(new Bu(m,g+p))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}zt(g2r);const lne=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,s="";return s+=t[e[r++]],s+=t[e[r++]],s+=t[e[r++]],s+=t[e[r++]],s+="-",s+=t[e[r++]],s+=t[e[r++]],s+="-",s+=t[e[r++]],s+=t[e[r++]],s+="-",s+=t[e[r++]],s+=t[e[r++]],s+="-",s+=t[e[r++]],s+=t[e[r++]],s+=t[e[r++]],s+=t[e[r++]],s+=t[e[r++]],s+=t[e[r++]],s}}();function q2e(n){return{asString:async()=>n,asFile:()=>{},value:typeof n=="string"?n:void 0}}function m2r(n,e,t){const i={id:lne(),name:n,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class lht{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 ss.some(this,([i,r])=>r.asFile())&&t.push("files"),uht(TY(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?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 TY(e)}}function TY(n){return n.toLowerCase()}function cht(n,e){return uht(TY(n),e.map(TY))}function uht(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,s]=t;return s==="*"?e.some(o=>o.startsWith(r+"/")):!1}const cne=Object.freeze({create:n=>Iw(n.map(e=>e.toString())).join(`\r `),split:n=>n.split(`\r `),parse:n=>cne.split(n).filter(e=>!e.startsWith("#"))}),K0=class K0{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+K0.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new K0((this.value?[this.value,...e]:e).join(K0.sep))}};K0.sep=".",K0.None=new K0("@@none@@"),K0.Empty=new K0("");let ha=K0;const S$e={EDITORS:"CodeEditors",FILES:"CodeFiles"};class _2r{}const v2r={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Ca.add(v2r.DragAndDropContribution,new _2r);const Y6=class Y6{constructor(){}static getInstance(){return Y6.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};Y6.INSTANCE=new Y6;let n0e=Y6;function dht(n){const e=new lht;for(const t of n.items){const i=t.type;if(t.kind==="string"){const r=new Promise(s=>t.getAsString(s));e.append(i,q2e(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(i,b2r(r))}}return e}function b2r(n){const e=n.path?vi.parse(n.path):void 0;return m2r(n.name,e,async()=>new Uint8Array(await n.arrayBuffer()))}const y2r=Object.freeze([S$e.EDITORS,S$e.FILES,A7.RESOURCES,A7.INTERNAL_URI_LIST]);function hht(n,e=!1){const t=dht(n),i=t.get(A7.INTERNAL_URI_LIST);if(i)t.replace(ol.uriList,i);else if(e||!t.has(ol.uriList)){const r=[];for(const s of n.items){const o=s.getAsFile();if(o){const a=o.path;try{a?r.push(vi.file(a).toString()):r.push(vi.parse(o.name,!0).toString())}catch{}}}r.length&&t.replace(ol.uriList,q2e(cne.create(r)))}for(const r of y2r)t.delete(r);return t}var K2e=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},sB=function(n,e){return function(t,i){e(t,i,n)}};class G2e{async provideDocumentPasteEdits(e,t,i,r,s){const o=await this.getEdit(i,s);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,r){const s=await this.getEdit(i,r);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const Q6=class Q6 extends G2e{constructor(){super(...arguments),this.kind=Q6.kind,this.dropMimeTypes=[ol.text],this.pasteMimeTypes=[ol.text]}async getEdit(e,t){const i=e.get(ol.text);if(!i||e.has(ol.uriList))return;const r=await i.asString();return{handledMimeType:ol.text,title:A("text.label","Insert Plain Text"),insertText:r,kind:this.kind}}};Q6.id="text",Q6.kind=new ha("text.plain");let JL=Q6;class fht extends G2e{constructor(){super(...arguments),this.kind=new ha("uri.absolute"),this.dropMimeTypes=[ol.uriList],this.pasteMimeTypes=[ol.uriList]}async getEdit(e,t){const i=await pht(e);if(!i.length||t.isCancellationRequested)return;let r=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===ir.file?a.fsPath:(r++,l)).join(" ");let o;return r>0?o=i.length>1?A("defaultDropProvider.uriList.uris","Insert Uris"):A("defaultDropProvider.uriList.uri","Insert Uri"):o=i.length>1?A("defaultDropProvider.uriList.paths","Insert Paths"):A("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:ol.uriList,insertText:s,title:o,kind:this.kind}}}let IY=class extends G2e{constructor(e){super(),this._workspaceContextService=e,this.kind=new ha("uri.relative"),this.dropMimeTypes=[ol.uriList],this.pasteMimeTypes=[ol.uriList]}async getEdit(e,t){const i=await pht(e);if(!i.length||t.isCancellationRequested)return;const r=iv(i.map(({uri:s})=>{const o=this._workspaceContextService.getWorkspaceFolder(s);return o?Fpr(o.uri,s):void 0}));if(r.length)return{handledMimeType:ol.uriList,insertText:r.join(" "),title:i.length>1?A("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):A("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};IY=K2e([sB(0,qL)],IY);class C2r{constructor(){this.kind=new ha("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:ol.text}]}async provideDocumentPasteEdits(e,t,i,r,s){var l;if(r.triggerKind!==r7.PasteAs&&!((l=r.only)!=null&&l.contains(this.kind)))return;const o=i.get("text/html"),a=await(o==null?void 0:o.asString());if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:A("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function pht(n){const e=n.get(ol.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const r of cne.parse(t))try{i.push({uri:vi.parse(r),originalText:r})}catch{}return i}let i0e=class extends Ye{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new JL)),this._register(e.documentDropEditProvider.register("*",new fht)),this._register(e.documentDropEditProvider.register("*",new IY(t)))}};i0e=K2e([sB(0,Fn),sB(1,qL)],i0e);let r0e=class extends Ye{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new JL)),this._register(e.documentPasteEditProvider.register("*",new fht)),this._register(e.documentPasteEditProvider.register("*",new IY(t))),this._register(e.documentPasteEditProvider.register("*",new C2r))}};r0e=K2e([sB(0,Fn),sB(1,qL)],r0e);const k_=class k_{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=k_._table[i],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(k_.isDigitCharacter(i)){r=8;do t+=1,i=this.value.charCodeAt(e+t);while(k_.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}if(k_.isVariableCharacter(i)){r=9;do i=this.value.charCodeAt(e+ ++t);while(k_.isVariableCharacter(i)||k_.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 k_._table[i]>"u"&&!k_.isDigitCharacter(i)&&!k_.isVariableCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}};k_._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let s0e=k_;class a3{constructor(){this._children=[]}appendChild(e){return e instanceof mh&&this._children[this._children.length-1]instanceof mh?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),s=i.children.slice(0);s.splice(r,1,...t),i._children=s,function o(a,l){for(const c of a)c.parent=l,o(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 b$)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class mh extends a3{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new mh(this.value)}}class ght extends a3{}class am extends ght{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 l3?this._children[0]:void 0}clone(){const e=new am(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class l3 extends a3{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof mh&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new l3;return this.options.forEach(e.appendChild,e),e}}class Y2e extends a3{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(s=>s instanceof nb&&!!s.elseValue)&&(r=this._replace([])),r}_replace(e){let t="";for(const i of this._children)if(i instanceof nb){let r=e[i.index]||"";r=i.resolve(r),t+=r}else t+=i.toString();return t}toString(){return""}clone(){const e=new Y2e;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 nb extends a3{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 nb(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class oB extends ght{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 mh(t)],!0):!1}clone(){const e=new oB(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function E$e(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class b$ extends a3{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof am&&(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 E$e([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof am&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof oB&&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 b$;return this._children=this.children.map(t=>t.clone()),e}walk(e){E$e(this.children,e)}}class eA{constructor(){this._scanner=new s0e,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 b$;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,s=[];t.walk(l=>(l instanceof am&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):s.push(l)),!0));const o=(l,c)=>{const u=r.get(l.index);if(!u)return;const d=new am(l.index);d.transform=l.transform;for(const f of u){const p=f.clone();d.appendChild(p),p instanceof am&&r.has(p.index)&&!c.has(p.index)&&(c.add(p.index),o(p,c),c.delete(p.index))}t.replace(l,[d])},a=new Set;for(const l of s)o(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new am(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 mh(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 am(Number(t)):new oB(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 s=new am(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new mh("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const o=new l3;for(;;){if(this._parseChoiceElement(o)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(o),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!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 mh(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 s=new oB(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new mh("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new Y2e;let i="",r="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new mh(s));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 nb(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new nb(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new nb(Number(r),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new nb(Number(r),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new nb(Number(r),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const o=this._until(4);if(o)return e.appendChild(new nb(Number(r),void 0,s,o)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new nb(Number(r),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new mh(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function mht(n,e,t){var i,r;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(s=>new dE(n,{range:s,text:typeof t.insertText=="string"?eA.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((r=t.additionalEdit)==null?void 0:r.edits)??[]]}}function _ht(n){function e(o,a){return"mimeType"in o?o.mimeType===a.handledMimeType:!!a.kind&&o.kind.contains(a.kind)}const t=new Map;for(const o of n)for(const a of o.yieldTo??[])for(const l of n)if(l!==o&&e(a,l)){let c=t.get(o);c||(c=[],t.set(o,c)),c.push(l)}if(!t.size)return Array.from(n);const i=new Set,r=[];function s(o){if(!o.length)return[];const a=o[0];if(r.includes(a))return console.warn("Yield to cycle detected",a),o;if(i.has(a))return s(o.slice(1));let l=[];const c=t.get(a);return c&&(r.push(a),l=s(c),r.pop()),i.add(a),[...l,a,...s(o.slice(1))]}return s(Array.from(n))}var w2r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},x2r=function(n,e){return function(t,i){e(t,i,n)}};const S2r=ur.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Aot,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),CX=class CX extends Ye{constructor(e,t,i,r,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=Jt(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Jt("span.icon");this.domNode.append(t),t.classList.add(...Ni.asClassNameArray(Yt.loading),"codicon-modifier-spin");const i=()=>{const r=this.editor.getOption(67);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(67))&&i()})),this._register(_t(this.domNode,Xt.CLICK,r=>{this.delegate.cancel()}))}getId(){return CX.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)}};CX.baseId="editor.widget.inlineProgressWidget";let o0e=CX,LY=class extends Ye{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Dc),this._currentWidget=this._register(new Dc),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,r,s){const o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=XE(()=>{const a=ie.fromPositions(e);this._currentDecorations.set([{range:a,options:S2r}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(o0e,this.id,this._editor,a,t,r))},s??this._showDelay);try{return await i}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};LY=w2r([x2r(2,mi)],LY);var E2r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},k$e=function(n,e){return function(t,i){e(t,i,n)}},EU,mE;let ep=(mE=class{static get(e){return e.getContribution(EU.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Dc,this._messageListeners=new Et,this._mouseOverMessage=!1,this._editor=e,this._visible=EU.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)==null||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Ph(Rb(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Rb(e)?Lte(e,{actionHandler:{callback:r=>{this.closeMessage(),pTe(this._openerService,r,Rb(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new T$e(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(rn.debounce(this._editor.onDidBlurEditorText,(r,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&kc(Hu(),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(_t(this._messageWidget.value.getDomNode(),Xt.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(_t(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 ie(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(T$e.fadeOut(this._messageWidget.value))}},EU=mE,mE.ID="editor.contrib.messageController",mE.MESSAGE_VISIBLE=new yn("messageVisible",!1,A("messageVisible","Whether the editor is currently showing an inline message")),mE);ep=EU=E2r([k$e(1,Oi),k$e(2,xf)],ep);const k2r=pc.bindToContribution(ep.get);gn(new k2r({id:"leaveEditorMessage",precondition:ep.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:130,primary:9}}));let T$e=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 s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const o=document.createElement("div");typeof r=="string"?(o.classList.add("message"),o.textContent=r):(r.classList.add("message"),o.appendChild(r)),this._domNode.appendChild(o);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)}};cs(ep.ID,ep,4);function Oue(n,e){return e&&(n.stack||n.stacktrace)?A("stackTrace.format","{0}: {1}",L$e(n),I$e(n.stack)||I$e(n.stacktrace)):L$e(n)}function I$e(n){return Array.isArray(n)?n.join(` `):n}function L$e(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"?A("nodeExceptionMessage","A system error occurred ({0})",n.message):n.message||A("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function AY(n=null,e=!1){if(!n)return A("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=iv(n),i=AY(t[0],e);return t.length>1?A("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(cf(n))return n;if(n.detail){const t=n.detail;if(t.error)return Oue(t.error,e);if(t.exception)return Oue(t.exception,e)}return n.stack?Oue(n,e):n.message?n.message:A("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var vht=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},ZP=function(n,e){return function(t,i){e(t,i,n)}},a0e,NI;let l0e=(NI=class extends Ye{constructor(e,t,i,r,s,o,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=s,this.edits=o,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(gi(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(gi(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{s.containsPosition(d.position)||this.dispose()})),this._register(rn.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=Jt(".post-edit-widget"),this.button=this._register(new MG(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(_t(this.domNode,Xt.CLICK,()=>this.showSelector()))}getId(){return a0e.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=al(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>uI({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},a0e=NI,NI.baseId="editor.widget.postEditWidget",NI);l0e=a0e=vht([ZP(7,up),ZP(8,Oi),ZP(9,Ws)],l0e);let NY=class extends Ye{constructor(e,t,i,r,s,o,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=r,this._instantiationService=s,this._bulkEditService=o,this._notificationService=a,this._currentWidget=this._register(new Dc),this._register(rn.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,r,s){const o=this._editor.getModel();if(!o||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async _=>{const v=this._editor.getModel();v&&(await v.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:_,allEdits:t.allEdits},i,r,s))},c=(_,v)=>{Km(_)||(this._notificationService.error(v),i&&this.show(e[0],t,l))};let u;try{u=await r(a,s)}catch(_){return c(_,A("resolveError",`Error resolving edit '{0}': {1}`,a.title,AY(_)))}if(s.isCancellationRequested)return;const d=mht(o.uri,e,u),f=e[0],p=o.deltaDecorations([],[{range:f,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let g,m;try{g=await this._bulkEditService.apply(d,{editor:this._editor,token:s}),m=o.getDecorationRange(p[0])}catch(_){return c(_,A("applyError",`Error applying edit '{0}': {1}`,a.title,AY(_)))}finally{o.deltaDecorations(p,[])}s.isCancellationRequested||i&&g.isApplied&&t.allEdits.length>1&&this.show(m??f,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(l0e,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)==null||e.showSelector()}};NY=vht([ZP(4,mi),ZP(5,t$),ZP(6,wl)],NY);var T2r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},BD=function(n,e){return function(t,i){e(t,i,n)}},u2;const bht="editor.changePasteType",Q2e=new yn("pasteWidgetVisible",!1,A("pasteWidgetVisible","Whether the paste widget is showing")),Mue="application/vnd.code.copyMetadata";var DI;let jw=(DI=class extends Ye{static get(e){return e.getContribution(u2.ID)}constructor(e,t,i,r,s,o,a){super(),this._bulkEditService=i,this._clipboardService=r,this._languageFeaturesService=s,this._quickInputService=o,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(_t(l,"copy",c=>this.handleCopy(c))),this._register(_t(l,"cut",c=>this.handleCopy(c))),this._register(_t(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new LY("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(NY,"pasteIntoEditor",e,Q2e,{id:bht,label:A("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},H4().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(85).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var m,_,v,b;if(!this._editor.hasTextFocus()||((_=(m=this._clipboardService).clearInternalState)==null||_.call(m),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!(i!=null&&i.length))return;const r=this._editor.getOption(37);let s=i;const o=i.length===1&&i[0].isEmpty();if(o){if(!r)return;s=[new ie(s[0].startLineNumber,1,s[0].startLineNumber,1+t.getLineLength(s[0].startLineNumber))]}const a=(v=this._editor._getViewModel())==null?void 0:v.getPlainTextToCopy(i,r,Wu),c={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:o,mode:null},u=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(y=>!!y.prepareDocumentPaste);if(!u.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:c});return}const d=dht(e.clipboardData),f=u.flatMap(y=>y.copyMimeTypes??[]),p=lne();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:f,defaultPastePayload:c});const g=Ic(async y=>{const C=iv(await Promise.all(u.map(async S=>{try{return await S.prepareDocumentPaste(t,s,d,y)}catch(k){console.error(k);return}})));C.reverse();for(const S of C)for(const[k,I]of S)d.replace(k,I);return d});(b=u2._currentCopyOperation)==null||b.dataTransferPromise.cancel(),u2._currentCopyOperation={handle:p,dataTransferPromise:g}}async handlePaste(e){var l,c,u;if(!e.clipboardData||!this._editor.hasTextFocus())return;(l=ep.get(this._editor))==null||l.closeMessage(),(c=this._currentPasteOperation)==null||c.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!(i!=null&&i.length)||!t||this._editor.getOption(92)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const r=this.fetchCopyMetadata(e),s=hht(e.clipboardData);s.delete(Mue);const o=[...e.clipboardData.types,...(r==null?void 0:r.providerCopyMimeTypes)??[],ol.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(d=>{var p,g;const f=(p=this._pasteAsActionContext)==null?void 0:p.preferred;return f&&d.providedPasteEditKinds&&!this.providerMatchesPreference(d,f)?!1:(g=d.pasteMimeTypes)==null?void 0:g.some(m=>cht(m,o))});if(!a.length){(u=this._pasteAsActionContext)!=null&&u.preferred&&this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,a,i,s,r):this.doPasteInline(a,i,s,r,e)}showPasteAsNoEditMessage(e,t){var i;(i=ep.get(this._editor))==null||i.showMessage(A("pasteAsError","No paste edits for '{0}' found",t instanceof ha?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,r,s){const o=this._editor;if(!o.hasModel())return;const a=new ak(o,3,void 0),l=Ic(async c=>{const u=this._editor;if(!u.hasModel())return;const d=u.getModel(),f=new Et,p=f.add(new ba(c));f.add(a.token.onCancellationRequested(()=>p.cancel()));const g=p.token;try{if(await this.mergeInDataFromCopy(i,r,g),g.isCancellationRequested)return;const m=e.filter(b=>this.isSupportedPasteProvider(b,i));if(!m.length||m.length===1&&m[0]instanceof JL)return this.applyDefaultPasteHandler(i,r,g,s);const _={triggerKind:r7.Automatic},v=await this.getPasteEdits(m,i,d,t,_,g);if(f.add(v),g.isCancellationRequested)return;if(v.edits.length===1&&v.edits[0].provider instanceof JL)return this.applyDefaultPasteHandler(i,r,g,s);if(v.edits.length){const b=u.getOption(85).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:v.edits},b,(y,C)=>new Promise((S,k)=>{(async()=>{var I,L;try{const N=(L=(I=y.provider).resolveDocumentPasteEdit)==null?void 0:L.call(I,y,C),P=new $4,O=N&&await this._pasteProgressManager.showWhile(t[0].getEndPosition(),A("resolveProcess","Resolving paste edit. Click to cancel"),Promise.race([P.p,N]),{cancel:()=>(P.cancel(),k(new rv))},0);return O&&(y.additionalEdit=O.additionalEdit),S(y)}catch(N){return k(N)}})()}),g)}await this.applyDefaultPasteHandler(i,r,g,s)}finally{f.dispose(),this._currentPasteOperation===l&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),A("pasteIntoEditorProgress","Running paste handlers. Click to cancel and do basic paste"),l,{cancel:async()=>{try{if(l.cancel(),a.token.isCancellationRequested)return;await this.applyDefaultPasteHandler(i,r,a.token,s)}finally{a.dispose()}}}).then(()=>{a.dispose()}),this._currentPasteOperation=l}showPasteAsPick(e,t,i,r,s){const o=Ic(async a=>{const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new Et,d=u.add(new ak(l,3,void 0,a));try{if(await this.mergeInDataFromCopy(r,s,d.token),d.token.isCancellationRequested)return;let f=t.filter(v=>this.isSupportedPasteProvider(v,r,e));e&&(f=f.filter(v=>this.providerMatchesPreference(v,e)));const p={triggerKind:r7.PasteAs,only:e&&e instanceof ha?e:void 0};let g=u.add(await this.getPasteEdits(f,r,c,i,p,d.token));if(d.token.isCancellationRequested)return;if(e&&(g={edits:g.edits.filter(v=>e instanceof ha?e.contains(v.kind):e.providerId===v.provider.id),dispose:g.dispose}),!g.edits.length){p.only&&this.showPasteAsNoEditMessage(i,p.only);return}let m;if(e)m=g.edits.at(0);else{const v=await this._quickInputService.pick(g.edits.map(b=>{var y;return{label:b.title,description:(y=b.kind)==null?void 0:y.value,edit:b}}),{placeHolder:A("pasteAsPickerPlaceholder","Select Paste Action")});m=v==null?void 0:v.edit}if(!m)return;const _=mht(c.uri,i,m);await this._bulkEditService.apply(_,{editor:this._editor})}finally{u.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:A("pasteAsProgress","Running paste handlers")},()=>o)}setCopyMetadata(e,t){e.setData(Mue,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(Mue);if(t)try{return JSON.parse(t)}catch{return}const[i,r]=gbe.getTextData(e.clipboardData);if(r)return{defaultPastePayload:{mode:r.mode,multicursorText:r.multicursorText??null,pasteOnNewLine:!!r.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){var r;if(t!=null&&t.id&&((r=u2._currentCopyOperation)==null?void 0:r.handle)===t.id){const s=await u2._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[o,a]of s)e.replace(o,a)}if(!e.has(ol.uriList)){const s=await this._clipboardService.readResources();if(i.isCancellationRequested)return;s.length&&e.append(ol.uriList,q2e(cne.create(s)))}}async getPasteEdits(e,t,i,r,s,o){const a=new Et,l=await K9(Promise.all(e.map(async u=>{var d,f;try{const p=await((d=u.provideDocumentPasteEdits)==null?void 0:d.call(u,i,r,t,s,o));return p&&a.add(p),(f=p==null?void 0:p.edits)==null?void 0:f.map(g=>({...g,provider:u}))}catch(p){Km(p)||console.error(p);return}})),o),c=iv(l??[]).flat().filter(u=>!s.only||s.only.contains(u.kind));return{edits:_ht(c),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,r){const s=e.get(ol.text)??e.get("text"),o=await(s==null?void 0:s.asString())??"";if(i.isCancellationRequested)return;const a={clipboardEvent:r,text:o,pasteOnNewLine:(t==null?void 0:t.defaultPastePayload.pasteOnNewLine)??!1,multicursorText:(t==null?void 0:t.defaultPastePayload.multicursorText)??null,mode:null};this._editor.trigger("keyboard","paste",a)}isSupportedPasteProvider(e,t,i){var r;return(r=e.pasteMimeTypes)!=null&&r.some(s=>t.matches(s))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return t instanceof ha?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},u2=DI,DI.ID="editor.contrib.copyPasteActionController",DI);jw=u2=T2r([BD(1,mi),BD(2,t$),BD(3,tx),BD(4,Fn),BD(5,Ym),BD(6,Blt)],jw);const tA="9_cutcopypaste",I2r=qy||document.queryCommandSupported("cut"),yht=qy||document.queryCommandSupported("copy"),L2r=typeof navigator.clipboard>"u"||Dm?document.queryCommandSupported("paste"):!0;function X2e(n){return n.register(),n}const A2r=I2r?X2e(new W4({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:qy?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:zn.MenubarEditMenu,group:"2_ccp",title:A({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:zn.EditorContext,group:tA,title:A("actions.clipboard.cutLabel","Cut"),when:me.writable,order:1},{menuId:zn.CommandPalette,group:"",title:A("actions.clipboard.cutLabel","Cut"),order:1},{menuId:zn.SimpleEditorContext,group:tA,title:A("actions.clipboard.cutLabel","Cut"),when:me.writable,order:1}]})):void 0,N2r=yht?X2e(new W4({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:qy?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:zn.MenubarEditMenu,group:"2_ccp",title:A({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:zn.EditorContext,group:tA,title:A("actions.clipboard.copyLabel","Copy"),order:2},{menuId:zn.CommandPalette,group:"",title:A("actions.clipboard.copyLabel","Copy"),order:1},{menuId:zn.SimpleEditorContext,group:tA,title:A("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Uc.appendMenuItem(zn.MenubarEditMenu,{submenu:zn.MenubarCopy,title:$i("copy as","Copy As"),group:"2_ccp",order:3});Uc.appendMenuItem(zn.EditorContext,{submenu:zn.EditorContextCopy,title:$i("copy as","Copy As"),group:tA,order:3});Uc.appendMenuItem(zn.EditorContext,{submenu:zn.EditorContextShare,title:$i("share","Share"),group:"11_share",order:-1,when:It.and(It.notEquals("resourceScheme","output"),me.editorTextFocus)});Uc.appendMenuItem(zn.ExplorerContext,{submenu:zn.ExplorerContextShare,title:$i("share","Share"),group:"11_share",order:-1});const jue=L2r?X2e(new W4({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:qy?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:zn.MenubarEditMenu,group:"2_ccp",title:A({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:zn.EditorContext,group:tA,title:A("actions.clipboard.pasteLabel","Paste"),when:me.writable,order:4},{menuId:zn.CommandPalette,group:"",title:A("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:zn.SimpleEditorContext,group:tA,title:A("actions.clipboard.pasteLabel","Paste"),when:me.writable,order:4}]})):void 0;class D2r extends In{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:A("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:me.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(fbe.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),fbe.forceCopyWithSyntaxHighlighting=!1)}}function Cht(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(Cs).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const s=r.getOption(37),o=r.getSelection();return o&&o.isEmpty()&&!s||r.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(H4().execCommand(e),!0)))}Cht(A2r,"cut");Cht(N2r,"copy");jue&&(jue.addImplementation(1e4,"code-editor",(n,e)=>{var s;const t=n.get(Cs),i=n.get(tx),r=t.getFocusedCodeEditor();return r&&r.hasTextFocus()?r.getContainerDomNode().ownerDocument.execCommand("paste")?((s=jw.get(r))==null?void 0:s.finishedPaste())??Promise.resolve():FA?(async()=>{const a=await i.readText();if(a!==""){const l=K7.INSTANCE.get(a);let c=!1,u=null,d=null;l&&(c=r.getOption(37)&&!!l.isFromEmptySelection,u=typeof l.multicursorText<"u"?l.multicursorText:null,d=l.mode),r.trigger("keyboard","paste",{text:a,pasteOnNewLine:c,multicursorText:u,mode:d})}})():!0:!1}),jue.addImplementation(0,"generic-dom",(n,e)=>(H4().execCommand("paste"),!0)));yht&&zt(D2r);const oa=new class{constructor(){this.QuickFix=new ha("quickfix"),this.Refactor=new ha("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new ha("notebook"),this.Source=new ha("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var cp;(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"})(cp||(cp={}));function R2r(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>wht(e,t,n.include))||!n.includeSourceActions&&oa.Source.contains(e))}function P2r(n,e){const t=e.kind?new ha(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>wht(t,i,n.include))||!n.includeSourceActions&&t&&oa.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function wht(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class vy{static fromUser(e,t){return!e||typeof e!="object"?new vy(t.kind,t.apply,!1):new vy(vy.getKindFromUser(e,t.kind),vy.getApplyFromUser(e,t.apply),vy.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 ha(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 O2r{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if((t=this.provider)!=null&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(r){ll(r)}i&&(this.action.edit=i.edit)}return this}}const xht="editor.action.codeAction",Z2e="editor.action.quickFix",Sht="editor.action.autoFix",Eht="editor.action.refactor",kht="editor.action.sourceAction",c0e="editor.action.organizeImports",u0e="editor.action.fixAll";class E6 extends Ye{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Gd(e.diagnostics)?Gd(t.diagnostics)?E6.codeActionsPreferredComparator(e,t):-1:Gd(t.diagnostics)?1:E6.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(E6.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&oa.QuickFix.contains(new ha(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const A$e={actions:[],documentation:void 0};async function zR(n,e,t,i,r,s){var m;const o=i.filter||{},a={...o,excludes:[...o.excludes||[],oa.Notebook]},l={only:(m=o.include)==null?void 0:m.value,trigger:i.type},c=new $2e(e,s),u=i.type===2,d=M2r(n,e,u?a:o),f=new Et,p=d.map(async _=>{try{r.report(_);const v=await _.provideCodeActions(e,t,l,c.token);if(v&&f.add(v),c.token.isCancellationRequested)return A$e;const b=((v==null?void 0:v.actions)||[]).filter(C=>C&&P2r(o,C)),y=F2r(_,b,o.include);return{actions:b.map(C=>new O2r(C,_)),documentation:y}}catch(v){if(Km(v))throw v;return ll(v),A$e}}),g=n.onDidChange(()=>{const _=n.all(e);fa(_,d)||c.cancel()});try{const _=await Promise.all(p),v=_.map(y=>y.actions).flat(),b=[...iv(_.map(y=>y.documentation)),...j2r(n,e,i,v)];return new E6(v,b,f)}finally{g.dispose(),c.dispose()}}function M2r(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(r=>R2r(t,new ha(r))):!0)}function*j2r(n,e,t,i){var r,s,o;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)==null?void 0:o.call(a,{trigger:t.type,only:(s=(r=t.filter)==null?void 0:r.include)==null?void 0:s.value},i.map(l=>l.action)))}function F2r(n,e,t){if(!n.documentation)return;const i=n.documentation.map(r=>({kind:new ha(r.kind),command:r.command}));if(t){let r;for(const s of i)s.kind.contains(t)&&(r?r.kind.contains(s.kind)&&(r=s):r=s);if(r)return r==null?void 0:r.command}for(const r of e)if(r.kind){for(const s of i)if(s.kind.contains(new ha(r.kind)))return s.command}}var X2;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions",n.FromAILightbulb="fromAILightbulb"})(X2||(X2={}));async function B2r(n,e,t,i,r=xr.None){var c;const s=n.get(t$),o=n.get(Fo),a=n.get(md),l=n.get(wl);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(r),!r.isCancellationRequested&&!((c=e.action.edit)!=null&&c.edits.length&&!(await 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!==X2.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{await o.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=$2r(u);l.error(typeof d=="string"?d:A("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function $2r(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}os.registerCommand("_executeCodeActionProvider",async function(n,e,t,i,r){if(!(e instanceof vi))throw Sm();const{codeActionProvider:s}=n.get(Fn),o=n.get(Xo).getModel(e);if(!o)throw Sm();const a=Yn.isISelection(t)?Yn.liftSelection(t):ie.isIRange(t)?o.validateRange(t):void 0;if(!a)throw Sm();const l=typeof i=="string"?new ha(i):void 0,c=await zR(s,o,a,{type:1,triggerAction:cp.Default,filter:{includeSourceActions:!0,include:l}},bb.None,xr.None),u=[],d=Math.min(c.validActions.length,typeof r=="number"?r:0);for(let f=0;f<d;f++)u.push(c.validActions[f].resolve(xr.None));try{return await Promise.all(u),c.validActions.map(f=>f.action)}finally{setTimeout(()=>c.dispose(),100)}});var H2r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},V2r=function(n,e){return function(t,i){e(t,i,n)}},d0e,RI;let h0e=(RI=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Bb(()=>this.keybindingService.getKeybindings().filter(t=>d0e.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===c0e?i={kind:oa.SourceOrganizeImports.value}:t.command===u0e&&(i={kind:oa.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...vy.fromUser(i,{kind:ha.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 ha(e.kind);return t.filter(r=>r.kind.contains(i)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,s)=>r?r.kind.contains(s.kind)?s:r:s,void 0)}},d0e=RI,RI.codeActionCommands=[Eht,xht,kht,c0e,u0e],RI);h0e=d0e=H2r([V2r(0,Ws)],h0e);ve("symbolIcon.arrayForeground",Or,A("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.booleanForeground",Or,A("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},A("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.colorForeground",Or,A("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.constantForeground",Or,A("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},A("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},A("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},A("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},A("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},A("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.fileForeground",Or,A("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.folderForeground",Or,A("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},A("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},A("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.keyForeground",Or,A("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.keywordForeground",Or,A("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},A("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.moduleForeground",Or,A("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.namespaceForeground",Or,A("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.nullForeground",Or,A("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.numberForeground",Or,A("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.objectForeground",Or,A("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.operatorForeground",Or,A("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.packageForeground",Or,A("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.propertyForeground",Or,A("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.referenceForeground",Or,A("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.snippetForeground",Or,A("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.stringForeground",Or,A("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.structForeground",Or,A("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.textForeground",Or,A("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.typeParameterForeground",Or,A("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.unitForeground",Or,A("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ve("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},A("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const Tht=Object.freeze({kind:ha.Empty,title:A("codeAction.widget.id.more","More Actions...")}),W2r=Object.freeze([{kind:oa.QuickFix,title:A("codeAction.widget.id.quickfix","Quick Fix")},{kind:oa.RefactorExtract,title:A("codeAction.widget.id.extract","Extract"),icon:Yt.wrench},{kind:oa.RefactorInline,title:A("codeAction.widget.id.inline","Inline"),icon:Yt.wrench},{kind:oa.RefactorRewrite,title:A("codeAction.widget.id.convert","Rewrite"),icon:Yt.wrench},{kind:oa.RefactorMove,title:A("codeAction.widget.id.move","Move"),icon:Yt.wrench},{kind:oa.SurroundWith,title:A("codeAction.widget.id.surround","Surround With"),icon:Yt.surroundWith},{kind:oa.Source,title:A("codeAction.widget.id.source","Source Action"),icon:Yt.symbolFile},Tht]);function z2r(n,e,t){if(!e)return n.map(s=>{var o;return{kind:"action",item:s,group:Tht,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!((o=s.action.edit)!=null&&o.edits.length)}});const i=W2r.map(s=>({group:s,actions:[]}));for(const s of n){const o=s.action.kind?new ha(s.action.kind):ha.None;for(const a of i)if(a.group.kind.contains(o)){a.actions.push(s);break}}const r=[];for(const s of i)if(s.actions.length){r.push({kind:"header",group:s.group});for(const o of s.actions){const a=s.group;r.push({kind:"action",item:o,group:o.action.isAI?{title:a.title,kind:a.kind,icon:Yt.sparkle}:a,label:o.action.title,disabled:!!o.action.disabled,keybinding:t(o.action)})}}return r}var U2r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},q2r=function(n,e){return function(t,i){e(t,i,n)}},aR;const N$e=Zo("gutter-lightbulb",Yt.lightBulb,A("gutterLightbulbWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor.")),D$e=Zo("gutter-lightbulb-auto-fix",Yt.lightbulbAutofix,A("gutterLightbulbAutoFixWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),R$e=Zo("gutter-lightbulb-sparkle",Yt.lightbulbSparkle,A("gutterLightbulbAIFixWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),P$e=Zo("gutter-lightbulb-aifix-auto-fix",Yt.lightbulbSparkleAutofix,A("gutterLightbulbAIFixAutoFixWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),O$e=Zo("gutter-lightbulb-sparkle-filled",Yt.sparkleFilled,A("gutterLightbulbSparkleFilledWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var Gv;(function(n){n.Hidden={type:0};class e{constructor(i,r,s,o){this.actions=i,this.trigger=r,this.editorPosition=s,this.widgetPosition=o,this.type=1}}n.Showing=e})(Gv||(Gv={}));var tw;let aB=(tw=class extends Ye{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new Ue),this.onClick=this._onClick.event,this._state=Gv.Hidden,this._gutterState=Gv.Hidden,this._iconClasses=[],this.lightbulbClasses=["codicon-"+N$e.id,"codicon-"+P$e.id,"codicon-"+D$e.id,"codicon-"+R$e.id,"codicon-"+O$e.id],this.gutterDecoration=aR.GUTTER_DECORATION,this._domNode=Jt("div.lightBulbWidget"),this._domNode.role="listbox",this._register(dd.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.gutterState.type!==1||!r||this.gutterState.editorPosition.lineNumber>=r.getLineCount())&&this.gutterHide()})),this._register(dlr(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:r,height:s}=al(this._domNode),o=this._editor.getOption(67);let a=Math.floor(o/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(a+=o),this._onClick.fire({x:i.posx,y:r+s+a,actions:this.state.actions,trigger:this.state.trigger})})),this._register(_t(this._domNode,"mouseenter",i=>{(i.buttons&1)===1&&this.hide()})),this._register(rn.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var i,r;this._preferredKbLabel=((i=this._keybindingService.lookupKeybinding(Sht))==null?void 0:i.getLabel())??void 0,this._quickFixKbLabel=((r=this._keybindingService.lookupKeybinding(Z2e))==null?void 0:r.getLabel())??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{if(!i.target.element||!this.lightbulbClasses.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==1)return;this._editor.focus();const{top:r,height:s}=al(i.target.element),o=this._editor.getOption(67);let a=Math.floor(o/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber<this.gutterState.editorPosition.lineNumber&&(a+=o),this._onClick.fire({x:i.event.posx,y:r+s+a,actions:this.gutterState.actions,trigger:this.gutterState.trigger})}))}dispose(){super.dispose(),this._editor.removeContentWidget(this),this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID)}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.gutterHide(),this.hide();if(!this._editor.hasTextFocus())return this.gutterHide(),this.hide();if(!this._editor.getOptions().get(65).enabled)return this.gutterHide(),this.hide();const o=this._editor.getModel();if(!o)return this.gutterHide(),this.hide();const{lineNumber:a,column:l}=o.validatePosition(i),c=o.getOptions().tabSize,u=this._editor.getOptions().get(50),d=o.getLineContent(a),f=Bte(d,c),p=u.spaceWidth*f>22,g=S=>S>2&&this._editor.getTopForLineNumber(S)===this._editor.getTopForLineNumber(S-1),m=this._editor.getLineDecorations(a);let _=!1;if(m)for(const S of m){const k=S.options.glyphMarginClassName;if(k&&!this.lightbulbClasses.some(I=>k.includes(I))){_=!0;break}}let v=a,b=1;if(!p){const S=k=>{const I=o.getLineContent(k);return/^\s*$|^\s+/.test(I)||I.length<=b};if(a>1&&!g(a-1)){const k=o.getLineCount(),I=a===k,L=a>1&&S(a-1),N=!I&&S(a+1),P=S(a),O=!N&&!L;if(!N&&!L&&!_)return this.gutterState=new Gv.Showing(e,t,i,{position:{lineNumber:v,column:b},preference:aR._posPref}),this.renderGutterLightbub(),this.hide();L||I||L&&!P?v-=1:(N||O&&P)&&(v+=1)}else if(a===1&&(a===o.getLineCount()||!S(a+1)&&!S(a)))if(this.gutterState=new Gv.Showing(e,t,i,{position:{lineNumber:v,column:b},preference:aR._posPref}),_)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(a<o.getLineCount()&&!g(a+1))v+=1;else if(l*u.spaceWidth<22)return this.hide();b=/^\S\s*$/.test(o.getLineContent(v))?2:1}this.state=new Gv.Showing(e,t,i,{position:{lineNumber:v,column:b},preference:aR._posPref}),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());const y=e.validActions,C=e.validActions[0].action.kind;if(y.length!==1||!C){this._editor.layoutContentWidget(this);return}this._editor.layoutContentWidget(this)}hide(){this.state!==Gv.Hidden&&(this.state=Gv.Hidden,this._editor.layoutContentWidget(this))}gutterHide(){this.gutterState!==Gv.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this.gutterState=Gv.Hidden)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}get gutterState(){return this._gutterState}set gutterState(e){this._gutterState=e,this._updateGutterLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],this.state.type!==1)return;let e,t=!1;this.state.actions.allAIFixes?(e=Yt.sparkleFilled,this.state.actions.validActions.length===1&&(t=!0)):this.state.actions.hasAutoFix?this.state.actions.hasAIFix?e=Yt.lightbulbSparkleAutofix:e=Yt.lightbulbAutofix:this.state.actions.hasAIFix?e=Yt.lightbulbSparkle:e=Yt.lightBulb,this._updateLightbulbTitle(this.state.actions.hasAutoFix,t),this._iconClasses=Ni.asClassNameArray(e),this._domNode.classList.add(...this._iconClasses)}_updateGutterLightBulbTitleAndIcon(){if(this.gutterState.type!==1)return;let e,t=!1;this.gutterState.actions.allAIFixes?(e=O$e,this.gutterState.actions.validActions.length===1&&(t=!0)):this.gutterState.actions.hasAutoFix?this.gutterState.actions.hasAIFix?e=P$e:e=D$e:this.gutterState.actions.hasAIFix?e=R$e:e=N$e,this._updateLightbulbTitle(this.gutterState.actions.hasAutoFix,t);const i=ur.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:Ni.asClassName(e),glyphMargin:{position:ov.Left},stickiness:1});this.gutterDecoration=i}renderGutterLightbub(){const e=this._editor.getSelection();e&&(this._gutterDecorationID===void 0?this._addGutterDecoration(e.startLineNumber):this._updateGutterDecoration(this._gutterDecorationID,e.startLineNumber))}_addGutterDecoration(e){this._editor.changeDecorations(t=>{this._gutterDecorationID=t.addDecoration(new ie(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new ie(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){this.state.type===1&&(t?this.title=A("codeActionAutoRun","Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=A("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=A("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=A("codeAction","Show Code Actions")))}set title(e){this._domNode.title=e}},aR=tw,tw.GUTTER_DECORATION=ur.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:Ni.asClassName(Yt.lightBulb),glyphMargin:{position:ov.Left},stickiness:1}),tw.ID="editor.contrib.lightbulbWidget",tw._posPref=[0],tw);aB=aR=U2r([q2r(1,Ws)],aB);var Iht=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},f0e=function(n,e){return function(t,i){e(t,i,n)}};const Lht="acceptSelectedCodeAction",Aht="previewSelectedCodeAction";class K2r{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;i.text.textContent=((r=e.group)==null?void 0:r.title)??""}disposeTemplate(e){}}let p0e=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 t3(e,Yf);return{container:e,icon:t,text:i,keybinding:r}}renderElement(e,t,i){var o,a,l;if((o=e.group)!=null&&o.icon?(i.icon.className=Ni.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=kn(e.group.icon.color.id))):(i.icon.className=Ni.asClassName(Yt.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=Nht(e.label),i.keybinding.set(e.keybinding),klr(!!e.keybinding,i.keybinding.element);const r=(a=this._keybindingService.lookupKeybinding(Lht))==null?void 0:a.getLabel(),s=(l=this._keybindingService.lookupKeybinding(Aht))==null?void 0:l.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:r&&s?this._supportsPreview&&e.canPreview?i.container.title=A({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to Apply, Shift+F2 to Preview"']},"{0} to Apply, {1} to Preview",r,s):i.container.title=A({key:"label",comment:['placeholder is a keybinding, e.g "F2 to Apply"']},"{0} to Apply",r):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};p0e=Iht([f0e(1,Ws)],p0e);class G2r extends UIEvent{constructor(){super("acceptSelectedAction")}}class M$e extends UIEvent{constructor(){super("previewSelectedAction")}}function Y2r(n){if(n.kind==="action")return n.label}let g0e=class extends Ye{constructor(e,t,i,r,s,o){super(),this._delegate=r,this._contextViewService=s,this._keybindingService=o,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new ba),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 Ig(e,this.domNode,a,[new p0e(t,this._keybindingService),new K2r],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Y2r},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?Nht(l==null?void 0:l.label):"";return l.disabled&&(c=A({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>A({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(WA),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(l=>l.kind==="header").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(r);let s=e;if(this._allMenuItems.length>=50)s=380;else{const l=this._allMenuItems.map((c,u)=>{const d=this.domNode.ownerDocument.getElementById(this._list.getElementID(u));if(d){d.style.width="auto";const f=d.getBoundingClientRect().width;return d.style.width="",f}return 0});s=Math.max(...l,e)}const a=Math.min(r,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,s),this.domNode.style.height=`${a}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 s=e?new M$e:new G2r;this._list.setSelection([i],s)}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 M$e):this._list.setSelection([])}onFocus(){var r,s;const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);(s=(r=this._delegate).onFocus)==null||s.call(r,i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=await 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([])}};g0e=Iht([f0e(4,Zw),f0e(5,Ws)],g0e);function Nht(n){return n.replace(/\r\n|\r|\n/g," ")}var Q2r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Fue=function(n,e){return function(t,i){e(t,i,n)}};ve("actionBar.toggledBackground",X9,A("actionBar.toggledBackground","Background color for toggled action items in action bar."));const nA={Visible:new yn("codeActionMenuVisible",!1,A("codeActionMenuVisible","Whether the action widget list is visible"))},QA=Ur("actionWidgetService");let iA=class extends Ye{get isVisible(){return nA.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Dc)}show(e,t,i,r,s,o,a){const l=nA.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(g0e,e,t,i,r);this._contextViewService.showContextView({getAnchor:()=>s,render:u=>(l.set(!0),this._renderWidget(u,c,a??[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},o,!1)}acceptSelected(e){var t;(t=this._list.value)==null||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)==null?void 0:e.value)==null||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)==null?void 0:e.value)==null||t.focusNext()}hide(e){var t;(t=this._list.value)==null||t.hide(e),this._list.clear()}_renderWidget(e,t,i){var p;const r=document.createElement("div");if(r.classList.add("action-widget"),e.appendChild(r),this._list.value=t,this._list.value)r.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Et,o=document.createElement("div"),a=e.appendChild(o);a.classList.add("context-view-block"),s.add(_t(a,Xt.MOUSE_DOWN,g=>g.stopPropagation()));const l=document.createElement("div"),c=e.appendChild(l);c.classList.add("context-view-pointerBlock"),s.add(_t(c,Xt.POINTER_MOVE,()=>c.remove())),s.add(_t(c,Xt.MOUSE_DOWN,()=>c.remove()));let u=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(r.appendChild(g.getContainer().parentElement),s.add(g),u=g.getContainer().offsetWidth)}const d=(p=this._list.value)==null?void 0:p.layout(u);r.style.width=`${d}px`;const f=s.add($b(e));return s.add(f.onDidBlur(()=>this.hide(!0))),s}_createActionBar(e,t){if(!t.length)return;const i=Jt(e),r=new hg(i);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)==null||t.hide(e)}};iA=Q2r([Fue(0,Zw),Fue(1,Oi),Fue(2,mi)],iA);ns(QA,iA,1);const y$=1100;Ao(class extends Mh{constructor(){super({id:"hideCodeActionWidget",title:$i("hideCodeActionWidget.title","Hide action widget"),precondition:nA.Visible,keybinding:{weight:y$,primary:9,secondary:[1033]}})}run(n){n.get(QA).hide(!0)}});Ao(class extends Mh{constructor(){super({id:"selectPrevCodeAction",title:$i("selectPrevCodeAction.title","Select previous action"),precondition:nA.Visible,keybinding:{weight:y$,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(QA);e instanceof iA&&e.focusPrevious()}});Ao(class extends Mh{constructor(){super({id:"selectNextCodeAction",title:$i("selectNextCodeAction.title","Select next action"),precondition:nA.Visible,keybinding:{weight:y$,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(QA);e instanceof iA&&e.focusNext()}});Ao(class extends Mh{constructor(){super({id:Lht,title:$i("acceptSelected.title","Accept selected action"),precondition:nA.Visible,keybinding:{weight:y$,primary:3,secondary:[2137]}})}run(n){const e=n.get(QA);e instanceof iA&&e.acceptSelected()}});Ao(class extends Mh{constructor(){super({id:Aht,title:$i("previewSelected.title","Preview selected action"),precondition:nA.Visible,keybinding:{weight:y$,primary:2051}})}run(n){const e=n.get(QA);e instanceof iA&&e.acceptSelected(!0)}});const Dht=new yn("supportedCodeAction",""),j$e="_typescript.applyFixAllCodeAction";class X2r extends Ye{constructor(e,t,i,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=r,this._autoTriggerTimer=this._register(new vv),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),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=>k7(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:cp.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const i=this._editor.getOption(65).enabled;if(i!==L_.Off){{if(i===L_.On)return t;if(i===L_.OnCode){if(!t.isEmpty())return t;const s=this._editor.getModel(),{lineNumber:o,column:a}=t.getPosition(),l=s.getLineContent(o);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===s.getLineMaxColumn(o)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var L2;(function(n){n.Empty={type:0};class e{constructor(i,r,s){this.trigger=i,this.position=r,this._cancellablePromise=s,this.type=1,this.actions=s.catch(o=>{if(Km(o))return Rht;throw o})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(L2||(L2={}));const Rht=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class Z2r extends Ye{constructor(e,t,i,r,s,o,a){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=o,this._telemetryService=a,this._codeActionOracle=this._register(new Dc),this._state=L2.Empty,this._onDidChangeState=this._register(new Ue),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Dht.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(l=>{l.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(L2.Empty,!0))}_settingEnabledNearbyQuickfixes(){var t;const e=(t=this._editor)==null?void 0:t.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e==null?void 0:e.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(L2.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(92)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new X2r(this._editor,this._markerService,i=>{var l;if(!i){this.setState(L2.Empty);return}const r=i.selection.getStartPosition(),s=Ic(async c=>{var u,d,f,p,g,m,_,v,b,y;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===cp.QuickFix||(d=(u=i.trigger.filter)==null?void 0:u.include)!=null&&d.contains(oa.QuickFix))){const C=await zR(this._registry,e,i.selection,i.trigger,bb.None,c),S=[...C.allActions];if(c.isCancellationRequested)return Rht;const k=(f=C.validActions)==null?void 0:f.some(L=>L.action.kind?oa.QuickFix.contains(new ha(L.action.kind)):!1),I=this._markerService.read({resource:e.uri});if(k){for(const L of C.validActions)(g=(p=L.action.command)==null?void 0:p.arguments)!=null&&g.some(N=>typeof N=="string"&&N.includes(j$e))&&(L.action.diagnostics=[...I.filter(N=>N.relatedInformation)]);return{validActions:C.validActions,allActions:S,documentation:C.documentation,hasAutoFix:C.hasAutoFix,hasAIFix:C.hasAIFix,allAIFixes:C.allAIFixes,dispose:()=>{C.dispose()}}}else if(!k&&I.length>0){const L=i.selection.getPosition();let N=L,P=Number.MAX_VALUE;const O=[...C.validActions];for(const V of I){const M=V.endColumn,B=V.endLineNumber,W=V.startLineNumber;if(B===L.lineNumber||W===L.lineNumber){N=new We(B,M);const q={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:(m=i.trigger.filter)!=null&&m.include?(_=i.trigger.filter)==null?void 0:_.include:oa.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((v=i.trigger.context)==null?void 0:v.notAvailableMessage)||"",position:N}},U=new Yn(N.lineNumber,N.column,N.lineNumber,N.column),G=await zR(this._registry,e,U,q,bb.None,c);if(G.validActions.length!==0){for(const H of G.validActions)(y=(b=H.action.command)==null?void 0:b.arguments)!=null&&y.some(z=>typeof z=="string"&&z.includes(j$e))&&(H.action.diagnostics=[...I.filter(z=>z.relatedInformation)]);C.allActions.length===0&&S.push(...G.allActions),Math.abs(L.column-M)<P?O.unshift(...G.validActions):O.push(...G.validActions)}P=Math.abs(L.column-M)}}const F=O.filter((V,M,B)=>B.findIndex(W=>W.action.title===V.action.title)===M);return F.sort((V,M)=>V.action.isPreferred&&!M.action.isPreferred?-1:!V.action.isPreferred&&M.action.isPreferred||V.action.isAI&&!M.action.isAI?1:!V.action.isAI&&M.action.isAI?-1:0),{validActions:F,allActions:S,documentation:C.documentation,hasAutoFix:C.hasAutoFix,hasAIFix:C.hasAIFix,allAIFixes:C.allAIFixes,dispose:()=>{C.dispose()}}}}if(i.trigger.type===1){const C=new Qc,S=await zR(this._registry,e,i.selection,i.trigger,bb.None,c);return this._telemetryService&&this._telemetryService.publicLog2("codeAction.invokedDurations",{codeActions:S.validActions.length,duration:C.elapsed()}),S}return zR(this._registry,e,i.selection,i.trigger,bb.None,c)});i.trigger.type===1&&((l=this._progressService)==null||l.showWhile(s,250));const o=new L2.Triggered(i.trigger,r,s);let a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&o.type===1&&o.trigger.type===2&&this._state.position!==o.position),a?setTimeout(()=>{this.setState(o)},500):this.setState(o)},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:cp.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)==null||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 J2r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},P0=function(n,e){return function(t,i){e(t,i,n)}},lR;const eIr="quickfix-edit-highlight";var _E;let AM=(_E=class extends Ye{static get(e){return e.getContribution(lR.ID)}constructor(e,t,i,r,s,o,a,l,c,u,d){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._telemetryService=d,this._activeCodeActions=this._register(new Dc),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Z2r(this._editor,s.codeActionProvider,t,i,o,l,this._telemetryService)),this._register(this._model.onDidChangeState(f=>this.update(f))),this._lightBulbWidget=new Bb(()=>{const f=this._editor.getContribution(aB.ID);return f&&this._register(f.onClick(p=>this.showCodeActionsFromLightbulb(p.actions,p))),f}),this._resolver=r.createInstance(h0e),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],r=i.action.command;r&&r.id==="inlineChat.start"&&r.arguments&&r.arguments.length>=1&&(r.arguments[0]={...r.arguments[0],autoSend:!1}),await this._applyCodeAction(i,!1,!1,X2.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}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=ep.get(this._editor))==null||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)}async _applyCodeAction(e,t,i,r){try{await this._instantiationService.invokeFunction(B2r,e,r,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:cp.QuickFix,filter:{}})}}hideLightBulbWidget(){var e,t;(e=this._lightBulbWidget.rawValue)==null||e.hide(),(t=this._lightBulbWidget.rawValue)==null||t.gutterHide()}async update(e){var r,s,o,a,l;if(e.type!==1){this.hideLightBulbWidget();return}let t;try{t=await e.actions}catch(c){tr(c);return}if(this._disposed)return;const i=this._editor.getSelection();if((i==null?void 0:i.startLineNumber)===e.position.lineNumber)if((r=this._lightBulbWidget.value)==null||r.update(t,e.trigger,e.position),e.trigger.type===1){if((s=e.trigger.filter)!=null&&s.include){const u=this.tryGetValidActionToApply(e.trigger,t);if(u){try{this.hideLightBulbWidget(),await this._applyCodeAction(u,!1,!1,X2.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const d=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(d&&d.action.disabled){(o=ep.get(this._editor))==null||o.showMessage(d.action.disabled,e.trigger.context.position),t.dispose();return}}}const c=!!((a=e.trigger.filter)!=null&&a.include);if(e.trigger.context&&(!t.allActions.length||!c&&!t.validActions.length)){(l=ep.get(this._editor))==null||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}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]}async showCodeActionList(e,t,i){const r=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const o=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!o.length)return;const a=We.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,u)=>{this._applyCodeAction(c,!0,!!u,i.fromLightbulb?X2.FromAILightbulb:X2.FromCodeActions),this._actionWidgetService.hide(!1),r.clear()},onHide:c=>{var u;(u=this._editor)==null||u.focus(),r.clear()},onHover:async(c,u)=>{var p;if(u.isCancellationRequested)return;let d=!1;const f=c.action.kind;if(f){const g=new ha(f);d=[oa.RefactorExtract,oa.RefactorInline,oa.RefactorRewrite,oa.RefactorMove,oa.Source].some(_=>_.contains(g))}return{canPreview:d||!!((p=c.action.edit)!=null&&p.edits.length)}},onFocus:c=>{var u,d;if(c&&c.action){const f=c.action.ranges,p=c.action.diagnostics;if(r.clear(),f&&f.length>0){const g=p&&(p==null?void 0:p.length)>1?p.map(m=>({range:m,options:lR.DECORATION})):f.map(m=>({range:m,options:lR.DECORATION}));r.set(g)}else if(p&&p.length>0){const g=p.map(_=>({range:_,options:lR.DECORATION}));r.set(g);const m=p[0];if(m.startLineNumber&&m.startColumn){const _=(d=(u=this._editor.getModel())==null?void 0:u.getWordAtPosition({lineNumber:m.startLineNumber,column:m.startColumn}))==null?void 0:d.word;Xy(A("editingNewSelection","Context: {0} at line {1} and column {2}.",_,m.startLineNumber,m.startColumn))}}}else r.clear()}};this._actionWidgetService.show("codeActionWidget",!0,z2r(o,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,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=al(this._editor.getDomNode()),r=i.left+t.left,s=i.top+t.top+t.height;return{x:r,y:s}}_shouldShowHeaders(){var t;const e=(t=this._editor)==null?void 0:t.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e==null?void 0:e.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const r=e.documentation.map(s=>({id:s.id,label:s.title,tooltip:s.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(s.id,...s.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:A("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:A("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),r}},lR=_E,_E.ID="editor.contrib.codeActionController",_E.DECORATION=ur.register({description:"quickfix-highlight",className:eIr}),_E);AM=lR=J2r([P0(1,w1),P0(2,Oi),P0(3,mi),P0(4,Fn),P0(5,Rk),P0(6,Fo),P0(7,Dr),P0(8,QA),P0(9,mi),P0(10,md)],AM);Gm((n,e)=>{((r,s)=>{s&&e.addRule(`.monaco-editor ${r} { background-color: ${s}; }`)})(".quickfix-edit-highlight",n.getColor(KC));const i=n.getColor(BS);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Ab(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function C$(n){return It.regex(Dht.keys()[0],new RegExp("(\\s|^)"+mg(n.value)+"\\b"))}const J2e={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:A("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:A("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[A("args.schema.apply.first","Always apply the first returned code action."),A("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),A("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:A("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function XA(n,e,t,i,r=cp.Default){if(n.hasModel()){const s=AM.get(n);s==null||s.manualTriggerAtCurrentPosition(e,r,t,i)}}class tIr extends In{constructor(){super({id:Z2e,label:A("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:It.and(me.writable,me.hasCodeActionsProvider),kbOpts:{kbExpr:me.textInputFocus,primary:2137,weight:100}})}run(e,t){return XA(t,A("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,cp.QuickFix)}}class nIr extends pc{constructor(){super({id:xht,precondition:It.and(me.writable,me.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:J2e}]}})}runEditorCommand(e,t,i){const r=vy.fromUser(i,{kind:ha.Empty,apply:"ifSingle"});return XA(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?A("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):A("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):r.preferred?A("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):A("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class iIr extends In{constructor(){super({id:Eht,label:A("refactor.label","Refactor..."),alias:"Refactor...",precondition:It.and(me.writable,me.hasCodeActionsProvider),kbOpts:{kbExpr:me.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:It.and(me.writable,C$(oa.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:J2e}]}})}run(e,t,i){const r=vy.fromUser(i,{kind:oa.Refactor,apply:"never"});return XA(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?A("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):A("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):r.preferred?A("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):A("editor.action.refactor.noneMessage","No refactorings available"),{include:oa.Refactor.contains(r.kind)?r.kind:ha.None,onlyIncludePreferredActions:r.preferred},r.apply,cp.Refactor)}}class rIr extends In{constructor(){super({id:kht,label:A("source.label","Source Action..."),alias:"Source Action...",precondition:It.and(me.writable,me.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:It.and(me.writable,C$(oa.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:J2e}]}})}run(e,t,i){const r=vy.fromUser(i,{kind:oa.Source,apply:"never"});return XA(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?A("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):A("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):r.preferred?A("editor.action.source.noneMessage.preferred","No preferred source actions available"):A("editor.action.source.noneMessage","No source actions available"),{include:oa.Source.contains(r.kind)?r.kind:ha.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,cp.SourceAction)}}class sIr extends In{constructor(){super({id:c0e,label:A("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:It.and(me.writable,C$(oa.SourceOrganizeImports)),kbOpts:{kbExpr:me.textInputFocus,primary:1581,weight:100}})}run(e,t){return XA(t,A("editor.action.organize.noneMessage","No organize imports action available"),{include:oa.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",cp.OrganizeImports)}}class oIr extends In{constructor(){super({id:u0e,label:A("fixAll.label","Fix All"),alias:"Fix All",precondition:It.and(me.writable,C$(oa.SourceFixAll))})}run(e,t){return XA(t,A("fixAll.noneMessage","No fix all action available"),{include:oa.SourceFixAll,includeSourceActions:!0},"ifSingle",cp.FixAll)}}class aIr extends In{constructor(){super({id:Sht,label:A("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:It.and(me.writable,C$(oa.QuickFix)),kbOpts:{kbExpr:me.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return XA(t,A("editor.action.autoFix.noneMessage","No auto fixes available"),{include:oa.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",cp.AutoFix)}}cs(AM.ID,AM,3);cs(aB.ID,aB,4);zt(tIr);zt(iIr);zt(rIr);zt(sIr);zt(aIr);zt(oIr);gn(new nIr);Ca.as(bv.Configuration).registerConfiguration({...n$,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:A("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});Ca.as(bv.Configuration).registerConfiguration({...n$,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:A("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});Ca.as(bv.Configuration).registerConfiguration({...n$,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:5,markdownDescription:A("triggerOnFocusChange","Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});class m0e{constructor(){this.lenses=[],this._disposables=new Et}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})}}async function Pht(n,e,t){const i=n.ordered(e),r=new Map,s=new m0e,o=i.map(async(a,l)=>{r.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&s.add(c,a)}catch(c){ll(c)}});return await Promise.all(o),s.lenses=s.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),s}os.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;ys(vi.isUri(t)),ys(typeof i=="number"||!i);const{codeLensProvider:r}=n.get(Fn),s=n.get(Xo).getModel(t);if(!s)throw Sm();const o=[],a=new Et;return Pht(r,s,xr.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)i==null||u.symbol.command?o.push(u.symbol):i-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(s,u.symbol,xr.None)).then(d=>o.push(d||u.symbol)));return Promise.all(c)}).then(()=>o).finally(()=>{setTimeout(()=>a.dispose(),100)})});var lIr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},cIr=function(n,e){return function(t,i){e(t,i,n)}};const Oht=Ur("ICodeLensCache");class F$e{constructor(e,t){this.lineCount=e,this.data=t}}let _0e=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new b1(20,.75);const t="codelens/cache";Kj(bo,()=>e.remove(t,1));const i="codelens/cache2",r=e.get(i,1,"{}");this._deserialize(r);const s=rn.filter(e.onWillSaveState,o=>o.reason===D7.SHUTDOWN);rn.once(s)(o=>{e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(o=>{var a;return{range:o.symbol.range,command:o.symbol.command&&{id:"",title:(a=o.symbol.command)==null?void 0:a.title}}}),r=new m0e;r.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new F$e(e.getLineCount(),r);this._cache.set(e.uri.toString(),s)}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 s of i.data.lenses)r.add(s.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],s=[];for(const a of r.lines)s.push({range:new ie(a,1,a,11)});const o=new m0e;o.add({lenses:s,dispose(){}},this._fakeProvider),this._cache.set(i,new F$e(r.lineCount,o))}}catch{}}};_0e=lIr([cIr(0,yv)],_0e);ns(Oht,_0e,1);class uIr{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")}}const X6=class X6{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${X6._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 s=0;s<e.length;s++){const o=e[s];if(o&&(r=!0,o.command)){const a=uE(o.command.title.trim());if(o.command.id){const l=`c${X6._idPool++}`;i.push(Jt("a",{id:l,title:o.command.tooltip,role:"button"},...a)),this._commands.set(l,o.command)}else i.push(Jt("span",{title:o.command.tooltip},...a));s+1<e.length&&i.push(Jt("span",void 0," | "))}}r?(_u(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):_u(this._domNode,Jt("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}};X6._idPool=0;let v0e=X6;class Bue{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 B$e=ur.register({collapseOnReplaceEdit:!0,description:"codelens"});class $$e{constructor(e,t,i,r,s,o){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:B$e},d=>this._decorationIds[u]=d),a?a=ie.plusRange(a,c.symbol.range):a=ie.lift(c.symbol.range)}),this._viewZone=new uIr(a.startLineNumber-1,s,o),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 v0e(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&&ie.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:B$e},s=>this._decorationIds[r]=s)})}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?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 dIr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Tj=function(n,e){return function(t,i){e(t,i,n)}},iO;let lB=(iO=class{constructor(e,t,i,r,s,o){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=s,this._codeLensCache=o,this._disposables=new Et,this._localToDispose=new Et,this._lenses=[],this._oldCodeLensModels=new Et,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new ao(()=>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.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(67)/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:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Th.fontFamily)),this._editor.changeViewZones(o=>{for(const a of this._lenses)a.updateHeight(e,o)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)==null||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)==null||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)==null||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&&XE(()=>{const r=this._codeLensCache.get(e);t===r&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const r of this._languageFeaturesService.codeLensProvider.all(e))if(typeof r.onDidChange=="function"){const s=r.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new ao(()=>{var s;const r=Date.now();(s=this._getCodeLensModelPromise)==null||s.cancel(),this._getCodeLensModelPromise=Ic(o=>Pht(this._languageFeaturesService.codeLensProvider,e,o)),this._getCodeLensModelPromise.then(o=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=o,this._codeLensCache.put(e,o);const a=this._provideCodeLensDebounce.update(e,Date.now()-r);i.delay=a,this._renderCodeLensSymbols(o),this._resolveCodeLensesInViewportSoon()},tr)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(gi(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(s=>{this._editor.changeViewZones(o=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(o),l=u.getLineNumber())});const c=new Bue;a.forEach(u=>{u.dispose(c,o),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)==null||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{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(gi(()=>{if(this._editor.getModel()){const r=Ub.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(o=>{this._disposeAllLenses(s,o)})}),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 s=r.target.element;if((s==null?void 0:s.tagName)==="SPAN"&&(s=s.parentElement),(s==null?void 0:s.tagName)==="A")for(const o of this._lenses){const a=o.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new Bue;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 s=Ub.capture(this._editor),o=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new Bue;let u=0,d=0;for(;d<i.length&&u<this._lenses.length;){const f=i[d][0].symbol.range.startLineNumber,p=this._lenses[u].getLineNumber();p<f?(this._lenses[u].dispose(c,l),this._lenses.splice(u,1)):p===f?(this._lenses[u].updateCodeLensSymbols(i[d],c),d++,u++):(this._lenses.splice(u,0,new $$e(i[d],this._editor,c,l,o.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 $$e(i[d],this._editor,c,l,o.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var o;(o=this._resolveCodeLensesPromise)==null||o.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(e);l&&(t.push(l),i.push(a))}),t.length===0)return;const r=Date.now(),s=Ic(a=>{const l=t.map((c,u)=>{const d=new Array(c.length),f=c.map((p,g)=>!p.symbol.command&&typeof p.provider.resolveCodeLens=="function"?Promise.resolve(p.provider.resolveCodeLens(e,p.symbol,a)).then(m=>{d[g]=m},ll):(d[g]=p.symbol,Promise.resolve(void 0)));return Promise.all(f).then(()=>{!a.isCancellationRequested&&!i[u].isDisposed()&&i[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(e,Date.now()-r);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{tr(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,(e=this._currentCodeLensModel)!=null&&e.isDisposed?void 0:this._currentCodeLensModel}},iO.ID="css.editor.codeLens",iO);lB=dIr([Tj(1,Fn),Tj(2,kg),Tj(3,Fo),Tj(4,wl),Tj(5,Oht)],lB);cs(lB.ID,lB,1);zt(class extends In{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:me.hasCodeLensProvider,label:A("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(Ym),r=e.get(Fo),s=e.get(wl),o=t.getSelection().positionLineNumber,a=t.getContribution(lB.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const f of l.lenses)f.symbol.command&&f.symbol.range.startLineNumber===o&&c.push({label:f.symbol.command.title,command:f.symbol.command});if(c.length===0)return;const u=await i.pick(c,{canPickMany:!1,placeHolder:A("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const f=await a.getModel(),p=f==null?void 0:f.lenses.find(g=>{var m;return g.symbol.range.startLineNumber===o&&((m=g.symbol.command)==null?void 0:m.title)===d.title});if(!p||!p.symbol.command)return;d=p.symbol.command}try{await r.executeCommand(d.id,...d.arguments||[])}catch(f){s.error(f)}}});var Mht=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},b0e=function(n,e){return function(t,i){e(t,i,n)}};let cB=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const r=t.range,s=t.color,o=s.alpha,a=new At(new ds(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),o)),l=o?At.Format.CSS.formatRGB(a):At.Format.CSS.formatRGBA(a),c=o?At.Format.CSS.formatHSL(a):At.Format.CSS.formatHSLA(a),u=o?At.Format.CSS.formatHex(a):At.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}};cB=Mht([b0e(0,Sf)],cB);let y0e=class extends Ye{constructor(e,t){super(),this._register(e.colorProvider.register("*",new cB(t)))}};y0e=Mht([b0e(0,Fn),b0e(1,Sf)],y0e);i3(y0e);async function jht(n,e,t,i=!0){return eIe(new hIr,n,e,t,i)}function Fht(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class hIr{constructor(){}async compute(e,t,i,r){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const o of s)r.push({colorInfo:o,provider:e});return Array.isArray(s)}}class fIr{constructor(){}async compute(e,t,i,r){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const o of s)r.push({range:o.range,color:[o.color.red,o.color.green,o.color.blue,o.color.alpha]});return Array.isArray(s)}}class pIr{constructor(e){this.colorInfo=e}async compute(e,t,i,r){const s=await e.provideColorPresentations(t,this.colorInfo,xr.None);return Array.isArray(s)&&r.push(...s),Array.isArray(s)}}async function eIe(n,e,t,i,r){let s=!1,o;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof cB)o=u;else try{await n.compute(u,t,i,a)&&(s=!0)}catch(d){ll(d)}}return s?a:o&&r?(await n.compute(o,t,i,a),a):[]}function Bht(n,e){const{colorProvider:t}=n.get(Fn),i=n.get(Xo).getModel(e);if(!i)throw Sm();const r=n.get(Dr).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}os.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof vi))throw Sm();const{model:i,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:s}=Bht(n,t);return eIe(new fIr,r,i,xr.None,s)});os.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:r,range:s}=i;if(!(r instanceof vi)||!Array.isArray(t)||t.length!==4||!ie.isIRange(s))throw Sm();const{model:o,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=Bht(n,r),[c,u,d,f]=t;return eIe(new pIr({range:s,color:{red:c,green:u,blue:d,alpha:f}}),a,o,xr.None,l)});var gIr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},$ue=function(n,e){return function(t,i){e(t,i,n)}},C0e;const $ht=Object.create({});var vE;let NM=(vE=class extends Ye{constructor(e,t,i,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new Et),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new iY(this._editor),this._decoratorLimitReporter=new mIr,this._colorDecorationClassRefs=this._register(new Et),this._debounceInformation=r.for(i.colorProvider,"Document Colors",{min:C0e.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(s=>{const o=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(148);const a=o!==this._isColorDecoratorsEnabled||s.hasChanged(21),l=s.hasChanged(148);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(148),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 vv,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Ic(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new Qc(!1),r=await jht(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),r});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){tr(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:ur.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,s)=>this._colorDatas.set(r,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let s=0;s<e.length&&t.length<i;s++){const{red:o,green:a,blue:l,alpha:c}=e[s].colorInfo.color,u=new ds(Math.round(o*255),Math.round(a*255),Math.round(l*255),c),d=`rgba(${u.r}, ${u.g}, ${u.b}, ${u.a})`,f=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:d}));t.push({range:{startLineNumber:e[s].colorInfo.range.startLineNumber,startColumn:e[s].colorInfo.range.startColumn,endLineNumber:e[s].colorInfo.range.endLineNumber,endColumn:e[s].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:Aot,inlineClassName:`${f.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:$ht}}})}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(ie.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)}},C0e=vE,vE.ID="editor.contrib.colorDetector",vE.RECOMPUTE_TIME=1e3,vE);NM=C0e=gIr([$ue(1,Dr),$ue(2,Fn),$ue(3,kg)],NM);class mIr{constructor(){this._onDidChange=new Ue,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}cs(NM.ID,NM,1);class _Ir{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 Ue,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new Ue,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new Ue,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 s=0;s<this.colorPresentations.length;s++)if(this.colorPresentations[s].label.toLowerCase().startsWith(r)){i=s;break}}i!==-1&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const Xp=Jt;class vIr extends Ye{constructor(e,t,i,r=!1){super(),this.model=t,this.showingStandaloneColorPicker=r,this._closeButton=null,this._domNode=Xp(".colorpicker-header"),Ot(e,this._domNode),this._pickedColorNode=Ot(this._domNode,Xp(".picked-color")),Ot(this._pickedColorNode,Xp("span.codicon.codicon-color-mode")),this._pickedColorPresentation=Ot(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=A("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=Ot(this._domNode,Xp(".original-color")),this._originalColorNode.style.backgroundColor=At.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(lG)||At.white,this._register(i.onDidColorThemeChange(o=>{this.backgroundColor=o.getColor(lG)||At.white})),this._register(_t(this._pickedColorNode,Xt.CLICK,()=>this.model.selectNextColorPresentation())),this._register(_t(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=At.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 bIr(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=At.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 bIr extends Ye{constructor(e){super(),this._onClicked=this._register(new Ue),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Ot(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Ot(this._button,t),Ot(t,Xp(".button"+Ni.asCSSSelector(Zo("color-picker-close",Yt.close,A("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._register(_t(this._button,Xt.CLICK,()=>{this._onClicked.fire()}))}}class yIr extends Ye{constructor(e,t,i,r=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Xp(".colorpicker-body"),Ot(e,this._domNode),this._saturationBox=new CIr(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 wIr(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 xIr(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 SIr(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 At(new ky(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new At(new ky(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new At(new ky(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 CIr extends Ye{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new Ue,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Ue,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Xp(".saturation-wrap"),Ot(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Ot(this._domNode,this._canvas),this.selection=Xp(".saturation-selection"),Ot(this._domNode,this.selection),this.layout(),this._register(_t(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 K4);const t=al(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=_t(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 At(new ky(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 s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=At.Format.CSS.format(t),i.fill(),i.fillStyle=r,i.fill(),i.fillStyle=s,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 Hht extends Ye{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new Ue,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Ue,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=Ot(e,Xp(".standalone-strip")),this.overlay=Ot(this.domNode,Xp(".standalone-overlay"))):(this.domNode=Ot(e,Xp(".strip")),this.overlay=Ot(this.domNode,Xp(".overlay"))),this.slider=Ot(this.domNode,Xp(".slider")),this.slider.style.top="0px",this._register(_t(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 K4),i=al(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangeTop(s.pageY-i.top),()=>null);const r=_t(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 wIr extends Hht{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,s=new At(new ds(t,i,r,1)),o=new At(new ds(t,i,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${o} 100%)`}getValue(e){return e.hsva.a}}class xIr extends Hht{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class SIr extends Ye{constructor(e){super(),this._onClicked=this._register(new Ue),this.onClicked=this._onClicked.event,this._button=Ot(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(_t(this._button,Xt.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}class EIr extends Tg{constructor(e,t,i,r,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(c7.getInstance(Ti(e)).onDidChange(()=>this.layout())),this._domNode=Xp(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new vIr(this._domNode,this.model,r,s)),this.body=this._register(new yIr(this._domNode,this.model,this.pixelRatio,s))}layout(){this.body.layout()}get domNode(){return this._domNode}}class Hue{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 kU{constructor(e,t,i,r,s,o){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=r,this.initialMousePosY=s,this.supportsMarkerHover=o,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}class rA{constructor(e){this.renderedHoverParts=e}dispose(){for(const e of this.renderedHoverParts)e.dispose()}}const ZA=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};var Vht=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Wht=function(n,e){return function(t,i){e(t,i,n)}};class kIr{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 uB=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return ng.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const r=NM.get(this._editor);if(!r)return[];for(const s of t){if(!r.isColorDecoration(s))continue;const o=r.getColorData(s.range.getStartPosition());if(o)return[await zht(this,this._editor.getModel(),o.colorInfo,o.provider)]}return[]}renderHoverParts(e,t){const i=Uht(this,this._editor,this._themeService,t,e);if(!i)return new rA([]);this._colorPicker=i.colorPicker;const r={hoverPart:i.hoverPart,hoverElement:this._colorPicker.domNode,dispose(){i.disposables.dispose()}};return new rA([r])}handleResize(){var e;(e=this._colorPicker)==null||e.layout()}isColorPickerVisible(){return!!this._colorPicker}};uB=Vht([Wht(1,mc)],uB);class TIr{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r}}let dB=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!NM.get(this._editor))return null;const s=await jht(i,this._editor.getModel(),xr.None);let o=null,a=null;for(const d of s){const f=d.colorInfo;ie.containsRange(f.range,e.range)&&(o=f,a=d.provider)}const l=o??e,c=a??t,u=!!o;return{colorHover:await zht(this,this._editor.getModel(),l,c),foundInEditor:u}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new ie(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await TU(this._editor.getModel(),t,this._color,i,e),i=qht(this._editor,i,t))}renderHoverParts(e,t){return Uht(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};dB=Vht([Wht(1,mc)],dB);async function zht(n,e,t,i){const r=e.getValueInRange(t.range),{red:s,green:o,blue:a,alpha:l}=t.color,c=new ds(Math.round(s*255),Math.round(o*255),Math.round(a*255),l),u=new At(c),d=await Fht(e,t,i,xr.None),f=new _Ir(u,[],0);return f.colorPresentations=d||[],f.guessColorPresentation(u,r),n instanceof uB?new kIr(n,ie.lift(t.range),f,i):new TIr(n,ie.lift(t.range),f,i)}function Uht(n,e,t,i,r){if(i.length===0||!e.hasModel())return;if(r.setMinimumDimensions){const f=e.getOption(67)+8;r.setMinimumDimensions(new Ys(302,f))}const s=new Et,o=i[0],a=e.getModel(),l=o.model,c=s.add(new EIr(r.fragment,l,e.getOption(144),t,n instanceof dB));let u=!1,d=new ie(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn);if(n instanceof dB){const f=o.model.color;n.color=f,TU(a,l,f,d,o),s.add(l.onColorFlushed(p=>{n.color=p}))}else s.add(l.onColorFlushed(async f=>{await TU(a,l,f,d,o),u=!0,d=qht(e,d,l)}));return s.add(l.onDidChangeColor(f=>{TU(a,l,f,d,o)})),s.add(e.onDidChangeModelContent(f=>{u?u=!1:(r.hide(),e.focus())})),{hoverPart:o,colorPicker:c,disposables:s}}function qht(n,e,t){const i=[],r=t.presentation.textEdit??{range:e,text:t.presentation.label,forceMoveMarkers:!1};i.push(r),t.presentation.additionalTextEdits&&i.push(...t.presentation.additionalTextEdits);const s=ie.lift(r.range),o=n.getModel()._setTrackedRange(null,s,3);return n.executeEdits("colorpicker",i),n.pushUndoStop(),n.getModel()._getTrackedRange(o)??s}async function TU(n,e,t,i,r){const s=await Fht(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,xr.None);e.colorPresentations=s||[]}const Kht="editor.action.showHover",IIr="editor.action.showDefinitionPreviewHover",LIr="editor.action.scrollUpHover",AIr="editor.action.scrollDownHover",NIr="editor.action.scrollLeftHover",DIr="editor.action.scrollRightHover",RIr="editor.action.pageUpHover",PIr="editor.action.pageDownHover",OIr="editor.action.goToTopHover",MIr="editor.action.goToBottomHover",une="editor.action.increaseHoverVerbosityLevel",jIr=A({key:"increaseHoverVerbosityLevel",comment:["Label for action that will increase the hover verbosity level."]},"Increase Hover Verbosity Level"),dne="editor.action.decreaseHoverVerbosityLevel",FIr=A({key:"decreaseHoverVerbosityLevel",comment:["Label for action that will decrease the hover verbosity level."]},"Decrease Hover Verbosity Level"),Ght="editor.action.inlineSuggest.commit",Yht="editor.action.inlineSuggest.showPrevious",Qht="editor.action.inlineSuggest.showNext";var tIe=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},R_=function(n,e){return function(t,i){e(t,i,n)}},IU;let w0e=class extends Ye{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Gs(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=ai(this,r=>{var l,c;const s=(l=this.model.read(r))==null?void 0:l.primaryGhostText.read(r);if(!this.alwaysShowToolbar.read(r)||!s||s.parts.length===0)return this.sessionPosition=void 0,null;const o=s.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==s.lineNumber&&(this.sessionPosition=void 0);const a=new We(s.lineNumber,Math.min(o,((c=this.sessionPosition)==null?void 0:c.column)??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(uf((r,s)=>{const o=this.model.read(r);if(!o||!this.alwaysShowToolbar.read(r))return;const a=Pk((c,u)=>{const d=u.add(this.instantiationService.createInstance(DM,this.editor,!0,this.position,o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands));return e.addContentWidget(d),u.add(gi(()=>e.removeContentWidget(d))),u.add(Gi(f=>{this.position.read(f)&&o.lastTriggerKind.read(f)!==Ib.Explicit&&o.triggerExplicitly()})),d}),l=o$(this,(c,u)=>!!this.position.read(c)||!!u);s.add(Gi(c=>{l.read(c)&&a.read(c)}))}))}};w0e=tIe([R_(2,mi)],w0e);const BIr=Zo("inline-suggestion-hints-next",Yt.chevronRight,A("parameterHintsNextIcon","Icon for show next parameter hint.")),$Ir=Zo("inline-suggestion-hints-previous",Yt.chevronLeft,A("parameterHintsPreviousIcon","Icon for show previous parameter hint."));var bE;let DM=(bE=class extends Ye{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const r=new Zf(e,t,i,!0,()=>this._commandService.executeCommand(e)),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let o=t;return s&&(o=A({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,s.getLabel())),r.tooltip=o,r}constructor(e,t,i,r,s,o,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=r,this._suggestionCount=s,this._extraCommands=o,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${IU.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=jr("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[jr("div@toolBar")]),this.previousAction=this.createCommandAction(Yht,A("previous","Previous"),Ni.asClassName($Ir)),this.availableSuggestionCountAction=new Zf("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Qht,A("next","Next"),Ni.asClassName(BIr)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(zn.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new ao(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new ao(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(l.createInstance(x0e,this.nodes.toolBar,zn.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:f=>f.startsWith("primary")},actionViewItemProvider:(f,p)=>{if(f instanceof Jf)return l.createInstance(VIr,f,void 0);if(f===this.availableSuggestionCountAction){const g=new HIr(void 0,f,{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(f=>{IU._dropDownVisible=f})),this._register(Gi(f=>{this._position.read(f),this.editor.layoutContentWidget(this)})),this._register(Gi(f=>{const p=this._suggestionCount.read(f),g=this._currentSuggestionIdx.read(f);p!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${p}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),p!==void 0&&p>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Gi(f=>{const g=this._extraCommands.read(f).map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:_=>this._commandService.executeCommand(m.id)}));for(const[m,_]of this.inlineCompletionsActionsMenus.getActions())for(const v of _)v instanceof Jf&&g.push(v);g.length>0&&g.unshift(new Ac),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},IU=bE,bE._dropDownVisible=!1,bE.id=0,bE);DM=IU=tIe([R_(6,Fo),R_(7,mi),R_(8,Ws),R_(9,Oi),R_(10,Eg)],DM);class HIr extends yM{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}let VIr=class extends nk{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=jr("div.keybinding").root;this._register(new t3(t,Yf,{disableTitle:!0,...mut})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},x0e=class extends eB{constructor(e,t,i,r,s,o,a,l,c){super(e,{resetMenu:t,...i},r,s,o,a,l,c),this.menuId=t,this.options2=i,this.menuService=r,this.contextKeyService=s,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 i,r,s,o,a,l,c;const e=[],t=[];jte(this.menu,(i=this.options2)==null?void 0:i.menuOptions,{primary:e,secondary:t},(s=(r=this.options2)==null?void 0:r.toolbarOptions)==null?void 0:s.primaryGroup,(a=(o=this.options2)==null?void 0:o.toolbarOptions)==null?void 0:a.shouldInlineSubmenu,(c=(l=this.options2)==null?void 0:l.toolbarOptions)==null?void 0:c.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){fa(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){fa(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};x0e=tIe([R_(3,Eg),R_(4,Oi),R_(5,up),R_(6,Ws),R_(7,Fo),R_(8,md)],x0e);function hne(n,e,t){const i=al(n);return!(e<i.left||e>i.left+i.width||t<i.top||t>i.top+i.height)}let WIr=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class Xht extends Ye{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new Ue),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new ao(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new ao(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new ao(()=>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=Rar(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){tr(e)}})()):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 WIr(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 nIe{constructor(){this._onDidWillResize=new Ue,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new Ue,this.onDidResize=this._onDidResize.event,this._sashListener=new Et,this._size=new Ys(0,0),this._minSize=new Ys(0,0),this._maxSize=new Ys(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new td(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new td(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new td(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:jG.North}),this._southSash=new td(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:jG.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(rn.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(rn.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(rn.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(rn.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:s,width:o}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(r,Math.min(o,t));const a=new Ys(t,e);Ys.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 zIr=30,UIr=24;class qIr extends Ye{constructor(e,t=new Ys(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new nIe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Ys.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 Ys(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.position?We.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:al(t).top+i.top-zIr}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const r=al(t),s=ZE(t.ownerDocument.body),o=r.top+i.top+i.height;return s.height-o-UIr}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),r=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),s=Math.min(Math.max(r,i),e),o=Math.min(e,s);let a;return this._editor.getOption(60).above?a=o<=r?1:2:a=o<=i?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}var KIr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},OW=function(n,e){return function(t,i){e(t,i,n)}},$0;const H$e=30,GIr=6;var yE;let S0e=(yE=class extends qIr{get isVisibleFromKeyboard(){var e;return((e=this._renderedHover)==null?void 0:e.source)===1}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,r,s){const o=e.getOption(67)+8,a=150,l=new Ys(a,o);super(e,l),this._configurationService=i,this._accessibilityService=r,this._keybindingService=s,this._hover=this._register(new nTe),this._onDidResize=this._register(new Ue),this.onDidResize=this._onDidResize.event,this._minimumSize=l,this._hoverVisibleKey=me.hoverVisible.bindTo(t),this._hoverFocusedKey=me.hoverFocused.bindTo(t),Ot(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(u=>{u.hasChanged(50)&&this._updateFont()}));const c=this._register($b(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._renderedHover)==null||e.dispose(),this._editor.removeContentWidget(this)}getId(){return $0.ID}static _applyDimensions(e,t,i){const r=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=r,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return $0._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return $0._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,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=r,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){$0._applyMaxDimensions(this._hover.contentsDomNode,e,t),$0._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Ys(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){$0._lastDimensions=new Ys(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){var t;const e=(t=this._renderedHover)==null?void 0:t.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=GIr;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),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?ZE(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._renderedHover)return!1;if(this._renderedHover.initialMousePosX===void 0||this._renderedHover.initialMousePosY===void 0)return this._renderedHover.initialMousePosX=e,this._renderedHover.initialMousePosY=t,!1;const i=al(this.getDomNode());this._renderedHover.closestMouseDistance===void 0&&(this._renderedHover.closestMouseDistance=V$e(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,i.left,i.top,i.width,i.height));const r=V$e(e,t,i.left,i.top,i.width,i.height);return r>this._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,r),!0)}_setRenderedHover(e){var t;(t=this._renderedHover)==null||t.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(s=>this._editor.applyFontInfo(s))}_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,$0._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,$0._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){var o;if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=zC(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??1,this.onContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const s=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&ylt(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),((o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:o.getAriaLabel())??"");s&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+s)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new Ys(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")}setMinimumDimensions(e){this._minimumSize=new Ys(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 Ys(e,this._minimumSize.height)}onContentsChanged(){var r;this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=zC(e),i=Vf(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=zC(e),i=Vf(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),(r=this._renderedHover)!=null&&r.showAtPosition){const s=zC(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._renderedHover.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-H$e})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+H$e})}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})}},$0=yE,yE.ID="editor.contrib.resizableContentHoverWidget",yE._lastDimensions=new Ys(0,0),yE);S0e=$0=KIr([OW(1,Oi),OW(2,Dr),OW(3,dp),OW(4,Ws)],S0e);function V$e(n,e,t,i,r,s){const o=t+r/2,a=i+s/2,l=Math.max(Math.abs(n-o)-r/2,0),c=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+c*c)}class DY{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 s=i.getLineMaxColumn(r);return e.getLineDecorations(r).filter(o=>{if(o.options.isWholeLine)return!0;const a=o.range.startLineNumber===r?o.range.startColumn:1,l=o.range.endLineNumber===r?o.range.endColumn:s;if(o.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 ng.EMPTY;const i=DY._getLineDecorations(this._editor,t);return ng.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,i,e):ng.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=DY._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return iv(t)}}class Zht{constructor(e,t,i){this.anchor=e,this.hoverParts=t,this.isComplete=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new YIr(this,this.anchor,t,this.isComplete)}}class YIr extends Zht{constructor(e,t,i,r){super(t,i,r),this.original=e}filter(e){return this.original.filter(e)}}var QIr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},XIr=function(n,e){return function(t,i){e(t,i,n)}};const W$e=Jt;let RY=class extends Ye{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this.actions=[],this._hasContent=!1,this.hoverElement=W$e("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=Ot(this.hoverElement,W$e("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const r=this._register(Ete.render(this.actionsElement,e,i));return this.actions.push(r),r}append(e){const t=Ot(this.actionsElement,e);return this._hasContent=!0,t}};RY=QIr([XIr(0,Ws)],RY);class ZIr{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function JIr(n,e,t,i,r){const s=await Promise.resolve(n.provideHover(t,i,r)).catch(ll);if(!(!s||!eLr(s)))return new ZIr(n,s,e)}function iIe(n,e,t,i,r=!1){const o=n.ordered(e,r).map((a,l)=>JIr(a,l,e,t,i));return ng.fromPromises(o).coalesce()}function Jht(n,e,t,i,r=!1){return iIe(n,e,t,i,r).map(s=>s.hover).toPromise()}wf("_executeHoverProvider",(n,e,t)=>{const i=n.get(Fn);return Jht(i.hoverProvider,e,t,xr.None)});wf("_executeHoverProvider_recursive",(n,e,t)=>{const i=n.get(Fn);return Jht(i.hoverProvider,e,t,xr.None,!0)});function eLr(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var tLr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},UT=function(n,e){return function(t,i){e(t,i,n)}};const UR=Jt,nLr=Zo("hover-increase-verbosity",Yt.add,A("increaseHoverVerbosity","Icon for increaseing hover verbosity.")),iLr=Zo("hover-decrease-verbosity",Yt.remove,A("decreaseHoverVerbosity","Icon for decreasing hover verbosity."));class O_{constructor(e,t,i,r,s,o=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=r,this.ordinal=s,this.source=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class eft{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case Uf.Increase:return this.hover.canIncreaseVerbosity??!1;case Uf.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let hB=class{constructor(e,t,i,r,s,o,a,l){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=r,this._languageFeaturesService=s,this._keybindingService=o,this._hoverService=a,this._commandService=l,this.hoverOrdinal=3}createLoadingMessage(e){return new O_(this,e.range,[new rd().appendText(A("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,s=i.getLineMaxColumn(r),o=[];let a=1e3;const l=i.getLineLength(r),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(118),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let f=!1;u>=0&&l>u&&e.range.startColumn>=u&&(f=!0,o.push(new O_(this,e.range,[{value:A("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!f&&typeof d=="number"&&l>=d&&o.push(new O_(this,e.range,[{value:A("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let p=!1;for(const g of t){const m=g.range.startLineNumber===r?g.range.startColumn:1,_=g.range.endLineNumber===r?g.range.endColumn:s,v=g.options.hoverMessage;if(!v||gM(v))continue;g.options.beforeContentClassName&&(p=!0);const b=new ie(e.range.startLineNumber,m,e.range.startLineNumber,_);o.push(new O_(this,b,tke(v),p,a++))}return o}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return ng.EMPTY;const r=this._editor.getModel(),s=this._languageFeaturesService.hoverProvider;return s.has(r)?this._getMarkdownHovers(s,r,e,i):ng.EMPTY}_getMarkdownHovers(e,t,i,r){const s=i.range.getStartPosition();return iIe(e,t,s,r).filter(l=>!gM(l.hover.contents)).map(l=>{const c=l.hover.range?ie.lift(l.hover.range):i.range,u=new eft(l.hover,l.provider,s);return new O_(this,c,l.hover.contents,!1,l.ordinal,u)})}renderHoverParts(e,t){return this._renderedHoverParts=new rLr(t,e.fragment,this,this._editor,this._languageService,this._openerService,this._commandService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}updateMarkdownHoverVerbosityLevel(e,t,i){var r;return Promise.resolve((r=this._renderedHoverParts)==null?void 0:r.updateMarkdownHoverPartVerbosityLevel(e,t,i))}};hB=tLr([UT(1,pa),UT(2,xf),UT(3,Dr),UT(4,Fn),UT(5,Ws),UT(6,C1),UT(7,Fo)],hB);class MW{constructor(e,t,i){this.hoverPart=e,this.hoverElement=t,this.disposables=i}dispose(){this.disposables.dispose()}}class rLr{constructor(e,t,i,r,s,o,a,l,c,u,d){this._hoverParticipant=i,this._editor=r,this._languageService=s,this._openerService=o,this._commandService=a,this._keybindingService=l,this._hoverService=c,this._configurationService=u,this._onFinishedRendering=d,this._ongoingHoverOperations=new Map,this._disposables=new Et,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(gi(()=>{this.renderedHoverParts.forEach(f=>{f.dispose()}),this._ongoingHoverOperations.forEach(f=>{f.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(kh(r=>r.ordinal,z_)),e.map(r=>{const s=this._renderHoverPart(r,i);return t.appendChild(s.hoverElement),s})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),r=i.hoverElement,s=e.source,o=new Et;if(o.add(i),!s)return new MW(e,r,o);const a=s.supportsVerbosityAction(Uf.Increase),l=s.supportsVerbosityAction(Uf.Decrease);if(!a&&!l)return new MW(e,r,o);const c=UR("div.verbosity-actions");return r.prepend(c),o.add(this._renderHoverExpansionAction(c,Uf.Increase,a)),o.add(this._renderHoverExpansionAction(c,Uf.Decrease,l)),new MW(e,r,o)}_renderMarkdownHover(e,t){return tft(this._editor,e,this._languageService,this._openerService,t)}_renderHoverExpansionAction(e,t,i){const r=new Et,s=t===Uf.Increase,o=Ot(e,UR(Ni.asCSSSelector(s?nLr:iLr)));o.tabIndex=0;const a=new hM("mouse",!1,{target:e,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(r.add(this._hoverService.setupManagedHover(a,o,oLr(this._keybindingService,t))),!i)return o.classList.add("disabled"),r;o.classList.add("enabled");const l=()=>this._commandService.executeCommand(t===Uf.Increase?une:dne);return r.add(new Clt(o,l)),r.add(new wlt(o,l,[3,10])),r}async updateMarkdownHoverPartVerbosityLevel(e,t,i=!0){const r=this._editor.getModel();if(!r)return;const s=this._getRenderedHoverPartAtIndex(t),o=s==null?void 0:s.hoverPart.source;if(!s||!(o!=null&&o.supportsVerbosityAction(e)))return;const a=await this._fetchHover(o,r,e);if(!a)return;const l=new eft(a,o.hoverProvider,o.hoverPosition),c=s.hoverPart,u=new O_(this._hoverParticipant,c.range,a.contents,c.isBeforeContent,c.ordinal,l),d=this._renderHoverPart(u,this._onFinishedRendering);return this._replaceRenderedHoverPartAtIndex(t,d,u),i&&this._focusOnHoverPartWithIndex(t),{hoverPart:u,hoverElement:d.hoverElement}}async _fetchHover(e,t,i){let r=i===Uf.Increase?1:-1;const s=e.hoverProvider,o=this._ongoingHoverOperations.get(s);o&&(o.tokenSource.cancel(),r+=o.verbosityDelta);const a=new ba;this._ongoingHoverOperations.set(s,{verbosityDelta:r,tokenSource:a});const l={verbosityRequest:{verbosityDelta:r,previousHover:e.hover}};let c;try{c=await Promise.resolve(s.provideHover(t,e.hoverPosition,a.token,l))}catch(u){ll(u)}return a.dispose(),this._ongoingHoverOperations.delete(s),c}_replaceRenderedHoverPartAtIndex(e,t,i){if(e>=this.renderedHoverParts.length||e<0)return;const r=this.renderedHoverParts[e],s=r.hoverElement,o=t.hoverElement,a=Array.from(o.children);s.replaceChildren(...a);const l=new MW(i,s,t.disposables);s.focus(),r.dispose(),this.renderedHoverParts[e]=l}_focusOnHoverPartWithIndex(e){this.renderedHoverParts[e].hoverElement.focus()}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function sLr(n,e,t,i,r){e.sort(kh(o=>o.ordinal,z_));const s=[];for(const o of e)s.push(tft(t,o,i,r,n.onContentsChanged));return new rA(s)}function tft(n,e,t,i,r){const s=new Et,o=UR("div.hover-row"),a=UR("div.hover-row-contents");o.appendChild(a);const l=e.contents;for(const u of l){if(gM(u))continue;const d=UR("div.markdown-hover"),f=Ot(d,UR("div.hover-contents")),p=s.add(new Pw({editor:n},t,i));s.add(p.onDidRenderAsync(()=>{f.className="hover-contents code-hover-contents",r()}));const g=s.add(p.render(u));f.appendChild(g.element),a.appendChild(d)}return{hoverPart:e,hoverElement:o,dispose(){s.dispose()}}}function oLr(n,e){switch(e){case Uf.Increase:{const t=n.lookupKeybinding(une);return t?A("increaseVerbosityWithKb","Increase Hover Verbosity ({0})",t.getLabel()):A("increaseVerbosity","Increase Hover Verbosity")}case Uf.Decrease:{const t=n.lookupKeybinding(dne);return t?A("decreaseVerbosityWithKb","Decrease Hover Verbosity ({0})",t.getLabel()):A("decreaseVerbosity","Decrease Hover Verbosity")}}}function E0e(n,e){return!!n[e]}class Vue{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=E0e(e.event,t.triggerModifier),this.hasSideBySideModifier=E0e(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class z$e{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=E0e(e,t.triggerModifier)}}class jW{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 U$e(n){return n==="altKey"?zr?new jW(57,"metaKey",6,"altKey"):new jW(5,"ctrlKey",6,"altKey"):zr?new jW(6,"altKey",57,"metaKey"):new jW(6,"altKey",5,"ctrlKey")}class fne extends Ye{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new Ue),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new Ue),this.onExecute=this._onExecute.event,this._onCancel=this._register(new Ue),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(t==null?void 0:t.extractLineNumberFromMouseEvent)??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=U$e(this._editor.getOption(78)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(78)){const r=U$e(this._editor.getOption(78));if(this._opts.equals(r))return;this._opts=r,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new Vue(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new Vue(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new Vue(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new z$e(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new z$e(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.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()}}class nft{constructor(e,t){this.range=e,this.direction=t}}class rIe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new rIe(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t==null?void 0:t.tooltip)??this.hint.tooltip,this.hint.label=(t==null?void 0:t.label)??this.hint.label,this.hint.textEdits=(t==null?void 0:t.textEdits)??this.hint.textEdits,this._isResolved=!0}catch(t){ll(t),this._isResolved=!1}}}const lP=class lP{static async create(e,t,i,r){const s=[],o=e.ordered(t).reverse().map(a=>i.map(async l=>{try{const c=await a.provideInlayHints(t,l,r);(c!=null&&c.hints.length||a.onDidChangeInlayHints)&&s.push([c??lP._emptyInlayHintList,a])}catch(c){ll(c)}}));if(await Promise.all(o.flat()),r.isCancellationRequested||t.isDisposed())throw new rv;return new lP(i,s,t)}constructor(e,t,i){this._disposables=new Et,this.ranges=e,this.provider=new Set;const r=[];for(const[s,o]of t){this._disposables.add(s),this.provider.add(o);for(const a of s.hints){const l=i.validatePosition(a.position);let c="before";const u=lP._getRangeAtPosition(i,l);let d;u.getStartPosition().isBefore(l)?(d=ie.fromPositions(u.getStartPosition(),l),c="after"):(d=ie.fromPositions(l,u.getEndPosition()),c="before"),r.push(new rIe(a,new nft(d,c),o))}}this.items=r.sort((s,o)=>We.compare(s.hint.position,o.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,r=e.getWordAtPosition(t);if(r)return new ie(i,r.startColumn,i,r.endColumn);e.tokenization.tokenizeIfCheap(i);const s=e.tokenization.getLineTokens(i),o=t.column-1,a=s.findTokenIndexAtOffset(o);let l=s.getStartOffset(a),c=s.getEndOffset(a);return c-l===1&&(l===o&&a>1?(l=s.getStartOffset(a-1),c=s.getEndOffset(a-1)):c===o&&a<s.getCount()-1&&(l=s.getStartOffset(a+1),c=s.getEndOffset(a+1))),new ie(i,l+1,i,c+1)}};lP._emptyInlayHintList=Object.freeze({dispose(){},hints:[]});let PY=lP;function aLr(n){return vi.from({scheme:ir.command,path:n.id,query:n.arguments&&encodeURIComponent(JSON.stringify(n.arguments))}).toString()}var lLr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},aC=function(n,e){return function(t,i){e(t,i,n)}};let uv=class extends X7{constructor(e,t,i,r,s,o,a,l,c,u,d,f,p){super(e,{...r.getRawOptions(),overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()},i,s,o,a,l,c,u,d,f,p),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){Wee(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};uv=lLr([aC(4,mi),aC(5,Cs),aC(6,Fo),aC(7,Oi),aC(8,mc),aC(9,wl),aC(10,dp),aC(11,wa),aC(12,Fn)],uv);const q$e=new At(new ds(0,122,204)),cLr={showArrow:!0,showFrame:!0,className:"",frameColor:q$e,arrowColor:q$e,keepEditorSelection:!1},uLr="vs.editor.contrib.zoneWidget";class dLr{constructor(e,t,i,r,s,o,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=o}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class hLr{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const wX=class wX{constructor(e){this._editor=e,this._ruleName=wX._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),Ome(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(){Ome(this._ruleName),UK(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:ie.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};wX._IdGenerator=new dTe(".arrow-decoration-");let k0e=wX;class fLr{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Et,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=TC(t),Wee(this.options,cLr,!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 k0e(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.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=ie.isIRange(e)?ie.lift(e):ie.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:ur.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.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(67);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(),s=this._getWidth(r);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(r)+"px";const o=document.createElement("div");o.style.overflow="hidden";const a=this.editor.getOption(67);if(!this.options.allowUnlimitedHeight){const f=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,f)}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(f=>{this._viewZone&&f.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new dLr(o,i.lineNumber,i.column,t,p=>this._onViewZoneTop(p),p=>this._onViewZoneHeight(p),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=f.addZone(this._viewZone),this._overlayWidget=new hLr(uLr+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const f=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=f+"px",this.container.style.borderBottomWidth=f+"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,s),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const f=d.validateRange(new ie(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(f,f.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 td(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(67),r=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+r;s>5&&s<35&&this._relayout(s)}}))}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 ift=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},rft=function(n,e){return function(t,i){e(t,i,n)}};const sft=Ur("IPeekViewService");ns(sft,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 ff;(function(n){n.inPeekEditor=new yn("inReferenceSearchEditor",!0,A("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(ff||(ff={}));var rO;let OY=(rO=class{constructor(e,t){e instanceof uv&&ff.inPeekEditor.bindTo(t)}dispose(){}},rO.ID="editor.contrib.referenceController",rO);OY=ift([rft(1,Oi)],OY);cs(OY.ID,OY,0);function pLr(n){const e=n.get(Cs).getFocusedCodeEditor();return e instanceof uv?e.getParentEditor():e}const gLr={headerBackgroundColor:At.white,primaryHeadingColor:At.fromHex("#333333"),secondaryHeadingColor:At.fromHex("#6c6c6cb3")};let MY=class extends fLr{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new Ue,this.onDidClose=this._onDidClose.event,Wee(this.options,gLr,!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=Jt(".head"),this._bodyElement=Jt(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=Jt(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Da(this._titleElement,"click",s=>this._onTitleClick(s))),Ot(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=Jt("span.filename"),this._secondaryHeading=Jt("span.dirname"),this._metaHeading=Jt("span.meta"),Ot(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=Jt(".peekview-actions");Ot(this._headElement,i);const r=this._getActionBarOptions();this._actionbarWidget=new hg(i,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Zf("peekview.close",A("label.close","Close"),Ni.asClassName(Yt.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:act.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:mu(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,qf(this._metaHeading)):ph(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(67)*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`)}};MY=ift([rft(2,mi)],MY);const mLr=ve("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:At.black,hcLight:At.white},A("peekViewTitleBackground","Background color of the peek view title area.")),oft=ve("peekViewTitleLabel.foreground",{dark:At.white,light:At.black,hcDark:At.white,hcLight:y1},A("peekViewTitleForeground","Color of the peek view title.")),aft=ve("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},A("peekViewTitleInfoForeground","Color of the peek view title info.")),_Lr=ve("peekView.border",{dark:Qy,light:Qy,hcDark:ls,hcLight:ls},A("peekViewBorder","Color of the peek view borders and arrow.")),vLr=ve("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:At.black,hcLight:At.white},A("peekViewResultsBackground","Background color of the peek view result list."));ve("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:At.white,hcLight:y1},A("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));ve("peekViewResult.fileForeground",{dark:At.white,light:"#1E1E1E",hcDark:At.white,hcLight:y1},A("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));ve("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},A("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));ve("peekViewResult.selectionForeground",{dark:At.white,light:"#6C6C6C",hcDark:At.white,hcLight:y1},A("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const lft=ve("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:At.black,hcLight:At.white},A("peekViewEditorBackground","Background color of the peek view editor."));ve("peekViewEditorGutter.background",lft,A("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));ve("peekViewEditorStickyScroll.background",lft,A("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));ve("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},A("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));ve("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},A("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));ve("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:aa,hcLight:aa},A("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class ck{constructor(e,t,i,r){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=r,this.id=E_e.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var t;const e=(t=this.parent.getPreview(this))==null?void 0:t.preview(this.range);return e?A({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}",e.value,Mm(this.uri),this.range.startLineNumber,this.range.startColumn):A("aria.oneReference","in {0} on line {1} at column {2}",Mm(this.uri),this.range.startLineNumber,this.range.startColumn)}}class bLr{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:s,endLineNumber:o,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:r,column:s-t}),c=new ie(r,l.startColumn,r,s),u=new ie(o,a,o,1073741824),d=i.getValueInRange(c).replace(/^\s+/,""),f=i.getValueInRange(e),p=i.getValueInRange(u).replace(/\s+$/,"");return{value:d+f+p,highlight:{start:d.length,end:d.length+f.length}}}}class fB{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Yc}dispose(){vo(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?A("aria.fileReferences.1","1 symbol in {0}, full path {1}",Mm(this.uri),this.uri.fsPath):A("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Mm(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new bLr(i))}catch(i){tr(i)}return this}}class tp{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new Ue,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(tp._compareReferences);let r;for(const s of e)if((!r||!la.isEqual(r.uri,s.uri,!0))&&(r=new fB(this,s.uri),this.groups.push(r)),r.children.length===0||tp._compareReferences(s,r.children[r.children.length-1])!==0){const o=new ck(i===s,r,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(o),r.children.push(o)}}dispose(){vo(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new tp(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?A("aria.result.0","No results found"):this.references.length===1?A("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?A("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):A("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 s=i.children.length,o=i.parent.groups.length;return o===1||t&&r+1<s||!t&&r>0?(t?r=(r+1)%s:r=(r+s-1)%s,i.children[r]):(r=i.parent.groups.indexOf(i),t?(r=(r+1)%o,i.parent.groups[r].children[0]):(r=(r+o-1)%o,i.parent.groups[r].children[i.parent.groups[r].children.length-1]))}nearestReference(e,t){const i=this.references.map((r,s)=>({idx:s,prefixLen:GE(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,s)=>r.prefixLen>s.prefixLen?-1:r.prefixLen<s.prefixLen?1:r.offsetDist<s.offsetDist?-1:r.offsetDist>s.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()&&ie.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 la.compare(e.uri,t.uri)||ie.compareRangesUsingStarts(e.range,t.range)}}var pne=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},gne=function(n,e){return function(t,i){e(t,i,n)}},T0e;let I0e=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof tp||e instanceof fB}getChildren(e){if(e instanceof tp)return e.groups;if(e instanceof fB)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};I0e=pne([gne(0,Cf)],I0e);class yLr{getHeight(){return 23}getTemplateId(e){return e instanceof fB?jY.id:FY.id}}let L0e=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof ck){const i=(t=e.parent.getPreview(e))==null?void 0:t.preview(e.range);if(i)return i.value}return Mm(e.uri)}};L0e=pne([gne(0,Ws)],L0e);class CLr{getId(e){return e instanceof ck?e.id:e.uri}}let A0e=class extends Ye{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new qG(i,{supportHighlights:!0})),this.badge=new Sve(Ot(i,Jt(".count")),{},sct),e.appendChild(i)}set(e,t){const i=Tte(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(A("referencesCount","{0} references",r)):this.badge.setTitleFormat(A("referenceCount","{0} reference",r))}};A0e=pne([gne(1,_M)],A0e);var PI;let jY=(PI=class{constructor(e){this._instantiationService=e,this.templateId=T0e.id}renderTemplate(e){return this._instantiationService.createInstance(A0e,e)}renderElement(e,t,i){i.set(e.element,J9(e.filterData))}disposeTemplate(e){e.dispose()}},T0e=PI,PI.id="FileReferencesRenderer",PI);jY=T0e=pne([gne(0,mi)],jY);class wLr extends Ye{constructor(e){super(),this.label=this._register(new fE(e))}set(e,t){var r;const i=(r=e.parent.getPreview(e))==null?void 0:r.preview(e.range);if(!i||!i.value)this.label.set(`${Mm(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:o}=i;t&&!Db.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,J9(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[o]))}}}const xX=class xX{constructor(){this.templateId=xX.id}renderTemplate(e){return new wLr(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};xX.id="OneReferenceRenderer";let FY=xX;class xLr{getWidgetAriaLabel(){return A("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var SLr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},$D=function(n,e){return function(t,i){e(t,i,n)}};const SX=class SX{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Et,this._callOnModelChange=new Et,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,s=e.children.length;r<s;r++){const o=e.children[r];this._decorationIgnoreSet.has(o.id)||o.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:o.range,options:SX.DecorationOptions}),i.push(r))}this._editor.changeDecorations(r=>{const s=r.deltaDecorations([],t);for(let o=0;o<s.length;o++)this._decorations.set(s[o],e.children[i[o]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,r]of this._decorations){const s=t.getDecorationRange(i);if(!s)continue;let o=!1;if(!ie.equalsRange(s,r.range)){if(ie.spansMultipleLines(s))o=!0;else{const a=r.range.endColumn-r.range.startColumn,l=s.endColumn-s.startColumn;a!==l&&(o=!0)}o?(this._decorationIgnoreSet.add(r.id),e.push(i)):r.range=s}}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()}};SX.DecorationOptions=ur.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});let N0e=SX;class ELr{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 kLr extends Dve{}let D0e=class extends MY{constructor(e,t,i,r,s,o,a,l,c){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},o),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=s,this._instantiationService=o,this._peekViewService=a,this._uriLabel=l,this._keybindingService=c,this._disposeOnNewModel=new Et,this._callOnDispose=new Et,this._onDidSelectReference=new Ue,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new Ys(0,0),this._isClosing=!1,this._applyTheme(r.getColorTheme()),this._callOnDispose.add(r.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}get isClosing(){return this._isClosing}dispose(){this._isClosing=!0,this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),vo(this._preview),vo(this._previewNotAvailableMessage),vo(this._tree),vo(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(_Lr)||At.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(mLr)||At.transparent,primaryHeadingColor:e.getColor(oft),secondaryHeadingColor:e.getColor(aft)})}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=Ot(e,Jt("div.messages")),ph(this._messageContainer),this._splitView=new Xct(e,{orientation:1}),this._previewContainer=Ot(e,Jt("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(uv,this._previewContainer,t,{},this.editor),ph(this._previewContainer),this._previewNotAvailableMessage=this._instantiationService.createInstance(yb,A("missingPreviewMessage","no preview available"),Ih,yb.DEFAULT_CREATION_OPTIONS,null),this._treeContainer=Ot(e,Jt("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new xLr,keyboardNavigationLabelProvider:this._instantiationService.createInstance(L0e),identityProvider:new CLr,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:vLr}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(Da(this._treeContainer,"keydown",s=>{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(kLr,"ReferencesWidget",this._treeContainer,new yLr,[this._instantiationService.createInstance(jY),this._instantiationService.createInstance(FY)],this._instantiationService.createInstance(I0e),i),this._splitView.addView({onDidChange:rn.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},BG.Distribute),this._splitView.addView({onDidChange:rn.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},BG.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(s,o)=>{s instanceof ck&&(o==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:o,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(s=>{s.sideBySide?r(s.element,"side"):s.editorOptions.pinned?r(s.element,"goto"):r(s.element,"show")})),ph(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Ys(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=A("noResults","No results"),qf(this._messageContainer),Promise.resolve(void 0)):(ph(this._messageContainer),this._decorationsManager=new N0e(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"),qf(this._treeContainer),qf(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 ck)return e;if(e instanceof fB&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==ir.inMemory?this.setTitle(Ppr(e.uri),this._uriLabel.getUriLabel(Tte(e.uri))):this.setTitle(A("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),await this._tree.expand(e.parent),this._tree.reveal(e));const r=await i;if(!this._model){r.dispose();return}vo(this._previewModelReference);const s=r.object;if(s){const o=this._preview.getModel()===s.textEditorModel?0:1,a=ie.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(s.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,o)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()}};D0e=SLr([$D(3,mc),$D(4,Cf),$D(5,mi),$D(6,sft),$D(7,_M),$D(8,Ws)],D0e);var TLr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},HD=function(n,e){return function(t,i){e(t,i,n)}},LU;const JA=new yn("referenceSearchVisible",!1,A("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var OI;let sA=(OI=class{static get(e){return e.getContribution(LU.ID)}constructor(e,t,i,r,s,o,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=s,this._instantiationService=o,this._storageService=a,this._configurationService=l,this._disposables=new Et,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=JA.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)==null||e.dispose(),(t=this._model)==null||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 s="peekViewLayout",o=ELr.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(D0e,this._editor,this._defaultTreeKeyboardSupport,o),this._widget.setTitle(A("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget?(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget.isClosing||this.closeWidget(),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.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(A("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new We(e.startLineNumber,e.startColumn),f=this._model.nearestReference(u,d);if(f)return this._widget.setSelection(f).then(()=>{this._widget&&this._editor.getOption(87)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){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),s=this._editor.hasTextFocus(),o=this._widget.isPreviewEditorFocused();await this._widget.setSelection(r),await this._gotoReference(r,!1),s?this._editor.focus():this._widget&&o&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;(t=this._widget)==null||t.dispose(),(i=this._model)==null||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 r;(r=this._widget)==null||r.hide(),this._ignoreModelChangeEvent=!0;const i=ie.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:"code.jump",pinned:t}},this._editor).then(s=>{if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=LU.get(s),a=this._model.clone();this.closeWidget(),s.focus(),o==null||o.toggleWidget(i,Ic(l=>Promise.resolve(a)),this._peekMode??!1)}},s=>{this._ignoreModelChangeEvent=!1,tr(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:r,range:s}=e;this._editorService.openCodeEditor({resource:r,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}},LU=OI,OI.ID="editor.contrib.referencesController",OI);sA=LU=TLr([HD(2,Oi),HD(3,Cs),HD(4,wl),HD(5,mi),HD(6,yv),HD(7,Dr)],sA);function eN(n,e){const t=pLr(n);if(!t)return;const i=sA.get(t);i&&e(i)}Rh.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Gl(2089,60),when:It.or(JA,ff.inPeekEditor),handler(n){eN(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Rh.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:It.or(JA,ff.inPeekEditor),handler(n){eN(n,e=>{e.goToNextOrPreviousReference(!0)})}});Rh.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:It.or(JA,ff.inPeekEditor),handler(n){eN(n,e=>{e.goToNextOrPreviousReference(!1)})}});os.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");os.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");os.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");os.registerCommand("closeReferenceSearch",n=>eN(n,e=>e.closeWidget()));Rh.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:It.and(ff.inPeekEditor,It.not("config.editor.stablePeek"))});Rh.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:It.and(JA,It.not("config.editor.stablePeek"),It.or(me.editorTextFocus,aut.negate()))});Rh.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:It.and(JA,uut,GTe.negate(),YTe.negate()),handler(n){var i;const t=(i=n.get(Qm).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof ck&&eN(n,r=>r.revealReference(t[0]))}});Rh.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:It.and(JA,uut,GTe.negate(),YTe.negate()),handler(n){var i;const t=(i=n.get(Qm).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof ck&&eN(n,r=>r.openReference(t[0],!0,!0))}});os.registerCommand("openReference",n=>{var i;const t=(i=n.get(Qm).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof ck&&eN(n,r=>r.openReference(t[0],!1,!0))});var cft=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},oF=function(n,e){return function(t,i){e(t,i,n)}};const sIe=new yn("hasSymbols",!1,A("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),mne=Ur("ISymbolNavigationService");let R0e=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=sIe.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)==null||e.dispose(),(t=this._currentMessage)==null||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 P0e(this._editorService),r=i.onDidChange(s=>{if(this._ignoreEditorChange)return;const o=this._editorService.getActiveCodeEditor();if(!o)return;const a=o.getModel(),l=o.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(k7(d.uri,a.uri))c=!0,u=u||ie.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=U_(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:ie.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var i;(i=this._currentMessage)==null||i.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?A("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):A("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};R0e=cft([oF(0,Oi),oF(1,Cs),oF(2,wl),oF(3,Ws)],R0e);ns(mne,R0e,1);gn(new class extends pc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:sIe,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(mne).revealNext(e)}});Rh.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:sIe,primary:9,handler(n){n.get(mne).reset()}});let P0e=class{constructor(e){this._listener=new Map,this._disposables=new Et,this._onDidChange=new Ue,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(),vo(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,U_(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.dispose(),this._listener.delete(e)}};P0e=cft([oF(0,Cs)],P0e);function O0e(n,e){return e.uri.scheme===n.uri.scheme?!0:!Nme(e.uri,ir.walkThroughSnippet,ir.vscodeChatCodeBlock,ir.vscodeChatCodeCompareBlock)}async function w$(n,e,t,i,r){const o=t.ordered(n,i).map(l=>Promise.resolve(r(l,n,e)).then(void 0,c=>{ll(c)})),a=await Promise.all(o);return iv(a.flat()).filter(l=>O0e(n,l))}function x$(n,e,t,i,r){return w$(e,t,n,i,(s,o,a)=>s.provideDefinition(o,a,r))}function oIe(n,e,t,i,r){return w$(e,t,n,i,(s,o,a)=>s.provideDeclaration(o,a,r))}function aIe(n,e,t,i,r){return w$(e,t,n,i,(s,o,a)=>s.provideImplementation(o,a,r))}function lIe(n,e,t,i,r){return w$(e,t,n,i,(s,o,a)=>s.provideTypeDefinition(o,a,r))}function S$(n,e,t,i,r,s){return w$(e,t,n,r,async(o,a,l)=>{var d,f;const c=(d=await o.provideReferences(a,l,{includeDeclaration:!0},s))==null?void 0:d.filter(p=>O0e(a,p));if(!i||!c||c.length!==2)return c;const u=(f=await o.provideReferences(a,l,{includeDeclaration:!1},s))==null?void 0:f.filter(p=>O0e(a,p));return u&&u.length===1?u:c})}async function S1(n){const e=await n(),t=new tp(e,""),i=t.references.map(r=>r.link);return t.dispose(),i}wf("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(Fn),r=x$(i.definitionProvider,e,t,!1,xr.None);return S1(()=>r)});wf("_executeDefinitionProvider_recursive",(n,e,t)=>{const i=n.get(Fn),r=x$(i.definitionProvider,e,t,!0,xr.None);return S1(()=>r)});wf("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(Fn),r=lIe(i.typeDefinitionProvider,e,t,!1,xr.None);return S1(()=>r)});wf("_executeTypeDefinitionProvider_recursive",(n,e,t)=>{const i=n.get(Fn),r=lIe(i.typeDefinitionProvider,e,t,!0,xr.None);return S1(()=>r)});wf("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(Fn),r=oIe(i.declarationProvider,e,t,!1,xr.None);return S1(()=>r)});wf("_executeDeclarationProvider_recursive",(n,e,t)=>{const i=n.get(Fn),r=oIe(i.declarationProvider,e,t,!0,xr.None);return S1(()=>r)});wf("_executeReferenceProvider",(n,e,t)=>{const i=n.get(Fn),r=S$(i.referenceProvider,e,t,!1,!1,xr.None);return S1(()=>r)});wf("_executeReferenceProvider_recursive",(n,e,t)=>{const i=n.get(Fn),r=S$(i.referenceProvider,e,t,!1,!0,xr.None);return S1(()=>r)});wf("_executeImplementationProvider",(n,e,t)=>{const i=n.get(Fn),r=aIe(i.implementationProvider,e,t,!1,xr.None);return S1(()=>r)});wf("_executeImplementationProvider_recursive",(n,e,t)=>{const i=n.get(Fn),r=aIe(i.implementationProvider,e,t,!0,xr.None);return S1(()=>r)});Uc.appendMenuItem(zn.EditorContext,{submenu:zn.EditorContextPeek,title:A("peek.submenu","Peek"),group:"navigation",order:100});class RM{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof RM||We.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const T_=class T_ extends Zb{static all(){return T_._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of ss.wrap(t.menu))(i.id===zn.EditorContext||i.id===zn.EditorContextPeek)&&(i.when=It.and(e.precondition,i.when));return t}constructor(e,t){super(T_._patchConfig(t)),this.configuration=e,T_._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,r){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(wl),o=e.get(Cs),a=e.get(Rk),l=e.get(mne),c=e.get(Fn),u=e.get(mi),d=t.getModel(),f=t.getPosition(),p=RM.is(i)?i:new RM(d,f),g=new ak(t,5),m=K9(this._getLocationModel(c,p.model,p.position,g.token),g.token).then(async _=>{var y;if(!_||g.token.isCancellationRequested)return;Ph(_.ariaMessage);let v;if(_.referenceAt(d.uri,f)){const C=this._getAlternativeCommand(t);!T_._activeAlternativeCommands.has(C)&&T_._allSymbolNavigationCommands.has(C)&&(v=T_._allSymbolNavigationCommands.get(C))}const b=_.references.length;if(b===0){if(!this.configuration.muteMessage){const C=d.getWordAtPosition(f);(y=ep.get(t))==null||y.showMessage(this._getNoResultFoundMessage(C),f)}}else if(b===1&&v)T_._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(C=>v.runEditorCommand(C,t,i,r).finally(()=>{T_._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(o,l,t,_,r)},_=>{s.error(_)}).finally(()=>{g.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,r,s){const o=this._getGoToPreference(i);if(!(i instanceof uv)&&(this.configuration.openInPeek||o==="peek"&&r.references.length>1))this._openInPeek(i,r,s);else{const a=r.firstReference(),l=r.references.length>1&&o==="gotoAndPeek",c=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,r,s):r.dispose(),o==="goto"&&t.put(a)}}async _openReference(e,t,i,r,s){let o;if(Kor(i)&&(o=i.targetSelectionRange),o||(o=i.range),!o)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:ie.collapseToStart(o),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(a){if(s){const l=a.getModel(),c=a.createDecorationsCollection([{range:o,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,i){const r=sA.get(e);r&&e.hasModel()?r.toggleWidget(i??e.getSelection(),Ic(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};T_._allSymbolNavigationCommands=new Map,T_._activeAlternativeCommands=new Set;let Fw=T_;class E$ extends Fw{async _getLocationModel(e,t,i,r){return new tp(await x$(e.definitionProvider,t,i,!1,r),A("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?A("noResultWord","No definition found for '{0}'",e.word):A("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}var CE;Ao((CE=class extends E${constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:CE.id,title:{...$i("actions.goToDecl.label","Go to Definition"),mnemonicTitle:A({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:me.hasDefinitionProvider,keybinding:[{when:me.editorTextFocus,primary:70,weight:100},{when:It.and(me.editorTextFocus,sut),primary:2118,weight:100}],menu:[{id:zn.EditorContext,group:"navigation",order:1.1},{id:zn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),os.registerCommandAlias("editor.action.goToDeclaration",CE.id)}},CE.id="editor.action.revealDefinition",CE));var wE;Ao((wE=class extends E${constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:wE.id,title:$i("actions.goToDeclToSide.label","Open Definition to the Side"),precondition:It.and(me.hasDefinitionProvider,me.isInEmbeddedEditor.toNegated()),keybinding:[{when:me.editorTextFocus,primary:Gl(2089,70),weight:100},{when:It.and(me.editorTextFocus,sut),primary:Gl(2089,2118),weight:100}]}),os.registerCommandAlias("editor.action.openDeclarationToTheSide",wE.id)}},wE.id="editor.action.revealDefinitionAside",wE));var xE;Ao((xE=class extends E${constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:xE.id,title:$i("actions.previewDecl.label","Peek Definition"),precondition:It.and(me.hasDefinitionProvider,ff.notInPeekEditor,me.isInEmbeddedEditor.toNegated()),keybinding:{when:me.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:zn.EditorContextPeek,group:"peek",order:2}}),os.registerCommandAlias("editor.action.previewDeclaration",xE.id)}},xE.id="editor.action.peekDefinition",xE));class uft extends Fw{async _getLocationModel(e,t,i,r){return new tp(await oIe(e.declarationProvider,t,i,!1,r),A("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?A("decl.noResultWord","No declaration found for '{0}'",e.word):A("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}var MI;Ao((MI=class extends uft{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:MI.id,title:{...$i("actions.goToDeclaration.label","Go to Declaration"),mnemonicTitle:A({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:It.and(me.hasDeclarationProvider,me.isInEmbeddedEditor.toNegated()),menu:[{id:zn.EditorContext,group:"navigation",order:1.3},{id:zn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?A("decl.noResultWord","No declaration found for '{0}'",e.word):A("decl.generic.noResults","No declaration found")}},MI.id="editor.action.revealDeclaration",MI));Ao(class extends uft{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:$i("actions.peekDecl.label","Peek Declaration"),precondition:It.and(me.hasDeclarationProvider,ff.notInPeekEditor,me.isInEmbeddedEditor.toNegated()),menu:{id:zn.EditorContextPeek,group:"peek",order:3}})}});class dft extends Fw{async _getLocationModel(e,t,i,r){return new tp(await lIe(e.typeDefinitionProvider,t,i,!1,r),A("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?A("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):A("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}var jI;Ao((jI=class extends dft{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:jI.ID,title:{...$i("actions.goToTypeDefinition.label","Go to Type Definition"),mnemonicTitle:A({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:me.hasTypeDefinitionProvider,keybinding:{when:me.editorTextFocus,primary:0,weight:100},menu:[{id:zn.EditorContext,group:"navigation",order:1.4},{id:zn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},jI.ID="editor.action.goToTypeDefinition",jI));var FI;Ao((FI=class extends dft{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:FI.ID,title:$i("actions.peekTypeDefinition.label","Peek Type Definition"),precondition:It.and(me.hasTypeDefinitionProvider,ff.notInPeekEditor,me.isInEmbeddedEditor.toNegated()),menu:{id:zn.EditorContextPeek,group:"peek",order:4}})}},FI.ID="editor.action.peekTypeDefinition",FI));class hft extends Fw{async _getLocationModel(e,t,i,r){return new tp(await aIe(e.implementationProvider,t,i,!1,r),A("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?A("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):A("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}var BI;Ao((BI=class extends hft{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:BI.ID,title:{...$i("actions.goToImplementation.label","Go to Implementations"),mnemonicTitle:A({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:me.hasImplementationProvider,keybinding:{when:me.editorTextFocus,primary:2118,weight:100},menu:[{id:zn.EditorContext,group:"navigation",order:1.45},{id:zn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},BI.ID="editor.action.goToImplementation",BI));var $I;Ao(($I=class extends hft{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:$I.ID,title:$i("actions.peekImplementation.label","Peek Implementations"),precondition:It.and(me.hasImplementationProvider,ff.notInPeekEditor,me.isInEmbeddedEditor.toNegated()),keybinding:{when:me.editorTextFocus,primary:3142,weight:100},menu:{id:zn.EditorContextPeek,group:"peek",order:5}})}},$I.ID="editor.action.peekImplementation",$I));class fft extends Fw{_getNoResultFoundMessage(e){return e?A("references.no","No references found for '{0}'",e.word):A("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Ao(class extends fft{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...$i("goToReferences.label","Go to References"),mnemonicTitle:A({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:It.and(me.hasReferenceProvider,ff.notInPeekEditor,me.isInEmbeddedEditor.toNegated()),keybinding:{when:me.editorTextFocus,primary:1094,weight:100},menu:[{id:zn.EditorContext,group:"navigation",order:1.45},{id:zn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,r){return new tp(await S$(e.referenceProvider,t,i,!0,!1,r),A("ref.title","References"))}});Ao(class extends fft{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:$i("references.action.label","Peek References"),precondition:It.and(me.hasReferenceProvider,ff.notInPeekEditor,me.isInEmbeddedEditor.toNegated()),menu:{id:zn.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,r){return new tp(await S$(e.referenceProvider,t,i,!1,!1,r),A("ref.title","References"))}});class ILr extends Fw{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:$i("label.generic","Go to Any Symbol"),precondition:It.and(ff.notInPeekEditor,me.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,r){return new tp(this._references,A("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&A("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}os.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:vi},{name:"position",description:"The position at which to start",constraint:We.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:async(n,e,t,i,r,s,o)=>{ys(vi.isUri(e)),ys(We.isIPosition(t)),ys(Array.isArray(i)),ys(typeof r>"u"||typeof r=="string"),ys(typeof o>"u"||typeof o=="boolean");const a=n.get(Cs),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(n1(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends ILr{_getNoResultFoundMessage(d){return s||super._getNoResultFoundMessage(d)}}({muteMessage:!s,openInPeek:!!o,openToSide:!1},i,r);c.get(mi).invokeFunction(u.run.bind(u),l)})}});os.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:vi},{name:"position",description:"The position at which to start",constraint:We.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:async(n,e,t,i,r)=>{n.get(Fo).executeCommand("editor.action.goToLocations",e,t,i,r,void 0,!0)}});os.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{ys(vi.isUri(e)),ys(We.isIPosition(t));const i=n.get(Fn),r=n.get(Cs);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(s=>{if(!n1(s)||!s.hasModel())return;const o=sA.get(s);if(!o)return;const a=Ic(c=>S$(i.referenceProvider,s.getModel(),We.lift(t),!1,!1,c).then(u=>new tp(u,A("ref.title","References")))),l=new ie(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(o.toggleWidget(l,a,!1))})}});os.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function LLr(n,e,t,i){const r=n.get(Cf),s=n.get(up),o=n.get(Fo),a=n.get(mi),l=n.get(wl);if(await i.item.resolve(xr.None),!i.part.location)return;const c=i.part.location,u=[],d=new Set(Uc.getMenuItems(zn.EditorContext).map(p=>DP(p)?p.command.id:lne()));for(const p of Fw.all())d.has(p.desc.id)&&u.push(new Zf(p.desc.id,Jf.label(p.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const g=await r.createModelReference(c.uri);try{const m=new RM(g.object.textEditorModel,ie.getStartPosition(c.range)),_=i.item.anchor.range;await a.invokeFunction(p.runEditorCommand.bind(p),e,m,_)}finally{g.dispose()}}));if(i.part.command){const{command:p}=i.part;u.push(new Ac),u.push(new Zf(p.id,p.title,void 0,!0,async()=>{try{await o.executeCommand(p.id,...p.arguments??[])}catch(g){l.notify({severity:gte.Error,source:i.item.provider.displayName,message:g})}}))}const f=e.getOption(128);s.showContextMenu({domForShadowRoot:f?e.getDomNode()??void 0:void 0,getAnchor:()=>{const p=al(t);return{x:p.left,y:p.top+p.height+8}},getActions:()=>u,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function pft(n,e,t,i){const s=await n.get(Cf).createModelReference(i.uri);await t.invokeWithinContext(async o=>{const a=e.hasSideBySideModifier,l=o.get(Oi),c=ff.inPeekEditor.getValue(l),u=!a&&t.getOption(89)&&!c;return new E$({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(o,new RM(s.object.textEditorModel,ie.getStartPosition(i.range)),ie.lift(i.range))}),s.dispose()}var ALr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},VD=function(n,e){return function(t,i){e(t,i,n)}},cR;class BY{constructor(){this._entries=new b1(50)}get(e){const t=BY._key(e);return this._entries.get(t)}set(e,t){const i=BY._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const gft=Ur("IInlayHintsCache");ns(gft,BY,1);class M0e{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 NLr{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var nw;let pB=(nw=class{static get(e){return e.getContribution(cR.ID)??void 0}constructor(e,t,i,r,s,o,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=r,this._commandService=s,this._notificationService=o,this._instaService=a,this._disposables=new Et,this._sessionDisposables=new Et,this._decorationsMetadata=new Map,this._ruleFactory=new iY(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(142)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(142);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(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(UC.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(),f=this._copyInlayHintsWithCurrentAnchor(d);this._updateHintsDecorators([d.getFullModelRange()],f),o.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(gi(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let r;const s=new Set,o=new ao(async()=>{const a=Date.now();r==null||r.dispose(!0),r=new ba;const l=t.onWillDispose(()=>r==null?void 0:r.cancel());try{const c=r.token,u=await PY.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(o.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){u.dispose();return}for(const d of u.provider)typeof d.onDidChangeInlayHints=="function"&&!s.has(d)&&(s.add(d),this._sessionDisposables.add(d.onDidChangeInlayHints(()=>{o.isScheduled()||o.schedule()})));this._sessionDisposables.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(c){tr(c)}finally{r.dispose(),l.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(o),this._sessionDisposables.add(gi(()=>r==null?void 0:r.dispose(!0))),o.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!o.isScheduled())&&o.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{r==null||r.cancel();const l=Math.max(o.delay,1250);o.schedule(l)})),this._sessionDisposables.add(this._installDblClickGesture(()=>o.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Et,t=e.add(new fne(this._editor)),i=new Et;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(r=>{const[s]=r,o=this._getInlayHintLabelPart(s),a=this._editor.getModel();if(!o||!a){i.clear();return}const l=new ba;i.add(gi(()=>l.dispose(!0))),o.item.resolve(l.token),this._activeInlayHintPart=o.part.command||o.part.location?new NLr(o,s.hasTriggerModifier):void 0;const c=a.validatePosition(o.item.hint.position).lineNumber,u=new ie(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),i.add(gi(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async r=>{const s=this._getInlayHintLabelPart(r);if(s){const o=s.part;o.location?this._instaService.invokeFunction(pft,r,this._editor,o.location):Age.is(o.command)&&await this._invokeCommand(o.command,s.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(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(xr.None),Gd(i.item.hint.textEdits))){const r=i.item.hint.textEdits.map(s=>ma.replace(ie.lift(s.range),s.text));this._editor.executeEdits("inlayHint.default",r),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Lc(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(LLr,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){var i;if(e.target.type!==6)return;const t=(i=e.target.detail.injectedText)==null?void 0:i.options;if(t instanceof rk&&(t==null?void 0:t.attachedData)instanceof M0e)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:gte.Error,source:t.provider.displayName,message:i})}}_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 s=e.getDecorationRange(i);if(s){const o=new nft(s,r.item.anchor.direction),a=r.item.with({anchor:o});t.set(r.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),r=[];for(const s of i.sort(ie.compareRangesUsingStarts)){const o=t.validateRange(new ie(s.startLineNumber-30,s.startColumn,s.endLineNumber+30,s.endColumn));r.length===0||!ie.areIntersectingOrTouching(r[r.length-1],o)?r.push(o):r[r.length-1]=ie.plusRange(r[r.length-1],o)}return r}_updateHintsDecorators(e,t){var g,m;const i=[],r=(_,v,b,y,C)=>{const S={content:b,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:y,attachedData:C};i.push({item:_,classNameRef:v,decoration:{range:_.anchor.range,options:{description:"InlayHint",showIfCollapsed:_.anchor.range.isEmpty(),collapseOnReplaceEdit:!_.anchor.range.isEmpty(),stickiness:0,[_.anchor.direction]:this._activeRenderMode===0?S:void 0}}})},s=(_,v)=>{const b=this._ruleFactory.createClassNameRef({width:`${o/3|0}px`,display:"inline-block"});r(_,b," ",v?$_.Right:$_.None)},{fontSize:o,fontFamily:a,padding:l,isUniform:c}=this._getLayoutInfo(),u="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(u,a);let d={line:0,totalLen:0};for(const _ of t){if(d.line!==_.anchor.range.startLineNumber&&(d={line:_.anchor.range.startLineNumber,totalLen:0}),d.totalLen>cR._MAX_LABEL_LEN)continue;_.hint.paddingLeft&&s(_,!1);const v=typeof _.hint.label=="string"?[{label:_.hint.label}]:_.hint.label;for(let b=0;b<v.length;b++){const y=v[b],C=b===0,S=b===v.length-1,k={fontSize:`${o}px`,fontFamily:`var(${u}), ${Th.fontFamily}`,verticalAlign:c?"baseline":"middle",unicodeBidi:"isolate"};Gd(_.hint.textEdits)&&(k.cursor="default"),this._fillInColors(k,_.hint),(y.command||y.location)&&((g=this._activeInlayHintPart)==null?void 0:g.part.item)===_&&this._activeInlayHintPart.part.index===b&&(k.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(k.color=Ga(hhr),k.cursor="pointer")),l&&(C&&S?(k.padding=`1px ${Math.max(1,o/4)|0}px`,k.borderRadius=`${o/4|0}px`):C?(k.padding=`1px 0 1px ${Math.max(1,o/4)|0}px`,k.borderRadius=`${o/4|0}px 0 0 ${o/4|0}px`):S?(k.padding=`1px ${Math.max(1,o/4)|0}px 1px 0`,k.borderRadius=`0 ${o/4|0}px ${o/4|0}px 0`):k.padding="1px 0 1px 0");let I=y.label;d.totalLen+=I.length;let L=!1;const N=d.totalLen-cR._MAX_LABEL_LEN;if(N>0&&(I=I.slice(0,-N)+"…",L=!0),r(_,this._ruleFactory.createClassNameRef(k),DLr(I),S&&!_.hint.paddingRight?$_.Right:$_.None,new M0e(_,b)),L)break}if(_.hint.paddingRight&&s(_,!0),i.length>cR._MAX_DECORATORS)break}const f=[];for(const[_,v]of this._decorationsMetadata){const b=(m=this._editor.getModel())==null?void 0:m.getDecorationRange(_);b&&e.some(y=>y.containsRange(b))&&(f.push(_),v.classNameRef.dispose(),this._decorationsMetadata.delete(_))}const p=Ub.capture(this._editor);this._editor.changeDecorations(_=>{const v=_.deltaDecorations(f,i.map(b=>b.decoration));for(let b=0;b<v.length;b++){const y=i[b];this._decorationsMetadata.set(v[b],y)}}),p.restore(this._editor)}_fillInColors(e,t){t.kind===MK.Parameter?(e.backgroundColor=Ga(yhr),e.color=Ga(bhr)):t.kind===MK.Type?(e.backgroundColor=Ga(vhr),e.color=Ga(_hr)):(e.backgroundColor=Ga(Qke),e.color=Ga(Yke))}_getLayoutInfo(){const e=this._editor.getOption(142),t=e.padding,i=this._editor.getOption(52),r=this._editor.getOption(49);let s=e.fontSize;(!s||s<5||s>i)&&(s=i);const o=e.fontFamily||r;return{fontSize:s,fontFamily:o,padding:t,isUniform:!t&&o===r&&s===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}},cR=nw,nw.ID="editor.contrib.InlayHints",nw._MAX_DECORATORS=1500,nw._MAX_LABEL_LEN=43,nw);pB=cR=ALr([VD(1,Fn),VD(2,kg),VD(3,gft),VD(4,Fo),VD(5,wl),VD(6,mi)],pB);function DLr(n){return n.replace(/[ \t]/g," ")}os.registerCommand("_executeInlayHintProvider",async(n,...e)=>{const[t,i]=e;ys(vi.isUri(t)),ys(ie.isIRange(i));const{inlayHintsProvider:r}=n.get(Fn),s=await n.get(Cf).createModelReference(t);try{const o=await PY.create(r,s.object.textEditorModel,[ie.lift(i)],xr.None),a=o.items.map(l=>l.hint);return setTimeout(()=>o.dispose(),0),a}finally{s.dispose()}});var RLr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Gx=function(n,e){return function(t,i){e(t,i,n)}};class K$e extends kU{constructor(e,t,i,r){super(10,t,e.item.anchor.range,i,r,!0),this.part=e}}let $Y=class extends hB{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,o,l,r,s,c),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){var r;if(!pB.get(this._editor)||e.target.type!==6)return null;const i=(r=e.target.detail.injectedText)==null?void 0:r.options;return i instanceof rk&&i.attachedData instanceof M0e?new K$e(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof K$e?new ng(async r=>{const{part:s}=e;if(await s.item.resolve(i),i.isCancellationRequested)return;let o;typeof s.item.hint.tooltip=="string"?o=new rd().appendText(s.item.hint.tooltip):s.item.hint.tooltip&&(o=s.item.hint.tooltip),o&&r.emitOne(new O_(this,e.range,[o],!1,0)),Gd(s.item.hint.textEdits)&&r.emitOne(new O_(this,e.range,[new rd().appendText(A("hint.dbl","Double-click to insert"))],!1,10001));let a;if(typeof s.part.tooltip=="string"?a=new rd().appendText(s.part.tooltip):s.part.tooltip&&(a=s.part.tooltip),a&&r.emitOne(new O_(this,e.range,[a],!1,1)),s.part.location||s.part.command){let c;const d=this._editor.getOption(78)==="altKey"?zr?A("links.navigate.kb.meta.mac","cmd + click"):A("links.navigate.kb.meta","ctrl + click"):zr?A("links.navigate.kb.alt.mac","option + click"):A("links.navigate.kb.alt","alt + click");s.part.location&&s.part.command?c=new rd().appendText(A("hint.defAndCommand","Go to Definition ({0}), right click for more",d)):s.part.location?c=new rd().appendText(A("hint.def","Go to Definition ({0})",d)):s.part.command&&(c=new rd(`[${A("hint.cmd","Execute Command")}](${aLr(s.part.command)} "${s.part.command.title}") (${d})`,{isTrusted:!0})),c&&r.emitOne(new O_(this,e.range,[c],!1,1e4))}const l=await this._resolveInlayHintLabelPartHover(s,i);for await(const c of l)r.emitOne(c)}):ng.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return ng.EMPTY;const{uri:i,range:r}=e.part.location,s=await this._resolverService.createModelReference(i);try{const o=s.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(o)?iIe(this._languageFeaturesService.hoverProvider,o,new We(r.startLineNumber,r.startColumn),t).filter(a=>!gM(a.hover.contents)).map(a=>new O_(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):ng.EMPTY}finally{s.dispose()}}};$Y=RLr([Gx(1,pa),Gx(2,xf),Gx(3,Ws),Gx(4,C1),Gx(5,Dr),Gx(6,Cf),Gx(7,Fn),Gx(8,Fo)],$Y);class cIe extends Ye{constructor(e,t,i,r,s,o){super();const a=t.anchor,l=t.hoverParts;this._renderedHoverParts=this._register(new j0e(e,i,l,o,s));const{showAtPosition:c,showAtSecondaryPosition:u}=cIe.computeHoverPositions(e,a.range,l);this.shouldAppearBeforeContent=l.some(d=>d.isBeforeContent),this.showAtPosition=c,this.showAtSecondaryPosition=u,this.initialMousePosX=a.initialMousePosX,this.initialMousePosY=a.initialMousePosY,this.shouldFocus=r.shouldFocus,this.source=r.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let r=1;if(e.hasModel()){const u=e._getViewModel(),d=u.coordinatesConverter,f=d.convertModelRangeToViewRange(t),p=u.getLineMinColumn(f.startLineNumber),g=new We(f.startLineNumber,p);r=d.convertViewPositionToModelPosition(g).column}const s=t.startLineNumber;let o=t.startColumn,a;for(const u of i){const d=u.range,f=d.startLineNumber===s,p=d.endLineNumber===s;if(f&&p){const m=d.startColumn,_=Math.min(o,m);o=Math.max(_,r)}u.forceShowAtRange&&(a=d)}let l,c;if(a){const u=a.getStartPosition();l=u,c=u}else l=t.getStartPosition(),c=new We(s,o);return{showAtPosition:l,showAtSecondaryPosition:c}}}class PLr{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}const EX=class EX extends Ye{constructor(e,t,i,r,s){super(),this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=s,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,s,r)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(t.length===0)return Ye.None;let i=t[0].range;for(const s of t){const o=s.range;i=ie.plusRange(i,o)}const r=e.createDecorationsCollection();return r.set([{range:i,options:EX._DECORATION_OPTIONS}]),gi(()=>{r.clear()})}_renderParts(e,t,i,r){const s=new RY(r),o={fragment:this._fragment,statusBar:s,...i},a=new Et;for(const c of e){const u=this._renderHoverPartsForParticipant(t,c,o);a.add(u);for(const d of u.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:c,hoverPart:d.hoverPart,hoverElement:d.hoverElement})}const l=this._renderStatusBar(this._fragment,s);return l&&(a.add(l),this._renderedParts.push({type:"statusBar",hoverElement:l.hoverElement,actions:l.actions})),gi(()=>{a.dispose()})}_renderHoverPartsForParticipant(e,t,i){const r=e.filter(o=>o.owner===t);return r.length>0?t.renderHoverParts(i,r):new rA([])}_renderStatusBar(e,t){if(t.hasContent)return new PLr(e,t)}_registerListenersOnRenderedParts(){const e=new Et;return this._renderedParts.forEach((t,i)=>{const r=t.hoverElement;r.tabIndex=0,e.add(_t(r,Xt.FOCUS_IN,s=>{s.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(_t(r,Xt.FOCUS_OUT,s=>{s.stopPropagation(),this._focusedHoverPartIndex=-1}))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof hB&&!(i instanceof $Y));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof uB)}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;const r=this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant,t);if(r===void 0)return;const s=await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(e,r,i);s&&(this._renderedParts[t]={type:"hoverPart",participant:this._markdownHoverParticipant,hoverPart:s.hoverPart,hoverElement:s.hoverElement},this._context.onContentsChanged())}isColorPickerVisible(){var e;return((e=this._colorHoverParticipant)==null?void 0:e.isColorPickerVisible())??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||i.type!=="hoverPart"||!(i.participant===e))return;const s=this._renderedParts.findIndex(o=>o.type==="hoverPart"&&o.participant===e);if(s===-1)throw new Ps;return t-s}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}};EX._DECORATION_OPTIONS=ur.register({description:"content-hover-highlight",className:"hoverHighlight"});let j0e=EX;var OLr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},G$e=function(n,e){return function(t,i){e(t,i,n)}};let F0e=class extends Ye{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._onContentsChanged=this._register(new Ue),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(S0e,this._editor)),this._participants=this._initializeHoverParticipants(),this._computer=new DY(this._editor,this._participants),this._hoverOperation=this._register(new Xht(this._editor,this._computer)),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of ZA.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((t,i)=>t.hoverOrdinal-i.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(t=>{var i;return(i=t.handleResize)==null?void 0:i.call(t)})})),e}_registerListeners(){this._register(this._hoverOperation.onResult(t=>{if(!this._computer.anchor)return;const i=t.hasLoadingMessage?this._addLoadingMessage(t.value):t.value;this._withResult(new Zht(this._computer.anchor,i,t.isComplete))}));const e=this._contentHoverWidget.getDomNode();this._register(Da(e,"keydown",t=>{t.equals(9)&&this.hide()})),this._register(Da(e,"mouseleave",t=>{this._onMouseLeave(t)})),this._register(Ka.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,r,s){if(!(this._contentHoverWidget.position&&this._currentResult))return e?(this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):!1;const a=this._editor.getOption(60).sticky,l=s&&this._contentHoverWidget.isMouseGettingCloser(s.event.posx,s.event.posy);return a&&l?(e&&this._startHoverOperationIfNecessary(e,t,i,r,!0),!0):e?this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._contentHoverWidget.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,s){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=s,this._hoverOperation.start(t))}_setCurrentResult(e){let t=e;if(this._currentResult===t)return;t&&t.hoverParts.length===0&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(e){if(!this._computer.anchor)return e;for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}return e}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const r=e.hoverParts.length===0,s=this._computer.insistOnKeepingHoverVisible;r&&s||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover=new cIe(this._editor,e,this._participants,this._computer,t,this._keybindingService),this._renderedContentHover.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover):this._renderedContentHover.dispose()}_hideHover(){this._contentHoverWidget.hide()}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._onContentsChanged.fire(),this._contentHoverWidget.onContentsChanged()},setMinimumDimensions:r=>{this._contentHoverWidget.setMinimumDimensions(r)}}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const i=this._findHoverAnchorCandidates(e);if(!(i.length>0))return this._startShowingOrUpdateHover(null,0,0,!1,e);const s=i[0];return this._startShowingOrUpdateHover(s,0,0,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const r of this._participants){if(!r.suggestHoverAnchor)continue;const s=r.suggestHoverAnchor(e);s&&t.push(s)}const i=e.target;switch(i.type){case 6:{t.push(new Hue(0,i.range,e.event.posx,e.event.posy));break}case 7:{const r=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<r))break;t.push(new Hue(0,i.range,e.event.posx,e.event.posy));break}}return t.sort((r,s)=>s.priority-r.priority),t}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!hne(t,e.x,e.y))&&this.hide()}startShowingAtRange(e,t,i,r){this._startShowingOrUpdateHover(new Hue(0,e,void 0,void 0),t,i,r,null)}async updateHoverVerbosityLevel(e,t,i){var r;(r=this._renderedContentHover)==null||r.updateHoverVerbosityLevel(e,t,i)}focusedHoverPartIndex(){var e;return((e=this._renderedContentHover)==null?void 0:e.focusedHoverPartIndex)??-1}containsNode(e){return e?this._contentHoverWidget.getDomNode().contains(e):!1}focus(){this._contentHoverWidget.focus()}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}getDomNode(){return this._contentHoverWidget.getDomNode()}get isColorPickerVisible(){var e;return((e=this._renderedContentHover)==null?void 0:e.isColorPickerVisible())??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};F0e=OLr([G$e(1,mi),G$e(2,Ws)],F0e);var MLr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Y$e=function(n,e){return function(t,i){e(t,i,n)}},B0e,HI;let Xd=(HI=class extends Ye{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._onHoverContentsChanged=this._register(new Ue),this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Et,this._hoverState={mouseDown:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new ao(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(B0e.ID)}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._shouldNotHideCurrentHoverWidget(e)&&this._hideWidgets()}_shouldNotHideCurrentHoverWidget(e){return this._isMouseOnContentHoverWidget(e)||this._isContentWidgetResizing()}_isMouseOnContentHoverWidget(e){var i;const t=(i=this._contentWidget)==null?void 0:i.getDomNode();return t?hne(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldNotHideCurrentHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=(o,a)=>{const l=this._isMouseOnContentHoverWidget(o);return a&&l},r=o=>{var c;const a=this._isMouseOnContentHoverWidget(o),l=((c=this._contentWidget)==null?void 0:c.isColorPickerVisible)??!1;return a&&l},s=(o,a)=>{var l,c,u,d;return(a&&((c=this._contentWidget)==null?void 0:c.containsNode((l=o.event.browserEvent.view)==null?void 0:l.document.activeElement))&&!((d=(u=o.event.browserEvent.view)==null?void 0:u.getSelection())!=null&&d.isCollapsed))??!1};return i(e,t)||r(e)||s(e,t)}_onEditorMouseMove(e){var a,l,c,u;if(this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._mouseMoveEvent=e,(a=this._contentWidget)!=null&&a.isFocused||(l=this._contentWidget)!=null&&l.isResizing))return;const t=this._hoverSettings.sticky;if(t&&((c=this._contentWidget)!=null&&c.isVisibleFromKeyboard))return;if(this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const r=this._hoverSettings.hidingDelay;if(((u=this._contentWidget)==null?void 0:u.isVisible)&&t&&r>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(r);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var l;if(!e)return;const i=(l=e.target.element)==null?void 0:l.classList.contains("colorpicker-color-decoration"),r=this._editor.getOption(149),s=this._hoverSettings.enabled,o=this._hoverState.activatedByDecoratorClick;if(i&&(r==="click"&&!o||r==="hover"&&!s||r==="clickAndHover"&&!s&&!o)||!i&&!s&&!o){this._hideWidgets();return}this._tryShowHoverWidget(e)||this._hideWidgets()}_tryShowHoverWidget(e){return this._getOrCreateContentWidget().showsOrWillShow(e)}_onKeyDown(e){var r;if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===1||t.kind===2&&(t.commandId===Kht||t.commandId===une||t.commandId===dne)&&((r=this._contentWidget)==null?void 0:r.isVisible);e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||i||this._hideWidgets()}_hideWidgets(){var e,t;this._hoverState.mouseDown&&((e=this._contentWidget)!=null&&e.isColorPickerVisible)||DM.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,(t=this._contentWidget)==null||t.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(F0e,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}showContentHover(e,t,i,r,s=!1){this._hoverState.activatedByDecoratorClick=s,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,r)}_isContentWidgetResizing(){var e;return((e=this._contentWidget)==null?void 0:e.widget.isResizing)||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){var e;(e=this._contentWidget)==null||e.focus()}scrollUp(){var e;(e=this._contentWidget)==null||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)==null||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)==null||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)==null||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)==null||e.pageUp()}pageDown(){var e;(e=this._contentWidget)==null||e.pageDown()}goToTop(){var e;(e=this._contentWidget)==null||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)==null||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)==null?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)==null?void 0:e.isVisible}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._contentWidget)==null||e.dispose()}},B0e=HI,HI.ID="editor.contrib.contentHover",HI);Xd=B0e=MLr([Y$e(1,mi),Y$e(2,Ws)],Xd);const VIe=class VIe extends Ye{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(149);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==$ht||!i.range)return;const r=this._editor.getContribution(Xd.ID);if(r&&!r.isColorPickerVisible){const s=new ie(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);r.showContentHover(s,1,0,!1,!0)}}};VIe.ID="editor.contrib.colorContribution";let HY=VIe;cs(HY.ID,HY,2);ZA.register(uB);var mft=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},qR=function(n,e){return function(t,i){e(t,i,n)}},$0e,H0e,VI;let oA=(VI=class extends Ye{constructor(e,t,i){super(),this._editor=e,this._instantiationService=i,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=me.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=me.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)==null||e.focus():this._standaloneColorPickerWidget=this._instantiationService.createInstance(V0e,this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)==null||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)==null||e.updateEditor(),this.hide()}static get(e){return e.getContribution($0e.ID)}},$0e=VI,VI.ID="editor.contrib.standaloneColorPickerController",VI);oA=$0e=mft([qR(1,Oi),qR(2,mi)],oA);cs(oA.ID,oA,1);const Q$e=8,jLr=22;var WI;let V0e=(WI=class extends Ye{constructor(e,t,i,r,s,o,a){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._keybindingService=s,this._languageFeaturesService=o,this._editorWorkerService=a,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new Ue),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(dB,this._editor),this._position=(d=this._editor._getViewModel())==null?void 0:d.getPrimaryCursorState().modelState.position;const l=this._editor.getSelection(),c=l?{startLineNumber:l.startLineNumber,startColumn:l.startColumn,endLineNumber:l.endLineNumber,endColumn:l.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},u=this._register($b(this._body));this._register(u.onDidBlur(f=>{this.hide()})),this._register(u.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 p=(g=f.target.element)==null?void 0:g.classList;p&&p.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(c),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return H0e.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()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new FLr(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new cB(this._editorWorkerService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),r=this._register(new RY(this._keybindingService)),s={fragment:i,statusBar:r,onContentsChanged:()=>{},hide:()=>this.hide()};this._colorHover=e;const o=this._standaloneColorPickerParticipant.renderHoverParts(s,[e]);if(!o)return;this._register(o.disposables);const a=o.colorPicker;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),a.layout();const l=a.body,c=l.saturationBox.domNode.clientWidth,u=l.domNode.clientWidth-c-jLr-Q$e,d=a.body.enterButton;d==null||d.onClicked(()=>{this.updateEditor(),this.hide()});const f=a.header,p=f.pickedColorNode;p.style.width=c+Q$e+"px";const g=f.originalColorNode;g.style.width=u+"px";const m=a.header.closeButton;m==null||m.onClicked(()=>{this.hide()}),t&&(d&&(d.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},H0e=WI,WI.ID="editor.contrib.standaloneColorPickerWidget",WI);V0e=H0e=mft([qR(3,mi),qR(4,Ws),qR(5,Fn),qR(6,Sf)],V0e);class FLr{constructor(e,t){this.value=e,this.foundInEditor=t}}class BLr extends Zb{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...$i("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:A({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:zn.CommandPalette}],metadata:{description:$i("showOrFocusStandaloneColorPickerDescription","Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){var i;(i=oA.get(t))==null||i.showOrFocus()}}class $Lr extends In{constructor(){super({id:"editor.action.hideColorPicker",label:A({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:me.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:$i("hideColorPickerDescription","Hide the standalone color picker.")}})}run(e,t){var i;(i=oA.get(t))==null||i.hide()}}class HLr extends In{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:A({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:me.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:$i("insertColorWithStandaloneColorPickerDescription","Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){var i;(i=oA.get(t))==null||i.insertColor()}}zt($Lr);zt(HLr);Ao(BLr);class KS{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,s=e.length;if(i+r>s)return!1;for(let o=0;o<r;o++){const a=e.charCodeAt(i+o),l=t.charCodeAt(o);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,s,o){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=s.getLineContent(a),f=s.getLineContent(c);let p=d.lastIndexOf(t,l-1+t.length),g=f.indexOf(i,u-1-i.length);if(p!==-1&&g!==-1)if(a===c)d.substring(p+t.length,g).indexOf(i)>=0&&(p=-1,g=-1);else{const _=d.substring(p+t.length),v=f.substring(0,g);(_.indexOf(i)>=0||v.indexOf(i)>=0)&&(p=-1,g=-1)}let m;p!==-1&&g!==-1?(r&&p+t.length<d.length&&d.charCodeAt(p+t.length)===32&&(t=t+" "),r&&g>0&&f.charCodeAt(g-1)===32&&(i=" "+i,g-=1),m=KS._createRemoveBlockCommentOperations(new ie(a,p+t.length+1,c,g+1),t,i)):(m=KS._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const _ of m)o.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){const r=[];return ie.isEmpty(e)?r.push(ma.delete(new ie(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(r.push(ma.delete(new ie(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(ma.delete(new ie(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),r}static _createAddBlockCommentOperations(e,t,i,r){const s=[];return ie.isEmpty(e)?s.push(ma.replace(new ie(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(ma.insert(new We(e.startLineNumber,e.startColumn),t+(r?" ":""))),s.push(ma.insert(new We(e.endLineNumber,e.endColumn),(r?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,r),o=this.languageConfigurationService.getLanguageConfiguration(s).comments;!o||!o.blockCommentStartToken||!o.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,o.blockCommentStartToken,o.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const r=i[0],s=i[1];return new Yn(r.range.endLineNumber,r.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const r=i[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new Yn(r.endLineNumber,r.endColumn+s,r.endLineNumber,r.endColumn+s)}}}class vC{constructor(e,t,i,r,s,o,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=r,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,r){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),o=r.getLanguageConfiguration(s).comments,a=o?o.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,s,o,a,l){let c=!0,u;e===0?u=!0:e===1?u=!1:u=!0;for(let d=0,f=r.length;d<f;d++){const p=r[d],g=s+d;if(g===s&&a){p.ignore=!0;continue}const m=i.getLineContent(g),_=Yd(m);if(_===-1){p.ignore=o,p.commentStrOffset=m.length;continue}if(c=!1,p.ignore=!1,p.commentStrOffset=_,u&&!KS._haystackHasNeedleAtOffset(m,p.commentStr,_)&&(e===0?u=!1:e===1||(p.ignore=!0)),u&&t){const v=_+p.commentStrLength;v<m.length&&m.charCodeAt(v)===32&&(p.commentStrLength+=1)}}if(e===0&&c){u=!1;for(let d=0,f=r.length;d<f;d++)r[d].ignore=!1}return{supported:!0,shouldRemoveComments:u,lines:r}}static _gatherPreflightData(e,t,i,r,s,o,a,l){const c=vC._gatherPreflightCommentStrings(i,r,s,l);return c===null?{supported:!1}:vC._analyzeLines(e,t,i,c,r,o,a,l)}_executeLineComments(e,t,i,r){let s;i.shouldRemoveComments?s=vC._createRemoveLineCommentsOperations(i.lines,r.startLineNumber):(vC._normalizeInsertionPoint(e,i.lines,r.startLineNumber,this._indentSize),s=this._createAddLineCommentsOperations(i.lines,r.startLineNumber));const o=new We(r.positionLineNumber,r.positionColumn);for(let a=0,l=s.length;a<l;a++)t.addEditOperation(s[a].range,s[a].text),ie.isEmpty(s[a].range)&&ie.getStartPosition(s[a].range).equals(o)&&e.getLineContent(o.lineNumber).length+1===o.column&&(this._deltaColumn=(s[a].text||"").length);this._selectionId=t.trackSelection(r)}_attemptRemoveBlockComment(e,t,i,r){let s=t.startLineNumber,o=t.endLineNumber;const a=r.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(s).lastIndexOf(i,a-1),c=e.getLineContent(o).indexOf(r,t.endColumn-1-i.length);return l!==-1&&c===-1&&(c=e.getLineContent(s).indexOf(r,l+i.length),o=s),l===-1&&c!==-1&&(l=e.getLineContent(o).lastIndexOf(i,c),s=o),t.isEmpty()&&(l===-1||c===-1)&&(l=e.getLineContent(s).indexOf(i),l!==-1&&(c=e.getLineContent(s).indexOf(r,l+i.length))),l!==-1&&e.getLineContent(s).charCodeAt(l+i.length)===32&&(i+=" "),c!==-1&&e.getLineContent(o).charCodeAt(c-1)===32&&(r=" "+r,c-=1),l!==-1&&c!==-1?KS._createRemoveBlockCommentOperations(new ie(s,l+i.length+1,o,c+1),i,r):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const r=e.getLanguageIdAtPosition(i.startLineNumber,1),s=this.languageConfigurationService.getLanguageConfiguration(r).comments;if(!s||!s.blockCommentStartToken||!s.blockCommentEndToken)return;const o=s.blockCommentStartToken,a=s.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,i,o,a);if(!l){if(i.isEmpty()){const c=e.getLineContent(i.startLineNumber);let u=Yd(c);u===-1&&(u=c.length),l=KS._createAddBlockCommentOperations(new ie(i.startLineNumber,u+1,i.startLineNumber,c.length+1),o,a,this._insertSpace)}else l=KS._createAddBlockCommentOperations(new ie(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),o,a,this._insertSpace);l.length===1&&(this._deltaColumn=o.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 ie(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=vC._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 Yn(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];o.ignore||i.push(ma.delete(new ie(t+r,o.commentStrOffset+1,t+r,o.commentStrOffset+o.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],r=this._insertSpace?" ":"";for(let s=0,o=e.length;s<o;s++){const a=e[s];a.ignore||i.push(ma.insert(new We(t+s,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 s=1073741824,o,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 f=0,p=t[l].commentStrOffset;d<s&&f<p;f++)d=vC.nextVisibleColumn(d,r,u.charCodeAt(f)===9,1);d<s&&(s=d)}s=Math.floor(s/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(o=0,a=t[l].commentStrOffset;d<s&&o<a;o++)d=vC.nextVisibleColumn(d,r,u.charCodeAt(o)===9,1);d>s?t[l].commentStrOffset=o-1:t[l].commentStrOffset=o}}}class uIe extends In{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(wa);if(!t.hasModel())return;const r=t.getModel(),s=[],o=r.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>ie.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)s.push(new vC(i,u.selection,o.indentSize,this._type,a.insertSpace,a.ignoreEmptyLines,u.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class VLr extends uIe{constructor(){super(0,{id:"editor.action.commentLine",label:A("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:zn.MenubarEditMenu,group:"5_insert",title:A({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class WLr extends uIe{constructor(){super(1,{id:"editor.action.addCommentLine",label:A("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2081),weight:100}})}}class zLr extends uIe{constructor(){super(2,{id:"editor.action.removeCommentLine",label:A("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2099),weight:100}})}}class ULr extends In{constructor(){super({id:"editor.action.blockComment",label:A("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:zn.MenubarEditMenu,group:"5_insert",title:A({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(wa);if(!t.hasModel())return;const r=t.getOption(23),s=[],o=t.getSelections();for(const a of o)s.push(new KS(a,r.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}zt(VLr);zt(WLr);zt(zLr);zt(ULr);var qLr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},qT=function(n,e){return function(t,i){e(t,i,n)}},W0e,zI;let PM=(zI=class{static get(e){return e.getContribution(W0e.ID)}constructor(e,t,i,r,s,o,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=r,this._keybindingService=s,this._menuService=o,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new Et,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&&$L(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.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],r=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const s of r){const[,o]=s;let a=0;for(const l of o)if(l instanceof RP){const c=this._getMenuActions(e,l.item.submenu);c.length>0&&(i.push(new oM(l.id,l.label,c)),a++)}else i.push(l),a++;a&&i.push(new Ac)}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 o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=al(this._editor.getDomNode()),l=a.left+o.left,c=a.top+o.top+o.height;r={x:l,y:c}}const s=this._editor.getOption(128)&&!Fb;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>e,getActionViewItem:o=>{const a=this._keybindingFor(o);if(a)return new yM(o,o,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=o;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new yM(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||rmr(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(73);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}),s=(c,u)=>new oM(`menu-action-${++i}`,c,u,void 0),o=(c,u,d,f,p)=>{if(!u)return r({label:c,enabled:u,run:()=>{}});const g=_=>()=>{this._configurationService.updateValue(d,_)},m=[];for(const _ of p)m.push(r({label:_.label,checked:f===_.value,run:g(_.value)}));return s(c,m)},a=[];a.push(r({label:A("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Ac),a.push(r({label:A("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(o(A("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:A("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:A("context.minimap.size.fill","Fill"),value:"fill"},{label:A("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(o(A("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:A("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:A("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(128)&&!Fb;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()}},W0e=zI,zI.ID="editor.contrib.contextmenu",zI);PM=W0e=qLr([qT(1,up),qT(2,Zw),qT(3,Oi),qT(4,Ws),qT(5,Eg),qT(6,Dr),qT(7,qL)],PM);class KLr extends In{constructor(){super({id:"editor.action.showContextMenu",label:A("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:me.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=PM.get(t))==null||i.showContextMenu()}}cs(PM.ID,PM,2);zt(KLr);class Wue{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 zue{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}const kX=class kX extends Ye{static get(e){return e.getContribution(kX.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 Wue(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new zue(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 zue(new Wue(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 zue(new Wue(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}};kX.ID="editor.contrib.cursorUndoRedoController";let OM=kX;class GLr extends In{constructor(){super({id:"cursorUndo",label:A("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:me.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var r;(r=OM.get(t))==null||r.cursorUndo()}}class YLr extends In{constructor(){super({id:"cursorRedo",label:A("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var r;(r=OM.get(t))==null||r.cursorRedo()}}cs(OM.ID,OM,0);zt(GLr);zt(YLr);class QLr{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 ie(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 Yn(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 Yn(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 Yn(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 Yn(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 Yn(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 WD(n){return zr?n.altKey:n.ctrlKey}const pS=class pS extends Ye{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)||(WD(e)&&(this._modifierPressed=!0),this._mouseDown&&WD(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(WD(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===pS.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(s=>t.position&&s.containsPosition(t.position));if(r.length===1)this._dragSelection=r[0];else return}WD(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 We(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:s,selectionStartColumn:o}=r;i=[new Yn(s,o,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new Yn(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(WD(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(pS.ID,new QLr(this._dragSelection,t,WD(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 ie(e.lineNumber,e.column,e.lineNumber,e.column),options:pS._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()}};pS.ID="editor.contrib.dragAndDrop",pS.TRIGGER_KEY_VALUE=zr?6:5,pS._DECORATION_OPTIONS=ur.register({description:"dnd-target",className:"dnd-target"});let VY=pS;cs(VY.ID,VY,2);cs(jw.ID,jw,0);i3(r0e);gn(new class extends pc{constructor(){super({id:bht,precondition:Q2e,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e){var t;return(t=jw.get(e))==null?void 0:t.changePasteType()}});gn(new class extends pc{constructor(){super({id:"editor.hidePasteWidget",precondition:Q2e,kbOpts:{weight:100,primary:9}})}runEditorCommand(n,e){var t;(t=jw.get(e))==null||t.clearWidgets()}});var UI;zt((UI=class extends In{constructor(){super({id:"editor.action.pasteAs",label:A("pasteAs","Paste As..."),alias:"Paste As...",precondition:me.writable,metadata:{description:"Paste as",args:[{name:"args",schema:UI.argsSchema}]}})}run(e,t,i){var s;let r=typeof(i==null?void 0:i.kind)=="string"?i.kind:void 0;return!r&&i&&(r=typeof i.id=="string"?i.id:void 0),(s=jw.get(t))==null?void 0:s.pasteAs(r?new ha(r):void 0)}},UI.argsSchema={type:"object",properties:{kind:{type:"string",description:A("pasteAs.kind","The kind of the paste edit to try applying. If not provided or there are multiple edits for this kind, the editor will show a picker.")}}},UI));zt(class extends In{constructor(){super({id:"editor.action.pasteAsText",label:A("pasteAsText","Paste as Text"),alias:"Paste as Text",precondition:me.writable})}run(n,e){var t;return(t=jw.get(e))==null?void 0:t.pasteAs({providerId:JL.id})}});class XLr{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 X$e{constructor(e){this.identifier=e}}const _ft=Ur("treeViewsDndService");ns(_ft,XLr,1);var ZLr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},FW=function(n,e){return function(t,i){e(t,i,n)}},z0e;const vft="editor.experimental.dropIntoEditor.defaultProvider",bft="editor.changeDropType",dIe=new yn("dropWidgetVisible",!1,A("dropWidgetVisible","Whether the drop widget is showing"));var qI;let MM=(qI=class extends Ye{static get(e){return e.getContribution(z0e.ID)}constructor(e,t,i,r,s){super(),this._configService=i,this._languageFeaturesService=r,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=n0e.getInstance(),this._dropProgressManager=this._register(t.createInstance(LY,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(NY,"dropIntoEditor",e,dIe,{id:bft,label:A("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(o=>this.onDropIntoEditor(e,o.position,o.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){var s;if(!i.dataTransfer||!e.hasModel())return;(s=this._currentOperation)==null||s.cancel(),e.focus(),e.setPosition(t);const r=Ic(async o=>{const a=new Et,l=a.add(new ak(e,1,void 0,o));try{const c=await this.extractDataTransferData(i);if(c.size===0||l.token.isCancellationRequested)return;const u=e.getModel();if(!u)return;const d=this._languageFeaturesService.documentDropEditProvider.ordered(u).filter(p=>p.dropMimeTypes?p.dropMimeTypes.some(g=>c.matches(g)):!0),f=a.add(await this.getDropEdits(d,u,t,c,l));if(l.token.isCancellationRequested)return;if(f.edits.length){const p=this.getInitialActiveEditIndex(u,f.edits),g=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([ie.fromPositions(t)],{activeEditIndex:p,allEdits:f.edits},g,async m=>m,o)}}finally{a.dispose(),this._currentOperation===r&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,A("dropIntoEditorProgress","Running drop handlers. Click to cancel"),r,{cancel:()=>r.cancel()}),this._currentOperation=r}async getDropEdits(e,t,i,r,s){const o=new Et,a=await K9(Promise.all(e.map(async c=>{try{const u=await c.provideDocumentDropEdits(t,i,r,s.token);return u&&o.add(u),u==null?void 0:u.edits.map(d=>({...d,providerId:c.id}))}catch(u){console.error(u)}})),s.token),l=iv(a??[]).flat();return{edits:_ht(l),dispose:()=>o.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(vft,{resource:e.uri});for(const[r,s]of Object.entries(i)){const o=new ha(s),a=t.findIndex(l=>o.value===l.providerId&&l.handledMimeType&&cht(r,[l.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new lht;const t=hht(e.dataTransfer);if(this.treeItemsTransfer.hasData(X$e.prototype)){const i=this.treeItemsTransfer.getData(X$e.prototype);if(Array.isArray(i))for(const r of i){const s=await this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);if(s)for(const[o,a]of s)t.replace(o,a)}}return t}},z0e=qI,qI.ID="editor.contrib.dropIntoEditorController",qI);MM=z0e=ZLr([FW(1,mi),FW(2,Dr),FW(3,Fn),FW(4,_ft)],MM);cs(MM.ID,MM,2);i3(i0e);gn(new class extends pc{constructor(){super({id:bft,precondition:dIe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=MM.get(e))==null||i.changeDropType()}});gn(new class extends pc{constructor(){super({id:"editor.hideDropWidget",precondition:dIe,kbOpts:{weight:100,primary:9}})}runEditorCommand(n,e,t){var i;(i=MM.get(e))==null||i.clearWidgets()}});Ca.as(bv.Configuration).registerConfiguration({...n$,properties:{[vft]:{type:"object",scope:5,description:A("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const Dd=class Dd{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===Dd._FIND_MATCH_DECORATION||r===Dd._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let r=0,s=this._decorations.length;r<s;r++){const o=this._editor.getModel().getDecorationRange(this._decorations[r]);if(e.equalsRange(o)){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,Dd._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,Dd._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let s=this._editor.getModel().getDecorationRange(t);if(s.startLineNumber!==s.endLineNumber&&s.endColumn===1){const o=s.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(o);s=new ie(s.startLineNumber,s.startColumn,o,a)}this._rangeHighlightDecorationId=r.addDecoration(s,Dd._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let r=Dd._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){r=Dd._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,f=e[0].range.endLineNumber;for(let p=1,g=e.length;p<g;p++){const m=e[p].range;f+u>=m.startLineNumber?m.endLineNumber>f&&(f=m.endLineNumber):(s.push({range:new ie(d,1,f,1),options:Dd._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=m.startLineNumber,f=m.endLineNumber)}s.push({range:new ie(d,1,f,1),options:Dd._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const o=new Array(e.length);for(let a=0,l=e.length;a<l;a++)o[a]={range:e[a].range,options:r};this._decorations=i.deltaDecorations(this._decorations,o),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,s),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,Dd._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],s=this._editor.getModel().getDecorationRange(r);if(!(!s||s.startLineNumber<e.lineNumber)){if(s.startLineNumber>e.lineNumber)return s;if(!(s.startColumn<e.column))return s}}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}};Dd._CURRENT_FIND_MATCH_DECORATION=ur.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",inlineClassName:"currentFindMatchInline",showIfCollapsed:!0,overviewRuler:{color:Ga($ce),position:ug.Center},minimap:{color:Ga(__e),position:1}}),Dd._FIND_MATCH_DECORATION=ur.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",inlineClassName:"findMatchInline",showIfCollapsed:!0,overviewRuler:{color:Ga($ce),position:ug.Center},minimap:{color:Ga(__e),position:1}}),Dd._FIND_MATCH_NO_OVERVIEW_DECORATION=ur.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0}),Dd._FIND_MATCH_ONLY_OVERVIEW_DECORATION=ur.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:Ga($ce),position:ug.Center}}),Dd._RANGE_HIGHLIGHT_DECORATION=ur.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0}),Dd._FIND_SCOPE_DECORATION=ur.register({description:"find-scope",className:"findScope",isWholeLine:!0});let U0e=Dd;class JLr{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 o=0;o<this._ranges.length;o++)i.push({range:this._ranges[o],text:this._replaceStrings[o]});i.sort((o,a)=>ie.compareRangesUsingStarts(o.range,a.range));const r=[];let s=i[0];for(let o=1;o<i.length;o++)s.range.endLineNumber===i[o].range.startLineNumber&&s.range.endColumn===i[o].range.startColumn?(s.range=s.range.plusRange(i[o].range),s.text=s.text+i[o].text):(r.push(s),s=i[o]);r.push(s);for(const o of r)t.addEditOperation(o.range,o.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function yft(n,e){if(n&&n[0]!==""){const t=Z$e(n,e,"-"),i=Z$e(n,e,"_");return t&&!i?J$e(n,e,"-"):!t&&i?J$e(n,e,"_"):n[0].toUpperCase()===n[0]?e.toUpperCase():n[0].toLowerCase()===n[0]?e.toLowerCase():har(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 Z$e(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function J$e(n,e,t){const i=e.split(t),r=n[0].split(t);let s="";return i.forEach((o,a)=>{s+=yft([r[a]],o)+t}),s.slice(0,-1)}class eHe{constructor(e){this.staticValue=e,this.kind=0}}class eAr{constructor(e){this.pieces=e,this.kind=1}}class jM{static fromStaticValue(e){return new jM([vI.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new eHe(""):e.length===1&&e[0].staticValue!==null?this._state=new eHe(e[0].staticValue):this._state=new eAr(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?yft(e,this._state.staticValue):this._state.staticValue;let i="";for(let r=0,s=this._state.pieces.length;r<s;r++){const o=this._state.pieces[r];if(o.staticValue!==null){i+=o.staticValue;continue}let a=jM._substitute(o.matchIndex,e);if(o.caseOps!==null&&o.caseOps.length>0){const l=[],c=o.caseOps.length;let u=0;for(let d=0,f=a.length;d<f;d++){if(u>=c){l.push(a.slice(d));break}switch(o.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 vI{static staticValue(e){return new vI(e,-1,null)}static caseOps(e,t){return new vI(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 tAr{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++]=vI.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=vI.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=vI.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new jM(this._result)}}function nAr(n){if(!n||n.length===0)return new jM(null);const e=[],t=new tAr(n);for(let i=0,r=n.length;i<r;i++){const s=n.charCodeAt(i);if(s===92){if(i++,i>=r)break;const o=n.charCodeAt(i);switch(o){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(o));break}continue}if(s===36){if(i++,i>=r)break;const o=n.charCodeAt(i);if(o===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(o===48||o===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=o&&o<=57){let a=o-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 nx=new yn("findWidgetVisible",!1);nx.toNegated();const _ne=new yn("findInputFocussed",!1),hIe=new yn("replaceInputFocussed",!1),BW={primary:545,mac:{primary:2593}},$W={primary:565,mac:{primary:2613}},HW={primary:560,mac:{primary:2608}},VW={primary:554,mac:{primary:2602}},WW={primary:558,mac:{primary:2606}},zo={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"},GS=19999,iAr=240;class k6{constructor(e,t){this._toDispose=new Et,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new vv,this._decorations=new U0e(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new ao(()=>{if(this._editor.hasModel())return 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,vo(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)},iAr)):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 ie(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const r=this._findMatches(i,!1,GS);this._decorations.set(r,i);const s=this._editor.getSelection();let o=this._decorations.getCurrentMatchesPosition(s);if(o===0&&r.length>0){const a=p7(r.map(l=>l.range),l=>ie.compareRangesUsingStarts(l,s)>=0);o=a>0?a-1+1:o}this._state.changeMatchInfo(o,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 s=this._editor.getModel();return t||r===1?(i===1?i=s.getLineCount():i--,r=s.getLineMaxColumn(i)):r--,new We(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()<GS){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=k6._getSearchRange(this._editor.getModel(),i);r.getEndPosition().isBefore(e)&&(e=r.getEndPosition()),e.isBefore(r.getStartPosition())&&(e=r.getEndPosition());const{lineNumber:s,column:o}=e,a=this._editor.getModel();let l=new We(s,o),c=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):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(132):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 s=this._editor.getModel();return t||r===s.getLineMaxColumn(i)?(i===s.getLineCount()?i=1:i++,r=1):r++,new We(i,r)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()<GS){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 s=this._decorations.getFindScope(),o=k6._getSearchRange(this._editor.getModel(),s);o.getEndPosition().isBefore(e)&&(e=o.getStartPosition()),e.isBefore(o.getStartPosition())&&(e=o.getStartPosition());const{lineNumber:a,column:l}=e,c=this._editor.getModel();let u=new We(a,l),d=c.findNextMatch(this._state.searchString,u,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):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(132):null,t)),d?!r&&!o.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?nAr(this._state.replaceString):jM.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),s=new Bu(t,r);this._executeEditorCommand("replace",s),this._decorations.setStartPosition(new We(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(s=>k6._getSearchRange(this._editor.getModel(),s));return this._editor.getModel().findMatches(this._state.searchString,r,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=GS?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new r2(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):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(),s=r.getValue(1),o=r.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=s.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=s.replace(i,a.buildReplaceString(null,c));const u=new c2e(o,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 o=0,a=i.length;o<a;o++)r[o]=t.buildReplaceString(i[o].matches,this._state.preserveCase);const s=new JLr(this._editor.getSelection(),i.map(o=>o.range),r);this._executeEditorCommand("replaceAll",s)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(s=>new Yn(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn));const r=this._editor.getSelection();for(let s=0,o=i.length;s<o;s++)if(i[s].equalsRange(r)){i=[r].concat(i.slice(0,s)).concat(i.slice(s+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}}}const TX=class TX extends Tg{constructor(e,t,i){super(),this._hideSoon=this._register(new ao(()=>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:kn(Cte),inputActiveOptionForeground:kn(wte),inputActiveOptionBackground:kn(X9)},s=this._register(bM());this.caseSensitive=this._register(new Uct({appendTitle:this._keybindingLabelFor(zo.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:s,...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 qct({appendTitle:this._keybindingLabelFor(zo.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:s,...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 Kct({appendTitle:this._keybindingLabelFor(zo.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:s,...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 a=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(_t(this._domNode,Xt.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(_t(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 TX.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")}};TX.ID="editor.contrib.findOptionsWidget";let q0e=TX;function zW(n,e){return n===1?!0:n===2?!1:e}class rAr extends Ye{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return zW(this._isRegexOverride,this._isRegex)}get wholeWord(){return zW(this._wholeWordOverride,this._wholeWord)}get matchCase(){return zW(this._matchCaseOverride,this._matchCase)}get preserveCase(){return zW(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 Ue),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 s=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,r.matchesPosition=!0,s=!0),this._matchesCount!==t&&(this._matchesCount=t,r.matchesCount=!0,s=!0),typeof i<"u"&&(ie.equalsRange(this._currentMatch,i)||(this._currentMatch=i,r.currentMatch=!0,s=!0)),s&&this._onFindReplaceStateChange.fire(r)}change(e,t,i=!0){var u;const r={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 o=this.isRegex,a=this.wholeWord,l=this.matchCase,c=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,r.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,r.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,r.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,r.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"&&((u=e.searchScope)!=null&&u.every(d=>{var f;return(f=this._searchScope)==null?void 0:f.some(p=>!ie.equalsRange(p,d))})||(this._searchScope=e.searchScope,r.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,r.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,r.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,r.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,o!==this.isRegex&&(s=!0,r.isRegex=!0),a!==this.wholeWord&&(s=!0,r.wholeWord=!0),l!==this.matchCase&&(s=!0,r.matchCase=!0),c!==this.preserveCase&&(s=!0,r.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(r)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=GS}}const sAr=A("defaultLabel","input"),oAr=A("label.preserveCaseToggle","Preserve Case");class aAr extends J4{constructor(e){super({icon:Yt.preserveCase,title:oAr+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??jh("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class lAr extends Tg{constructor(e,t,i,r){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new Ue),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new Ue),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new Ue),this._onInput=this._register(new Ue),this._onKeyUp=this._register(new Ue),this._onPreserveCaseKeyDown=this._register(new Ue),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||sAr;const s=r.appendPreserveCaseLabel||"",o=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 Gct(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:o,showHistoryHint:r.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:r.inputBoxStyles})),this.preserveCase=this._register(new aAr({appendTitle:s,isChecked:!1,...r.toggleStyles})),this._register(this.preserveCase.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(f=>{this._onPreserveCaseKeyDown.fire(f)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const u=[this.preserveCase.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(15)||f.equals(17)||f.equals(9)){const p=u.indexOf(this.domNode.ownerDocument.activeElement);if(p>=0){let g=-1;f.equals(17)?g=(p+1)%u.length:f.equals(15)&&(p===0?g=u.length-1:g=p-1),f.equals(9)?(u[p].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),Jr.stop(f,!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,f=>this._onKeyDown.fire(f)),this.onkeyup(this.inputBox.inputElement,f=>this._onKeyUp.fire(f)),this.oninput(this.inputBox.inputElement,f=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,f=>this._onMouseDown.fire(f))}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.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var Cft=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},wft=function(n,e){return function(t,i){e(t,i,n)}};const fIe=new yn("suggestWidgetVisible",!1,A("suggestWidgetVisible","Whether suggestion are visible")),pIe="historyNavigationWidgetFocus",xft="historyNavigationForwardsEnabled",Sft="historyNavigationBackwardsEnabled";let pw;const UW=[];function Eft(n,e){if(UW.includes(e))throw new Error("Cannot register the same widget multiple times");UW.push(e);const t=new Et,i=new yn(pIe,!1).bindTo(n),r=new yn(xft,!0).bindTo(n),s=new yn(Sft,!0).bindTo(n),o=()=>{i.set(!0),pw=e},a=()=>{i.set(!1),pw===e&&(pw=void 0)};return ete(e.element)&&o(),t.add(e.onDidFocus(()=>o())),t.add(e.onDidBlur(()=>a())),t.add(gi(()=>{UW.splice(UW.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:s,dispose(){t.dispose()}}}let K0e=class extends Yct{constructor(e,t,i,r){super(e,t,i);const s=this._register(r.createScoped(this.inputBox.element));this._register(Eft(s,this.inputBox))}};K0e=Cft([wft(3,Oi)],K0e);let G0e=class extends lAr{constructor(e,t,i,r,s=!1){super(e,t,s,i);const o=this._register(r.createScoped(this.inputBox.element));this._register(Eft(o,this.inputBox))}};G0e=Cft([wft(3,Oi)],G0e);Rh.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:It.and(It.has(pIe),It.equals(Sft,!0),It.not("isComposing"),fIe.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{pw==null||pw.showPreviousValue()}});Rh.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:It.and(It.has(pIe),It.equals(xft,!0),It.not("isComposing"),fIe.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{pw==null||pw.showNextValue()}});function tHe(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))==null?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))==null?void 0:t.getElectronAccelerator())==="Down"}const nHe=Zo("find-collapsed",Yt.chevronRight,A("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),iHe=Zo("find-expanded",Yt.chevronDown,A("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),cAr=Zo("find-selection",Yt.selection,A("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),uAr=Zo("find-replace",Yt.replace,A("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),dAr=Zo("find-replace-all",Yt.replaceAll,A("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),hAr=Zo("find-previous-match",Yt.arrowUp,A("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),fAr=Zo("find-next-match",Yt.arrowDown,A("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),pAr=A("label.findDialog","Find / Replace"),gAr=A("label.find","Find"),mAr=A("placeholder.find","Find"),_Ar=A("label.previousMatchButton","Previous Match"),vAr=A("label.nextMatchButton","Next Match"),bAr=A("label.toggleSelectionFind","Find in Selection"),yAr=A("label.closeButton","Close"),CAr=A("label.replace","Replace"),wAr=A("placeholder.replace","Replace"),xAr=A("label.replaceButton","Replace"),SAr=A("label.replaceAllButton","Replace All"),EAr=A("label.toggleReplaceButton","Toggle Replace"),kAr=A("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",GS),TAr=A("label.matchesLocation","{0} of {1}"),rHe=A("label.noResults","No results"),O0=419,IAr=275,LAr=IAr-54;let Ij=69;const AAr=33,sHe="ctrlEnterReplaceAll.windows.donotask",oHe=zr?256:2048;class Uue{constructor(e){this.afterLineNumber=e,this.heightInPx=AAr,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function aHe(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function lHe(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEnd<t.value.length){n.stopPropagation();return}}const IX=class IX extends Tg{constructor(e,t,i,r,s,o,a,l,c,u){super(),this._hoverService=u,this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=r,this._keybindingService=s,this._contextKeyService=o,this._storageService=l,this._notificationService=c,this._ctrlEnterReplaceAllWarningPrompted=!!l.getBoolean(sHe,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new Rm(500),this._register(gi(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(92)&&(this._codeEditor.getOption(92)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(146)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(41)){const f=this._codeEditor.getOption(41).loop;this._state.change({loop:f},!1);const p=this._codeEditor.getOption(41).addExtraSpaceOnTop;p&&!this._viewZone&&(this._viewZone=new Uue(0),this._showViewZone()),!p&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const d=await this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}})),this._findInputFocused=_ne.bindTo(o),this._findFocusTracker=this._register($b(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=hIe.bindTo(o),this._replaceFocusTracker=this._register($b(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 Uue(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return IX.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(92)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=Vf(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,tr)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){var t;this._matchesCount.style.minWidth=Ij+"px",this._state.matchesCount>=GS?this._matchesCount.title=kAr:this._matchesCount.title="",(t=this._matchesCount.firstChild)==null||t.remove();let e;if(this._state.matchesCount>0){let i=String(this._state.matchesCount);this._state.matchesCount>=GS&&(i+="+");let r=String(this._state.matchesPosition);r==="0"&&(r="?"),e=jL(TAr,r,i)}else e=rHe;this._matchesCount.appendChild(document.createTextNode(e)),Ph(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),Ij=Math.max(Ij,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===rHe)return i===""?A("ariaSearchNoResultEmpty","{0} found",e):A("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const r=A("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),s=this._codeEditor.getModel();return s&&t.startLineNumber<=s.getLineCount()&&t.startLineNumber>=1?`${s.getLineContent(t.startLineNumber)}, ${r}`:r}return A("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(92);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=al(i),s=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),o=r.left+(s?s.left:0),a=s?s.top:0;if(this._viewZone&&a<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const l=Got(this._domNode).left;o>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 Uue(0));const i=this._viewZone;this._codeEditor.changeViewZones(r=>{if(this._viewZoneId!==void 0){const s=this._getHeight();if(s===i.heightInPx)return;const o=s-i.heightInPx;i.heightInPx=s,r.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o);return}else{let s=this._getHeight();if(s-=this._codeEditor.getOption(84).top,s<=0)return;i.heightInPx=s,this._viewZoneId=r.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s)}})}_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||!this._domNode.isConnected)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 s=!1,o=!1,a=!1;if(this._resized&&Vf(this._domNode)>O0){this._domNode.style.maxWidth=`${i-28-r-15}px`,this._replaceInput.width=Vf(this._findInput.domNode);return}if(O0+28+r>=i&&(o=!0),O0+28+r-Ij>=i&&(a=!0),O0+28+r-Ij>=i+50&&(s=!0),this._domNode.classList.toggle("collapsed-find-widget",s),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",o),!a&&!s&&(this._domNode.style.maxWidth=`${i-28-r-15}px`),this._findInput.layout({collapsedFindWidget:s,narrowFindWidget:a,reducedFindWidget:o}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=Vf(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&&!ie.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(oHe|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 aHe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return lHe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(oHe|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Wu&&qy&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(A("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(sHe,!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 aHe(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return lHe(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 K0e(null,this._contextViewProvider,{width:LAr,label:gAr,placeholder:mAr,appendCaseSensitiveLabel:this._keybindingLabelFor(zo.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(zo.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(zo.ToggleRegexCommand),validation:u=>{if(u.length===0||!this._findInput.getRegex())return null;try{return new RegExp(u,"gu"),null}catch(d){return{content:d.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>tHe(this._keybindingService),inputBoxStyles:SG,toggleStyles:xG},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(u=>this._onFindInputKeyDown(u))),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(u=>{u.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),u.preventDefault())})),this._register(this._findInput.onRegexKeyDown(u=>{u.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),u.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(u=>{this._tryUpdateHeight()&&this._showViewZone()})),Nh&&this._register(this._findInput.onMouseDown(u=>this._onFindInputMouseDown(u))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(bM());this._prevBtn=this._register(new zD({label:_Ar+this._keybindingLabelFor(zo.PreviousMatchFindAction),icon:hAr,hoverDelegate:i,onTrigger:()=>{MS(this._codeEditor.getAction(zo.PreviousMatchFindAction)).run().then(void 0,tr)}},this._hoverService)),this._nextBtn=this._register(new zD({label:vAr+this._keybindingLabelFor(zo.NextMatchFindAction),icon:fAr,hoverDelegate:i,onTrigger:()=>{MS(this._codeEditor.getAction(zo.NextMatchFindAction)).run().then(void 0,tr)}},this._hoverService));const r=document.createElement("div");r.className="find-part",r.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",r.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new J4({icon:cAr,title:bAr+this._keybindingLabelFor(zo.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:kn(X9),inputActiveOptionBorder:kn(Cte),inputActiveOptionForeground:kn(wte)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let u=this._codeEditor.getSelections();u=u.map(d=>(d.endColumn===1&&d.endLineNumber>d.startLineNumber&&(d=d.setEndPosition(d.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(d.endLineNumber-1))),d.isEmpty()?null:d)).filter(d=>!!d),u.length&&this._state.change({searchScope:u},!0)}}else this._state.change({searchScope:null},!0)})),s.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new zD({label:yAr+this._keybindingLabelFor(zo.CloseFindWidgetCommand),icon:Eut,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:u=>{u.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),u.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new G0e(null,void 0,{label:CAr,placeholder:wAr,appendPreserveCaseLabel:this._keybindingLabelFor(zo.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>tHe(this._keybindingService),inputBoxStyles:SG,toggleStyles:xG},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(u=>this._onReplaceInputKeyDown(u))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(u=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(u=>{u.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(),u.preventDefault())}));const o=this._register(bM());this._replaceBtn=this._register(new zD({label:xAr+this._keybindingLabelFor(zo.ReplaceOneAction),icon:uAr,hoverDelegate:o,onTrigger:()=>{this._controller.replace()},onKeyDown:u=>{u.equals(1026)&&(this._closeBtn.focus(),u.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new zD({label:SAr+this._keybindingLabelFor(zo.ReplaceAllAction),icon:dAr,hoverDelegate:o,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const l=document.createElement("div");l.className="replace-actions",a.appendChild(l),l.appendChild(this._replaceBtn.domNode),l.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new zD({label:EAr,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Vf(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),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=pAr,this._domNode.role="dialog",this._domNode.style.width=`${O0}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(r),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new td(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let c=O0;this._register(this._resizeSash.onDidStart(()=>{c=Vf(this._domNode)})),this._register(this._resizeSash.onDidChange(u=>{this._resized=!0;const d=c+u.startX-u.currentX;if(d<O0)return;const f=parseFloat(Jee(this._domNode).maxWidth)||0;d>f||(this._domNode.style.width=`${d}px`,this._isReplaceVisible&&(this._replaceInput.width=Vf(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const u=Vf(this._domNode);if(u<O0)return;let d=O0;if(!this._resized||u===O0){const f=this._codeEditor.getLayoutInfo();d=f.width-28-f.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${d}px`,this._isReplaceVisible&&(this._replaceInput.width=Vf(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}};IX.ID="editor.contrib.findWidget";let Y0e=IX;class zD extends Tg{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+Ni.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupManagedHover(e.hoverDelegate??jh("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,r=>{this._opts.onTrigger(),r.preventDefault()}),this.onkeydown(this._domNode,r=>{var s,o;if(r.equals(10)||r.equals(3)){this._opts.onTrigger(),r.preventDefault();return}(o=(s=this._opts).onKeyDown)==null||o.call(s,r)})}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(...Ni.asClassNameArray(nHe)),this._domNode.classList.add(...Ni.asClassNameArray(iHe))):(this._domNode.classList.remove(...Ni.asClassNameArray(iHe)),this._domNode.classList.add(...Ni.asClassNameArray(nHe)))}}Gm((n,e)=>{const t=n.getColor(BS);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Ab(n.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=n.getColor(mhr);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Ab(n.type)?"dashed":"solid"} ${i}; }`);const r=n.getColor(ls);r&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${r}; }`);const s=n.getColor(phr);s&&e.addRule(`.monaco-editor .findMatchInline { color: ${s}; }`);const o=n.getColor(ghr);o&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${o}; }`)});var kft=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},tm=function(n,e){return function(t,i){e(t,i,n)}},Q0e;const NAr=524288;function X0e(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)<NAr)return n.getModel().getValueInRange(i)}return null}var KI;let pf=(KI=class extends Ye{get editor(){return this._editor}static get(e){return e.getContribution(Q0e.ID)}constructor(e,t,i,r,s,o){super(),this._editor=e,this._findWidgetVisible=nx.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=r,this._notificationService=s,this._hoverService=o,this._updateHistoryDelayer=new Rm(500),this._state=this._register(new rAr),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(a=>this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=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),a&&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!!_ne.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=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=mg(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const r=X0e(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);r&&(this._state.isRegex?i.searchString=mg(r):i.searchString=r)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const r=X0e(this._editor,e.seedSearchStringFromSelection);r&&(i.searchString=r)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const r=await 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(s=>!s.isEmpty())&&(i.searchScope=r)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new k6(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.isTooLargeForHeapOperation()?(this._notificationService.warn(A("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}async getGlobalBufferTerm(){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)}},Q0e=KI,KI.ID="editor.contrib.findController",KI);pf=Q0e=kft([tm(1,Oi),tm(2,yv),tm(3,tx),tm(4,wl),tm(5,C1)],pf);let Z0e=class extends pf{constructor(e,t,i,r,s,o,a,l,c){super(e,i,a,l,o,c),this._contextViewService=t,this._keybindingService=r,this._themeService=s,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let r=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":r=!0;break;case"never":r=!1;break;case"multiline":{r=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||r,await super._start(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 Y0e(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new q0e(this._editor,this._state,this._keybindingService))}};Z0e=kft([tm(1,Zw),tm(2,Oi),tm(3,Ws),tm(4,mc),tm(5,wl),tm(6,yv),tm(7,tx),tm(8,C1)],Z0e);const DAr=dat(new uat({id:zo.StartFindAction,label:A("startFindAction","Find"),alias:"Find",precondition:It.or(me.focus,It.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:zn.MenubarEditMenu,group:"3_find",title:A({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));DAr.addImplementation(0,(n,e,t)=>{const i=pf.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 RAr={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"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class PAr extends In{constructor(){super({id:zo.StartFindWithArgs,label:A("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:RAr})}async run(e,t,i){const r=pf.get(t);if(r){const s=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await 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},s),r.setGlobalBufferTerm(r.getState().searchString)}}}class OAr extends In{constructor(){super({id:zo.StartFindWithSelection,label:A("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=pf.get(t);i&&(await 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 Tft extends In{async run(e,t){const i=pf.get(t);i&&!this._run(i)&&(await 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 MAr extends Tft{constructor(){super({id:zo.NextMatchFindAction,label:A("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:me.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:It.and(me.focus,_ne),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class jAr extends Tft{constructor(){super({id:zo.PreviousMatchFindAction,label:A("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:me.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:It.and(me.focus,_ne),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class FAr extends In{constructor(){super({id:zo.GoToMatchFindAction,label:A("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:nx}),this._highlightDecorations=[]}run(e,t,i){const r=pf.get(t);if(!r)return;const s=r.getState().matchesCount;if(s<1){e.get(wl).notify({severity:gte.Warning,message:A("findMatchAction.noResults","No matches. Try searching for something else.")});return}const o=e.get(Ym),a=new Et,l=a.add(o.createInputBox());l.placeholder=A("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",s);const c=d=>{const f=parseInt(d);if(isNaN(f))return;const p=r.getState().matchesCount;if(f>0&&f<=p)return f-1;if(f<0&&f>=-p)return p+f},u=d=>{const f=c(d);if(typeof f=="number"){l.validationMessage=void 0,r.goToMatch(f);const p=r.getState().currentMatch;p&&this.addDecorations(t,p)}else l.validationMessage=A("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount),this.clearDecorations(t)};a.add(l.onDidChangeValue(d=>{u(d)})),a.add(l.onDidAccept(()=>{const d=c(l.value);typeof d=="number"?(r.goToMatch(d),l.hide()):l.validationMessage=A("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount)})),a.add(l.onDidHide(()=>{this.clearDecorations(t),a.dispose()})),l.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:Ga(hct),position:ug.Full}}}])})}}class Ift extends In{async run(e,t){const i=pf.get(t);if(!i)return;const r=X0e(t,"single",!1);r&&i.setSearchString(r),this._run(i)||(await 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 BAr extends Ift{constructor(){super({id:zo.NextSelectionMatchFindAction,label:A("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:me.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class $Ar extends Ift{constructor(){super({id:zo.PreviousSelectionMatchFindAction,label:A("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:me.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const HAr=dat(new uat({id:zo.StartFindReplaceAction,label:A("startReplace","Replace"),alias:"Replace",precondition:It.or(me.focus,It.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:zn.MenubarEditMenu,group:"3_find",title:A({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));HAr.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(92))return!1;const i=pf.get(e);if(!i)return!1;const r=e.getSelection(),s=i.isFindInputFocused(),o=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!s,a=s||o?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:o?"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})});cs(pf.ID,Z0e,0);zt(PAr);zt(OAr);zt(MAr);zt(jAr);zt(FAr);zt(BAr);zt($Ar);const t0=pc.bindToContribution(pf.get);gn(new t0({id:zo.CloseFindWidgetCommand,precondition:nx,handler:n=>n.closeFindWidget(),kbOpts:{weight:105,kbExpr:It.and(me.focus,It.not("isComposing")),primary:9,secondary:[1033]}}));gn(new t0({id:zo.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:me.focus,primary:BW.primary,mac:BW.mac,win:BW.win,linux:BW.linux}}));gn(new t0({id:zo.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:105,kbExpr:me.focus,primary:$W.primary,mac:$W.mac,win:$W.win,linux:$W.linux}}));gn(new t0({id:zo.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:105,kbExpr:me.focus,primary:HW.primary,mac:HW.mac,win:HW.win,linux:HW.linux}}));gn(new t0({id:zo.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:105,kbExpr:me.focus,primary:VW.primary,mac:VW.mac,win:VW.win,linux:VW.linux}}));gn(new t0({id:zo.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:105,kbExpr:me.focus,primary:WW.primary,mac:WW.mac,win:WW.win,linux:WW.linux}}));gn(new t0({id:zo.ReplaceOneAction,precondition:nx,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:me.focus,primary:3094}}));gn(new t0({id:zo.ReplaceOneAction,precondition:nx,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:It.and(me.focus,hIe),primary:3}}));gn(new t0({id:zo.ReplaceAllAction,precondition:nx,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:me.focus,primary:2563}}));gn(new t0({id:zo.ReplaceAllAction,precondition:nx,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:It.and(me.focus,hIe),primary:void 0,mac:{primary:2051}}}));gn(new t0({id:zo.SelectAllMatchesAction,precondition:nx,handler:n=>n.selectAllMatches(),kbOpts:{weight:105,kbExpr:me.focus,primary:515}}));const VAr={0:" ",1:"u",2:"r"},cHe=65535,ib=16777215,uHe=4278190080;class que{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,s=this._states[i];t?this._states[i]=s|1<<r:this._states[i]=s&~(1<<r)}}class qp{constructor(e,t,i){if(e.length!==t.length||e.length>cHe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new que(e.length),this._userDefinedStates=new que(e.length),this._recoveredStates=new que(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,r)=>{const s=e[e.length-1];return this.getStartLineNumber(s)<=i&&this.getEndLineNumber(s)>=r};for(let i=0,r=this._startIndexes.length;i<r;i++){const s=this._startIndexes[i],o=this._endIndexes[i];if(s>ib||o>ib)throw new Error("startLineNumber or endLineNumber must not exceed "+ib);for(;e.length>0&&!t(s,o);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=s+((a&255)<<24),this._endIndexes[i]=o+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&ib}getEndLineNumber(e){return this._endIndexes[e]&ib}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 WAr(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&uHe)>>>24)+((this._endIndexes[e]&uHe)>>>16);return t===cHe?-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]=`[${VAr[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&ib,endLineNumber:this._endIndexes[e]&ib,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 s=[],o=!1;for(let l=0;l<t;l++){const c=e[l];i[l]=c.startLineNumber,r[l]=c.endLineNumber,s.push(c.type),c.type&&(o=!0)}o||(s=void 0);const a=new qp(i,r,s);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,r){i=i??Number.MAX_VALUE;const s=(_,v)=>Array.isArray(_)?b=>b<v?_[b]:void 0:b=>b<v?_.toFoldRange(b):void 0,o=s(e,e.length),a=s(t,t.length);let l=0,c=0,u=o(0),d=a(0);const f=[];let p,g=0;const m=[];for(;u||d;){let _;if(d&&(!u||u.startLineNumber>=d.startLineNumber))u&&u.startLineNumber===d.startLineNumber?(d.source===1?_=d:(_=u,_.isCollapsed=d.isCollapsed&&(u.endLineNumber===d.endLineNumber||!(r!=null&&r.startsInside(u.startLineNumber+1,u.endLineNumber+1))),_.source=0),u=o(++l)):(_=d,d.isCollapsed&&d.source===0&&(_.source=2)),d=a(++c);else{let v=c,b=d;for(;;){if(!b||b.startLineNumber>u.endLineNumber){_=u;break}if(b.source===1&&b.endLineNumber>u.endLineNumber)break;b=a(++v)}u=o(++l)}if(_){for(;p&&p.endLineNumber<_.startLineNumber;)p=f.pop();_.endLineNumber>_.startLineNumber&&_.startLineNumber>g&&_.endLineNumber<=i&&(!p||p.endLineNumber>=_.endLineNumber)&&(m.push(_),g=_.startLineNumber,p&&f.push(p),p=_)}}return m}}class WAr{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 zAr{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new Ue,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new qp(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,s=-1,o=-1;const a=l=>{for(;r<l;){const c=this._regions.getEndLineNumber(r),u=this._regions.isCollapsed(r);if(c<=s){const d=this.regions.getSource(r)!==0;i.changeDecorationOptions(this._editorDecorationIds[r],this._decorationProvider.getDecorationOption(u,c<=o,d))}u&&c>o&&(o=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),s=Math.max(s,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 s of e)if(!(s.startLineNumber>r.endLineNumber||r.startLineNumber>s.endLineNumber))return!0;return!1};for(let r=0;r<this._regions.length;r++){const s=this._regions.toFoldRange(r);(s.source===0||!i(s))&&t.push(s)}this.updatePost(qp.fromFoldRanges(t))}update(e,t){const i=this._currentFoldedOrManualRanges(t),r=qp.sanitizeAndMerge(e,i,this._textModel.getLineCount(),t);this.updatePost(qp.fromFoldRanges(r))}updatePost(e){const t=[];let i=-1;for(let r=0,s=e.length;r<s;r++){const o=e.getStartLineNumber(r),a=e.getEndLineNumber(r),l=e.isCollapsed(r),c=e.getSource(r)!==0,u={startLineNumber:o,startColumn:this._textModel.getLineMaxColumn(o),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=[];for(let i=0,r=this._regions.length;i<r;i++){let s=this.regions.isCollapsed(i);const o=this.regions.getSource(i);if(s||o!==0){const a=this._regions.toFoldRange(i),l=this._textModel.getDecorationRange(this._editorDecorationIds[i]);l&&(s&&(e!=null&&e.startsInside(l.startLineNumber+1,l.endLineNumber))&&(s=!1),t.push({startLineNumber:l.startLineNumber,endLineNumber:l.endLineNumber,type:a.type,isCollapsed:s,source:o}))}}return t}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let r=0,s=e.length;r<s;r++){const o=e[r];if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const a=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const s of e){if(s.startLineNumber>=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>i)continue;const o=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);(!s.checksum||o===s.checksum)&&t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,type:void 0,isCollapsed:s.isCollapsed??!0,source:s.source??0})}const r=qp.sanitizeAndMerge(this._regions,t,i);this.updatePost(qp.fromFoldRanges(r))}_getLinesChecksum(e,t){return Qee(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),s=1;for(;r>=0;){const o=this._regions.toRegion(r);(!t||t(o,s))&&i.push(o),s++,r=o.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,s=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const o=[];for(let a=r,l=this._regions.length;a<l;a++){const c=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<s){for(;o.length>0&&!c.containedBy(o[o.length-1]);)o.pop();o.push(c),t(c,o.length)&&i.push(c)}else break}}else for(let o=r,a=this._regions.length;o<a;o++){const l=this._regions.toRegion(o);if(this._regions.getStartLineNumber(o)<s)(!t||t(l))&&i.push(l);else break}return i}}function gIe(n,e,t){const i=[];for(const r of t){const s=n.getRegionAtLine(r);if(s){const o=!s.isCollapsed;if(i.push(s),e>1){const a=n.getRegionsInside(s,(l,c)=>l.isCollapsed!==o&&c<e);i.push(...a)}}}n.toggleCollapseState(i)}function c3(n,e,t=Number.MAX_VALUE,i){const r=[];if(i&&i.length>0)for(const s of i){const o=n.getRegionAtLine(s);if(o&&(o.isCollapsed!==e&&r.push(o),t>1)){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==e&&c<t);r.push(...a)}}else{const s=n.getRegionsInside(null,(o,a)=>o.isCollapsed!==e&&a<t);r.push(...s)}n.toggleCollapseState(r)}function Lft(n,e,t,i){const r=[];for(const s of i){const o=n.getAllRegionsAtLine(s,(a,l)=>a.isCollapsed!==e&&l<=t);r.push(...o)}n.toggleCollapseState(r)}function UAr(n,e,t){const i=[];for(const r of t){const s=n.getAllRegionsAtLine(r,o=>o.isCollapsed!==e);s.length>0&&i.push(s[0])}n.toggleCollapseState(i)}function qAr(n,e,t,i){const r=(o,a)=>a===e&&o.isCollapsed!==t&&!i.some(l=>o.containsLine(l)),s=n.getRegionsInside(null,r);n.toggleCollapseState(s)}function Aft(n,e,t){const i=[];for(const o of t){const a=n.getAllRegionsAtLine(o,void 0);a.length>0&&i.push(a[0])}const r=o=>i.every(a=>!a.containedBy(o)&&!o.containedBy(a))&&o.isCollapsed!==e,s=n.getRegionsInside(null,r);n.toggleCollapseState(s)}function mIe(n,e,t){const i=n.textModel,r=n.regions,s=[];for(let o=r.length-1;o>=0;o--)if(t!==r.isCollapsed(o)){const a=r.getStartLineNumber(o);e.test(i.getLineContent(a))&&s.push(r.toRegion(o))}n.toggleCollapseState(s)}function _Ie(n,e,t){const i=n.regions,r=[];for(let s=i.length-1;s>=0;s--)t!==i.isCollapsed(s)&&e===i.getType(s)&&r.push(i.toRegion(s));n.toggleCollapseState(r)}function KAr(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 GAr(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 YAr(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 QAr{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new Ue,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||ek(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,r=0,s=Number.MAX_VALUE,o=-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);s<=l&&c<=o||(!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 ie(l,1,c,1))),s=l,o=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 dHe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let r=null;const s=o=>((!r||!XAr(o,r))&&(r=dHe(this._hiddenRanges,o)),r?r.startLineNumber-1:null);for(let o=0,a=e.length;o<a;o++){let l=e[o];const c=s(l.startLineNumber);c&&(l=l.setStartPosition(c,i.getLineMaxColumn(c)),t=!0);const u=s(l.endLineNumber);u&&(l=l.setEndPosition(u,i.getLineMaxColumn(u)),t=!0),e[o]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function XAr(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function dHe(n,e){const t=p7(n,i=>e<i.startLineNumber)-1;return t>=0&&n[t].endLineNumber>=e?n[t]:null}const ZAr=5e3,JAr="indent";class vIe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=JAr}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(nNr(this.editorModel,i,r,this.foldingRangesLimit))}}let eNr=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>ib||t>ib)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 s=this._length-1,o=0;s>=0;s--,o++)i[o]=this._startIndexes[s],r[o]=this._endIndexes[s];return new qp(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 s=e.getOptions().tabSize,o=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),f=Bte(d,s);(f<r||f===r&&i++<t)&&(o[c]=u,a[c]=this._endIndexes[l],c++)}return new qp(o,a)}}};const tNr={limit:ZAr,update:()=>{}};function nNr(n,e,t,i=tNr){const r=n.getOptions().tabSize,s=new eNr(i);let o;t&&(o=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=Bte(u,r);let f=a[a.length-1];if(d===-1){e&&(f.endAbove=c);continue}let p;if(o&&(p=u.match(o)))if(p[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,f=a[g],s.insertFirst(c,f.line,d),f.line=c,f.indent=d,f.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(f.indent>d){do a.pop(),f=a[a.length-1];while(f.indent>d);const g=f.endAbove-1;g-c>=1&&s.insertFirst(c,g,d)}f.indent===d?f.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return s.toIndentRanges(n)}const iNr=ve("editor.foldBackground",{light:Ir(FS,.3),dark:Ir(FS,.3),hcDark:null,hcLight:null},A("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);ve("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},A("collapsedTextColor","Color of the collapsed text after the first line of a folded range."));ve("editorGutter.foldingControlForeground",aG,A("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const WY=Zo("folding-expanded",Yt.chevronDown,A("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),zY=Zo("folding-collapsed",Yt.chevronRight,A("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),hHe=Zo("folding-manual-collapsed",zY,A("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),fHe=Zo("folding-manual-expanded",WY,A("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),Kue={color:Ga(iNr),position:1},UD=A("linesCollapsed","Click to expand the range."),qW=A("linesExpanded","Click to collapse the range."),$l=class $l{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?$l.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?$l.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:$l.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:$l.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?$l.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:$l.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?$l.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:$l.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?$l.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:$l.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?$l.MANUALLY_EXPANDED_VISUAL_DECORATION:$l.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};$l.COLLAPSED_VISUAL_DECORATION=ur.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:UD,firstLineDecorationClassName:Ni.asClassName(zY)}),$l.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=ur.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:Kue,isWholeLine:!0,linesDecorationsTooltip:UD,firstLineDecorationClassName:Ni.asClassName(zY)}),$l.MANUALLY_COLLAPSED_VISUAL_DECORATION=ur.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:UD,firstLineDecorationClassName:Ni.asClassName(hHe)}),$l.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=ur.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:Kue,isWholeLine:!0,linesDecorationsTooltip:UD,firstLineDecorationClassName:Ni.asClassName(hHe)}),$l.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=ur.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:UD}),$l.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=ur.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:Kue,isWholeLine:!0,linesDecorationsTooltip:UD}),$l.EXPANDED_VISUAL_DECORATION=ur.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ni.asClassName(WY),linesDecorationsTooltip:qW}),$l.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=ur.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Ni.asClassName(WY),linesDecorationsTooltip:qW}),$l.MANUALLY_EXPANDED_VISUAL_DECORATION=ur.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ni.asClassName(fHe),linesDecorationsTooltip:qW}),$l.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=ur.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Ni.asClassName(fHe),linesDecorationsTooltip:qW}),$l.NO_CONTROLS_EXPANDED_RANGE_DECORATION=ur.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),$l.HIDDEN_RANGE_DECORATION=ur.register({description:"folding-hidden-range-decoration",stickiness:1});let J0e=$l;const rNr={},sNr="syntax";class bIe{constructor(e,t,i,r,s){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=r,this.fallbackRangeProvider=s,this.id=sNr,this.disposables=new Et,s&&this.disposables.add(s);for(const o of t)typeof o.onDidChange=="function"&&this.disposables.add(o.onDidChange(i))}compute(e){return oNr(this.providers,this.editorModel,e).then(t=>{var i;return t?lNr(t,this.foldingRangesLimit):((i=this.fallbackRangeProvider)==null?void 0:i.compute(e))??null})}dispose(){this.disposables.dispose()}}function oNr(n,e,t){let i=null;const r=n.map((s,o)=>Promise.resolve(s.provideFoldingRanges(e,rNr,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:o,kind:c.kind})}},ll));return Promise.all(r).then(s=>i)}class aNr{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>ib||t>ib)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._nestingLevels[s]=r,this._types[s]=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 qp(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),s=new Uint32Array(e),o=[];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],s[l]=this._endIndexes[a],o[l]=this._types[a],l++)}return new qp(r,s,o)}}}function lNr(n,e){const t=n.sort((o,a)=>{let l=o.start-a.start;return l===0&&(l=o.rank-a.rank),l}),i=new aNr(e);let r;const s=[];for(const o of t)if(!r)r=o,i.add(o.start,o.end,o.kind&&o.kind.value,s.length);else if(o.start>r.start)if(o.end<=r.end)s.push(r),r=o,i.add(o.start,o.end,o.kind&&o.kind.value,s.length);else{if(o.start>r.end){do r=s.pop();while(r&&o.start>r.end);r&&s.push(r),r=o}i.add(o.start,o.end,o.kind&&o.kind.value,s.length)}return i.toIndentRanges()}var cNr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Lj=function(n,e){return function(t,i){e(t,i,n)}},d2;const qu=new yn("foldingEnabled",!1);var GI;let uk=(GI=class extends Ye{static get(e){return e.getContribution(d2.ID)}static getFoldingRangeProviders(e,t){var r;const i=e.foldingRangeProvider.ordered(t);return((r=d2._foldingRangeSelector)==null?void 0:r.call(d2,i,t))??i}constructor(e,t,i,r,s,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new Et),this.editor=e,this._foldingLimitReporter=new Nft(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=s.for(o.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 J0e(e),this.foldingDecorationProvider.showFoldingControls=a.get(111),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=qu.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(111)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(111),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 zAr(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new QAr(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Rm(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new ao(()=>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.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)==null||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)==null||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new vIe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=d2.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new bIe(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)==null||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 Qc,i=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=Ic(s=>i.compute(s));return r.then(s=>{if(s&&r===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=s.setCollapsedAllOfType(KE.Imports.value,!0);c&&(o=Ub.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(s,uNr(a)),o==null||o.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(tr(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 s of i){const o=s.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(o)&&r.push(...t.getAllRegionsAtLine(o,a=>a.isCollapsed&&o>a.startLineNumber))}r.length&&(t.toggleCollapseState(r),this.reveal(i[0].getPosition()))}}}).then(void 0,tr)}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,s=e.target.element.offsetLeft;if(r.offsetX-s<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,s=e.target.range;if(!s||s.startLineNumber!==i)return;if(r){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||s.startColumn!==a.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const a=o.isCollapsed;if(r||a){const l=e.event.altKey;let c=[];if(l){const u=f=>!f.containedBy(o)&&!o.containedBy(f),d=t.getRegionsInside(null,u);for(const f of d)f.isCollapsed&&c.push(f);c.length===0&&(c=d)}else{const u=e.event.middleButton||e.event.shiftKey;if(u)for(const d of t.getRegionsInside(o))d.isCollapsed===a&&c.push(d);(a||!u||c.length===0)&&c.push(o)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}},d2=GI,GI.ID="editor.contrib.folding",GI);uk=d2=cNr([Lj(1,Oi),Lj(2,wa),Lj(3,wl),Lj(4,kg),Lj(5,Fn)],uk);class Nft{constructor(e){this.editor=e,this._onDidChange=new Ue,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 vd extends In{runEditorCommand(e,t,i){const r=e.get(wa),s=uk.get(t);if(!s)return;const o=s.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(a=>{if(a){this.invoke(s,a,t,i,r);const l=t.getSelection();l&&s.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 uNr(n){return!n||n.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of n){const r=i.startLineNumber;if(r>=e&&r<=t)return!0}return!1}}}function Dft(n){if(!Kd(n)){if(!zc(n))return!1;const e=n;if(!Kd(e.levels)&&!zE(e.levels)||!Kd(e.direction)&&!cf(e.direction)||!Kd(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(zE)))return!1}return!0}class dNr extends vd{constructor(){super({id:"editor.unfold",label:A("unfoldAction.label","Unfold"),alias:"Unfold",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{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:Dft,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 s=r&&r.levels||1,o=this.getLineNumbers(r,i);r&&r.direction==="up"?Lft(t,!1,s,o):c3(t,!1,s,o)}}class hNr extends vd{constructor(){super({id:"editor.unfoldRecursively",label:A("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2142),weight:100}})}invoke(e,t,i,r){c3(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class fNr extends vd{constructor(){super({id:"editor.fold",label:A("foldAction.label","Fold"),alias:"Fold",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{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:Dft,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 s=this.getLineNumbers(r,i),o=r&&r.levels,a=r&&r.direction;typeof o!="number"&&typeof a!="string"?UAr(t,!0,s):a==="up"?Lft(t,!0,o||1,s):c3(t,!0,o||1,s)}}class pNr extends vd{constructor(){super({id:"editor.toggleFold",label:A("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2090),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);gIe(t,1,r)}}class gNr extends vd{constructor(){super({id:"editor.foldRecursively",label:A("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2140),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);c3(t,!0,Number.MAX_VALUE,r)}}class mNr extends vd{constructor(){super({id:"editor.toggleFoldRecursively",label:A("toggleFoldRecursivelyAction.label","Toggle Fold Recursively"),alias:"Toggle Fold Recursively",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,3114),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);gIe(t,Number.MAX_VALUE,r)}}class _Nr extends vd{constructor(){super({id:"editor.foldAllBlockComments",label:A("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2138),weight:100}})}invoke(e,t,i,r,s){if(t.regions.hasTypes())_Ie(t,KE.Comment.value,!0);else{const o=i.getModel();if(!o)return;const a=s.getLanguageConfiguration(o.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+mg(a.blockCommentStartToken));mIe(t,l,!0)}}}}class vNr extends vd{constructor(){super({id:"editor.foldAllMarkerRegions",label:A("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2077),weight:100}})}invoke(e,t,i,r,s){if(t.regions.hasTypes())_Ie(t,KE.Region.value,!0);else{const o=i.getModel();if(!o)return;const a=s.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);mIe(t,l,!0)}}}}class bNr extends vd{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:A("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2078),weight:100}})}invoke(e,t,i,r,s){if(t.regions.hasTypes())_Ie(t,KE.Region.value,!1);else{const o=i.getModel();if(!o)return;const a=s.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);mIe(t,l,!1)}}}}class yNr extends vd{constructor(){super({id:"editor.foldAllExcept",label:A("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2136),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);Aft(t,!0,r)}}class CNr extends vd{constructor(){super({id:"editor.unfoldAllExcept",label:A("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2134),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);Aft(t,!1,r)}}class wNr extends vd{constructor(){super({id:"editor.foldAll",label:A("foldAllAction.label","Fold All"),alias:"Fold All",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2069),weight:100}})}invoke(e,t,i){c3(t,!0)}}class xNr extends vd{constructor(){super({id:"editor.unfoldAll",label:A("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2088),weight:100}})}invoke(e,t,i){c3(t,!1)}}const cP=class cP extends vd{getFoldingLevel(){return parseInt(this.id.substr(cP.ID_PREFIX.length))}invoke(e,t,i){qAr(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};cP.ID_PREFIX="editor.foldLevel",cP.ID=e=>cP.ID_PREFIX+e;let UY=cP;class SNr extends vd{constructor(){super({id:"editor.gotoParentFold",label:A("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const s=KAr(r[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class ENr extends vd{constructor(){super({id:"editor.gotoPreviousFold",label:A("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const s=GAr(r[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class kNr extends vd{constructor(){super({id:"editor.gotoNextFold",label:A("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const s=YAr(r[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class TNr extends vd{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:A("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2135),weight:100}})}invoke(e,t,i){var o;const r=[],s=i.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(r.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(r.length>0){r.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=qp.sanitizeAndMerge(t.regions,r,(o=i.getModel())==null?void 0:o.getLineCount());t.updatePost(qp.fromFoldRanges(a))}}}}class INr extends vd{constructor(){super({id:"editor.removeManualFoldingRanges",label:A("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2137),weight:100}})}invoke(e,t,i){const r=i.getSelections();if(r){const s=[];for(const o of r){const{startLineNumber:a,endLineNumber:l}=o;s.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(s),e.triggerFoldingModelChanged()}}}cs(uk.ID,uk,0);zt(dNr);zt(hNr);zt(fNr);zt(gNr);zt(mNr);zt(wNr);zt(xNr);zt(_Nr);zt(vNr);zt(bNr);zt(yNr);zt(CNr);zt(pNr);zt(SNr);zt(ENr);zt(kNr);zt(TNr);zt(INr);for(let n=1;n<=7;n++)lcr(new UY({id:UY.ID(n),label:A("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:qu,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2048|21+n),weight:100}}));os.registerCommand("_executeFoldingRangeProvider",async function(n,...e){const[t]=e;if(!(t instanceof vi))throw Sm();const i=n.get(Fn),r=n.get(Xo).getModel(t);if(!r)throw Sm();const s=n.get(Dr);if(!s.getValue("editor.folding",{resource:t}))return[];const o=n.get(wa),a=s.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return s.getValue("editor.foldingMaximumRegions",{resource:t})},update:(p,g)=>{}},c=new vIe(r,o,l);let u=c;if(a!=="indentation"){const p=uk.getFoldingRangeProviders(i,r);p.length&&(u=new bIe(r,p,()=>{},l,c))}const d=await u.compute(xr.None),f=[];try{if(d)for(let p=0;p<d.length;p++){const g=d.getType(p);f.push({start:d.getStartLineNumber(p),end:d.getEndLineNumber(p),kind:g?KE.fromValue(g):void 0})}return f}finally{u.dispose()}});class LNr extends In{constructor(){super({id:"editor.action.fontZoomIn",label:A("EditorFontZoomIn.label","Increase Editor Font Size"),alias:"Increase Editor Font Size",precondition:void 0})}run(e,t){lm.setZoomLevel(lm.getZoomLevel()+1)}}class ANr extends In{constructor(){super({id:"editor.action.fontZoomOut",label:A("EditorFontZoomOut.label","Decrease Editor Font Size"),alias:"Decrease Editor Font Size",precondition:void 0})}run(e,t){lm.setZoomLevel(lm.getZoomLevel()-1)}}class NNr extends In{constructor(){super({id:"editor.action.fontZoomReset",label:A("EditorFontZoomReset.label","Reset Editor Font Size"),alias:"Reset Editor Font Size",precondition:void 0})}run(e,t){lm.setZoomLevel(0)}}zt(LNr);zt(ANr);zt(NNr);var Rft=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},T6=function(n,e){return function(t,i){e(t,i,n)}},sO;let qY=(sO=class{constructor(e,t,i,r){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=r,this._disposables=new Et,this._sessionDisposables=new Et,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(s=>{s.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 XK;for(const r of t.autoFormatTriggerCharacters)i.add(r.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(r=>{const s=r.charCodeAt(r.length-1);i.has(s)&&this._trigger(String.fromCharCode(s))}))}_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 ba,s=this._editor.onDidChangeModelContent(o=>{if(o.isFlush){r.cancel(),s.dispose();return}for(let a=0,l=o.changes.length;a<l;a++)if(o.changes[a].range.endLineNumber<=i.lineNumber){r.cancel(),s.dispose();return}});Sdt(this._workerService,this._languageFeaturesService,t,i,e,t.getFormattingOptions(),r.token).then(o=>{r.token.isCancellationRequested||Gd(o)&&(this._accessibilitySignalService.playSignal(Up.format,{userGesture:!1}),IM.execute(this._editor,o,!0))}).finally(()=>{s.dispose()})}},sO.ID="editor.contrib.autoFormat",sO);qY=Rft([T6(1,Fn),T6(2,Sf),T6(3,Mk)],qY);var oO;let KY=(oO=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new Et,this._callOnModel=new Et,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(xdt,this.editor,e,2,bb.None,xr.None,!1).catch(tr))}},oO.ID="editor.contrib.formatOnPaste",oO);KY=Rft([T6(1,Fn),T6(2,mi)],KY);class DNr extends In{constructor(){super({id:"editor.action.formatDocument",label:A("formatDocument.label","Format Document"),alias:"Format Document",precondition:It.and(me.notInCompositeEditor,me.writable,me.hasDocumentFormattingProvider),kbOpts:{kbExpr:me.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(mi);await e.get(Rk).showWhile(i.invokeFunction(Jkr,t,1,bb.None,xr.None,!0),250)}}}class RNr extends In{constructor(){super({id:"editor.action.formatSelection",label:A("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:It.and(me.writable,me.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2084),weight:100},contextMenuOpts:{when:me.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(mi),r=t.getModel(),s=t.getSelections().map(a=>a.isEmpty()?new ie(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)):a);await e.get(Rk).showWhile(i.invokeFunction(xdt,t,s,1,bb.None,xr.None,!0),250)}}cs(qY.ID,qY,2);cs(KY.ID,KY,2);zt(DNr);zt(RNr);os.registerCommand("editor.action.format",async n=>{const e=n.get(Cs).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(Fo);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var PNr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Gue=function(n,e){return function(t,i){e(t,i,n)}};class KR{remove(){var e;(e=this.parent)==null||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 s=0;t.children.get(r)!==void 0;s++)r=`${i}_${s}`;return r}static empty(e){return e.children.size===0}}class eye extends KR{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class Pft extends KR{constructor(e,t,i,r){super(),this.id=e,this.parent=t,this.label=i,this.order=r,this.children=new Map}}class NC extends KR{static create(e,t,i){const r=new ba(i),s=new NC(t.uri),o=e.ordered(t),a=o.map((c,u)=>{const d=KR.findId(`provider_${u}`,s),f=new Pft(d,s,c.displayName??"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(p=>{for(const g of p||[])NC._makeOutlineElement(g,f);return f},p=>(ll(p),f)).then(p=>{KR.empty(p)?p.remove():s._groups.set(d,p)})}),l=e.onDidChange(()=>{const c=e.ordered(t);fa(c,o)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!i.isCancellationRequested?NC.create(e,t,i):s._compact()).finally(()=>{r.dispose(),l.dispose(),r.dispose()})}static _makeOutlineElement(e,t){const i=KR.findId(e,t),r=new eye(i,t,e);if(e.children)for(const s of e.children)NC._makeOutlineElement(s,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=ss.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 eye?e.push(t.symbol):e.push(...ss.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>ie.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return NC._flattenDocumentSymbols(t,e,""),t.sort((i,r)=>We.compare(ie.getStartPosition(i.range),ie.getStartPosition(r.range))||We.compare(ie.getEndPosition(r.range),ie.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&&NC._flattenDocumentSymbols(e,r.children,r.name)}}const k$=Ur("IOutlineModelService");let tye=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Et,this._cache=new b1(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()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,r=i.ordered(e);let s=this._cache.get(e.id);if(!s||s.versionId!==e.getVersionId()||!fa(s.provider,r)){const a=new ba;s={versionId:e.getVersionId(),provider:r,promiseCnt:0,source:a,promise:NC.create(i,e,a.token),model:void 0},this._cache.set(e.id,s);const l=Date.now();s.promise.then(c=>{s.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(s.model)return s.model;s.promiseCnt+=1;const o=t.onCancellationRequested(()=>{--s.promiseCnt===0&&(s.source.cancel(),this._cache.delete(e.id))});try{return await s.promise}finally{o.dispose()}}};tye=PNr([Gue(0,Fn),Gue(1,kg),Gue(2,Xo)],tye);ns(k$,tye,1);os.registerCommand("_executeDocumentSymbolProvider",async function(n,...e){const[t]=e;ys(vi.isUri(t));const i=n.get(k$),s=await n.get(Cf).createModelReference(t);try{return(await i.getOrCreate(s.object.textEditorModel,xr.None)).getTopLevelSymbols()}finally{s.dispose()}});const G0=class G0 extends Ye{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=G0.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=G0.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=G0.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=G0.suppressSuggestions.bindTo(this.contextKeyService),this._register(Gi(i=>{const r=this.model.read(i),s=r==null?void 0:r.state.read(i),o=!!(s!=null&&s.inlineCompletion)&&(s==null?void 0:s.primaryGhostText)!==void 0&&!(s!=null&&s.primaryGhostText.isEmpty());this.inlineCompletionVisible.set(o),s!=null&&s.primaryGhostText&&(s!=null&&s.inlineCompletion)&&this.suppressSuggestions.set(s.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(Gi(i=>{const r=this.model.read(i);let s=!1,o=!0;const a=r==null?void 0:r.primaryGhostText.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 p=Yd(u);p===-1&&(p=u.length-1),s=p>0;const g=r.textModel.getOptions().tabSize;o=cc.visibleColumnFromColumn(u,p+1,g)<g}}this.inlineCompletionSuggestsIndentation.set(s),this.inlineCompletionSuggestsIndentationLessThanTabSize.set(o)}))}};G0.inlineSuggestionVisible=new yn("inlineSuggestionVisible",!1,A("inlineSuggestionVisible","Whether an inline suggestion is visible")),G0.inlineSuggestionHasIndentation=new yn("inlineSuggestionHasIndentation",!1,A("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace")),G0.inlineSuggestionHasIndentationLessThanTabSize=new yn("inlineSuggestionHasIndentationLessThanTabSize",!0,A("inlineSuggestionHasIndentationLessThanTabSize","Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")),G0.suppressSuggestions=new yn("inlineSuggestionSuppressSuggestions",void 0,A("suppressSuggestions","Whether suggestions should be suppressed for the current suggestion"));let np=G0;function ONr(n){const e=new Et,t=e.add(Zot());return e.add(Gi(i=>{t.setStyle(n.read(i))})),e}class gB{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 new Fke([...this.parts.map(s=>new Gy(ie.fromPositions(new We(1,s.column)),s.lines.join(` `)))]).applyToString(i).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 GY{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=_1(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class nye{constructor(e,t,i,r=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=r,this.parts=[new GY(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=_1(this.text)}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 pHe(n,e){return fa(n,e,Oft)}function Oft(n,e){return n===e?!0:!n||!e?!1:n instanceof gB&&e instanceof gB||n instanceof nye&&e instanceof nye?n.equals(e):!1}const MNr=[];function jNr(){return MNr}class Mft{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Ps(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new ie(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function jft(n,e){const t=new Et,i=n.createDecorationsCollection();return t.add(r$({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const s=e.read(r);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}function FNr(n,e){return new We(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function gHe(n,e){return new We(n.lineNumber-e.lineNumber+1,n.lineNumber-e.lineNumber===0?n.column-e.column+1:n.column)}var BNr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},$Nr=function(n,e){return function(t,i){e(t,i,n)}};const mHe="ghost-text";let iye=class extends Ye{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Ar(this,!1),this.currentTextModel=Gs(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=ai(this,r=>{if(this.isDisposed.read(r))return;const s=this.currentTextModel.read(r);if(s!==this.model.targetTextModel.read(r))return;const o=this.model.ghostText.read(r);if(!o)return;const a=o instanceof nye?o.columnRange:void 0,l=[],c=[];function u(m,_){if(c.length>0){const v=c[c.length-1];_&&v.decorations.push(new xh(v.content.length+1,v.content.length+1+m[0].length,_,0)),v.content+=m[0],m=m.slice(1)}for(const v of m)c.push({content:v,decorations:_?[new xh(1,v.length+1,_,0)]:[]})}const d=s.getLineContent(o.lineNumber);let f,p=0;for(const m of o.parts){let _=m.lines;f===void 0?(l.push({column:m.column,text:_[0],preview:m.preview}),_=_.slice(1)):u([d.substring(p,m.column-1)],void 0),_.length>0&&(u(_,mHe),f===void 0&&m.column<=d.length&&(f=m.column)),p=m.column-1}f!==void 0&&u([d.substring(p)],void 0);const g=f!==void 0?new Mft(f,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:o.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:s}}),this.decorations=ai(this,r=>{const s=this.uiState.read(r);if(!s)return[];const o=[];s.replacedRange&&o.push({range:s.replacedRange.toRange(s.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),s.hiddenRange&&o.push({range:s.hiddenRange.toRange(s.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of s.inlineTexts)o.push({range:ie.fromPositions(new We(s.lineNumber,a.column)),options:{description:mHe,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:$_.Left},showIfCollapsed:!0}});return o}),this.additionalLinesWidget=this._register(new HNr(this.editor,this.languageService.languageIdCodec,ai(r=>{const s=this.uiState.read(r);return s?{lineNumber:s.lineNumber,additionalLines:s.additionalLines,minReservedLineCount:s.additionalReservedLineCount,targetTextModel:s.targetTextModel}:void 0}))),this._register(gi(()=>{this.isDisposed.set(!0,void 0)})),this._register(jft(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};iye=BNr([$Nr(2,pa)],iye);class HNr extends Ye{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=Fu("editorOptionChanged",rn.filter(this.editor.onDidChangeConfiguration,r=>r.hasChanged(33)||r.hasChanged(118)||r.hasChanged(100)||r.hasChanged(95)||r.hasChanged(51)||r.hasChanged(50)||r.hasChanged(67))),this._register(Gi(r=>{const s=this.lines.read(r);this.editorOptionsChanged.read(r),s?this.updateLines(s.lineNumber,s.additionalLines,s.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:s}=r.getOptions();this.editor.changeViewZones(o=>{this._viewZoneId&&(o.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");VNr(l,s,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=o.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function VNr(n,e,t,i,r){const s=i.get(33),o=i.get(118),a="none",l=i.get(95),c=i.get(51),u=i.get(50),d=i.get(67),f=new z4(1e4);f.appendString('<div class="suggest-preview-text">');for(let m=0,_=t.length;m<_;m++){const v=t[m],b=v.content;f.appendString('<div class="view-line'),f.appendString('" style="top:'),f.appendString(String(m*d)),f.appendString('px;width:1000000px;">');const y=U9(b),C=sM(b),S=Xc.createEmpty(b,r);f$(new jk(u.isMonospace&&!s,u.canUseHalfwidthRightwardsArrow,b,!1,y,C,0,S,v.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,o,a,l,c!==UE.OFF,null),f),f.appendString("</div>")}f.appendString("</div>"),vu(n,u);const p=f.build(),g=_He?_He.createHTML(p):p;n.innerHTML=g}const _He=Xw("editorGhostText",{createHTML:n=>n});function WNr(n,e){const t=new yct,i=new wct(t,c=>e.getLanguageConfiguration(c)),r=new Cct(new zNr([n]),i),s=uve(r,[],void 0,!0);let o="";const a=n.getLineContent();function l(c,u){if(c.kind===2)if(l(c.openingBracket,u),u=Qa(u,c.openingBracket.length),c.child&&(l(c.child,u),u=Qa(u,c.child.length)),c.closingBracket)l(c.closingBracket,u),u=Qa(u,c.closingBracket.length);else{const f=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);o+=f}else if(c.kind!==3){if(c.kind===0||c.kind===1)o+=a.substring(u,Qa(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=Qa(u,d.length)}}return l(s,wh),o}class zNr{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}}async function Fft(n,e,t,i,r=xr.None,s){const o=e instanceof We?KNr(e,t):e,a=n.all(t),l=new Rke;for(const v of a)v.groupId&&l.add(v.groupId,v);function c(v){if(!v.yieldsToGroupIds)return[];const b=[];for(const y of v.yieldsToGroupIds||[]){const C=l.get(y);for(const S of C)b.push(S)}return b}const u=new Map,d=new Set;function f(v,b){if(b=[...b,v],d.has(v))return b;d.add(v);try{const y=c(v);for(const C of y){const S=f(C,b);if(S)return S}}finally{d.delete(v)}}function p(v){const b=u.get(v);if(b)return b;const y=f(v,[]);y&&ll(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(S=>S.toString?S.toString():""+S).join(" -> ")}`));const C=new $4;return u.set(v,C.p),(async()=>{var S;if(!y){const k=c(v);for(const I of k){const L=await p(I);if(L&&L.items.length>0)return}}try{return e instanceof We?await v.provideInlineCompletions(t,e,i,r):await((S=v.provideInlineEdits)==null?void 0:S.call(v,t,e,i,r))}catch(k){ll(k);return}})().then(S=>C.complete(S),S=>C.error(S)),C.p}const g=await Promise.all(a.map(async v=>({provider:v,completions:await p(v)}))),m=new Map,_=[];for(const v of g){const b=v.completions;if(!b)continue;const y=new qNr(b,v.provider);_.push(y);for(const C of b.items){const S=YY.from(C,y,o,t,s);m.set(S.hash(),S)}}return new UNr(Array.from(m.values()),new Set(m.keys()),_)}class UNr{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 qNr{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 YY{static from(e,t,i,r,s){let o,a,l=e.range?ie.lift(e.range):i;if(typeof e.insertText=="string"){if(o=e.insertText,s&&e.completeBracketPairs){o=vHe(o,l.getStartPosition(),r,s);const c=o.length-e.insertText.length;c!==0&&(l=new ie(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(s&&e.completeBracketPairs){e.insertText.snippet=vHe(e.insertText.snippet,l.getStartPosition(),r,s);const d=e.insertText.snippet.length-c;d!==0&&(l=new ie(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new eA().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof mh?(o=u.children[0].value,a=void 0):(o=u.toString(),a={snippet:e.insertText.snippet,range:l})}else cte(e.insertText);return new YY(o,e.command,l,o,a,e.additionalTextEdits||jNr(),e,t)}constructor(e,t,i,r,s,o,a,l){this.filterText=e,this.command=t,this.range=i,this.insertText=r,this.snippetInfo=s,this.additionalTextEdits=o,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` `),r=e.replace(/\r\n|\r/g,` `)}withRange(e){return new YY(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()})}toSingleTextEdit(){return new Gy(this.range,this.insertText)}}function KNr(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new ie(n.lineNumber,t.startColumn,n.lineNumber,i):ie.fromPositions(n,n.with(void 0,i))}function vHe(n,e,t,i){const s=t.getLineContent(e.lineNumber).substring(0,e.column-1)+n,o=t.tokenization.tokenizeLineWithEdit(e,s.length-(e.column-1),n),a=o==null?void 0:o.sliceAndInflate(e.column-1,s.length,0);return a?WNr(a,i):n}function bI(n,e,t){const i=t?n.range.intersectRanges(t):n.range;if(!i)return n;const r=e.getValueInRange(i,1),s=GE(r,n.text),o=av.ofText(r.substring(0,s)).addToPosition(n.range.getStartPosition()),a=n.text.substring(s),l=ie.fromPositions(o,n.range.getEndPosition());return new Gy(l,a)}function Bft(n,e){return n.text.startsWith(e.text)&&GNr(n.range,e.range)}function bHe(n,e,t,i,r=0){let s=bI(n,e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const o=e.getLineContent(s.range.startLineNumber),a=_o(o).length;if(s.range.startColumn-1<=a){const g=_o(s.text).length,m=o.substring(s.range.startColumn-1,a),[_,v]=[s.range.getStartPosition(),s.range.getEndPosition()],b=_.column+m.length<=v.column?_.delta(0,m.length):v,y=ie.fromPositions(b,v),C=s.text.startsWith(m)?s.text.substring(m.length):s.text.substring(g);s=new Gy(y,C)}const c=e.getValueInRange(s.range),u=YNr(c,s.text);if(!u)return;const d=s.range.startLineNumber,f=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 p=s.text.length-r;for(const g of u){const m=s.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===s.range.startLineNumber&&m<i.column||g.originalLength>0)return;if(g.modifiedLength===0)continue;const _=g.modifiedStart+g.modifiedLength,v=Math.max(g.modifiedStart,Math.min(_,p)),b=s.text.substring(g.modifiedStart,v),y=s.text.substring(v,Math.max(g.modifiedStart,_));b.length>0&&f.push(new GY(m,b,!1)),y.length>0&&f.push(new GY(m,y,!0))}return new gB(d,f)}function GNr(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let M0;function YNr(n,e){if((M0==null?void 0:M0.originalValue)===n&&(M0==null?void 0:M0.newValue)===e)return M0==null?void 0:M0.changes;{let t=CHe(n,e,!0);if(t){const i=yHe(t);if(i>0){const r=CHe(n,e,!1);r&&yHe(r)<i&&(t=r)}}return M0={originalValue:n,newValue:e,changes:t},t}}function yHe(n){let e=0;for(const t of n)e+=t.originalLength;return e}function CHe(n,e,t){if(n.length>5e3||e.length>5e3)return;function i(c){let u=0;for(let d=0,f=c.length;d<f;d++){const p=c.charCodeAt(d);p>u&&(u=p)}return u}const r=Math.max(i(n),i(e));function s(c){if(c<0)throw new Error("unexpected");return r+c+1}function o(c){let u=0,d=0;const f=new Int32Array(c.length);for(let p=0,g=c.length;p<g;p++)if(t&&c[p]==="("){const m=d*100+u;f[p]=s(2*m),u++}else if(t&&c[p]===")"){u=Math.max(u-1,0);const m=d*100+u;f[p]=s(2*m+1),u===0&&d++}else f[p]=c.charCodeAt(p);return f}const a=o(n),l=o(e);return new my({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var QNr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},wHe=function(n,e){return function(t,i){e(t,i,n)}};let rye=class extends Ye{constructor(e,t,i,r,s){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=r,this.languageConfigurationService=s,this._updateOperation=this._register(new Dc),this.inlineCompletions=L7("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=L7("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var u,d;const r=new ZNr(e,t,this.textModel.getVersionId()),s=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if((u=this._updateOperation.value)!=null&&u.request.satisfies(r))return this._updateOperation.value.promise;if((d=s.get())!=null&&d.request.satisfies(r))return Promise.resolve(!0);const o=!!this._updateOperation.value;this._updateOperation.clear();const a=new ba,l=(async()=>{if((o||t.triggerKind===Ib.Automatic)&&await XNr(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==r.versionId)return!1;const p=new Date,g=await Fft(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==r.versionId)return!1;const m=new Date;this._debounceValue.update(this.textModel,m.getTime()-p.getTime());const _=new eDr(g,r,this.textModel,this.versionId);if(i){const v=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!g.has(v)&&_.prepend(i.inlineCompletion,v.range,!0)}return this._updateOperation.clear(),va(v=>{s.set(_,v)}),!0})(),c=new JNr(r,a,l);return this._updateOperation.value=c,l}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.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};rye=QNr([wHe(3,Fn),wHe(4,wa)],rye);function XNr(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 ZNr{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&z_e(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,hmr())&&(e.context.triggerKind===Ib.Automatic||this.context.triggerKind===Ib.Explicit)&&this.versionId===e.versionId}}class JNr{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class eDr{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=[];const s=i.deltaDecorations([],e.completions.map(o=>({range:o.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((o,a)=>new xHe(o,s[a],this._textModel,this._versionId))}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 xHe(e,r,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class xHe{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,r){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=r,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=Yp({owner:this,equalsFn:ie.equalsRange},s=>(this._modelVersion.read(s),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??Yue)}toSingleTextEdit(e){return new Gy(this._updatedRange.read(e)??Yue,this.inlineCompletion.insertText)}isVisible(e,t,i){const r=bI(this._toFilterTextReplacement(i),e),s=this._updatedRange.read(i);if(!s||!this.inlineCompletion.range.getStartPosition().equals(s.getStartPosition())||t.lineNumber!==r.range.startLineNumber)return!1;const o=e.getValueInRange(r.range,1),a=r.text,l=Math.max(0,t.column-r.range.startColumn);let c=a.substring(0,l),u=a.substring(l),d=o.substring(0,l),f=o.substring(l);const p=e.getLineIndentColumn(r.range.startLineNumber);return r.range.startColumn<=p&&(d=d.trimStart(),d.length===0&&(f=f.trimStart()),c=c.trimStart(),c.length===0&&(u=u.trimStart())),c.startsWith(d)&&!!klt(f,u)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&av.ofRange(i).isGreaterThanOrEqualTo(av.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new Gy(this._updatedRange.read(e)??Yue,this.inlineCompletion.filterText)}}const Yue=new ie(1,1,1,1),Tr={Visible:fIe,HasFocusedSuggestion:new yn("suggestWidgetHasFocusedSuggestion",!1,A("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new yn("suggestWidgetDetailsVisible",!1,A("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new yn("suggestWidgetMultipleSuggestions",!1,A("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new yn("suggestionMakesTextEdit",!0,A("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new yn("acceptSuggestionOnEnter",!0,A("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new yn("suggestionHasInsertAndReplaceRange",!1,A("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new yn("suggestionInsertMode",void 0,{type:"string",description:A("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new yn("suggestionCanResolve",!1,A("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},pE=new zn("suggestWidgetStatusBar");class tDr{constructor(e,t,i,r){var s;this.position=e,this.completion=t,this.container=i,this.provider=r,this.isInvalid=!1,this.score=Db.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(s=t.label)==null?void 0:s.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,ie.isIRange(t.range)?(this.editStart=new We(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new We(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new We(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||ie.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new We(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new We(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new We(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||ie.spansMultipleLines(t.range.insert)||ie.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}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new Qc(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(r=>{Object.assign(this.completion,r),this._resolveDuration=i.elapsed()},r=>{Km(r)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}const LX=class LX{constructor(e=2,t=new Set,i=new Set,r=new Map,s=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=r,this.showDeprecated=s}};LX.default=new LX;let mB=LX;class nDr{constructor(e,t,i,r){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=r}}async function yIe(n,e,t,i=mB.default,r={triggerKind:0},s=xr.None){const o=new Qc;t=t.clone();const a=e.getWordAtPosition(t),l=a?new ie(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):ie.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new Et,f=[];let p=!1;const g=(_,v,b)=>{var C;let y=!1;if(!v)return y;for(const S of v.suggestions)if(!i.kindFilter.has(S.kind)){if(!i.showDeprecated&&((C=S==null?void 0:S.tags)!=null&&C.includes(1)))continue;S.range||(S.range=c),S.sortText||(S.sortText=typeof S.label=="string"?S.label:S.label.label),!p&&S.insertTextRules&&S.insertTextRules&4&&(p=eA.guessNeedsClipboard(S.insertText)),u.push(new tDr(t,S,v,_)),y=!0}return Uee(v)&&d.add(v),f.push({providerName:_._debugDisplayName??"unknown_provider",elapsedProvider:v.duration??-1,elapsedOverall:b.elapsed()}),y},m=(async()=>{})();for(const _ of n.orderedGroups(e)){let v=!1;if(await Promise.all(_.map(async b=>{if(i.providerItemsToReuse.has(b)){const y=i.providerItemsToReuse.get(b);y.forEach(C=>u.push(C)),v=v||y.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const y=new Qc,C=await b.provideCompletionItems(e,t,r,s);v=g(b,C,y)||v}catch(y){ll(y)}})),v||s.isCancellationRequested)break}return await m,s.isCancellationRequested?(d.dispose(),Promise.reject(new rv)):new nDr(u.sort(sDr(i.snippetSortOrder)),p,{entries:f,elapsed:o.elapsed()},d)}function CIe(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 iDr(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return CIe(n,e)}function rDr(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return CIe(n,e)}const vne=new Map;vne.set(0,iDr);vne.set(2,rDr);vne.set(1,CIe);function sDr(n){return vne.get(n)}os.registerCommand("_executeCompletionItemProvider",async(n,...e)=>{const[t,i,r,s]=e;ys(vi.isUri(t)),ys(We.isIPosition(i)),ys(typeof r=="string"||!r),ys(typeof s=="number"||!s);const{completionProvider:o}=n.get(Fn),a=await n.get(Cf).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(i),d=await yIe(o,a.object.textEditorModel,u,void 0,{triggerCharacter:r??void 0,triggerKind:r?1:0});for(const f of d.items)c.length<(s??0)&&c.push(f.resolve(xr.None)),l.incomplete=l.incomplete||f.container.incomplete,l.suggestions.push(f.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}});function oDr(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))==null||t.triggerSuggest(new Set().add(e),void 0,!0)}class GR{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 SHe(n,e=Wu){return jdr(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}var aDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},lDr=function(n,e){return function(t,i){e(t,i,n)}};class EHe{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 kHe{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 s=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);s&&(i=s.value,r=s.multiline)}if(i&&r&&e.snippet){const s=this._model.getLineContent(this._selection.startLineNumber),o=_o(s,0,this._selection.startColumn-1);let a=o;e.snippet.walk(c=>c===e?!1:(c instanceof mh&&(a=_o(_1(c.value).pop())),!0));const l=GE(a,o);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 THe{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return lE(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=lE(this._model.uri.fsPath),r=i.lastIndexOf(".");return r<=0?i:i.slice(0,r)}else{if(t==="TM_DIRECTORY")return pot(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Tte(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 IHe{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=>!xot(r));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let QY=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}}};QY=aDr([lDr(2,wa)],QY);const Y0=class Y0{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 Y0.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Y0.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Y0.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Y0.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?"-":"+",s=Math.trunc(Math.abs(i/60)),o=s<10?"0"+s:s,a=Math.abs(i)-s*60,l=a<10?"0"+a:a;return r+o+":"+l}}};Y0.dayNames=[A("Sunday","Sunday"),A("Monday","Monday"),A("Tuesday","Tuesday"),A("Wednesday","Wednesday"),A("Thursday","Thursday"),A("Friday","Friday"),A("Saturday","Saturday")],Y0.dayNamesShort=[A("SundayShort","Sun"),A("MondayShort","Mon"),A("TuesdayShort","Tue"),A("WednesdayShort","Wed"),A("ThursdayShort","Thu"),A("FridayShort","Fri"),A("SaturdayShort","Sat")],Y0.monthNames=[A("January","January"),A("February","February"),A("March","March"),A("April","April"),A("May","May"),A("June","June"),A("July","July"),A("August","August"),A("September","September"),A("October","October"),A("November","November"),A("December","December")],Y0.monthNamesShort=[A("JanuaryShort","Jan"),A("FebruaryShort","Feb"),A("MarchShort","Mar"),A("AprilShort","Apr"),A("MayShort","May"),A("JuneShort","Jun"),A("JulyShort","Jul"),A("AugustShort","Aug"),A("SeptemberShort","Sep"),A("OctoberShort","Oct"),A("NovemberShort","Nov"),A("DecemberShort","Dec")];let XY=Y0;class LHe{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=tmr(this._workspaceService.getWorkspace());if(!Jgr(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(M_e(e))return lE(e.uri.path);let t=lE(e.configPath.path);return t.endsWith(j_e)&&(t=t.substr(0,t.length-j_e.length-1)),t}_resoveWorkspacePath(e){if(M_e(e))return SHe(e.uri.fsPath);const t=lE(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?SHe(i):"/"}}class AHe{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 lne()}}var cDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},uDr=function(n,e){return function(t,i){e(t,i,n)}},zv;const I_=class I_{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=B6e(t.placeholders,am.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),s=this._snippet.fullLen(i),o=ie.fromPositions(e.getPositionAt(this._offset+r),e.getPositionAt(this._offset+r+s)),a=i.isFinalTabstop?I_._decor.inactiveFinal:I_._decor.inactive,l=t.addDecoration(o,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const r=[];for(const s of this._placeholderGroups[this._placeholderGroupsIdx])if(s.transform){const o=this._placeholderDecorations.get(s),a=this._editor.getModel().getDecorationRange(o),l=this._editor.getModel().getValueInRange(a),c=s.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(ma.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 s=new Set,o=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);o.push(new Yn(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),r.changeDecorationOptions(l,a.isFinalTabstop?I_._decor.activeFinal:I_._decor.active),s.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);r.changeDecorationOptions(d,u.isFinalTabstop?I_._decor.activeFinal:I_._decor.active),s.add(u)}}for(const[a,l]of this._placeholderDecorations)s.has(a)||r.changeDecorationOptions(l,a.isFinalTabstop?I_._decor.inactiveFinal:I_._decor.inactive);return o});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof am){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 s=this._placeholderDecorations.get(r),o=this._editor.getModel().getDecorationRange(s);if(!o){e.delete(r.index);break}i.push(o)}}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 l3,!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 s=e.shift();console.assert(s._offset!==-1),console.assert(!s._placeholderDecorations);const o=s._snippet.placeholderInfo.last.index;for(const l of s._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=r.index+(o+1)/this._nestingLevel:l.index=r.index+l.index/this._nestingLevel;this._snippet.replace(r,s._snippet.children);const a=this._placeholderDecorations.get(r);i.removeDecoration(a),this._placeholderDecorations.delete(r);for(const l of s._snippet.placeholders){const c=s._snippet.offset(l),u=s._snippet.fullLen(l),d=ie.fromPositions(t.getPositionAt(s._offset+c),t.getPositionAt(s._offset+c+u)),f=i.addDecoration(d,I_._decor.inactive);this._placeholderDecorations.set(l,f)}}this._placeholderGroups=B6e(this._snippet.placeholders,am.compareByIndex)})}};I_._decor={active:ur.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:ur.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:ur.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:ur.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};let ZY=I_;const NHe={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let JY=zv=class{static adjustWhitespace(e,t,i,r,s){const o=e.getLineContent(t.lineNumber),a=_o(o,0,t.column-1);let l;return r.walk(c=>{if(!(c instanceof mh)||c.parent instanceof l3||s&&!s.has(c))return!0;const u=c.value.split(/\r\n|\r|\n/);if(i){const f=r.offset(c);if(f===0)u[0]=e.normalizeIndentation(u[0]);else{l=l??r.toString();const p=l.charCodeAt(f-1);(p===10||p===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let p=1;p<u.length;p++)u[p]=e.normalizeIndentation(a+u[p])}const d=u.join(e.getEOL());return d!==c.value&&(c.parent.replace(c,[new mh(d)]),l=void 0),!0}),a}static adjustSelection(e,t,i,r){if(i!==0||r!==0){const{positionLineNumber:s,positionColumn:o}=t,a=o-i,l=o+r,c=e.validateRange({startLineNumber:s,startColumn:a,endLineNumber:s,endColumn:l});t=Yn.createWithDirection(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn,t.getDirection())}return t}static createEditsAndSnippetsFromSelections(e,t,i,r,s,o,a,l,c){const u=[],d=[];if(!e.hasModel())return{edits:u,snippets:d};const f=e.getModel(),p=e.invokeWithinContext(C=>C.get(qL)),g=e.invokeWithinContext(C=>new THe(C.get(_M),f)),m=()=>a,_=f.getValueInRange(zv.adjustSelection(f,e.getSelection(),i,0)),v=f.getValueInRange(zv.adjustSelection(f,e.getSelection(),0,r)),b=f.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((C,S)=>({selection:C,idx:S})).sort((C,S)=>ie.compareRangesUsingStarts(C.selection,S.selection));for(const{selection:C,idx:S}of y){let k=zv.adjustSelection(f,C,i,0),I=zv.adjustSelection(f,C,0,r);_!==f.getValueInRange(k)&&(k=C),v!==f.getValueInRange(I)&&(I=C);const L=C.setStartPosition(k.startLineNumber,k.startColumn).setEndPosition(I.endLineNumber,I.endColumn),N=new eA().parse(t,!0,s),P=L.getStartPosition(),O=zv.adjustWhitespace(f,P,o||S>0&&b!==f.getLineFirstNonWhitespaceColumn(C.positionLineNumber),N);N.resolveVariables(new EHe([g,new IHe(m,S,y.length,e.getOption(79)==="spread"),new kHe(f,C,S,l),new QY(f,C,c),new XY,new LHe(p),new AHe])),u[S]=ma.replace(L,N.toString()),u[S].identifier={major:S,minor:0},u[S]._isTracked=!0,d[S]=new ZY(e,N,O)}return{edits:u,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,i,r,s,o,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),u=new eA,d=new b$,f=new EHe([e.invokeWithinContext(g=>new THe(g.get(_M),c)),new IHe(()=>s,0,e.getSelections().length,e.getOption(79)==="spread"),new kHe(c,e.getSelection(),0,o),new QY(c,e.getSelection(),a),new XY,new LHe(e.invokeWithinContext(g=>g.get(qL))),new AHe]);t=t.sort((g,m)=>ie.compareRangesUsingStarts(g.range,m.range));let p=0;for(let g=0;g<t.length;g++){const{range:m,template:_}=t[g];if(g>0){const S=t[g-1].range,k=ie.fromPositions(S.getEndPosition(),m.getStartPosition()),I=new mh(c.getValueInRange(k));d.appendChild(I),p+=I.value.length}const v=u.parseFragment(_,d);zv.adjustWhitespace(c,m.getStartPosition(),!0,d,new Set(v)),d.resolveVariables(f);const b=d.toString(),y=b.slice(p);p=b.length;const C=ma.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 ZY(e,d,"")]}}constructor(e,t,i=NHe,r){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=r,this._templateMerges=[],this._snippets=[]}dispose(){vo(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"?zv.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):zv.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(s=>!!s.identifier);for(let s=0;s<t.length;s++)t[s].initialize(r[s].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):r.map(s=>Yn.fromPositions(s.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=NHe){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:r}=zv.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,s=>{const o=s.filter(l=>!!l.identifier);for(let l=0;l<r.length;l++)r[l].initialize(o[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):o.map(l=>Yn.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[s,o]of r){o.sort(ie.compareRangesUsingStarts);for(const a of e)if(o[0].containsRange(a)){t.set(s,[]);break}}if(t.size===0)return!1;t.forEach((s,o)=>{s.push(...r.get(o))})}e.sort(ie.compareRangesUsingStarts);for(const[i,r]of t){if(r.length!==e.length){t.delete(i);continue}r.sort(ie.compareRangesUsingStarts);for(let s=0;s<r.length;s++)if(!r[s].containsRange(e[s])){t.delete(i);continue}}return t.size>0}};JY=zv=cDr([uDr(3,wa)],JY);var dDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},KW=function(n,e){return function(t,i){e(t,i,n)}},uR;const DHe={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var yy;let Oh=(yy=class{static get(e){return e.getContribution(uR.ID)}constructor(e,t,i,r,s){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=s,this._snippetListener=new Et,this._modelVersionId=-1,this._inSnippet=uR.InSnippetMode.bindTo(r),this._hasNextTabstop=uR.HasNextTabstop.bindTo(r),this._hasPrevTabstop=uR.HasPrevTabstop.bindTo(r)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)==null||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?DHe:{...DHe,...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?(ys(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new JY(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),(i=this._session)!=null&&i.hasChoice){const r={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(u,d)=>{if(!this._session||u!==this._editor.getModel()||!We.equals(this._editor.getPosition(),d))return;const{activeChoice:f}=this._session;if(!f||f.choice.options.length===0)return;const p=u.getValueInRange(f.range),g=!!f.choice.options.find(_=>_.value===p),m=[];for(let _=0;_<f.choice.options.length;_++){const v=f.choice.options[_];m.push({kind:13,label:v.value,insertText:v.value,sortText:"a".repeat(_+1),range:f.range,filterText:g?`${p}_${v.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:A("next","Go to next placeholder...")}})}return{suggestions:m}}},s=this._editor.getModel();let o,a=!1;const l=()=>{o==null||o.dispose(),a=!1},c=()=>{a||(o=this._languageFeaturesService.completionProvider.register({language:s.getLanguageId(),pattern:s.uri.fsPath,scheme:s.uri.scheme,exclusive:!0},r),this._snippetListener.add(o),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 t;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){(t=this._choiceCompletions)==null||t.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{oDr(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.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)==null||e.prev(),this._updateState()}next(){var e;(e=this._session)==null||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}},uR=yy,yy.ID="snippetController2",yy.InSnippetMode=new yn("inSnippetMode",!1,A("inSnippetMode","Whether the editor in current in snippet mode")),yy.HasNextTabstop=new yn("hasNextTabstop",!1,A("hasNextTabstop","Whether there is a next tab stop when in snippet mode")),yy.HasPrevTabstop=new yn("hasPrevTabstop",!1,A("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode")),yy);Oh=uR=dDr([KW(1,Uu),KW(2,Fn),KW(3,Oi),KW(4,wa)],Oh);cs(Oh.ID,Oh,4);const bne=pc.bindToContribution(Oh.get);gn(new bne({id:"jumpToNextSnippetPlaceholder",precondition:It.and(Oh.InSnippetMode,Oh.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:130,kbExpr:me.textInputFocus,primary:2}}));gn(new bne({id:"jumpToPrevSnippetPlaceholder",precondition:It.and(Oh.InSnippetMode,Oh.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:130,kbExpr:me.textInputFocus,primary:1026}}));gn(new bne({id:"leaveSnippet",precondition:Oh.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:130,kbExpr:me.textInputFocus,primary:9,secondary:[1033]}}));gn(new bne({id:"acceptSnippet",precondition:Oh.InSnippetMode,handler:n=>n.finish()}));var hDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Que=function(n,e){return function(t,i){e(t,i,n)}};let sye=class extends Ye{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,r,s,o,a,l,c,u,d,f){super(),this.textModel=e,this.selectedSuggestItem=t,this._textModelVersionId=i,this._positions=r,this._debounceValue=s,this._suggestPreviewEnabled=o,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=u,this._commandService=d,this._languageConfigurationService=f,this._source=this._register(this._instantiationService.createInstance(rye,this.textModel,this._textModelVersionId,this._debounceValue)),this._isActive=Ar(this,!1),this._forceUpdateExplicitlySignal=X4(this),this._selectedInlineCompletionId=Ar(this,void 0),this._primaryPosition=ai(this,g=>this._positions.read(g)[0]??new We(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([bC.Redo,bC.Undo,bC.AcceptWord]),this._fetchInlineCompletionsPromise=Glt({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Ib.Automatic}),handleChange:(g,m)=>(g.didChange(this._textModelVersionId)&&this._preserveCurrentCompletionReasons.has(this._getReason(g.change))?m.preserveCurrentCompletion=!0:g.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=Ib.Explicit),!0)},(g,m)=>{if(this._forceUpdateExplicitlySignal.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this._textModelVersionId.read(g);const v=this._source.suggestWidgetInlineCompletions.get(),b=this.selectedSuggestItem.read(g);if(v&&!b){const I=this._source.inlineCompletions.get();va(L=>{(!I||v.request.versionId>I.request.versionId)&&this._source.inlineCompletions.set(v.clone(),L),this._source.clearSuggestWidgetInlineCompletions(L)})}const y=this._primaryPosition.read(g),C={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:b==null?void 0:b.toSelectedSuggestionInfo()},S=this.selectedInlineCompletion.get(),k=m.preserveCurrentCompletion||S!=null&&S.forwardStable?S:void 0;return this._source.fetch(y,C,k)}),this._filteredInlineCompletionItems=Yp({owner:this,equalsFn:bG()},g=>{const m=this._source.inlineCompletions.read(g);if(!m)return[];const _=this._primaryPosition.read(g);return m.inlineCompletions.filter(b=>b.isVisible(this.textModel,_,g))}),this.selectedInlineCompletionIndex=ai(this,g=>{const m=this._selectedInlineCompletionId.read(g),_=this._filteredInlineCompletionItems.read(g),v=this._selectedInlineCompletionId===void 0?-1:_.findIndex(b=>b.semanticId===m);return v===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):v}),this.selectedInlineCompletion=ai(this,g=>{const m=this._filteredInlineCompletionItems.read(g),_=this.selectedInlineCompletionIndex.read(g);return m[_]}),this.activeCommands=Yp({owner:this,equalsFn:bG()},g=>{var m;return((m=this.selectedInlineCompletion.read(g))==null?void 0:m.inlineCompletion.source.inlineCompletions.commands)??[]}),this.lastTriggerKind=this._source.inlineCompletions.map(this,g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=ai(this,g=>{if(this.lastTriggerKind.read(g)===Ib.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=Yp({owner:this,equalsFn:(g,m)=>!g||!m?g===m:pHe(g.ghostTexts,m.ghostTexts)&&g.inlineCompletion===m.inlineCompletion&&g.suggestItem===m.suggestItem},g=>{const m=this.textModel,_=this.selectedSuggestItem.read(g);if(_){const v=bI(_.toSingleTextEdit(),m),b=this._computeAugmentation(v,g);if(!this._suggestPreviewEnabled.read(g)&&!b)return;const C=(b==null?void 0:b.edit)??v,S=b?b.edit.text.length-v.text.length:0,k=this._suggestPreviewMode.read(g),I=this._positions.read(g),L=[C,...Xue(this.textModel,I,C)],N=L.map((O,F)=>bHe(O,m,k,I[F],S)).filter(Oy),P=N[0]??new gB(C.range.endLineNumber,[]);return{edits:L,primaryGhostText:P,ghostTexts:N,inlineCompletion:b==null?void 0:b.completion,suggestItem:_}}else{if(!this._isActive.read(g))return;const v=this.selectedInlineCompletion.read(g);if(!v)return;const b=v.toSingleTextEdit(g),y=this._inlineSuggestMode.read(g),C=this._positions.read(g),S=[b,...Xue(this.textModel,C,b)],k=S.map((I,L)=>bHe(I,m,y,C[L],0)).filter(Oy);return k[0]?{edits:S,primaryGhostText:k[0],ghostTexts:k,inlineCompletion:v,suggestItem:void 0}:void 0}}),this.ghostTexts=Yp({owner:this,equalsFn:pHe},g=>{const m=this.state.read(g);if(m)return m.ghostTexts}),this.primaryGhostText=Yp({owner:this,equalsFn:Oft},g=>{const m=this.state.read(g);if(m)return m==null?void 0:m.primaryGhostText}),this._register(Z4(this._fetchInlineCompletionsPromise));let p;this._register(Gi(g=>{var v,b;const m=this.state.read(g),_=m==null?void 0:m.inlineCompletion;if((_==null?void 0:_.semanticId)!==(p==null?void 0:p.semanticId)&&(p=_,_)){const y=_.inlineCompletion,C=y.source;(b=(v=C.provider).handleItemDidShow)==null||b.call(v,C.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}_getReason(e){return e!=null&&e.isUndoing?bC.Undo:e!=null&&e.isRedoing?bC.Redo:this.isAcceptingPartially?bC.AcceptWord:bC.Other}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){KL(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){KL(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,r=this._source.suggestWidgetInlineCompletions.read(t),s=r?r.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Oy);return Dur(s,a=>{let l=a.toSingleTextEdit(t);return l=bI(l,i,ie.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),Bft(l,e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await 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)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){var r;if(e.getModel()!==this.textModel)throw new Ps;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(i.command&&i.source.addRef(),e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[ma.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(r=Oh.get(e))==null||r.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const s=t.edits,o=RHe(s).map(a=>Yn.fromPositions(a));e.executeEdits("inlineSuggestion.accept",[...s.map(a=>ma.replace(a.range,a.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}this.stop(),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,ll),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const r=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),s=this._languageConfigurationService.getLanguageConfiguration(r),o=new RegExp(s.wordDefinition.source,s.wordDefinition.flags.replace("g","")),a=i.match(o);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},0)}async acceptNextLine(e){await this._acceptNext(e,(t,i)=>{const r=i.match(/\n/);return r&&r.index!==void 0?r.index+1:i.length},1)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new Ps;const r=this.state.get();if(!r||r.primaryGhostText.isEmpty()||!r.inlineCompletion)return;const s=r.primaryGhostText,o=r.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){await this.accept(e);return}const a=s.parts[0],l=new We(s.lineNumber,a.column),c=a.text,u=t(l,c);if(u===c.length&&s.parts.length===1){this.accept(e);return}const d=c.substring(0,u),f=this._positions.get(),p=f[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const g=ie.fromPositions(p,l),m=e.getModel().getValueInRange(g)+d,_=new Gy(g,m),v=[_,...Xue(this.textModel,f,_)],b=RHe(v).map(y=>Yn.fromPositions(y));e.executeEdits("inlineSuggestion.accept",v.map(y=>ma.replace(y.range,y.text))),e.setSelections(b,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const g=ie.fromPositions(o.range.getStartPosition(),av.ofText(d).addToPosition(l)),m=e.getModel().getValueInRange(g,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,m.length,{kind:i})}}finally{o.source.removeRef()}}handleSuggestAccepted(e){var s,o;const t=bI(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const r=i.completion.inlineCompletion;(o=(s=r.source.provider).handlePartialAccept)==null||o.call(s,r.source.inlineCompletions,r.sourceInlineCompletion,t.text.length,{kind:2})}};sye=hDr([Que(9,mi),Que(10,Fo),Que(11,wa)],sye);var bC;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(bC||(bC={}));function Xue(n,e,t){if(e.length===1)return[];const i=e[0],r=e.slice(1),s=t.range.getStartPosition(),o=t.range.getEndPosition(),a=n.getValueInRange(ie.fromPositions(i,o)),l=gHe(i,s);if(l.lineNumber<1)return tr(new Ps(`positionWithinTextEdit line number should be bigger than 0. Invalid subtraction between ${i.toString()} and ${s.toString()}`)),[];const c=fDr(t.text,l);return r.map(u=>{const d=FNr(gHe(u,s),o),f=n.getValueInRange(ie.fromPositions(u,d)),p=GE(a,f),g=ie.fromPositions(u,u.delta(0,p));return new Gy(g,c)})}function fDr(n,e){let t="";const i=oar(n);for(let r=e.lineNumber-1;r<i.length;r++)t+=i[r].substring(r===e.lineNumber-1?e.column-1:0);return t}function RHe(n){const e=EK.createSortPermutation(n,kh(s=>s.range,ie.compareRangesUsingStarts)),i=new Fke(e.apply(n)).getNewRanges();return e.inverse().apply(i).map(s=>s.getEndPosition())}var pDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},PHe=function(n,e){return function(t,i){e(t,i,n)}},aF;class wIe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const r=i[0].score[0];for(let s=0;s<i.length;s++){const{score:o,completion:a}=i[s];if(o[0]!==r)break;if(a.preselect)return s}return 0}}class OHe extends wIe{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class gDr extends wIe{constructor(){super("recentlyUsed"),this._cache=new b1(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 s=i[0].score[0];let o=-1,a=-1,l=-1;for(let c=0;c<i.length&&i[c].score[0]===s;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&&o===-1)return o=c}return a!==-1?a:o!==-1?o: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:i7.fromString(r.type),this._cache.set(i,r);this._seq=this._cache.size}}class mDr extends wIe{constructor(){super("recentlyUsedByPrefix"),this._trie=jP.forStrings(),this._seq=0}memorize(e,t,i){const{word:r}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${r}`;this._trie.set(s,{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 s=`${e.getLanguageId()}/${r}`;let o=this._trie.get(s);if(o||(o=this._trie.findSubstr(s)),o)for(let a=0;a<i.length;a++){const{kind:l,insertText:c}=i[a].completion;if(l===o.type&&c===o.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:i7.fromString(i.type),this._trie.set(t,i)}}}var SE;let oye=(SE=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Et,this._persistSoon=new ao(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===D7.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 r;const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((r=this._strategy)==null?void 0:r.name)!==i){this._saveState();const s=aF._strategyCtors.get(i)||OHe;this._strategy=new s;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${aF._storagePrefix}/${i}`,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(`${aF._storagePrefix}/${this._strategy.name}`,i,t,1)}}},aF=SE,SE._strategyCtors=new Map([["recentlyUsedByPrefix",mDr],["recentlyUsed",gDr],["first",OHe]]),SE._storagePrefix="suggest/memories",SE);oye=aF=pDr([PHe(0,yv),PHe(1,Dr)],oye);const yne=Ur("ISuggestMemories");ns(yne,oye,1);var _Dr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},vDr=function(n,e){return function(t,i){e(t,i,n)}},aye,YI;let eQ=(YI=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=aye.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(124)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)==null||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(124)==="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(),s=i.getWordAtPosition(r.getStartPosition());if(!s){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(s.endColumn===r.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},aye=YI,YI.AtEnd=new yn("atEndOfWord",!1),YI);eQ=aye=_Dr([vDr(1,Oi)],eQ);var bDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},yDr=function(n,e){return function(t,i){e(t,i,n)}},lF,QI;let FM=(QI=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=lF.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)==null||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(lF._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 s=t.items.length;s>0&&(r=(r+t.items.length+(e?1:-1))%t.items.length,!(r===i||!t.items[r].completion.additionalTextEdits));s--);return r}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=lF._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},lF=QI,QI.OtherSuggestions=new yn("hasOtherSuggestions",!1),QI);FM=lF=bDr([yDr(1,Oi)],FM);class CDr{constructor(e,t,i,r){this._disposables=new Et,this._disposables.add(i.onDidSuggest(s=>{s.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(s=>{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(s=>{if(this._active&&!t.isFrozen()&&i.state!==0){const o=s.charCodeAt(s.length-1);this._active.acceptCharacters.has(o)&&e.getOption(0)&&r(this._active.item)}}))}_onItem(e){if(!e||!Gd(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new XK;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()}}const Zg=class Zg{async provideSelectionRanges(e,t){const i=[];for(const r of t){const s=[];i.push(s);const o=new Map;await new Promise(a=>Zg._bracketsRightYield(a,0,e,r,o)),await new Promise(a=>Zg._bracketsLeftYield(a,0,e,r,o,s))}return i}static _bracketsRightYield(e,t,i,r,s){const o=new Map,a=Date.now();for(;;){if(t>=Zg._maxRounds){e();break}if(!r){e();break}const l=i.bracketPairs.findNextBracket(r);if(!l){e();break}if(Date.now()-a>Zg._maxDuration){setTimeout(()=>Zg._bracketsRightYield(e,t+1,i,r,s));break}if(l.bracketInfo.isOpeningBracket){const u=l.bracketInfo.bracketText,d=o.has(u)?o.get(u):0;o.set(u,d+1)}else{const u=l.bracketInfo.getOpeningBrackets()[0].bracketText;let d=o.has(u)?o.get(u):0;if(d-=1,o.set(u,Math.max(0,d)),d<0){let f=s.get(u);f||(f=new Ch,s.set(u,f)),f.push(l.range)}}r=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,r,s,o){const a=new Map,l=Date.now();for(;;){if(t>=Zg._maxRounds&&s.size===0){e();break}if(!r){e();break}const c=i.bracketPairs.findPrevBracket(r);if(!c){e();break}if(Date.now()-l>Zg._maxDuration){setTimeout(()=>Zg._bracketsLeftYield(e,t+1,i,r,s,o));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText;let f=a.has(d)?a.get(d):0;if(f-=1,a.set(d,Math.max(0,f)),f<0){const p=s.get(d);if(p){const g=p.shift();p.size===0&&s.delete(d);const m=ie.fromPositions(c.range.getEndPosition(),g.getStartPosition()),_=ie.fromPositions(c.range.getStartPosition(),g.getEndPosition());o.push({range:m}),o.push({range:_}),Zg._addBracketLeading(i,_,o)}}}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText,f=a.has(d)?a.get(d):0;a.set(d,f+1)}r=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const r=t.startLineNumber,s=e.getLineFirstNonWhitespaceColumn(r);s!==0&&s!==t.startColumn&&(i.push({range:ie.fromPositions(new We(r,s),t.getEndPosition())}),i.push({range:ie.fromPositions(new We(r,1),t.getEndPosition())}));const o=r-1;if(o>0){const a=e.getLineFirstNonWhitespaceColumn(o);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(o)&&(i.push({range:ie.fromPositions(new We(o,a),t.getEndPosition())}),i.push({range:ie.fromPositions(new We(o,1),t.getEndPosition())}))}}};Zg._maxDuration=30,Zg._maxRounds=2;let tQ=Zg;const Q0=class Q0{static async create(e,t){if(!t.getOption(119).localityBonus||!t.hasModel())return Q0.None;const i=t.getModel(),r=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Q0.None;const[s]=await new tQ().provideSelectionRanges(i,[r]);if(s.length===0)return Q0.None;const o=await e.computeWordRanges(i.uri,s[0].range);if(!o)return Q0.None;const a=i.getWordUntilPosition(r);return delete o[a.word],new class extends Q0{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=o[u];if(Wst(d))return 2<<20;const f=X8(d,ie.fromPositions(l),ie.compareRangesUsingStarts),p=f>=0?d[f]:d[Math.max(0,~f-1)];let g=s.length;for(const m of s){if(!ie.containsRange(m.range,p))break;g-=1}return g}}}};Q0.None=new class extends Q0{distance(){return 0}};let nQ=Q0,MHe=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class IS{constructor(e,t,i,r,s,o,a=E7.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=IS._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=r,this._options=s,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,o==="top"?this._snippetCompareFn=IS._compareCompletionItemsSnippetsUp:o==="bottom"&&(this._snippetCompareFn=IS._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="",s="";const o=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||o.length>2e3?UL:xpr;for(let c=0;c<o.length;c++){const u=o[c];if(u.isInvalid)continue;const d=this._itemsByProvider.get(u.provider);d?d.push(u):this._itemsByProvider.set(u.provider,[u]);const f=u.position.column-u.editStart.column,p=f+i-(u.position.column-this._column);if(r.length!==p&&(r=p===0?"":t.slice(-p),s=r.toLowerCase()),u.word=r,p===0)u.score=Db.Default;else{let g=0;for(;g<f;){const m=r.charCodeAt(g);if(m===32||m===9)g+=1;else break}if(g>=p)u.score=Db.Default;else if(typeof u.completion.filterText=="string"){const m=l(r,s,g,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;Sme(u.completion.filterText,u.textLabel)===0?u.score=m:(u.score=bpr(r,s,g,u.textLabel,u.labelLow,0),u.score[0]=m[0])}else{const m=l(r,s,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?gge(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 IS._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 IS._compareCompletionItems(e,t)}}var wDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Yx=function(n,e){return function(t,i){e(t,i,n)}},lye;class KT{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 xDr(n,e,t){if(!e.getContextKeyValue(np.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(np.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}function SDr(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(np.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}let iQ=lye=class{constructor(e,t,i,r,s,o,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=r,this._logService=s,this._contextKeyService=o,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new Et,this._triggerCharacterListener=new Et,this._triggerQuickSuggest=new vv,this._triggerState=void 0,this._completionDisposables=new Et,this._onDidCancel=new Ue,this._onDidTrigger=new Ue,this._onDidSuggest=new Ue,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Yn(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(){vo(this._triggerCharacterListener),vo([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(92)||!this._editor.hasModel()||!this._editor.getOption(122))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const r of i.triggerCharacters||[]){let s=e.get(r);s||(s=new Set,e.set(r,s)),s.add(i)}const t=i=>{var o;if(!SDr(this._editor,this._contextKeyService,this._configurationService)||KT.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let r="";FL(i.charCodeAt(i.length-1))?Ec(i.charCodeAt(i.length-2))&&(r=i.substr(i.length-2)):r=i.charAt(i.length-1);const s=e.get(r);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:r,retrigger:!!this._completionModel,clipboardText:(o=this._completionModel)==null?void 0:o.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.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;GR.isAllOff(this._editor.getOption(90))||this._editor.getOption(119).snippetsPreventQuickSuggestions&&((e=Oh.get(this._editor))!=null&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!KT.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),r=this._editor.getOption(90);if(!GR.isAllOff(r)){if(!GR.isAllOn(r)){t.tokenization.tokenizeIfCheap(i.lineNumber);const s=t.tokenization.getLineTokens(i.lineNumber),o=s.getStandardTokenType(s.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(GR.valueFor(r,o)!=="on")return}xDr(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(91)))}_refilterCompletionItems(){ys(this._editor.hasModel()),ys(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new KT(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){var f,p,g;if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new KT(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let r={triggerKind:e.triggerKind??0};e.triggerCharacter&&(r={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new ba;const s=this._editor.getOption(113);let o=1;switch(s){case"top":o=0;break;case"bottom":o=2;break}const{itemKind:a,showDeprecated:l}=lye.createSuggestFilter(this._editor),c=new mB(o,((f=e.completionOptions)==null?void 0:f.kindFilter)??a,(p=e.completionOptions)==null?void 0:p.providerFilter,(g=e.completionOptions)==null?void 0:g.providerItemsToReuse,l),u=nQ.create(this._editorWorkerService,this._editor),d=yIe(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),c,r,this._requestToken.token);Promise.all([d,u]).then(async([m,_])=>{var S;if((S=this._requestToken)==null||S.dispose(),!this._editor.hasModel())return;let v=e==null?void 0:e.clipboardText;if(!v&&m.needsClipboard&&(v=await this._clipboardService.readText()),this._triggerState===void 0)return;const b=this._editor.getModel(),y=new KT(b,this._editor.getPosition(),e),C={...E7.default,firstMatchCanBeWeak:!this._editor.getOption(119).matchOnWordStartOnly};if(this._completionModel=new IS(m.items,this._context.column,{leadingLineContent:y.leadingLineContent,characterCountDelta:y.column-this._context.column},_,this._editor.getOption(119),this._editor.getOption(113),C,v),this._completionDisposables.add(m.disposable),this._onNewContext(y),this._reportDurationsTelemetry(m.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const k of m.items)k.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${k.provider._debugDisplayName}`,k.completion)}).catch(tr)}_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(113)==="none"&&t.add(27);const r=e.getOption(119);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(_o(e.leadingLineContent)!==_o(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(KT.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,s]of this._completionModel.getItemsByProvider())s.length>0&&s[0].container.incomplete?i.add(r):t.set(r,s);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=KT.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})}}}}};iQ=lye=wDr([Yx(1,Sf),Yx(2,tx),Yx(3,md),Yx(4,Uu),Yx(5,Oi),Yx(6,Dr),Yx(7,Fn),Yx(8,Vke)],iQ);const AX=class AX{constructor(e,t){this._disposables=new Et,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),r=i.length;let s=!1;for(let a=0;a<r;a++)if(!i[a].isEmpty()){s=!0;break}if(!s){this._lastOvertyped.length!==0&&(this._lastOvertyped.length=0);return}this._lastOvertyped=[];const o=e.getModel();for(let a=0;a<r;a++){const l=i[a];if(o.getValueLengthInRange(l)>AX._maxSelectionLength)return;this._lastOvertyped[a]={value:o.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()}};AX._maxSelectionLength=51200;let cye=AX;var EDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Zue=function(n,e){return function(t,i){e(t,i,n)}};let uye=class{constructor(e,t,i,r,s){this._menuId=t,this._menuService=r,this._contextKeyService=s,this._menuDisposables=new Et,this.element=Ot(e,Jt(".suggest-status-bar"));const o=a=>a instanceof Jf?i.createInstance(yTe,a,{useComma:!0}):void 0;this._leftActions=new hg(this.element,{actionViewItemProvider:o}),this._rightActions=new hg(this.element,{actionViewItemProvider:o}),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[s,o]of e.getActions())s==="left"?i.push(...o):r.push(...o);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()}};uye=EDr([Zue(2,mi),Zue(3,Eg),Zue(4,Oi)],uye);var kDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},TDr=function(n,e){return function(t,i){e(t,i,n)}};function xIe(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let dye=class{constructor(e,t){this._editor=e,this._onDidClose=new Ue,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new Ue,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Et,this._renderDisposeable=new Et,this._borderWidth=1,this._size=new Ys(330,0),this.domNode=Jt(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Pw,{editor:e}),this._body=Jt(".body"),this._scrollbar=new Z9(this._body,{alwaysConsumeMouseWheel:!0}),Ot(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Ot(this._body,Jt(".header")),this._close=Ot(this._header,Jt("span"+Ni.asCSSSelector(Yt.close))),this._close.title=A("details.close","Close"),this._type=Ot(this._header,Jt("p.type")),this._docs=Ot(this._body,Jt("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(120)||t.fontSize,s=e.get(121)||t.lineHeight,o=t.fontWeight,a=`${r}px`,l=`${s}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${s/r}`,this.domNode.style.fontWeight=o,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(121)||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=A("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 s;this._renderDisposeable.clear();let{detail:i,documentation:r}=e.completion;if(t){let o="";o+=`score: ${e.score[0]} `,o+=`prefix: ${e.word??"(no prefix)"} `,o+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,o+=`distance: ${e.distance} (localityBonus-setting) `,o+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,o+=`commit_chars: ${(s=e.completion.commitCharacters)==null?void 0:s.join("")} `,r=new rd().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!xIe(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const o=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=o,this._type.title=o,qf(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else mu(this._type),this._type.title="",ph(this._type),this.domNode.classList.add("no-type");if(mu(this._docs),typeof r=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),mu(this._docs);const o=this._markdownRenderer.render(r);this._docs.appendChild(o.element),this._renderDisposeable.add(o),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=o=>{o.preventDefault(),o.stopPropagation()},this._close.onclick=o=>{o.preventDefault(),o.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 isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new Ys(e,t);Ys.equals(i,this._size)||(this._size=i,flr(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}};dye=kDr([TDr(1,mi)],dye);class IDr{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Et,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new nIe,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,r,s=0,o=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&&(o=r.width-a.dimension.width,l=!0),a.north&&(s=r.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+s,left:i.left+o})}a.done&&(i=void 0,r=void 0,s=0,o=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??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 this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),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){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const r=ZE(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),o=new Ys(220,2*s.lineHeight),a=e.top,l=function(){const S=r.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),k=-s.borderWidth+e.left+e.width,I=new Ys(S,r.height-e.top-s.borderHeight-s.verticalPadding),L=I.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:k,fit:S-t.width,maxSizeTop:I,maxSizeBottom:L,minSize:o.with(Math.min(S,o.width))}}(),c=function(){const S=e.left-s.borderWidth-s.horizontalPadding,k=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),I=new Ys(S,r.height-e.top-s.borderHeight-s.verticalPadding),L=I.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:k,fit:S-t.width,maxSizeTop:I,maxSizeBottom:L,minSize:o.with(Math.min(S,o.width))}}(),u=function(){const S=e.left,k=-s.borderWidth+e.top+e.height,I=new Ys(e.width-s.borderHeight,r.height-e.top-e.height-s.verticalPadding);return{top:k,left:S,fit:I.height-t.height,maxSizeBottom:I,maxSizeTop:I,minSize:o.with(I.width)}}(),d=[l,c,u],f=d.find(S=>S.fit>=0)??d.sort((S,k)=>k.fit-S.fit)[0],p=e.top+e.height-s.borderHeight;let g,m=t.height;const _=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);m>_&&(m=_);let v;i?m<=f.maxSizeTop.height?(g=!0,v=f.maxSizeTop):(g=!1,v=f.maxSizeBottom):m<=f.maxSizeBottom.height?(g=!1,v=f.maxSizeBottom):(g=!0,v=f.maxSizeTop);let{top:b,left:y}=f;!g&&m>e.height&&(b=p-m);const C=this._editor.getDomNode();if(C){const S=C.getBoundingClientRect();b-=S.top,y-=S.left}this._applyTopLeft({left:y,top:b}),this._resizable.enableSashes(!g,f===l,g,f!==l),this._resizable.minSize=f.minSize,this._resizable.maxSize=v,this._resizable.layout(m,Math.min(v.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}var Ty;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(Ty||(Ty={}));const LDr=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function GW(n,e,t,i,r){if(Ni.isThemeIcon(r))return[`codicon-${r.id}`,"predefined-file-icon"];if(vi.isUri(r))return[];const s=i===Ty.ROOT_FOLDER?["rootfolder-icon"]:i===Ty.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===ir.data)o=tk.parseMetaData(t).get(tk.META_DATA_LABEL);else{const a=t.path.match(LDr);a?(o=YW(a[2].toLowerCase()),a[1]&&s.push(`${YW(a[1].toLowerCase())}-name-dir-icon`)):o=YW(t.authority.toLowerCase())}if(i===Ty.ROOT_FOLDER)s.push(`${o}-root-name-folder-icon`);else if(i===Ty.FOLDER)s.push(`${o}-name-folder-icon`);else{if(o){if(s.push(`${o}-name-file-icon`),s.push("name-file-icon"),o.length<=255){const l=o.split(".");for(let c=1;c<l.length;c++)s.push(`${l.slice(c).join(".")}-ext-file-icon`)}s.push("ext-file-icon")}const a=ADr(n,e,t);a&&s.push(`${YW(a)}-lang-file-icon`)}}return s}function ADr(n,e,t){if(!t)return null;let i=null;if(t.scheme===ir.data){const s=tk.parseMetaData(t).get(tk.META_DATA_MIME);s&&(i=e.getLanguageIdByMimeType(s))}else{const r=n.getModel(t);r&&(i=r.getLanguageId())}return i&&i!==Ih?i:e.guessLanguageIdByFilepathOrFirstLine(t)}function YW(n){return n.replace(/[\s]/g,"/")}var NDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Jue=function(n,e){return function(t,i){e(t,i,n)}};function $ft(n){return`suggest-aria-id:${n}`}const DDr=Zo("suggest-more-info",Yt.chevronRight,A("suggestMoreInfoIcon","Icon for more information in the suggest widget."));var cb;const RDr=new(cb=class{extract(e,t){if(e.textLabel.match(cb._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(cb._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const i=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,r=cb._regexRelaxed.exec(i);if(r&&(r.index===0||r.index+r[0].length===i.length))return t[0]=r[0],!0}return!1}},cb._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*\))/,cb._regexStrict=new RegExp(`^${cb._regexRelaxed.source}$`,"i"),cb);let hye=class{constructor(e,t,i,r){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=r,this._onDidToggleDetails=new Ue,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Et,i=e;i.classList.add("show-file-icons");const r=Ot(e,Jt(".icon")),s=Ot(r,Jt("span.colorspan")),o=Ot(e,Jt(".contents")),a=Ot(o,Jt(".main")),l=Ot(a,Jt(".icon-label.codicon")),c=Ot(a,Jt("span.left")),u=Ot(a,Jt("span.right")),d=new qG(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const f=Ot(c,Jt("span.signature-label")),p=Ot(c,Jt("span.qualifier-label")),g=Ot(u,Jt("span.details-label")),m=Ot(u,Jt("span.readMore"+Ni.asCSSSelector(DDr)));return m.title=A("readMore","Read More"),{root:i,left:c,right:u,icon:r,colorspan:s,iconLabel:d,iconContainer:l,parametersLabel:f,qualifierLabel:p,detailsLabel:g,readMore:m,disposables:t,configureFont:()=>{const v=this._editor.getOptions(),b=v.get(50),y=b.getMassagedFontFamily(),C=b.fontFeatureSettings,S=v.get(120)||b.fontSize,k=v.get(121)||b.lineHeight,I=b.fontWeight,L=b.letterSpacing,N=`${S}px`,P=`${k}px`,O=`${L}px`;i.style.fontSize=N,i.style.fontWeight=I,i.style.letterSpacing=O,a.style.fontFamily=y,a.style.fontFeatureSettings=C,a.style.lineHeight=P,r.style.height=P,r.style.width=P,m.style.height=P,m.style.width=P}}}renderElement(e,t,i){i.configureFont();const{completion:r}=e;i.root.id=$ft(t),i.colorspan.style.backgroundColor="";const s={labelEscapeNewLines:!0,matches:J9(e.score)},o=[];if(r.kind===19&&RDr.extract(e,o))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=o[0];else if(r.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=GW(this._modelService,this._languageService,vi.from({scheme:"fake",path:e.textLabel}),Ty.FILE),l=GW(this._modelService,this._languageService,vi.from({scheme:"fake",path:r.detail}),Ty.FILE);s.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",s.extraClasses=[GW(this._modelService,this._languageService,vi.from({scheme:"fake",path:e.textLabel}),Ty.FOLDER),GW(this._modelService,this._languageService,vi.from({scheme:"fake",path:r.detail}),Ty.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...Ni.asClassNameArray(i7.toIcon(r.kind))));r.tags&&r.tags.indexOf(1)>=0&&(s.extraClasses=(s.extraClasses||[]).concat(["deprecated"]),s.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,s),typeof r.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=ede(r.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=ede(r.label.detail||""),i.detailsLabel.textContent=ede(r.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(119).showInlineDetails?qf(i.detailsLabel):ph(i.detailsLabel),xIe(e)?(i.right.classList.add("can-expand-details"),qf(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"),ph(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};hye=NDr([Jue(1,Xo),Jue(2,pa),Jue(3,mc)],hye);function ede(n){return n.replace(/\r\n|\r|\n/g,"")}var PDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},QW=function(n,e){return function(t,i){e(t,i,n)}},dR;ve("editorSuggestWidget.background",ig,A("editorSuggestWidgetBackground","Background color of the suggest widget."));ve("editorSuggestWidget.border",Kke,A("editorSuggestWidgetBorder","Border color of the suggest widget."));const ODr=ve("editorSuggestWidget.foreground",y1,A("editorSuggestWidgetForeground","Foreground color of the suggest widget."));ve("editorSuggestWidget.selectedForeground",C7,A("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));ve("editorSuggestWidget.selectedIconForeground",eTe,A("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const MDr=ve("editorSuggestWidget.selectedBackground",w7,A("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));ve("editorSuggestWidget.highlightForeground",DR,A("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));ve("editorSuggestWidget.focusHighlightForeground",xfr,A("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));ve("editorSuggestWidgetStatus.foreground",Ir(ODr,.5),A("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class jDr{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof uv}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(Ys.is(t))return Ys.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}var EE;let fye=(EE=class{constructor(e,t,i,r,s){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Dc,this._pendingShowDetails=new Dc,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new vv,this._disposables=new Et,this._onDidSelect=new ML,this._onDidFocus=new ML,this._onDidHide=new Ue,this._onDidShow=new Ue,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new Ue,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new nIe,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new FDr(this,e),this._persistedSize=new jDr(t,e);class o{constructor(p,g,m=!1,_=!1){this.persistedSize=p,this.currentSize=g,this.persistHeight=m,this.persistWidth=_}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new o(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(f=>{var p,g;if(this._resize(f.dimension.width,f.dimension.height),a&&(a.persistHeight=a.persistHeight||!!f.north||!!f.south,a.persistWidth=a.persistWidth||!!f.east||!!f.west),!!f.done){if(a){const{itemHeight:m,defaultSize:_}=this.getLayoutInfo(),v=Math.round(m/2);let{width:b,height:y}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-y)<=v)&&(y=((p=a.persistedSize)==null?void 0:p.height)??_.height),(!a.persistWidth||Math.abs(a.currentSize.width-b)<=v)&&(b=((g=a.persistedSize)==null?void 0:g.width)??_.width),this._persistedSize.store(new Ys(b,y))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Ot(this.element.domNode,Jt(".message")),this._listElement=Ot(this.element.domNode,Jt(".tree"));const l=this._disposables.add(s.createInstance(dye,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new IDr(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(119).showIcons);c();const u=s.createInstance(hye,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Ig("SuggestWidget",this._listElement,{getHeight:f=>this.getLayoutInfo().itemHeight,getTemplateId:f=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>A("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:f=>{let p=f.textLabel;if(typeof f.completion.label!="string"){const{detail:v,description:b}=f.completion.label;v&&b?p=A("label.full","{0} {1}, {2}",p,v,b):v?p=A("label.detail","{0} {1}",p,v):b&&(p=A("label.desc","{0}, {1}",p,b))}if(!f.isResolved||!this._isDetailsVisible())return p;const{documentation:g,detail:m}=f.completion,_=jL("{0}{1}",m||"",g?typeof g=="string"?g:g.value:"");return A("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",p,_)}}}),this._list.style(zA({listInactiveFocusBackground:MDr,listInactiveFocusOutline:aa})),this._status=s.createInstance(uye,this.element.domNode,pE);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(119).showStatusBar);d(),this._disposables.add(r.onDidColorThemeChange(f=>this._onThemeChange(f))),this._onThemeChange(r.getColorTheme()),this._disposables.add(this._list.onMouseDown(f=>this._onListMouseDownOrTap(f))),this._disposables.add(this._list.onTap(f=>this._onListMouseDownOrTap(f))),this._disposables.add(this._list.onDidChangeSelection(f=>this._onListSelection(f))),this._disposables.add(this._list.onDidChangeFocus(f=>this._onListFocus(f))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(f=>{f.hasChanged(119)&&(d(),c()),this._completionModel&&(f.hasChanged(50)||f.hasChanged(120)||f.hasChanged(121))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=Tr.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Tr.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Tr.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Tr.HasFocusedSuggestion.bindTo(i),this._disposables.add(Da(this._details.widget.domNode,"keydown",f=>{this._onDetailsKeydown.fire(f)})),this._disposables.add(this.editor.onMouseDown(f=>this._onEditorMouseDown(f)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)==null||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=Ab(e.type)?2:1}_onListFocus(e){var r;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 t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&((r=this._currentSuggestionDetails)==null||r.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=Ic(async s=>{const o=XE(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=s.onCancellationRequested(()=>o.dispose());try{return await t.resolve(s)}finally{o.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:$ft(i)}))}).catch(tr)),this._onDidFocus.fire({item:t,index:i,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:ph(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=dR.LOADING_MESSAGE,ph(this._listElement,this._status.element),qf(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Xy(dR.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=dR.NO_SUGGESTIONS_MESSAGE,ph(this._listElement,this._status.element),qf(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Xy(dR.NO_SUGGESTIONS_MESSAGE);break;case 3:ph(this._messageElement),qf(this._listElement,this._status.element),this._show();break;case 4:ph(this._messageElement),qf(this._listElement,this._status.element),this._show();break;case 5:ph(this._messageElement),qf(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=XE(()=>this._setState(1),t)))}showSuggestions(e,t,i,r,s){var l,c;if(this._contentWidget.setPosition(this.editor.getPosition()),(l=this._loadingTimeout)==null||l.dispose(),(c=this._currentSuggestionDetails)==null||c.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const o=this._completionModel.items.length,a=o===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(o>1),a){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(s?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=WK(Ti(this.element.domNode),()=>{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")):(xIe(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=WK(Ti(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details")),this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var i;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(i=this._loadingTimeout)==null||i.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.height<t&&this._persistedSize.store(e.with(void 0,t))}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.widget.isEmpty&&this._details.show(),this._positionDetails())}_layout(e){var o,a;if(!this.editor.hasModel()||!this.editor.getDomNode())return;const t=ZE(this.element.domNode.ownerDocument.body),i=this.getLayoutInfo();e||(e=i.defaultSize);let r=e.height,s=e.width;if(this._status.element.style.height=`${i.itemHeight}px`,this._state===2||this._state===1)r=i.itemHeight+i.borderHeight,s=i.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new Ys(s,r),this._contentWidget.setPreference(2);else{const l=t.width-i.borderHeight-2*i.horizontalPadding;s>l&&(s=l);const c=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:s,u=i.statusBarHeight+this._list.contentHeight+i.borderHeight,d=i.itemHeight+i.statusBarHeight,f=al(this.editor.getDomNode()),p=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),g=f.top+p.top+p.height,m=Math.min(t.height-g-i.verticalPadding,u),_=f.top+p.top-i.verticalPadding,v=Math.min(_,u);let b=Math.min(Math.max(v,m)+i.borderHeight,u);r===((o=this._cappedHeight)==null?void 0:o.capped)&&(r=this._cappedHeight.wanted),r<d&&(r=d),r>b&&(r=b),r>m||this._forceRenderingAbove&&_>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),b=v):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),b=m),this.element.preferredSize=new Ys(c,i.defaultSize.height),this.element.maxSize=new Ys(l,b),this.element.minSize=new Ys(220,d),this._cappedHeight=r===u?{wanted:((a=this._cappedHeight)==null?void 0:a.wanted)??e.height,capped:r}:void 0}this._resize(s,r)}_resize(e,t){const{width:i,height:r}=this.element.maxSize;e=Math.min(i,e),t=Math.min(r,t);const{statusBarHeight:s}=this.getLayoutInfo();this._list.layout(t-s,e),this._listElement.style.height=`${t-s}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?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=hh(this.editor.getOption(121)||e.lineHeight,8,1e3),i=!this.editor.getOption(119).showStatusBar||this._state===2||this._state===1?0:t,r=this._details.widget.borderWidth,s=2*r;return{itemHeight:t,statusBarHeight:i,borderWidth:r,borderHeight:s,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Ys(430,i+12*t+s)}}_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}},dR=EE,EE.LOADING_MESSAGE=A("suggestWidget.loading","Loading..."),EE.NO_SUGGESTIONS_MESSAGE=A("suggestWidget.noSuggestions","No suggestions."),EE);fye=dR=PDr([QW(1,yv),QW(2,Oi),QW(3,mc),QW(4,mi)],fye);class FDr{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 Ys(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 BDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},qD=function(n,e){return function(t,i){e(t,i,n)}},pye;class $Dr{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=ur.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const r=e.getOffsetAt(t),s=e.getPositionAt(r+1);e.changeDecorations(o=>{this._marker&&o.removeDecoration(this._marker),this._marker=o.addDecoration(ie.fromPositions(t,s),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}var XI;let H_=(XI=class{static get(e){return e.getContribution(pye.ID)}constructor(e,t,i,r,s,o,a){this._memoryService=t,this._commandService=i,this._contextKeyService=r,this._instantiationService=s,this._logService=o,this._telemetryService=a,this._lineSuffix=new Dc,this._toDispose=new Et,this._selectors=new HDr(d=>d.priority),this._onWillInsertSuggestItem=new Ue,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=s.createInstance(iQ,this.editor),this._selectors.register({priority:0,select:(d,f,p)=>this._memoryService.select(d,f,p)});const l=Tr.InsertMode.bindTo(r);l.set(e.getOption(119).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(119).insertMode))),this.widget=this._toDispose.add(new _ce(Ti(e.getDomNode()),()=>{const d=this._instantiationService.createInstance(fye,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(_=>this._insertSuggestion(_,0),this));const f=new CDr(this.editor,d,this.model,_=>this._insertSuggestion(_,2));this._toDispose.add(f);const p=Tr.MakesTextEdit.bindTo(this._contextKeyService),g=Tr.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Tr.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(gi(()=>{p.reset(),g.reset(),m.reset()})),this._toDispose.add(d.onDidFocus(({item:_})=>{const v=this.editor.getPosition(),b=_.editStart.column,y=v.column;let C=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!_.completion.additionalTextEdits&&!(_.completion.insertTextRules&4)&&y-b===_.completion.insertText.length&&(C=this.editor.getModel().getValueInRange({startLineNumber:v.lineNumber,startColumn:b,endLineNumber:v.lineNumber,endColumn:y})!==_.completion.insertText),p.set(C),g.set(!We.equals(_.editInsertEnd,_.editReplaceEnd)),m.set(!!_.provider.resolveCompletionItem||!!_.completion.documentation||_.completion.detail!==_.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(_=>{if(_.toKeyCodeChord().equals(new Aw(!0,!1,!1,!1,33))||zr&&_.toKeyCodeChord().equals(new Aw(!1,!1,!1,!0,33))){_.stopPropagation();return}_.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new _ce(Ti(e.getDomNode()),()=>this._toDispose.add(new cye(this.editor,this.model)))),this._alternatives=this._toDispose.add(new _ce(Ti(e.getDomNode()),()=>this._toDispose.add(new FM(this.editor,this._contextKeyService)))),this._toDispose.add(s.createInstance(eQ,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new $Dr(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let f=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(f=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),f!==-1)break;if(f===-1&&(f=0),this.model.state===0)return;let p=!1;if(d.triggerOptions.auto){const g=this.editor.getOption(119);g.selectionMode==="never"||g.selectionMode==="always"?p=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?p=d.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(p=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,f,d.isFrozen,d.triggerOptions.auto,p)})),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=Tr.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=Oh.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const r=this.editor.getModel(),s=r.getAlternativeVersionId(),{item:o}=e,a=[],l=new ba;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(o,!!(t&8));this._memoryService.memorize(r,this.editor.getPosition(),o);const u=o.isResolved;let d=-1,f=-1;if(Array.isArray(o.completion.additionalTextEdits)){this.model.cancel();const g=Ub.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map(m=>{let _=ie.lift(m.range);if(_.startLineNumber===o.position.lineNumber&&_.startColumn>o.position.column){const v=this.editor.getPosition().column-o.position.column,b=v,y=ie.spansMultipleLines(_)?0:v;_=new ie(_.startLineNumber,_.startColumn+b,_.endLineNumber,_.endColumn+y)}return ma.replaceMove(_,m.text)})),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const g=new Qc;let m;const _=r.onDidChangeContent(C=>{if(C.isFlush){l.cancel(),_.dispose();return}for(const S of C.changes){const k=ie.getEndPosition(S.range);(!m||We.isBefore(k,m))&&(m=k)}}),v=t;t|=2;let b=!1;const y=this.editor.onWillType(()=>{y.dispose(),b=!0,v&2||this.editor.pushUndoStop()});a.push(o.resolve(l.token).then(()=>{if(!o.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(m&&o.completion.additionalTextEdits.some(S=>We.isBefore(m,ie.getStartPosition(S.range))))return!1;b&&this.editor.pushUndoStop();const C=Ub.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map(S=>ma.replaceMove(ie.lift(S.range),S.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(v&2))&&this.editor.pushUndoStop(),!0}).then(C=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),C),f=C===!0?1:C===!1?0:-2}).finally(()=>{_.dispose(),y.dispose()}))}let{insertText:p}=o.completion;if(o.completion.insertTextRules&4||(p=eA.escape(p)),this.model.cancel(),i.insert(p,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(o.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),o.completion.command)if(o.completion.command.id===rQ.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Qc;a.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch(m=>{o.completion.extensionId?ll(m):tr(m)}).finally(()=>{d=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();r.canUndo();){s!==r.getAlternativeVersionId()&&r.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(o),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(o,r,u,d,f,e.index,e.model.items),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,r,s,o,a){var f;if(Math.floor(Math.random()*100)===0)return;const l=new Map;for(let p=0;p<Math.min(30,a.length);p++){const g=a[p].textLabel;l.has(g)?l.get(g).push(p):l.set(g,[p])}const c=l.get(e.textLabel),d=c&&c.length>1?c[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:((f=e.extensionId)==null?void 0:f.value)??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:Qee(Mm(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Opr(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:r,additionalEditsAsync:s,index:o,firstIndex:d})}getOverwriteInfo(e,t){ys(this.editor.hasModel());let i=this.editor.getOption(119).insertMode==="replace";t&&(i=!i);const r=e.position.column-e.editStart.column,s=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,o=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:r+o,overwriteAfter:s+a}}_alertCompletionItem(e){if(Gd(e.completion.additionalTextEdits)){const t=A("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Ph(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=s=>{if(s.completion.insertTextRules&4||s.completion.additionalTextEdits)return!0;const o=this.editor.getPosition(),a=s.editStart.column,l=o.column;return l-a!==s.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:o.lineNumber,startColumn:a,endLineNumber:o.lineNumber,endColumn:l})!==s.completion.insertText};rn.once(this.model.onDidTrigger)(s=>{const o=[];rn.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{vo(o),i()},void 0,o),this.model.onDidSuggest(({completionModel:a})=>{if(vo(o),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,o)}),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)}},pye=XI,XI.ID="editor.contrib.suggestController",XI);H_=pye=BDr([qD(1,yne),qD(2,Fo),qD(3,Oi),qD(4,mi),qD(5,Uu),qD(6,md)],H_);class HDr{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}}const NX=class NX extends In{constructor(){super({id:NX.id,label:A("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:It.and(me.writable,me.hasCompletionItemProvider,Tr.Visible.toNegated()),kbOpts:{kbExpr:me.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const r=H_.get(t);if(!r)return;let s;i&&typeof i=="object"&&i.auto===!0&&(s=!0),r.triggerSuggest(void 0,s,void 0)}};NX.id="editor.action.triggerSuggest";let rQ=NX;cs(H_.ID,H_,2);zt(rQ);const yg=190,Bh=pc.bindToContribution(H_.get);gn(new Bh({id:"acceptSelectedSuggestion",precondition:It.and(Tr.Visible,Tr.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:It.and(Tr.Visible,me.textInputFocus),weight:yg},{primary:3,kbExpr:It.and(Tr.Visible,me.textInputFocus,Tr.AcceptSuggestionsOnEnter,Tr.MakesTextEdit),weight:yg}],menuOpts:[{menuId:pE,title:A("accept.insert","Insert"),group:"left",order:1,when:Tr.HasInsertAndReplaceRange.toNegated()},{menuId:pE,title:A("accept.insert","Insert"),group:"left",order:1,when:It.and(Tr.HasInsertAndReplaceRange,Tr.InsertMode.isEqualTo("insert"))},{menuId:pE,title:A("accept.replace","Replace"),group:"left",order:1,when:It.and(Tr.HasInsertAndReplaceRange,Tr.InsertMode.isEqualTo("replace"))}]}));gn(new Bh({id:"acceptAlternativeSelectedSuggestion",precondition:It.and(Tr.Visible,me.textInputFocus,Tr.HasFocusedSuggestion),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:pE,group:"left",order:2,when:It.and(Tr.HasInsertAndReplaceRange,Tr.InsertMode.isEqualTo("insert")),title:A("accept.replace","Replace")},{menuId:pE,group:"left",order:2,when:It.and(Tr.HasInsertAndReplaceRange,Tr.InsertMode.isEqualTo("replace")),title:A("accept.insert","Insert")}]}));os.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");gn(new Bh({id:"hideSuggestWidget",precondition:Tr.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:9,secondary:[1033]}}));gn(new Bh({id:"selectNextSuggestion",precondition:It.and(Tr.Visible,It.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));gn(new Bh({id:"selectNextPageSuggestion",precondition:It.and(Tr.Visible,It.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:12,secondary:[2060]}}));gn(new Bh({id:"selectLastSuggestion",precondition:It.and(Tr.Visible,It.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));gn(new Bh({id:"selectPrevSuggestion",precondition:It.and(Tr.Visible,It.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));gn(new Bh({id:"selectPrevPageSuggestion",precondition:It.and(Tr.Visible,It.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:11,secondary:[2059]}}));gn(new Bh({id:"selectFirstSuggestion",precondition:It.and(Tr.Visible,It.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));gn(new Bh({id:"focusSuggestion",precondition:It.and(Tr.Visible,Tr.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));gn(new Bh({id:"focusAndAcceptSuggestion",precondition:It.and(Tr.Visible,Tr.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));gn(new Bh({id:"toggleSuggestionDetails",precondition:It.and(Tr.Visible,Tr.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:pE,group:"right",order:1,when:It.and(Tr.DetailsVisible,Tr.CanResolve),title:A("detail.more","Show Less")},{menuId:pE,group:"right",order:1,when:It.and(Tr.DetailsVisible.toNegated(),Tr.CanResolve),title:A("detail.less","Show More")}]}));gn(new Bh({id:"toggleExplainMode",precondition:Tr.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));gn(new Bh({id:"toggleSuggestionFocus",precondition:Tr.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:2570,mac:{primary:778}}}));gn(new Bh({id:"insertBestCompletion",precondition:It.and(me.textInputFocus,It.equals("config.editor.tabCompletion","on"),eQ.AtEnd,Tr.Visible.toNegated(),FM.OtherSuggestions.toNegated(),Oh.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(zc(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:yg,primary:2}}));gn(new Bh({id:"insertNextSuggestion",precondition:It.and(me.textInputFocus,It.equals("config.editor.tabCompletion","on"),FM.OtherSuggestions,Tr.Visible.toNegated(),Oh.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:2}}));gn(new Bh({id:"insertPrevSuggestion",precondition:It.and(me.textInputFocus,It.equals("config.editor.tabCompletion","on"),FM.OtherSuggestions,Tr.Visible.toNegated(),Oh.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:yg,kbExpr:me.textInputFocus,primary:1026}}));zt(class extends In{constructor(){super({id:"editor.action.resetSuggestSize",label:A("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){var t;(t=H_.get(e))==null||t.resetWidgetSize()}});class VDr extends Ye{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new Ue),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,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 r=H_.get(this.editor);if(r){this._register(r.registerSelector({priority:100,select:(a,l,c)=>{const u=this.editor.getModel();if(!u)return-1;const d=this.suggestControllerPreselector(),f=d?bI(d,u):void 0;if(!f)return-1;const p=We.lift(l),g=c.map((_,v)=>{const b=I6.fromSuggestion(r,u,p,_,this.isShiftKeyPressed),y=bI(b.toSingleTextEdit(),u),C=Bft(f,y);return{index:v,valid:C,prefixLength:y.text.length,suggestItem:_}}).filter(_=>_&&_.valid&&_.prefixLength>0),m=jke(g,kh(_=>_.prefixLength,z_));return m?m.index:-1}}));let s=!1;const o=()=>{s||(s=!0,this._register(r.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(r.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(r.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(rn.once(r.model.onDidTrigger)(a=>{o()})),this._register(r.onWillInsertSuggestItem(a=>{const l=this.editor.getPosition(),c=this.editor.getModel();if(!l||!c)return;const u=I6.fromSuggestion(r,c,l,a.item,this.isShiftKeyPressed);this.onWillAccept(u)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!WDr(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=H_.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 I6.fromSuggestion(e,r,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=H_.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=H_.get(this.editor);e==null||e.forceRenderingAbove()}}class I6{static fromSuggestion(e,t,i,r,s){let{insertText:o}=r.completion,a=!1;if(r.completion.insertTextRules&4){const c=new eA().parse(o);c.children.length<100&&JY.adjustWhitespace(t,i,!0,c),o=c.toString(),a=!0}const l=e.getOverwriteInfo(r,s);return new I6(ie.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),o,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 yot(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new Gy(this.range,this.insertText)}}function WDr(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var zDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},lC=function(n,e){return function(t,i){e(t,i,n)}},gye,ZI;let Fm=(ZI=class extends Ye{static get(e){return e.getContribution(gye.ID)}constructor(e,t,i,r,s,o,a,l,c,u){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=r,this._commandService=s,this._debounceService=o,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this._accessibilityService=u,this._editorObs=Gf(this.editor),this._positions=ai(this,f=>{var p;return((p=this._editorObs.selections.read(f))==null?void 0:p.map(g=>g.getEndPosition()))??[new We(1,1)]}),this._suggestWidgetAdaptor=this._register(new VDr(this.editor,()=>{var f,p;return this._editorObs.forceUpdate(),(p=(f=this.model.get())==null?void 0:f.selectedInlineCompletion.get())==null?void 0:p.toSingleTextEdit(void 0)},f=>this._editorObs.forceUpdate(p=>{var g;(g=this.model.get())==null||g.handleSuggestAccepted(f)}))),this._suggestWidgetSelectedItem=Gs(this,f=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(p=>f(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem),this._enabledInConfig=Gs(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this._isScreenReaderEnabled=Gs(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Gs(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=ai(this,f=>this._enabledInConfig.read(f)&&(!this._isScreenReaderEnabled.read(f)||!this._editorDictationInProgress.read(f))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this.model=$d(this,f=>{if(this._editorObs.isReadonly.read(f))return;const p=this._editorObs.model.read(f);return p?this._instantiationService.createInstance(sye,p,this._suggestWidgetSelectedItem,this._editorObs.versionId,this._positions,this._debounceValue,Gs(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(119).preview),Gs(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(119).previewMode),Gs(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).mode),this._enabled):void 0}).recomputeInitiallyAndOnChange(this._store),this._ghostTexts=ai(this,f=>{const p=this.model.read(f);return(p==null?void 0:p.ghostTexts.read(f))??[]}),this._stablizedGhostTexts=UDr(this._ghostTexts,this._store),this._ghostTextWidgets=Lmr(this,this._stablizedGhostTexts,(f,p)=>p.add(this._instantiationService.createInstance(iye,this.editor,{ghostText:f,minReservedLineCount:vm(0),targetTextModel:this.model.map(g=>g==null?void 0:g.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=X4(this),this._fontFamily=Gs(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).fontFamily),this._register(new np(this._contextKeyService,this.model)),this._register(Wbe(this._editorObs.onDidType,(f,p)=>{var g;this._enabled.get()&&((g=this.model.get())==null||g.trigger())})),this._register(this._commandService.onDidExecuteCommand(f=>{new Set([YP.Tab.id,YP.DeleteLeft.id,YP.DeleteRight.id,Ght,"acceptSelectedSuggestion"]).has(f.commandId)&&e.hasTextFocus()&&this._enabled.get()&&this._editorObs.forceUpdate(g=>{var m;(m=this.model.get())==null||m.trigger(g)})})),this._register(Wbe(this._editorObs.selections,(f,p)=>{var g;p.some(m=>m.reason===3||m.source==="api")&&((g=this.model.get())==null||g.stop())})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||DM.dropDownVisible||va(f=>{var p;(p=this.model.get())==null||p.stop(f)})})),this._register(Gi(f=>{var g;const p=(g=this.model.read(f))==null?void 0:g.state.read(f);p!=null&&p.suggestItem?p.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(gi(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const d=o$(this,(f,p)=>{var _;const g=this.model.read(f),m=g==null?void 0:g.state.read(f);return this._suggestWidgetSelectedItem.get()?p:(_=m==null?void 0:m.inlineCompletion)==null?void 0:_.semanticId});this._register(eEr(ai(f=>(this._playAccessibilitySignal.read(f),d.read(f),{})),async(f,p,g)=>{const m=this.model.get(),_=m==null?void 0:m.state.get();if(!_||!m)return;const v=m.textModel.getLineContent(_.primaryGhostText.lineNumber);await Nw(50,wge(g)),await Qlt(this._suggestWidgetSelectedItem,Kd,()=>!1,wge(g)),await this._accessibilitySignalService.playSignal(Up.inlineSuggestion),this.editor.getOption(8)&&this._provideScreenReaderUpdate(_.primaryGhostText.renderForScreenReader(v))})),this._register(new w0e(this.editor,this.model,this._instantiationService)),this._register(ONr(ai(f=>{const p=this._fontFamily.read(f);return p===""||p==="default"?"":` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { font-family: ${p}; }`}))),this._register(this._configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let r;!t&&i&&this.editor.getOption(150)&&(r=A("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),Ph(r?e+", "+r:e)}shouldShowHoverAt(e){var i;const t=(i=this.model.get())==null?void 0:i.primaryGhostText.get();return t?t.parts.some(r=>e.containsPosition(new We(t.lineNumber,r.column))):!1}shouldShowHoverAtViewZone(e){var t;return((t=this._ghostTextWidgets.get()[0])==null?void 0:t.ownsViewZone(e))??!1}},gye=ZI,ZI.ID="editor.contrib.inlineCompletionsController",ZI);Fm=gye=zDr([lC(1,mi),lC(2,Oi),lC(3,Dr),lC(4,Fo),lC(5,kg),lC(6,Fn),lC(7,Mk),lC(8,Ws),lC(9,dp)],Fm);function UDr(n,e){const t=Ar("result",[]),i=[];return e.add(Gi(r=>{const s=n.read(r);va(o=>{if(s.length!==i.length){i.length=s.length;for(let a=0;a<i.length;a++)i[a]||(i[a]=Ar("item",s[a]));t.set([...i],o)}i.forEach((a,l)=>a.set(s[l],o))})})),t}const DX=class DX extends In{constructor(){super({id:DX.ID,label:A("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:It.and(me.writable,np.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var r;const i=Fm.get(t);(r=i==null?void 0:i.model.get())==null||r.next()}};DX.ID=Qht;let mye=DX;const RX=class RX extends In{constructor(){super({id:RX.ID,label:A("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:It.and(me.writable,np.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var r;const i=Fm.get(t);(r=i==null?void 0:i.model.get())==null||r.previous()}};RX.ID=Yht;let _ye=RX;class qDr extends In{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:A("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:me.writable})}async run(e,t){const i=Fm.get(t);await Klt(async r=>{var s;await((s=i==null?void 0:i.model.get())==null?void 0:s.triggerExplicitly(r)),i==null||i.playAccessibilitySignal(r)})}}class KDr extends In{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:A("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:It.and(me.writable,np.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:It.and(me.writable,np.inlineSuggestionVisible)},menuOpts:[{menuId:zn.InlineSuggestionToolbar,title:A("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var r;const i=Fm.get(t);await((r=i==null?void 0:i.model.get())==null?void 0:r.acceptNextWord(i.editor))}}class GDr extends In{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:A("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:It.and(me.writable,np.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:zn.InlineSuggestionToolbar,title:A("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var r;const i=Fm.get(t);await((r=i==null?void 0:i.model.get())==null?void 0:r.acceptNextLine(i.editor))}}class YDr extends In{constructor(){super({id:Ght,label:A("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:np.inlineSuggestionVisible,menuOpts:[{menuId:zn.InlineSuggestionToolbar,title:A("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:It.and(np.inlineSuggestionVisible,me.tabMovesFocus.toNegated(),np.inlineSuggestionHasIndentationLessThanTabSize,Tr.Visible.toNegated(),me.hoverFocused.toNegated())}})}async run(e,t){var r;const i=Fm.get(t);i&&((r=i.model.get())==null||r.accept(i.editor),i.editor.focus())}}const PX=class PX extends In{constructor(){super({id:PX.ID,label:A("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:np.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=Fm.get(t);va(r=>{var s;(s=i==null?void 0:i.model.get())==null||s.stop(r)})}};PX.ID="editor.action.inlineSuggest.hide";let vye=PX;const OX=class OX extends Mh{constructor(){super({id:OX.ID,title:A("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:zn.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:It.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(Dr),s=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",s)}};OX.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let bye=OX;var QDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Aj=function(n,e){return function(t,i){e(t,i,n)}};class XDr{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 yye=class{constructor(e,t,i,r,s,o){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=r,this._instantiationService=s,this._telemetryService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Fm.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 kU(1e3,this,ie.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 kU(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new kU(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar!=="onHover")return[];const i=Fm.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new XDr(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Et,r=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&i.add(this.renderScreenReaderText(e,r));const s=r.controller.model.get(),o=this._instantiationService.createInstance(DM,this._editor,!1,vm(null),s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.activeCommands),a=o.getDomNode();e.fragment.appendChild(a),s.triggerExplicitly(),i.add(o);const l={hoverPart:r,hoverElement:a,dispose(){i.dispose()}};return new rA([l])}renderScreenReaderText(e,t){const i=new Et,r=Jt,s=r("div.hover-row.markdown-hover"),o=Ot(s,r("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new Pw({editor:this._editor},this._languageService,this._openerService)),l=c=>{i.add(a.onDidRenderAsync(()=>{o.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=A("inlineSuggestionFollows","Suggestion:"),d=i.add(a.render(new rd().appendText(u).appendCodeblock("text",c)));o.replaceChildren(d.element)};return i.add(Gi(c=>{var d;const u=(d=t.controller.model.read(c))==null?void 0:d.primaryGhostText.read(c);if(u){const f=this._editor.getModel().getLineContent(u.lineNumber);l(u.renderForScreenReader(f))}else _u(o)})),e.fragment.appendChild(s),i}};yye=QDr([Aj(1,pa),Aj(2,xf),Aj(3,dp),Aj(4,mi),Aj(5,md)],yye);class ZDr{}const Cne=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};cs(Fm.ID,Fm,3);zt(qDr);zt(mye);zt(_ye);zt(KDr);zt(GDr);zt(YDr);zt(vye);Ao(bye);ZA.register(yye);Cne.register(new ZDr);var JDr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},tde=function(n,e){return function(t,i){e(t,i,n)}},cF,kE;let _B=(kE=class{constructor(e,t,i,r){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=r,this.toUnhook=new Et,this.toUnhookForKeyboard=new Et,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new fne(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([o,a])=>{this.startFindDefinitionFromMouse(o,a??void 0)})),this.toUnhook.add(s.onExecute(o=>{this.isEnabled(o)&&this.gotoDefinition(o.target.position,o.hasSideBySideModifier).catch(a=>{tr(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(cF.ID)}async startFindDefinitionFromCursor(e){await 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)}async startFindDefinition(e){var o;this.toUnhookForKeyboard.clear();const t=e?(o=this.editor.getModel())==null?void 0:o.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new ydt(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Ic(a=>this.findDefinition(e,a));let r;try{r=await this.previousPromise}catch(a){tr(a);return}if(!r||!r.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const s=r[0].originSelectionRange?ie.lift(r[0].originSelectionRange):new ie(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(r.length>1){let a=s;for(const{originSelectionRange:l}of r)l&&(a=ie.plusRange(a,l));this.addDecoration(a,new rd().appendText(A("multipleResults","Click to show {0} definitions.",r.length)))}else{const a=r[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),f=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new rd().appendCodeblock(f||"",d):void 0),l.dispose()})}}getPreviewValue(e,t,i){let r=i.range;return r.endLineNumber-r.startLineNumber>=cF.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,i){let s=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);s=Math.min(s,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${s-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),r=Math.min(e.getLineCount(),t+cF.MAX_SOURCE_PREVIEW_LINES);let s=t+1;for(;s<r;s++){const o=e.getLineFirstNonWhitespaceColumn(s);if(i===o)break}return new ie(t,1,s+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?void 0:i.options)instanceof rk)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?x$(this.languageFeaturesService.definitionProvider,i,e,!1,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const r=!t&&this.editor.getOption(89)&&!this.isInPeekEditor(i);return new E$({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Oi);return ff.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},cF=kE,kE.ID="editor.contrib.gotodefinitionatposition",kE.MAX_SOURCE_PREVIEW_LINES=8,kE);_B=cF=JDr([tde(1,Cf),tde(2,pa),tde(3,Fn)],_B);cs(_B.ID,_B,2);var Hft=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},sQ=function(n,e){return function(t,i){e(t,i,n)}};class jHe{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Cye=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new Ue,this.onDidChange=this._onDidChange.event,this._dispoables=new Et,this._markers=[],this._nextIdx=-1,vi.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),s=(a,l)=>{let c=o7(a.resource.toString(),l.resource.toString());return c===0&&(r==="position"?c=ie.compareRangesUsingStarts(a,l)||Ya.compare(a.severity,l.severity):c=Ya.compare(a.severity,l.severity)||ie.compareRangesUsingStarts(a,l)),c},o=()=>{this._markers=this._markerService.read({resource:vi.isUri(e)?e:void 0,severities:Ya.Error|Ya.Warning|Ya.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(s)};o(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(o(),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 jHe(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let r=!1,s=this._markers.findIndex(o=>o.resource.toString()===e.uri.toString());s<0&&(s=X8(this._markers,{resource:e.uri},(o,a)=>o7(o.resource.toString(),a.resource.toString())),s<0&&(s=~s));for(let o=s;o<this._markers.length;o++){let a=ie.lift(this._markers[o]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new ie(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=o,r=!0;break}if(this._markers[o].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(ie.containsPosition(this._markers[i],t))return new jHe(this._markers[i],i+1,this._markers.length)}}};Cye=Hft([sQ(1,w1),sQ(2,Dr)],Cye);const Vft=Ur("IMarkerNavigationService");let wye=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new Ch}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new Cye(e,this._markerService,this._configService)}};wye=Hft([sQ(0,w1),sQ(1,Dr)],wye);ns(Vft,wye,1);var xye;(function(n){function e(t){switch(t){case _l.Ignore:return"severity-ignore "+Ni.asClassName(Yt.info);case _l.Info:return Ni.asClassName(Yt.info);case _l.Warning:return Ni.asClassName(Yt.warning);case _l.Error:return Ni.asClassName(Yt.error);default:return""}}n.className=e})(xye||(xye={}));var eRr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},KD=function(n,e){return function(t,i){e(t,i,n)}},Sye;class tRr{constructor(e,t,i,r,s){this._openerService=r,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Et,this._editor=t;const o=document.createElement("div");o.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.add(Da(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new blt(o,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{o.style.left=`-${a.scrollLeft}px`,o.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){vo(this._disposables)}update(e){const{source:t,message:i,relatedInformation:r,code:s}=e;let o=((t==null?void 0:t.length)||0)+2;s&&(typeof s=="string"?o+=s.length:o+=s.value.length);const a=_1(i);this._lines=a.length,this._longestLineLength=0;for(const f of a)this._longestLineLength=Math.max(f.length+o,this._longestLineLength);mu(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const f of a)l=document.createElement("div"),l.innerText=f,f===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const f=document.createElement("span");if(f.classList.add("details"),l.appendChild(f),t){const p=document.createElement("span");p.innerText=t,p.classList.add("source"),f.appendChild(p)}if(s)if(typeof s=="string"){const p=document.createElement("span");p.innerText=`(${s})`,p.classList.add("code"),f.appendChild(p)}else{this._codeLink=Jt("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(s.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const p=Ot(this._codeLink,Jt("span"));p.innerText=s.value,f.appendChild(this._codeLink)}}if(mu(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Gd(r)){const f=this._relatedBlock.appendChild(document.createElement("div"));f.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const p of r){const g=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(p.resource)}(${p.startLineNumber}, ${p.startColumn}): `,m.title=this._labelService.getUriLabel(p.resource),this._relatedDiagnostics.set(m,p);const _=document.createElement("span");_.innerText=p.message,g.appendChild(m),g.appendChild(_),this._lines+=1,f.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 Ya.Error:t=A("Error","Error");break;case Ya.Warning:t=A("Warning","Warning");break;case Ya.Info:t=A("Info","Info");break;case Ya.Hint:t=A("Hint","Hint");break}let i=A("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}}var JI;let vB=(JI=class extends MY{constructor(e,t,i,r,s,o,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=r,this._contextKeyService=o,this._labelService=a,this._callOnDispose=new Et,this._onDidSelectRelatedInformation=new Ue,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Ya.Warning,this._backgroundColor=At.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(sRr);let t=Eye,i=nRr;this._severity===Ya.Warning?(t=AU,i=iRr):this._severity===Ya.Info&&(t=kye,i=rRr);const r=e.getColor(t),s=e.getColor(i);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:s,primaryHeadingColor:e.getColor(oft),secondaryHeadingColor:e.getColor(aft)})}_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.getMenuActions(Sye.TitleMenu,this._contextKeyService);jte(i,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=Ot(e,Jt(""))}_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 tRr(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=ie.lift(e),s=this.editor.getPosition(),o=s&&r.containsPosition(s)?s:r.getStartPosition();super.show(o,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?A("problems","{0} of {1} problems",t,i):A("change","{0} of {1} problem",t,i);this.setTitle(Mm(a.uri),l)}this._icon.className=`codicon ${xye.className(Ya.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(o,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()}},Sye=JI,JI.TitleMenu=new zn("gotoErrorTitleMenu"),JI);vB=Sye=eRr([KD(1,mc),KD(2,xf),KD(3,Eg),KD(4,mi),KD(5,Oi),KD(6,_M)],vB);const FHe=_7(bte,chr),BHe=_7(Rw,v7),$He=_7(Qy,b7),Eye=ve("editorMarkerNavigationError.background",{dark:FHe,light:FHe,hcDark:ls,hcLight:ls},A("editorMarkerNavigationError","Editor marker navigation widget error color.")),nRr=ve("editorMarkerNavigationError.headerBackground",{dark:Ir(Eye,.1),light:Ir(Eye,.1),hcDark:null,hcLight:null},A("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),AU=ve("editorMarkerNavigationWarning.background",{dark:BHe,light:BHe,hcDark:ls,hcLight:ls},A("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),iRr=ve("editorMarkerNavigationWarning.headerBackground",{dark:Ir(AU,.1),light:Ir(AU,.1),hcDark:"#0C141F",hcLight:Ir(AU,.2)},A("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),kye=ve("editorMarkerNavigationInfo.background",{dark:$He,light:$He,hcDark:ls,hcLight:ls},A("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),rRr=ve("editorMarkerNavigationInfo.headerBackground",{dark:Ir(kye,.1),light:Ir(kye,.1),hcDark:null,hcLight:null},A("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),sRr=ve("editorMarkerNavigation.background",lv,A("editorMarkerNavigationBackground","Editor marker navigation widget background."));var oRr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},XW=function(n,e){return function(t,i){e(t,i,n)}},uF,eL;let aA=(eL=class{static get(e){return e.getContribution(uF.ID)}constructor(e,t,i,r,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=r,this._instantiationService=s,this._sessionDispoables=new Et,this._editor=e,this._widgetVisible=Wft.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(vB,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,s,o;(!((r=this._model)!=null&&r.selected)||!ie.containsPosition((s=this._model)==null?void 0:s.selected.marker,i.position))&&((o=this._model)==null||o.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:ie.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 We(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,r;if(this._editor.hasModel()){const s=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(s.move(e,this._editor.getModel(),this._editor.getPosition()),!s.selected)return;if(s.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const o=await this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);o&&((i=uF.get(o))==null||i.close(),(r=uF.get(o))==null||r.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}}},uF=eL,eL.ID="editor.contrib.markerController",eL);aA=uF=oRr([XW(1,Vft),XW(2,Oi),XW(3,Cs),XW(4,mi)],aA);class wne extends In{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=aA.get(t))==null||i.nagivate(this._next,this._multiFile))}}const O2=class O2 extends wne{constructor(){super(!0,!1,{id:O2.ID,label:O2.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:me.focus,primary:578,weight:100},menuOpts:{menuId:vB.TitleMenu,title:O2.LABEL,icon:Zo("marker-navigation-next",Yt.arrowDown,A("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}};O2.ID="editor.action.marker.next",O2.LABEL=A("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");let oQ=O2;const M2=class M2 extends wne{constructor(){super(!1,!1,{id:M2.ID,label:M2.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:me.focus,primary:1602,weight:100},menuOpts:{menuId:vB.TitleMenu,title:M2.LABEL,icon:Zo("marker-navigation-previous",Yt.arrowUp,A("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}};M2.ID="editor.action.marker.prev",M2.LABEL=A("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");let Tye=M2;class aRr extends wne{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:A("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:me.focus,primary:66,weight:100},menuOpts:{menuId:zn.MenubarGoMenu,title:A({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class lRr extends wne{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:A("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:me.focus,primary:1090,weight:100},menuOpts:{menuId:zn.MenubarGoMenu,title:A({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}cs(aA.ID,aA,4);zt(oQ);zt(Tye);zt(aRr);zt(lRr);const Wft=new yn("markersNavigationVisible",!1),cRr=pc.bindToContribution(aA.get);gn(new cRr({id:"closeMarkersNavigation",precondition:Wft,handler:n=>n.close(),kbOpts:{weight:150,kbExpr:me.focus,primary:9,secondary:[1033]}}));var Yv;(function(n){n.NoAutoFocus="noAutoFocus",n.FocusIfVisible="focusIfVisible",n.AutoFocusImmediately="autoFocusImmediately"})(Yv||(Yv={}));class uRr extends In{constructor(){super({id:Kht,label:A({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."]},"Show or Focus Hover"),metadata:{description:$i("showOrFocusHoverDescription","Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Yv.NoAutoFocus,Yv.FocusIfVisible,Yv.AutoFocusImmediately],enumDescriptions:[A("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),A("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),A("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Yv.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const r=Xd.get(t);if(!r)return;const s=i==null?void 0:i.focus;let o=Yv.FocusIfVisible;Object.values(Yv).includes(s)?o=s:typeof s=="boolean"&&s&&(o=Yv.AutoFocusImmediately);const a=c=>{const u=t.getPosition(),d=new ie(u.lineNumber,u.column,u.lineNumber,u.column);r.showContentHover(d,1,1,c)},l=t.getOption(2)===2;r.isHoverVisible?o!==Yv.NoAutoFocus?r.focus():a(l):a(l||o===Yv.AutoFocusImmediately)}}class dRr extends In{constructor(){super({id:IIr,label:A({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,metadata:{description:$i("showDefinitionPreviewHoverDescription","Show the definition preview hover in the editor.")}})}run(e,t){const i=Xd.get(t);if(!i)return;const r=t.getPosition();if(!r)return;const s=new ie(r.lineNumber,r.column,r.lineNumber,r.column),o=_B.get(t);if(!o)return;o.startFindDefinitionFromCursor(r).then(()=>{i.showContentHover(s,1,1,!0)})}}class hRr extends In{constructor(){super({id:LIr,label:A({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:me.hoverFocused,kbOpts:{kbExpr:me.hoverFocused,primary:16,weight:100},metadata:{description:$i("scrollUpHoverDescription","Scroll up the editor hover.")}})}run(e,t){const i=Xd.get(t);i&&i.scrollUp()}}class fRr extends In{constructor(){super({id:AIr,label:A({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:me.hoverFocused,kbOpts:{kbExpr:me.hoverFocused,primary:18,weight:100},metadata:{description:$i("scrollDownHoverDescription","Scroll down the editor hover.")}})}run(e,t){const i=Xd.get(t);i&&i.scrollDown()}}class pRr extends In{constructor(){super({id:NIr,label:A({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:me.hoverFocused,kbOpts:{kbExpr:me.hoverFocused,primary:15,weight:100},metadata:{description:$i("scrollLeftHoverDescription","Scroll left the editor hover.")}})}run(e,t){const i=Xd.get(t);i&&i.scrollLeft()}}class gRr extends In{constructor(){super({id:DIr,label:A({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:me.hoverFocused,kbOpts:{kbExpr:me.hoverFocused,primary:17,weight:100},metadata:{description:$i("scrollRightHoverDescription","Scroll right the editor hover.")}})}run(e,t){const i=Xd.get(t);i&&i.scrollRight()}}class mRr extends In{constructor(){super({id:RIr,label:A({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:me.hoverFocused,kbOpts:{kbExpr:me.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:$i("pageUpHoverDescription","Page up the editor hover.")}})}run(e,t){const i=Xd.get(t);i&&i.pageUp()}}class _Rr extends In{constructor(){super({id:PIr,label:A({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:me.hoverFocused,kbOpts:{kbExpr:me.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:$i("pageDownHoverDescription","Page down the editor hover.")}})}run(e,t){const i=Xd.get(t);i&&i.pageDown()}}class vRr extends In{constructor(){super({id:OIr,label:A({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:me.hoverFocused,kbOpts:{kbExpr:me.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:$i("goToTopHoverDescription","Go to the top of the editor hover.")}})}run(e,t){const i=Xd.get(t);i&&i.goToTop()}}class bRr extends In{constructor(){super({id:MIr,label:A({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:me.hoverFocused,kbOpts:{kbExpr:me.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:$i("goToBottomHoverDescription","Go to the bottom of the editor hover.")}})}run(e,t){const i=Xd.get(t);i&&i.goToBottom()}}class yRr extends In{constructor(){super({id:une,label:jIr,alias:"Increase Hover Verbosity Level",precondition:me.hoverVisible})}run(e,t,i){const r=Xd.get(t);if(!r)return;const s=(i==null?void 0:i.index)!==void 0?i.index:r.focusedHoverPartIndex();r.updateHoverVerbosityLevel(Uf.Increase,s,i==null?void 0:i.focus)}}class CRr extends In{constructor(){super({id:dne,label:FIr,alias:"Decrease Hover Verbosity Level",precondition:me.hoverVisible})}run(e,t,i){var o;const r=Xd.get(t);if(!r)return;const s=(i==null?void 0:i.index)!==void 0?i.index:r.focusedHoverPartIndex();(o=Xd.get(t))==null||o.updateHoverVerbosityLevel(Uf.Decrease,s,i==null?void 0:i.focus)}}var wRr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},nde=function(n,e){return function(t,i){e(t,i,n)}};const C_=Jt;class xRr{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 HHe={type:1,filter:{include:oa.QuickFix},triggerAction:cp.QuickFixHover};let Iye=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,s=i.getLineMaxColumn(r),o=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,c=a.range.endLineNumber===r?a.range.endColumn:s,u=this._markerDecorationsService.getMarker(i.uri,a);if(!u)continue;const d=new ie(e.range.startLineNumber,l,e.range.startLineNumber,c);o.push(new xRr(this,d,u))}return o}renderHoverParts(e,t){if(!t.length)return new rA([]);const i=new Et,r=[];t.forEach(o=>{const a=this._renderMarkerHover(o);e.fragment.appendChild(a.hoverElement),r.push(a)});const s=t.length===1?t[0]:t.sort((o,a)=>Ya.compare(o.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),new rA(r)}_renderMarkerHover(e){const t=new Et,i=C_("div.hover-row"),r=Ot(i,C_("div.marker.hover-contents")),{source:s,message:o,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const c=Ot(r,C_("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=o,s||a)if(a&&typeof a!="string"){const d=C_("span");if(s){const m=Ot(d,C_("span"));m.innerText=s}const f=Ot(d,C_("a.code-link"));f.setAttribute("href",a.target.toString()),t.add(_t(f,"click",m=>{this._openerService.open(a.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()}));const p=Ot(f,C_("span"));p.innerText=a.value;const g=Ot(r,d);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const d=Ot(r,C_("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(Gd(l))for(const{message:d,resource:f,startLineNumber:p,startColumn:g}of l){const m=Ot(r,C_("div"));m.style.marginTop="8px";const _=Ot(m,C_("a"));_.innerText=`${Mm(f)}(${p}, ${g}): `,_.style.cursor="pointer",t.add(_t(_,"click",b=>{if(b.stopPropagation(),b.preventDefault(),this._openerService){const y={selection:{startLineNumber:p,startColumn:g}};this._openerService.open(f,{fromUserGesture:!0,editorOptions:y}).catch(tr)}}));const v=Ot(m,C_("span"));v.innerText=d,this._editor.applyFontInfo(v)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Ya.Error||t.marker.severity===Ya.Warning||t.marker.severity===Ya.Info){const r=aA.get(this._editor);r&&e.statusBar.addAction({label:A("view problem","View Problem"),commandId:oQ.ID,run:()=>{e.hide(),r.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(92)){const r=e.statusBar.append(C_("div"));this.recentMarkerCodeActionsInfo&&(IG.makeKey(this.recentMarkerCodeActionsInfo.marker)===IG.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=A("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Ye.None:XE(()=>r.textContent=A("checkingForQuickFixes","Checking for quick fixes..."),200,i);r.textContent||(r.textContent=" ");const o=this.getCodeActions(t.marker);i.add(gi(()=>o.cancel())),o.then(a=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=A("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;i.add(gi(()=>{l||a.dispose()})),e.statusBar.addAction({label:A("quick fixes","Quick Fix..."),commandId:Z2e,run:c=>{l=!0;const u=AM.get(this._editor),d=al(c);e.hide(),u==null||u.showCodeActions(HHe,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},tr)}}getCodeActions(e){return Ic(t=>zR(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new ie(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),HHe,bb.None,t))}};Iye=wRr([nde(1,STe),nde(2,xf),nde(3,Fn)],Iye);class SRr{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=ov.Center}computeSync(){var s;const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],r=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const a=((s=o.options.glyphMargin)==null?void 0:s.position)??ov.Center;if(!r&&a!==this._laneOrLine)continue;const l=r?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!l||gM(l)||i.push(...tke(l).map(e))}return i}}var ERr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},VHe=function(n,e){return function(t,i){e(t,i,n)}},Lye;const WHe=Jt;var tL;let Aye=(tL=class extends Ye{constructor(e,t,i){super(),this._renderDisposeables=this._register(new Et),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new nTe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Pw({editor:this._editor},t,i)),this._computer=new SRr(this._editor),this._hoverOperation=this._register(new Xht(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._register(Da(this._hover.containerDomNode,"mouseleave",r=>{this._onMouseLeave(r)})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Lye.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))}showsOrWillShow(e){const t=e.target;return t.type===2&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===3?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,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 s=WHe("div.hover-row.markdown-hover"),o=Ot(s,WHe("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));o.appendChild(a.element),i.appendChild(s)}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(),s=this._editor.getOption(67),o=this._hover.containerDomNode.clientHeight,a=i-r-(o-s)/2,l=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${l}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!hne(t,e.x,e.y))&&this.hide()}},Lye=tL,tL.ID="editor.contrib.modesGlyphHoverWidget",tL);Aye=Lye=ERr([VHe(1,pa),VHe(2,xf)],Aye);var kRr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},TRr=function(n,e){return function(t,i){e(t,i,n)}},aO;let aQ=(aO=class extends Ye{constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Et,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new ao(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._isMouseOnMarginHoverWidget(e)&&this._hideWidgets()}_isMouseOnMarginHoverWidget(e){var i;const t=(i=this._glyphWidget)==null?void 0:i.getDomNode();return t?hne(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnMarginHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnMarginHoverWidget(e);return t&&i}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave)return;if(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){!e||this._tryShowHoverWidget(e)||this._hideWidgets()}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&(e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||this._hideWidgets())}_hideWidgets(){var e;(e=this._glyphWidget)==null||e.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(Aye,this._editor)),this._glyphWidget}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)==null||e.dispose()}},aO.ID="editor.contrib.marginHover",aO);aQ=kRr([TRr(1,mi)],aQ);class IRr{}class LRr{}class ARr{}cs(Xd.ID,Xd,2);cs(aQ.ID,aQ,2);zt(uRr);zt(dRr);zt(hRr);zt(fRr);zt(pRr);zt(gRr);zt(mRr);zt(_Rr);zt(vRr);zt(bRr);zt(yRr);zt(CRr);ZA.register(hB);ZA.register(Iye);Gm((n,e)=>{const t=n.getColor(olt);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)}; }`))});Cne.register(new IRr);Cne.register(new LRr);Cne.register(new ARr);function $f(n,e){let t=0;for(let i=0;i<n.length;i++)n.charAt(i)===" "?t+=e:t++;return t}function L6(n,e,t){n=n<0?0:n;let i="";if(!t){const r=Math.floor(n/e);n=n%e;for(let s=0;s<r;s++)i+=" "}for(let r=0;r<n;r++)i+=" ";return i}function zft(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return[];const r=e.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;if(!r)return[];const s=new u2e(n,r,e);for(i=Math.min(i,n.getLineCount());t<=i&&s.shouldIgnore(t);)t++;if(t>i-1)return[];const{tabSize:o,indentSize:a,insertSpaces:l}=n.getOptions(),c=(m,_)=>(_=_||1,jm.shiftIndent(m,m.length+_,o,a,l)),u=(m,_)=>(_=_||1,jm.unshiftIndent(m,m.length+_,o,a,l)),d=[],f=n.getLineContent(t);let p=_o(f),g=p;s.shouldIncrease(t)?(g=c(g),p=c(p)):s.shouldIndentNextLine(t)&&(g=c(g)),t++;for(let m=t;m<=i;m++){if(NRr(n,m))continue;const _=n.getLineContent(m),v=_o(_),b=g;s.shouldDecrease(m,b)&&(g=u(g),p=u(p)),v!==g&&d.push(ma.replaceMove(new Yn(m,1,m,v.length+1),ETe(g,a,l))),!s.shouldIgnore(m)&&(s.shouldIncrease(m,b)?(p=c(p),g=p):s.shouldIndentNextLine(m,b)?g=c(g):g=p)}return d}function NRr(n,e){return n.tokenization.isCheapToTokenize(e)?n.tokenization.getLineTokens(e).getStandardTokenType(0)===2:!1}var DRr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},RRr=function(n,e){return function(t,i){e(t,i,n)}};const MX=class MX extends In{constructor(){super({id:MX.ID,label:A("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:me.writable,metadata:{description:$i("indentationToSpacesDescription","Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const r=i.getOptions(),s=t.getSelection();if(!s)return;const o=new FRr(s,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};MX.ID="editor.action.indentationToSpaces";let Nye=MX;const jX=class jX extends In{constructor(){super({id:jX.ID,label:A("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:me.writable,metadata:{description:$i("indentationToTabsDescription","Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const r=i.getOptions(),s=t.getSelection();if(!s)return;const o=new BRr(s,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};jX.ID="editor.action.indentationToTabs";let Dye=jX;class SIe extends In{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(Ym),r=e.get(Xo),s=t.getModel();if(!s)return;const o=r.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget),a=s.getOptions(),l=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===o.tabSize&&u===a.tabSize?A("configuredTabSize","Configured Tab Size"):u===o.tabSize?A("defaultTabSize","Default Tab Size"):u===a.tabSize?A("currentTabSize","Current Tab Size"):void 0})),c=Math.min(s.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:A({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(u=>{if(u&&s&&!s.isDisposed()){const d=parseInt(u.label,10);this.displaySizeOnly?s.updateOptions({tabSize:d}):s.updateOptions({tabSize:d,indentSize:d,insertSpaces:this.insertSpaces})}})},50)}}const FX=class FX extends SIe{constructor(){super(!1,!1,{id:FX.ID,label:A("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:$i("indentUsingTabsDescription","Use indentation with tabs.")}})}};FX.ID="editor.action.indentUsingTabs";let Rye=FX;const BX=class BX extends SIe{constructor(){super(!0,!1,{id:BX.ID,label:A("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:$i("indentUsingSpacesDescription","Use indentation with spaces.")}})}};BX.ID="editor.action.indentUsingSpaces";let Pye=BX;const $X=class $X extends SIe{constructor(){super(!0,!0,{id:$X.ID,label:A("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:$i("changeTabDisplaySizeDescription","Change the space size equivalent of the tab.")}})}};$X.ID="editor.action.changeTabDisplaySize";let Oye=$X;const HX=class HX extends In{constructor(){super({id:HX.ID,label:A("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:$i("detectIndentationDescription","Detect the indentation from content.")}})}run(e,t){const i=e.get(Xo),r=t.getModel();if(!r)return;const s=i.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget);r.detectIndentation(s.insertSpaces,s.tabSize)}};HX.ID="editor.action.detectIndentation";let Mye=HX;class PRr extends In{constructor(){super({id:"editor.action.reindentlines",label:A("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:me.writable,metadata:{description:$i("editor.reindentlinesDescription","Reindent the lines of the editor.")}})}run(e,t){const i=e.get(wa),r=t.getModel();if(!r)return;const s=zft(r,i,1,r.getLineCount());s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class ORr extends In{constructor(){super({id:"editor.action.reindentselectedlines",label:A("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:me.writable,metadata:{description:$i("editor.reindentselectedlinesDescription","Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(wa),r=t.getModel();if(!r)return;const s=t.getSelections();if(s===null)return;const o=[];for(const a of s){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const u=zft(r,i,l,c);o.push(...u)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class MRr{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(ie.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)}}var lO;let lQ=(lO=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Et,this.callOnModel=new Et,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||this.rangeContainsOnlyWhitespaceCharacters(i,e)||jRr(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(12),{tabSize:o,indentSize:a,insertSpaces:l}=i.getOptions(),c=[],u={shiftIndent:g=>jm.shiftIndent(g,g.length+1,o,a,l),unshiftIndent:g=>jm.unshiftIndent(g,g.length+1,o,a,l)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(i,d)){d++;continue}break}if(d>e.endLineNumber)return;let f=i.getLineContent(d);if(!/\S/.test(f.substring(0,e.startColumn-1))){const g=m6(s,i,i.getLanguageId(),d,u,this._languageConfigurationService);if(g!==null){const m=_o(f),_=$f(g,o),v=$f(m,o);if(_!==v){const b=L6(_,o,l);c.push({range:new ie(d,1,d,m.length+1),text:b}),f=b+f.substring(m.length)}else{const b=Uut(i,d,this._languageConfigurationService);if(b===0||b===8)return}}}const p=d;for(;d<e.endLineNumber;){if(!/\S/.test(i.getLineContent(d+1))){d++;continue}break}if(d!==e.endLineNumber){const m=m6(s,{tokenization:{getLineTokens:_=>i.tokenization.getLineTokens(_),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(_,v)=>i.getLanguageIdAtPosition(_,v)},getLineContent:_=>_===p?f:i.getLineContent(_)},i.getLanguageId(),d+1,u,this._languageConfigurationService);if(m!==null){const _=$f(m,o),v=$f(_o(i.getLineContent(d+1)),o);if(_!==v){const b=_-v;for(let y=d+1;y<=e.endLineNumber;y++){const C=i.getLineContent(y),S=_o(C),I=$f(S,o)+b,L=L6(I,o,l);L!==S&&c.push({range:new ie(y,1,y,S.length+1),text:L})}}}}if(c.length>0){this.editor.pushUndoStop();const g=new MRr(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",g),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=s=>s.trim().length===0;let r=!0;if(t.startLineNumber===t.endLineNumber){const o=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);r=i(o)}else for(let s=t.startLineNumber;s<=t.endLineNumber;s++){const o=e.getLineContent(s);if(s===t.startLineNumber){const a=o.substring(t.startColumn-1);r=i(a)}else if(s===t.endLineNumber){const a=o.substring(0,t.endColumn-1);r=i(a)}else r=e.getLineFirstNonWhitespaceColumn(s)===0;if(!r)break}return r}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 s=r.findTokenIndexAtOffset(i);if(s>=0&&r.getStandardTokenType(s)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},lO.ID="editor.contrib.autoIndentOnPaste",lO);lQ=DRr([RRr(1,wa)],lQ);function jRr(n,e){const t=i=>mgr(n,i)===2;return t(e.getStartPosition())||t(e.getEndPosition())}function Uft(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let r="";for(let o=0;o<t;o++)r+=" ";const s=new RegExp(r,"gi");for(let o=1,a=n.getLineCount();o<=a;o++){let l=n.getLineFirstNonWhitespaceColumn(o);if(l===0&&(l=n.getLineMaxColumn(o)),l===1)continue;const c=new ie(o,1,o,l),u=n.getValueInRange(c),d=i?u.replace(/\t/ig,r):u.replace(s," ");e.addEditOperation(c,d)}}class FRr{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),Uft(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class BRr{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),Uft(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}cs(lQ.ID,lQ,2);zt(Nye);zt(Dye);zt(Rye);zt(Pye);zt(Oye);zt(Mye);zt(PRr);zt(ORr);cs(pB.ID,pB,1);ZA.register($Y);class $Rr{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 Yn(r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn),r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn)):new Yn(r.endLineNumber,r.endColumn-this._text.length,r.endLineNumber,r.endColumn)}}var HRr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},VRr=function(n,e){return function(t,i){e(t,i,n)}},NU,TE;let BM=(TE=class{static get(e){return e.getContribution(NU.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var l;(l=this.currentRequest)==null||l.cancel();const i=this.editor.getSelection(),r=this.editor.getModel();if(!r||!i)return;let s=i;if(s.startLineNumber!==s.endLineNumber)return;const o=new ydt(this.editor,5),a=r.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=Ic(c=>this.editorWorkerService.navigateValueSet(a,s,t)),this.currentRequest.then(c=>{var g;if(!c||!c.range||!c.value||!o.validate(this.editor))return;const u=ie.lift(c.range);let d=c.range;const f=c.value.length-(s.endColumn-s.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+c.value.length},f>1&&(s=new Yn(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const p=new $Rr(u,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,p),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:NU.DECORATION}]),(g=this.decorationRemover)==null||g.cancel(),this.decorationRemover=Nw(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(tr)}).catch(tr)):Promise.resolve(void 0)}},NU=TE,TE.ID="editor.contrib.inPlaceReplaceController",TE.DECORATION=ur.register({description:"in-place-replace",className:"valueSetReplacement"}),TE);BM=NU=HRr([VRr(1,Sf)],BM);class WRr extends In{constructor(){super({id:"editor.action.inPlaceReplace.up",label:A("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=BM.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class zRr extends In{constructor(){super({id:"editor.action.inPlaceReplace.down",label:A("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=BM.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}cs(BM.ID,BM,4);zt(WRr);zt(zRr);class URr extends In{constructor(){super({id:"expandLineSelection",label:A("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:me.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,ou.expandLineSelection(r,r.getCursorStates())),r.revealAllCursors(i.source,!0)}}zt(URr);class qRr{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=KRr(e,this._cursors,this._trimInRegexesAndStrings);for(let r=0,s=i.length;r<s;r++){const o=i[r];t.addEditOperation(o.range,o.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function KRr(n,e,t){e.sort((a,l)=>a.lineNumber===l.lineNumber?a.column-l.column:a.lineNumber-l.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let r=0,s=0;const o=e.length;for(let a=1,l=n.getLineCount();a<=l;a++){const c=n.getLineContent(a),u=c.length+1;let d=0;if(s<o&&e[s].lineNumber===a&&(d=e[s].column,s++,d===u)||c.length===0)continue;const f=Lb(c);let p=0;if(f===-1)p=1;else if(f!==c.length-1)p=f+2;else continue;if(!t){if(!n.tokenization.hasAccurateTokensForLine(a))continue;const g=n.tokenization.getLineTokens(a),m=g.getStandardTokenType(g.findTokenIndexAtOffset(p));if(m===2||m===3)continue}p=Math.max(d,p),i[r++]=ma.delete(new ie(a,p,a,u))}return i}class qft{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 o=i.startLineNumber;o<=i.endLineNumber;o++)r.push(e.getLineContent(o));const s=r.join(` `);s===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new ie(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":` `):this._isCopyingDown?t.addEditOperation(new ie(i.startLineNumber,1,i.startLineNumber,1),s+` `):t.addEditOperation(new ie(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),` `+s),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,s=i.startColumn,o=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(r=r+this._startLineNumberDelta,s=1),this._endLineNumberDelta!==0&&(o=o+this._endLineNumberDelta,a=1),i=Yn.createWithDirection(r,s,o,a,this._selectionDirection)}return i}}var GRr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},YRr=function(n,e){return function(t,i){e(t,i,n)}};let jye=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.getLanguageId(),r=(d,f)=>e.getLanguageIdAtPosition(d,f),s=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===s){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 o=this._selection;o.startLineNumber<o.endLineNumber&&o.endColumn===1&&(this._moveEndPositionDown=!0,o=o.setEndPosition(o.endLineNumber-1,e.getLineMaxColumn(o.endLineNumber-1)));const{tabSize:a,indentSize:l,insertSpaces:c}=e.getOptions(),u=this.buildIndentConverter(a,l,c);if(o.startLineNumber===o.endLineNumber&&e.getLineMaxColumn(o.startLineNumber)===1){const d=o.startLineNumber,f=this._isMovingDown?d+1:d-1;e.getLineMaxColumn(f)===1?t.addEditOperation(new ie(1,1,1,1),null):(t.addEditOperation(new ie(d,1,d,1),e.getLineContent(f)),t.addEditOperation(new ie(f,1,f,e.getLineMaxColumn(f)),null)),o=new Yn(f,1,f,1)}else{let d,f;if(this._isMovingDown){d=o.endLineNumber+1,f=e.getLineContent(d),t.addEditOperation(new ie(d-1,e.getLineMaxColumn(d-1),d,e.getLineMaxColumn(d)),null);let p=f;if(this.shouldAutoIndent(e,o)){const g=this.matchEnterRule(e,u,a,d,o.startLineNumber-1);if(g!==null){const _=_o(e.getLineContent(d)),v=g+$f(_,a);p=L6(v,a,c)+this.trimStart(f)}else{const _={tokenization:{getLineTokens:b=>b===o.startLineNumber?e.tokenization.getLineTokens(d):e.tokenization.getLineTokens(b),getLanguageId:i,getLanguageIdAtPosition:r},getLineContent:b=>b===o.startLineNumber?e.getLineContent(d):e.getLineContent(b)},v=m6(this._autoIndent,_,e.getLanguageIdAtPosition(d,1),o.startLineNumber,u,this._languageConfigurationService);if(v!==null){const b=_o(e.getLineContent(d)),y=$f(v,a),C=$f(b,a);y!==C&&(p=L6(y,a,c)+this.trimStart(f))}}t.addEditOperation(new ie(o.startLineNumber,1,o.startLineNumber,1),p+` `);const m=this.matchEnterRuleMovingDown(e,u,a,o.startLineNumber,d,p);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,o,a,c,m);else{const _={tokenization:{getLineTokens:b=>b===o.startLineNumber?e.tokenization.getLineTokens(d):b>=o.startLineNumber+1&&b<=o.endLineNumber+1?e.tokenization.getLineTokens(b-1):e.tokenization.getLineTokens(b),getLanguageId:i,getLanguageIdAtPosition:r},getLineContent:b=>b===o.startLineNumber?p:b>=o.startLineNumber+1&&b<=o.endLineNumber+1?e.getLineContent(b-1):e.getLineContent(b)},v=m6(this._autoIndent,_,e.getLanguageIdAtPosition(d,1),o.startLineNumber+1,u,this._languageConfigurationService);if(v!==null){const b=_o(e.getLineContent(o.startLineNumber)),y=$f(v,a),C=$f(b,a);if(y!==C){const S=y-C;this.getIndentEditsOfMovingBlock(e,t,o,a,c,S)}}}}else t.addEditOperation(new ie(o.startLineNumber,1,o.startLineNumber,1),p+` `)}else if(d=o.startLineNumber-1,f=e.getLineContent(d),t.addEditOperation(new ie(d,1,d+1,1),null),t.addEditOperation(new ie(o.endLineNumber,e.getLineMaxColumn(o.endLineNumber),o.endLineNumber,e.getLineMaxColumn(o.endLineNumber)),` `+f),this.shouldAutoIndent(e,o)){const p={tokenization:{getLineTokens:m=>m===d?e.tokenization.getLineTokens(o.startLineNumber):e.tokenization.getLineTokens(m),getLanguageId:i,getLanguageIdAtPosition:r},getLineContent:m=>m===d?e.getLineContent(o.startLineNumber):e.getLineContent(m)},g=this.matchEnterRule(e,u,a,o.startLineNumber,o.startLineNumber-2);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,o,a,c,g);else{const m=m6(this._autoIndent,p,e.getLanguageIdAtPosition(o.startLineNumber,1),d,u,this._languageConfigurationService);if(m!==null){const _=_o(e.getLineContent(o.startLineNumber)),v=$f(m,a),b=$f(_,a);if(v!==b){const y=v-b;this.getIndentEditsOfMovingBlock(e,t,o,a,c,y)}}}}}this._selectionId=t.trackSelection(o)}buildIndentConverter(e,t,i){return{shiftIndent:r=>jm.shiftIndent(r,r.length+1,e,t,i),unshiftIndent:r=>jm.unshiftIndent(r,r.length+1,e,t,i)}}parseEnterResult(e,t,i,r,s){if(s){let o=s.indentation;s.indentAction===Ul.None||s.indentAction===Ul.Indent?o=s.indentation+s.appendText:s.indentAction===Ul.IndentOutdent?o=s.indentation:s.indentAction===Ul.Outdent&&(o=t.unshiftIndent(s.indentation)+s.appendText);const a=e.getLineContent(r);if(this.trimStart(a).indexOf(this.trimStart(o))>=0){const l=_o(e.getLineContent(r));let c=_o(o);const u=Uut(e,r,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=$f(c,i),f=$f(l,i);return d-f}}return null}matchEnterRuleMovingDown(e,t,i,r,s,o){if(Lb(o)>=0){const a=e.getLineMaxColumn(s),l=GP(this._autoIndent,e,new ie(s,a,s,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(Lb(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=GP(this._autoIndent,e,new ie(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,r,c)}}matchEnterRule(e,t,i,r,s,o){let a=s;for(;a>=1;){let u;if(a===s&&o!==void 0?u=o:u=e.getLineContent(a),Lb(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=GP(this._autoIndent,e,new ie(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,s,o){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=_o(l),d=$f(c,r)+o,f=L6(d,r,s);f!==c&&(t.addEditOperation(new ie(a,1,a,c.length+1),f),a===i.endLineNumber&&i.endColumn<=c.length+1&&f===""&&(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}};jye=GRr([YRr(3,wa)],jye);const uP=class uP{static getCollator(){return uP._COLLATOR||(uP._COLLATOR=new Intl.Collator),uP._COLLATOR}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=QRr(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=Kft(e,t,i);if(!r)return!1;for(let s=0,o=r.before.length;s<o;s++)if(r.before[s]!==r.after[s])return!0;return!1}};uP._COLLATOR=null;let bB=uP;function Kft(n,e,t){const i=e.startLineNumber;let r=e.endLineNumber;if(e.endColumn===1&&r--,i>=r)return null;const s=[];for(let a=i;a<=r;a++)s.push(n.getLineContent(a));let o=s.slice(0);return o.sort(bB.getCollator().compare),t===!0&&(o=o.reverse()),{startLineNumber:i,endLineNumber:r,before:s,after:o}}function QRr(n,e,t){const i=Kft(n,e,t);return i?ma.replace(new ie(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(` `)):null}class Gft extends In{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((o,a)=>({selection:o,index:a,ignore:!1}));i.sort((o,a)=>ie.compareRangesUsingStarts(o.selection,a.selection));let r=i[0];for(let o=1;o<i.length;o++){const a=i[o];r.selection.endLineNumber===a.selection.startLineNumber&&(r.index<a.index?a.ignore=!0:(r.ignore=!0,r=a))}const s=[];for(const o of i)s.push(new qft(o.selection,this.down,o.ignore));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class XRr extends Gft{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:A("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"2_line",title:A({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class ZRr extends Gft{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:A("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"2_line",title:A({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class JRr extends In{constructor(){super({id:"editor.action.duplicateSelection",label:A("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:me.writable,menuOpts:{menuId:zn.MenubarSelectionMenu,group:"2_line",title:A({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const r=[],s=t.getSelections(),o=t.getModel();for(const a of s)if(a.isEmpty())r.push(new qft(a,!0));else{const l=new Yn(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);r.push(new QCr(l,o.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class Yft extends In{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(wa),r=[],s=t.getSelections()||[],o=t.getOption(12);for(const a of s)r.push(new jye(a,this.down,o,i));t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class ePr extends Yft{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:A("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"2_line",title:A({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class tPr extends Yft{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:A("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"2_line",title:A({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class Qft extends In{constructor(e,t){super(t),this.descending=e}run(e,t){if(!t.hasModel())return;const i=t.getModel();let r=t.getSelections();r.length===1&&r[0].isEmpty()&&(r=[new Yn(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);for(const o of r)if(!bB.canRun(t.getModel(),o,this.descending))return;const s=[];for(let o=0,a=r.length;o<a;o++)s[o]=new bB(r[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class nPr extends Qft{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:A("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:me.writable})}}class iPr extends Qft{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:A("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:me.writable})}}class rPr extends In{constructor(){super({id:"editor.action.removeDuplicateLines",label:A("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:me.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;const r=[],s=[];let o=0,a=!0,l=t.getSelections();l.length===1&&l[0].isEmpty()&&(l=[new Yn(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))],a=!1);for(const c of l){const u=new Set,d=[];for(let m=c.startLineNumber;m<=c.endLineNumber;m++){const _=i.getLineContent(m);u.has(_)||(d.push(_),u.add(_))}const f=new Yn(c.startLineNumber,1,c.endLineNumber,i.getLineMaxColumn(c.endLineNumber)),p=c.startLineNumber-o,g=new Yn(p,1,p+d.length-1,d[d.length-1].length);r.push(ma.replace(f,d.join(` `))),s.push(g),o+=c.endLineNumber-c.startLineNumber+1-d.length}t.pushUndoStop(),t.executeEdits(this.id,r,a?s:void 0),t.pushUndoStop()}}const VX=class VX extends In{constructor(){super({id:VX.ID,label:A("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:Gl(2089,2102),weight:100}})}run(e,t,i){let r=[];i.reason==="auto-save"&&(r=(t.getSelections()||[]).map(u=>new We(u.positionLineNumber,u.positionColumn)));const s=t.getSelection();if(s===null)return;const o=e.get(Dr),a=t.getModel(),l=o.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a==null?void 0:a.getLanguageId(),resource:a==null?void 0:a.uri}),c=new qRr(s,r,l);t.pushUndoStop(),t.executeCommands(this.id,[c]),t.pushUndoStop()}};VX.ID="editor.action.trimTrailingWhitespace";let Fye=VX;class sPr extends In{constructor(){super({id:"editor.action.deleteLines",label:A("lines.delete","Delete Line"),alias:"Delete Line",precondition:me.writable,kbOpts:{kbExpr:me.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 s=0;const o=[],a=[];for(let l=0,c=i.length;l<c;l++){const u=i[l];let d=u.startLineNumber,f=u.endLineNumber,p=1,g=r.getLineMaxColumn(f);f<r.getLineCount()?(f+=1,g=1):d>1&&(d-=1,p=r.getLineMaxColumn(d)),o.push(ma.replace(new Yn(d,p,f,g),"")),a.push(new Yn(d-s,u.positionColumn,d-s,u.positionColumn)),s+=u.endLineNumber-u.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,o,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(s=>{let o=s.endLineNumber;return s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(o-=1),{startLineNumber:s.startLineNumber,selectionStartColumn:s.selectionStartColumn,endLineNumber:o,positionColumn:s.positionColumn}});t.sort((s,o)=>s.startLineNumber===o.startLineNumber?s.endLineNumber-o.endLineNumber:s.startLineNumber-o.startLineNumber);const i=[];let r=t[0];for(let s=1;s<t.length;s++)r.endLineNumber+1>=t[s].startLineNumber?r.endLineNumber=t[s].endLineNumber:(i.push(r),r=t[s]);return i.push(r),i}}class oPr extends In{constructor(){super({id:"editor.action.indentLines",label:A("lines.indent","Indent Line"),alias:"Indent Line",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,TS.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class aPr extends In{constructor(){super({id:"editor.action.outdentLines",label:A("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:2140,weight:100}})}run(e,t){YP.Outdent.runEditorCommand(e,t,null)}}class lPr extends In{constructor(){super({id:"editor.action.insertLineBefore",label:A("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zte.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class cPr extends In{constructor(){super({id:"editor.action.insertLineAfter",label:A("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:me.writable,kbOpts:{kbExpr:me.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zte.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class Xft extends In{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),r=this._getRangesToDelete(t),s=[];for(let l=0,c=r.length-1;l<c;l++){const u=r[l],d=r[l+1];ie.intersectRanges(u,d)===null?s.push(u):r[l+1]=ie.plusRange(u,d)}s.push(r[r.length-1]);const o=this._getEndCursorState(i,s),a=s.map(l=>ma.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,o),t.pushUndoStop()}}class uPr extends Xft{constructor(){super({id:"deleteAllLeft",label:A("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:me.writable,kbOpts:{kbExpr:me.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const r=[];let s=0;return t.forEach(o=>{let a;if(o.endColumn===1&&s>0){const l=o.startLineNumber-s;a=new Yn(l,o.startColumn,l,o.startColumn)}else a=new Yn(o.startLineNumber,o.startColumn,o.startLineNumber,o.startColumn);s+=o.endLineNumber-o.startLineNumber,o.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(ie.compareRangesUsingStarts),i=i.map(s=>{if(s.isEmpty())if(s.startColumn===1){const o=Math.max(1,s.startLineNumber-1),a=s.startLineNumber===1?1:r.getLineLength(o)+1;return new ie(o,a,s.startLineNumber,1)}else return new ie(s.startLineNumber,1,s.startLineNumber,s.startColumn);else return new ie(s.startLineNumber,1,s.endLineNumber,s.endColumn)}),i)}}class dPr extends Xft{constructor(){super({id:"deleteAllRight",label:A("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:me.writable,kbOpts:{kbExpr:me.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const r=[];for(let s=0,o=t.length,a=0;s<o;s++){const l=t[s],c=new Yn(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(s=>{if(s.isEmpty()){const o=t.getLineMaxColumn(s.startLineNumber);return s.startColumn===o?new ie(s.startLineNumber,s.startColumn,s.startLineNumber+1,1):new ie(s.startLineNumber,s.startColumn,s.startLineNumber,o)}return s});return r.sort(ie.compareRangesUsingStarts),r}}class hPr extends In{constructor(){super({id:"editor.action.joinLines",label:A("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:me.writable,kbOpts:{kbExpr:me.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(ie.compareRangesUsingStarts);const s=[],o=i.reduce((f,p)=>f.isEmpty()?f.endLineNumber===p.startLineNumber?(r.equalsSelection(f)&&(r=p),p):p.startLineNumber>f.endLineNumber+1?(s.push(f),p):new Yn(f.startLineNumber,f.startColumn,p.endLineNumber,p.endColumn):p.startLineNumber>f.endLineNumber?(s.push(f),p):new Yn(f.startLineNumber,f.startColumn,p.endLineNumber,p.endColumn));s.push(o);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=r,d=0;for(let f=0,p=s.length;f<p;f++){const g=s[f],m=g.startLineNumber,_=1;let v=0,b,y;const C=a.getLineLength(g.endLineNumber)-g.endColumn;if(g.isEmpty()||g.startLineNumber===g.endLineNumber){const I=g.getStartPosition();I.lineNumber<a.getLineCount()?(b=m+1,y=a.getLineMaxColumn(b)):(b=I.lineNumber,y=a.getLineMaxColumn(I.lineNumber))}else b=g.endLineNumber,y=a.getLineMaxColumn(b);let S=a.getLineContent(m);for(let I=m+1;I<=b;I++){const L=a.getLineContent(I),N=a.getLineFirstNonWhitespaceColumn(I);if(N>=1){let P=!0;S===""&&(P=!1),P&&(S.charAt(S.length-1)===" "||S.charAt(S.length-1)===" ")&&(P=!1,S=S.replace(/[\s\uFEFF\xA0]+$/g," "));const O=L.substr(N-1);S+=(P?" ":"")+O,P?v=O.length+1:v=O.length}else v=0}const k=new ie(m,_,b,y);if(!k.isEmpty()){let I;g.isEmpty()?(l.push(ma.replace(k,S)),I=new Yn(k.startLineNumber-d,S.length-v+1,m-d,S.length-v+1)):g.startLineNumber===g.endLineNumber?(l.push(ma.replace(k,S)),I=new Yn(g.startLineNumber-d,g.startColumn,g.endLineNumber-d,g.endColumn)):(l.push(ma.replace(k,S)),I=new Yn(g.startLineNumber-d,g.startColumn,g.startLineNumber-d,S.length-C)),ie.intersectRanges(k,r)!==null?u=I:c.push(I)}d+=k.endLineNumber-k.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class fPr extends In{constructor(){super({id:"editor.action.transpose",label:A("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:me.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const r=t.getModel();if(r===null)return;const s=[];for(let o=0,a=i.length;o<a;o++){const l=i[o];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 ie(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),f=r.getValueInRange(d).split("").reverse().join("");s.push(new Bu(new Yn(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),f))}else{const d=new ie(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),f=r.getValueInRange(d).split("").reverse().join("");s.push(new c2e(d,f,new Yn(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class tN extends In{run(e,t){const i=t.getSelections();if(i===null)return;const r=t.getModel();if(r===null)return;const s=t.getOption(132),o=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const u=new ie(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=r.getValueInRange(u);o.push(ma.replace(u,this._modifyText(d,s)))}else{const l=r.getValueInRange(a);o.push(ma.replace(a,this._modifyText(l,s)))}t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop()}}class pPr extends tN{constructor(){super({id:"editor.action.transformToUppercase",label:A("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:me.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class gPr extends tN{constructor(){super({id:"editor.action.transformToLowercase",label:A("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:me.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class gw{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}}const WX=class WX extends tN{constructor(){super({id:"editor.action.transformToTitlecase",label:A("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:me.writable})}_modifyText(e,t){const i=WX.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,r=>r.toLocaleUpperCase()):e}};WX.titleBoundary=new gw("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let cQ=WX;const dP=class dP extends tN{constructor(){super({id:"editor.action.transformToSnakecase",label:A("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:me.writable})}_modifyText(e,t){const i=dP.caseBoundary.get(),r=dP.singleLetters.get();return!i||!r?e:e.replace(i,"$1_$2").replace(r,"$1_$2$3").toLocaleLowerCase()}};dP.caseBoundary=new gw("(\\p{Ll})(\\p{Lu})","gmu"),dP.singleLetters=new gw("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let A6=dP;const zX=class zX extends tN{constructor(){super({id:"editor.action.transformToCamelcase",label:A("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:me.writable})}_modifyText(e,t){const i=zX.wordBoundary.get();if(!i)return e;const r=e.split(i);return r.shift()+r.map(o=>o.substring(0,1).toLocaleUpperCase()+o.substring(1)).join("")}};zX.wordBoundary=new gw("[_\\s-]","gm");let uQ=zX;const hP=class hP extends tN{constructor(){super({id:"editor.action.transformToPascalcase",label:A("editor.transformToPascalcase","Transform to Pascal Case"),alias:"Transform to Pascal Case",precondition:me.writable})}_modifyText(e,t){const i=hP.wordBoundary.get(),r=hP.wordBoundaryToMaintain.get();return!i||!r?e:e.split(r).map(a=>a.split(i)).flat().map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}};hP.wordBoundary=new gw("[_\\s-]","gm"),hP.wordBoundaryToMaintain=new gw("(?<=\\.)","gm");let dQ=hP;const gS=class gS extends tN{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:A("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:me.writable})}_modifyText(e,t){const i=gS.caseBoundary.get(),r=gS.singleLetters.get(),s=gS.underscoreBoundary.get();return!i||!r||!s?e:e.replace(s,"$1-$3").replace(i,"$1-$2").replace(r,"$1-$2").toLocaleLowerCase()}};gS.caseBoundary=new gw("(\\p{Ll})(\\p{Lu})","gmu"),gS.singleLetters=new gw("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),gS.underscoreBoundary=new gw("(\\S)(_)(\\S)","gm");let hQ=gS;zt(XRr);zt(ZRr);zt(JRr);zt(ePr);zt(tPr);zt(nPr);zt(iPr);zt(rPr);zt(Fye);zt(sPr);zt(oPr);zt(aPr);zt(lPr);zt(cPr);zt(uPr);zt(dPr);zt(hPr);zt(fPr);zt(pPr);zt(gPr);A6.caseBoundary.isSupported()&&A6.singleLetters.isSupported()&&zt(A6);uQ.wordBoundary.isSupported()&&zt(uQ);dQ.wordBoundary.isSupported()&&zt(dQ);cQ.titleBoundary.isSupported()&&zt(cQ);hQ.isSupported()&&zt(hQ);var mPr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},ZW=function(n,e){return function(t,i){e(t,i,n)}},DU;const Zft=new yn("LinkedEditingInputVisible",!1),_Pr="linked-editing-decoration";var IE;let $M=(IE=class extends Ye{static get(e){return e.getContribution(DU.ID)}constructor(e,t,i,r,s){super(),this.languageConfigurationService=r,this._syncRangesToken=0,this._localToDispose=this._register(new Et),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=Zft.bindTo(t),this._debounceInformation=s.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 Et),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(o=>{(o.hasChanged(70)||o.hasChanged(94))&&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(70)||this._editor.getOption(94))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(rn.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const r=new Rm(this._debounceInformation.get(t)),s=()=>{this._rangeUpdateTriggerPromise=r.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},o=new Rm(0),a=l=>{this._rangeSyncTriggerPromise=o.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{s()})),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}}s()})),this._localToDispose.add({dispose:()=>{r.dispose(),o.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 o=r.match(this._currentWordPattern);if((o?o[0].length:0)!==r.length)return this.clearRanges()}const s=[];for(let o=1,a=this._currentDecorations.length;o<a;o++){const l=this._currentDecorations.getRange(o);if(l)if(l.startLineNumber!==l.endLineNumber)s.push({range:l,text:r});else{let c=t.getValueInRange(l),u=r,d=l.startColumn,f=l.endColumn;const p=GE(c,u);d+=p,c=c.substr(p),u=u.substr(p);const g=FK(c,u);f-=g,c=c.substr(0,c.length-g),u=u.substr(0,u.length-g),(d!==f||u.length!==0)&&s.push({range:new ie(l.startLineNumber,d,l.endLineNumber,f),text:u})}}if(s.length!==0)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const o=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",s),this._editor._getViewModel().setPrevEditOperationType(o)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations.clear(),this._currentRequestCts&&(this._currentRequestCts.cancel(),this._currentRequestCts=null,this._currentRequestPosition=null)}async updateRanges(e=!1){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 o=this._currentDecorations.getRange(0);if(o&&o.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=r;const s=this._currentRequestCts=new ba;try{const o=new Qc(!1),a=await Jft(this._providers,i,t,s.token);if(this._debounceInformation.update(i,o.elapsed()),s!==this._currentRequestCts||(this._currentRequestCts=null,r!==i.getVersionId()))return;let l=[];a!=null&&a.ranges&&(l=a.ranges),this._currentWordPattern=(a==null?void 0:a.wordPattern)||this._languageWordPattern;let c=!1;for(let d=0,f=l.length;d<f;d++)if(ie.containsPosition(l[d],t)){if(c=!0,d!==0){const p=l[d];l.splice(d,1),l.unshift(p)}break}if(!c){this.clearRanges();return}const u=l.map(d=>({range:d,options:DU.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(o){Km(o)||tr(o),(this._currentRequestCts===s||!this._currentRequestCts)&&this.clearRanges()}}},DU=IE,IE.ID="editor.contrib.linkedEditing",IE.DECORATION=ur.register({description:"linked-editing",stickiness:0,className:_Pr}),IE);$M=DU=mPr([ZW(1,Oi),ZW(2,Fn),ZW(3,wa),ZW(4,kg)],$M);class vPr extends In{constructor(){super({id:"editor.action.linkedEditing",label:A("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:It.and(me.writable,me.hasRenameProvider),kbOpts:{kbExpr:me.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(Cs),[r,s]=Array.isArray(t)&&t||[void 0,void 0];return vi.isUri(r)&&We.isIPosition(s)?i.openCodeEditor({resource:r},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(s),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},tr):super.runCommand(e,t)}run(e,t){const i=$M.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const bPr=pc.bindToContribution($M.get);gn(new bPr({id:"cancelLinkedEditingInput",precondition:Zft,handler:n=>n.clearRanges(),kbOpts:{kbExpr:me.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function Jft(n,e,t,i){const r=n.ordered(e);return Cke(r.map(s=>async()=>{try{return await s.provideLinkedEditingRanges(e,t,i)}catch(o){ll(o);return}}),s=>!!s&&Gd(s==null?void 0:s.ranges))}ve("editor.linkedEditingBackground",{dark:At.fromHex("#f00").transparent(.3),light:At.fromHex("#f00").transparent(.3),hcDark:At.fromHex("#f00").transparent(.3),hcLight:At.white},A("editorLinkedEditingBackground","Background color when the editor auto renames on type."));wf("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(Fn);return Jft(i,e,t,xr.None)});cs($M.ID,$M,1);zt(vPr);let yPr=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}async resolve(e){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 fQ{constructor(e){this._disposables=new Et;let t=[];for(const[i,r]of e){const s=i.links.map(o=>new yPr(o,r));t=fQ._union(t,s),Uee(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let r,s,o,a;for(r=0,o=0,s=e.length,a=t.length;r<s&&o<a;){const l=e[r],c=t[o];if(ie.areIntersectingOrTouching(l.range,c.range)){r++;continue}ie.compareRangesUsingStarts(l.range,c.range)<0?(i.push(l),r++):(i.push(c),o++)}for(;r<s;r++)i.push(e[r]);for(;o<a;o++)i.push(t[o]);return i}}function ept(n,e,t){const i=[],r=n.ordered(e).reverse().map((s,o)=>Promise.resolve(s.provideLinks(e,t)).then(a=>{a&&(i[o]=[a,s])},ll));return Promise.all(r).then(()=>{const s=new fQ(iv(i));return t.isCancellationRequested?(s.dispose(),new fQ([])):s})}os.registerCommand("_executeLinkProvider",async(n,...e)=>{let[t,i]=e;ys(t instanceof vi),typeof i!="number"&&(i=0);const{linkProvider:r}=n.get(Fn),s=n.get(Xo).getModel(t);if(!s)return[];const o=await ept(r,s,xr.None);if(!o)return[];for(let l=0;l<Math.min(i,o.links.length);l++)await o.links[l].resolve(xr.None);const a=o.links.slice(0);return o.dispose(),a});var CPr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},JW=function(n,e){return function(t,i){e(t,i,n)}},Bye,nL;let yB=(nL=class extends Ye{static get(e){return e.getContribution(Bye.ID)}constructor(e,t,i,r,s){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=r,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=s.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new ao(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const o=this._register(new fne(e));this._register(o.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(o.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(o.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(71)&&(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)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(71))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Ic(t=>ept(this.providers,e,t));try{const t=new Qc(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){tr(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(78)==="altKey",i=[],r=Object.keys(this.currentOccurrences);for(const o of r){const a=this.currentOccurrences[o];i.push(a.decorationId)}const s=[];if(e)for(const o of e)s.push(JP.decoration(o,t));this.editor.changeDecorations(o=>{const a=o.deltaDecorations(i,s);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l<c;l++){const u=new JP(e[l],a[l]);this.currentOccurrences[u.decorationId]=u}})}_onEditorMouseMove(e,t){const i=this.editor.getOption(78)==="altKey";if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const r=this.getLinkOccurrence(e.target.position);r&&this.editor.changeDecorations(s=>{r.activate(s,i),this.activeLinkDecorationId=r.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(78)==="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(xr.None).then(s=>{if(typeof s=="string"&&this.editor.hasModel()){const o=this.editor.getModel().uri;if(o.scheme===ir.file&&s.startsWith(`${ir.file}:`)){const a=vi.parse(s);if(a.scheme===ir.file){const l=B0(a);let c=null;l.startsWith("/./")||l.startsWith("\\.\\")?c=`.${l.substr(1)}`:(l.startsWith("//./")||l.startsWith("\\\\.\\"))&&(c=`.${l.substr(2)}`),c&&(s=Mpr(o,c))}}}return this.openerService.open(s,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},s=>{const o=s instanceof Error?s.message:s;o==="invalid"?this.notificationService.warn(A("invalid.url","Failed to open this link because it is not well-formed: {0}",r.url.toString())):o==="missing"?this.notificationService.warn(A("missing.url","Failed to open this link because its target is missing.")):tr(s)})}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.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},Bye=nL,nL.ID="editor.linkDetector",nL);yB=Bye=CPr([JW(1,xf),JW(2,wl),JW(3,Fn),JW(4,kg)],yB);const zHe={general:ur.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:ur.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class JP{static decoration(e,t){return{range:e.range,options:JP._getOptions(e,t,!1)}}static _getOptions(e,t,i){const r={...i?zHe.active:zHe.general};return r.hoverMessage=wPr(e,t),r}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,JP._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,JP._getOptions(this.link,t,!1))}}function wPr(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?A("links.navigate.executeCmd","Execute command"):A("links.navigate.follow","Follow link"),r=e?zr?A("links.navigate.kb.meta.mac","cmd + click"):A("links.navigate.kb.meta","ctrl + click"):zr?A("links.navigate.kb.alt.mac","option + click"):A("links.navigate.kb.alt","alt + click");if(n.url){let s="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];s=A("tooltip.explanation","Execute command {0}",l)}}return new rd("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,s).appendMarkdown(` (${r})`)}else return new rd().appendText(`${i} (${r})`)}class xPr extends In{constructor(){super({id:"editor.action.openLink",label:A("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=yB.get(t);if(!i||!t.hasModel())return;const r=t.getSelections();for(const s of r){const o=i.getLinkOccurrence(s.getEndPosition());o&&i.openLinkOccurrence(o,!1)}}}cs(yB.ID,yB,1);zt(xPr);const WIe=class WIe extends Ye{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(118);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};WIe.ID="editor.contrib.longLinesHelper";let pQ=WIe;cs(pQ.ID,pQ,2);const SPr=ve("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},A("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);ve("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},A("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);ve("editor.wordHighlightTextBackground",SPr,A("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 EPr=ve("editor.wordHighlightBorder",{light:null,dark:null,hcDark:aa,hcLight:aa},A("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));ve("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:aa,hcLight:aa},A("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));ve("editor.wordHighlightTextBorder",EPr,A("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const kPr=ve("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",A("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),TPr=ve("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",A("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),IPr=ve("editorOverviewRuler.wordHighlightTextForeground",clt,A("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),LPr=ur.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:Ga(TPr),position:ug.Center},minimap:{color:Ga(yte),position:1}}),APr=ur.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:Ga(IPr),position:ug.Center},minimap:{color:Ga(yte),position:1}}),NPr=ur.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:Ga(clt),position:ug.Center},minimap:{color:Ga(yte),position:1}}),DPr=ur.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),RPr=ur.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:Ga(kPr),position:ug.Center},minimap:{color:Ga(yte),position:1}});function PPr(n){return n===rM.Write?LPr:n===rM.Text?APr:RPr}function OPr(n){return n?DPr:NPr}Gm((n,e)=>{const t=n.getColor(Gke);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var MPr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},jPr=function(n,e){return function(t,i){e(t,i,n)}},$ye;function Fk(n,e){const t=e.filter(i=>!n.find(r=>r.equals(i)));if(t.length>=1){const i=t.map(s=>`line ${s.viewState.position.lineNumber} column ${s.viewState.position.column}`).join(", "),r=t.length===1?A("cursorAdded","Cursor added: {0}",i):A("cursorsAdded","Cursors added: {0}",i);Xy(r)}}class FPr extends In{constructor(){super({id:"editor.action.insertCursorAbove",label:A("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"3_multi",title:A({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 s=t._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const o=s.getCursorStates();s.setCursorStates(i.source,3,ou.addCursorUp(s,o,r)),s.revealTopMostCursor(i.source),Fk(o,s.getCursorStates())}}class BPr extends In{constructor(){super({id:"editor.action.insertCursorBelow",label:A("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"3_multi",title:A({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 s=t._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const o=s.getCursorStates();s.setCursorStates(i.source,3,ou.addCursorDown(s,o,r)),s.revealBottomMostCursor(i.source),Fk(o,s.getCursorStates())}}class $Pr extends In{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:A("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"3_multi",title:A({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 s=t.getLineMaxColumn(r);i.push(new Yn(r,s,r,s))}e.endColumn>1&&i.push(new Yn(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),r=t.getSelections(),s=t._getViewModel(),o=s.getCursorStates(),a=[];r.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),Fk(o,s.getCursorStates())}}class HPr extends In{constructor(){super({id:"editor.action.addCursorsToBottom",label:A("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(),s=[];for(let l=i[0].startLineNumber;l<=r;l++)s.push(new Yn(l,i[0].startColumn,l,i[0].endColumn));const o=t._getViewModel(),a=o.getCursorStates();s.length>0&&t.setSelections(s),Fk(a,o.getCursorStates())}}class VPr extends In{constructor(){super({id:"editor.action.addCursorsToTop",label:A("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 Yn(a,i[0].startColumn,a,i[0].endColumn));const s=t._getViewModel(),o=s.getCursorStates();r.length>0&&t.setSelections(r),Fk(o,s.getCursorStates())}}class ez{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class CB{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new CB(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let r=!1,s,o;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(r=!0,s=!0,o=!0):(s=i.wholeWord,o=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 Yn(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` `);return new CB(e,t,r,c,s,o,u)}constructor(e,t,i,r,s,o,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=r,this.wholeWord=s,this.matchCase=o,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 ez(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 ez(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(132):null,!1);return i?new Yn(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 ez(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 ez(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(132):null,!1);return i?new Yn(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(132):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1,1073741824)}}const UX=class UX extends Ye{static get(e){return e.getContribution(UX.ID)}constructor(e){super(),this._sessionDispose=this._register(new Et),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=CB.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 Yn(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(!tpt(this._editor.getModel(),t,r)){const o=this._editor.getModel(),a=[];for(let l=0,c=t.length;l<c;l++)a[l]=this._expandEmptyToWord(o,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(132):null,!1,1073741824):t=r.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(132):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 s=0,o=t.length;s<o;s++){const a=t[s];if(a.range.intersectRanges(r)){t[s]=t[0],t[0]=a;break}}this._setSelections(t.map(s=>new Yn(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn)))}}};UX.ID="editor.contrib.multiCursorController";let HM=UX;class u3 extends In{run(e,t){const i=HM.get(t);if(!i)return;const r=t._getViewModel();if(r){const s=r.getCursorStates(),o=pf.get(t);if(o)this._run(i,o);else{const a=e.get(mi).createInstance(pf,t);this._run(i,a),a.dispose()}Fk(s,r.getCursorStates())}}}class WPr extends u3{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:A("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:me.focus,primary:2082,weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"3_multi",title:A({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class zPr extends u3{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:A("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:zn.MenubarSelectionMenu,group:"3_multi",title:A({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class UPr extends u3{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:A("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:me.focus,primary:Gl(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class qPr extends u3{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:A("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 KPr extends u3{constructor(){super({id:"editor.action.selectHighlights",label:A("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:me.focus,primary:3114,weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"3_multi",title:A({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class GPr extends u3{constructor(){super({id:"editor.action.changeAll",label:A("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:It.and(me.writable,me.editorTextFocus),kbOpts:{kbExpr:me.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class YPr{constructor(e,t,i,r,s){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=r,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,s&&this._model===s._model&&this._searchText===s._searchText&&this._matchCase===s._matchCase&&this._wordSeparators===s._wordSeparators&&this._modelVersionId===s._modelVersionId&&(this._cachedFindMatches=s._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(ie.compareRangesUsingStarts)),this._cachedFindMatches}}var iL;let gQ=(iL=class extends Ye{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(109),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new ao(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(r=>{this._isEnabled=e.getOption(109)})),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=pf.get(e);i&&this._register(i.getState().onFindReplaceStateChange(r=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState($ye._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 s=HM.get(i);if(!s)return null;const o=pf.get(i);if(!o)return null;let a=s.getSession(o);if(!a){const u=i.getSelections();if(u.length>1){const f=o.getState().matchCase;if(!tpt(i.getModel(),u,f))return null}a=CB.create(i,o)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=o.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 YPr(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(132):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(ie.compareRangesUsingStarts);const s=[];for(let c=0,u=0,d=i.length,f=r.length;c<d;){const p=i[c];if(u>=f)s.push(p),c++;else{const g=ie.compareRangesUsingStarts(p,r[u]);g<0?((r[u].isEmpty()||!ie.areIntersecting(p,r[u]))&&s.push(p),c++):(g>0||c++,u++)}}const o=this.editor.getOption(81)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&o,l=s.map(c=>({range:c,options:OPr(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}},$ye=iL,iL.ID="editor.contrib.selectionHighlighter",iL);gQ=$ye=MPr([jPr(1,Fn)],gQ);function tpt(n,e,t){const i=UHe(n,e[0],!t);for(let r=1,s=e.length;r<s;r++){const o=e[r];if(o.isEmpty())return!1;const a=UHe(n,o,!t);if(i!==a)return!1}return!0}function UHe(n,e,t){const i=n.getValueInRange(e);return t?i.toLowerCase():i}class QPr extends In{constructor(){super({id:"editor.action.focusNextCursor",label:A("mutlicursor.focusNextCursor","Focus Next Cursor"),metadata:{description:A("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 s=Array.from(r.getCursorStates()),o=s.shift();o&&(s.push(o),r.setCursorStates(i.source,3,s),r.revealPrimaryCursor(i.source,!0),Fk(s,r.getCursorStates()))}}class XPr extends In{constructor(){super({id:"editor.action.focusPreviousCursor",label:A("mutlicursor.focusPreviousCursor","Focus Previous Cursor"),metadata:{description:A("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 s=Array.from(r.getCursorStates()),o=s.pop();o&&(s.unshift(o),r.setCursorStates(i.source,3,s),r.revealPrimaryCursor(i.source,!0),Fk(s,r.getCursorStates()))}}cs(HM.ID,HM,4);cs(gQ.ID,gQ,1);zt(FPr);zt(BPr);zt($Pr);zt(WPr);zt(zPr);zt(UPr);zt(qPr);zt(KPr);zt(GPr);zt(HPr);zt(VPr);zt(QPr);zt(XPr);const ZPr="editor.action.inlineEdit.accept",JPr="editor.action.inlineEdit.reject",eOr="editor.action.inlineEdit.jumpTo",tOr="editor.action.inlineEdit.jumpBack";var nOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},iOr=function(n,e){return function(t,i){e(t,i,n)}};const ide="inline-edit";let Hye=class extends Ye{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Ar(this,!1),this.currentTextModel=Gs(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=ai(this,r=>{var b;if(this.isDisposed.read(r))return;const s=this.currentTextModel.read(r);if(s!==this.model.targetTextModel.read(r))return;const o=this.model.ghostText.read(r);if(!o)return;let a=(b=this.model.range)==null?void 0:b.read(r);a&&a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn&&(a=void 0);const l=(a?a.startLineNumber===a.endLineNumber:!0)&&o.parts.length===1&&o.parts[0].lines.length===1,c=o.parts.length===1&&o.parts[0].lines.every(y=>y.length===0),u=[],d=[];function f(y,C){if(d.length>0){const S=d[d.length-1];C&&S.decorations.push(new xh(S.content.length+1,S.content.length+1+y[0].length,C,0)),S.content+=y[0],y=y.slice(1)}for(const S of y)d.push({content:S,decorations:C?[new xh(1,S.length+1,C,0)]:[]})}const p=s.getLineContent(o.lineNumber);let g,m=0;if(!c&&(l||!a)){for(const y of o.parts){let C=y.lines;a&&!l&&(f(C,ide),C=[]),g===void 0?(u.push({column:y.column,text:C[0],preview:y.preview}),C=C.slice(1)):f([p.substring(m,y.column-1)],void 0),C.length>0&&(f(C,ide),g===void 0&&y.column<=p.length&&(g=y.column)),m=y.column-1}g!==void 0&&f([p.substring(m)],void 0)}const _=g!==void 0?new Mft(g,p.length+1):void 0,v=l||!a?o.lineNumber:a.endLineNumber-1;return{inlineTexts:u,additionalLines:d,hiddenRange:_,lineNumber:v,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:s,range:a,isSingleLine:l,isPureRemove:c}}),this.decorations=ai(this,r=>{const s=this.uiState.read(r);if(!s)return[];const o=[];if(s.hiddenRange&&o.push({range:s.hiddenRange.toRange(s.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),s.range){const a=[];if(s.isSingleLine)a.push(s.range);else if(!s.isPureRemove){const l=s.range.endLineNumber-s.range.startLineNumber;for(let c=0;c<l;c++){const u=s.range.startLineNumber+c,d=s.targetTextModel.getLineFirstNonWhitespaceColumn(u),f=s.targetTextModel.getLineLastNonWhitespaceColumn(u),p=new ie(u,d,u,f);a.push(p)}}for(const l of a)o.push({range:l,options:TM})}if(s.range&&!s.isSingleLine&&s.isPureRemove){const a=new ie(s.range.startLineNumber,1,s.range.endLineNumber-1,1);o.push({range:a,options:Z7})}for(const a of s.inlineTexts)o.push({range:ie.fromPositions(new We(s.lineNumber,a.column)),options:{description:ide,after:{content:a.text,inlineClassName:a.preview?"inline-edit-decoration-preview":"inline-edit-decoration",cursorStops:$_.Left},showIfCollapsed:!0}});return o}),this._register(gi(()=>{this.isDisposed.set(!0,void 0)})),this._register(jft(this.editor,this.decorations))}};Hye=nOr([iOr(2,pa)],Hye);var EIe=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},cy=function(n,e){return function(t,i){e(t,i,n)}},RU;let Vye=class extends Ye{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Gs(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).showToolbar==="always"),this.sessionPosition=void 0,this.position=ai(this,r=>{var l,c;const s=(l=this.model.read(r))==null?void 0:l.model.ghostText.read(r);if(!this.alwaysShowToolbar.read(r)||!s||s.parts.length===0)return this.sessionPosition=void 0,null;const o=s.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==s.lineNumber&&(this.sessionPosition=void 0);const a=new We(s.lineNumber,Math.min(o,((c=this.sessionPosition)==null?void 0:c.column)??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(uf((r,s)=>{if(!this.model.read(r)||!this.alwaysShowToolbar.read(r))return;const a=s.add(this.instantiationService.createInstance(Wye,this.editor,!0,this.position));e.addContentWidget(a),s.add(gi(()=>e.removeContentWidget(a)))}))}};Vye=EIe([cy(2,mi)],Vye);var LE;let Wye=(LE=class extends Ye{constructor(e,t,i,r,s,o){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=s,this._menuService=o,this.id=`InlineEditHintsContentWidget${RU.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=jr("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[jr("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(zn.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(r.createInstance(zye,this.nodes.toolBar,this.editor,zn.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,l)=>{if(a instanceof Jf)return r.createInstance(rOr,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{RU._dropDownVisible=a})),this._register(Gi(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(Gi(a=>{const l=[];for(const[c,u]of this.inlineCompletionsActionsMenus.getActions())for(const d of u)d instanceof Jf&&l.push(d);l.length>0&&l.unshift(new Ac),this.toolBar.setAdditionalSecondaryActions(l)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},RU=LE,LE._dropDownVisible=!1,LE.id=0,LE);Wye=RU=EIe([cy(3,mi),cy(4,Oi),cy(5,Eg)],Wye);class rOr extends nk{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=jr("div.keybinding").root;this._register(new t3(t,Yf,{disableTitle:!0,...mut})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let zye=class extends eB{constructor(e,t,i,r,s,o,a,l,c,u){super(e,{resetMenu:i,...r},s,o,a,l,c,u),this.editor=t,this.menuId=i,this.options2=r,this.menuService=s,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._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var i,r,s,o,a,l,c;const e=[],t=[];jte(this.menu,(i=this.options2)==null?void 0:i.menuOptions,{primary:e,secondary:t},(s=(r=this.options2)==null?void 0:r.toolbarOptions)==null?void 0:s.primaryGroup,(a=(o=this.options2)==null?void 0:o.toolbarOptions)==null?void 0:a.shouldInlineSubmenu,(c=(l=this.options2)==null?void 0:l.toolbarOptions)==null?void 0:c.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setAdditionalSecondaryActions(e){fa(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};zye=EIe([cy(4,Eg),cy(5,Oi),cy(6,up),cy(7,Ws),cy(8,Fo),cy(9,md)],zye);var npt=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},PU=function(n,e){return function(t,i){e(t,i,n)}},dF,Uye;function*sOr(n,e,t=1){e===void 0&&([e,n]=[n,0]);for(let i=n;i<e;i+=t)yield i}function rde(n){var i;const e=((i=n[0].match(/^\s*/))==null?void 0:i[0])??"",t=e.length;return{text:n.map(r=>r.replace(new RegExp("^"+e),"")),shift:t}}var rL;let qye=(rL=class extends Ye{static _createUniqueUri(){return vi.from({scheme:"inline-edit-widget",path:new Date().toString()+String(dF._modelId++)})}constructor(e,t,i,r,s){super(),this._editor=e,this._model=t,this._instantiationService=i,this._diffProviderFactoryService=r,this._modelService=s,this._position=ai(this,o=>{const a=this._model.read(o);if(!a||a.text.length===0||a.range.startLineNumber===a.range.endLineNumber&&!(a.range.startColumn===a.range.endColumn&&a.range.startColumn===1))return null;const l=this._editor.getModel();if(!l)return null;const c=Array.from(sOr(a.range.startLineNumber,a.range.endLineNumber+1)),u=c.map(m=>l.getLineLastNonWhitespaceColumn(m)),d=Math.max(...u),f=c[u.indexOf(d)],p=new We(f,d);return{top:a.range.startLineNumber,left:p}}),this._text=ai(this,o=>{const a=this._model.read(o);if(!a)return{text:"",shift:0};const l=rde(a.text.split(` `));return{text:l.text.join(` `),shift:l.shift}}),this._originalModel=$d(()=>this._modelService.createModel("",null,dF._createUniqueUri())).keepObserved(this._store),this._modifiedModel=$d(()=>this._modelService.createModel("",null,dF._createUniqueUri())).keepObserved(this._store),this._diff=ai(this,o=>{var a,l;return(l=(a=this._diffPromise.read(o))==null?void 0:a.promiseResult.read(o))==null?void 0:l.data}),this._diffPromise=ai(this,o=>{const a=this._model.read(o);if(!a)return;const l=this._editor.getModel();if(!l)return;const c=rde(l.getValueInRange(a.range).split(` `)).text.join(` `),u=rde(a.text.split(` `)).text.join(` `);this._originalModel.get().setValue(c),this._modifiedModel.get().setValue(u);const d=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return Pte.fromFn(async()=>{const f=await d.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},xr.None);if(!f.identical)return f.changes})}),this._register(uf((o,a)=>{if(!this._model.read(o)||this._position.get()===null)return;const c=a.add(this._instantiationService.createInstance(Kye,this._editor,this._position,this._text.map(u=>u.text),this._text.map(u=>u.shift),this._diff));e.addOverlayWidget(c),a.add(gi(()=>e.removeOverlayWidget(c)))}))}},dF=rL,rL._modelId=0,rL);qye=dF=npt([PU(2,mi),PU(3,g$),PU(4,Xo)],qye);var sL;let Kye=(sL=class extends Ye{constructor(e,t,i,r,s,o){var a;super(),this._editor=e,this._position=t,this._text=i,this._shift=r,this._diff=s,this._instantiationService=o,this.id=`InlineEditSideBySideContentWidget${Uye.id++}`,this.allowEditorOverflow=!1,this._nodes=Jt("div.inlineEditSideBySide",void 0),this._scrollChanged=Fu("editor.onDidScrollChange",this._editor.onDidScrollChange),this._previewEditor=this._register(this._instantiationService.createInstance(uv,this._nodes,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off",wrappingIndent:"none",wrappingStrategy:void 0},{contributions:[],isSimpleWidget:!0},this._editor)),this._previewEditorObs=Gf(this._previewEditor),this._editorObs=Gf(this._editor),this._previewTextModel=this._register(this._instantiationService.createInstance(yb,"",((a=this._editor.getModel())==null?void 0:a.getLanguageId())??Ih,yb.DEFAULT_CREATION_OPTIONS,null)),this._setText=ai(l=>{const c=this._text.read(l);c&&this._previewTextModel.setValue(c)}).recomputeInitiallyAndOnChange(this._store),this._decorations=ai(this,l=>{this._setText.read(l);const c=this._position.read(l);if(!c)return{org:[],mod:[]};const u=this._diff.read(l);if(!u)return{org:[],mod:[]};const d=[],f=[];if(u.length===1&&u[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return{org:[],mod:[]};const p=this._shift.get(),g=m=>new ie(m.startLineNumber+c.top-1,m.startColumn+p,m.endLineNumber+c.top-1,m.endColumn+p);for(const m of u)if(m.original.isEmpty||d.push({range:g(m.original.toInclusiveRange()),options:Z7}),m.modified.isEmpty||f.push({range:m.modified.toInclusiveRange(),options:bY}),m.modified.isEmpty||m.original.isEmpty)m.original.isEmpty||d.push({range:g(m.original.toInclusiveRange()),options:N2e}),m.modified.isEmpty||f.push({range:m.modified.toInclusiveRange(),options:L2e});else for(const _ of m.innerChanges||[])m.original.contains(_.originalRange.startLineNumber)&&d.push({range:g(_.originalRange),options:_.originalRange.isEmpty()?D2e:TM}),m.modified.contains(_.modifiedRange.startLineNumber)&&f.push({range:_.modifiedRange,options:_.modifiedRange.isEmpty()?A2e:yY});return{org:d,mod:f}}),this._originalDecorations=ai(this,l=>this._decorations.read(l).org),this._modifiedDecorations=ai(this,l=>this._decorations.read(l).mod),this._previewEditor.setModel(this._previewTextModel),this._register(this._editorObs.setDecorations(this._originalDecorations)),this._register(this._previewEditorObs.setDecorations(this._modifiedDecorations)),this._register(Gi(l=>{const c=this._previewEditorObs.contentWidth.read(l),u=this._text.read(l).split(` `).length-1,d=this._editor.getOption(67)*u;c<=0||this._previewEditor.layout({height:d,width:c})})),this._register(Gi(l=>{this._position.read(l),this._editor.layoutOverlayWidget(this)})),this._register(Gi(l=>{this._scrollChanged.read(l),this._position.read(l)&&this._editor.layoutOverlayWidget(this)}))}getId(){return this.id}getDomNode(){return this._nodes}getPosition(){const e=this._position.get();if(!e)return null;const t=this._editor.getLayoutInfo(),i=this._editor.getScrolledVisiblePosition(new We(e.top,1));if(!i)return null;const r=i.top-1,s=this._editor.getOffsetForColumn(e.left.lineNumber,e.left.column);return{preference:{left:t.contentLeft+s+10,top:r}}}},Uye=sL,sL.id=0,sL);Kye=Uye=npt([PU(5,mi)],Kye);var oOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},GT=function(n,e){return function(t,i){e(t,i,n)}},hF,nm;let Sh=(nm=class extends Ye{static get(e){return e.getContribution(hF.ID)}constructor(e,t,i,r,s,o,a,l){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=r,this._commandService=s,this._configurationService=o,this._diffProviderFactoryService=a,this._modelService=l,this._isVisibleContext=hF.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=hF.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=Ar(this,void 0),this._currentWidget=$d(this._currentEdit,g=>{const m=this._currentEdit.read(g);if(!m)return;const _=m.range.endLineNumber,v=m.range.endColumn,b=m.text.endsWith(` `)&&!(m.range.startLineNumber===m.range.endLineNumber&&m.range.startColumn===m.range.endColumn)?m.text.slice(0,-1):m.text,y=new gB(_,[new GY(v,b,!1)]),C=m.range.startLineNumber===m.range.endLineNumber&&y.parts.length===1&&y.parts[0].lines.length===1,S=m.text==="";return!C&&!S?void 0:this.instantiationService.createInstance(Hye,this.editor,{ghostText:vm(y),minReservedLineCount:vm(0),targetTextModel:vm(this.editor.getModel()??void 0),range:vm(m.range)})}),this._isAccepting=Ar(this,!1),this._enabled=Gs(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).enabled),this._fontFamily=Gs(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).fontFamily);const c=Fu("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(Gi(g=>{this._enabled.read(g)&&(c.read(g),!this._isAccepting.read(g)&&this.getInlineEdit(e,!0))}));const u=Gs(this,e.onDidChangeCursorPosition,()=>e.getPosition());this._register(Gi(g=>{if(!this._enabled.read(g))return;const m=u.read(g);m&&this.checkCursorPosition(m)})),this._register(Gi(g=>{const m=this._currentEdit.read(g);if(this._isCursorAtInlineEditContext.set(!1),!m){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const _=e.getPosition();_&&this.checkCursorPosition(_)}));const d=Fu("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(Gi(async g=>{var m;this._enabled.read(g)&&(d.read(g),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(63).keepOnBlur)&&((m=this._currentRequestCts)==null||m.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const f=Fu("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(Gi(g=>{this._enabled.read(g)&&(f.read(g),this.getInlineEdit(e,!0))}));const p=this._register(Zot());this._register(Gi(g=>{const m=this._fontFamily.read(g);p.setStyle(m===""||m==="default"?"":` .monaco-editor .inline-edit-decoration, .monaco-editor .inline-edit-decoration-preview, .monaco-editor .inline-edit { font-family: ${m}; }`)})),this._register(new Vye(this.editor,this._currentWidget,this.instantiationService)),this._register(new qye(this.editor,this._currentEdit,this.instantiationService,this._diffProviderFactoryService,this._modelService))}checkCursorPosition(e){if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const t=this._currentEdit.get();if(!t){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(ie.containsPosition(t.range,e))}validateInlineEdit(e,t){var i;if(t.text.includes(` `)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const s=t.range.endLineNumber,o=t.range.endColumn,a=((i=e.getModel())==null?void 0:i.getLineLength(s))??0;if(o!==a+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const i=e.getModel();if(!i)return;const r=i.getVersionId(),s=this.languageFeaturesService.inlineEditProvider.all(i);if(s.length===0)return;const o=s[0];this._currentRequestCts=new ba;const a=this._currentRequestCts.token,l=t?jK.Automatic:jK.Invoke;if(t&&await aOr(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==r)return;const u=await o.provideInlineEdit(i,{triggerKind:l},a);if(u&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==r)&&this.validateInlineEdit(e,u))return u}async getInlineEdit(e,t){this._isCursorAtInlineEditContext.set(!1),await this.clear();const i=await this.fetchInlineEdit(e,t);i&&this._currentEdit.set(i,void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}async accept(){this._isAccepting.set(!0,void 0);const e=this._currentEdit.get();if(!e)return;let t=e.text;e.text.startsWith(` `)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[ma.replace(ie.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,ll),this.freeEdit(e),va(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){var i;this._jumpBackPosition=(i=this.editor.getSelection())==null?void 0:i.getStartPosition();const e=this._currentEdit.get();if(!e)return;const t=We.lift({lineNumber:e.range.startLineNumber,column:e.range.startColumn});this.editor.setPosition(t),this.editor.revealPositionInCenterIfOutsideViewport(t)}async clear(e=!0){const t=this._currentEdit.get();t&&(t!=null&&t.rejected)&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,ll),t&&this.freeEdit(t),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}},hF=nm,nm.ID="editor.contrib.inlineEditController",nm.inlineEditVisibleKey="inlineEditVisible",nm.inlineEditVisibleContext=new yn(nm.inlineEditVisibleKey,!1),nm.cursorAtInlineEditKey="cursorAtInlineEdit",nm.cursorAtInlineEditContext=new yn(nm.cursorAtInlineEditKey,!1),nm);Sh=hF=oOr([GT(1,mi),GT(2,Oi),GT(3,Fn),GT(4,Fo),GT(5,Dr),GT(6,g$),GT(7,Xo)],Sh);function aOr(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()}))})}let lOr=class extends In{constructor(){super({id:ZPr,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:It.and(me.writable,Sh.inlineEditVisibleContext),kbOpts:[{weight:101,primary:2,kbExpr:It.and(me.writable,Sh.inlineEditVisibleContext,Sh.cursorAtInlineEditContext)}],menuOpts:[{menuId:zn.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){const i=Sh.get(t);await(i==null?void 0:i.accept())}};class cOr extends In{constructor(){const e=It.and(me.writable,It.not(Sh.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e}})}async run(e,t){const i=Sh.get(t);i==null||i.trigger()}}class uOr extends In{constructor(){const e=It.and(me.writable,Sh.inlineEditVisibleContext,It.not(Sh.cursorAtInlineEditKey));super({id:eOr,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e},menuOpts:[{menuId:zn.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){const i=Sh.get(t);i==null||i.jumpToCurrent()}}class dOr extends In{constructor(){const e=It.and(me.writable,Sh.cursorAtInlineEditContext);super({id:tOr,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:110,primary:2646,kbExpr:e},menuOpts:[{menuId:zn.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){const i=Sh.get(t);i==null||i.jumpBack()}}class hOr extends In{constructor(){const e=It.and(me.writable,Sh.inlineEditVisibleContext);super({id:JPr,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:zn.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){const i=Sh.get(t);await(i==null?void 0:i.clear())}}zt(lOr);zt(hOr);zt(uOr);zt(dOr);zt(cOr);cs(Sh.ID,Sh,3);const fOr="editor.action.inlineEdits.accept",pOr="editor.action.inlineEdits.showPrevious",gOr="editor.action.inlineEdits.showNext",VM=new yn("inlineEditsVisible",!1,A("inlineEditsVisible","Whether an inline edit is visible")),mOr=new yn("inlineEditsIsPinned",!1,A("isPinned","Whether an inline edit is visible")),zIe=class zIe extends Ye{constructor(e){super(),this._editor=e,this._editorObs=Gf(this._editor),this._placeholderText=this._editorObs.getOption(88),this._state=Yp({owner:this,equalsFn:yG},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=_Or(this,t=>{var i;return((i=this._state.read(t))==null?void 0:i.placeholder)!==void 0}),this._view=Pk((t,i)=>{if(!this._shouldViewBeAlive.read(t))return;const r=jr("div.editorPlaceholder");i.add(Gi(s=>{const o=this._state.read(s),a=(o==null?void 0:o.placeholder)!==void 0;r.root.style.display=a?"block":"none",r.root.innerText=(o==null?void 0:o.placeholder)??""})),i.add(Gi(s=>{const o=this._editorObs.layoutInfo.read(s);r.root.style.left=`${o.contentLeft}px`,r.root.style.width=o.contentWidth-o.verticalScrollbarWidth+"px",r.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),i.add(Gi(s=>{r.root.style.fontFamily=this._editorObs.getOption(49).read(s),r.root.style.fontSize=this._editorObs.getOption(52).read(s)+"px",r.root.style.lineHeight=this._editorObs.getOption(67).read(s)+"px"})),i.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:vm(0),position:vm(null),domNode:r.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};zIe.ID="editor.contrib.placeholderText";let wB=zIe;function _Or(n,e){return o$(n,(t,i)=>i===!0?!0:e(t))}var vOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},bOr=function(n,e){return function(t,i){e(t,i,n)}};class yOr{constructor(e,t,i){this.range=e,this.newLines=t,this.changes=i}}let Gye=class extends Ye{constructor(e,t,i,r){super(),this._editor=e,this._edit=t,this._userPrompt=i,this._instantiationService=r,this._editorObs=Gf(this._editor),this._elements=jr("div.inline-edits-widget",{style:{position:"absolute",overflow:"visible",top:"0px",left:"0px"}},[jr("div@editorContainer",{style:{position:"absolute",top:"0px",left:"0px",width:"500px",height:"500px"}},[jr("div.toolbar@toolbar",{style:{position:"absolute",top:"-25px",left:"0px"}}),jr("div.promptEditor@promptEditor",{style:{position:"absolute",top:"-25px",left:"80px",width:"300px",height:"22px"}}),jr("div.preview@editor",{style:{position:"absolute",top:"0px",left:"0px"}})]),LD("svg",{style:{overflow:"visible",pointerEvents:"none"}},[LD("defs",[LD("linearGradient",{id:"Gradient2",x1:"0",y1:"0",x2:"1",y2:"0"},[LD("stop",{offset:"0%",class:"gradient-stop"}),LD("stop",{offset:"100%",class:"gradient-stop"})])]),LD("path@path",{d:"",fill:"url(#Gradient2)"})])]),this._previewTextModel=this._register(this._instantiationService.createInstance(yb,"",Ih,yb.DEFAULT_CREATION_OPTIONS,null)),this._setText=ai(o=>{const a=this._edit.read(o);a&&this._previewTextModel.setValue(a.newLines.join(` `))}).recomputeInitiallyAndOnChange(this._store),this._promptTextModel=this._register(this._instantiationService.createInstance(yb,"",Ih,yb.DEFAULT_CREATION_OPTIONS,null)),this._promptEditor=this._register(this._instantiationService.createInstance(uv,this._elements.promptEditor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,placeholder:"Describe the change you want...",fontFamily:Jut},{contributions:dI.getSomeEditorContributions([H_.ID,wB.ID,PM.ID]),isSimpleWidget:!0},this._editor)),this._previewEditor=this._register(this._instantiationService.createInstance(uv,this._elements.editor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0},{contributions:[]},this._editor)),this._previewEditorObs=Gf(this._previewEditor),this._decorations=ai(this,o=>{var u;this._setText.read(o);const a=(u=this._edit.read(o))==null?void 0:u.changes;if(!a)return[];const l=[],c=[];if(a.length===1&&a[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return[];for(const d of a)if(d.original.isEmpty||l.push({range:d.original.toInclusiveRange(),options:Z7}),d.modified.isEmpty||c.push({range:d.modified.toInclusiveRange(),options:bY}),d.modified.isEmpty||d.original.isEmpty)d.original.isEmpty||l.push({range:d.original.toInclusiveRange(),options:N2e}),d.modified.isEmpty||c.push({range:d.modified.toInclusiveRange(),options:L2e});else for(const f of d.innerChanges||[])d.original.contains(f.originalRange.startLineNumber)&&l.push({range:f.originalRange,options:f.originalRange.isEmpty()?D2e:TM}),d.modified.contains(f.modifiedRange.startLineNumber)&&c.push({range:f.modifiedRange,options:f.modifiedRange.isEmpty()?A2e:yY});return c}),this._layout1=ai(this,o=>{const a=this._editor.getModel(),l=this._edit.read(o);if(!l)return null;const c=l.range;let u=0;for(let p=c.startLineNumber;p<c.endLineNumberExclusive;p++){const g=a.getLineMaxColumn(p),m=this._editor.getOffsetForColumn(p,g);u=Math.max(u,m)}return{left:this._editor.getLayoutInfo().contentLeft+u}}),this._layout=ai(this,o=>{const a=this._edit.read(o);if(!a)return null;const l=a.range,c=this._editorObs.scrollLeft.read(o),u=this._layout1.read(o).left+20-c,d=this._editor.getTopForLineNumber(l.startLineNumber)-this._editorObs.scrollTop.read(o),f=this._editor.getTopForLineNumber(l.endLineNumberExclusive)-this._editorObs.scrollTop.read(o),p=new YR(u,d),g=new YR(u,f),m=f-d,_=50,v=this._editor.getOption(67)*a.newLines.length,b=m-v,y=new YR(u+_,d+b/2),C=new YR(u+_,f-b/2);return{topCode:p,bottomCode:g,codeHeight:m,topEdit:y,bottomEdit:C,editHeight:v}});const s=ai(this,o=>this._edit.read(o)!==void 0||this._userPrompt.read(o)!==void 0);this._register(Ow(this._elements.root,{display:ai(this,o=>s.read(o)?"block":"none")})),this._register(VR(this._editor.getDomNode(),this._elements.root)),this._register(Gf(e).createOverlayWidget({domNode:this._elements.root,position:vm(null),allowEditorOverflow:!1,minContentWidthInPx:ai(o=>{var c;const a=(c=this._layout1.read(o))==null?void 0:c.left;if(a===void 0)return 0;const l=this._previewEditorObs.contentWidth.read(o);return a+l})})),this._previewEditor.setModel(this._previewTextModel),this._register(this._previewEditorObs.setDecorations(this._decorations)),this._register(Gi(o=>{const a=this._layout.read(o);if(!a)return;const{topCode:l,bottomCode:c,topEdit:u,bottomEdit:d,editHeight:f}=a,p=10,g=0,m=40,_=new wOr().moveTo(l).lineTo(l.deltaX(p)).curveTo(l.deltaX(p+m),u.deltaX(-40-g),u.deltaX(-0)).lineTo(u).lineTo(d).lineTo(d.deltaX(-0)).curveTo(d.deltaX(-40-g),c.deltaX(p+m),c.deltaX(p)).lineTo(c).build();this._elements.path.setAttribute("d",_),this._elements.editorContainer.style.top=`${u.y}px`,this._elements.editorContainer.style.left=`${u.x}px`,this._elements.editorContainer.style.height=`${f}px`;const v=this._previewEditorObs.contentWidth.read(o);this._previewEditor.layout({height:f,width:v})})),this._promptEditor.setModel(this._promptTextModel),this._promptEditor.layout(),this._register(xOr(COr(this._userPrompt,o=>o??"",o=>o),Gf(this._promptEditor).value)),this._register(Gi(o=>{const a=Gf(this._promptEditor).isFocused.read(o);this._elements.root.classList.toggle("focused",a)}))}};Gye=vOr([bOr(3,mi)],Gye);function COr(n,e,t){return i$(void 0,i=>e(n.read(i)),(i,r)=>n.set(t(i),r))}class YR{constructor(e,t){this.x=e,this.y=t}deltaX(e){return new YR(this.x+e,this.y)}}class wOr{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}curveTo(e,t,i){return this._data+=`C ${e.x} ${e.y} ${t.x} ${t.y} ${i.x} ${i.y} `,this}build(){return this._data}}function xOr(n,e){const t=new Et;return t.add(Gi(i=>{const r=n.read(i);e.set(r,void 0)})),t.add(Gi(i=>{const r=e.read(i);n.set(r,void 0)})),t}var SOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},sde=function(n,e){return function(t,i){e(t,i,n)}},fF,oL;let Yye=(oL=class extends Ye{static _createUniqueUri(){return vi.from({scheme:"inline-edits",path:new Date().toString()+String(fF._modelId++)})}constructor(e,t,i,r,s,o,a){super(),this.textModel=e,this._textModelVersionId=t,this._selection=i,this._debounceValue=r,this.languageFeaturesService=s,this._diffProviderFactoryService=o,this._modelService=a,this._forceUpdateExplicitlySignal=X4(this),this._selectedInlineCompletionId=Ar(this,void 0),this._isActive=Ar(this,!1),this._originalModel=$d(()=>this._modelService.createModel("",null,fF._createUniqueUri())).keepObserved(this._store),this._modifiedModel=$d(()=>this._modelService.createModel("",null,fF._createUniqueUri())).keepObserved(this._store),this._pinnedRange=new kOr(this.textModel,this._textModelVersionId),this.isPinned=this._pinnedRange.range.map(l=>!!l),this.userPrompt=Ar(this,void 0),this.inlineEdit=ai(this,l=>{var c,u;return(u=(c=this._inlineEdit.read(l))==null?void 0:c.promiseResult.read(l))==null?void 0:u.data}),this._inlineEdit=ai(this,l=>{const c=this.selectedInlineEdit.read(l);if(!c)return;const u=c.inlineCompletion.range;if(c.inlineCompletion.insertText.trim()==="")return;let d=c.inlineCompletion.insertText.split(/\r\n|\r|\n/);function f(_){var b;const v=((b=_[0].match(/^\s*/))==null?void 0:b[0])??"";return _.map(y=>y.replace(new RegExp("^"+v),""))}d=f(d);let g=this.textModel.getValueInRange(u).split(/\r\n|\r|\n/);g=f(g),this._originalModel.get().setValue(g.join(` `)),this._modifiedModel.get().setValue(d.join(` `));const m=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return Pte.fromFn(async()=>{const _=await m.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},xr.None);if(!_.identical)return new yOr(fr.fromRangeInclusive(u),f(d),_.changes)})}),this._fetchStore=this._register(new Et),this._inlineEditsFetchResult=L7(this,void 0),this._inlineEdits=Yp({owner:this,equalsFn:yG},l=>{var c;return((c=this._inlineEditsFetchResult.read(l))==null?void 0:c.completions.map(u=>new EOr(u)))??[]}),this._fetchInlineEditsPromise=Glt({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:Ib.Automatic}),handleChange:(l,c)=>(l.didChange(this._forceUpdateExplicitlySignal)&&(c.inlineCompletionTriggerKind=Ib.Explicit),!0)},async(l,c)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(l),this._textModelVersionId.read(l);function u(m,_){return _(m)}const d=this._pinnedRange.range.read(l)??u(this._selection.read(l),m=>m.isEmpty()?void 0:m);if(!d){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const f={triggerKind:c.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(l)},p=wge(this._fetchStore);await Nw(200,p);const g=await Fft(this.languageFeaturesService.inlineCompletionsProvider,d,this.textModel,f,p);p.isCancellationRequested||this._inlineEditsFetchResult.set(g,void 0)}),this._filteredInlineEditItems=Yp({owner:this,equalsFn:bG()},l=>this._inlineEdits.read(l)),this.selectedInlineCompletionIndex=ai(this,l=>{const c=this._selectedInlineCompletionId.read(l),u=this._filteredInlineEditItems.read(l),d=this._selectedInlineCompletionId===void 0?-1:u.findIndex(f=>f.semanticId===c);return d===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):d}),this.selectedInlineEdit=ai(this,l=>{const c=this._filteredInlineEditItems.read(l),u=this.selectedInlineCompletionIndex.read(l);return c[u]}),this._register(Z4(this._fetchInlineEditsPromise))}async triggerExplicitly(e){KL(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){KL(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.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)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new Ps;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},fF=oL,oL._modelId=0,oL);Yye=fF=SOr([sde(4,Fn),sde(5,g$),sde(6,Xo)],Yye);class EOr{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class kOr extends Ye{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=Ar(this,[]),this.range=ai(this,i=>{this._versionId.read(i);const r=this._decorations.read(i)[0];return r?this._textModel.getDecorationRange(r)??null:null}),this._register(gi(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var TOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Nj=function(n,e){return function(t,i){e(t,i,n)}},Qye,aL;let Bw=(aL=class extends Ye{static get(e){return e.getContribution(Qye.ID)}constructor(e,t,i,r,s,o){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._debounceService=r,this._languageFeaturesService=s,this._configurationService=o,this._enabled=oEr("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=Gf(this.editor),this._selection=ai(this,a=>this._editorObs.cursorSelection.read(a)??new Yn(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=$d(this,a=>{if(!this._enabled.read(a)||this._editorObs.isReadonly.read(a))return;const l=this._editorObs.model.read(a);return l?this._instantiationService.createInstance(zf(Yye,a),l,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=o$(this,(a,l)=>{var c;return l||((c=this.model.read(a))==null?void 0:c.inlineEdit.read(a))!==void 0}),this._widget=$d(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance(zf(Gye,a),this.editor,this.model.map((l,c)=>l==null?void 0:l.inlineEdit.read(c)),IOr(l=>{var c;return((c=this.model.read(l))==null?void 0:c.userPrompt)??Ar("empty","")}))}),this._register(Kv(VM,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.inlineEdit.read(a))})),this._register(Kv(mOr,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.isPinned.read(a))})),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},Qye=aL,aL.ID="editor.contrib.inlineEditsController",aL);Bw=Qye=TOr([Nj(1,mi),Nj(2,Oi),Nj(3,kg),Nj(4,Fn),Nj(5,Dr)],Bw);function IOr(n){return i$(void 0,e=>n(e).read(e),(e,t)=>{n(void 0).set(e,t)})}function T$(n){return{label:n.value,alias:n.original}}const qX=class qX extends In{constructor(){super({id:qX.ID,...T$($i("action.inlineEdits.showNext","Show Next Inline Edit")),precondition:It.and(me.writable,VM),kbOpts:{weight:100,primary:606}})}async run(e,t){var r;const i=Bw.get(t);(r=i==null?void 0:i.model.get())==null||r.next()}};qX.ID=gOr;let Xye=qX;const KX=class KX extends In{constructor(){super({id:KX.ID,...T$($i("action.inlineEdits.showPrevious","Show Previous Inline Edit")),precondition:It.and(me.writable,VM),kbOpts:{weight:100,primary:604}})}async run(e,t){var r;const i=Bw.get(t);(r=i==null?void 0:i.model.get())==null||r.previous()}};KX.ID=pOr;let Zye=KX;class LOr extends In{constructor(){super({id:"editor.action.inlineEdits.trigger",...T$($i("action.inlineEdits.trigger","Trigger Inline Edit")),precondition:me.writable})}async run(e,t){const i=Bw.get(t);await Klt(async r=>{var s;await((s=i==null?void 0:i.model.get())==null?void 0:s.triggerExplicitly(r))})}}class AOr extends In{constructor(){super({id:fOr,...T$($i("action.inlineEdits.accept","Accept Inline Edit")),precondition:VM,menuOpts:{menuId:zn.InlineEditsActions,title:A("inlineEditsActions","Accept Inline Edit"),group:"primary",order:1,icon:Yt.check},kbOpts:{primary:2058,weight:2e4,kbExpr:VM}})}async run(e,t){var r;t instanceof uv&&(t=t.getParentEditor());const i=Bw.get(t);i&&((r=i.model.get())==null||r.accept(i.editor),i.editor.focus())}}const GX=class GX extends In{constructor(){super({id:GX.ID,...T$($i("action.inlineEdits.hide","Hide Inline Edit")),precondition:VM,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=Bw.get(t);va(r=>{var s;(s=i==null?void 0:i.model.get())==null||s.stop(r)})}};GX.ID="editor.action.inlineEdits.hide";let Jye=GX;cs(Bw.ID,Bw,3);zt(LOr);zt(Xye);zt(Zye);zt(AOr);zt(Jye);const lA={Visible:new yn("parameterHintsVisible",!1),MultipleSignatures:new yn("parameterHintsMultipleSignatures",!1)};async function ipt(n,e,t,i,r){const s=n.ordered(e);for(const o of s)try{const a=await o.provideSignatureHelp(e,t,r,i);if(a)return a}catch(a){ll(a)}}os.registerCommand("_executeSignatureHelpProvider",async(n,...e)=>{const[t,i,r]=e;ys(vi.isUri(t)),ys(We.isIPosition(i)),ys(typeof r=="string"||!r);const s=n.get(Fn),o=await n.get(Cf).createModelReference(t);try{const a=await ipt(s.signatureHelpProvider,o.object.textEditorModel,We.lift(i),{triggerKind:My.Invoke,isRetrigger:!1,triggerCharacter:r},xr.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{o.dispose()}});var cS;(function(n){n.Default={type:0};class e{constructor(r,s){this.request=r,this.previouslyActiveHints=s,this.type=2}}n.Pending=e;class t{constructor(r){this.hints=r,this.type=1}}n.Active=t})(cS||(cS={}));const YX=class YX extends Ye{constructor(e,t,i=YX.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new Ue),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=cS.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Dc),this.triggerChars=new XK,this.retriggerChars=new XK,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Rm(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=cS.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(tr)}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(86).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(86).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 cS.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){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(NOr);this._pendingTriggers=[];const s={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const o=this.editor.getModel(),a=this.editor.getPosition();this.state=new cS.Pending(Ic(l=>ipt(this.providers,o,a,s,l)),i);try{const l=await 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 cS.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=cS.Default),tr(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:My.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:My.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:My.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};YX.DEFAULT_DELAY=120;let e1e=YX;function NOr(n,e){switch(e.triggerKind){case My.Invoke:return e;case My.ContentChange:return n;case My.TriggerCharacter:default:return e}}var DOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},tz=function(n,e){return function(t,i){e(t,i,n)}},t1e;const Pp=Jt,ROr=Zo("parameter-hints-next",Yt.chevronDown,A("parameterHintsNextIcon","Icon for show next parameter hint.")),POr=Zo("parameter-hints-previous",Yt.chevronUp,A("parameterHintsPreviousIcon","Icon for show previous parameter hint."));var lL;let n1e=(lL=class extends Ye{constructor(e,t,i,r,s,o){super(),this.editor=e,this.model=t,this.telemetryService=o,this.renderDisposeables=this._register(new Et),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Pw({editor:e},s,r)),this.keyVisible=lA.Visible.bindTo(i),this.keyMultipleSignatures=lA.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Pp(".editor-widget.parameter-hints-widget"),t=Ot(e,Pp(".phwrapper"));t.tabIndex=-1;const i=Ot(t,Pp(".controls")),r=Ot(i,Pp(".button"+Ni.asCSSSelector(POr))),s=Ot(i,Pp(".overloads")),o=Ot(i,Pp(".button"+Ni.asCSSSelector(ROr)));this._register(_t(r,"click",f=>{Jr.stop(f),this.previous()})),this._register(_t(o,"click",f=>{Jr.stop(f),this.next()}));const a=Pp(".body"),l=new Z9(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Ot(a,Pp(".signature")),u=Ot(a,Pp(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:s,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(f=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const f=this.editor.getOption(50),p=this.domNodes.element;p.style.fontSize=`${f.fontSize}px`,p.style.lineHeight=`${f.lineHeight/f.fontSize}`,p.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",f.fontFamily),p.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",Th.fontFamily)};d(),this._register(rn.chain(this.editor.onDidChangeConfiguration.bind(this.editor),f=>f.filter(p=>p.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(f=>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.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.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const r=Ot(this.domNodes.signature,Pp(".code")),s=i.parameters.length>0,o=i.activeParameter??e.activeParameter;if(s)this.renderParameters(r,i,o);else{const c=Ot(r,Pp("span"));c.textContent=i.label}const a=i.parameters[o];if(a!=null&&a.documentation){const c=Pp("span.documentation");if(typeof a.documentation=="string")c.textContent=a.documentation;else{const u=this.renderMarkdownDocs(a.documentation);c.appendChild(u.element)}Ot(this.domNodes.docs,Pp("p",{},c))}if(i.documentation!==void 0)if(typeof i.documentation=="string")Ot(this.domNodes.docs,Pp("p",{},i.documentation));else{const c=this.renderMarkdownDocs(i.documentation);Ot(this.domNodes.docs,c.element)}const l=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let c="";const u=i.parameters[o];Array.isArray(u.label)?c=i.label.substring(u.label[0],u.label[1]):c=u.label,u.documentation&&(c+=typeof u.documentation=="string"?`, ${u.documentation}`:`, ${u.documentation.value}`),i.documentation&&(c+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==c&&(Ph(A("hint","{0}, hint",c)),this.announcedLabel=c)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new Qc,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var s;(s=this.domNodes)==null||s.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const r=t.elapsed();return r>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:r}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&MS(t.documentation).length>0||t&&typeof t.documentation=="object"&&MS(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&MS(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&MS(e.documentation.value).length>0)}renderParameters(e,t,i){const[r,s]=this.getParameterLabelOffsets(t,i),o=document.createElement("span");o.textContent=t.label.substring(0,r);const a=document.createElement("span");a.textContent=t.label.substring(r,s),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(s),Ot(e,o,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|^)${mg(i.label)}(?=\\W|$)`,"g");r.test(e.label);const s=r.lastIndex-i.label.length;return s>=0?[s,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 t1e.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)}},t1e=lL,lL.ID="editor.widget.parameterHintsWidget",lL);n1e=t1e=DOr([tz(2,Oi),tz(3,xf),tz(4,pa),tz(5,md)],n1e);ve("editorHoverWidget.highlightForeground",DR,A("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var OOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},qHe=function(n,e){return function(t,i){e(t,i,n)}},i1e,cL;let WM=(cL=class extends Ye{static get(e){return e.getContribution(i1e.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new e1e(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(r=>{var s;r?(this.widget.value.show(),this.widget.value.render(r)):(s=this.widget.rawValue)==null||s.hide()})),this.widget=new Bb(()=>this._register(t.createInstance(n1e,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)==null||e.previous()}next(){var e;(e=this.widget.rawValue)==null||e.next()}trigger(e){this.model.trigger(e,0)}},i1e=cL,cL.ID="editor.controller.parameterHints",cL);WM=i1e=OOr([qHe(1,mi),qHe(2,Fn)],WM);class MOr extends In{constructor(){super({id:"editor.action.triggerParameterHints",label:A("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:me.hasSignatureHelpProvider,kbOpts:{kbExpr:me.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=WM.get(t);i==null||i.trigger({triggerKind:My.Invoke})}}cs(WM.ID,WM,2);zt(MOr);const kIe=175,TIe=pc.bindToContribution(WM.get);gn(new TIe({id:"closeParameterHints",precondition:lA.Visible,handler:n=>n.cancel(),kbOpts:{weight:kIe,kbExpr:me.focus,primary:9,secondary:[1033]}}));gn(new TIe({id:"showPrevParameterHint",precondition:It.and(lA.Visible,lA.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:kIe,kbExpr:me.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));gn(new TIe({id:"showNextParameterHint",precondition:It.and(lA.Visible,lA.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:kIe,kbExpr:me.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var jOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},FOr=function(n,e){return function(t,i){e(t,i,n)}};class BOr{constructor(e){this.instantiationService=e}init(...e){}}function $Or(n,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...i){this._autorun=uf((r,s)=>{const o=zf(n(),r);s.add(this.instantiationService.createInstance(o,...i))})}dispose(){var i;(i=this._autorun)==null||i.dispose()}}}function HOr(n){return tne()?$Or(n,r1e):n()}let r1e=class extends BOr{constructor(e,t){super(t),this.init(e)}};r1e=jOr([FOr(1,mi)],r1e);cs(wB.ID,HOr(()=>wB),0);ve("editor.placeholder.foreground",Y_r,A("placeholderForeground","Foreground color of the placeholder text in the editor."));var VOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},nz=function(n,e){return function(t,i){e(t,i,n)}};const d3=new yn("renameInputVisible",!1,A("renameInputVisible","Whether the rename input widget is visible"));new yn("renameInputFocused",!1,A("renameInputFocused","Whether the rename input widget is focused"));let s1e=class{constructor(e,t,i,r,s,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=r,this._logService=o,this.allowEditorOverflow=!0,this._disposables=new Et,this._visibleContextKey=d3.bindTo(s),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new Qc,this._inputWithButton=new WOr,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.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._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new IIe(this._domNode,{fontInfo:this._editor.getOption(50),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{var e,t,i;((e=this._renameCandidateListView)==null?void 0:e.focusedCandidate)!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),((t=this._renameCandidateProvidersCts)==null?void 0:t.token.isCancellationRequested)===!1&&this._renameCandidateProvidersCts.cancel(),(i=this._renameCandidateListView)==null||i.clearFocus()})),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){if(!this._domNode)return;const t=e.getColor(q4),i=e.getColor(alt);this._domNode.style.backgroundColor=String(e.getColor(ig)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(ult)??"");const r=e.getColor(dlt);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(v_e)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(v_e)??""),this._inputWithButton.domNode.style.borderWidth=r?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=r?"solid":"none",this._inputWithButton.domNode.style.borderColor=(r==null?void 0:r.toString())??"none"}_updateFont(){if(this._domNode===void 0)return;ys(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(50);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=ZE(this.getDomNode().ownerDocument.body),t=al(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const r=this._editor.getOption(67),{totalHeight:s}=xB.getLayoutInfo({lineHeight:r}),o=this._nPxAvailableBelow>s*6?[2,1]:[1,2];return{position:this._position,preference:o}}beforeRender(){var i,r;const[e,t]=this._acceptKeybindings;return this._label.innerText=A({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(i=this._keybindingService.lookupKeybinding(e))==null?void 0:i.getLabel(),(r=this._keybindingService.lookupKeybinding(t))==null?void 0:r.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;ys(this._renameCandidateListView),ys(this._nPxAvailableAbove!==void 0),ys(this._nPxAvailableBelow!==void 0);const t=zC(this._inputWithButton.domNode),i=zC(this._label);let r;e===2?r=this._nPxAvailableBelow:r=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:r-i-t,width:Vf(this._inputWithButton.domNode)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)==null||t.call(this,e)}cancelInput(e,t){var i;(i=this._currentCancelInput)==null||i.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,r,s){const{start:o,end:a}=this._getSelection(e,t);this._renameCts=s;const l=new Et;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,r===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=r,this._requestRenameCandidates(t,!1),l.add(_t(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(_t(this._inputWithButton.button,Xt.KEY_DOWN,u=>{const d=new Io(u);(d.equals(3)||d.equals(10))&&(d.stopPropagation(),d.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new We(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",o.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),l.add(gi(()=>{this._renameCts=void 0,s.dispose(!0)})),l.add(gi(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(gi(()=>this._candidates.clear()));const c=new $4;return c.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=u=>{var d;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(d=this._renameCandidateListView)==null||d.clearCandidates(),c.complete(u),!0},this._currentAcceptInput=u=>{this._trace("invoking _currentAcceptInput"),ys(this._renameCandidateListView!==void 0);const d=this._renameCandidateListView.nCandidates;let f,p;const g=this._renameCandidateListView.focusedCandidate;if(g!==void 0?(this._trace("using new name from renameSuggestion"),f=g,p={k:"renameSuggestion"}):(this._trace("using new name from inputField"),f=this._inputWithButton.input.value,p=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),f===t||f.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),c.complete({newName:f,wantsPreview:i&&u,stats:{source:p,nRenameSuggestions:d,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(s.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var u;return this.cancelInput(!((u=this._domNode)!=null&&u.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show(),c.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),ys(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new ba;const i=t?s7.Invoke:s7.Automatic,r=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(r.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(r,e,this._renameCts.token)}}_getSelection(e,t){ys(this._editor.hasModel());const i=this._editor.getSelection();let r=0,s=t.length;return!ie.isEmpty(i)&&!ie.spansMultipleLines(i)&&ie.containsRange(e,i)&&(r=Math.max(0,i.startColumn-e.startColumn),s=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:r,end:s}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const r=(...c)=>this._trace("_updateRenameCandidates",...c);r("start");const s=await K9(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),s===void 0){r("returning early - received updateRenameCandidates results - undefined");return}const o=s.flatMap(c=>c.status==="fulfilled"&&Oy(c.value)?c.value:[]);r(`received updateRenameCandidates results - total (unfiltered) ${o.length} candidates.`);const a=Iw(o,c=>c.newSymbolName);r(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>c.trim().length>0&&c!==this._inputWithButton.input.value&&c!==t&&!this._candidates.has(c));if(r(`valid distinct candidates - ${o.length} candidates.`),l.forEach(c=>this._candidates.add(c.newSymbolName)),l.length<1){r("returning early - no valid distinct candidates");return}r("setting candidates"),this._renameCandidateListView.setCandidates(l),r("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};s1e=VOr([nz(2,mc),nz(3,Ws),nz(4,Oi),nz(5,Uu)],s1e);class IIe{constructor(e,t){this._disposables=new Et,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=IIe._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables),this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(zA({listInactiveFocusForeground:C7,listInactiveFocusBackground:w7}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Xy(A("renameSuggestionsReceivedAria","Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=xB.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(r=>r.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const r=new class{getTemplateId(o){return"candidate"}getHeight(o){return t}},s=new class{constructor(){this.templateId="candidate"}renderTemplate(o){return new xB(o,i)}renderElement(o,a,l){l.populate(o)}disposeTemplate(o){o.dispose()}};return new Ig("NewSymbolNameCandidates",e,r,[s],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class WOr{constructor(){this._onDidInputChange=new Ue,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new Et}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",A("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=A("generateRenameSuggestionsButton","Generate new name suggestions"),this._buttonCancelHoverText=A("cancelRenameSuggestionsButton","Cancel"),this._buttonHover=Jb().setupManagedHover(jh("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(_t(this.input,Xt.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(_t(this.input,Xt.KEY_DOWN,e=>{const t=new Io(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(_t(this.input,Xt.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(_t(this.input,Xt.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(_t(this.input,Xt.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return ys(this._inputNode),this._inputNode}get button(){return ys(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){var e;this._buttonState="sparkle",this._sparkleIcon??(this._sparkleIcon=zL(Yt.sparkle)),mu(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){var e;this._buttonState="stop",this._stopIcon??(this._stopIcon=zL(Yt.primitiveSquare)),mu(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}const Z6=class Z6{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${Z6._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=zL(Yt.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),vu(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){var i;const t=!!((i=e.tags)!=null&&i.includes(Lge.AIGenerated));this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+Z6._PADDING*2}}dispose(){}};Z6._PADDING=2;let xB=Z6;var zOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Qx=function(n,e){return function(t,i){e(t,i,n)}},o1e;class LIe{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const r=this._providers[this._providerRenameIdx];if(!r.resolveRenameLocation)break;const s=await r.resolveRenameLocation(this.model,this.position,e);if(s){if(s.rejectReason){t.push(s.rejectReason);continue}return s}}this._providerRenameIdx=0;const i=this.model.getWordAtPosition(this.position);return i?{range:new ie(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(` `):void 0}:{range:ie.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` `):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,r){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(` `)};const o=await s.provideRenameEdits(this.model,this.position,e,r);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),r)}else return this._provideRenameEdits(e,t+1,i.concat(A("no result","No result.")),r);return o}}async function UOr(n,e,t,i){const r=new LIe(e,t,n),s=await r.resolveRenameLocation(xr.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:r.provideRenameEdits(i,xr.None)}var uL;let dk=(uL=class{static get(e){return e.getContribution(o1e.ID)}constructor(e,t,i,r,s,o,a,l,c){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=r,this._progressService=s,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._telemetryService=c,this._disposableStore=new Et,this._cts=new ba,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(s1e,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var g,m;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new ba,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new LIe(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const r=new ak(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const _=i.resolveRenameLocation(r.token);this._progressService.showWhile(_,250),s=await _,e("resolved rename location")}catch(_){_ instanceof rv?e("resolve rename location cancelled",JSON.stringify(_,null," ")):(e("resolve rename location failed",_ instanceof Error?_:JSON.stringify(_,null," ")),(typeof _=="string"||Rb(_))&&((g=ep.get(this.editor))==null||g.showMessage(_||A("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{r.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),(m=ep.get(this.editor))==null||m.showMessage(s.rejectReason,t);return}if(r.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new ak(this.editor,5,s.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async _=>[_,await _.supportsAutomaticNewSymbolNamesTriggerKind??!1])),u=(_,v)=>{let b=c.slice();return _===s7.Automatic&&(b=b.filter(([y,C])=>C)),b.map(([y])=>y.provideNewSymbolNames(a,s.range,_,v))};e("creating rename input field and awaiting its result");const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),f=await this._renameWidget.getInput(s.range,s.text,d,l.length>0?u:void 0,o);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),f),typeof f=="boolean"){e(`returning early - rename input field response - ${f}`),f&&this.editor.focus(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const p=K9(i.provideRenameEdits(f.newName,o.token),o.token).then(async _=>{if(!_){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(_.rejectReason){e(`returning early - rejected with reason: ${_.rejectReason}`),this._notificationService.info(_.rejectReason);return}this.editor.setSelection(ie.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(_,{editor:this.editor,showPreview:f.wantsPreview,label:A("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,f.newName),code:"undoredo.rename",quotableLabel:A("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,f.newName),respectAutoSaveConfig:!0}).then(v=>{e("edits applied"),v.ariaSummary&&Ph(A("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,f.newName,v.ariaSummary))}).catch(v=>{e(`error when applying edits ${JSON.stringify(v,null," ")}`),this._notificationService.error(A("rename.failedApply","Rename failed to apply edits")),this._logService.error(v)})},_=>{e("error when providing rename edits",JSON.stringify(_,null," ")),this._notificationService.error(A("rename.failed","Rename failed to compute edits")),this._logService.error(_)}).finally(()=>{o.dispose()});return e("returning rename operation"),this._progressService.showWhile(p,250),p}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const r=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",r)}},o1e=uL,uL.ID="editor.contrib.renameController",uL);dk=o1e=zOr([Qx(1,mi),Qx(2,wl),Qx(3,t$),Qx(4,Rk),Qx(5,Uu),Qx(6,pte),Qx(7,Fn),Qx(8,md)],dk);class qOr extends In{constructor(){super({id:"editor.action.rename",label:A("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:It.and(me.writable,me.hasRenameProvider),kbOpts:{kbExpr:me.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Cs),[r,s]=Array.isArray(t)&&t||[void 0,void 0];return vi.isUri(r)&&We.isIPosition(s)?i.openCodeEditor({resource:r},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(s),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},tr):super.runCommand(e,t)}run(e,t){const i=e.get(Uu),r=dk.get(t);return r?(i.trace("[RenameAction] got controller, running..."),r.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}cs(dk.ID,dk,4);zt(qOr);const AIe=pc.bindToContribution(dk.get);gn(new AIe({id:"acceptRenameInput",precondition:d3,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:It.and(me.focus,It.not("isComposing")),primary:3}}));gn(new AIe({id:"acceptRenameInputWithPreview",precondition:It.and(d3,It.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:It.and(me.focus,It.not("isComposing")),primary:2051}}));gn(new AIe({id:"cancelRenameInput",precondition:d3,handler:n=>n.cancelRenameInput(),kbOpts:{weight:199,kbExpr:me.focus,primary:9,secondary:[1033]}}));Ao(class extends Mh{constructor(){super({id:"focusNextRenameSuggestion",title:{...$i("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:d3,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(Cs).getFocusedCodeEditor();if(!t)return;const i=dk.get(t);i&&i.focusNextRenameSuggestion()}});Ao(class extends Mh{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...$i("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:d3,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(Cs).getFocusedCodeEditor();if(!t)return;const i=dk.get(t);i&&i.focusPreviousRenameSuggestion()}});wf("_executeDocumentRenameProvider",function(n,e,t,...i){const[r]=i;ys(typeof r=="string");const{renameProvider:s}=n.get(Fn);return UOr(s,e,t,r)});wf("_executePrepareRename",async function(n,e,t){const{renameProvider:i}=n.get(Fn),s=await new LIe(e,t,i).resolveRenameLocation(xr.None);if(s!=null&&s.rejectReason)throw new Error(s.rejectReason);return s});Ca.as(bv.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:A("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var KOr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},KHe=function(n,e){return function(t,i){e(t,i,n)}},cO;let mQ=(cO=class extends Ye{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(r=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(r=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(r=>{var o;const s=(o=this.editor.getModel())==null?void 0:o.getLanguageId();s&&r.affects(s)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(r=>{this.options&&!r.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(r=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(r=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new ao(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,r=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(r!=null&&r.markers)))return{foldingRules:r,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,r;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((r=this.options)!=null&&r.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(s=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(s)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(s=>{if(!s.shouldBeInComments)return!0;const o=t.validateRange(s.range),a=t.tokenization.getLineTokens(o.startLineNumber),l=a.findTokenIndexAtOffset(o.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const i=Object.values(this.currentOccurrences).map(s=>s.decorationId),r=e.map(s=>GOr(s));this.editor.changeDecorations(s=>{const o=s.deltaDecorations(i,r);this.currentOccurrences={};for(let a=0,l=o.length;a<l;a++){const c={sectionHeader:e[a],decorationId:o[a]};this.currentOccurrences[c.decorationId]=c}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},cO.ID="editor.sectionHeaderDetector",cO);mQ=KOr([KHe(1,wa),KHe(2,Sf)],mQ);function GOr(n){return{range:n.range,options:ur.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:n.hasSeparatorLine?2:1,sectionHeaderText:n.text}})}}cs(mQ.ID,mQ,1);function YOr(n){for(let e=0,t=n.length;e<t;e+=4){const i=n[e+0],r=n[e+1],s=n[e+2],o=n[e+3];n[e+0]=o,n[e+1]=s,n[e+2]=r,n[e+3]=i}}function QOr(n){const e=new Uint8Array(n.buffer,n.byteOffset,n.length*4);return tot()||YOr(e),dte.wrap(e)}function rpt(n){const e=new Uint32Array(XOr(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 QOr(e)}function XOr(n){let e=0;if(e+=2,n.type==="full")e+=1+n.data.length;else{e+=1,e+=3*n.deltas.length;for(const t of n.deltas)t.data&&(e+=t.data.length)}return e}function xne(n){return n&&!!n.data}function spt(n){return n&&Array.isArray(n.edits)}class ZOr{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function opt(n,e){return n.has(e)}function JOr(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function apt(n,e,t,i,r){const s=JOr(n,e),o=await Promise.all(s.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,r)}catch(u){c=u,l=null}return(!l||!xne(l)&&!spt(l))&&(l=null),new ZOr(a,l,c)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function eMr(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class tMr{constructor(e,t){this.provider=e,this.tokens=t}}function nMr(n,e){return n.has(e)}function lpt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function NIe(n,e,t,i){const r=lpt(n,e),s=await Promise.all(r.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){ll(l),a=null}return(!a||!xne(a))&&(a=null),new tMr(o,a)}));for(const o of s)if(o.tokens)return o;return s.length>0?s[0]:null}os.registerCommand("_provideDocumentSemanticTokensLegend",async(n,...e)=>{const[t]=e;ys(t instanceof vi);const i=n.get(Xo).getModel(t);if(!i)return;const{documentSemanticTokensProvider:r}=n.get(Fn),s=eMr(r,i);return s?s[0].getLegend():n.get(Fo).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});os.registerCommand("_provideDocumentSemanticTokens",async(n,...e)=>{const[t]=e;ys(t instanceof vi);const i=n.get(Xo).getModel(t);if(!i)return;const{documentSemanticTokensProvider:r}=n.get(Fn);if(!opt(r,i))return n.get(Fo).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const s=await apt(r,i,null,null,xr.None);if(!s)return;const{provider:o,tokens:a}=s;if(!a||!xne(a))return;const l=rpt({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),l});os.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(n,...e)=>{const[t,i]=e;ys(t instanceof vi);const r=n.get(Xo).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:s}=n.get(Fn),o=lpt(s,r);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!i||!ie.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const a=await NIe(s,r,ie.lift(i),xr.None);if(a)return a.provider.getLegend()});os.registerCommand("_provideDocumentRangeSemanticTokens",async(n,...e)=>{const[t,i]=e;ys(t instanceof vi),ys(ie.isIRange(i));const r=n.get(Xo).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:s}=n.get(Fn),o=await NIe(s,r,ie.lift(i),xr.None);if(!(!o||!o.tokens))return rpt({id:0,type:"full",data:o.tokens.data})});const DIe="editor.semanticHighlighting";function OU(n,e,t){var r;const i=(r=t.getValue(DIe,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))==null?void 0:r.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var cpt=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},uy=function(n,e){return function(t,i){e(t,i,n)}},sS;let a1e=class extends Ye{constructor(e,t,i,r,s,o){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new l1e(u,e,i,s,o)},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()];OU(u,i,r)?d||a(u):d&&l(u,d)}};t.getModels().forEach(u=>{OU(u,i,r)&&a(u)}),this._register(t.onModelAdded(u=>{OU(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(DIe)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};a1e=cpt([uy(0,mte),uy(1,Xo),uy(2,mc),uy(3,Dr),uy(4,kg),uy(5,Fn)],a1e);var AE;let l1e=(AE=class extends Ye{constructor(e,t,i,r,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentSemanticTokens",{min:sS.REQUEST_MIN_DELAY,max:sS.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new ao(()=>this._fetchDocumentSemanticTokensNow(),sS.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 o=()=>{vo(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)}))};o(),this._register(this._provider.onDidChange(()=>{o(),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),vo(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!opt(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new ba,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=apt(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],o=this._model.onDidChangeContent(l=>{s.push(l)}),a=new Qc(!1);r.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,s)}},l=>{l&&(Km(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||tr(l),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,r,s){s=Math.min(s,i.length-r,e.length-t);for(let o=0;o<s;o++)i[r+o]=e[t+o]}_setDocumentSemanticTokens(e,t,i,r){const s=this._currentDocumentResponse,o=()=>{(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),o();return}if(spt(t)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:s.data};else{let a=0;for(const f of t.edits)a+=(f.data?f.data.length:0)-f.deleteCount;const l=s.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let f=t.edits.length-1;f>=0;f--){const p=t.edits[f];if(p.start>l.length){i.warnInvalidEditStart(s.resultId,t.resultId,f,p.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(p.start+p.deleteCount);g>0&&(sS._copy(l,u-g,c,d-g,g),d-=g),p.data&&(sS._copy(p.data,0,c,d-p.data.length,p.data.length),d-=p.data.length),u=p.start}u>0&&sS._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(xne(t)){this._currentDocumentResponse=new iMr(e,t.resultId,t.data);const a=qat(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);o()}},sS=AE,AE.REQUEST_MIN_DELAY=300,AE.REQUEST_MAX_DELAY=2e3,AE);l1e=sS=cpt([uy(1,mte),uy(2,mc),uy(3,kg),uy(4,Fn)],l1e);class iMr{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}i3(a1e);var rMr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Dj=function(n,e){return function(t,i){e(t,i,n)}},uO;let _Q=(uO=class extends Ye{constructor(e,t,i,r,s,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=r,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new ao(()=>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(DIe)&&(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(!OU(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!nMr(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=Ic(o=>Promise.resolve(NIe(this._provider,e,t,o))),s=new Qc(!1);return r.then(o=>{if(this._debounceInformation.update(e,s.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=o,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,qat(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}},uO.ID="editor.contrib.viewportSemanticTokens",uO);_Q=rMr([Dj(1,mte),Dj(2,mc),Dj(3,Dr),Dj(4,kg),Dj(5,Fn)],_Q);cs(_Q.ID,_Q,1);class sMr{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const r of t){const s=[];i.push(s),this.selectSubwords&&this._addInWordRanges(s,e,r),this._addWordRanges(s,e,r),this._addWhitespaceLine(s,e,r),s.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const r=t.getWordAtPosition(i);if(!r)return;const{word:s,startColumn:o}=r,a=i.column-o;let l=a,c=a,u=0;for(;l>=0;l--){const d=s.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(jS(d)&&oy(u))break;u=d}for(l+=1;c<s.length;c++){const d=s.charCodeAt(c);if(oy(d)&&jS(u))break;if(d===95||d===45)break;u=d}l<c&&e.push({range:new ie(i.lineNumber,o+l,i.lineNumber,o+c)})}_addWordRanges(e,t,i){const r=t.getWordAtPosition(i);r&&e.push({range:new ie(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 ie(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var oMr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},aMr=function(n,e){return function(t,i){e(t,i,n)}},c1e;class RIe{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 RIe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var dL;let SB=(dL=class{static get(e){return e.getContribution(c1e.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await dpt(this._languageFeaturesService.selectionRangeProvider,i,t.map(s=>s.getPosition()),this._editor.getOption(114),xr.None).then(s=>{var o;if(!(!Gd(s)||s.length!==t.length)&&!(!this._editor.hasModel()||!fa(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<s.length;a++)s[a]=s[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),s[a].unshift(t[a]);this._state=s.map(a=>new RIe(0,a)),(o=this._selectionListener)==null||o.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(e));const r=this._state.map(s=>Yn.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}},c1e=dL,dL.ID="editor.contrib.smartSelectController",dL);SB=c1e=oMr([aMr(1,Fn)],SB);class upt extends In{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=SB.get(t);i&&await i.run(this._forward)}}class lMr extends upt{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:A("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"1_basic",title:A({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}os.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class cMr extends upt{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:A("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:zn.MenubarSelectionMenu,group:"1_basic",title:A({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}cs(SB.ID,SB,4);zt(lMr);zt(cMr);async function dpt(n,e,t,i,r){const s=n.all(e).concat(new sMr(i.selectSubwords));s.length===1&&s.unshift(new tQ);const o=[],a=[];for(const l of s)o.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(Gd(c)&&c.length===t.length)for(let u=0;u<t.length;u++){a[u]||(a[u]=[]);for(const d of c[u])ie.isIRange(d.range)&&ie.containsPosition(d.range,t[u])&&a[u].push(ie.lift(d.range))}},ll));return await Promise.all(o),a.map(l=>{if(l.length===0)return[];l.sort((f,p)=>We.isBefore(f.getStartPosition(),p.getStartPosition())?1:We.isBefore(p.getStartPosition(),f.getStartPosition())||We.isBefore(f.getEndPosition(),p.getEndPosition())?-1:We.isBefore(p.getEndPosition(),f.getEndPosition())?1:0);const c=[];let u;for(const f of l)(!u||ie.containsRange(f,u)&&!ie.equalsRange(f,u))&&(c.push(f),u=f);if(!i.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let f=1;f<c.length;f++){const p=c[f-1],g=c[f];if(g.startLineNumber!==p.startLineNumber||g.endLineNumber!==p.endLineNumber){const m=new ie(p.startLineNumber,e.getLineFirstNonWhitespaceColumn(p.startLineNumber),p.endLineNumber,e.getLineLastNonWhitespaceColumn(p.endLineNumber));m.containsRange(p)&&!m.equalsRange(p)&&g.containsRange(m)&&!g.equalsRange(m)&&d.push(m);const _=new ie(p.startLineNumber,1,p.endLineNumber,e.getLineMaxColumn(p.endLineNumber));_.containsRange(p)&&!_.equalsRange(m)&&g.containsRange(_)&&!g.equalsRange(_)&&d.push(_)}d.push(g)}return d})}os.registerCommand("_executeSelectionRangeProvider",async function(n,...e){const[t,i]=e;ys(vi.isUri(t));const r=n.get(Fn).selectionRangeProvider,s=await n.get(Cf).createModelReference(t);try{return dpt(r,s.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},xr.None)}finally{s.dispose()}});const uMr=Object.freeze({View:$i("view","View"),Help:$i("help","Help"),Test:$i("test","Test"),File:$i("file","File"),Preferences:$i("preferences","Preferences"),Developer:$i({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer")});class N6{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&&fa(this.startLineNumbers,e.startLineNumbers)&&fa(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new N6([],[],0)}}const GHe=Xw("stickyScrollViewLayer",{createHTML:n=>n}),ode="data-sticky-line-index",YHe="data-sticky-is-line",dMr="data-sticky-is-line-number",QHe="data-sticky-is-folding-icon";class hMr extends Ye{constructor(e){super(),this._editor=e,this._foldingIconStore=new Et,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(67),this._renderedStickyLines=[],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 uv),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(116)&&t(),i.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),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}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const r=this._isWidgetHeightZero(e),s=r?void 0:e,o=r?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(s,t,o),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,r=e.startLineNumbers.findIndex(s=>!i.startLineNumbers.includes(s));return r===-1?0:r}_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`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;t<this._renderedStickyLines.length;t++){const i=this._renderedStickyLines[t];i.lineNumberDomNode.remove(),i.lineDomNode.remove()}this._renderedStickyLines=this._renderedStickyLines.slice(0,e),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._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i){if(this._clearStickyLinesFromLine(i),!e)return;for(const a of this._renderedStickyLines)this._updateTopAndZIndexOfStickyLine(a);const r=this._editor.getLayoutInfo(),s=this._lineNumbers.slice(i);for(const[a,l]of s.entries()){const c=this._renderChildNode(a+i,l,t,r);c&&(this._linesDomNode.appendChild(c.lineDomNode),this._lineNumbersDomNode.appendChild(c.lineNumberDomNode),this._renderedStickyLines.push(c))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;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._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(a=>a.scrollWidth))+r.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(_t(this._lineNumbersDomNode,Xt.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(_t(this._lineNumbersDomNode,Xt.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,r){const s=this._editor._getViewModel();if(!s)return;const o=s.coordinatesConverter.convertModelPositionToViewPosition(new We(t,1)).lineNumber,a=s.getViewLineRenderingData(o),l=this._editor.getOption(68);let c;try{c=xh.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{c=[]}const u=new jk(!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 z4(2e3),f=f$(u,d);let p;GHe?p=GHe.createHTML(d.build()):p=d.build();const g=document.createElement("span");g.setAttribute(ode,String(e)),g.setAttribute(YHe,""),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=p;const m=document.createElement("span");m.setAttribute(ode,String(e)),m.setAttribute(dMr,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const _=r.contentLeft;m.style.width=`${_}px`;const v=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?v.innerText=t.toString():l.renderType===2&&(v.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),v.className="sticky-line-number-inner",v.style.lineHeight=`${this._lineHeight}px`,v.style.width=`${r.lineNumbersWidth}px`,v.style.paddingLeft=`${r.lineNumbersLeft}px`,m.appendChild(v);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(v),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 fMr(e,t,g,m,b,f.characterMapping,g.scrollWidth);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var u;const t=e.index,i=e.lineDomNode,r=e.lineNumberDomNode,s=t===this._lineNumbers.length-1,o="0",a="1";i.style.zIndex=s?o:a,r.style.zIndex=s?o:a;const l=`${t*this._lineHeight+this._lastLineRelativePosition+((u=e.foldingIcon)!=null&&u.isCollapsed?1:0)}px`,c=`${t*this._lineHeight}px`;return i.style.top=s?l:c,r.style.top=s?l:c,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(111);if(!e||i==="never")return;const r=e.regions,s=r.findRange(t),o=r.getStartLineNumber(s);if(!(t===o))return;const l=r.isCollapsed(s),c=new pMr(l,o,r.getEndLineNumber(s),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(QHe,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=a2e(t.characterMapping,e,0);return new We(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,ode);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,YHe)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,QHe)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class fMr{constructor(e,t,i,r,s,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=r,this.foldingIcon=s,this.characterMapping=o,this.scrollWidth=a}}class pMr{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=Ni.asClassName(e?zY:WY)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class D6{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class vQ{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class hpt{constructor(e,t,i,r){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=r}}var Sne=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},EB=function(n,e){return function(t,i){e(t,i,n)}},R6;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(R6||(R6={}));var YS;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(YS||(YS={}));let u1e=class extends Ye{constructor(e,t,i,r){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Rm(300)),this._updateOperation=this._register(new Et),this._editor.getOption(116).defaultModel){case R6.OUTLINE_MODEL:this._modelProviders.push(new d1e(this._editor,r));case R6.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new f1e(this._editor,t,r));case R6.INDENTATION_MODEL:this._modelProviders.push(new h1e(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:r}=t.computeStickyModel(e);this._modelPromise=r;const s=await i;if(this._modelPromise!==r)return null;switch(s){case YS.CANCELED:return this._updateOperation.clear(),null;case YS.VALID:return t.stickyModel}}return null}).catch(t=>(tr(t),null))}};u1e=Sne([EB(2,mi),EB(3,Fn)],u1e);class fpt extends Ye{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,YS.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Ic(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?YS.CANCELED:(this._stickyModel=this.createStickyModel(e,i),YS.VALID):this._invalid()).then(void 0,i=>(tr(i),YS.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let d1e=class extends fpt{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return NC.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var o;const{stickyOutlineElement:i,providerID:r}=this._stickyModelFromOutlineModel(t,(o=this._stickyModel)==null?void 0:o.outlineProviderId),s=this._editor.getModel();return new hpt(s.uri,s.getVersionId(),i,r)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(ss.first(e.children.values())instanceof Pft){const a=ss.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,u;for(const[d,f]of e.children.entries()){const p=this._findSumOfRangesOfGroup(f);p>c&&(u=f,c=p,l=f.id)}t=l,i=u.children}}else i=e.children;const r=[],s=Array.from(i.values()).sort((a,l)=>{const c=new D6(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new D6(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of s)r.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new vQ(void 0,r,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const o of s.children.values())i.push(this._stickyModelFromOutlineElement(o,s.symbol.selectionRange.startLineNumber));i.sort((s,o)=>this._comparator(s.range,o.range));const r=new D6(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new vQ(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 eye?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};d1e=Sne([EB(1,Fn)],d1e);class ppt extends fpt{constructor(e){super(e),this._foldingLimitReporter=new Nft(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),r=this._editor.getModel();return new hpt(r.uri,r.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],r=new vQ(void 0,[],void 0);for(let s=0;s<t;s++){const o=e.getParentIndex(s);let a;o!==-1?a=i[o]:a=r;const l=new vQ(new D6(e.getStartLineNumber(s),e.getEndLineNumber(s)+1),[],a);a.children.push(l),i.push(l)}return r}}let h1e=class extends ppt{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new vIe(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};h1e=Sne([EB(1,wa)],h1e);let f1e=class extends ppt{constructor(e,t,i){super(e),this._languageFeaturesService=i;const r=uk.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());r.length>0&&(this.provider=this._register(new bIe(e.getModel(),r,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};f1e=Sne([EB(2,Fn)],f1e);var gMr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},XHe=function(n,e){return function(t,i){e(t,i,n)}};class mMr{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let p1e=class extends Ye{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new Ue),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Et),this._updateSoon=this._register(new ao(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),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._sessionStore.add(gi(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new u1e(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new ba,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,r,s){if(t.children.length===0)return;let o=s;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(X8(a,e.startLineNumber,(u,d)=>u-d)),c=this.updateIndex(X8(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 f=d.range.startLineNumber,p=d.range.endLineNumber;e.startLineNumber<=p+1&&f-1<=e.endLineNumber&&f!==o&&(o=f,i.push(new mMr(f,p-1,r+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,i,r+1,f))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,i,r,s)}}getCandidateStickyLinesIntersecting(e){var r,s;if(!((r=this._model)!=null&&r.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=(s=this._editor._getViewModel())==null?void 0:s.getHiddenAreas();if(i)for(const o of i)t=t.filter(a=>!(a.startLineNumber>=o.startLineNumber&&a.endLineNumber<=o.endLineNumber+1));return t}};p1e=gMr([XHe(1,Fn),XHe(2,wa)],p1e);var _Mr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},GD=function(n,e){return function(t,i){e(t,i,n)}},g1e,hL;let $w=(hL=class extends Ye{constructor(e,t,i,r,s,o,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=r,this._contextKeyService=a,this._sessionStore=new Et,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._stickyScrollWidget=new hMr(this._editor),this._stickyLineCandidateProvider=new p1e(this._editor,i,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=N6.Empty,this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{this._readConfigurationChange(u)})),this._register(_t(l,Xt.CONTEXT_MENU,async u=>{this._onContextMenu(Ti(l),u)})),this._stickyScrollFocusedContextKey=me.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=me.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register($b(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(_t(l,Xt.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(g1e.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||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 Et,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(ie.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Et),t=this._register(new fne(this._editor,{extractLineNumberFromMouseEvent:s=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return o?o.lineNumber:0}})),i=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const o=s.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new ie(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},r=this._stickyScrollWidget.getDomNode();this._register(Da(r,Xt.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(c===null)return;const u=new We(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(c===null)return;l=new We(c,1)}this._revealPosition(l)})),this._register(Da(r,Xt.MOUSE_MOVE,s=>{if(s.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(_t(r,Xt.MOUSE_LEAVE,s=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([s,o])=>{const a=i(s);if(!a||!s.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 ba;e.add(gi(()=>u.dispose(!0)));let d;x$(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new We(l.startLineNumber,l.startColumn+1),!1,u.token).then(f=>{if(!u.token.isCancellationRequested)if(f.length!==0){this._candidateDefinitionsLength=f.length;const p=c;d!==p?(e.clear(),d=p,d.style.textDecoration="underline",e.add(gi(()=>{d.style.textDecoration="none"}))):d||(d=p,d.style.textDecoration="underline",e.add(gi(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(pft,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new B_(e,t);this._contextMenuService.showContextMenu({menuId:zn.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;gIe(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(67)*t.index+1;this._editor.setScrollTop(r),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);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=void 0,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=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_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(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),r=this._stickyLineCandidateProvider.getVersionId();if(r===void 0||r===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=uk.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=N6.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),i=this._editor.getScrollTop();let r=0;const s=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new D6(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,f=u.endLineNumber,p=u.nestingDepth;if(f-d>0){const g=(p-1)*e,m=p*e,_=this._editor.getBottomForLineNumber(d)-i,v=this._editor.getTopForLineNumber(f)-i,b=this._editor.getBottomForLineNumber(f)-i;if(g>v&&g<=b){s.push(d),o.push(f+1),r=b-m;break}else m>_&&m<=b&&(s.push(d),o.push(f+1));if(s.length===t)break}}}return this._endLineNumbers=o,new N6(s,o,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},g1e=hL,hL.ID="store.contrib.stickyScrollController",hL);$w=g1e=_Mr([GD(1,up),GD(2,Fn),GD(3,mi),GD(4,wa),GD(5,kg),GD(6,Oi)],$w);class vMr extends Mh{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...$i("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:A({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:$i("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:uMr.View,toggled:{condition:It.equals("config.editor.stickyScroll.enabled",!0),title:A("stickyScroll","Sticky Scroll"),mnemonicTitle:A({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:zn.CommandPalette},{id:zn.MenubarAppearanceMenu,group:"4_editor",order:3},{id:zn.StickyScrollContext}]})}async run(e){const t=e.get(Dr),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const Ene=100;class bMr extends Zb{constructor(){super({id:"editor.action.focusStickyScroll",title:{...$i("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:A({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:It.and(It.has("config.editor.stickyScroll.enabled"),me.stickyScrollVisible),menu:[{id:zn.CommandPalette}]})}runEditorCommand(e,t){var i;(i=$w.get(t))==null||i.focus()}}class yMr extends Zb{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:$i("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:me.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Ene,primary:18}})}runEditorCommand(e,t){var i;(i=$w.get(t))==null||i.focusNext()}}class CMr extends Zb{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:$i("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:me.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Ene,primary:16}})}runEditorCommand(e,t){var i;(i=$w.get(t))==null||i.focusPrevious()}}class wMr extends Zb{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:$i("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:me.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Ene,primary:3}})}runEditorCommand(e,t){var i;(i=$w.get(t))==null||i.goToFocused()}}class xMr extends Zb{constructor(){super({id:"editor.action.selectEditor",title:$i("selectEditor.title","Select Editor"),precondition:me.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Ene,primary:9}})}runEditorCommand(e,t){var i;(i=$w.get(t))==null||i.selectEditor()}}cs($w.ID,$w,1);Ao(vMr);Ao(bMr);Ao(CMr);Ao(yMr);Ao(wMr);Ao(xMr);var gpt=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},pF=function(n,e){return function(t,i){e(t,i,n)}};class SMr{constructor(e,t,i,r,s,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=r,this.command=s,this.completion=o}}let m1e=class extends uor{constructor(e,t,i,r,s,o){super(s.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=r,this._suggestMemoryService=o}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(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),r=ss.slice(t,i),s=ss.slice(t,0,i);let o=5;for(const a of ss.concat(r,s)){if(a.score===Db.Default)continue;const l=new ie(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),c=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new SMr(l,c,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a)),o-->=0&&a.resolve(xr.None)}return e}};m1e=gpt([pF(5,yne)],m1e);let _1e=class extends Ye{constructor(e,t,i,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,r){var p;if(i.selectedSuggestionInfo)return;let s;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){s=g;break}if(!s)return;const o=s.getOption(90);if(GR.isAllOff(o))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(GR.valueFor(o,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 f=e.getValueInRange(new ie(t.lineNumber,1,t.lineNumber,t.column));if(!u&&((p=this._lastResult)!=null&&p.canBeReused(e,t.lineNumber,c))){const g=new MHe(f,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),d=this._lastResult}else{const g=await yIe(this._languageFeatureService.completionProvider,e,t,new mB(void 0,iQ.createSuggestFilter(s).itemKind,u==null?void 0:u.providers),u&&{triggerKind:1,triggerCharacter:u.ch},r);let m;g.needsClipboard&&(m=await this._clipboardService.readText());const _=new IS(g.items,t.column,new MHe(f,0),nQ.None,s.getOption(119),s.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},m);d=new m1e(e,t.lineNumber,c,_,g,this._suggestMemoryService)}return this._lastResult=d,d}handleItemDidShow(e,t){t.completion.resolve(xr.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var s;const i=e.getValueInRange(ie.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(s=o.triggerCharacters)!=null&&s.includes(i)&&r.add(o);if(r.size!==0)return{providers:r,ch:i}}};_1e=gpt([pF(0,Fn),pF(1,tx),pF(2,yne),pF(3,Cs)],_1e);i3(_1e);class EMr extends In{constructor(){super({id:"editor.action.forceRetokenize",label:A("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 Qc;i.tokenization.forceTokenization(i.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}zt(EMr);const QX=class QX extends Mh{constructor(){super({id:QX.ID,title:$i({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:$i("tabMovesFocusDescriptions","Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!EM.getTabFocusMode();EM.setTabFocusMode(t),Ph(t?A("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):A("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}};QX.ID="editor.action.toggleTabFocusMode";let v1e=QX;Ao(v1e);var kMr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},ZHe=function(n,e){return function(t,i){e(t,i,n)}};let b1e=class extends Ye{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,s){super(),this._link=t,this._hoverService=r,this._enabled=!0,this.el=Ot(e,Jt("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??jh("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new Yr(this.el,"click")),a=this._register(new Yr(this.el,"keypress")),l=rn.chain(a.event,d=>d.map(f=>new Io(f)).filter(f=>f.keyCode===3)),c=this._register(new Yr(this.el,Oo.Tap)).event;this._register(dd.addTarget(this.el));const u=rn.any(o.event,l,c);this._register(u(d=>{this.enabled&&(Jr.stop(d,!0),i!=null&&i.opener?i.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};b1e=kMr([ZHe(3,C1),ZHe(4,xf)],b1e);var mpt=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},_pt=function(n,e){return function(t,i){e(t,i,n)}};const TMr=26;let y1e=class extends Ye{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(C1e))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,TMr)}};y1e=mpt([_pt(1,mi)],y1e);let C1e=class extends Ye{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Pw,{}),this.element=Jt("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=Jt("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){mu(this.element)}show(e){mu(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Ot(this.element,Jt("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(Jt(`div${Ni.asCSSSelector(e.icon)}`));const r=Ot(this.element,Jt("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ot(this.element,Jt("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(b1e,this.messageActionsContainer,{...o,tabIndex:-1},{}));const s=Ot(this.element,Jt("div.action-container"));this.actionBar=this._register(new hg(s)),this.actionBar.push(this._register(new Zf("banner.close","Close Banner",Ni.asClassName(Eut),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};C1e=mpt([_pt(0,mi)],C1e);var PIe=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},eO=function(n,e){return function(t,i){e(t,i,n)}};const IMr=Zo("extensions-warning-message",Yt.warning,A("warningIcon","Icon shown with a warning message in the extensions editor."));var dO;let kB=(dO=class extends Ye{constructor(e,t,i,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const o=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let a;if(s.nonBasicAsciiCharacterCount>=o)a={message:A("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new IB};else if(s.ambiguousCharacterCount>=o)a={message:A("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new cA};else if(s.invisibleCharacterCount>=o)a={message:A("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new TB};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:IMr,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(y1e,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(i.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(s=>{s.hasChanged(126)&&(this._options=e.getOption(126),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=LMr(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"?lsr:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new w1e(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new AMr(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},dO.ID="editor.contrib.unicodeHighlighter",dO);kB=PIe([eO(1,Sf),eO(2,Hlt),eO(3,mi)],kB);function LMr(n,e){return{nonBasicASCII:e.nonBasicASCII===Bp?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Bp?!n:e.includeComments,includeStrings:e.includeStrings===Bp?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let w1e=class extends Ye{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 ao(()=>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:bQ.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!w2e(t,e))return null;const i=t.getValueInRange(e.range);return{reason:bpt(i,this._options),inComment:x2e(t,e),inString:S2e(t,e)}}};w1e=PIe([eO(3,Sf)],w1e);class AMr extends Ye{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 ao(()=>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 s=Oke.computeUnicodeHighlights(this._model,this._options,r);for(const o of s.ranges)i.ranges.push(o);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||s.hasMore}if(!i.hasMore)for(const r of i.ranges)t.push({range:r,options:bQ.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 w2e(t,e)?{reason:bpt(i,this._options),inComment:x2e(t,e),inString:S2e(t,e)}:null}}const vpt=A("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let x1e=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(kB.ID);if(!r)return[];const s=[],o=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),f=ade(d);let p;switch(c.reason.kind){case 0:{U9(c.reason.confusableWith)?p=A("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",f,ade(c.reason.confusableWith.codePointAt(0))):p=A("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",f,ade(c.reason.confusableWith.codePointAt(0)));break}case 1:p=A("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",f);break;case 2:p=A("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",f);break}if(o.has(p))continue;o.add(p);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},m=A("unicodeHighlight.adjustSettings","Adjust settings"),_=`command:${yQ.ID}?${encodeURIComponent(JSON.stringify(g))}`,v=new rd("",!0).appendMarkdown(p).appendText(" ").appendLink(_,m,vpt);s.push(new O_(this,l.range,[v],!1,a++))}return s}renderHoverParts(e,t){return sLr(e,t,this._editor,this._languageService,this._openerService)}};x1e=PIe([eO(1,pa),eO(2,xf)],x1e);function S1e(n){return`U+${n.toString(16).padStart(4,"0")}`}function ade(n){let e=`\`${S1e(n)}\``;return lI.isInvisibleCharacter(n)||(e+=` "${`${NMr(n)}`}"`),e}function NMr(n){return n===96?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function bpt(n,e){return Oke.computeUnicodeHighlightReason(n,e)}const XX=class XX{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=ur.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}};XX.instance=new XX;let bQ=XX;class DMr extends In{constructor(){super({id:cA.ID,label:A("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=A("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){const r=e==null?void 0:e.get(Dr);r&&this.runAction(r)}async runAction(e){await e.updateValue(ef.includeComments,!1,2)}}class RMr extends In{constructor(){super({id:cA.ID,label:A("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=A("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){const r=e==null?void 0:e.get(Dr);r&&this.runAction(r)}async runAction(e){await e.updateValue(ef.includeStrings,!1,2)}}const ZX=class ZX extends In{constructor(){super({id:ZX.ID,label:A("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=A("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){const r=e==null?void 0:e.get(Dr);r&&this.runAction(r)}async runAction(e){await e.updateValue(ef.ambiguousCharacters,!1,2)}};ZX.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let cA=ZX;const JX=class JX extends In{constructor(){super({id:JX.ID,label:A("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=A("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){const r=e==null?void 0:e.get(Dr);r&&this.runAction(r)}async runAction(e){await e.updateValue(ef.invisibleCharacters,!1,2)}};JX.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let TB=JX;const eZ=class eZ extends In{constructor(){super({id:eZ.ID,label:A("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=A("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){const r=e==null?void 0:e.get(Dr);r&&this.runAction(r)}async runAction(e){await e.updateValue(ef.nonBasicASCII,!1,2)}};eZ.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let IB=eZ;const tZ=class tZ extends In{constructor(){super({id:tZ.ID,label:A("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:r,reason:s,inString:o,inComment:a}=i,l=String.fromCodePoint(r),c=e.get(Ym),u=e.get(Dr);function d(g){return lI.isInvisibleCharacter(g)?A("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",S1e(g)):A("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${S1e(g)} "${l}"`)}const f=[];if(s.kind===0)for(const g of s.notAmbiguousInLocales)f.push({label:A("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{OMr(u,[g])}});if(f.push({label:d(r),run:()=>PMr(u,[r])}),a){const g=new DMr;f.push({label:g.label,run:async()=>g.runAction(u)})}else if(o){const g=new RMr;f.push({label:g.label,run:async()=>g.runAction(u)})}if(s.kind===0){const g=new cA;f.push({label:g.label,run:async()=>g.runAction(u)})}else if(s.kind===1){const g=new TB;f.push({label:g.label,run:async()=>g.runAction(u)})}else if(s.kind===2){const g=new IB;f.push({label:g.label,run:async()=>g.runAction(u)})}else MMr(s);const p=await c.pick(f,{title:vpt});p&&await p.run()}};tZ.ID="editor.action.unicodeHighlight.showExcludeOptions";let yQ=tZ;async function PMr(n,e){const t=n.getValue(ef.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const r of e)i[String.fromCodePoint(r)]=!0;await n.updateValue(ef.allowedCharacters,i,2)}async function OMr(n,e){var r;const t=(r=n.inspect(ef.allowedLocales).user)==null?void 0:r.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const s of e)i[s]=!0;await n.updateValue(ef.allowedLocales,i,2)}function MMr(n){throw new Error(`Unexpected value: ${n}`)}zt(cA);zt(TB);zt(IB);zt(yQ);cs(kB.ID,kB,1);ZA.register(x1e);var jMr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},JHe=function(n,e){return function(t,i){e(t,i,n)}};const ypt="ignoreUnusualLineTerminators";function FMr(n,e,t){n.setModelProperty(e.uri,ypt,t)}function BMr(n,e){return n.getModelProperty(e.uri,ypt)}var hO;let CQ=(hO=class extends Ye{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(r=>{r.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||BMr(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:A("unusualLineTerminators.title","Unusual Line Terminators"),message:A("unusualLineTerminators.message","Detected unusual line terminators"),detail:A("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`.",Mm(e.uri)),primaryButton:A({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:A("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){FMr(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},hO.ID="editor.contrib.unusualLineTerminatorsDetector",hO);CQ=jMr([JHe(1,Q9),JHe(2,Cs)],CQ);cs(CQ.ID,CQ,1);var $Mr=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},HMr=function(n,e){return function(t,i){e(t,i,n)}};class eVe{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const r=[],s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return s?e.isDisposed()?void 0:e.findMatches(s.word,!0,!1,!0,LK,!1).map(a=>({range:a.range,kind:rM.Text})):Promise.resolve(r)}provideMultiDocumentHighlights(e,t,i,r){const s=new Yc,o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!o)return Promise.resolve(s);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(o.word,!0,!1,!0,LK,!1).map(u=>({range:u.range,kind:rM.Text}));c&&s.set(a.uri,c)}return s}}let E1e=class extends Ye{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new eVe)),this._register(e.multiDocumentHighlightProvider.register("*",new eVe))}};E1e=$Mr([HMr(0,Fn)],E1e);var Cpt=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},MU=function(n,e){return function(t,i){e(t,i,n)}},pl,k1e;const OIe=new yn("hasWordHighlights",!1);function wpt(n,e,t,i){const r=n.ordered(e);return Cke(r.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,i)).then(void 0,ll)),s=>s!=null).then(s=>{if(s){const o=new Yc;return o.set(e.uri,s),o}return new Yc})}function VMr(n,e,t,i,r,s){const o=n.ordered(e);return Cke(o.map(a=>()=>{const l=s.filter(c=>Tat(c)).filter(c=>zke(a.selector,c.uri,c.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,r)).then(void 0,ll)}),a=>a!=null)}class xpt{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=Ic(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new ie(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const r=t.startLineNumber,s=t.startColumn,o=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<=s&&d.endColumn>=o&&(l=!0)}return l}cancel(){this.result.cancel()}}class WMr extends xpt{constructor(e,t,i,r){super(e,t,i),this._providers=r}_compute(e,t,i,r){return wpt(this._providers,e,t.getPosition(),r).then(s=>s||new Yc)}}class zMr extends xpt{constructor(e,t,i,r,s){super(e,t,i),this._providers=r,this._otherModels=s}_compute(e,t,i,r){return VMr(this._providers,e,t.getPosition(),i,r,this._otherModels).then(s=>s||new Yc)}}function UMr(n,e,t,i,r){return new WMr(e,t,r,n)}function qMr(n,e,t,i,r,s){return new zMr(e,t,r,n,s)}wf("_executeDocumentHighlights",async(n,e,t)=>{const i=n.get(Fn),r=await wpt(i.documentHighlightProvider,e,t,xr.None);return r==null?void 0:r.get(e.uri)});var NE;let T1e=(NE=class{constructor(e,t,i,r,s){this.toUnhook=new Et,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Yc,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new Rm(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=s,this._hasWordHighlights=OIe.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(o)})})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(o=>{Gee(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():pl.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{var l,c;const a=this.editor.getOption(81);if(this.occurrencesHighlight!==a)switch(this.occurrencesHighlight=a,a){case"off":this._stopAll();break;case"singleFile":this._stopAll((c=(l=pl.query)==null?void 0:l.modelInfo)==null?void 0:c.model);break;case"multiFile":pl.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",a);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,pl.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(ie.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,r=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const s=this._getWord();if(s){const o=this.editor.getModel().getLineContent(r.startLineNumber);Ph(`${o}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.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 s=this._getWord();if(s){const o=this.editor.getModel().getLineContent(r.startLineNumber);Ph(`${o}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=pl.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),pl.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const r of t){if(!r.hasModel()||k7(r.getModel().uri,e==null?void 0:e.uri))continue;const s=pl.storedDecorationIDs.get(r.getModel().uri);if(!s)continue;r.removeDecorations(s),i.push(r.getModel().uri);const o=hk.get(r);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const r of i)pl.storedDecorationIDs.delete(r)}_stopSingular(){var e,t,i,r;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==ir.vscodeNotebookCell&&((i=(t=pl.query)==null?void 0:t.modelInfo)==null?void 0:i.model.uri.scheme)!==ir.vscodeNotebookCell?(pl.query=null,this._run()):(r=pl.query)!=null&&r.modelInfo&&(pl.query.modelInfo=null)),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)}_stopAll(e){this._removeAllDecorations(e),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){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())==null?void 0:t.uri.scheme)!==ir.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===ir.vscodeNotebookCell){const s=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const l=a.getModel();l&&l!==e&&l.uri.scheme===ir.vscodeNotebookCell&&s.push(l)}return s}const i=[],r=this.codeEditorService.listCodeEditors();for(const s of r){if(!H2e(s))continue;const o=s.getModel();o&&e===o.modified&&i.push(o.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const s of r){const o=s.getModel();o&&o!==e&&i.push(o)}return i}_run(e){var r,s;let t;if(this.editor.hasTextFocus()){const o=this.editor.getSelection();if(!o||o.startLineNumber!==o.endLineNumber){pl.query=null,this._stopAll();return}const a=o.startColumn,l=o.endColumn,c=this._getWord();if(!c||c.startColumn>a||c.endColumn<l){pl.query=null,this._stopAll();return}t=this.workerRequest&&this.workerRequest.isValid(this.model,o,this.decorations),pl.query={modelInfo:{model:this.model,selection:o},word:c}}else if(!pl.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),t)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else if(k7(this.editor.getModel().uri,(r=pl.query.modelInfo)==null?void 0:r.model.uri)){if(!e){const l=this.decorations.getRanges();for(const c of l)if(c.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model:void 0);const o=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const a=this.getOtherModelsToHighlight(this.editor.getModel());if(!pl.query||!pl.query.modelInfo||pl.query.modelInfo.model.isDisposed())return;this.workerRequest=this.computeWithModel(pl.query.modelInfo.model,pl.query.modelInfo.selection,pl.query.word,a),(s=this.workerRequest)==null||s.result.then(l=>{o===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=l||[],this._beginRenderDecorations())},tr)}}computeWithModel(e,t,i,r){return r.length?qMr(this.multiDocumentProviders,e,t,i,this.editor.getOption(132),r):UMr(this.providers,e,t,i,this.editor.getOption(132))}_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(){var t,i,r;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const s of e){const o=hk.get(s);if(!o)continue;const a=[],l=(t=s.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=pl.storedDecorationIDs.get(l),u=this.workerRequestValue.get(l);if(u)for(const f of u)f.range&&a.push({range:f.range,options:PPr(f.kind)});let d=[];s.changeDecorations(f=>{d=f.deltaDecorations(c??[],a)}),pl.storedDecorationIDs=pl.storedDecorationIDs.set(l,d),a.length>0&&((i=o.wordHighlighter)==null||i.decorations.set(a),(r=o.wordHighlighter)==null||r._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},pl=NE,NE.storedDecorationIDs=new Yc,NE.query=null,NE);T1e=pl=Cpt([MU(4,Cs)],T1e);var fL;let hk=(fL=class extends Ye{static get(e){return e.getContribution(k1e.ID)}constructor(e,t,i,r){super(),this._wordHighlighter=null;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new T1e(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,r))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),s()})),s()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},k1e=fL,fL.ID="editor.contrib.wordHighlighter",fL);hk=k1e=Cpt([MU(1,Oi),MU(2,Fn),MU(3,Cs)],hk);class Spt extends In{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=hk.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class KMr extends Spt{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:A("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:OIe,kbOpts:{kbExpr:me.editorTextFocus,primary:65,weight:100}})}}class GMr extends Spt{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:A("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:OIe,kbOpts:{kbExpr:me.editorTextFocus,primary:1089,weight:100}})}}class YMr extends In{constructor(){super({id:"editor.action.wordHighlight.trigger",label:A("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:me.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const r=hk.get(t);r&&r.restoreViewState(!0)}}cs(hk.ID,hk,0);zt(KMr);zt(GMr);zt(YMr);i3(E1e);class kne extends pc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const r=Om(t.getOption(132),t.getOption(131)),s=t.getModel(),o=t.getSelections(),a=o.length>1,l=o.map(c=>{const u=new We(c.positionLineNumber,c.positionColumn),d=this._move(r,s,u,this._wordNavigationType,a);return this._moveTo(c,d,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>vs.fromModelSelection(c))),l.length===1){const c=new We(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new Yn(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Yn(t.lineNumber,t.column,t.lineNumber,t.column)}}class Bk extends kne{_move(e,t,i,r,s){return $s.moveWordLeft(e,t,i,r,s)}}class $k extends kne{_move(e,t,i,r,s){return $s.moveWordRight(e,t,i,r)}}class QMr extends Bk{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class XMr extends Bk{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class ZMr extends Bk{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:It.and(me.textInputFocus,(e=It.and(e$,$te))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class JMr extends Bk{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class e4r extends Bk{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class t4r extends Bk{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:It.and(me.textInputFocus,(e=It.and(e$,$te))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class n4r extends Bk{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,r,s){return super._move(Om(Xb.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,r,s)}}class i4r extends Bk{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,r,s){return super._move(Om(Xb.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,r,s)}}class r4r extends $k{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class s4r extends $k{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:It.and(me.textInputFocus,(e=It.and(e$,$te))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class o4r extends $k{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class a4r extends $k{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class l4r extends $k{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:It.and(me.textInputFocus,(e=It.and(e$,$te))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class c4r extends $k{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class u4r extends $k{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,r,s){return super._move(Om(Xb.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,r,s)}}class d4r extends $k{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,r,s){return super._move(Om(Xb.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,r,s)}}class Tne extends pc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const r=e.get(wa);if(!t.hasModel())return;const s=Om(t.getOption(132),t.getOption(131)),o=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=r.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),f=a.map(p=>{const g=this._delete({wordSeparators:s,model:o,selection:p,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Bu(g,"")});t.pushUndoStop(),t.executeCommands(this.id,f),t.pushUndoStop()}}class MIe extends Tne{_delete(e,t){const i=$s.deleteWordLeft(e,t);return i||new ie(1,1,1,1)}}class jIe extends Tne{_delete(e,t){const i=$s.deleteWordRight(e,t);if(i)return i;const r=e.model.getLineCount(),s=e.model.getLineMaxColumn(r);return new ie(r,s,r,s)}}class h4r extends MIe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:me.writable})}}class f4r extends MIe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:me.writable})}}class p4r extends MIe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:me.writable,kbOpts:{kbExpr:me.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class g4r extends jIe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:me.writable})}}class m4r extends jIe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:me.writable})}}class _4r extends jIe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:me.writable,kbOpts:{kbExpr:me.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class v4r extends In{constructor(){super({id:"deleteInsideWord",precondition:me.writable,label:A("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const r=Om(t.getOption(132),t.getOption(131)),s=t.getModel(),a=t.getSelections().map(l=>{const c=$s.deleteInsideWord(r,s,l);return new Bu(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}gn(new QMr);gn(new XMr);gn(new ZMr);gn(new JMr);gn(new e4r);gn(new t4r);gn(new r4r);gn(new s4r);gn(new o4r);gn(new a4r);gn(new l4r);gn(new c4r);gn(new n4r);gn(new i4r);gn(new u4r);gn(new d4r);gn(new h4r);gn(new f4r);gn(new p4r);gn(new g4r);gn(new m4r);gn(new _4r);zt(v4r);class b4r extends Tne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:me.writable,kbOpts:{kbExpr:me.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=Xte.deleteWordPartLeft(e);return i||new ie(1,1,1,1)}}class y4r extends Tne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:me.writable,kbOpts:{kbExpr:me.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=Xte.deleteWordPartRight(e);if(i)return i;const r=e.model.getLineCount(),s=e.model.getLineMaxColumn(r);return new ie(r,s,r,s)}}class Ept extends kne{_move(e,t,i,r,s){return Xte.moveWordPartLeft(e,t,i,s)}}class C4r extends Ept{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:me.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}os.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class w4r extends Ept{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:me.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}os.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class kpt extends kne{_move(e,t,i,r,s){return Xte.moveWordPartRight(e,t,i)}}class x4r extends kpt{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:me.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class S4r extends kpt{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:me.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}gn(new b4r);gn(new y4r);gn(new C4r);gn(new w4r);gn(new x4r);gn(new S4r);const UIe=class UIe extends Ye{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=ep.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new rd(A("editor.simple.readonly","Cannot edit in read-only input")):t=new rd(A("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};UIe.ID="editor.contrib.readOnlyMessageController";let wQ=UIe;cs(wQ.ID,wQ,2);var E4r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},tVe=function(n,e){return function(t,i){e(t,i,n)}};let I1e=class extends Ye{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Ar(this,void 0);const r=Fu("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Fu("_textModel.onDidChangeContent",rn.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(uf(async(o,a)=>{r.read(o),s.read(o);const l=a.add(new SSr),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const r=i.asListOfDocumentSymbols().filter(s=>e.contains(s.range.startLineNumber)&&!e.contains(s.range.endLineNumber));return r.sort(Ust(kh(s=>s.range.endLineNumber-s.range.startLineNumber,z_))),r.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber}))}};I1e=E4r([tVe(1,Fn),tVe(2,k$)],I1e);wY.setBreadcrumbsSourceFactory((n,e)=>e.createInstance(I1e,n));const qIe=class qIe extends Ye{constructor(e){super(),this.editor=e,this.widget=null,Fb&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new L1e(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};qIe.ID="editor.contrib.iPadShowKeyboard";let xQ=qIe;const nZ=class nZ extends Ye{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(_t(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(_t(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return nZ.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};nZ.ID="editor.contrib.ShowKeyboardWidget";let L1e=nZ;cs(xQ.ID,xQ,3);var k4r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},nVe=function(n,e){return function(t,i){e(t,i,n)}},A1e,pL;let LB=(pL=class extends Ye{static get(e){return e.getContribution(A1e.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(Ka.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 N1e(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},A1e=pL,pL.ID="editor.contrib.inspectTokens",pL);LB=A1e=k4r([nVe(1,Lg),nVe(2,pa)],LB);class T4r extends In{constructor(){super({id:"editor.action.inspectTokens",label:F_e.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=LB.get(t);i==null||i.launch()}}function I4r(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 L4r(n,e){const t=Ka.get(e);if(t)return t;const i=n.encodeLanguageId(e);return{getInitialState:()=>mM,tokenize:(r,s,o)=>fTe(e,o),tokenizeEncoded:(r,s,o)=>Ate(i,o)}}const iZ=class iZ extends Ye{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=L4r(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 iZ._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 s=this._model.getLineContent(e.lineNumber);let o="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,c=i+1<t.tokens1.length?t.tokens1[i+1].offset:s.length;o=s.substring(l,c)}_u(this._domNode,Jt("h2.tm-token",void 0,I4r(o),Jt("span.tm-token-length",void 0,`${o.length} ${o.length===1?"char":"chars"}`))),Ot(this._domNode,Jt("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(r<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(r<<1)+1]):null;Ot(this._domNode,Jt("table.tm-metadata-table",void 0,Jt("tbody",void 0,Jt("tr",void 0,Jt("td.tm-metadata-key",void 0,"language"),Jt("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),Jt("tr",void 0,Jt("td.tm-metadata-key",void 0,"token type"),Jt("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Jt("tr",void 0,Jt("td.tm-metadata-key",void 0,"font style"),Jt("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Jt("tr",void 0,Jt("td.tm-metadata-key",void 0,"foreground"),Jt("td.tm-metadata-value",void 0,`${a?At.Format.CSS.formatHex(a.foreground):"-?-"}`)),Jt("tr",void 0,Jt("td.tm-metadata-key",void 0,"background"),Jt("td.tm-metadata-value",void 0,`${a?At.Format.CSS.formatHex(a.background):"-?-"}`))))),Ot(this._domNode,Jt("hr.tokens-inspect-separator")),i<t.tokens1.length&&Ot(this._domNode,Jt("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=Ka.getColorMap(),i=rf.getLanguageId(e),r=rf.getTokenType(e),s=rf.getFontStyle(e),o=rf.getForeground(e),a=rf.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:r,fontStyle:s,foreground:t[o],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]}}};iZ._ID="editor.contrib.inspectTokensWidget";let N1e=iZ;cs(LB.ID,LB,4);zt(T4r);var A4r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},iVe=function(n,e){return function(t,i){e(t,i,n)}},gF,gL;let D1e=(gL=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Ca.as(UA.Quickaccess)}provide(e){const t=new Et;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(gF.PREFIX.length));r&&r.prefix&&r.prefix!==gF.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==gF.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:A("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}},gF=gL,gL.PREFIX="?",gL);D1e=gF=A4r([iVe(0,Ym),iVe(1,Ws)],D1e);Ca.as(UA.Quickaccess).registerQuickAccessProvider({ctor:D1e,prefix:"",helpEntries:[{description:B_e.helpQuickAccessActionLabel}]});class Tpt{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var o;const r=new Et;e.canAcceptInBackground=!!((o=this.options)!=null&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=r.add(new Dc);return s.value=this.doProvide(e,t,i),r.add(this.onDidActiveTextEditorControlChange(()=>{s.value=void 0,s.value=this.doProvide(e,t)})),r}doProvide(e,t,i){const r=new Et,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const o={editor:s},a=Cdt(s);if(a){let l=s.saveViewState()??void 0;r.add(a.onDidChangeCursorPosition(()=>{l=s.saveViewState()??void 0})),o.restoreViewState=()=>{l&&s===this.activeTextEditorControl&&s.restoreViewState(l)},r.add(qE(t.onCancellationRequested)(()=>{var c;return(c=o.restoreViewState)==null?void 0:c.call(o)}))}r.add(gi(()=>this.clearDecorations(s))),r.add(this.provideWithTextEditor(o,e,t,i))}else r.add(this.provideWithoutTextEditor(e,t));return r}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Xy(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return H2e(e)?(t=e.getModel())==null?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 s=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Ga(hct),position:ug.Full}}}],[o,a]=i.deltaDecorations(r,s);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const rZ=class rZ extends Tpt{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=A("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,Ye.None}provideWithTextEditor(e,t,i){const r=e.editor,s=new Et;s.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 o=()=>{const l=this.parsePosition(r,t.value.trim().substr(rZ.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)};o(),s.add(t.onDidChangeValue(()=>o()));const a=Cdt(r);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),s.add(gi(()=>a.updateOptions({lineNumbers:"relative"})))),s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(s=>parseInt(s,10)).filter(s=>!isNaN(s)),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)?A("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):A("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},s=this.lineCount(e);return s>1?A("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,s):A("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 s={lineNumber:t,column:i};return r.validatePosition(s).equals(s)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};rZ.PREFIX=":";let R1e=rZ;var N4r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},D4r=function(n,e){return function(t,i){e(t,i,n)}};let AB=class extends R1e{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=rn.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};AB=N4r([D4r(0,Cs)],AB);var mL;let Ipt=(mL=class extends In{constructor(){super({id:mL.ID,label:_G.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:me.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Ym).quickAccess.show(AB.PREFIX)}},mL.ID="editor.action.gotoLine",mL);zt(Ipt);Ca.as(UA.Quickaccess).registerQuickAccessProvider({ctor:AB,prefix:AB.PREFIX,helpEntries:[{description:_G.gotoLineActionLabel,commandId:Ipt.ID}]});const Lpt=[void 0,[]];function lde(n,e,t=0,i=0){const r=e;return r.values&&r.values.length>1?R4r(n,r.values,t,i):Apt(n,e,t,i)}function R4r(n,e,t,i){let r=0;const s=[];for(const o of e){const[a,l]=Apt(n,o,t,i);if(typeof a!="number")return Lpt;r+=a,s.push(...l)}return[r,P4r(s)]}function Apt(n,e,t,i){const r=UL(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],J9(r)]:Lpt}function P4r(n){const e=n.sort((r,s)=>r.start-s.start),t=[];let i;for(const r of e)!i||!O4r(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 O4r(n,e){return!(n.end<e.start||e.end<n.start)}function rVe(n){return n.startsWith('"')&&n.endsWith('"')}const Npt=" ";function P1e(n){typeof n!="string"&&(n="");const e=n.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:r}=sVe(n),s=t.indexOf(Tb)>=0,o=rVe(n);let a;const l=n.split(Npt);if(l.length>1)for(const c of l){const u=rVe(c),{pathNormalized:d,normalized:f,normalizedLowercase:p}=sVe(c);f&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:f,normalizedLowercase:p,expectContiguousMatch:u}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:r,values:a,containsPathSeparator:s,expectContiguousMatch:o}}function sVe(n){let e;Wu?e=n.replace(/\//g,Tb):e=n.replace(/\\/g,Tb);const t=rar(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function oVe(n){return Array.isArray(n)?P1e(n.map(e=>e.original).join(Npt)):P1e(n.original)}var M4r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},aVe=function(n,e){return function(t,i){e(t,i,n)}},jU,ub;let yI=(ub=class extends Tpt{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,A("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),Ye.None}provideWithTextEditor(e,t,i,r){const s=e.editor,o=this.getModel(s);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i,r):this.doProvideWithoutEditorSymbols(e,o,t,i):Ye.None}doProvideWithoutEditorSymbols(e,t,i,r){const s=new Et;return this.provideLabelPick(i,A("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,s)||r.isCancellationRequested||s.add(this.doProvideWithEditorSymbols(e,t,i,r)))(),s}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new $4,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),i.complete(!0))}));return t.add(gi(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,r,s){var d;const o=e.editor,a=new Et;a.add(i.onDidAccept(f=>{var g;const[p]=i.selectedItems;p&&p.range&&(this.gotoLocation(e,{range:p.range.selection,keyMods:i.keyMods,preserveFocus:f.inBackground}),(g=s==null?void 0:s.handleAccept)==null||g.call(s,p),f.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:f})=>{f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,r);let c;const u=async f=>{c==null||c.dispose(!0),i.busy=!1,c=new ba(r),i.busy=!0;try{const p=P1e(i.value.substr(jU.PREFIX.length).trim()),g=await this.doGetSymbolPicks(l,p,void 0,c.token,t);if(r.isCancellationRequested)return;if(g.length>0){if(i.items=g,f&&p.original.length===0){const m=h7(g,_=>!!(_.type!=="separator"&&_.range&&ie.containsPosition(_.range.decoration,f)));m&&(i.activeItems=[m])}}else p.original.length>0?this.provideLabelPick(i,A("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,A("noSymbolResults","No editor symbols"))}finally{r.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>u(void 0))),u((d=o.getSelection())==null?void 0:d.getPosition()),a.add(i.onDidChangeActive(()=>{const[f]=i.activeItems;f&&f.range&&(o.revealRangeInCenter(f.range.selection,0),this.addDecorations(o,f.range.decoration))})),a}async doGetSymbolPicks(e,t,i,r,s){var _,v;const o=await e;if(r.isCancellationRequested)return[];const a=t.original.indexOf(jU.SCOPE_PREFIX)===0,l=a?1:0;let c,u;t.values&&t.values.length>1?(c=oVe(t.values[0]),u=oVe(t.values.slice(1))):c=t;let d;const f=(v=(_=this.options)==null?void 0:_.openSideBySideDirection)==null?void 0:v.call(_);f&&(d=[{iconClass:f==="right"?Ni.asClassName(Yt.splitHorizontal):Ni.asClassName(Yt.splitVertical),tooltip:f==="right"?A("openToSide","Open to the Side"):A("openToBottom","Open to the Bottom")}]);const p=[];for(let b=0;b<o.length;b++){const y=o[b],C=nar(y.name),S=`$(${OK.toIcon(y.kind).id}) ${C}`,k=S.length-C.length;let I=y.containerName;i!=null&&i.extraContainerLabel&&(I?I=`${i.extraContainerLabel} • ${I}`:I=i.extraContainerLabel);let L,N,P,O;if(t.original.length>l){let V=!1;if(c!==t&&([L,N]=lde(S,{...t,values:void 0},l,k),typeof L=="number"&&(V=!0)),typeof L!="number"&&([L,N]=lde(S,c,l,k),typeof L!="number"))continue;if(!V&&u){if(I&&u.original.length>0&&([P,O]=lde(I,u)),typeof P!="number")continue;typeof L=="number"&&(L+=P)}}const F=y.tags&&y.tags.indexOf(1)>=0;p.push({index:b,kind:y.kind,score:L,label:S,ariaLabel:Yor(y.name,y.kind),description:I,highlights:F?void 0:{label:N,description:O},range:{selection:ie.collapseToStart(y.selectionRange),decoration:y.range},uri:s.uri,symbolName:C,strikethrough:F,buttons:d})}const g=p.sort((b,y)=>a?this.compareByKindAndScore(b,y):this.compareByScore(b,y));let m=[];if(a){let S=function(){y&&typeof b=="number"&&C>0&&(y.label=jL(ude[b]||cde,C))},b,y,C=0;for(const k of g)b!==k.kind?(S(),b=k.kind,C=1,y={type:"separator"},m.push(y)):C++,m.push(k);S()}else g.length>0&&(m=[{label:A("symbols","symbols ({0})",p.length),type:"separator"},...g]);return m}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=ude[e.kind]||cde,r=ude[t.kind]||cde,s=i.localeCompare(r);return s===0?this.compareByScore(e,t):s}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},jU=ub,ub.PREFIX="@",ub.SCOPE_PREFIX=":",ub.PREFIX_BY_CATEGORY=`${ub.PREFIX}${ub.SCOPE_PREFIX}`,ub);yI=jU=M4r([aVe(0,Fn),aVe(1,k$)],yI);const cde=A("property","properties ({0})"),ude={5:A("method","methods ({0})"),11:A("function","functions ({0})"),8:A("_constructor","constructors ({0})"),12:A("variable","variables ({0})"),4:A("class","classes ({0})"),22:A("struct","structs ({0})"),23:A("event","events ({0})"),24:A("operator","operators ({0})"),10:A("interface","interfaces ({0})"),2:A("namespace","namespaces ({0})"),3:A("package","packages ({0})"),25:A("typeParameter","type parameters ({0})"),1:A("modules","modules ({0})"),6:A("property","properties ({0})"),9:A("enum","enumerations ({0})"),21:A("enumMember","enumeration members ({0})"),14:A("string","strings ({0})"),0:A("file","files ({0})"),17:A("array","arrays ({0})"),15:A("number","numbers ({0})"),16:A("boolean","booleans ({0})"),18:A("object","objects ({0})"),19:A("key","keys ({0})"),7:A("field","fields ({0})"),13:A("constant","constants ({0})")};var j4r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},dde=function(n,e){return function(t,i){e(t,i,n)}};let O1e=class extends yI{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=rn.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};O1e=j4r([dde(0,Cs),dde(1,Fn),dde(2,k$)],O1e);const sZ=class sZ extends In{constructor(){super({id:sZ.ID,label:I7.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:me.hasDocumentSymbolProvider,kbOpts:{kbExpr:me.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Ym).quickAccess.show(yI.PREFIX,{itemActivation:tb.NONE})}};sZ.ID="editor.action.quickOutline";let SQ=sZ;zt(SQ);Ca.as(UA.Quickaccess).registerQuickAccessProvider({ctor:O1e,prefix:yI.PREFIX,helpEntries:[{description:I7.quickOutlineActionLabel,prefix:yI.PREFIX,commandId:SQ.ID},{description:I7.quickOutlineByCategoryActionLabel,prefix:yI.PREFIX_BY_CATEGORY}]});function F4r(n){const e=new Map;for(const t of n)e.set(t,(e.get(t)??0)+1);return e}class P6{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),r=new Map,s=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,r);c>0&&s.push({key:o,score:c})}}return s}static termFrequencies(e){return F4r(P6.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const r=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(r.length>1)for(const s of r)s.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(s)&&(yield t(s))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const r of t.textChunks){const s=P6.termFrequencies(r);for(const o of s.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);i.push({text:r,tf:s})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}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 s=this.chunkOccurrences.get(r);if(typeof s=="number"){const o=s-1;o<=0?this.chunkOccurrences.delete(r):this.chunkOccurrences.set(r,o)}}}}computeSimilarityScore(e,t,i){let r=0;for(const[s,o]of Object.entries(t)){const a=e.tf.get(s);if(!a)continue;let l=i.get(s);typeof l!="number"&&(l=this.computeIdf(s),i.set(s,l));const c=a*l;r+=c*o}return r}computeEmbedding(e){const t=P6.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,r]of e){const s=this.computeIdf(i);s>0&&(t[i]=r*s)}return t}}function B4r(n){var i;const e=n.slice(0);e.sort((r,s)=>s.score-r.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const r of e)r.score/=t;return e}var QR;(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"})(QR||(QR={}));function hde(n){const e=n;return Array.isArray(e.items)}function lVe(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class $4r extends Ye{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var c;const r=new Et;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const o=r.add(new Dc),a=async()=>{var _;const u=o.value=new Et;s==null||s.dispose(!0),e.busy=!1,s=new ba(t);const d=s.token;let f=e.value.substring(this.prefix.length);(_=this.options)!=null&&_.shouldSkipTrimPickFilter||(f=f.trim());const p=this._getPicks(f,u,d,i),g=(v,b)=>{var S;let y,C;if(hde(v)?(y=v.items,C=v.active):y=v,y.length===0){if(b)return!1;(f.length>0||e.hideInput)&&((S=this.options)!=null&&S.noResultsPick)&&(J8(this.options.noResultsPick)?y=[this.options.noResultsPick(f)]:y=[this.options.noResultsPick])}return e.items=y,C&&(e.activeItems=[C]),!0},m=async v=>{let b=!1,y=!1;await Promise.all([(async()=>{typeof v.mergeDelay=="number"&&(await Nw(v.mergeDelay),d.isCancellationRequested)||y||(b=g(v.picks,!0))})(),(async()=>{e.busy=!0;try{const C=await v.additionalPicks;if(d.isCancellationRequested)return;let S,k;hde(v.picks)?(S=v.picks.items,k=v.picks.active):S=v.picks;let I,L;if(hde(C)?(I=C.items,L=C.active):I=C,I.length>0||!b){let N;if(!k&&!L){const P=e.activeItems[0];P&&S.indexOf(P)!==-1&&(N=P)}g({items:[...S,...I],active:k||L||N})}}finally{d.isCancellationRequested||(e.busy=!1),y=!0}})()])};if(p!==null)if(lVe(p))await m(p);else if(!(p instanceof Promise))g(p);else{e.busy=!0;try{const v=await p;if(d.isCancellationRequested)return;lVe(v)?await m(v):g(v)}finally{d.isCancellationRequested||(e.busy=!1)}}};r.add(e.onDidChangeValue(()=>a())),a(),r.add(e.onDidAccept(u=>{var f;if(i!=null&&i.handleAccept){u.inBackground||e.hide(),(f=i.handleAccept)==null||f.call(i,e.activeItems[0]);return}const[d]=e.selectedItems;typeof(d==null?void 0:d.accept)=="function"&&(u.inBackground||e.hide(),d.accept(e.keyMods,u))}));const l=async(u,d)=>{var p;if(typeof d.trigger!="function")return;const f=((p=d.buttons)==null?void 0:p.indexOf(u))??-1;if(f>=0){const g=d.trigger(f,e.keyMods),m=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(m){case QR.NO_ACTION:break;case QR.CLOSE_PICKER:e.hide();break;case QR.REFRESH_PICKER:a();break;case QR.REMOVE_ITEM:{const _=e.items.indexOf(d);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),y=e.activeItems.filter(S=>S!==b[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,y&&(e.activeItems=y),e.keepScrollPosition=C}break}}}};return r.add(e.onDidTriggerItemButton(({button:u,item:d})=>l(u,d))),r.add(e.onDidTriggerSeparatorButton(({button:u,separator:d})=>l(u,d))),r}}var Dpt=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},LS=function(n,e){return function(t,i){e(t,i,n)}},h2,ec,Cy;let M1e=(Cy=class extends $4r{constructor(e,t,i,r,s,o){super(h2.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=r,this.telemetryService=s,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(j1e)),this.options=e}async _getPicks(e,t,i,r){var p,g;const s=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const o=qE(()=>{const m=new P6;m.updateDocuments(s.map(v=>({key:v.commandId,textChunks:[this.getTfIdfChunk(v)]})));const _=m.calculateScores(e,i);return B4r(_).filter(v=>v.score>h2.TFIDF_THRESHOLD).slice(0,h2.TFIDF_MAX_RESULTS)}),a=[];for(const m of s){const _=h2.WORD_FILTER(e,m.label)??void 0,v=m.commandAlias?h2.WORD_FILTER(e,m.commandAlias)??void 0:void 0;if(_||v)m.highlights={label:_,detail:this.options.showAlias?v:void 0},a.push(m);else if(e===m.commandId)a.push(m);else if(e.length>=3){const b=o();if(i.isCancellationRequested)return[];const y=b.find(C=>C.key===m.commandId);y&&(m.tfIdfScore=y.score,a.push(m))}}const l=new Map;for(const m of a){const _=l.get(m.label);_?(m.description=m.commandId,_.description=_.commandId):l.set(m.label,m)}a.sort((m,_)=>{if(m.tfIdfScore&&_.tfIdfScore)return m.tfIdfScore===_.tfIdfScore?m.label.localeCompare(_.label):_.tfIdfScore-m.tfIdfScore;if(m.tfIdfScore)return 1;if(_.tfIdfScore)return-1;const v=this.commandsHistory.peek(m.commandId),b=this.commandsHistory.peek(_.commandId);if(v&&b)return v>b?-1:1;if(v)return-1;if(b)return 1;if(this.options.suggestedCommandIds){const y=this.options.suggestedCommandIds.has(m.commandId),C=this.options.suggestedCommandIds.has(_.commandId);if(y&&C)return 0;if(y)return-1;if(C)return 1}return m.label.localeCompare(_.label)});const c=[];let u=!1,d=!0,f=!!this.options.suggestedCommandIds;for(let m=0;m<a.length;m++){const _=a[m];m===0&&this.commandsHistory.peek(_.commandId)&&(c.push({type:"separator",label:A("recentlyUsed","recently used")}),u=!0),d&&_.tfIdfScore!==void 0&&(c.push({type:"separator",label:A("suggested","similar commands")}),d=!1),f&&_.tfIdfScore===void 0&&!this.commandsHistory.peek(_.commandId)&&((p=this.options.suggestedCommandIds)!=null&&p.has(_.commandId))&&(c.push({type:"separator",label:A("commonlyUsed","commonly used")}),u=!0,f=!1),u&&_.tfIdfScore===void 0&&!this.commandsHistory.peek(_.commandId)&&!((g=this.options.suggestedCommandIds)!=null&&g.has(_.commandId))&&(c.push({type:"separator",label:A("morecCommands","other commands")}),u=!1),c.push(this.toCommandPick(_,r))}return this.hasAdditionalCommandPicks(e,i)?{picks:c,additionalPicks:(async()=>{var v;const m=await this.getAdditionalCommandPicks(s,a,e,i);if(i.isCancellationRequested)return[];const _=m.map(b=>this.toCommandPick(b,r));return d&&((v=_[0])==null?void 0:v.type)!=="separator"&&_.unshift({type:"separator",label:A("suggested","similar commands")}),_})()}:c}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),r=i?A("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(s=e.args)!=null&&s.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){Km(o)||this.dialogService.error(A("canNotRun","Command '{0}' resulted in an error",e.label),AY(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let r=e;return t&&t!==e&&(r+=` - ${t}`),i&&i.value!==e&&(r+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),r}},h2=Cy,Cy.PREFIX=">",Cy.TFIDF_THRESHOLD=.5,Cy.TFIDF_MAX_RESULTS=5,Cy.WORD_FILTER=rTe(S7,gpr,Elt),Cy);M1e=h2=Dpt([LS(1,mi),LS(2,Ws),LS(3,Fo),LS(4,md),LS(5,Q9)],M1e);var db;let j1e=(db=class extends Ye{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===D7.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=ec.getConfiguredCommandHistoryLength(this.configurationService),ec.cache&&ec.cache.limit!==this.configuredCommandsHistoryLength&&(ec.cache.limit=this.configuredCommandsHistoryLength,ec.hasChanges=!0))}load(){const e=this.storageService.get(ec.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(r){this.logService.error(`[CommandsHistory] invalid data: ${r}`)}const i=ec.cache=new b1(this.configuredCommandsHistoryLength,1);if(t){let r;t.usesLRU?r=t.entries:r=t.entries.sort((s,o)=>s.value-o.value),r.forEach(s=>i.set(s.key,s.value))}ec.counter=this.storageService.getNumber(ec.PREF_KEY_COUNTER,0,ec.counter)}push(e){ec.cache&&(ec.cache.set(e,ec.counter++),ec.hasChanges=!0)}peek(e){var t;return(t=ec.cache)==null?void 0:t.peek(e)}saveState(){if(!ec.cache||!ec.hasChanges)return;const e={usesLRU:!0,entries:[]};ec.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(ec.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(ec.PREF_KEY_COUNTER,ec.counter,0,0),ec.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var r,s;const i=(s=(r=e.getValue().workbench)==null?void 0:r.commandPalette)==null?void 0:s.history;return typeof i=="number"?i:ec.DEFAULT_COMMANDS_HISTORY_LENGTH}},ec=db,db.DEFAULT_COMMANDS_HISTORY_LENGTH=50,db.PREF_KEY_CACHE="commandPalette.mru.cache",db.PREF_KEY_COUNTER="commandPalette.mru.counter",db.counter=1,db.hasChanges=!1,db);j1e=ec=Dpt([LS(0,yv),LS(1,Dr),LS(2,Uu)],j1e);class H4r extends M1e{constructor(e,t,i,r,s,o){super(e,t,i,r,s,o)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const r of e.getSupportedActions()){let s;(i=r.metadata)!=null&&i.description&&(f_r(r.metadata.description)?s=r.metadata.description:s={original:r.metadata.description,value:r.metadata.description}),t.push({commandId:r.id,commandAlias:r.alias,commandDescription:s,label:uTe(r.label)||r.id})}return t}}var V4r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},YD=function(n,e){return function(t,i){e(t,i,n)}};let NB=class extends H4r{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,r,s,o){super({showAlias:!1},e,i,r,s,o),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};NB=V4r([YD(0,mi),YD(1,Cs),YD(2,Ws),YD(3,Fo),YD(4,md),YD(5,Q9)],NB);const oZ=class oZ extends In{constructor(){super({id:oZ.ID,label:vG.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:me.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ym).quickAccess.show(NB.PREFIX)}};oZ.ID="editor.action.quickCommand";let EQ=oZ;zt(EQ);Ca.as(UA.Quickaccess).registerQuickAccessProvider({ctor:NB,prefix:NB.PREFIX,helpEntries:[{description:vG.quickCommandHelp,commandId:EQ.ID}]});var W4r=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},QD=function(n,e){return function(t,i){e(t,i,n)}};let F1e=class extends sA{constructor(e,t,i,r,s,o,a){super(!0,e,t,i,r,s,o,a)}};F1e=W4r([QD(1,Oi),QD(2,Cs),QD(3,wl),QD(4,mi),QD(5,yv),QD(6,Dr)],F1e);cs(sA.ID,F1e,4);class z4r extends In{constructor(){super({id:"editor.action.toggleHighContrast",label:H_e.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Lg),r=i.getColorTheme();Ab(r.type)?(i.setTheme(this._originalThemeName||(cM(r.type)?zP:OC)),this._originalThemeName=null):(i.setTheme(cM(r.type)?gI:mI),this._originalThemeName=r.themeName)}}zt(z4r);const U4r=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Edt,Emitter:kdt,KeyCode:Tdt,KeyMod:Idt,MarkerSeverity:Rdt,MarkerTag:Pdt,Position:Ldt,Range:Adt,Selection:Ndt,SelectionDirection:Ddt,Token:Mdt,Uri:Odt,editor:jdt,languages:Fdt},Symbol.toStringTag,{value:"Module"}));function q4r(n){return new Worker("/editor.worker-oRlJJsnX.js",{name:n==null?void 0:n.name})}function K4r(n){return new Worker("/json.worker-BnUULff4.js",{name:n==null?void 0:n.name})}function G4r(n){return new Worker("/css.worker-DGFkc2qH.js",{name:n==null?void 0:n.name})}function Y4r(n){return new Worker("/html.worker-CltiozTZ.js",{name:n==null?void 0:n.name})}function Q4r(n){return new Worker("/ts.worker-Bd4z-OY3.js",{name:n==null?void 0:n.name})}JIn({dsn:void 0,integrations:[new $2n],tracesSampleRate:1});gf.use(fwt).init({resources:{en:{translation:Oir}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const X4r=bxt,Z4r=new VCt({defaultOptions:{queries:{retry:1}}});self.MonacoEnvironment={getWorker(n,e){return e==="json"?new K4r:e==="css"||e==="scss"||e==="less"?new G4r:e==="html"||e==="handlebars"||e==="razor"?new Y4r:e==="typescript"||e==="javascript"?new Q4r:new q4r}};Hee.config({monaco:U4r});Hee.init().then();const J4r=document.getElementById("root");nLn.createRoot(J4r).render(h.jsx(we.StrictMode,{children:h.jsx(KCt,{client:Z4r,children:h.jsx(SVe,{store:kO,children:h.jsx(Mir,{children:h.jsx(X4r,{children:h.jsx(eLn,{children:h.jsx(ZSn,{})})})})})})}));const B1e=jir();export{ii as $,YXt as A,as as B,er as C,eg as D,Dn as E,Z3r as F,HO as G,As as H,tvn as I,nvn as J,evn as K,vr as L,FQe as M,LQe as N,cCe as O,nn as P,v4 as Q,we as R,yo as S,nr as T,Xwn as U,zvt as V,m$ as W,nht as X,jo as Y,oo as Z,ts as _,xt as a,Ah as a$,nit as a0,tmn as a1,Ggn as a2,N4 as a3,Tn as a4,Si as a5,dr as a6,v5r as a7,Lh as a8,Yi as a9,Ki as aA,HZ as aB,hs as aC,Vr as aD,_Ue as aE,iwe as aF,FE as aG,Tee as aH,FZ as aI,vUe as aJ,k3r as aK,q3r as aL,mb as aM,swe as aN,Wnt as aO,j3r as aP,t4 as aQ,yu as aR,bu as aS,fc as aT,O3r as aU,L9 as aV,xk as aW,RA as aX,Sg as aY,Tc as aZ,ev as a_,xEe as aa,Is as ab,BZ as ac,pr as ad,dn as ae,Eee as af,See as ag,kee as ah,Nr as ai,Pb as aj,F_ as ak,LZ as al,IZ as am,jE as an,PQe as ao,go as ap,Yw as aq,l5r as ar,Vnt as as,Znt as at,Knt as au,qnt as av,Gw as aw,$n as ax,an as ay,$Z as az,lr as b,WQe as b$,Mb as b0,gu as b1,$t as b2,Cu as b3,Fr as b4,hv as b5,Bm as b6,lee as b7,uee as b8,cee as b9,Mmn as bA,Ihe as bB,jt as bC,x_n as bD,Kw as bE,_9 as bF,mvn as bG,l4 as bH,Um as bI,hA as bJ,$y as bK,H3e as bL,ji as bM,wu as bN,qB as bO,pd as bP,u1 as bQ,Lk as bR,Yl as bS,Ixe as bT,K5r as bU,wk as bV,Hm as bW,D1t as bX,k5r as bY,w5r as bZ,R5r as b_,wet as ba,c1 as bb,L8 as bc,VSe as bd,pn as be,pe as bf,iw as bg,rw as bh,r1 as bi,Ua as bj,MJ as bk,QQe as bl,A5r as bm,B1e as bn,o5r as bo,vS as bp,Ji as bq,F5r as br,Ls as bs,wee as bt,Vs as bu,m4 as bv,kUt as bw,Qb as bx,ne as by,Xpn as bz,b5r as c,z1n as c$,c5r as c0,Sk as c1,Tk as c2,tit as c3,Jnt as c4,qd as c5,Kl as c6,Lo as c7,oit as c8,Pnt as c9,dh as cA,Vy as cB,$u as cC,y3r as cD,d_n as cE,Wmn as cF,jC as cG,lw as cH,rE as cI,Omn as cJ,Qnt as cK,xDe as cL,To as cM,ypn as cN,gc as cO,w3r as cP,vEe as cQ,Lnt as cR,mbn as cS,NL as cT,r3r as cU,jvn as cV,Cee as cW,Wpn as cX,F1n as cY,H1n as cZ,$1n as c_,qmn as ca,nc as cb,r_n as cc,Uy as cd,Vw as ce,oJt as cf,lJt as cg,R3r as ch,gEe as ci,_5r as cj,Hxn as ck,KO as cl,aq as cm,uEe as cn,bEe as co,A9 as cp,Sze as cq,yEe as cr,TZ as cs,m5r as ct,DA as cu,Vd as cv,pgn as cw,lt as cx,Qs as cy,qo as cz,vf as d,t5r as d$,B1n as d0,cgn as d1,MKt as d2,wgn as d3,fgn as d4,ggn as d5,Y3r as d6,wxe as d7,T3r as d8,M3r as d9,d5r as dA,Pmn as dB,u5r as dC,lmn as dD,cmn as dE,Zgn as dF,Xgn as dG,twe as dH,rwe as dI,xee as dJ,q8 as dK,x4e as dL,Wm as dM,wg as dN,I3r as dO,XQe as dP,mUe as dQ,yUe as dR,PE as dS,wZ as dT,ySe as dU,Zd as dV,Eet as dW,C9 as dX,_4 as dY,Kpn as dZ,MO as d_,Kpe as da,E3r as db,Z_ as dc,O5t as dd,r5r as de,T5r as df,eit as dg,WLt as dh,x3r as di,ewe as dj,P_n as dk,Wp as dl,j_n as dm,Dnt as dn,Qgn as dp,L3r as dq,O5r as dr,svn as ds,S3r as dt,Ivn as du,H5r as dv,W5r as dw,Hvn as dx,U5r as dy,q5r as dz,ze as e,iit as e$,g5r as e0,Yit as e1,Xmn as e2,Jmn as e3,p5r as e4,Zmn as e5,Umn as e6,e_n as e7,n_n as e8,egn as e9,E5r as eA,x5r as eB,S5r as eC,Ygn as eD,Pvn as eE,V5r as eF,$vn as eG,Bvn as eH,hvn as eI,N9 as eJ,Lvn as eK,Svn as eL,_vn as eM,xvn as eN,j5r as eO,HC as eP,z3r as eQ,SO as eR,n5r as eS,jb as eT,M5r as eU,Rvn as eV,z5r as eW,B5r as eX,rit as eY,Tvn as eZ,kvn as e_,OE as ea,Iee as eb,V_n as ec,W_n as ed,lit as ee,$C as ef,I5r as eg,ovn as eh,rvn as ei,B_n as ej,XSn as ek,D5r as el,N5r as em,m_n as en,L5r as eo,P5r as ep,avn as eq,Dbn as er,cqe as es,fd as et,K3r as eu,Qzt as ev,F_n as ew,M_n as ex,D_n as ey,g_n as ez,Zc as f,D3r as f$,$5r as f0,wvn as f1,i5r as f2,h1 as f3,p1 as f4,_a as f5,f1 as f6,hc as f7,bs as f8,dv as f9,h5r as fA,xxe as fB,Jgn as fC,jpn as fD,uqe as fE,aJt as fF,w_ as fG,knt as fH,smn as fI,q_ as fJ,k_n as fK,E_n as fL,jmn as fM,f5r as fN,Kmn as fO,y5r as fP,a5r as fQ,mEe as fR,Bpn as fS,hEe as fT,N3r as fU,nTt as fV,MQe as fW,Mpn as fX,ahn as fY,Zzt as fZ,A3r as f_,lvn as fa,yvn as fb,zzt as fc,e5r as fd,J3r as fe,kxe as ff,C5r as fg,T_n as fh,Ymn as fi,oTt as fj,tTt as fk,OS as fl,$pn as fm,Fpn as fn,xu as fo,Nc as fp,gk as fq,zu as fr,rmn as fs,P3r as ft,Rnt as fu,Rmn as fv,Dmn as fw,NA as fx,AL as fy,s5r as fz,Ik as g,uTt as g0,bit as g1,el as g2,Sxe as g3,_f as g4,EA as g5,jKt as g6,cl as g7,ya as g8,Gb as g9,cn as ga,un as gb,xw as gc,Dze as gd,Uo as ge,Vrr as gf,ME as gg,pqt as gh,aqt as gi,uqt as gj,dqt as gk,gqt as gl,oqt as gm,fqt as gn,uUt as go,B5t as gp,xL as gq,G5r as gr,TV as gs,Jn as h,Ut as i,h as j,qm as k,so as l,C3r as m,hb as n,Cl as o,x as p,bJt as q,Je as r,G_n as s,zi as t,xe as u,b3r as v,Qo as w,qw as x,Ml as y,ql as z};
Copyright ©2021 || Defacer Indonesia